Skip to content

Commit d3f35a4

Browse files
committed
Medication step1
1 parent dd6655f commit d3f35a4

14 files changed

Lines changed: 350 additions & 60 deletions

File tree

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Defines the initial version of stream structures and event types for a common mo
88

99
## Functional Requirements Specifications
1010

11-
| Date | 16th September 2025 |
11+
| Date | 29th September 2025 |
1212
| ---------------- | ------------- |
13-
| Document Version | 0.3 |
13+
| Document Version | 0.4 |
1414
| Status | Draft |
1515
| | |
1616

@@ -69,6 +69,14 @@ Note: all textual descriptions and labels should be translatable. market with a
6969
- Some data may be taken with different variations and context
7070
- [SNOWMED CT](https://bioportal.bioontology.org/ontologies/SNOMEDCT)
7171
- [LOINC (BODY WEIGHT)](https://loinc.org/LG34372-9)
72+
73+
- Medications code list
74+
- ATC: https://atcddd.fhi.no/atc_ddd_index/
75+
- HCPCS: https://www.aapc.com/codes/hcpcs-codes-range/
76+
- SCTID: https://browser.ihtsdotools.org/?perspective=full&conceptId1=404684003&edition=MAIN/2025-09-01&release=&languages=en
77+
- UNII: https://precision.fda.gov/uniisearch
78+
- Frequency Fhir: https://build.fhir.org/ig/HL7/CDA-Examples/medicationfrequency.html
79+
7280

7381
- Source of the data
7482
The origin of the data will be given by `createdBy` and `modifiedBy` . Still this may not be sufficient

definitions/eventTypes/eventTypes-hds.json

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,42 @@
4545
"livebirth",
4646
"abortion"
4747
]
48-
}
48+
},
49+
"medication/basic": {
50+
"description": "Simple medication based on name and eventual coding",
51+
"type": "object",
52+
"required": ["label"],
53+
"properties": {
54+
"name": {
55+
"description": "The name of product",
56+
"type": "string"
57+
},
58+
"doseMg": {
59+
"description": "The dosage in milligrams",
60+
"type": "number"
61+
},
62+
"frequencyHours": {
63+
"description": "Frequency in Hours. If non null, 'event.duration' should reflect the full period, otherwise it reflects one intake",
64+
"type": "number"
65+
},
66+
"codes": {
67+
"type": "array",
68+
"items": {
69+
"type": "object",
70+
"required": ["system", "content"],
71+
"properties": {
72+
"system": {
73+
"description": "The system code for HDS",
74+
"type": "string"
75+
},
76+
"content": {
77+
"description": "Accordingly to the norm, appropriate content for coding",
78+
"type": "object"
79+
}
80+
}
81+
}
82+
}
83+
}
84+
}
4985
}
5086
}

definitions/items/fertility.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,3 @@ fertility-pregnancy:
127127
label: 'Live birth'
128128
- value: 'abortion'
129129
label: 'Abortion'
130-
131-
132-

definitions/items/medication.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
medication-intake:
2+
version: v1
3+
label: Medication Intake
4+
description: Medication Intake
5+
streamId: medication-intake
6+
eventType: medication/basic
7+
type: composite
8+
composite:
9+
name:
10+
label: Name of the medication
11+
type: text
12+
doseMg:
13+
label: Dosage in milligrams
14+
type: number
15+
canBeNull: true
16+
frequencyHours:
17+
label: Frequency in hours
18+
type: number
19+
canBeNull: true
20+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
id: medication
2+
name: Medication
3+
parentId: null
4+
children:
5+
- id: medication-intake
6+
name: Intake
7+
- id: medication-prescription
8+
name: Prescriptions

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ <h3>Items</h3>
6363
<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>
6464
<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>
6565
<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>
66+
<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>
6667
<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>
6768
<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>
6869
<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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,40 @@
506506
}
507507
]
508508
},
509+
"medication-intake": {
510+
"version": "v1",
511+
"label": {
512+
"en": "Medication Intake"
513+
},
514+
"description": {
515+
"en": "Medication Intake"
516+
},
517+
"streamId": "medication-intake",
518+
"eventType": "medication/basic",
519+
"type": "composite",
520+
"composite": {
521+
"name": {
522+
"label": {
523+
"en": "Name of the medication"
524+
},
525+
"type": "text"
526+
},
527+
"doseMg": {
528+
"label": {
529+
"en": "Dosage in milligrams"
530+
},
531+
"type": "number",
532+
"canBeNull": true
533+
},
534+
"frequencyHours": {
535+
"label": {
536+
"en": "Frequency in hours"
537+
},
538+
"type": "number",
539+
"canBeNull": true
540+
}
541+
}
542+
},
509543
"profile-addresscountry": {
510544
"version": "temporary",
511545
"label": {

docs/json-schemas/defs.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818
"required": [
1919
"en"
2020
]
21+
},
22+
"entryType": {
23+
"enum": [
24+
"number",
25+
"text",
26+
"select",
27+
"checkbox",
28+
"date"
29+
]
2130
}
2231
}
2332
}

docs/json-schemas/item.json

Lines changed: 90 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"streamId": {
1616
"type": "string"
1717
},
18+
"eventType": {
19+
"type": "string"
20+
},
1821
"repeatable": {
1922
"enum": [
2023
"any",
@@ -45,39 +48,17 @@
4548
"nullable": true
4649
},
4750
"type": {
48-
"enum": [
49-
"number",
50-
"text",
51-
"select",
52-
"checkbox",
53-
"date"
54-
]
55-
},
56-
"eventType": {
57-
"type": "string"
58-
},
59-
"options": {
60-
"type": "array",
61-
"items": {
62-
"type": "object",
63-
"nullable": false,
64-
"properties": {
65-
"value": {
66-
"type": [
67-
"number",
68-
"string"
69-
]
70-
},
71-
"label": {
72-
"$ref": "defs.json#/definitions/localized"
73-
}
51+
"type": "string",
52+
"oneOf": [
53+
{
54+
"$ref": "defs.json#/definitions/entryType"
7455
},
75-
"required": [
76-
"value",
77-
"label"
78-
],
79-
"additionalProperties": false
80-
}
56+
{
57+
"enum": [
58+
"composite"
59+
]
60+
}
61+
]
8162
},
8263
"variations": {
8364
"type": "object",
@@ -89,12 +70,87 @@
8970
}
9071
}
9172
},
73+
"allOf": [
74+
{
75+
"if": {
76+
"properties": {
77+
"type": {
78+
"const": "select"
79+
}
80+
}
81+
},
82+
"then": {
83+
"properties": {
84+
"options": {
85+
"type": "array",
86+
"items": {
87+
"type": "object",
88+
"nullable": false,
89+
"properties": {
90+
"value": {
91+
"type": [
92+
"number",
93+
"string"
94+
]
95+
},
96+
"label": {
97+
"$ref": "defs.json#/definitions/localized"
98+
}
99+
},
100+
"required": [
101+
"value",
102+
"label"
103+
],
104+
"additionalProperties": false
105+
}
106+
}
107+
}
108+
}
109+
},
110+
{
111+
"if": {
112+
"properties": {
113+
"type": {
114+
"const": "composite"
115+
}
116+
}
117+
},
118+
"then": {
119+
"properties": {
120+
"composite": {
121+
"type": "object",
122+
"nullable": false,
123+
"patternProperties": {
124+
"^[a-z][a-zA-Z0-9]*$": {
125+
"type": "object",
126+
"properties": {
127+
"label": {
128+
"$ref": "defs.json#/definitions/localized"
129+
},
130+
"type": {
131+
"$ref": "defs.json#/definitions/entryType"
132+
},
133+
"canBeNull": {
134+
"type": "boolean",
135+
"nullable": true
136+
}
137+
},
138+
"additionalProperties": false
139+
}
140+
}
141+
}
142+
},
143+
"required": [
144+
"composite"
145+
]
146+
}
147+
}
148+
],
92149
"required": [
93150
"version",
94151
"label",
95152
"description",
96153
"streamId",
97154
"type"
98-
],
99-
"additionalProperties": false
155+
]
100156
}

docs/pack.json

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"publicationDate": "2025-09-24T09:32:55.428Z",
2+
"publicationDate": "2025-10-08T12:48:11.640Z",
33
"streams": [
44
{
55
"id": "body",
@@ -144,6 +144,23 @@
144144
}
145145
]
146146
},
147+
{
148+
"id": "medication",
149+
"name": "Medication",
150+
"parentId": null,
151+
"children": [
152+
{
153+
"id": "medication-intake",
154+
"name": "Intake",
155+
"parentId": "medication"
156+
},
157+
{
158+
"id": "medication-prescription",
159+
"name": "Prescriptions",
160+
"parentId": "medication"
161+
}
162+
]
163+
},
147164
{
148165
"id": "profile",
149166
"name": "Profile",
@@ -685,6 +702,40 @@
685702
}
686703
]
687704
},
705+
"medication-intake": {
706+
"version": "v1",
707+
"label": {
708+
"en": "Medication Intake"
709+
},
710+
"description": {
711+
"en": "Medication Intake"
712+
},
713+
"streamId": "medication-intake",
714+
"eventType": "medication/basic",
715+
"type": "composite",
716+
"composite": {
717+
"name": {
718+
"label": {
719+
"en": "Name of the medication"
720+
},
721+
"type": "text"
722+
},
723+
"doseMg": {
724+
"label": {
725+
"en": "Dosage in milligrams"
726+
},
727+
"type": "number",
728+
"canBeNull": true
729+
},
730+
"frequencyHours": {
731+
"label": {
732+
"en": "Frequency in hours"
733+
},
734+
"type": "number",
735+
"canBeNull": true
736+
}
737+
}
738+
},
688739
"profile-addresscountry": {
689740
"version": "temporary",
690741
"label": {

0 commit comments

Comments
 (0)