@openfn/language-fhir-eswatini 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +205 -96
- package/dist/index.js +205 -96
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -234,18 +234,17 @@ function SzAppointment_default(props) {
|
|
|
234
234
|
if (!Array.isArray(props.serviceCategory)) {
|
|
235
235
|
props.serviceCategory = [props.serviceCategory];
|
|
236
236
|
}
|
|
237
|
-
resource.serviceCategory =
|
|
238
|
-
"http://hl7.org/fhir/ValueSet/service-category|4.0.1",
|
|
239
|
-
|
|
240
|
-
));
|
|
237
|
+
resource.serviceCategory = props.serviceCategory.map(
|
|
238
|
+
(x) => import_language_fhir_42.b.concept(import_language_fhir_42.b.lookupValue("http://hl7.org/fhir/ValueSet/service-category|4.0.1", x))
|
|
239
|
+
);
|
|
241
240
|
import_language_fhir_42.b.ensureConceptText(resource.serviceCategory);
|
|
242
241
|
}
|
|
243
242
|
if (!import_lodash.default.isNil(props.serviceType)) {
|
|
244
243
|
if (!Array.isArray(props.serviceType)) {
|
|
245
244
|
props.serviceType = [props.serviceType];
|
|
246
245
|
}
|
|
247
|
-
resource.serviceType =
|
|
248
|
-
import_language_fhir_42.b.lookupValue("http://hl7.org/fhir/ValueSet/service-type|4.0.1",
|
|
246
|
+
resource.serviceType = props.serviceType.map(
|
|
247
|
+
(x) => import_language_fhir_42.b.concept(import_language_fhir_42.b.lookupValue("http://hl7.org/fhir/ValueSet/service-type|4.0.1", x))
|
|
249
248
|
);
|
|
250
249
|
import_language_fhir_42.b.ensureConceptText(resource.serviceType);
|
|
251
250
|
}
|
|
@@ -253,8 +252,8 @@ function SzAppointment_default(props) {
|
|
|
253
252
|
if (!Array.isArray(props.specialty)) {
|
|
254
253
|
props.specialty = [props.specialty];
|
|
255
254
|
}
|
|
256
|
-
resource.specialty =
|
|
257
|
-
import_language_fhir_42.b.lookupValue("http://hl7.org/fhir/ValueSet/c80-practice-codes|4.0.1",
|
|
255
|
+
resource.specialty = props.specialty.map(
|
|
256
|
+
(x) => import_language_fhir_42.b.concept(import_language_fhir_42.b.lookupValue("http://hl7.org/fhir/ValueSet/c80-practice-codes|4.0.1", x))
|
|
258
257
|
);
|
|
259
258
|
import_language_fhir_42.b.ensureConceptText(resource.specialty);
|
|
260
259
|
}
|
|
@@ -268,8 +267,8 @@ function SzAppointment_default(props) {
|
|
|
268
267
|
if (!Array.isArray(props.reasonCode)) {
|
|
269
268
|
props.reasonCode = [props.reasonCode];
|
|
270
269
|
}
|
|
271
|
-
resource.reasonCode =
|
|
272
|
-
import_language_fhir_42.b.lookupValue("http://hl7.org/fhir/ValueSet/encounter-reason|4.0.1",
|
|
270
|
+
resource.reasonCode = props.reasonCode.map(
|
|
271
|
+
(x) => import_language_fhir_42.b.concept(import_language_fhir_42.b.lookupValue("http://hl7.org/fhir/ValueSet/encounter-reason|4.0.1", x))
|
|
273
272
|
);
|
|
274
273
|
import_language_fhir_42.b.ensureConceptText(resource.reasonCode);
|
|
275
274
|
}
|
|
@@ -310,6 +309,12 @@ function SzAppointment_default(props) {
|
|
|
310
309
|
resource.participant.push(_participant);
|
|
311
310
|
}
|
|
312
311
|
}
|
|
312
|
+
resource.text = {
|
|
313
|
+
status: "generated",
|
|
314
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
315
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
316
|
+
</div>`
|
|
317
|
+
};
|
|
313
318
|
return resource;
|
|
314
319
|
}
|
|
315
320
|
|
|
@@ -348,8 +353,8 @@ function SzCondition_default(props) {
|
|
|
348
353
|
if (!Array.isArray(props.category)) {
|
|
349
354
|
props.category = [props.category];
|
|
350
355
|
}
|
|
351
|
-
resource.category =
|
|
352
|
-
import_language_fhir_43.b.lookupValue("http://hl7.org/fhir/ValueSet/condition-category|4.0.1",
|
|
356
|
+
resource.category = props.category.map(
|
|
357
|
+
(x) => import_language_fhir_43.b.concept(import_language_fhir_43.b.lookupValue("http://hl7.org/fhir/ValueSet/condition-category|4.0.1", x))
|
|
353
358
|
);
|
|
354
359
|
import_language_fhir_43.b.ensureConceptText(resource.category);
|
|
355
360
|
}
|
|
@@ -369,8 +374,8 @@ function SzCondition_default(props) {
|
|
|
369
374
|
if (!Array.isArray(props.bodySite)) {
|
|
370
375
|
props.bodySite = [props.bodySite];
|
|
371
376
|
}
|
|
372
|
-
resource.bodySite =
|
|
373
|
-
import_language_fhir_43.b.lookupValue("http://hl7.org/fhir/ValueSet/body-site|4.0.1",
|
|
377
|
+
resource.bodySite = props.bodySite.map(
|
|
378
|
+
(x) => import_language_fhir_43.b.concept(import_language_fhir_43.b.lookupValue("http://hl7.org/fhir/ValueSet/body-site|4.0.1", x))
|
|
374
379
|
);
|
|
375
380
|
import_language_fhir_43.b.ensureConceptText(resource.bodySite);
|
|
376
381
|
}
|
|
@@ -420,6 +425,12 @@ function SzCondition_default(props) {
|
|
|
420
425
|
resource.evidence.push(_evidence);
|
|
421
426
|
}
|
|
422
427
|
}
|
|
428
|
+
resource.text = {
|
|
429
|
+
status: "generated",
|
|
430
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
431
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
432
|
+
</div>`
|
|
433
|
+
};
|
|
423
434
|
return resource;
|
|
424
435
|
}
|
|
425
436
|
|
|
@@ -477,8 +488,8 @@ function SzEncounter_default(props) {
|
|
|
477
488
|
if (!Array.isArray(props.type)) {
|
|
478
489
|
props.type = [props.type];
|
|
479
490
|
}
|
|
480
|
-
resource.type =
|
|
481
|
-
import_language_fhir_44.b.lookupValue("http://hl7.org/fhir/ValueSet/encounter-type|4.0.1",
|
|
491
|
+
resource.type = props.type.map(
|
|
492
|
+
(x) => import_language_fhir_44.b.concept(import_language_fhir_44.b.lookupValue("http://hl7.org/fhir/ValueSet/encounter-type|4.0.1", x))
|
|
482
493
|
);
|
|
483
494
|
import_language_fhir_44.b.ensureConceptText(resource.type);
|
|
484
495
|
}
|
|
@@ -539,8 +550,8 @@ function SzEncounter_default(props) {
|
|
|
539
550
|
if (!Array.isArray(props.reasonCode)) {
|
|
540
551
|
props.reasonCode = [props.reasonCode];
|
|
541
552
|
}
|
|
542
|
-
resource.reasonCode =
|
|
543
|
-
import_language_fhir_44.b.lookupValue("http://hl7.org/fhir/ValueSet/encounter-reason|4.0.1",
|
|
553
|
+
resource.reasonCode = props.reasonCode.map(
|
|
554
|
+
(x) => import_language_fhir_44.b.concept(import_language_fhir_44.b.lookupValue("http://hl7.org/fhir/ValueSet/encounter-reason|4.0.1", x))
|
|
544
555
|
);
|
|
545
556
|
import_language_fhir_44.b.ensureConceptText(resource.reasonCode);
|
|
546
557
|
}
|
|
@@ -595,6 +606,12 @@ function SzEncounter_default(props) {
|
|
|
595
606
|
if (!import_lodash3.default.isNil(props.partOf)) {
|
|
596
607
|
resource.partOf = import_language_fhir_44.b.reference(props.partOf);
|
|
597
608
|
}
|
|
609
|
+
resource.text = {
|
|
610
|
+
status: "generated",
|
|
611
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
612
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
613
|
+
</div>`
|
|
614
|
+
};
|
|
598
615
|
return resource;
|
|
599
616
|
}
|
|
600
617
|
|
|
@@ -634,9 +651,8 @@ function SzEpisodeOfCare_default(props) {
|
|
|
634
651
|
if (!Array.isArray(props.type)) {
|
|
635
652
|
props.type = [props.type];
|
|
636
653
|
}
|
|
637
|
-
resource.type =
|
|
638
|
-
"https://hapifhir.eswatinihie.com/fhir/ValueSet/SzEpisodeOfCareTypeVS",
|
|
639
|
-
props.type
|
|
654
|
+
resource.type = props.type.map((x) => import_language_fhir_45.b.concept(
|
|
655
|
+
import_language_fhir_45.b.lookupValue("https://hapifhir.eswatinihie.com/fhir/ValueSet/SzEpisodeOfCareTypeVS", x)
|
|
640
656
|
));
|
|
641
657
|
import_language_fhir_45.b.ensureConceptText(resource.type);
|
|
642
658
|
}
|
|
@@ -680,6 +696,12 @@ function SzEpisodeOfCare_default(props) {
|
|
|
680
696
|
}
|
|
681
697
|
resource.account = import_language_fhir_45.b.reference(props.account);
|
|
682
698
|
}
|
|
699
|
+
resource.text = {
|
|
700
|
+
status: "generated",
|
|
701
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
702
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
703
|
+
</div>`
|
|
704
|
+
};
|
|
683
705
|
return resource;
|
|
684
706
|
}
|
|
685
707
|
|
|
@@ -711,10 +733,10 @@ function SzLocation_default(props) {
|
|
|
711
733
|
if (!Array.isArray(props.type)) {
|
|
712
734
|
props.type = [props.type];
|
|
713
735
|
}
|
|
714
|
-
resource.type = import_language_fhir_46.b.concept(import_language_fhir_46.b.lookupValue(
|
|
736
|
+
resource.type = props.type.map((x) => import_language_fhir_46.b.concept(import_language_fhir_46.b.lookupValue(
|
|
715
737
|
"http://terminology.hl7.org/ValueSet/v3-ServiceDeliveryLocationRoleType|3.0.0",
|
|
716
|
-
|
|
717
|
-
));
|
|
738
|
+
x
|
|
739
|
+
)));
|
|
718
740
|
import_language_fhir_46.b.ensureConceptText(resource.type);
|
|
719
741
|
}
|
|
720
742
|
if (!import_lodash5.default.isNil(props.physicalType)) {
|
|
@@ -756,6 +778,12 @@ function SzLocation_default(props) {
|
|
|
756
778
|
}
|
|
757
779
|
resource.endpoint = import_language_fhir_46.b.reference(props.endpoint);
|
|
758
780
|
}
|
|
781
|
+
resource.text = {
|
|
782
|
+
status: "generated",
|
|
783
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
784
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
785
|
+
</div>`
|
|
786
|
+
};
|
|
759
787
|
return resource;
|
|
760
788
|
}
|
|
761
789
|
|
|
@@ -812,6 +840,12 @@ function SzMedication_default(props) {
|
|
|
812
840
|
};
|
|
813
841
|
resource.batch = _batch;
|
|
814
842
|
}
|
|
843
|
+
resource.text = {
|
|
844
|
+
status: "generated",
|
|
845
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
846
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
847
|
+
</div>`
|
|
848
|
+
};
|
|
815
849
|
return resource;
|
|
816
850
|
}
|
|
817
851
|
|
|
@@ -923,6 +957,12 @@ function SzMedicationDispense_default(props) {
|
|
|
923
957
|
}
|
|
924
958
|
resource.eventHistory = import_language_fhir_48.b.reference(props.eventHistory);
|
|
925
959
|
}
|
|
960
|
+
resource.text = {
|
|
961
|
+
status: "generated",
|
|
962
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
963
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
964
|
+
</div>`
|
|
965
|
+
};
|
|
926
966
|
return resource;
|
|
927
967
|
}
|
|
928
968
|
|
|
@@ -956,9 +996,8 @@ function SzMedicationRequest_default(props) {
|
|
|
956
996
|
if (!Array.isArray(props.category)) {
|
|
957
997
|
props.category = [props.category];
|
|
958
998
|
}
|
|
959
|
-
resource.category =
|
|
960
|
-
"http://hl7.org/fhir/ValueSet/medicationrequest-category|4.0.1",
|
|
961
|
-
props.category
|
|
999
|
+
resource.category = props.category.map((x) => import_language_fhir_49.b.concept(
|
|
1000
|
+
import_language_fhir_49.b.lookupValue("http://hl7.org/fhir/ValueSet/medicationrequest-category|4.0.1", x)
|
|
962
1001
|
));
|
|
963
1002
|
import_language_fhir_49.b.ensureConceptText(resource.category);
|
|
964
1003
|
}
|
|
@@ -1001,8 +1040,8 @@ function SzMedicationRequest_default(props) {
|
|
|
1001
1040
|
if (!Array.isArray(props.reasonCode)) {
|
|
1002
1041
|
props.reasonCode = [props.reasonCode];
|
|
1003
1042
|
}
|
|
1004
|
-
resource.reasonCode =
|
|
1005
|
-
import_language_fhir_49.b.lookupValue("http://hl7.org/fhir/ValueSet/condition-code|4.0.1",
|
|
1043
|
+
resource.reasonCode = props.reasonCode.map(
|
|
1044
|
+
(x) => import_language_fhir_49.b.concept(import_language_fhir_49.b.lookupValue("http://hl7.org/fhir/ValueSet/condition-code|4.0.1", x))
|
|
1006
1045
|
);
|
|
1007
1046
|
import_language_fhir_49.b.ensureConceptText(resource.reasonCode);
|
|
1008
1047
|
}
|
|
@@ -1076,6 +1115,12 @@ function SzMedicationRequest_default(props) {
|
|
|
1076
1115
|
}
|
|
1077
1116
|
resource.eventHistory = import_language_fhir_49.b.reference(props.eventHistory);
|
|
1078
1117
|
}
|
|
1118
|
+
resource.text = {
|
|
1119
|
+
status: "generated",
|
|
1120
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
1121
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
1122
|
+
</div>`
|
|
1123
|
+
};
|
|
1079
1124
|
return resource;
|
|
1080
1125
|
}
|
|
1081
1126
|
|
|
@@ -1112,9 +1157,9 @@ function SzCauseOfDeath_default(props) {
|
|
|
1112
1157
|
if (!Array.isArray(props.category)) {
|
|
1113
1158
|
props.category = [props.category];
|
|
1114
1159
|
}
|
|
1115
|
-
resource.category = import_language_fhir_410.b.concept(
|
|
1116
|
-
import_language_fhir_410.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-category|4.0.1",
|
|
1117
|
-
);
|
|
1160
|
+
resource.category = props.category.map((x) => import_language_fhir_410.b.concept(
|
|
1161
|
+
import_language_fhir_410.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-category|4.0.1", x)
|
|
1162
|
+
));
|
|
1118
1163
|
import_language_fhir_410.b.ensureConceptText(resource.category);
|
|
1119
1164
|
}
|
|
1120
1165
|
if (!import_lodash9.default.isNil(props.code)) {
|
|
@@ -1162,9 +1207,8 @@ function SzCauseOfDeath_default(props) {
|
|
|
1162
1207
|
if (!Array.isArray(props.interpretation)) {
|
|
1163
1208
|
props.interpretation = [props.interpretation];
|
|
1164
1209
|
}
|
|
1165
|
-
resource.interpretation =
|
|
1166
|
-
"http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1",
|
|
1167
|
-
props.interpretation
|
|
1210
|
+
resource.interpretation = props.interpretation.map((x) => import_language_fhir_410.b.concept(
|
|
1211
|
+
import_language_fhir_410.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1", x)
|
|
1168
1212
|
));
|
|
1169
1213
|
import_language_fhir_410.b.ensureConceptText(resource.interpretation);
|
|
1170
1214
|
}
|
|
@@ -1224,6 +1268,12 @@ function SzCauseOfDeath_default(props) {
|
|
|
1224
1268
|
resource.component.push(_component);
|
|
1225
1269
|
}
|
|
1226
1270
|
}
|
|
1271
|
+
resource.text = {
|
|
1272
|
+
status: "generated",
|
|
1273
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
1274
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
1275
|
+
</div>`
|
|
1276
|
+
};
|
|
1227
1277
|
return resource;
|
|
1228
1278
|
}
|
|
1229
1279
|
|
|
@@ -1262,9 +1312,9 @@ function SzClinicalObservation_default(props) {
|
|
|
1262
1312
|
if (!Array.isArray(props.category)) {
|
|
1263
1313
|
props.category = [props.category];
|
|
1264
1314
|
}
|
|
1265
|
-
resource.category = import_language_fhir_411.b.concept(
|
|
1266
|
-
import_language_fhir_411.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-category|4.0.1",
|
|
1267
|
-
);
|
|
1315
|
+
resource.category = props.category.map((x) => import_language_fhir_411.b.concept(
|
|
1316
|
+
import_language_fhir_411.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-category|4.0.1", x)
|
|
1317
|
+
));
|
|
1268
1318
|
import_language_fhir_411.b.ensureConceptText(resource.category);
|
|
1269
1319
|
}
|
|
1270
1320
|
if (!import_lodash10.default.isNil(props.code)) {
|
|
@@ -1310,9 +1360,8 @@ function SzClinicalObservation_default(props) {
|
|
|
1310
1360
|
if (!Array.isArray(props.interpretation)) {
|
|
1311
1361
|
props.interpretation = [props.interpretation];
|
|
1312
1362
|
}
|
|
1313
|
-
resource.interpretation =
|
|
1314
|
-
"http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1",
|
|
1315
|
-
props.interpretation
|
|
1363
|
+
resource.interpretation = props.interpretation.map((x) => import_language_fhir_411.b.concept(
|
|
1364
|
+
import_language_fhir_411.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1", x)
|
|
1316
1365
|
));
|
|
1317
1366
|
import_language_fhir_411.b.ensureConceptText(resource.interpretation);
|
|
1318
1367
|
}
|
|
@@ -1372,6 +1421,12 @@ function SzClinicalObservation_default(props) {
|
|
|
1372
1421
|
resource.component.push(_component);
|
|
1373
1422
|
}
|
|
1374
1423
|
}
|
|
1424
|
+
resource.text = {
|
|
1425
|
+
status: "generated",
|
|
1426
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
1427
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
1428
|
+
</div>`
|
|
1429
|
+
};
|
|
1375
1430
|
return resource;
|
|
1376
1431
|
}
|
|
1377
1432
|
|
|
@@ -1428,9 +1483,9 @@ function SzLabResult_default(props) {
|
|
|
1428
1483
|
if (!Array.isArray(props.category)) {
|
|
1429
1484
|
props.category = [props.category];
|
|
1430
1485
|
}
|
|
1431
|
-
resource.category = import_language_fhir_412.b.concept(
|
|
1432
|
-
import_language_fhir_412.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-category|4.0.1",
|
|
1433
|
-
);
|
|
1486
|
+
resource.category = props.category.map((x) => import_language_fhir_412.b.concept(
|
|
1487
|
+
import_language_fhir_412.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-category|4.0.1", x)
|
|
1488
|
+
));
|
|
1434
1489
|
import_language_fhir_412.b.ensureConceptText(resource.category);
|
|
1435
1490
|
}
|
|
1436
1491
|
if (!import_lodash11.default.isNil(props.code)) {
|
|
@@ -1477,9 +1532,8 @@ function SzLabResult_default(props) {
|
|
|
1477
1532
|
if (!Array.isArray(props.interpretation)) {
|
|
1478
1533
|
props.interpretation = [props.interpretation];
|
|
1479
1534
|
}
|
|
1480
|
-
resource.interpretation =
|
|
1481
|
-
"http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1",
|
|
1482
|
-
props.interpretation
|
|
1535
|
+
resource.interpretation = props.interpretation.map((x) => import_language_fhir_412.b.concept(
|
|
1536
|
+
import_language_fhir_412.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1", x)
|
|
1483
1537
|
));
|
|
1484
1538
|
import_language_fhir_412.b.ensureConceptText(resource.interpretation);
|
|
1485
1539
|
}
|
|
@@ -1539,6 +1593,12 @@ function SzLabResult_default(props) {
|
|
|
1539
1593
|
resource.component.push(_component);
|
|
1540
1594
|
}
|
|
1541
1595
|
}
|
|
1596
|
+
resource.text = {
|
|
1597
|
+
status: "generated",
|
|
1598
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
1599
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
1600
|
+
</div>`
|
|
1601
|
+
};
|
|
1542
1602
|
return resource;
|
|
1543
1603
|
}
|
|
1544
1604
|
|
|
@@ -1577,9 +1637,9 @@ function SzMannerOfDeath_default(props) {
|
|
|
1577
1637
|
if (!Array.isArray(props.category)) {
|
|
1578
1638
|
props.category = [props.category];
|
|
1579
1639
|
}
|
|
1580
|
-
resource.category = import_language_fhir_413.b.concept(
|
|
1581
|
-
import_language_fhir_413.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-category|4.0.1",
|
|
1582
|
-
);
|
|
1640
|
+
resource.category = props.category.map((x) => import_language_fhir_413.b.concept(
|
|
1641
|
+
import_language_fhir_413.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-category|4.0.1", x)
|
|
1642
|
+
));
|
|
1583
1643
|
import_language_fhir_413.b.ensureConceptText(resource.category);
|
|
1584
1644
|
}
|
|
1585
1645
|
if (!import_lodash12.default.isNil(props.code)) {
|
|
@@ -1627,9 +1687,8 @@ function SzMannerOfDeath_default(props) {
|
|
|
1627
1687
|
if (!Array.isArray(props.interpretation)) {
|
|
1628
1688
|
props.interpretation = [props.interpretation];
|
|
1629
1689
|
}
|
|
1630
|
-
resource.interpretation =
|
|
1631
|
-
"http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1",
|
|
1632
|
-
props.interpretation
|
|
1690
|
+
resource.interpretation = props.interpretation.map((x) => import_language_fhir_413.b.concept(
|
|
1691
|
+
import_language_fhir_413.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1", x)
|
|
1633
1692
|
));
|
|
1634
1693
|
import_language_fhir_413.b.ensureConceptText(resource.interpretation);
|
|
1635
1694
|
}
|
|
@@ -1689,6 +1748,12 @@ function SzMannerOfDeath_default(props) {
|
|
|
1689
1748
|
resource.component.push(_component);
|
|
1690
1749
|
}
|
|
1691
1750
|
}
|
|
1751
|
+
resource.text = {
|
|
1752
|
+
status: "generated",
|
|
1753
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
1754
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
1755
|
+
</div>`
|
|
1756
|
+
};
|
|
1692
1757
|
return resource;
|
|
1693
1758
|
}
|
|
1694
1759
|
|
|
@@ -1777,9 +1842,8 @@ function SzVitalSigns_default(props) {
|
|
|
1777
1842
|
if (!Array.isArray(props.interpretation)) {
|
|
1778
1843
|
props.interpretation = [props.interpretation];
|
|
1779
1844
|
}
|
|
1780
|
-
resource.interpretation =
|
|
1781
|
-
"http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1",
|
|
1782
|
-
props.interpretation
|
|
1845
|
+
resource.interpretation = props.interpretation.map((x) => import_language_fhir_414.b.concept(
|
|
1846
|
+
import_language_fhir_414.b.lookupValue("http://hl7.org/fhir/ValueSet/observation-interpretation|4.0.1", x)
|
|
1783
1847
|
));
|
|
1784
1848
|
import_language_fhir_414.b.ensureConceptText(resource.interpretation);
|
|
1785
1849
|
}
|
|
@@ -1839,6 +1903,12 @@ function SzVitalSigns_default(props) {
|
|
|
1839
1903
|
resource.component.push(_component);
|
|
1840
1904
|
}
|
|
1841
1905
|
}
|
|
1906
|
+
resource.text = {
|
|
1907
|
+
status: "generated",
|
|
1908
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
1909
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
1910
|
+
</div>`
|
|
1911
|
+
};
|
|
1842
1912
|
return resource;
|
|
1843
1913
|
}
|
|
1844
1914
|
|
|
@@ -1863,8 +1933,8 @@ function SzOrganization_default(props) {
|
|
|
1863
1933
|
if (!Array.isArray(props.type)) {
|
|
1864
1934
|
props.type = [props.type];
|
|
1865
1935
|
}
|
|
1866
|
-
resource.type =
|
|
1867
|
-
import_language_fhir_415.b.lookupValue("http://hl7.org/fhir/ValueSet/organization-type|4.0.1",
|
|
1936
|
+
resource.type = props.type.map(
|
|
1937
|
+
(x) => import_language_fhir_415.b.concept(import_language_fhir_415.b.lookupValue("http://hl7.org/fhir/ValueSet/organization-type|4.0.1", x))
|
|
1868
1938
|
);
|
|
1869
1939
|
import_language_fhir_415.b.ensureConceptText(resource.type);
|
|
1870
1940
|
}
|
|
@@ -1890,6 +1960,12 @@ function SzOrganization_default(props) {
|
|
|
1890
1960
|
}
|
|
1891
1961
|
resource.endpoint = import_language_fhir_415.b.reference(props.endpoint);
|
|
1892
1962
|
}
|
|
1963
|
+
resource.text = {
|
|
1964
|
+
status: "generated",
|
|
1965
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
1966
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
1967
|
+
</div>`
|
|
1968
|
+
};
|
|
1893
1969
|
return resource;
|
|
1894
1970
|
}
|
|
1895
1971
|
|
|
@@ -2053,6 +2129,12 @@ function SzPatient_default(props) {
|
|
|
2053
2129
|
resource.link.push(_link);
|
|
2054
2130
|
}
|
|
2055
2131
|
}
|
|
2132
|
+
resource.text = {
|
|
2133
|
+
status: "generated",
|
|
2134
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
2135
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
2136
|
+
</div>`
|
|
2137
|
+
};
|
|
2056
2138
|
return resource;
|
|
2057
2139
|
}
|
|
2058
2140
|
|
|
@@ -2103,11 +2185,17 @@ function SzPractitioner_default(props) {
|
|
|
2103
2185
|
if (!Array.isArray(props.communication)) {
|
|
2104
2186
|
props.communication = [props.communication];
|
|
2105
2187
|
}
|
|
2106
|
-
resource.communication =
|
|
2107
|
-
import_language_fhir_417.b.lookupValue("http://hl7.org/fhir/ValueSet/languages|4.0.1",
|
|
2188
|
+
resource.communication = props.communication.map(
|
|
2189
|
+
(x) => import_language_fhir_417.b.concept(import_language_fhir_417.b.lookupValue("http://hl7.org/fhir/ValueSet/languages|4.0.1", x))
|
|
2108
2190
|
);
|
|
2109
2191
|
import_language_fhir_417.b.ensureConceptText(resource.communication);
|
|
2110
2192
|
}
|
|
2193
|
+
resource.text = {
|
|
2194
|
+
status: "generated",
|
|
2195
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
2196
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
2197
|
+
</div>`
|
|
2198
|
+
};
|
|
2111
2199
|
return resource;
|
|
2112
2200
|
}
|
|
2113
2201
|
|
|
@@ -2195,8 +2283,8 @@ function SzProcedure_default(props) {
|
|
|
2195
2283
|
if (!Array.isArray(props.reasonCode)) {
|
|
2196
2284
|
props.reasonCode = [props.reasonCode];
|
|
2197
2285
|
}
|
|
2198
|
-
resource.reasonCode =
|
|
2199
|
-
import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/procedure-reason|4.0.1",
|
|
2286
|
+
resource.reasonCode = props.reasonCode.map(
|
|
2287
|
+
(x) => import_language_fhir_418.b.concept(import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/procedure-reason|4.0.1", x))
|
|
2200
2288
|
);
|
|
2201
2289
|
import_language_fhir_418.b.ensureConceptText(resource.reasonCode);
|
|
2202
2290
|
}
|
|
@@ -2210,8 +2298,8 @@ function SzProcedure_default(props) {
|
|
|
2210
2298
|
if (!Array.isArray(props.bodySite)) {
|
|
2211
2299
|
props.bodySite = [props.bodySite];
|
|
2212
2300
|
}
|
|
2213
|
-
resource.bodySite =
|
|
2214
|
-
import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/body-site|4.0.1",
|
|
2301
|
+
resource.bodySite = props.bodySite.map(
|
|
2302
|
+
(x) => import_language_fhir_418.b.concept(import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/body-site|4.0.1", x))
|
|
2215
2303
|
);
|
|
2216
2304
|
import_language_fhir_418.b.ensureConceptText(resource.bodySite);
|
|
2217
2305
|
}
|
|
@@ -2231,8 +2319,8 @@ function SzProcedure_default(props) {
|
|
|
2231
2319
|
if (!Array.isArray(props.complication)) {
|
|
2232
2320
|
props.complication = [props.complication];
|
|
2233
2321
|
}
|
|
2234
|
-
resource.complication =
|
|
2235
|
-
import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/condition-code|4.0.1",
|
|
2322
|
+
resource.complication = props.complication.map(
|
|
2323
|
+
(x) => import_language_fhir_418.b.concept(import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/condition-code|4.0.1", x))
|
|
2236
2324
|
);
|
|
2237
2325
|
import_language_fhir_418.b.ensureConceptText(resource.complication);
|
|
2238
2326
|
}
|
|
@@ -2246,8 +2334,8 @@ function SzProcedure_default(props) {
|
|
|
2246
2334
|
if (!Array.isArray(props.followUp)) {
|
|
2247
2335
|
props.followUp = [props.followUp];
|
|
2248
2336
|
}
|
|
2249
|
-
resource.followUp =
|
|
2250
|
-
import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/procedure-followup|4.0.1",
|
|
2337
|
+
resource.followUp = props.followUp.map(
|
|
2338
|
+
(x) => import_language_fhir_418.b.concept(import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/procedure-followup|4.0.1", x))
|
|
2251
2339
|
);
|
|
2252
2340
|
import_language_fhir_418.b.ensureConceptText(resource.followUp);
|
|
2253
2341
|
}
|
|
@@ -2274,11 +2362,17 @@ function SzProcedure_default(props) {
|
|
|
2274
2362
|
if (!Array.isArray(props.usedCode)) {
|
|
2275
2363
|
props.usedCode = [props.usedCode];
|
|
2276
2364
|
}
|
|
2277
|
-
resource.usedCode =
|
|
2278
|
-
import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/device-kind|4.0.1",
|
|
2365
|
+
resource.usedCode = props.usedCode.map(
|
|
2366
|
+
(x) => import_language_fhir_418.b.concept(import_language_fhir_418.b.lookupValue("http://hl7.org/fhir/ValueSet/device-kind|4.0.1", x))
|
|
2279
2367
|
);
|
|
2280
2368
|
import_language_fhir_418.b.ensureConceptText(resource.usedCode);
|
|
2281
2369
|
}
|
|
2370
|
+
resource.text = {
|
|
2371
|
+
status: "generated",
|
|
2372
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
2373
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
2374
|
+
</div>`
|
|
2375
|
+
};
|
|
2282
2376
|
return resource;
|
|
2283
2377
|
}
|
|
2284
2378
|
|
|
@@ -2337,9 +2431,8 @@ function SzLabRequest_default(props) {
|
|
|
2337
2431
|
if (!Array.isArray(props.orderDetail)) {
|
|
2338
2432
|
props.orderDetail = [props.orderDetail];
|
|
2339
2433
|
}
|
|
2340
|
-
resource.orderDetail =
|
|
2341
|
-
"http://hl7.org/fhir/ValueSet/servicerequest-orderdetail|4.0.1",
|
|
2342
|
-
props.orderDetail
|
|
2434
|
+
resource.orderDetail = props.orderDetail.map((x) => import_language_fhir_419.b.concept(
|
|
2435
|
+
import_language_fhir_419.b.lookupValue("http://hl7.org/fhir/ValueSet/servicerequest-orderdetail|4.0.1", x)
|
|
2343
2436
|
));
|
|
2344
2437
|
import_language_fhir_419.b.ensureConceptText(resource.orderDetail);
|
|
2345
2438
|
}
|
|
@@ -2380,10 +2473,10 @@ function SzLabRequest_default(props) {
|
|
|
2380
2473
|
if (!Array.isArray(props.locationCode)) {
|
|
2381
2474
|
props.locationCode = [props.locationCode];
|
|
2382
2475
|
}
|
|
2383
|
-
resource.locationCode = import_language_fhir_419.b.concept(import_language_fhir_419.b.lookupValue(
|
|
2476
|
+
resource.locationCode = props.locationCode.map((x) => import_language_fhir_419.b.concept(import_language_fhir_419.b.lookupValue(
|
|
2384
2477
|
"http://terminology.hl7.org/ValueSet/v3-ServiceDeliveryLocationRoleType",
|
|
2385
|
-
|
|
2386
|
-
));
|
|
2478
|
+
x
|
|
2479
|
+
)));
|
|
2387
2480
|
import_language_fhir_419.b.ensureConceptText(resource.locationCode);
|
|
2388
2481
|
}
|
|
2389
2482
|
if (!import_lodash18.default.isNil(props.locationReference)) {
|
|
@@ -2396,8 +2489,8 @@ function SzLabRequest_default(props) {
|
|
|
2396
2489
|
if (!Array.isArray(props.reasonCode)) {
|
|
2397
2490
|
props.reasonCode = [props.reasonCode];
|
|
2398
2491
|
}
|
|
2399
|
-
resource.reasonCode =
|
|
2400
|
-
import_language_fhir_419.b.lookupValue("http://hl7.org/fhir/ValueSet/procedure-reason|4.0.1",
|
|
2492
|
+
resource.reasonCode = props.reasonCode.map(
|
|
2493
|
+
(x) => import_language_fhir_419.b.concept(import_language_fhir_419.b.lookupValue("http://hl7.org/fhir/ValueSet/procedure-reason|4.0.1", x))
|
|
2401
2494
|
);
|
|
2402
2495
|
import_language_fhir_419.b.ensureConceptText(resource.reasonCode);
|
|
2403
2496
|
}
|
|
@@ -2429,8 +2522,8 @@ function SzLabRequest_default(props) {
|
|
|
2429
2522
|
if (!Array.isArray(props.bodySite)) {
|
|
2430
2523
|
props.bodySite = [props.bodySite];
|
|
2431
2524
|
}
|
|
2432
|
-
resource.bodySite =
|
|
2433
|
-
import_language_fhir_419.b.lookupValue("http://hl7.org/fhir/ValueSet/body-site|4.0.1",
|
|
2525
|
+
resource.bodySite = props.bodySite.map(
|
|
2526
|
+
(x) => import_language_fhir_419.b.concept(import_language_fhir_419.b.lookupValue("http://hl7.org/fhir/ValueSet/body-site|4.0.1", x))
|
|
2434
2527
|
);
|
|
2435
2528
|
import_language_fhir_419.b.ensureConceptText(resource.bodySite);
|
|
2436
2529
|
}
|
|
@@ -2440,6 +2533,12 @@ function SzLabRequest_default(props) {
|
|
|
2440
2533
|
}
|
|
2441
2534
|
resource.relevantHistory = import_language_fhir_419.b.reference(props.relevantHistory);
|
|
2442
2535
|
}
|
|
2536
|
+
resource.text = {
|
|
2537
|
+
status: "generated",
|
|
2538
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
2539
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
2540
|
+
</div>`
|
|
2541
|
+
};
|
|
2443
2542
|
return resource;
|
|
2444
2543
|
}
|
|
2445
2544
|
|
|
@@ -2490,9 +2589,8 @@ function SzReferral_default(props) {
|
|
|
2490
2589
|
if (!Array.isArray(props.category)) {
|
|
2491
2590
|
props.category = [props.category];
|
|
2492
2591
|
}
|
|
2493
|
-
resource.category =
|
|
2494
|
-
"http://hl7.org/fhir/ValueSet/servicerequest-category|4.0.1",
|
|
2495
|
-
props.category
|
|
2592
|
+
resource.category = props.category.map((x) => import_language_fhir_420.b.concept(
|
|
2593
|
+
import_language_fhir_420.b.lookupValue("http://hl7.org/fhir/ValueSet/servicerequest-category|4.0.1", x)
|
|
2496
2594
|
));
|
|
2497
2595
|
import_language_fhir_420.b.ensureConceptText(resource.category);
|
|
2498
2596
|
}
|
|
@@ -2506,9 +2604,8 @@ function SzReferral_default(props) {
|
|
|
2506
2604
|
if (!Array.isArray(props.orderDetail)) {
|
|
2507
2605
|
props.orderDetail = [props.orderDetail];
|
|
2508
2606
|
}
|
|
2509
|
-
resource.orderDetail =
|
|
2510
|
-
"http://hl7.org/fhir/ValueSet/servicerequest-orderdetail|4.0.1",
|
|
2511
|
-
props.orderDetail
|
|
2607
|
+
resource.orderDetail = props.orderDetail.map((x) => import_language_fhir_420.b.concept(
|
|
2608
|
+
import_language_fhir_420.b.lookupValue("http://hl7.org/fhir/ValueSet/servicerequest-orderdetail|4.0.1", x)
|
|
2512
2609
|
));
|
|
2513
2610
|
import_language_fhir_420.b.ensureConceptText(resource.orderDetail);
|
|
2514
2611
|
}
|
|
@@ -2549,10 +2646,10 @@ function SzReferral_default(props) {
|
|
|
2549
2646
|
if (!Array.isArray(props.locationCode)) {
|
|
2550
2647
|
props.locationCode = [props.locationCode];
|
|
2551
2648
|
}
|
|
2552
|
-
resource.locationCode = import_language_fhir_420.b.concept(import_language_fhir_420.b.lookupValue(
|
|
2649
|
+
resource.locationCode = props.locationCode.map((x) => import_language_fhir_420.b.concept(import_language_fhir_420.b.lookupValue(
|
|
2553
2650
|
"http://terminology.hl7.org/ValueSet/v3-ServiceDeliveryLocationRoleType",
|
|
2554
|
-
|
|
2555
|
-
));
|
|
2651
|
+
x
|
|
2652
|
+
)));
|
|
2556
2653
|
import_language_fhir_420.b.ensureConceptText(resource.locationCode);
|
|
2557
2654
|
}
|
|
2558
2655
|
if (!import_lodash19.default.isNil(props.locationReference)) {
|
|
@@ -2565,8 +2662,8 @@ function SzReferral_default(props) {
|
|
|
2565
2662
|
if (!Array.isArray(props.reasonCode)) {
|
|
2566
2663
|
props.reasonCode = [props.reasonCode];
|
|
2567
2664
|
}
|
|
2568
|
-
resource.reasonCode =
|
|
2569
|
-
import_language_fhir_420.b.lookupValue("http://hl7.org/fhir/ValueSet/procedure-reason|4.0.1",
|
|
2665
|
+
resource.reasonCode = props.reasonCode.map(
|
|
2666
|
+
(x) => import_language_fhir_420.b.concept(import_language_fhir_420.b.lookupValue("http://hl7.org/fhir/ValueSet/procedure-reason|4.0.1", x))
|
|
2570
2667
|
);
|
|
2571
2668
|
import_language_fhir_420.b.ensureConceptText(resource.reasonCode);
|
|
2572
2669
|
}
|
|
@@ -2598,8 +2695,8 @@ function SzReferral_default(props) {
|
|
|
2598
2695
|
if (!Array.isArray(props.bodySite)) {
|
|
2599
2696
|
props.bodySite = [props.bodySite];
|
|
2600
2697
|
}
|
|
2601
|
-
resource.bodySite =
|
|
2602
|
-
import_language_fhir_420.b.lookupValue("http://hl7.org/fhir/ValueSet/body-site|4.0.1",
|
|
2698
|
+
resource.bodySite = props.bodySite.map(
|
|
2699
|
+
(x) => import_language_fhir_420.b.concept(import_language_fhir_420.b.lookupValue("http://hl7.org/fhir/ValueSet/body-site|4.0.1", x))
|
|
2603
2700
|
);
|
|
2604
2701
|
import_language_fhir_420.b.ensureConceptText(resource.bodySite);
|
|
2605
2702
|
}
|
|
@@ -2609,6 +2706,12 @@ function SzReferral_default(props) {
|
|
|
2609
2706
|
}
|
|
2610
2707
|
resource.relevantHistory = import_language_fhir_420.b.reference(props.relevantHistory);
|
|
2611
2708
|
}
|
|
2709
|
+
resource.text = {
|
|
2710
|
+
status: "generated",
|
|
2711
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
2712
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
2713
|
+
</div>`
|
|
2714
|
+
};
|
|
2612
2715
|
return resource;
|
|
2613
2716
|
}
|
|
2614
2717
|
|
|
@@ -2690,11 +2793,17 @@ function SzLabSpecimen_default(props) {
|
|
|
2690
2793
|
if (!Array.isArray(props.condition)) {
|
|
2691
2794
|
props.condition = [props.condition];
|
|
2692
2795
|
}
|
|
2693
|
-
resource.condition =
|
|
2694
|
-
import_language_fhir_421.b.lookupValue("http://terminology.hl7.org/ValueSet/v2-0493|3.0.0",
|
|
2796
|
+
resource.condition = props.condition.map(
|
|
2797
|
+
(x) => import_language_fhir_421.b.concept(import_language_fhir_421.b.lookupValue("http://terminology.hl7.org/ValueSet/v2-0493|3.0.0", x))
|
|
2695
2798
|
);
|
|
2696
2799
|
import_language_fhir_421.b.ensureConceptText(resource.condition);
|
|
2697
2800
|
}
|
|
2801
|
+
resource.text = {
|
|
2802
|
+
status: "generated",
|
|
2803
|
+
div: `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
2804
|
+
<h2>${resource.resourceType}: ${resource.id || "(anon)"}</h2>
|
|
2805
|
+
</div>`
|
|
2806
|
+
};
|
|
2698
2807
|
return resource;
|
|
2699
2808
|
}
|
|
2700
2809
|
|
|
@@ -2921,7 +3030,7 @@ function specimen(type, props) {
|
|
|
2921
3030
|
// src/Adaptor.ts
|
|
2922
3031
|
var import_language_fhir_423 = require("@openfn/language-fhir-4");
|
|
2923
3032
|
var import_language_common = require("@openfn/language-common");
|
|
2924
|
-
var BASE_URL = "
|
|
3033
|
+
var BASE_URL = "https://hapifhir.eswatinihie.com";
|
|
2925
3034
|
function addToBundle(resources, name = "bundle") {
|
|
2926
3035
|
return (state) => {
|
|
2927
3036
|
let [$resources, $name] = (0, import_util.expandReferences)(state, resources, name);
|