Skip to content

Commit 4840224

Browse files
committed
added data source medication intake
1 parent 1b02554 commit 4840224

14 files changed

Lines changed: 417 additions & 17 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
medication:
2+
label: Medications
3+
description: Search medications from datasets service
4+
endpoint: https://datasets.datasafe.dev/medication
5+
queryParam: search
6+
minQueryLength: 3
7+
resultKey: medications
8+
displayFields:
9+
label: label
10+
description: description
11+
valueFields:
12+
- label
13+
- code
14+
- system
15+
- source
16+
- hdsId
17+
- meta

definitions/eventTypes/eventTypes-hds.json

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,60 @@
8181
}
8282
}
8383
}
84-
}
84+
},
85+
"medication/coded-v1": {
86+
"description": "Coded medication from external dataset with optional dosage and route metadata",
87+
"type": "object",
88+
"required": ["label"],
89+
"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"
116+
}
117+
}
118+
}
119+
},
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"
135+
}
136+
}
137+
}
85138
},
86139
"extras": {}
87140
}

definitions/items/medication.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
medication-intake:
1+
medication-intake-basic:
22
version: v1
3-
label: Medication Intake
4-
description: Medication Intake
3+
label: Medication Intake Basic
4+
description: Medication Intake Custom
55
streamId: medication-intake
66
eventType: medication/basic
77
type: composite
@@ -17,4 +17,12 @@ medication-intake:
1717
label: Frequency in hours
1818
type: number
1919
canBeNull: true
20-
20+
21+
medication-intake-coded:
22+
version: v1
23+
label: Medication Intake (coded)
24+
description: Search and select a coded medication from datasets service
25+
streamId: medication-intake
26+
eventType: medication/coded-v1
27+
type: datasource-search
28+
datasource: medication

docs/datasources.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"medication": {
3+
"label": {
4+
"en": "Medications"
5+
},
6+
"description": {
7+
"en": "Search medications from datasets service"
8+
},
9+
"endpoint": "https://datasets.datasafe.dev/medication",
10+
"queryParam": "search",
11+
"minQueryLength": 3,
12+
"resultKey": "medications",
13+
"displayFields": {
14+
"label": {
15+
"en": "label"
16+
},
17+
"description": {
18+
"en": "description"
19+
}
20+
},
21+
"valueFields": [
22+
"label",
23+
"code",
24+
"system",
25+
"source",
26+
"hdsId",
27+
"meta"
28+
]
29+
}
30+
}

docs/eventTypes.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,6 +1958,64 @@
19581958
}
19591959
}
19601960
}
1961+
},
1962+
"medication/coded-v1": {
1963+
"description": "Coded medication from external dataset with optional dosage and route metadata",
1964+
"type": "object",
1965+
"required": [
1966+
"label"
1967+
],
1968+
"properties": {
1969+
"label": {
1970+
"description": "Localized medication name",
1971+
"type": "object"
1972+
},
1973+
"codes": {
1974+
"description": "Array of coding identifiers (ATC, RxNorm, etc.)",
1975+
"type": "array",
1976+
"items": {
1977+
"type": "object",
1978+
"required": [
1979+
"code",
1980+
"system"
1981+
],
1982+
"properties": {
1983+
"code": {
1984+
"description": "Code value (e.g. ATC code)",
1985+
"type": "string"
1986+
},
1987+
"system": {
1988+
"description": "Coding system (e.g. ATC, RxNorm)",
1989+
"type": "string"
1990+
},
1991+
"source": {
1992+
"description": "Data source reference",
1993+
"type": "object"
1994+
},
1995+
"hdsId": {
1996+
"description": "Unique HDS identifier for this code entry",
1997+
"type": "string"
1998+
}
1999+
}
2000+
}
2001+
},
2002+
"dosageValue": {
2003+
"description": "Dosage amount",
2004+
"type": "number"
2005+
},
2006+
"dosageUnit": {
2007+
"description": "Dosage unit (mg, g, ml, etc.)",
2008+
"type": "string"
2009+
},
2010+
"administrationRoute": {
2011+
"description": "Route of administration (oral, parenteral, etc.)",
2012+
"type": "string"
2013+
},
2014+
"frequencyHours": {
2015+
"description": "Frequency in Hours. If non null, 'event.duration' should reflect the full period, otherwise it reflects one intake",
2016+
"type": "number"
2017+
}
2018+
}
19612019
}
19622020
},
19632021
"extras": {

docs/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ <h3>Files</h3>
3030
<tr><td>Streams Tree</td><td><a href="./streamsTree.json">./streamsTree.json</a></tr>
3131
<tr><td>Items dictionnary</td><td><a href="./items.json">./items.json</a></tr>
3232
<tr><td>EventTypes dictionnary</td><td><a href="./eventTypes.json">./eventTypes.json</a></tr>
33+
<tr><td>Datasources dictionnary</td><td><a href="./datasources.json">./datasources.json</a></tr>
3334
</tbody>
3435
</table>
3536

@@ -70,7 +71,8 @@ <h3>Items</h3>
7071
<tr><td><span style="font-weight: bold;" id="fertility-pregnancy">fertility-pregnancy</span><br><u>Type:</u> select<br><u>When:</u> any</td><td>Pregnancy<br>Pregnancy<BR><SELECT style="width: 20em"><OPTION>ongoing: Ongoing pregnangcy</OPTION><OPTION>miscarriage: Miscarriage</OPTION><OPTION>ectopic: Ectopic</OPTION><OPTION>stillbirth: Stillbirth</OPTION><OPTION>livebirth: Live birth</OPTION><OPTION>abortion: Abortion</OPTION></SELECT><BR><span style="font-style: italic; font-size: small">One per fetus. (can be multiple with same start date)<br>The value of `event.time` should indicate the start of pregnancy.<br>When content value is 'ongoing' `event.duration` must be set to `null`.<br>For any other value `event.duration` should be set to indicate when the pregnancy state terminated.</span></td><td><u>streamId:</u> fertility-preganancies<br><u>eventType(s):</u> pregnancy/detailed<br><u>version:</u> v1</td></tr>
7172
<tr><td><span style="font-weight: bold;" id="fertility-sexual-activity">fertility-sexual-activity</span><br><u>Type:</u> select<br><u>When:</u> any</td><td>Sexual activity<br>Potentially reproductive sexual activity<BR><SELECT style="width: 20em"><OPTION>fertile: Fertile intercourse</OPTION><OPTION>incomplete: No ejaculation (incomplete)</OPTION><OPTION>withdrawal: Withdrawal before ejaculation</OPTION><OPTION>condom: Usage of a condom</OPTION><OPTION>cervical-barrier: Usage of a cervical barrier</OPTION></SELECT></td><td><u>streamId:</u> fertility-sexual-activity<br><u>eventType(s):</u> reproductive-sexuality/detailed<br><u>version:</u> v1</td></tr>
7273
<tr><td><span style="font-weight: bold;" id="fertility-ttc-tta">fertility-ttc-tta</span><br><u>Type:</u> select<br><u>When:</u> daily</td><td>Trying to conceive / Avoiding pregnancy<br>Current fertility intention<BR><SELECT style="width: 20em"><OPTION>0: TTA - Not taking risks. Would take all available measures to end a pregnancy.</OPTION><OPTION>1: TTA - Not taking risks. Would strongly consider placing baby for adoption.</OPTION><OPTION>2: TTA - Not taking risks. Would need some time, maybe counseling. Ultimately keeping the pregnancy.</OPTION><OPTION>4: TTA - Not taking risks. Currently content with family size but a surprise pregnancy would be welcome.</OPTION><OPTION>5: TTW/TTA - "Loosely TTA" known risks are taken in the fertile window. "OOPS" pregnancy would be welcome.</OPTION><OPTION>6: TTW - Charting only for health/curiosity. Unprotected intercourse happens whenever. Pregnancy very welcome.</OPTION><OPTION>7: TTW/TTC - Pregnancy very welcome (moving up the scale in very near future).</OPTION><OPTION>8: TTC - "Excited to start/grow a family TTC" Intentional intercourse every cycle. Excited to start/grow a family. But would not use any fertility treatments if needed.</OPTION><OPTION>9: TTC - "Highly hopeful TTC" Intentional intercourse every cycle. Would consider some but not all fertility treatments if needed.</OPTION><OPTION>10: TTC - " Seriously TTC" Intentional intercourse every cycle. Would pursue any/ALL fertility treatments or procedures if needed.</OPTION></SELECT></td><td><u>streamId:</u> fertility-ttc-tta<br><u>eventType(s):</u> ratio/generic<br><u>version:</u> v1</td></tr>
73-
<tr><td><span style="font-weight: bold;" id="medication-intake">medication-intake</span><br><u>Type:</u> composite<br><u>When:</u> undefined</td><td>Medication Intake<br>Medication Intake</td><td><u>streamId:</u> medication-intake<br><u>eventType(s):</u> medication/basic<br><u>version:</u> v1</td></tr>
74+
<tr><td><span style="font-weight: bold;" id="medication-intake-basic">medication-intake-basic</span><br><u>Type:</u> composite<br><u>When:</u> undefined</td><td>Medication Intake Basic<br>Medication Intake Custom</td><td><u>streamId:</u> medication-intake<br><u>eventType(s):</u> medication/basic<br><u>version:</u> v1</td></tr>
75+
<tr><td><span style="font-weight: bold;" id="medication-intake-coded">medication-intake-coded</span><br><u>Type:</u> datasource-search<br><u>When:</u> undefined</td><td>Medication Intake (coded)<br>Search and select a coded medication from datasets service</td><td><u>streamId:</u> medication-intake<br><u>eventType(s):</u> medication/coded-v1<br><u>version:</u> v1</td></tr>
7476
<tr><td><span style="font-weight: bold;" id="profile-addresscountry">profile-addresscountry</span><br><u>Type:</u> text<br><u>When:</u> none</td><td>Country<br>Country of living</td><td><u>streamId:</u> profile-address<br><u>eventType(s):</u> contact/country<br><u>version:</u> temporary</td></tr>
7577
<tr><td><span style="font-weight: bold;" id="profile-date-of-birth">profile-date-of-birth</span><br><u>Type:</u> date<br><u>When:</u> none</td><td>Date of Birth<br>Date of birth</td><td><u>streamId:</u> profile-date-of-birth<br><u>eventType(s):</u> date/iso-8601<br><u>version:</u> v1</td></tr>
7678
<tr><td><span style="font-weight: bold;" id="profile-name">profile-name</span><br><u>Type:</u> text<br><u>When:</u> none</td><td>Name<br>Name</td><td><u>streamId:</u> profile-name<br><u>eventType(s):</u> contact/name<br><u>version:</u> temporary</td></tr>

docs/items.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,13 +624,13 @@
624624
"type": "number",
625625
"repeatable": "any"
626626
},
627-
"medication-intake": {
627+
"medication-intake-basic": {
628628
"version": "v1",
629629
"label": {
630-
"en": "Medication Intake"
630+
"en": "Medication Intake Basic"
631631
},
632632
"description": {
633-
"en": "Medication Intake"
633+
"en": "Medication Intake Custom"
634634
},
635635
"streamId": "medication-intake",
636636
"eventType": "medication/basic",
@@ -658,6 +658,19 @@
658658
}
659659
}
660660
},
661+
"medication-intake-coded": {
662+
"version": "v1",
663+
"label": {
664+
"en": "Medication Intake (coded)"
665+
},
666+
"description": {
667+
"en": "Search and select a coded medication from datasets service"
668+
},
669+
"streamId": "medication-intake",
670+
"eventType": "medication/coded-v1",
671+
"type": "datasource-search",
672+
"datasource": "medication"
673+
},
661674
"profile-addresscountry": {
662675
"version": "temporary",
663676
"label": {

docs/json-schemas/item.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
},
5656
{
5757
"enum": [
58-
"composite"
58+
"composite",
59+
"datasource-search"
5960
]
6061
}
6162
]
@@ -170,6 +171,25 @@
170171
"composite"
171172
]
172173
}
174+
},
175+
{
176+
"if": {
177+
"properties": {
178+
"type": {
179+
"const": "datasource-search"
180+
}
181+
}
182+
},
183+
"then": {
184+
"properties": {
185+
"datasource": {
186+
"type": "string"
187+
}
188+
},
189+
"required": [
190+
"datasource"
191+
]
192+
}
173193
}
174194
],
175195
"required": [

0 commit comments

Comments
 (0)