Skip to content

Commit eabaf38

Browse files
author
Daniel Schröder
committed
bigger selection for anterior chamber
1 parent 77dd646 commit eabaf38

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

src/anterior-chamber-component.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,6 @@ export class AnteriorChamberComponent extends LitElement {
223223
max-width: 800px;
224224
}
225225
226-
.anterior-chamber-input select {
227-
width: 10em;
228-
}
229226
.anterior-chamber-input select:invalid {
230227
color: gray;
231228
}

src/anterior-chamber-to-fhir.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Observation } from "@fhir-typescript/r4b-core/dist/fhir/Observation";
22
import { snomed, loinc } from "./tonometry-to-fhir.ts";
33

44
import { ObservationStatusCodes } from "@fhir-typescript/r4b-core/dist/fhirValueSets/ObservationStatusCodes";
5-
import { Bundle, BundleEntry, DiagnosticReport } from "@fhir-typescript/r4b-core/dist/fhir";
5+
import { Bundle, BundleEntry, DiagnosticReport, Reference } from "@fhir-typescript/r4b-core/dist/fhir";
66
import { AnteriorChamberData, SUNCells, SUNFlare } from "./anterior-chamber-data.ts";
77

88
const SUNFlare2Fhir = {
@@ -27,6 +27,7 @@ const SUNCells2Fhir = {
2727
export function anteriorChamber2Fhir(data: AnteriorChamberData): Bundle[] {
2828
let cellsLeft = new Observation({
2929
resourceType: "Observation",
30+
id: "cells-left",
3031
status: ObservationStatusCodes.Final,
3132
category: [
3233
{ coding: [{ system: "http://terminology.hl7.org/CodeSystem/observation-category", code: "exam" }] },
@@ -45,6 +46,7 @@ export function anteriorChamber2Fhir(data: AnteriorChamberData): Bundle[] {
4546

4647
let flareLeft = new Observation({
4748
resourceType: "Observation",
49+
id: "flare-left",
4850
status: ObservationStatusCodes.Final,
4951
category: [
5052
{ coding: [{ system: "http://terminology.hl7.org/CodeSystem/observation-category", code: "exam" }] },
@@ -69,11 +71,16 @@ export function anteriorChamber2Fhir(data: AnteriorChamberData): Bundle[] {
6971

7072
// add optional note for left eye if present
7173
if (!!data.leftEye.note) {
72-
left.entry.push(new BundleEntry({ resource: getDiagnosticReport(data.recordedDate, data.leftEye.note) }));
74+
left.entry.push(
75+
new BundleEntry({
76+
resource: getDiagnosticReport(data.recordedDate, data.leftEye.note, [cellsLeft, flareLeft]),
77+
})
78+
);
7379
}
7480

7581
let cellsRight = new Observation({
7682
resourceType: "Observation",
83+
id: "cells-right",
7784
status: ObservationStatusCodes.Final,
7885
category: [
7986
{ coding: [{ system: "http://terminology.hl7.org/CodeSystem/observation-category", code: "exam" }] },
@@ -92,6 +99,7 @@ export function anteriorChamber2Fhir(data: AnteriorChamberData): Bundle[] {
9299

93100
let flareRight = new Observation({
94101
resourceType: "Observation",
102+
id: "flare-right",
95103
status: ObservationStatusCodes.Final,
96104
category: [
97105
{ coding: [{ system: "http://terminology.hl7.org/CodeSystem/observation-category", code: "exam" }] },
@@ -116,13 +124,17 @@ export function anteriorChamber2Fhir(data: AnteriorChamberData): Bundle[] {
116124

117125
// add optional note for right eye if present
118126
if (!!data.rightEye.note) {
119-
right.entry.push(new BundleEntry({ resource: getDiagnosticReport(data.recordedDate, data.rightEye.note) }));
127+
right.entry.push(
128+
new BundleEntry({
129+
resource: getDiagnosticReport(data.recordedDate, data.rightEye.note, [cellsRight, flareRight]),
130+
})
131+
);
120132
}
121133

122134
return [left, right];
123135
}
124136

125-
export function getDiagnosticReport(date: string, note: string) {
137+
export function getDiagnosticReport(date: string, note: string, results: Observation[]) {
126138
return new DiagnosticReport({
127139
resourceType: "DiagnosticReport",
128140
status: ObservationStatusCodes.Final,
@@ -136,5 +148,6 @@ export function getDiagnosticReport(date: string, note: string) {
136148
},
137149
effectiveDateTime: new Date(date).toISOString(),
138150
conclusion: note,
151+
result: results.map((r) => new Reference({ reference: `Observation/${r.id}` })),
139152
});
140153
}

src/funduscopy-to-fhir.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,15 @@ export function funduscopy2Fhir(data: FunduscopyData): Bundle[] {
7474

7575
// add optional note for left eye if present
7676
if (!!data.leftEye.note) {
77-
left.entry.push(new BundleEntry({ resource: getDiagnosticReport(data.recordedDate, data.leftEye.note) }));
77+
left.entry.push(
78+
new BundleEntry({
79+
resource: getDiagnosticReport(data.recordedDate, data.leftEye.note, [
80+
papillEdemaLeft,
81+
macularEdemaLeft,
82+
vascuitisLeft,
83+
]),
84+
})
85+
);
7886
}
7987

8088
let papillEdemaRight = new Observation({
@@ -139,7 +147,15 @@ export function funduscopy2Fhir(data: FunduscopyData): Bundle[] {
139147

140148
// add optional note for right eye if present
141149
if (!!data.rightEye.note) {
142-
right.entry.push(new BundleEntry({ resource: getDiagnosticReport(data.recordedDate, data.rightEye.note) }));
150+
right.entry.push(
151+
new BundleEntry({
152+
resource: getDiagnosticReport(data.recordedDate, data.rightEye.note, [
153+
papillEdemaRight,
154+
macularEdemaRight,
155+
vascuitisRight,
156+
]),
157+
})
158+
);
143159
}
144160

145161
return [left, right];

0 commit comments

Comments
 (0)