Skip to main content
The MedicationRequest resource represents an order or request for medication. All requests must reference a valid Patient.

Endpoints

Create MedicationRequest

Requires admin or practitioner role.
POST /api/fhir/MedicationRequest
Authorization: Bearer {token}
Content-Type: application/json
resourceType
string
required
Must be "MedicationRequest"
status
string
required
active, on-hold, cancelled, completed, entered-in-error, stopped, draft, unknown
intent
string
required
proposal, plan, order, original-order, reflex-order, filler-order, instance-order, option
medicationCodeableConcept
object
required
Medication being requested (RxNorm code)
subject
object
required
Reference to Patient: {"reference": "Patient/{id}"}
authoredOn
string
When the request was initially created
dosageInstruction
array
How the medication should be taken
dispenseRequest
object
Medication supply authorization

Example Request

cURL
curl -X POST https://api.example.com/api/fhir/MedicationRequest \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "resourceType": "MedicationRequest",
    "status": "active",
    "intent": "order",
    "medicationCodeableConcept": {
      "coding": [{
        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
        "code": "197361",
        "display": "Lisinopril 10 MG Oral Tablet"
      }]
    },
    "subject": {
      "reference": "Patient/65f1234567890abcdef12345"
    },
    "authoredOn": "2024-03-15T10:00:00Z",
    "dosageInstruction": [{
      "text": "Take one tablet daily",
      "timing": {
        "repeat": {
          "frequency": 1,
          "period": 1,
          "periodUnit": "d"
        }
      },
      "route": {
        "coding": [{
          "system": "http://snomed.info/sct",
          "code": "26643006",
          "display": "Oral route"
        }]
      },
      "doseAndRate": [{
        "doseQuantity": {
          "value": 10,
          "unit": "mg",
          "system": "http://unitsofmeasure.org",
          "code": "mg"
        }
      }]
    }],
    "dispenseRequest": {
      "numberOfRepeatsAllowed": 3,
      "quantity": {
        "value": 30,
        "unit": "tablets",
        "system": "http://unitsofmeasure.org",
        "code": "{tablets}"
      },
      "expectedSupplyDuration": {
        "value": 30,
        "unit": "days",
        "system": "http://unitsofmeasure.org",
        "code": "d"
      }
    }
  }'

Response

{
  "resourceType": "MedicationRequest",
  "id": "65f5678901234abcdef56789",
  "status": "active",
  "intent": "order",
  "medicationCodeableConcept": {
    "coding": [{
      "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
      "code": "197361",
      "display": "Lisinopril 10 MG Oral Tablet"
    }]
  },
  "subject": {
    "reference": "Patient/65f1234567890abcdef12345"
  },
  "authoredOn": "2024-03-15T10:00:00Z"
}

List MedicationRequests

GET /api/fhir/MedicationRequest
Authorization: Bearer {token}
subject
string
Filter by patient: Patient/{id}
status
string
Filter by status

Get MedicationRequest by ID

GET /api/fhir/MedicationRequest/:id
Authorization: Bearer {token}

Update MedicationRequest

PUT /api/fhir/MedicationRequest/:id
Authorization: Bearer {token}
Content-Type: application/json

Medication Status Workflow

1

Draft

Initial creation, not yet finalized
2

Active

Medication is currently being taken
3

Completed

Medication course is finished

Role Permissions

RoleCreateReadUpdate
Admin
Practitioner
Auditor

Build docs developers (and LLMs) love