FHIR R4 Medication API

FHIR R4 Medication API

Add ?format=fhir to a drug fetch and the API returns a FHIR R4 Medication resource instead of the native shape — ready to drop into an EHR, a CDS-Hooks service, or any HL7-aware pipeline. No mapping layer on your side.

Every market identifier we hold is mapped to its correct FHIR home. Codes with a recognised codesystem (ATC at http://www.whocc.no/atc, GTIN, NDC, PZN, CIP13, dm+d AMPP-ID) become code.coding[] entries; Pharmacode and Swissmedic-No become identifier[] entries. Swiss dispensing category and BAG-SL reimbursement ride along as typed extensions.

GET /v1/drugs/:id?format=fhir
curl 'https://drug-database.com/v1/drugs/\
3f8a1c2d-1b4e-4c7a-9d2f-0a1b2c3d4e5f?format=fhir' \
  -H 'Authorization: Bearer ms_live_…'
response — trimmed
{
  "resourceType": "Medication",
  "id": "3f8a1c2d-1b4e-4c7a-9d2f-0a1b2c3d4e5f",
  "meta": {
    "source": "drug-database:drug/3f8a1c2d-…",
    "profile": ["http://hl7.org/fhir/StructureDefinition/Medication"]
  },
  "status": "active",
  "code": {
    "text": "Aspirin Cardio 100 mg",
    "coding": [
      { "system": "http://www.whocc.no/atc", "code": "B01AC06",
        "display": "Aspirin Cardio 100 mg" },
      { "system": "https://www.gs1.org/gtin", "code": "7680651870019",
        "display": "Aspirin Cardio 100 mg" }
    ]
  },
  "identifier": [
    { "system": "https://swissmedic.ch/swissmedic-no",
      "value": "65187", "use": "official" },
    { "system": "https://www.refdata.ch/pharmacode",
      "value": "1234567", "use": "secondary" }
  ],
  "manufacturer": { "display": "Bayer (Schweiz) AG" },
  "extension": [
    { "url": "…/swissmedic-dispensing-category", "valueCode": "B" },
    { "url": "…/bag-sl-reimbursed", "valueBoolean": true }
  ]
}

What you get

Standard R4 Medication

Validates against the base HL7 Medication profile — no proprietary resourceType.

Correct code/identifier split

Public codesystems in coding[], jurisdiction-internal codes in identifier[], each with its system URI.

Swiss fields as extensions

Dispensing category and BAG-SL reimbursement carried as typed extensions, not stuffed into core fields.

Frequently asked

Which FHIR version?

FHIR R4. The resource declares the base http://hl7.org/fhir/StructureDefinition/Medication profile and validates as a standard Medication resource.

How are codes split between coding[] and identifier[]?

Codes with a recognised public codesystem URI — ATC, GTIN, NDC, PZN, CIP13, dm+d AMPP-ID — go into code.coding[]. Jurisdiction-internal identifiers like Pharmacode and Swissmedic-No go into identifier[] with their de-facto system URIs.

What about Swiss-specific fields?

Swissmedic dispensing category (A–E) and BAG-SL reimbursement status are carried as typed FHIR extensions, so they round-trip without polluting the standard fields.

Start free — 100 requests/day

Free tier: 100 requests/day, no card. The FHIR response is ETag-cached and revalidatable via the changes feed — see the docs for the full coding-system URI table.