MedicationStatement
A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient’s memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains.
https://hl7.org/fhir/R4/medicationstatement.html
MedicationStatement resources can be created in two ways in the Canvas UI:
Prescribe commands create MedicationRequest resources, but these
Prescribe
commands are also represented as MedicationStatement resources. MedicationStatement resources that were created with aPrescribe
command will contain a reference to the related MedicationRequest resource in thederivedFrom
attribute.MedicationStatement resources can also be created with the Medication Statement command
MedicationStatement create
Create a MedicationStatement resource.
If context
or extension
is provided, the MedicationStatement will be added to the existing encounter (note). If it is not provided, a new data import note will be created.
Create requests support either medicationReference
or medicationCodeableConcept
in the request body; Canvas recommends using medicationReference
. Medication identifiers for medicationReference
can be obtained from the Medication search endpoint.
Attributes
Canvas supports a note identifier extension on this resource. The note identifier can be used with the Canvas Note API.
Canvas recommends sending the note identifier extension or the Encounter reference, but not both. If both are supplied, they must both refer to the same note. If neither is specified, it will insert into a Data Import note where the DOS is the current time of ingestion.
Identifies the meaning of the extension
The valueId field is used for the Note extension and will be the note’s unique identifier.
A code representing the patient or other source’s judgment about the state of the medication used that this statement is about.
What medication was taken.
Canvas recommends using a medicationReference on create/update to ensure a proper medication lookup is done on validation similar to our commands framework on the Canvas UI. Use the Medication search endpoint to help find the correct FDB ID.
A create/update requires either a medicationReference or medicationCodeableConcept when making a request
The reference string of the medication in the format of "Medication/fdb-449732"
The display name of the medication
What medication was taken.
Canvas recommends using a medicationReference on create/update; however on a Read/Search the medicationCodeableConcept will be returned to allow visibility into all the coding associated with the medication (e.g RxNorm, FDB)
A create/update requires either a medicationReference or medicationCodeableConcept when making a request.
The url of the medication coding.
The code value of the medication coding
The display name of the medication
Who is/was taking the medication.
The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"
Type the reference refers to (e.g. “Patient”)
Encounter / Episode associated with MedicationStatement.
Supply an encounter reference to be able to insert the command into a specific note on the patient’s timeline. If no encounter or note via the extension is specified, it will insert into a Data Import note where the DOS is the current time of ingestion.
Canvas does not currently support concurrent creation of resources on the same encounter. Please avoid issuing concurrent requests that reference the same encounter to this endpoint, or to any other endpoints that reference encounters. It is OK to issue concurrent requests to these endpoints as long as the requests reference different encounters.
The reference string of the encounter in the format of "Encounter/948b54e2-40b7-4648-bfce-e2373f9802af"
Type the reference refers to (e.g. “Encounter”)
The interval when the medication is/was/will be taken.
The datetime string represented the start time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00"
.
If omitted this will default to the current timestamp.
The datetime string represented the end time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00"
.
If omitted, this field will be left empty.
Details of how medication is/was taken or should be taken.
The text
attribute for the Dosage object contains the SIG.
Canvas will only ingest the first item in the dosage array.
The SIG of the medication
Responses
Canvas returns the created resource's id as a UUID within the
location
header and a null
response body.Errors
MedicationStatement read
Read an MedicationStatement resource.
Read responses will always contain a medicationCodeableConcept
regardless of what was used to create the MedicationStatement.
Path Parameters
Response Payload Attributes
The identifier of the MedicationStatement.
Canvas supports a note identifier extension on this resource. The note identifier can be used with the Canvas Note API.
Identifies the meaning of the extension
The valueId field is used for the Note extension and will be the note’s unique identifier.
A code representing the patient or other source’s judgment about the state of the medication used that this statement is about.
What medication was taken.
Canvas recommends using a medicationReference on create/update; however on a Read/Search the medicationCodeableConcept will be returned to allow visibility into all the coding associated with the medication (e.g RxNorm, FDB)
The url of the medication coding.
The code value of the medication coding
The display name of the medication
Who is/was taking the medication.
The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"
Type the reference refers to (e.g. “Patient”)
The interval when the medication is/was/will be taken.
The datetime string represented the start time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00"
.
The datetime string represented the end time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00"
.
When the statement was asserted. This is autogenerated on a create request as the timestamp of ingestion.
This will display if the medication was added to the Patient’s chart via a MedicationRequest (prescribe or refill command).
The reference string of the MedicationRequest in the format of "medicationReference/948b54e2-40b7-4648-bfce-e2373f9802af"
Type the reference refers to (e.g. “MedicationRequest”)
Details of how medication is/was taken or should be taken.
The text
attribute for the Dosage object contains the SIG.
The SIG of the medication
Responses
Errors
MedicationStatement update
Update an MedicationStatement resource.
The only type of MedicationStatement update interaction that is supported by Canvas is to mark an existing MedicationStatement as entered-in-error. No changes to other fields will be processed.
Attributes
The identifier of the MedicationStatement.
Canvas supports a note identifier extension on this resource. The note identifier can be used with the Canvas Note API.
Identifies the meaning of the extension
The valueId field is used for the Note extension and will be the note’s unique identifier.
A code representing the patient or other source’s judgment about the state of the medication used that this statement is about.
What medication was taken.
Canvas recommends using a medicationReference on create/update to ensure a proper medication lookup is done on validation similar to our commands framework on the Canvas UI. Use the Medication search endpoint to help find the correct FDB ID.
A create/update requires either a medicationReference or medicationCodeableConcept when making a request
The reference string of the medication in the format of "Medication/fdb-449732"
The display name of the medication
What medication was taken.
Canvas recommends using a medicationReference on create/update; however on a Read/Search the medicationCodeableConcept will be returned to allow visibility into all the coding associated with the medication (e.g RxNorm, FDB)
A create/update requires either a medicationReference or medicationCodeableConcept when making a request.
The url of the medication coding.
The code value of the medication coding
The display name of the medication
Who is/was taking the medication.
The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"
Type the reference refers to (e.g. “Patient”)
Encounter / Episode associated with MedicationStatement.
Supply an encounter reference to be able to insert the command into a specific note on the patient’s timeline. If no encounter or note via the extension is specified, it will insert into a Data Import note where the DOS is the current time of ingestion.
Canvas does not currently support concurrent creation of resources on the same encounter. Please avoid issuing concurrent requests that reference the same encounter to this endpoint, or to any other endpoints that reference encounters. It is OK to issue concurrent requests to these endpoints as long as the requests reference different encounters.
The reference string of the encounter in the format of "Encounter/948b54e2-40b7-4648-bfce-e2373f9802af"
Type the reference refers to (e.g. “Encounter”)
The interval when the medication is/was/will be taken.
The datetime string represented the start time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00"
.
The datetime string represented the end time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00"
.
Details of how medication is/was taken or should be taken.
The text
attribute for the Dosage object contains the SIG.
The SIG of the medication
Responses
Canvas returns a
null
response body.Errors
MedicationStatement search
Search for MedicationStatement resources.
Search bundle entries will always contain values for medicationCodeableConcept
regardless of what was used to create the MedicationStatement.
Query Parameters
The identifier of the MedicationStatement.
The patient reference associated to the Medication Statement in the format Patient/a39cafb9d1b445be95a2e2548e12a787
.
Response Payload Attributes
The FHIR Resource name.
This element and value designate that the bundle is a search response. Search result bundles will always have the Bundle.type of searchset .
The number of resources that match the search parameter.
Attributes relevant to pagination, see our Pagination page for more detail.
The relation of the page search
The search url for the specific relation
The results bundle that lists out each object returned in the search
The attributes specific to the resource type, see the Attributes section below
Attributes
The identifier of the MedicationStatement.
Canvas supports a note identifier extension on this resource. The note identifier can be used with the Canvas Note API.
Identifies the meaning of the extension
The valueId field is used for the Note extension and will be the note’s unique identifier.
A code representing the patient or other source’s judgment about the state of the medication used that this statement is about.
What medication was taken.
Canvas recommends using a medicationReference on create/update; however on a Read/Search the medicationCodeableConcept will be returned to allow visibility into all the coding associated with the medication (e.g RxNorm, FDB)
The url of the medication coding.
The code value of the medication coding
The display name of the medication
Who is/was taking the medication.
The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"
Type the reference refers to (e.g. “Patient”)
The interval when the medication is/was/will be taken.
The datetime string represented the start time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00"
.
The datetime string represented the end time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00"
.
When the statement was asserted. This is autogenerated on a create request as the timestamp of ingestion.
This will display if the medication was added to the Patient’s chart via a MedicationRequest (prescribe or refill command).
The reference string of the MedicationRequest in the format of "medicationReference/948b54e2-40b7-4648-bfce-e2373f9802af"
Type the reference refers to (e.g. “MedicationRequest”)
Details of how medication is/was taken or should be taken.
The text
attribute for the Dosage object contains the SIG.
The SIG of the medication
Responses
Errors
curl --request POST \ --url 'https://fumage-example.canvasmedical.com/MedicationStatement' \ --header 'Authorization: Bearer <token>' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data ' { "resourceType": "MedicationStatement", "extension": [ { "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id", "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5", } ], "status": "active", "medicationReference": { "reference": "Medication/fdb-259181", "display": "Advil 200 mg tablet" }, "subject": { "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0" }, "context": { "reference": "Encounter/eae3c8a5-a129-4960-9715-fc26da30eccc" }, "effectivePeriod": { "start": "2023-06-15T15:00:00-04:00", "end": "2023-06-25T15:00:00-04:00" }, "dosage": [ { "text": "1-2 tablets once daily at bedtime as needed for restless legs" } ] }'
import requests url = "https://fumage-example.canvasmedical.com/MedicationStatement" headers = { "accept": "application/json", "Authorization": "Bearer <token>", "content-type": "application/json" } payload = { "resourceType": "MedicationStatement", "extension": [ { "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id", "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5", } ], "status": "active", "medicationReference": { "reference": "Medication/fdb-259181", "display": "Advil 200 mg tablet" }, "subject": { "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0" }, "context": { "reference": "Encounter/eae3c8a5-a129-4960-9715-fc26da30eccc" }, "effectivePeriod": { "start": "2023-06-15T15:00:00-04:00", "end": "2023-06-25T15:00:00-04:00" }, "dosage": [ { "text": "1-2 tablets once daily at bedtime as needed for restless legs" } ] } response = requests.post(url, json=payload, headers=headers) print(response.text)
null
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "invalid", "details": { "text": "Bad request" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "unknown", "details": { "text": "Authentication failed" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "forbidden", "details": { "text": "Authorization failed" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "not-supported", "details": { "text": "Operation is not supported" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "business-rule", "details": { "text": "Unprocessable entity" } } ] }
curl --request GET \ --url 'https://fumage-example.canvasmedical.com/MedicationStatement/<id>' \ --header 'Authorization: Bearer <token>' \ --header 'accept: application/json'
import requests url = "https://fumage-example.canvasmedical.com/MedicationStatement/<id>" headers = { "accept": "application/json", "Authorization": "Bearer <token>" } response = requests.get(url, headers=headers) print(response.text)
{ "resourceType": "MedicationStatement", "id": "e76e44b4-4e68-4f72-b1c3-1de528a3bb2a", "status": "active", "medicationCodeableConcept": { "coding": [ { "system": "http://www.fdbhealth.com/", "code": "259181", "display": "Advil 200 mg tablet" }, { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "310965", "display": "Advil 200 mg tablet" } ] }, "subject": { "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0" }, "context": { "reference": "Encounter/eae3c8a5-a129-4960-9715-fc26da30eccc" }, "effectivePeriod": { "start": "2023-06-15T15:00:00-04:00", "end": "2023-06-25T15:00:00-04:00" }, "dosage": [ { "text": "1-2 tablets once daily at bedtime as needed for restless legs" } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "unknown", "details": { "text": "Authentication failed" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "forbidden", "details": { "text": "Authorization failed" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "not-found", "details": { "text": "Unknown MedicationStatement resource 'a47c7b0e-bbb4-42cd-bc4a-df259d148ea1'" } } ] }
curl --request PUT \ --url 'https://fumage-example.canvasmedical.com/MedicationStatement/<id>' \ --header 'Authorization: Bearer <token>' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data ' { "resourceType": "MedicationStatement", "extension": [ { "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id", "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5", } ], "status": "entered-in-error", "medicationReference": { "reference": "Medication/fdb-259181", "display": "Advil 200 mg tablet" }, "subject": { "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0" }, "context": { "reference": "Encounter/eae3c8a5-a129-4960-9715-fc26da30eccc" }, "effectivePeriod": { "start": "2023-06-15T15:00:00-04:00", "end": "2023-06-25T15:00:00-04:00" }, "dosage": [ { "text": "1-2 tablets once daily at bedtime as needed for restless legs" } ] }'
import requests url = "https://fumage-example.canvasmedical.com/MedicationStatement/<id>" headers = { "accept": "application/json", "Authorization": "Bearer <token>", "content-type": "application/json" } payload = { "resourceType": "MedicationStatement", "extension": [ { "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id", "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5", } ], "status": "entered-in-error", "medicationReference": { "reference": "Medication/fdb-259181", "display": "Advil 200 mg tablet" }, "subject": { "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0" }, "context": { "reference": "Encounter/eae3c8a5-a129-4960-9715-fc26da30eccc" }, "effectivePeriod": { "start": "2023-06-15T15:00:00-04:00", "end": "2023-06-25T15:00:00-04:00" }, "dosage": [ { "text": "1-2 tablets once daily at bedtime as needed for restless legs" } ] } response = requests.put(url, json=payload, headers=headers) print(response.text)
null
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "invalid", "details": { "text": "Bad request" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "unknown", "details": { "text": "Authentication failed" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "forbidden", "details": { "text": "Authorization failed" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "not-found", "details": { "text": "Unknown MedicationStatement resource 'a47c7b0e-bbb4-42cd-bc4a-df259d148ea1'" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "not-supported", "details": { "text": "Operation is not supported" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "conflict", "details": { "text": "Resource updated since If-Unmodified-Since date" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "business-rule", "details": { "text": "Unprocessable entity" } } ] }
curl --request GET \ --url 'https://fumage-example.canvasmedical.com/MedicationStatement?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0' \ --header 'Authorization: Bearer <token>' \ --header 'accept: application/json'
import requests url = "https://fumage-example.canvasmedical.com/MedicationStatement?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0" headers = { "accept": "application/json", "Authorization": "Bearer <token>" } response = requests.get(url, headers=headers) print(response.text)
{ "resourceType": "Bundle", "type": "searchset", "total": 1, "link": [ { "relation": "self", "url": "/MedicationStatement?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0&_count=10&_offset=0" }, { "relation": "first", "url": "/MedicationStatement?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0&_count=10&_offset=0" }, { "relation": "last", "url": "/MedicationStatement?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0&_count=10&_offset=0" } ], "entry": [ { "resource": { "resourceType": "MedicationStatement", "id": "e76e44b4-4e68-4f72-b1c3-1de528a3bb2a", "status": "active", "medicationCodeableConcept": { "coding": [ { "system": "http://www.fdbhealth.com/", "code": "259181", "display": "Advil 200 mg tablet" }, { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "310965", "display": "Advil 200 mg tablet" } ] }, "subject": { "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0" }, "context": { "reference": "Encounter/eae3c8a5-a129-4960-9715-fc26da30eccc" }, "effectivePeriod": { "start": "2023-06-15T15:00:00-04:00", "end": "2023-06-25T15:00:00-04:00" }, "dosage": [ { "text": "1-2 tablets once daily at bedtime as needed for restless legs" } ] } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "invalid", "details": { "text": "Bad request" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "unknown", "details": { "text": "Authentication failed" } } ] }
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "forbidden", "details": { "text": "Authorization failed" } } ] }