Skip to content

Commit d0806f2

Browse files
committed
added better medication
1 parent 299d22c commit d0806f2

5 files changed

Lines changed: 746 additions & 152 deletions

File tree

definitions/datasources/medications.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ medication:
1010
description: description
1111
valueFields:
1212
- label
13-
- code
14-
- system
15-
- source
13+
- description
14+
- ingredient
15+
- strength
16+
- doseForm
17+
- route
18+
- doseUnit
19+
- codes
1620
- hdsId
17-
- meta

definitions/eventTypes/eventTypes-hds.json

Lines changed: 208 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -83,58 +83,221 @@
8383
}
8484
},
8585
"medication/coded-v1": {
86-
"description": "Coded medication from external dataset with optional dosage and route metadata",
86+
"description": "Coded medication intake. 'drug' is the coded identity from datasets-service, 'intake' is the user-entered regimen. Maps to FHIR MedicationStatement: drug → medicationCodeableConcept, intake → dosage.",
8787
"type": "object",
88-
"required": ["label"],
88+
"required": ["drug"],
8989
"properties": {
90-
"label": {
91-
"description": "Localized medication name",
92-
"type": "object"
93-
},
94-
"codes": {
95-
"description": "Array of coding identifiers (ATC, RxNorm, etc.)",
96-
"type": "array",
97-
"items": {
98-
"type": "object",
99-
"required": ["code", "system"],
100-
"properties": {
101-
"code": {
102-
"description": "Code value (e.g. ATC code)",
103-
"type": "string"
104-
},
105-
"system": {
106-
"description": "Coding system (e.g. ATC, RxNorm)",
107-
"type": "string"
108-
},
109-
"source": {
110-
"description": "Data source reference",
111-
"type": "object"
112-
},
113-
"hdsId": {
114-
"description": "Unique HDS identifier for this code entry",
115-
"type": "string"
90+
"drug": {
91+
"description": "Coded drug identity, populated from datasets-service selection. Contains multiple codes when the same drug is matched across coding systems.",
92+
"type": "object",
93+
"required": ["label", "codes"],
94+
"properties": {
95+
"label": {
96+
"description": "Localized medication name for display",
97+
"type": "object",
98+
"properties": {
99+
"en": { "type": "string" }
100+
}
101+
},
102+
"description": {
103+
"description": "Localized full description (e.g. 'Aspirin 325 MG Oral Tablet')",
104+
"type": "object",
105+
"properties": {
106+
"en": { "type": "string" }
107+
}
108+
},
109+
"codes": {
110+
"description": "Coding identifiers across systems. A single drug may have codes in RxNorm (prescribing), SNOMED-CT (clinical), and ATC (classification).",
111+
"type": "array",
112+
"items": {
113+
"type": "object",
114+
"required": ["code", "system", "hdsId"],
115+
"properties": {
116+
"code": {
117+
"description": "Code value (rxcui, SCTID, ATC code)",
118+
"type": "string"
119+
},
120+
"system": {
121+
"description": "Coding system: RxNorm, SNOMED-CT, ATC",
122+
"type": "string"
123+
},
124+
"source": {
125+
"description": "Data source reference",
126+
"type": "object",
127+
"properties": {
128+
"key": { "type": "string" }
129+
}
130+
},
131+
"hdsId": {
132+
"description": "Unique HDS identifier for this code entry",
133+
"type": "string"
134+
}
135+
}
116136
}
117137
}
118138
}
119139
},
120-
"dosageValue": {
121-
"description": "Dosage amount",
122-
"type": "number"
123-
},
124-
"dosageUnit": {
125-
"description": "Dosage unit (mg, g, ml, etc.)",
126-
"type": "string"
127-
},
128-
"administrationRoute": {
129-
"description": "Route of administration (oral, parenteral, etc.)",
130-
"type": "string"
131-
},
132-
"frequencyHours": {
133-
"description": "Frequency in Hours. If non null, 'event.duration' should reflect the full period, otherwise it reflects one intake",
134-
"type": "number"
140+
"intake": {
141+
"description": "User-entered intake regimen",
142+
"type": "object",
143+
"properties": {
144+
"doseValue": {
145+
"description": "Amount per intake (e.g. 2 for '2 tablets', 5 for '5 mL')",
146+
"type": "number"
147+
},
148+
"doseUnit": {
149+
"description": "HDS eventType reference for the dose unit",
150+
"type": "string",
151+
"enum": [
152+
"dose/tablet",
153+
"dose/drop",
154+
"dose/puff",
155+
"dose/application",
156+
"dose/suppository",
157+
"dose/unit",
158+
"volume/ml",
159+
"mass/mg",
160+
"mass/mcg",
161+
"mass/g"
162+
]
163+
},
164+
"route": {
165+
"description": "Route of administration",
166+
"type": "string",
167+
"enum": [
168+
"oral",
169+
"sublingual",
170+
"parenteral",
171+
"intravenous",
172+
"intramuscular",
173+
"subcutaneous",
174+
"inhalation",
175+
"nasal",
176+
"topical",
177+
"transdermal",
178+
"ophthalmic",
179+
"otic",
180+
"rectal",
181+
"vaginal"
182+
]
183+
},
184+
"frequencyHours": {
185+
"description": "Interval between doses in hours. If set, event.duration should reflect the full treatment period",
186+
"type": "number"
187+
},
188+
"asNeeded": {
189+
"description": "True if taken as needed (PRN) rather than on schedule",
190+
"type": "boolean"
191+
},
192+
"note": {
193+
"description": "Free text instructions (e.g. 'take with food', 'before bedtime')",
194+
"type": "string"
195+
}
196+
}
135197
}
136198
}
199+
},
200+
"mass/mcg": {
201+
"description": "Micrograms",
202+
"type": "number"
203+
},
204+
"dose/tablet": {
205+
"description": "Tablets or capsules count",
206+
"type": "number"
207+
},
208+
"dose/drop": {
209+
"description": "Drops (ophthalmic, otic, nasal, oral)",
210+
"type": "number"
211+
},
212+
"dose/puff": {
213+
"description": "Puffs or actuations (inhalers, nasal sprays)",
214+
"type": "number"
215+
},
216+
"dose/application": {
217+
"description": "Applications (topical creams, ointments, gels, patches)",
218+
"type": "number"
219+
},
220+
"dose/suppository": {
221+
"description": "Suppositories (rectal, vaginal)",
222+
"type": "number"
223+
},
224+
"dose/unit": {
225+
"description": "International Units (IU)",
226+
"type": "number"
227+
},
228+
"concentration/mg-ml": {
229+
"description": "Milligrams per milliliter",
230+
"type": "number"
231+
},
232+
"concentration/mcg-ml": {
233+
"description": "Micrograms per milliliter",
234+
"type": "number"
235+
},
236+
"concentration/mg-g": {
237+
"description": "Milligrams per gram (topical)",
238+
"type": "number"
239+
},
240+
"rate/mg-hr": {
241+
"description": "Milligrams per hour (transdermal, infusion)",
242+
"type": "number"
243+
},
244+
"rate/mcg-hr": {
245+
"description": "Micrograms per hour (transdermal)",
246+
"type": "number"
137247
}
138248
},
139-
"extras": {}
140-
}
249+
"extras": {
250+
"mass/mg": {
251+
"name": { "en": "Milligrams", "fr": "Milligrammes" },
252+
"symbol": "mg"
253+
},
254+
"mass/mcg": {
255+
"name": { "en": "Micrograms", "fr": "Microgrammes" },
256+
"symbol": "μg"
257+
},
258+
"dose/tablet": {
259+
"name": { "en": "Tablets", "fr": "Comprimés" },
260+
"symbol": "tab"
261+
},
262+
"dose/drop": {
263+
"name": { "en": "Drops", "fr": "Gouttes" },
264+
"symbol": "gtt"
265+
},
266+
"dose/puff": {
267+
"name": { "en": "Puffs", "fr": "Bouffées" },
268+
"symbol": "puff"
269+
},
270+
"dose/application": {
271+
"name": { "en": "Applications", "fr": "Applications" },
272+
"symbol": "app"
273+
},
274+
"dose/suppository": {
275+
"name": { "en": "Suppositories", "fr": "Suppositoires" },
276+
"symbol": "supp"
277+
},
278+
"dose/unit": {
279+
"name": { "en": "International Units", "fr": "Unités internationales" },
280+
"symbol": "IU"
281+
},
282+
"concentration/mg-ml": {
283+
"name": { "en": "Milligrams per milliliter", "fr": "Milligrammes par millilitre" },
284+
"symbol": "mg/mL"
285+
},
286+
"concentration/mcg-ml": {
287+
"name": { "en": "Micrograms per milliliter", "fr": "Microgrammes par millilitre" },
288+
"symbol": "μg/mL"
289+
},
290+
"concentration/mg-g": {
291+
"name": { "en": "Milligrams per gram", "fr": "Milligrammes par gramme" },
292+
"symbol": "mg/g"
293+
},
294+
"rate/mg-hr": {
295+
"name": { "en": "Milligrams per hour", "fr": "Milligrammes par heure" },
296+
"symbol": "mg/h"
297+
},
298+
"rate/mcg-hr": {
299+
"name": { "en": "Micrograms per hour", "fr": "Microgrammes par heure" },
300+
"symbol": "μg/h"
301+
}
302+
}
303+
}

docs/datasources.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
},
2121
"valueFields": [
2222
"label",
23-
"code",
24-
"system",
25-
"source",
26-
"hdsId",
27-
"meta"
23+
"description",
24+
"ingredient",
25+
"strength",
26+
"doseForm",
27+
"route",
28+
"doseUnit",
29+
"codes",
30+
"hdsId"
2831
]
2932
}
3033
}

0 commit comments

Comments
 (0)