MedicationRequest

An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called “MedicationRequest” rather than “MedicationPrescription” or “MedicationOrder” to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.

http://hl7.org/fhir/us/core/STU3.1.1/StructureDefinition-us-core-medicationrequest.html

FHIR MedicationRequests maps to the Prescribe and Refill commands in Canvas. Any adjustments made with the Adjust Prescription command will appear in MedicationRequest API responses.

Attributes

id
string

The identifier of the MedicationRequest

status
string

A code specifying the current state of the order. Generally, this will be active or completed state

intent
string

Whether the request is a proposal, plan, or an original order

reportedBoolean
boolean

Indicates if this record was captured as a secondary ‘reported’ record rather than as an original primary source-of-truth record

medicationCodeableConcept
json

Identifies the medication being requested. This is simply an attribute carrying a code that identifies the medication from a known list of medications.

subject
json

Who or group medication request is for

encounter
json

Encounter created as part of encounter/admission/stay

authoredOn
datetime

When request was initially authored

requester
json

Who/What requested the Request

performer [deprecated]
json

Intended performer of administration

This attribute is deprecated and will be removed in a future release. It currently (and incorrectly) contains information about the dispenser of the medication. Canvas recommends disregarding this attribute. Information about the dispenser can be obtained from the performer attribute under dispenseRequest.

reasonCode
array[json]

Reason or indication for ordering or not ordering the medication

note
array[json]

Information about the prescription

dosageInstruction
array[json]

How the medication should be taken

dispenseRequest
json

Medication supply authorization

substitution
json

Any restrictions on medication substitution

get
/MedicationRequest/{id}

MedicationRequest read

Read a MedicationRequest resource.

Path Parameters

id required
string
The unique identifier for the MedicationRequest

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.

Query Parameters

_id
string

The identifier of the MedicationRequest

intent
string

Returns prescriptions with different intents

Supported codes for search interactions: order, filler-order

patient
string

Returns prescriptions for a specific patient

status
string

Status of the prescription

Supported codes for search interactions: active, cancelled, entered-in-error, stopped

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 GET \
         --url 'https://fumage-example.canvasmedical.com/MedicationRequest/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/MedicationRequest/<id>"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>"
    }
    
    response = requests.get(url, headers=headers)
    
    print(response.text)
    
  • {
        "resourceType": "MedicationRequest",
        "id": "3423a69c-618d-4cbe-861a-54c60f48744e",
        "status": "active",
        "intent": "order",
        "reportedBoolean": false,
        "medicationCodeableConcept": {
            "coding": [
                {
                    "system": "http://www.fdbhealth.com/",
                    "code": "244899",
                    "display": "lisinopril 10 mg tablet"
                },
                {
                    "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
                    "code": "314076",
                    "display": "lisinopril 10 mg tablet"
                }
            ]
        },
        "subject": {
            "reference": "Patient/6cb2a409334943c2b48f1686dc739f11",
            "type": "Patient"
        },
        "encounter": {
            "reference": "Encounter/bdadce18-098b-40dc-8bdd-ef8481bd999a",
            "type": "Encounter"
        },
        "authoredOn": "2023-09-21T18:19:36.106449+00:00",
        "requester": {
            "reference": "Practitioner/6c20b7152cf7421791c5ab4113060b3f",
            "type": "Practitioner"
        },
        "reasonCode": [
            {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/sid/icd-10-cm",
                        "code": "I10",
                        "display": "Essential (primary) hypertension"
                    }
                ]
            }
        ],
        "dosageInstruction": [
            {
                "text": "take 1 daily",
                "doseAndRate": [
                    {
                        "doseQuantity": {
                            "unit": "Tablet"
                        }
                    }
                ]
            }
        ],
        "dispenseRequest": {
            "numberOfRepeatsAllowed": 3,
            "quantity": {
                "value": 30.0
            },
            "expectedSupplyDuration": {
                "value": 30,
                "unit": "days"
            },
            "performer": {
                "display": "Name: CVS Health #68534|NCPDP ID: 0068534|Address: 1 Cvs Dr, Woonsocket, RI, 028956146|Phone: 4017702500|Fax: 4017704486"
            }
        },
        "substitution": {
            "allowedBoolean": true
        }
    }
    
  • {
      "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 MedicationRequest resource 'a47c7b0e-bbb4-42cd-bc4a-df259d148ea1'"
          }
        }
      ]
    }
    
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/MedicationRequest?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/MedicationRequest?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": "/MedicationRequest?patient=Patient%2F6cb2a409334943c2b48f1686dc739f11&_count=10&_offset=0"
            },
            {
                "relation": "first",
                "url": "/MedicationRequest?patient=Patient%2F6cb2a409334943c2b48f1686dc739f11&_count=10&_offset=0"
            },
            {
                "relation": "last",
                "url": "/MedicationRequest?patient=Patient%2F6cb2a409334943c2b48f1686dc739f11&_count=10&_offset=0"
            }
        ],
        "entry": [
            {
                "resource": {
                    "resourceType": "MedicationRequest",
                    "id": "3423a69c-618d-4cbe-861a-54c60f48744e",
                    "status": "active",
                    "intent": "order",
                    "reportedBoolean": false,
                    "medicationCodeableConcept": {
                        "coding": [
                            {
                                "system": "http://www.fdbhealth.com/",
                                "code": "244899",
                                "display": "lisinopril 10 mg tablet"
                            },
                            {
                                "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
                                "code": "314076",
                                "display": "lisinopril 10 mg tablet"
                            }
                        ]
                    },
                    "subject": {
                        "reference": "Patient/6cb2a409334943c2b48f1686dc739f11",
                        "type": "Patient"
                    },
                    "encounter": {
                        "reference": "Encounter/bdadce18-098b-40dc-8bdd-ef8481bd999a",
                        "type": "Encounter"
                    },
                    "authoredOn": "2023-09-21T18:19:36.106449+00:00",
                    "requester": {
                        "reference": "Practitioner/6c20b7152cf7421791c5ab4113060b3f",
                        "type": "Practitioner"
                    },
                    "reasonCode": [
                        {
                            "coding": [
                                {
                                    "system": "http://hl7.org/fhir/sid/icd-10-cm",
                                    "code": "I10",
                                    "display": "Essential (primary) hypertension"
                                }
                            ]
                        }
                    ],
                    "dosageInstruction": [
                        {
                            "text": "take 1 daily",
                            "doseAndRate": [
                                {
                                    "doseQuantity": {
                                        "unit": "Tablet"
                                    }
                                }
                            ]
                        }
                    ],
                    "dispenseRequest": {
                        "numberOfRepeatsAllowed": 3,
                        "quantity": {
                            "value": 30.0
                        },
                        "expectedSupplyDuration": {
                            "value": 30,
                            "unit": "days"
                        },
                        "performer": {
                            "display": "Name: CVS Health #68534|NCPDP ID: 0068534|Address: 1 Cvs Dr, Woonsocket, RI, 028956146|Phone: 4017702500|Fax: 4017704486"
                        }
                    },
                    "substitution": {
                        "allowedBoolean": true
                    }
                }
            }
        ]
    }
    
  • {
      "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"
          }
        }
      ]
    }