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 several ways. Canvas Prescribe commands create MedicationRequest resources, but these Prescribe commands are also represented as MedicationStatement resources. MedicationStatement resources that were created with a Prescribe command will contain a reference to the related MedicationRequest resource in the derivedFrom attribute.

MedicationStatement resources can also be created with the Medication Statement command. See our Zendesk article for more information.

Attributes

id
string

The identifier of the MedicationStatement

status
string

A code representing the patient or other source’s judgment about the state of the medication used that this statement is about

Supported codes for create interactions are: active, entered-in-error, stopped

medicationCodeableConcept
json

What medication was taken

subject
json

Who is/was taking the medication

context
json

Encounter / Episode associated with MedicationStatement

The context attribute is accepted by create and update interactions, but is not returned by read or search interactions.

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.

effectivePeriod
json

The interval when the medication is/was/will be taken

dateAsserted
datetime

When the statement was asserted

derivedFrom
array[json]

Additional supporting information

dosage
array[json]

Details of how medication is/was taken or should be taken

The text attribute for the Dosage object contains the SIG.

post
/MedicationStatement

MedicationStatement create

Create a MedicationStatement resource.

If context 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

id
string

The identifier of the MedicationStatement

status
string

A code representing the patient or other source’s judgment about the state of the medication used that this statement is about

Supported codes for create interactions are: active, entered-in-error, stopped

medicationCodeableConcept
json

What medication was taken

subject
json

Who is/was taking the medication

context
json

Encounter / Episode associated with MedicationStatement

The context attribute is accepted by create and update interactions, but is not returned by read or search interactions.

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.

effectivePeriod
json

The interval when the medication is/was/will be taken

dateAsserted
datetime

When the statement was asserted

derivedFrom
array[json]

Additional supporting information

dosage
array[json]

Details of how medication is/was taken or should be taken

The text attribute for the Dosage object contains the SIG.

Responses

201 Created
The server has successfully processed the request, the new resource has been created and is now ready for interaction.

Errors

400 Bad Request
The request was invalid or cannot be otherwise served. An accompanying error message will explain further.
401 Unauthorized
The request requires user authentication.
403 Forbidden
The request requires user authorization.
405 Method Not Allowed
The request performs an operation that is either not supported or allowed.
422 Unprocessable Entity
The request cannot be processed due to semantic issues or conflicts with the database state.
get
/MedicationStatement/{id}

MedicationStatement read

Read an MedicationStatement resource.

Read responses will always contain a medicationCodeableConcept regardless of what was used to create the MedicationStatement.

Path Parameters

id required
string
The unique identifier for the MedicationStatement

Responses

200 OK
Request was successful.

Errors

401 Unauthorized
The request requires user authentication.
403 Forbidden
The request requires user authorization.
404 Not Found
The requested resource was not found.
put
/MedicationStatement/{id}

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

id
string

The identifier of the MedicationStatement

status
string

A code representing the patient or other source’s judgment about the state of the medication used that this statement is about

Supported codes for create interactions are: active, entered-in-error, stopped

medicationCodeableConcept
json

What medication was taken

subject
json

Who is/was taking the medication

context
json

Encounter / Episode associated with MedicationStatement

The context attribute is accepted by create and update interactions, but is not returned by read or search interactions.

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.

effectivePeriod
json

The interval when the medication is/was/will be taken

dateAsserted
datetime

When the statement was asserted

derivedFrom
array[json]

Additional supporting information

dosage
array[json]

Details of how medication is/was taken or should be taken

The text attribute for the Dosage object contains the SIG.

Responses

200 OK
Request was successful.

Errors

400 Bad Request
The request was invalid or cannot be otherwise served. An accompanying error message will explain further.
401 Unauthorized
The request requires user authentication.
403 Forbidden
The request requires user authorization.
404 Not Found
The requested resource was not found.
405 Method Not Allowed
The request performs an operation that is either not supported or allowed.
412 Precondition Failed
The request depends on a precondition that has not been met.
422 Unprocessable Entity
The request cannot be processed due to semantic issues or conflicts with the database state.

Query Parameters

_id
string

The identifier of the MedicationStatement

patient
string

Returns statements for a specific patient

Responses

200 OK
Request was successful.

Errors

400 Bad Request
The request was invalid or cannot be otherwise served. An accompanying error message will explain further.
401 Unauthorized
The request requires user authentication.
403 Forbidden
The request requires user authorization.
  • 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",
        "status": "active",
        "medicationReference": {
            "reference": "Medication/fdb-449732",
            "display": "Tylenol PM Extra Strength 25 mg-500 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",
        "status": "active",
        "medicationReference": {
            "reference": "Medication/fdb-449732",
            "display": "Tylenol PM Extra Strength 25 mg-500 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",
        "status": "active",
        "medicationReference": {
            "reference": "Medication/fdb-449732",
            "display": "Tylenol PM Extra Strength 25 mg-500 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",
        "status": "entered-in-error",
        "medicationReference": {
            "reference": "Medication/fdb-449732",
            "display": "Tylenol PM Extra Strength 25 mg-500 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",
        "status": "entered-in-error",
        "medicationReference": {
            "reference": "Medication/fdb-449732",
            "display": "Tylenol PM Extra Strength 25 mg-500 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",
                    "status": "active",
                    "medicationReference": {
                        "reference": "Medication/fdb-449732",
                        "display": "Tylenol PM Extra Strength 25 mg-500 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"
          }
        }
      ]
    }