01 · Standard
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 } ]}
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
How it works
From record to FHIR resource
Find the record
Search or look up a pack code to get the record id — the same id serves both shapes.
Ask for FHIR
Append ?format=fhir to GET /v1/drugs/{id}. Same key, same scope, same cache headers.
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.
02 · Mapping
Codes vs identifiers
03 · Extensions
Swiss fields, typed
04 · Drop-in
One query parameter
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.
curl 'https://drug-database.com/v1/drugs/\
3f8a1c2d-…?format=fhir' \
-H 'Authorization: Bearer dd_live_…'{
"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 }
]
}Which FHIR version is supported?
How are codes split between code.coding and identifier?
How are Swiss-specific fields represented?
Is there a separate FHIR endpoint?
Do you run a full FHIR server?
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