Medication
Work with FHIR R4 4.0.1 Medication resources.
Choose an operation for this resource:
- Search Medication
- Read Medication
- Read Medication Version
- Create Medication
- Update Medication
- Delete Medication
- Hard Delete Medication
- Purge Deleted Medication
The diagram summarizes Medication requests and responses. See Supported FHIR REST Interactions for the shared interaction model.
FHIR R4 definition: https://hl7.org/fhir/R4/medication.html. See interaction response codes and common error responses.
Interactions and responses
- Resource lifecycle: create, read, versioned read, update, soft deletion and version preconditions.
- PUT-as-create and restoration: creation/restoration, server-managed metadata, response headers and return preferences.
- Interaction responses: success
statuscodes. - OperationOutcome errors: common errors and response bodies.
- Batch requests: independent entry processing.
| Medication capability | Support or requirement |
|---|---|
| Conditional create | Not supported. |
| Conditional update | Not supported. |
| Transaction bundles | Not supported. |
Search
- Search operation: endpoints, complete parameter table, supported forms and examples.
- Common Search Controls: shared controls and server-provided paging links.
- Value Types and Syntax and Comparators, Modifiers, and Chains: shared syntax. Use only the forms supported by this resource.
| Medication detail | Requirement or behavior |
|---|---|
| Token filters | Search matches top-level identifier, Medication code, _id, and _lastUpdated. |
| Token filters | Identifier and code each accept one unmodified token: value, system|value, |value (no system), or system|. |
| Limitations | Repeated tokens, comma alternatives, and token modifiers are unsupported and return 400. |
| Date filters | Up to two repeated _lastUpdated bounds are supported, using eq, ne, gt, lt, ge, le, sa, eb, or ap. |
| Limitations | Medication has no patient search. |
| Patient references | Patient-specific medication history belongs to MedicationStatement. |
| Limitations | Ingredient, manufacturer, chained, composite, and full-text searches are outside this resource's supported baseline. |
GET /api/fhir/r4/Medication?identifier=https%3A%2F%2Fexample.test%2Fmedications%7Cmed-001&code=http%3A%2F%2Fwww.nlm.nih.gov%2Fresearch%2Fumls%2Frxnorm%7C860975&_lastUpdated=ge2026-01-01&_lastUpdated=lt2027-01-01
Example resource
For shared validation-error responses, see OperationOutcome errors.
| Medication detail | Requirement or behavior |
|---|---|
| Status | Status, when present, is active, inactive, or entered-in-error. |
| Choice elements | Each ingredient requires exactly one itemCodeableConcept or itemReference. |
| References | Manufacturer references target Organization; ingredient references target Substance or Medication. |
| Contained resources | Contained references resolve in the entire container, including siblings and # back-references to an allowed container type. |
| References | A declared reference type must agree with the resolved target. |
| Contained resources | Narrative, extensions, modifier extensions, backbone IDs, primitive extensions, and supported contained resources are retained. |
| Limitations | Contained Substance ingredients are preserved; this does not add a standalone Substance endpoint. |
| Contained resources | Each contained member must be referenced or refer back to its container. |
| Contained resources | A contained Medication or Substance that refers back to its container may omit its ID; that absence is preserved in current and historical responses. |
| Resource rule | Empty batch elements are invalid; an extension-only batch is allowed. |
| Resource rule | Primitive metadata requires a lexical value or an extension; an ID alone does not supply a missing value. |
{"resourceType":"Medication","identifier":[{"system":"https://example.test/medications","value":"med-001"}],"code":{"coding":[{"system":"http://www.nlm.nih.gov/research/umls/rxnorm","code":"860975"}]},"status":"active","ingredient":[{"itemCodeableConcept":{"text":"Metformin hydrochloride"},"isActive":true}],"batch":{"lotNumber":"synthetic-lot","expirationDate":"2027-01-01"}}
Permissions and limits
- Authentication and Scopes: bearer tokens, scope configuration and constrained access. Required resource scopes are listed on each operation page.
- Data Deletion and Purge Operations: permanent-deletion eligibility and additional permissions.
- Hard Delete and Purge Deleted: resource endpoints and required scopes; see also shared purge guidance.
| Item | Requirement or behavior |
|---|---|
| Limitations | Conditional create, conditional update, and transaction bundles are not supported. |
| Limitations | R6 Medication is not supported. |