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

post
/MedicationStatement

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

extension
array[json]

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.

Click to view child attributes
url
string required

Identifies the meaning of the extension

Value Options Supported:
  • http://schemas.canvasmedical.com/fhir/extensions/note-id
valueId
string required

The valueId field is used for the Note extension and will be the note’s unique identifier.

status
string required

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

Value Options Supported:
  • active
  • entered-in-error
  • stopped
medicationReference
json

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

Click to view child attributes
reference
string required

The reference string of the medication in the format of "Medication/fdb-449732"

display
string required

The display name of the medication

medicationCodeableConcept
json

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.

Click to view child attributes
system
string required

The url of the medication coding.

Value Options Supported:
  • http://www.nlm.nih.gov/research/umls/rxnorm
  • http://www.fdbhealth.com/
code
string required

The code value of the medication coding

display
string required

The display name of the medication

subject
json required

Who is/was taking the medication.

Click to view child attributes
reference
string required

The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"

type
string

Type the reference refers to (e.g. “Patient”)

context
json

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.

Click to view child attributes
reference
string required

The reference string of the encounter in the format of "Encounter/948b54e2-40b7-4648-bfce-e2373f9802af"

type
string

Type the reference refers to (e.g. “Encounter”)

effectivePeriod
json

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

Click to view child attributes
start
datetime

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.

end
datetime

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.

dosage
array[json]

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.

Click to view child attributes
text
string

The SIG of the medication

Responses

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

Canvas returns the created resource's id as a UUID within the location header and a null response body.

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

Response Payload Attributes

id
string

The identifier of the MedicationStatement.

extension
array[json]

Canvas supports a note identifier extension on this resource. The note identifier can be used with the Canvas Note API.

Click to view child attributes
url
string

Identifies the meaning of the extension

Value Options Supported:
  • http://schemas.canvasmedical.com/fhir/extensions/note-id
valueId
string

The valueId field is used for the Note extension and will be the note’s unique identifier.

status
string

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

Value Options Supported:
  • active
  • entered-in-error
  • stopped
  • intented (Medications where the effectivePeriod.start date is in the future)
medicationCodeableConcept
json

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)

Click to view child attributes
system
string

The url of the medication coding.

Value Options Supported:
  • http://www.nlm.nih.gov/research/umls/rxnorm
  • http://www.fdbhealth.com/
code
string

The code value of the medication coding

display
string

The display name of the medication

subject
json

Who is/was taking the medication.

Click to view child attributes
reference
string

The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"

type
string

Type the reference refers to (e.g. “Patient”)

effectivePeriod
json

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

Click to view child attributes
start
datetime

The datetime string represented the start time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

end
datetime

The datetime string represented the end time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

dateAsserted
datetime

When the statement was asserted. This is autogenerated on a create request as the timestamp of ingestion.

derivedFrom
array[json]

This will display if the medication was added to the Patient’s chart via a MedicationRequest (prescribe or refill command).

Click to view child attributes
reference
string

The reference string of the MedicationRequest in the format of "medicationReference/948b54e2-40b7-4648-bfce-e2373f9802af"

type
string

Type the reference refers to (e.g. “MedicationRequest”)

dosage
array[json]

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

The text attribute for the Dosage object contains the SIG.

Click to view child attributes
text
string

The SIG of the medication

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 required

The identifier of the MedicationStatement.

extension
array[json]

Canvas supports a note identifier extension on this resource. The note identifier can be used with the Canvas Note API.

Click to view child attributes
url
string required

Identifies the meaning of the extension

Value Options Supported:
  • http://schemas.canvasmedical.com/fhir/extensions/note-id
valueId
string required

The valueId field is used for the Note extension and will be the note’s unique identifier.

status
string required

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

Value Options Supported:
  • entered-in-error
medicationReference
json

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

Click to view child attributes
reference
string required

The reference string of the medication in the format of "Medication/fdb-449732"

display
string required

The display name of the medication

medicationCodeableConcept
json

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.

Click to view child attributes
system
string required

The url of the medication coding.

Value Options Supported:
  • http://www.nlm.nih.gov/research/umls/rxnorm
  • http://www.fdbhealth.com/
code
string required

The code value of the medication coding

display
string required

The display name of the medication

subject
json required

Who is/was taking the medication.

Click to view child attributes
reference
string required

The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"

type
string

Type the reference refers to (e.g. “Patient”)

context
json

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.

Click to view child attributes
reference
string required

The reference string of the encounter in the format of "Encounter/948b54e2-40b7-4648-bfce-e2373f9802af"

type
string

Type the reference refers to (e.g. “Encounter”)

effectivePeriod
json

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

Click to view child attributes
start
datetime

The datetime string represented the start time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

end
datetime

The datetime string represented the end time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

dosage
array[json]

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

The text attribute for the Dosage object contains the SIG.

Click to view child attributes
text
string

The SIG of the medication

Responses

200 OK
The server has successfully processed the request.

Canvas returns a null response body.

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

The patient reference associated to the Medication Statement in the format Patient/a39cafb9d1b445be95a2e2548e12a787.

Response Payload Attributes

resourceType
string

The FHIR Resource name.

type
string

This element and value designate that the bundle is a search response. Search result bundles will always have the Bundle.type of searchset .

total
integer

The number of resources that match the search parameter.

link
array[json]

Attributes relevant to pagination, see our Pagination page for more detail.

Click to view child attributes
relation
enum [self|first|next|last]

The relation of the page search

url

The search url for the specific relation

entry
array[json]

The results bundle that lists out each object returned in the search

Click to view child attributes
resource
json

The attributes specific to the resource type, see the Attributes section below

Attributes

id
string

The identifier of the MedicationStatement.

extension
array[json]

Canvas supports a note identifier extension on this resource. The note identifier can be used with the Canvas Note API.

Click to view child attributes
url
string

Identifies the meaning of the extension

Value Options Supported:
  • http://schemas.canvasmedical.com/fhir/extensions/note-id
valueId
string

The valueId field is used for the Note extension and will be the note’s unique identifier.

status
string

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

Value Options Supported:
  • active
  • entered-in-error
  • stopped
  • intented (Medications where the effectivePeriod.start date is in the future)
medicationCodeableConcept
json

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)

Click to view child attributes
system
string

The url of the medication coding.

Value Options Supported:
  • http://www.nlm.nih.gov/research/umls/rxnorm
  • http://www.fdbhealth.com/
code
string

The code value of the medication coding

display
string

The display name of the medication

subject
json

Who is/was taking the medication.

Click to view child attributes
reference
string

The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"

type
string

Type the reference refers to (e.g. “Patient”)

effectivePeriod
json

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

Click to view child attributes
start
datetime

The datetime string represented the start time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

end
datetime

The datetime string represented the end time of the medication in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

dateAsserted
datetime

When the statement was asserted. This is autogenerated on a create request as the timestamp of ingestion.

derivedFrom
array[json]

This will display if the medication was added to the Patient’s chart via a MedicationRequest (prescribe or refill command).

Click to view child attributes
reference
string

The reference string of the MedicationRequest in the format of "medicationReference/948b54e2-40b7-4648-bfce-e2373f9802af"

type
string

Type the reference refers to (e.g. “MedicationRequest”)

dosage
array[json]

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

The text attribute for the Dosage object contains the SIG.

Click to view child attributes
text
string

The SIG of the medication

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",
        "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"
          }
        }
      ]
    }