PUT api/Village/{village}/Medication/{id}

Update a medication. If the existing photos are being replaced, this method MUST be called with multipart/form-data encoding for the file

The request payload for the image MAY include a pill photo, which MUST have Content-Disposition and Content-Type headers. The 'name' in the Content-Disposition header MUST be "pillphoto":

  • Content-Disposition: form-data; name="pillphoto"; filename="whatever-you-want"
  • Content-Type: mime/type
The request payload for the image MAY include a label photo, which MUST have Content-Disposition and Content-Type headers. The 'name' in the Content-Disposition header MUST be "labelphoto":
  • Content-Disposition: form-data; name="labelphoto"; filename="whatever-you-want"
  • Content-Type: mime/type

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

globally unique identifier

Required

village

string

None.

Body Parameters

ApiEditMedicationModel
NameDescriptionTypeAdditional information
pillphoto

The pill photo

ApiFileUpload

None.

labelphoto

The label photo

ApiFileUpload

None.

RemovePillPhoto

If true and pillPhoto is null, remove the existing pill photo

boolean

None.

RemoveLabelPhoto

If true and labelPhoto is null, remove the existing label photo

boolean

None.

Id

Medication unique ID

globally unique identifier

None.

Name

Medication Name

string

Required

Form

Form of the medication (e.g. pill, tablet, capsule, etc.)

string

None.

StandardDosage

Standard dosage (from RXTerms API)

string

String length: inclusive between 0 and 255

CustomDosage

Custom dosage

string

String length: inclusive between 0 and 255

Frequency

Frequency (Legacy free text)

string

None.

Active

Whether or not this medication is currently being taken

boolean

None.

StartDate

Date the care recipient started taking the medication

date

Data type: Date

EndDate

Date the care recipient stopped taking or will stop taking the medication

date

Data type: Date

LastRefillDate

Date the medication was last filled

date

Data type: Date

RefillsRemaining

Number of refills remaining

integer

None.

Reason

Why the medication is being taken

string

None.

Notes

Additional notes

string

Data type: MultilineText

String length: inclusive between 0 and 2048

RXCUI

Unique ID for RX APIs

string

None.

LastUpdated

When the medication was last updated

date

None.

LastUpdatedBy

Who last updated the medication

string

None.

SendReminders

Whether or not to send reminders for missed(?) dosages

boolean

None.

MedicationFrequency

Frequency of dosages

MedicationFrequency

None.

DaysOfWeek

Which days of the week the medication is taken

Weekday

None.

NextDoseDate

The "next" dose date (if this is a date in the past, use it to calculate the next date)

date

None.

DailyFrequency

Daily frequency type

MedicationDailyFrequency

None.

DailyTimesValue

If DailyFrequency = TimesPerDay, DailyTimesValue = number of times. If DailyFrequency = XHours, DailyTimesValue = X

integer

None.

DoseTimes

; separated list of times when the doses are taken

string

None.

Request Formats

application/json, text/json

Sample:
{
  "pillphoto": null,
  "labelphoto": null,
  "RemovePillPhoto": true,
  "RemoveLabelPhoto": true,
  "Id": "a59df67c-da4b-4a7e-b38b-2c77c438d65c",
  "Name": "sample string 4",
  "Form": "sample string 5",
  "StandardDosage": "sample string 6",
  "CustomDosage": "sample string 7",
  "Frequency": "sample string 8",
  "Active": true,
  "StartDate": "2025-06-03T05:12:01.136+00:00",
  "EndDate": "2025-06-03T05:12:01.136+00:00",
  "LastRefillDate": "2025-06-03T05:12:01.136+00:00",
  "RefillsRemaining": 1,
  "Reason": "sample string 10",
  "Notes": "sample string 11",
  "RXCUI": "sample string 12",
  "LastUpdated": "2025-06-03T05:12:01.136+00:00",
  "LastUpdatedBy": "sample string 14",
  "SendReminders": true,
  "MedicationFrequency": 0,
  "DaysOfWeek": 1,
  "NextDoseDate": "2025-06-03T05:12:01.136+00:00",
  "DailyFrequency": 0,
  "DailyTimesValue": 1,
  "DoseTimes": "sample string 16"
}

application/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'application/xml'. Exception message: Type 'CaringVillage.API.Models.ApiFileUpload' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.

text/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'text/xml'. Exception message: Type 'CaringVillage.API.Models.ApiFileUpload' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.

multipart/form-data

Sample:

Failed to generate the sample for media type 'multipart/form-data'. Cannot use formatter 'MultipartMediaTypeFormatter' to write type 'ApiEditMedicationModel'.

Response Information

Resource Description

true if the medication was updated successfully

PrimitiveOfBoolean
NameDescriptionTypeAdditional information
value

boolean

Required

Response Formats

application/json, text/json

Sample:
{
  "value": true
}

application/xml, text/xml

Sample:
<PrimitiveOfboolean xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.API.Models">
  <value>true</value>
</PrimitiveOfboolean>