For developers · FHIR R4

Any medicine as a FHIR R4 Medication.

Add ?format=fhir to a drug fetch and get a FHIR R4 Medication resource — public code systems in code.coding, register numbers in identifier, Swiss dispensing and reimbursement as extensions.

GET /v1/drugs/{id}?format=fhir

Register row · CH

product_name
Atorvastax
atc_code
C10AA05
swissmedic_no
62613012
gtin
7680626130126
dispensing_cat
B
is_reimbursed
true

FHIR R4 · Medication

{  "resourceType": "Medication",  "id": "fe3c42ed-4213-42f8-a7fd-bdae3cfc2ce7",  "meta": {    "source": "drug-database:drug/fe3c42ed-4213-42f8-a7fd-bdae3cfc2ce7",    "profile": [      "http://hl7.org/fhir/StructureDefinition/Medication"    ]  },  "code": {    "coding": [      {        "system": "http://www.whocc.no/atc",        "code": "C10AA05",        "display": "Atorvastax"      },      {        "system": "https://www.gs1.org/gtin",        "code": "7680626130126",        "display": "Atorvastax"      }    ],    "text": "Atorvastax"  },  "status": "active",  "identifier": [    {      "system": "https://swissmedic.ch/swissmedic-no",      "value": "62613012",      "use": "official"    }  ],  "extension": [    {      "url": "https://drug-database.com/fhir/StructureDefinition/swissmedic-dispensing-category",      "valueCode": "B"    },    {      "url": "https://drug-database.com/fhir/StructureDefinition/bag-sl-reimbursed",      "valueBoolean": true    }  ]}
One real Swiss record and the Medication resource the API builds from it — generated here by the same mapper (lib/fhir.ts) the endpoint uses. Open the record

Codes and identifiers

Every pack code, in the right slot.

Codes from public code systems — GTIN, NDC, CIP13 — go into Medication.code.coding with their system URI; register-internal numbers go into identifier[]. A FHIR client matches on the code it already holds.

  • Valid R4 Medication, with the base profile declared in meta
  • The WHO ATC code as a coding, system http://www.whocc.no/atc
  • Swiss dispensing category and reimbursement as extensions
  • NDC (US)468,130
  • GTIN190,796
  • APB (BE)26,461
  • CIP13 (FR)21,191
  • RVG (NL)19,870
  • Varunummer (SE)19,208
  • Varenummer (DK)16,472
  • Código nacional (ES)15,523
  • Varenummer (NO)11,281
  • AIC (IT)10,979
  • PA number (IE)10,480
  • Merkevare id (NO)9,297
  • Kód SÚKL (CZ)8,848
  • Myyntilupa (FI)5,515
  • Vnr (IS)3,050
Pack codes on file per code system — each one lands in coding[] or identifier[] when a record is served as FHIR.

How it works

From record to FHIR resource

  1. Find the record

    Search or look up a pack code to get the record id — the same id serves both shapes.

  2. Ask for FHIR

    Append ?format=fhir to GET /v1/drugs/{id}. Same key, same scope, same cache headers.

  3. Hand it to your stack

    The response is a plain R4 Medication — no proprietary resourceType, no mapping layer on your side.

In detail

How a drug record maps to FHIR R4

The native drug record and the FHIR resource are two representations of the same row. With ?format=fhir the API returns a FHIR R4 Medication that declares the base http://hl7.org/fhir/StructureDefinition/Medication profile: the product name as code.text, the manufacturer as manufacturer.display and the record id as Medication.id.

Codes are placed where a FHIR client looks for them. Codes from systems with a recognised URI — ATC, GTIN, NDC, PZN, CIP13, Pharmacode, dm+d AMPP — become code.coding entries with their system URI. The register’s own authorisation number and national codes without a public URI become identifier entries, so nothing is lost and nothing is filed in the wrong slot.

01 · Standard

Plain R4 Medication

resourceType "Medication" with the base HL7 profile declared in meta.profile — readable by any R4 client without custom parsing.

02 · Mapping

Codes vs identifiers

Public code systems go into code.coding with their URI; register-internal numbers go into identifier, marked official or secondary.

03 · Extensions

Swiss fields, typed

The Swissmedic dispensing category (A–E) and BAG-SL reimbursement status ride as extensions — only on records where the register publishes them.

04 · Drop-in

One query parameter

No second endpoint and no second auth path: ?format=fhir on the record you already fetch, ETag-cached like the native shape.

Try it

A real call, end to end.

Append ?format=fhir to a drug fetch and receive a Medication resource with codes and identifiers in their FHIR homes.

Standards & mapping

  • FHIR R4, base HL7 Medication profile declared in meta.profile.
  • code.coding: ATC, GTIN, NDC, PZN, CIP13, Pharmacode and dm+d AMPP-ID, each with its system URI.
  • identifier: the register authorisation number, plus national codes without a public URI (urn:drug-database:<system>).
  • Reimbursement extensions only where a national list exists; never emitted for registers that publish none.
  • FHIR fetches need the drugs:read scope.
  • Medication is the only FHIR resource served today; there is no FHIR server, search or Bundle endpoint.
GET /v1/drugs/{id}?format=fhir
curl 'https://drug-database.com/v1/drugs/\
3f8a1c2d-…?format=fhir' \
  -H 'Authorization: Bearer dd_live_…'
response
{
  "resourceType": "Medication",
  "id": "3f8a1c2d-…",
  "meta": {
    "profile": ["http://hl7.org/fhir/StructureDefinition/Medication"]
  },
  "status": "active",
  "code": {
    "text": "Aspirin Cardio 100 mg",
    "coding": [
      { "system": "http://www.whocc.no/atc", "code": "B01AC06" },
      { "system": "https://www.gs1.org/gtin", "code": "7680…" },
      { "system": "https://www.refdata.ch/pharmacode", "code": "…" }
    ]
  },
  "identifier": [
    { "system": "https://swissmedic.ch/swissmedic-no", "value": "…", "use": "official" }
  ],
  "manufacturer": { "display": "Bayer (Schweiz) AG" },
  "extension": [
    { "url": "…/swissmedic-dispensing-category", "valueCode": "B" },
    { "url": "…/bag-sl-reimbursed", "valueBoolean": true }
  ]
}

FAQ

Questions about FHIR Medication

Which FHIR version is supported?
FHIR R4. The resource declares the base http://hl7.org/fhir/StructureDefinition/Medication profile in meta.profile.
How are codes split between code.coding and identifier?
Codes from systems with a recognised URI — ATC, GTIN, NDC, PZN, CIP13, Pharmacode and dm+d AMPP-ID — go into code.coding. The register authorisation number (for example the Swissmedic number) and national codes without a public URI go into identifier.
How are Swiss-specific fields represented?
The Swissmedic dispensing category (A–E) and BAG-SL reimbursement status are carried as extensions, and only on Swiss records. Other registers get a reimbursement extension only where they publish a national reimbursement list.
Is there a separate FHIR endpoint?
No. It is GET /v1/drugs/{id} with ?format=fhir — the same id, key and scope as the native record.
Do you run a full FHIR server?
No. Only the Medication resource is served, one record per request. There is no FHIR search, Bundle or other resource type today.

Ready when you are

Try fhir medication on real data.

Create a key in minutes. The free plan is enough to see real responses and judge the data; the paid plans are where you build.

Free to try · 10 lookups in total · No card required