Skip to content

Commit b680296

Browse files
author
Daniel Schröder
committed
added IVI-HandMovementPerception
1 parent 0cab4fd commit b680296

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

src/ivi-component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class IVIComponent extends LitElement {
112112
<div class="inputs-inline">
113113
<label class="checkbox">
114114
<input class="visus-right" type="checkbox" @input="${this._updateFormData}" />
115-
<span class="checkbox-label"> Handbewegungen sichtbar</span>
115+
<span class="checkbox-label"> Wahrnehmung von Handbewegungen</span>
116116
</label>
117117
</div>
118118
<label class="label">Nächste Spritze(n):</label>
@@ -205,7 +205,7 @@ export class IVIComponent extends LitElement {
205205
<div class="inputs-inline">
206206
<label class="checkbox">
207207
<input class="visus-left" type="checkbox" @input="${this._updateFormData}" />
208-
<span class="checkbox-label"> Handbewegungen sichtbar</span>
208+
<span class="checkbox-label"> Wahrnehmung von Handbewegungen</span>
209209
</label>
210210
</div>
211211
<label class="label">Nächste Spritze(n):</label>

src/ivi-to-fhir.ts

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
import { Bundle, Medication, MedicationAdministration, Reference } from "@fhir-typescript/r4b-core/dist/fhir";
1+
import {
2+
Bundle,
3+
Medication,
4+
MedicationAdministration,
5+
Observation,
6+
Reference,
7+
} from "@fhir-typescript/r4b-core/dist/fhir";
28
import { IVIData, IVIMedication, IVIRegimen } from "./ivi-data.ts";
39
import { snomed } from "./tonometry-to-fhir.ts";
4-
import { MedicationAdminStatusCodes } from "@fhir-typescript/r4b-core/dist/valueSetCodes";
10+
import { MedicationAdminStatusCodes, ObservationStatusCodes } from "@fhir-typescript/r4b-core/dist/valueSetCodes";
511
import { isValidMedicationAdmin } from "./ivi-component.ts";
12+
import { PresenceStatus2Fhir } from "./funduscopy-to-fhir.ts";
13+
import { PresenceStatus } from "./funduscopy-data.ts";
614

715
const Medication2Fhir = {
816
[IVIMedication.Af2]: "",
@@ -60,9 +68,26 @@ export async function ivi2Fhir(data: IVIData): Promise<Bundle[]> {
6068
},
6169
});
6270

71+
let visusLeft = new Observation({
72+
status: ObservationStatusCodes.Final,
73+
category: [
74+
{ coding: [{ system: "http://terminology.hl7.org/CodeSystem/observation-category", code: "exam" }] },
75+
],
76+
code: {
77+
coding: [snomed("260295004", "Sees hand movements (finding)")],
78+
},
79+
effectiveDateTime: new Date(data.recordedDate).toISOString(),
80+
valueCodeableConcept: {
81+
coding: PresenceStatus2Fhir[data.leftEye.visus ? PresenceStatus.Present : PresenceStatus.Absent],
82+
},
83+
bodySite: {
84+
coding: [snomed("1290041000", "Entire left eye proper (body structure)")],
85+
},
86+
});
87+
6388
let left = new Bundle({
6489
type: "collection",
65-
entry: [{ resource: medReqLeft }, { resource: medicationLeft }],
90+
entry: [{ resource: medReqLeft }, { resource: medicationLeft }, { resource: visusLeft }],
6691
});
6792

6893
result.push(left);
@@ -101,9 +126,26 @@ export async function ivi2Fhir(data: IVIData): Promise<Bundle[]> {
101126
},
102127
});
103128

129+
let visusRight = new Observation({
130+
status: ObservationStatusCodes.Final,
131+
category: [
132+
{ coding: [{ system: "http://terminology.hl7.org/CodeSystem/observation-category", code: "exam" }] },
133+
],
134+
code: {
135+
coding: [snomed("260295004", "Sees hand movements (finding)")],
136+
},
137+
effectiveDateTime: new Date(data.recordedDate).toISOString(),
138+
valueCodeableConcept: {
139+
coding: PresenceStatus2Fhir[data.rightEye.visus ? PresenceStatus.Present : PresenceStatus.Absent],
140+
},
141+
bodySite: {
142+
coding: [snomed("1290043002", "Entire right eye proper (body structure)")],
143+
},
144+
});
145+
104146
let right = new Bundle({
105147
type: "collection",
106-
entry: [{ resource: medReqRight }, { resource: medicationRight }],
148+
entry: [{ resource: medReqRight }, { resource: medicationRight }, { resource: visusRight }],
107149
});
108150

109151
result.push(right);

src/my-element.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ export class MyElement extends LitElement {
7171
};
7272

7373
private columnMapIVI: ColumnConfig<IVIData> = {
74-
Verordnungszeitpunkt: "Bundle.entry.resource.effective",
74+
Verordnungszeitpunkt: "Bundle.entry.resource.effective[0]",
7575
Seitigkeit: "Bundle.entry.resource.dosage.site.coding",
7676
Medikament: "Bundle.entry.resource.where(resourceType='Medication').code.text",
77+
"Wahrnehmung von Handbewegungen": "Bundle.entry.resource.where(resourceType='Observation').value.coding",
7778
note: "Bundle.entry.resource.note.text.value",
7879
};
7980

0 commit comments

Comments
 (0)