@openfn/language-fhir-eswatini 0.2.1 → 0.3.0
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 +603 -690
- package/dist/index.js +601 -688
- package/package.json +4 -4
- package/types/builders.d.ts +111 -169
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ __export(builders_exports, {
|
|
|
49
49
|
ext: () => ext,
|
|
50
50
|
extendSystemMap: () => extendSystemMap,
|
|
51
51
|
extendValues: () => extendValues,
|
|
52
|
-
extension: () =>
|
|
52
|
+
extension: () => extension,
|
|
53
53
|
findExtension: () => findExtension,
|
|
54
54
|
id: () => id,
|
|
55
55
|
identifier: () => identifier,
|
|
@@ -584,190 +584,50 @@ function SzEpisodeOfCare_default(props) {
|
|
|
584
584
|
return resource;
|
|
585
585
|
}
|
|
586
586
|
|
|
587
|
-
// src/profiles/
|
|
587
|
+
// src/profiles/SzLocation.ts
|
|
588
588
|
import _5 from "lodash";
|
|
589
589
|
import { b as dt5 } from "@openfn/language-fhir-4";
|
|
590
|
-
function SzAuthorizerExtension_default(props) {
|
|
591
|
-
const resource = {
|
|
592
|
-
resourceType: "Extension",
|
|
593
|
-
...props
|
|
594
|
-
};
|
|
595
|
-
if (!_5.isNil(props.value)) {
|
|
596
|
-
delete resource.value;
|
|
597
|
-
dt5.composite(resource, "value", props.value);
|
|
598
|
-
}
|
|
599
|
-
resource.meta = {
|
|
600
|
-
profile: [
|
|
601
|
-
`http://172.209.216.154:3447/fhir/StructureDefinition/Sz${resource.resourceType}`
|
|
602
|
-
]
|
|
603
|
-
};
|
|
604
|
-
return resource;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
// src/profiles/SzChiefdomExtension.ts
|
|
608
|
-
import _6 from "lodash";
|
|
609
|
-
import { b as dt6 } from "@openfn/language-fhir-4";
|
|
610
|
-
function SzChiefdomExtension_default(props) {
|
|
611
|
-
const resource = {
|
|
612
|
-
resourceType: "Extension",
|
|
613
|
-
...props
|
|
614
|
-
};
|
|
615
|
-
if (!_6.isNil(props.value)) {
|
|
616
|
-
delete resource.value;
|
|
617
|
-
dt6.composite(resource, "value", props.value);
|
|
618
|
-
}
|
|
619
|
-
resource.meta = {
|
|
620
|
-
profile: [
|
|
621
|
-
`http://172.209.216.154:3447/fhir/StructureDefinition/Sz${resource.resourceType}`
|
|
622
|
-
]
|
|
623
|
-
};
|
|
624
|
-
return resource;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
// src/profiles/SzInkhundlaExtension.ts
|
|
628
|
-
import _7 from "lodash";
|
|
629
|
-
import { b as dt7 } from "@openfn/language-fhir-4";
|
|
630
|
-
function SzInkhundlaExtension_default(props) {
|
|
631
|
-
const resource = {
|
|
632
|
-
resourceType: "Extension",
|
|
633
|
-
...props
|
|
634
|
-
};
|
|
635
|
-
if (!_7.isNil(props.value)) {
|
|
636
|
-
delete resource.value;
|
|
637
|
-
dt7.composite(resource, "value", props.value);
|
|
638
|
-
}
|
|
639
|
-
resource.meta = {
|
|
640
|
-
profile: [
|
|
641
|
-
`http://172.209.216.154:3447/fhir/StructureDefinition/Sz${resource.resourceType}`
|
|
642
|
-
]
|
|
643
|
-
};
|
|
644
|
-
return resource;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
// src/profiles/SzLocationCodeExtension.ts
|
|
648
|
-
import _8 from "lodash";
|
|
649
|
-
import { b as dt8 } from "@openfn/language-fhir-4";
|
|
650
|
-
function SzLocationCodeExtension_default(props) {
|
|
651
|
-
const resource = {
|
|
652
|
-
resourceType: "Extension",
|
|
653
|
-
...props
|
|
654
|
-
};
|
|
655
|
-
if (!_8.isNil(props.value)) {
|
|
656
|
-
delete resource.value;
|
|
657
|
-
dt8.composite(resource, "value", props.value);
|
|
658
|
-
}
|
|
659
|
-
resource.meta = {
|
|
660
|
-
profile: [
|
|
661
|
-
`http://172.209.216.154:3447/fhir/StructureDefinition/Sz${resource.resourceType}`
|
|
662
|
-
]
|
|
663
|
-
};
|
|
664
|
-
return resource;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
// src/profiles/SzReferralRecipientExtension.ts
|
|
668
|
-
import _9 from "lodash";
|
|
669
|
-
import { b as dt9 } from "@openfn/language-fhir-4";
|
|
670
|
-
function SzReferralRecipientExtension_default(props) {
|
|
671
|
-
const resource = {
|
|
672
|
-
resourceType: "Extension",
|
|
673
|
-
...props
|
|
674
|
-
};
|
|
675
|
-
if (!_9.isNil(props.value)) {
|
|
676
|
-
delete resource.value;
|
|
677
|
-
dt9.composite(resource, "value", props.value);
|
|
678
|
-
}
|
|
679
|
-
resource.meta = {
|
|
680
|
-
profile: [
|
|
681
|
-
`http://172.209.216.154:3447/fhir/StructureDefinition/Sz${resource.resourceType}`
|
|
682
|
-
]
|
|
683
|
-
};
|
|
684
|
-
return resource;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
// src/profiles/SzRegistrationDate.ts
|
|
688
|
-
import _10 from "lodash";
|
|
689
|
-
import { b as dt10 } from "@openfn/language-fhir-4";
|
|
690
|
-
function SzRegistrationDate_default(props) {
|
|
691
|
-
const resource = {
|
|
692
|
-
resourceType: "Extension",
|
|
693
|
-
...props
|
|
694
|
-
};
|
|
695
|
-
if (!_10.isNil(props.value)) {
|
|
696
|
-
delete resource.value;
|
|
697
|
-
dt10.composite(resource, "value", props.value);
|
|
698
|
-
}
|
|
699
|
-
resource.meta = {
|
|
700
|
-
profile: [
|
|
701
|
-
`http://172.209.216.154:3447/fhir/StructureDefinition/Sz${resource.resourceType}`
|
|
702
|
-
]
|
|
703
|
-
};
|
|
704
|
-
return resource;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
// src/profiles/SzTestingLabExtension.ts
|
|
708
|
-
import _11 from "lodash";
|
|
709
|
-
import { b as dt11 } from "@openfn/language-fhir-4";
|
|
710
|
-
function SzTestingLabExtension_default(props) {
|
|
711
|
-
const resource = {
|
|
712
|
-
resourceType: "Extension",
|
|
713
|
-
...props
|
|
714
|
-
};
|
|
715
|
-
if (!_11.isNil(props.value)) {
|
|
716
|
-
delete resource.value;
|
|
717
|
-
dt11.composite(resource, "value", props.value);
|
|
718
|
-
}
|
|
719
|
-
resource.meta = {
|
|
720
|
-
profile: [
|
|
721
|
-
`http://172.209.216.154:3447/fhir/StructureDefinition/Sz${resource.resourceType}`
|
|
722
|
-
]
|
|
723
|
-
};
|
|
724
|
-
return resource;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
// src/profiles/SzLocation.ts
|
|
728
|
-
import _12 from "lodash";
|
|
729
|
-
import { b as dt12 } from "@openfn/language-fhir-4";
|
|
730
590
|
function SzLocation_default(props) {
|
|
731
591
|
const resource = {
|
|
732
592
|
resourceType: "Location",
|
|
733
593
|
...props
|
|
734
594
|
};
|
|
735
|
-
if (!
|
|
595
|
+
if (!_5.isNil(props.identifier)) {
|
|
736
596
|
if (!Array.isArray(props.identifier)) {
|
|
737
597
|
props.identifier = [props.identifier];
|
|
738
598
|
}
|
|
739
|
-
resource.identifier =
|
|
599
|
+
resource.identifier = dt5.identifier(props.identifier);
|
|
740
600
|
}
|
|
741
|
-
if (!
|
|
601
|
+
if (!_5.isNil(props.operationalStatus)) {
|
|
742
602
|
let src = props.operationalStatus;
|
|
743
603
|
if (typeof src === "string") {
|
|
744
|
-
src =
|
|
604
|
+
src = dt5.lookupValue("http://terminology.hl7.org/ValueSet/v2-0116", src);
|
|
745
605
|
}
|
|
746
|
-
resource.operationalStatus =
|
|
606
|
+
resource.operationalStatus = dt5.coding(src);
|
|
747
607
|
}
|
|
748
|
-
if (!
|
|
608
|
+
if (!_5.isNil(props.type)) {
|
|
749
609
|
if (!Array.isArray(props.type)) {
|
|
750
610
|
props.type = [props.type];
|
|
751
611
|
}
|
|
752
|
-
resource.type =
|
|
612
|
+
resource.type = dt5.concept(props.type);
|
|
753
613
|
}
|
|
754
|
-
if (!
|
|
755
|
-
resource.physicalType =
|
|
614
|
+
if (!_5.isNil(props.physicalType)) {
|
|
615
|
+
resource.physicalType = dt5.concept(props.physicalType);
|
|
756
616
|
}
|
|
757
|
-
if (!
|
|
617
|
+
if (!_5.isNil(props.position)) {
|
|
758
618
|
let src = props.position;
|
|
759
619
|
let _position = {
|
|
760
620
|
...item
|
|
761
621
|
};
|
|
762
622
|
resource.position = _position;
|
|
763
623
|
}
|
|
764
|
-
if (!
|
|
765
|
-
resource.managingOrganization =
|
|
624
|
+
if (!_5.isNil(props.managingOrganization)) {
|
|
625
|
+
resource.managingOrganization = dt5.reference(props.managingOrganization);
|
|
766
626
|
}
|
|
767
|
-
if (!
|
|
768
|
-
resource.partOf =
|
|
627
|
+
if (!_5.isNil(props.partOf)) {
|
|
628
|
+
resource.partOf = dt5.reference(props.partOf);
|
|
769
629
|
}
|
|
770
|
-
if (!
|
|
630
|
+
if (!_5.isNil(props.hoursOfOperation)) {
|
|
771
631
|
let src = props.hoursOfOperation;
|
|
772
632
|
if (!Array.isArray(src)) {
|
|
773
633
|
src = [src];
|
|
@@ -780,11 +640,11 @@ function SzLocation_default(props) {
|
|
|
780
640
|
resource.hoursOfOperation.push(_hoursOfOperation);
|
|
781
641
|
}
|
|
782
642
|
}
|
|
783
|
-
if (!
|
|
643
|
+
if (!_5.isNil(props.endpoint)) {
|
|
784
644
|
if (!Array.isArray(props.endpoint)) {
|
|
785
645
|
props.endpoint = [props.endpoint];
|
|
786
646
|
}
|
|
787
|
-
resource.endpoint =
|
|
647
|
+
resource.endpoint = dt5.reference(props.endpoint);
|
|
788
648
|
}
|
|
789
649
|
resource.meta = {
|
|
790
650
|
profile: [
|
|
@@ -795,29 +655,29 @@ function SzLocation_default(props) {
|
|
|
795
655
|
}
|
|
796
656
|
|
|
797
657
|
// src/profiles/SzMedication.ts
|
|
798
|
-
import
|
|
799
|
-
import { b as
|
|
658
|
+
import _6 from "lodash";
|
|
659
|
+
import { b as dt6 } from "@openfn/language-fhir-4";
|
|
800
660
|
function SzMedication_default(props) {
|
|
801
661
|
const resource = {
|
|
802
662
|
resourceType: "Medication",
|
|
803
663
|
...props
|
|
804
664
|
};
|
|
805
|
-
if (!
|
|
665
|
+
if (!_6.isNil(props.identifier)) {
|
|
806
666
|
if (!Array.isArray(props.identifier)) {
|
|
807
667
|
props.identifier = [props.identifier];
|
|
808
668
|
}
|
|
809
|
-
resource.identifier =
|
|
669
|
+
resource.identifier = dt6.identifier(props.identifier);
|
|
810
670
|
}
|
|
811
|
-
if (!
|
|
812
|
-
resource.code =
|
|
671
|
+
if (!_6.isNil(props.code)) {
|
|
672
|
+
resource.code = dt6.concept(props.code);
|
|
813
673
|
}
|
|
814
|
-
if (!
|
|
815
|
-
resource.manufacturer =
|
|
674
|
+
if (!_6.isNil(props.manufacturer)) {
|
|
675
|
+
resource.manufacturer = dt6.reference(props.manufacturer);
|
|
816
676
|
}
|
|
817
|
-
if (!
|
|
818
|
-
resource.form =
|
|
677
|
+
if (!_6.isNil(props.form)) {
|
|
678
|
+
resource.form = dt6.concept(props.form);
|
|
819
679
|
}
|
|
820
|
-
if (!
|
|
680
|
+
if (!_6.isNil(props.ingredient)) {
|
|
821
681
|
let src = props.ingredient;
|
|
822
682
|
if (!Array.isArray(src)) {
|
|
823
683
|
src = [src];
|
|
@@ -830,7 +690,7 @@ function SzMedication_default(props) {
|
|
|
830
690
|
resource.ingredient.push(_ingredient);
|
|
831
691
|
}
|
|
832
692
|
}
|
|
833
|
-
if (!
|
|
693
|
+
if (!_6.isNil(props.batch)) {
|
|
834
694
|
let src = props.batch;
|
|
835
695
|
let _batch = {
|
|
836
696
|
...item
|
|
@@ -846,49 +706,49 @@ function SzMedication_default(props) {
|
|
|
846
706
|
}
|
|
847
707
|
|
|
848
708
|
// src/profiles/SzMedicationDispense.ts
|
|
849
|
-
import
|
|
850
|
-
import { b as
|
|
709
|
+
import _7 from "lodash";
|
|
710
|
+
import { b as dt7 } from "@openfn/language-fhir-4";
|
|
851
711
|
function SzMedicationDispense_default(props) {
|
|
852
712
|
const resource = {
|
|
853
713
|
resourceType: "MedicationDispense",
|
|
854
714
|
...props
|
|
855
715
|
};
|
|
856
|
-
if (!
|
|
716
|
+
if (!_7.isNil(props.identifier)) {
|
|
857
717
|
if (!Array.isArray(props.identifier)) {
|
|
858
718
|
props.identifier = [props.identifier];
|
|
859
719
|
}
|
|
860
|
-
resource.identifier =
|
|
720
|
+
resource.identifier = dt7.identifier(props.identifier);
|
|
861
721
|
}
|
|
862
|
-
if (!
|
|
722
|
+
if (!_7.isNil(props.partOf)) {
|
|
863
723
|
if (!Array.isArray(props.partOf)) {
|
|
864
724
|
props.partOf = [props.partOf];
|
|
865
725
|
}
|
|
866
|
-
resource.partOf =
|
|
726
|
+
resource.partOf = dt7.reference(props.partOf);
|
|
867
727
|
}
|
|
868
|
-
if (!
|
|
728
|
+
if (!_7.isNil(props.statusReason)) {
|
|
869
729
|
delete resource.statusReason;
|
|
870
|
-
|
|
730
|
+
dt7.composite(resource, "statusReason", props.statusReason);
|
|
871
731
|
}
|
|
872
|
-
if (!
|
|
873
|
-
resource.category =
|
|
732
|
+
if (!_7.isNil(props.category)) {
|
|
733
|
+
resource.category = dt7.concept(props.category);
|
|
874
734
|
}
|
|
875
|
-
if (!
|
|
735
|
+
if (!_7.isNil(props.medication)) {
|
|
876
736
|
delete resource.medication;
|
|
877
|
-
|
|
737
|
+
dt7.composite(resource, "medication", props.medication);
|
|
878
738
|
}
|
|
879
|
-
if (!
|
|
880
|
-
resource.subject =
|
|
739
|
+
if (!_7.isNil(props.subject)) {
|
|
740
|
+
resource.subject = dt7.reference(props.subject);
|
|
881
741
|
}
|
|
882
|
-
if (!
|
|
883
|
-
resource.context =
|
|
742
|
+
if (!_7.isNil(props.context)) {
|
|
743
|
+
resource.context = dt7.reference(props.context);
|
|
884
744
|
}
|
|
885
|
-
if (!
|
|
745
|
+
if (!_7.isNil(props.supportingInformation)) {
|
|
886
746
|
if (!Array.isArray(props.supportingInformation)) {
|
|
887
747
|
props.supportingInformation = [props.supportingInformation];
|
|
888
748
|
}
|
|
889
|
-
resource.supportingInformation =
|
|
749
|
+
resource.supportingInformation = dt7.reference(props.supportingInformation);
|
|
890
750
|
}
|
|
891
|
-
if (!
|
|
751
|
+
if (!_7.isNil(props.performer)) {
|
|
892
752
|
let src = props.performer;
|
|
893
753
|
if (!Array.isArray(src)) {
|
|
894
754
|
src = [src];
|
|
@@ -901,45 +761,45 @@ function SzMedicationDispense_default(props) {
|
|
|
901
761
|
resource.performer.push(_performer);
|
|
902
762
|
}
|
|
903
763
|
}
|
|
904
|
-
if (!
|
|
905
|
-
resource.location =
|
|
764
|
+
if (!_7.isNil(props.location)) {
|
|
765
|
+
resource.location = dt7.reference(props.location);
|
|
906
766
|
}
|
|
907
|
-
if (!
|
|
767
|
+
if (!_7.isNil(props.authorizingPrescription)) {
|
|
908
768
|
if (!Array.isArray(props.authorizingPrescription)) {
|
|
909
769
|
props.authorizingPrescription = [props.authorizingPrescription];
|
|
910
770
|
}
|
|
911
|
-
resource.authorizingPrescription =
|
|
771
|
+
resource.authorizingPrescription = dt7.reference(props.authorizingPrescription);
|
|
912
772
|
}
|
|
913
|
-
if (!
|
|
914
|
-
resource.type =
|
|
773
|
+
if (!_7.isNil(props.type)) {
|
|
774
|
+
resource.type = dt7.concept(props.type);
|
|
915
775
|
}
|
|
916
|
-
if (!
|
|
917
|
-
resource.destination =
|
|
776
|
+
if (!_7.isNil(props.destination)) {
|
|
777
|
+
resource.destination = dt7.reference(props.destination);
|
|
918
778
|
}
|
|
919
|
-
if (!
|
|
779
|
+
if (!_7.isNil(props.receiver)) {
|
|
920
780
|
if (!Array.isArray(props.receiver)) {
|
|
921
781
|
props.receiver = [props.receiver];
|
|
922
782
|
}
|
|
923
|
-
resource.receiver =
|
|
783
|
+
resource.receiver = dt7.reference(props.receiver);
|
|
924
784
|
}
|
|
925
|
-
if (!
|
|
785
|
+
if (!_7.isNil(props.substitution)) {
|
|
926
786
|
let src = props.substitution;
|
|
927
787
|
let _substitution = {
|
|
928
788
|
...item
|
|
929
789
|
};
|
|
930
790
|
resource.substitution = _substitution;
|
|
931
791
|
}
|
|
932
|
-
if (!
|
|
792
|
+
if (!_7.isNil(props.detectedIssue)) {
|
|
933
793
|
if (!Array.isArray(props.detectedIssue)) {
|
|
934
794
|
props.detectedIssue = [props.detectedIssue];
|
|
935
795
|
}
|
|
936
|
-
resource.detectedIssue =
|
|
796
|
+
resource.detectedIssue = dt7.reference(props.detectedIssue);
|
|
937
797
|
}
|
|
938
|
-
if (!
|
|
798
|
+
if (!_7.isNil(props.eventHistory)) {
|
|
939
799
|
if (!Array.isArray(props.eventHistory)) {
|
|
940
800
|
props.eventHistory = [props.eventHistory];
|
|
941
801
|
}
|
|
942
|
-
resource.eventHistory =
|
|
802
|
+
resource.eventHistory = dt7.reference(props.eventHistory);
|
|
943
803
|
}
|
|
944
804
|
resource.meta = {
|
|
945
805
|
profile: [
|
|
@@ -950,91 +810,91 @@ function SzMedicationDispense_default(props) {
|
|
|
950
810
|
}
|
|
951
811
|
|
|
952
812
|
// src/profiles/SzMedicationRequest.ts
|
|
953
|
-
import
|
|
954
|
-
import { b as
|
|
813
|
+
import _8 from "lodash";
|
|
814
|
+
import { b as dt8 } from "@openfn/language-fhir-4";
|
|
955
815
|
function SzMedicationRequest_default(props) {
|
|
956
816
|
const resource = {
|
|
957
817
|
resourceType: "MedicationRequest",
|
|
958
818
|
...props
|
|
959
819
|
};
|
|
960
|
-
if (!
|
|
820
|
+
if (!_8.isNil(props.identifier)) {
|
|
961
821
|
if (!Array.isArray(props.identifier)) {
|
|
962
822
|
props.identifier = [props.identifier];
|
|
963
823
|
}
|
|
964
|
-
resource.identifier =
|
|
824
|
+
resource.identifier = dt8.identifier(props.identifier);
|
|
965
825
|
}
|
|
966
|
-
if (!
|
|
967
|
-
resource.statusReason =
|
|
826
|
+
if (!_8.isNil(props.statusReason)) {
|
|
827
|
+
resource.statusReason = dt8.concept(props.statusReason);
|
|
968
828
|
}
|
|
969
|
-
if (!
|
|
829
|
+
if (!_8.isNil(props.category)) {
|
|
970
830
|
if (!Array.isArray(props.category)) {
|
|
971
831
|
props.category = [props.category];
|
|
972
832
|
}
|
|
973
|
-
resource.category =
|
|
833
|
+
resource.category = dt8.concept(props.category);
|
|
974
834
|
}
|
|
975
|
-
if (!
|
|
835
|
+
if (!_8.isNil(props.reported)) {
|
|
976
836
|
delete resource.reported;
|
|
977
|
-
|
|
837
|
+
dt8.composite(resource, "reported", props.reported);
|
|
978
838
|
}
|
|
979
|
-
if (!
|
|
839
|
+
if (!_8.isNil(props.medication)) {
|
|
980
840
|
delete resource.medication;
|
|
981
|
-
|
|
841
|
+
dt8.composite(resource, "medication", props.medication);
|
|
982
842
|
}
|
|
983
|
-
if (!
|
|
984
|
-
resource.subject =
|
|
843
|
+
if (!_8.isNil(props.subject)) {
|
|
844
|
+
resource.subject = dt8.reference(props.subject);
|
|
985
845
|
}
|
|
986
|
-
if (!
|
|
987
|
-
resource.encounter =
|
|
846
|
+
if (!_8.isNil(props.encounter)) {
|
|
847
|
+
resource.encounter = dt8.reference(props.encounter);
|
|
988
848
|
}
|
|
989
|
-
if (!
|
|
849
|
+
if (!_8.isNil(props.supportingInformation)) {
|
|
990
850
|
if (!Array.isArray(props.supportingInformation)) {
|
|
991
851
|
props.supportingInformation = [props.supportingInformation];
|
|
992
852
|
}
|
|
993
|
-
resource.supportingInformation =
|
|
853
|
+
resource.supportingInformation = dt8.reference(props.supportingInformation);
|
|
994
854
|
}
|
|
995
|
-
if (!
|
|
996
|
-
resource.requester =
|
|
855
|
+
if (!_8.isNil(props.requester)) {
|
|
856
|
+
resource.requester = dt8.reference(props.requester);
|
|
997
857
|
}
|
|
998
|
-
if (!
|
|
999
|
-
resource.performer =
|
|
858
|
+
if (!_8.isNil(props.performer)) {
|
|
859
|
+
resource.performer = dt8.reference(props.performer);
|
|
1000
860
|
}
|
|
1001
|
-
if (!
|
|
1002
|
-
resource.performerType =
|
|
861
|
+
if (!_8.isNil(props.performerType)) {
|
|
862
|
+
resource.performerType = dt8.concept(props.performerType);
|
|
1003
863
|
}
|
|
1004
|
-
if (!
|
|
1005
|
-
resource.recorder =
|
|
864
|
+
if (!_8.isNil(props.recorder)) {
|
|
865
|
+
resource.recorder = dt8.reference(props.recorder);
|
|
1006
866
|
}
|
|
1007
|
-
if (!
|
|
867
|
+
if (!_8.isNil(props.reasonCode)) {
|
|
1008
868
|
if (!Array.isArray(props.reasonCode)) {
|
|
1009
869
|
props.reasonCode = [props.reasonCode];
|
|
1010
870
|
}
|
|
1011
|
-
resource.reasonCode =
|
|
871
|
+
resource.reasonCode = dt8.concept(props.reasonCode);
|
|
1012
872
|
}
|
|
1013
|
-
if (!
|
|
873
|
+
if (!_8.isNil(props.reasonReference)) {
|
|
1014
874
|
if (!Array.isArray(props.reasonReference)) {
|
|
1015
875
|
props.reasonReference = [props.reasonReference];
|
|
1016
876
|
}
|
|
1017
|
-
resource.reasonReference =
|
|
877
|
+
resource.reasonReference = dt8.reference(props.reasonReference);
|
|
1018
878
|
}
|
|
1019
|
-
if (!
|
|
879
|
+
if (!_8.isNil(props.basedOn)) {
|
|
1020
880
|
if (!Array.isArray(props.basedOn)) {
|
|
1021
881
|
props.basedOn = [props.basedOn];
|
|
1022
882
|
}
|
|
1023
|
-
resource.basedOn =
|
|
883
|
+
resource.basedOn = dt8.reference(props.basedOn);
|
|
1024
884
|
}
|
|
1025
|
-
if (!
|
|
1026
|
-
resource.groupIdentifier =
|
|
885
|
+
if (!_8.isNil(props.groupIdentifier)) {
|
|
886
|
+
resource.groupIdentifier = dt8.identifier(props.groupIdentifier);
|
|
1027
887
|
}
|
|
1028
|
-
if (!
|
|
1029
|
-
resource.courseOfTherapyType =
|
|
888
|
+
if (!_8.isNil(props.courseOfTherapyType)) {
|
|
889
|
+
resource.courseOfTherapyType = dt8.concept(props.courseOfTherapyType);
|
|
1030
890
|
}
|
|
1031
|
-
if (!
|
|
891
|
+
if (!_8.isNil(props.insurance)) {
|
|
1032
892
|
if (!Array.isArray(props.insurance)) {
|
|
1033
893
|
props.insurance = [props.insurance];
|
|
1034
894
|
}
|
|
1035
|
-
resource.insurance =
|
|
895
|
+
resource.insurance = dt8.reference(props.insurance);
|
|
1036
896
|
}
|
|
1037
|
-
if (!
|
|
897
|
+
if (!_8.isNil(props.dosageInstruction)) {
|
|
1038
898
|
let src = props.dosageInstruction;
|
|
1039
899
|
if (!Array.isArray(src)) {
|
|
1040
900
|
src = [src];
|
|
@@ -1047,34 +907,34 @@ function SzMedicationRequest_default(props) {
|
|
|
1047
907
|
resource.dosageInstruction.push(_dosageInstruction);
|
|
1048
908
|
}
|
|
1049
909
|
}
|
|
1050
|
-
if (!
|
|
910
|
+
if (!_8.isNil(props.dispenseRequest)) {
|
|
1051
911
|
let src = props.dispenseRequest;
|
|
1052
912
|
let _dispenseRequest = {
|
|
1053
913
|
...item
|
|
1054
914
|
};
|
|
1055
915
|
resource.dispenseRequest = _dispenseRequest;
|
|
1056
916
|
}
|
|
1057
|
-
if (!
|
|
917
|
+
if (!_8.isNil(props.substitution)) {
|
|
1058
918
|
let src = props.substitution;
|
|
1059
919
|
let _substitution = {
|
|
1060
920
|
...item
|
|
1061
921
|
};
|
|
1062
922
|
resource.substitution = _substitution;
|
|
1063
923
|
}
|
|
1064
|
-
if (!
|
|
1065
|
-
resource.priorPrescription =
|
|
924
|
+
if (!_8.isNil(props.priorPrescription)) {
|
|
925
|
+
resource.priorPrescription = dt8.reference(props.priorPrescription);
|
|
1066
926
|
}
|
|
1067
|
-
if (!
|
|
927
|
+
if (!_8.isNil(props.detectedIssue)) {
|
|
1068
928
|
if (!Array.isArray(props.detectedIssue)) {
|
|
1069
929
|
props.detectedIssue = [props.detectedIssue];
|
|
1070
930
|
}
|
|
1071
|
-
resource.detectedIssue =
|
|
931
|
+
resource.detectedIssue = dt8.reference(props.detectedIssue);
|
|
1072
932
|
}
|
|
1073
|
-
if (!
|
|
933
|
+
if (!_8.isNil(props.eventHistory)) {
|
|
1074
934
|
if (!Array.isArray(props.eventHistory)) {
|
|
1075
935
|
props.eventHistory = [props.eventHistory];
|
|
1076
936
|
}
|
|
1077
|
-
resource.eventHistory =
|
|
937
|
+
resource.eventHistory = dt8.reference(props.eventHistory);
|
|
1078
938
|
}
|
|
1079
939
|
resource.meta = {
|
|
1080
940
|
profile: [
|
|
@@ -1085,90 +945,90 @@ function SzMedicationRequest_default(props) {
|
|
|
1085
945
|
}
|
|
1086
946
|
|
|
1087
947
|
// src/profiles/SzCauseOfDeath.ts
|
|
1088
|
-
import
|
|
1089
|
-
import { b as
|
|
948
|
+
import _9 from "lodash";
|
|
949
|
+
import { b as dt9 } from "@openfn/language-fhir-4";
|
|
1090
950
|
function SzCauseOfDeath_default(props) {
|
|
1091
951
|
const resource = {
|
|
1092
952
|
resourceType: "Observation",
|
|
1093
953
|
...props
|
|
1094
954
|
};
|
|
1095
|
-
if (!
|
|
955
|
+
if (!_9.isNil(props.identifier)) {
|
|
1096
956
|
if (!Array.isArray(props.identifier)) {
|
|
1097
957
|
props.identifier = [props.identifier];
|
|
1098
958
|
}
|
|
1099
|
-
resource.identifier =
|
|
959
|
+
resource.identifier = dt9.identifier(props.identifier);
|
|
1100
960
|
}
|
|
1101
|
-
if (!
|
|
961
|
+
if (!_9.isNil(props.basedOn)) {
|
|
1102
962
|
if (!Array.isArray(props.basedOn)) {
|
|
1103
963
|
props.basedOn = [props.basedOn];
|
|
1104
964
|
}
|
|
1105
|
-
resource.basedOn =
|
|
965
|
+
resource.basedOn = dt9.reference(props.basedOn);
|
|
1106
966
|
}
|
|
1107
|
-
if (!
|
|
967
|
+
if (!_9.isNil(props.partOf)) {
|
|
1108
968
|
if (!Array.isArray(props.partOf)) {
|
|
1109
969
|
props.partOf = [props.partOf];
|
|
1110
970
|
}
|
|
1111
|
-
resource.partOf =
|
|
971
|
+
resource.partOf = dt9.reference(props.partOf);
|
|
1112
972
|
}
|
|
1113
|
-
if (!
|
|
973
|
+
if (!_9.isNil(props.category)) {
|
|
1114
974
|
if (!Array.isArray(props.category)) {
|
|
1115
975
|
props.category = [props.category];
|
|
1116
976
|
}
|
|
1117
|
-
resource.category =
|
|
977
|
+
resource.category = dt9.concept(props.category);
|
|
1118
978
|
}
|
|
1119
|
-
if (!
|
|
1120
|
-
resource.code =
|
|
979
|
+
if (!_9.isNil(props.code)) {
|
|
980
|
+
resource.code = dt9.concept(props.code);
|
|
1121
981
|
} else {
|
|
1122
982
|
resource.code = { "coding": [{ "system": "http://loinc.org", "code": "79378-6" }] };
|
|
1123
983
|
}
|
|
1124
|
-
if (!
|
|
1125
|
-
resource.subject =
|
|
984
|
+
if (!_9.isNil(props.subject)) {
|
|
985
|
+
resource.subject = dt9.reference(props.subject);
|
|
1126
986
|
}
|
|
1127
|
-
if (!
|
|
987
|
+
if (!_9.isNil(props.focus)) {
|
|
1128
988
|
if (!Array.isArray(props.focus)) {
|
|
1129
989
|
props.focus = [props.focus];
|
|
1130
990
|
}
|
|
1131
|
-
resource.focus =
|
|
991
|
+
resource.focus = dt9.reference(props.focus);
|
|
1132
992
|
}
|
|
1133
|
-
if (!
|
|
1134
|
-
resource.encounter =
|
|
993
|
+
if (!_9.isNil(props.encounter)) {
|
|
994
|
+
resource.encounter = dt9.reference(props.encounter);
|
|
1135
995
|
}
|
|
1136
|
-
if (!
|
|
996
|
+
if (!_9.isNil(props.effective)) {
|
|
1137
997
|
delete resource.effective;
|
|
1138
|
-
|
|
998
|
+
dt9.composite(resource, "effective", props.effective);
|
|
1139
999
|
}
|
|
1140
|
-
if (!
|
|
1000
|
+
if (!_9.isNil(props.performer)) {
|
|
1141
1001
|
if (!Array.isArray(props.performer)) {
|
|
1142
1002
|
props.performer = [props.performer];
|
|
1143
1003
|
}
|
|
1144
|
-
resource.performer =
|
|
1004
|
+
resource.performer = dt9.reference(props.performer);
|
|
1145
1005
|
}
|
|
1146
|
-
if (!
|
|
1006
|
+
if (!_9.isNil(props.value)) {
|
|
1147
1007
|
delete resource.value;
|
|
1148
|
-
|
|
1008
|
+
dt9.composite(resource, "value", props.value);
|
|
1149
1009
|
}
|
|
1150
|
-
if (!
|
|
1151
|
-
resource.dataAbsentReason =
|
|
1010
|
+
if (!_9.isNil(props.dataAbsentReason)) {
|
|
1011
|
+
resource.dataAbsentReason = dt9.concept(props.dataAbsentReason);
|
|
1152
1012
|
}
|
|
1153
|
-
if (!
|
|
1013
|
+
if (!_9.isNil(props.interpretation)) {
|
|
1154
1014
|
if (!Array.isArray(props.interpretation)) {
|
|
1155
1015
|
props.interpretation = [props.interpretation];
|
|
1156
1016
|
}
|
|
1157
|
-
resource.interpretation =
|
|
1017
|
+
resource.interpretation = dt9.concept(props.interpretation);
|
|
1158
1018
|
}
|
|
1159
|
-
if (!
|
|
1160
|
-
resource.bodySite =
|
|
1019
|
+
if (!_9.isNil(props.bodySite)) {
|
|
1020
|
+
resource.bodySite = dt9.concept(props.bodySite);
|
|
1161
1021
|
}
|
|
1162
|
-
if (!
|
|
1163
|
-
resource.method =
|
|
1022
|
+
if (!_9.isNil(props.method)) {
|
|
1023
|
+
resource.method = dt9.concept(props.method);
|
|
1164
1024
|
}
|
|
1165
|
-
if (!
|
|
1166
|
-
resource.specimen =
|
|
1025
|
+
if (!_9.isNil(props.specimen)) {
|
|
1026
|
+
resource.specimen = dt9.reference(props.specimen);
|
|
1167
1027
|
}
|
|
1168
|
-
if (!
|
|
1169
|
-
resource.device =
|
|
1028
|
+
if (!_9.isNil(props.device)) {
|
|
1029
|
+
resource.device = dt9.reference(props.device);
|
|
1170
1030
|
}
|
|
1171
|
-
if (!
|
|
1031
|
+
if (!_9.isNil(props.referenceRange)) {
|
|
1172
1032
|
let src = props.referenceRange;
|
|
1173
1033
|
if (!Array.isArray(src)) {
|
|
1174
1034
|
src = [src];
|
|
@@ -1181,19 +1041,19 @@ function SzCauseOfDeath_default(props) {
|
|
|
1181
1041
|
resource.referenceRange.push(_referenceRange);
|
|
1182
1042
|
}
|
|
1183
1043
|
}
|
|
1184
|
-
if (!
|
|
1044
|
+
if (!_9.isNil(props.hasMember)) {
|
|
1185
1045
|
if (!Array.isArray(props.hasMember)) {
|
|
1186
1046
|
props.hasMember = [props.hasMember];
|
|
1187
1047
|
}
|
|
1188
|
-
resource.hasMember =
|
|
1048
|
+
resource.hasMember = dt9.reference(props.hasMember);
|
|
1189
1049
|
}
|
|
1190
|
-
if (!
|
|
1050
|
+
if (!_9.isNil(props.derivedFrom)) {
|
|
1191
1051
|
if (!Array.isArray(props.derivedFrom)) {
|
|
1192
1052
|
props.derivedFrom = [props.derivedFrom];
|
|
1193
1053
|
}
|
|
1194
|
-
resource.derivedFrom =
|
|
1054
|
+
resource.derivedFrom = dt9.reference(props.derivedFrom);
|
|
1195
1055
|
}
|
|
1196
|
-
if (!
|
|
1056
|
+
if (!_9.isNil(props.component)) {
|
|
1197
1057
|
let src = props.component;
|
|
1198
1058
|
if (!Array.isArray(src)) {
|
|
1199
1059
|
src = [src];
|
|
@@ -1215,88 +1075,88 @@ function SzCauseOfDeath_default(props) {
|
|
|
1215
1075
|
}
|
|
1216
1076
|
|
|
1217
1077
|
// src/profiles/SzClinicalObservation.ts
|
|
1218
|
-
import
|
|
1219
|
-
import { b as
|
|
1078
|
+
import _10 from "lodash";
|
|
1079
|
+
import { b as dt10 } from "@openfn/language-fhir-4";
|
|
1220
1080
|
function SzClinicalObservation_default(props) {
|
|
1221
1081
|
const resource = {
|
|
1222
1082
|
resourceType: "Observation",
|
|
1223
1083
|
...props
|
|
1224
1084
|
};
|
|
1225
|
-
if (!
|
|
1085
|
+
if (!_10.isNil(props.identifier)) {
|
|
1226
1086
|
if (!Array.isArray(props.identifier)) {
|
|
1227
1087
|
props.identifier = [props.identifier];
|
|
1228
1088
|
}
|
|
1229
|
-
resource.identifier =
|
|
1089
|
+
resource.identifier = dt10.identifier(props.identifier);
|
|
1230
1090
|
}
|
|
1231
|
-
if (!
|
|
1091
|
+
if (!_10.isNil(props.basedOn)) {
|
|
1232
1092
|
if (!Array.isArray(props.basedOn)) {
|
|
1233
1093
|
props.basedOn = [props.basedOn];
|
|
1234
1094
|
}
|
|
1235
|
-
resource.basedOn =
|
|
1095
|
+
resource.basedOn = dt10.reference(props.basedOn);
|
|
1236
1096
|
}
|
|
1237
|
-
if (!
|
|
1097
|
+
if (!_10.isNil(props.partOf)) {
|
|
1238
1098
|
if (!Array.isArray(props.partOf)) {
|
|
1239
1099
|
props.partOf = [props.partOf];
|
|
1240
1100
|
}
|
|
1241
|
-
resource.partOf =
|
|
1101
|
+
resource.partOf = dt10.reference(props.partOf);
|
|
1242
1102
|
}
|
|
1243
|
-
if (!
|
|
1103
|
+
if (!_10.isNil(props.category)) {
|
|
1244
1104
|
if (!Array.isArray(props.category)) {
|
|
1245
1105
|
props.category = [props.category];
|
|
1246
1106
|
}
|
|
1247
|
-
resource.category =
|
|
1107
|
+
resource.category = dt10.concept(props.category);
|
|
1248
1108
|
}
|
|
1249
|
-
if (!
|
|
1250
|
-
resource.code =
|
|
1109
|
+
if (!_10.isNil(props.code)) {
|
|
1110
|
+
resource.code = dt10.concept(props.code);
|
|
1251
1111
|
}
|
|
1252
|
-
if (!
|
|
1253
|
-
resource.subject =
|
|
1112
|
+
if (!_10.isNil(props.subject)) {
|
|
1113
|
+
resource.subject = dt10.reference(props.subject);
|
|
1254
1114
|
}
|
|
1255
|
-
if (!
|
|
1115
|
+
if (!_10.isNil(props.focus)) {
|
|
1256
1116
|
if (!Array.isArray(props.focus)) {
|
|
1257
1117
|
props.focus = [props.focus];
|
|
1258
1118
|
}
|
|
1259
|
-
resource.focus =
|
|
1119
|
+
resource.focus = dt10.reference(props.focus);
|
|
1260
1120
|
}
|
|
1261
|
-
if (!
|
|
1262
|
-
resource.encounter =
|
|
1121
|
+
if (!_10.isNil(props.encounter)) {
|
|
1122
|
+
resource.encounter = dt10.reference(props.encounter);
|
|
1263
1123
|
}
|
|
1264
|
-
if (!
|
|
1124
|
+
if (!_10.isNil(props.effective)) {
|
|
1265
1125
|
delete resource.effective;
|
|
1266
|
-
|
|
1126
|
+
dt10.composite(resource, "effective", props.effective);
|
|
1267
1127
|
}
|
|
1268
|
-
if (!
|
|
1128
|
+
if (!_10.isNil(props.performer)) {
|
|
1269
1129
|
if (!Array.isArray(props.performer)) {
|
|
1270
1130
|
props.performer = [props.performer];
|
|
1271
1131
|
}
|
|
1272
|
-
resource.performer =
|
|
1132
|
+
resource.performer = dt10.reference(props.performer);
|
|
1273
1133
|
}
|
|
1274
|
-
if (!
|
|
1134
|
+
if (!_10.isNil(props.value)) {
|
|
1275
1135
|
delete resource.value;
|
|
1276
|
-
|
|
1136
|
+
dt10.composite(resource, "value", props.value);
|
|
1277
1137
|
}
|
|
1278
|
-
if (!
|
|
1279
|
-
resource.dataAbsentReason =
|
|
1138
|
+
if (!_10.isNil(props.dataAbsentReason)) {
|
|
1139
|
+
resource.dataAbsentReason = dt10.concept(props.dataAbsentReason);
|
|
1280
1140
|
}
|
|
1281
|
-
if (!
|
|
1141
|
+
if (!_10.isNil(props.interpretation)) {
|
|
1282
1142
|
if (!Array.isArray(props.interpretation)) {
|
|
1283
1143
|
props.interpretation = [props.interpretation];
|
|
1284
1144
|
}
|
|
1285
|
-
resource.interpretation =
|
|
1145
|
+
resource.interpretation = dt10.concept(props.interpretation);
|
|
1286
1146
|
}
|
|
1287
|
-
if (!
|
|
1288
|
-
resource.bodySite =
|
|
1147
|
+
if (!_10.isNil(props.bodySite)) {
|
|
1148
|
+
resource.bodySite = dt10.concept(props.bodySite);
|
|
1289
1149
|
}
|
|
1290
|
-
if (!
|
|
1291
|
-
resource.method =
|
|
1150
|
+
if (!_10.isNil(props.method)) {
|
|
1151
|
+
resource.method = dt10.concept(props.method);
|
|
1292
1152
|
}
|
|
1293
|
-
if (!
|
|
1294
|
-
resource.specimen =
|
|
1153
|
+
if (!_10.isNil(props.specimen)) {
|
|
1154
|
+
resource.specimen = dt10.reference(props.specimen);
|
|
1295
1155
|
}
|
|
1296
|
-
if (!
|
|
1297
|
-
resource.device =
|
|
1156
|
+
if (!_10.isNil(props.device)) {
|
|
1157
|
+
resource.device = dt10.reference(props.device);
|
|
1298
1158
|
}
|
|
1299
|
-
if (!
|
|
1159
|
+
if (!_10.isNil(props.referenceRange)) {
|
|
1300
1160
|
let src = props.referenceRange;
|
|
1301
1161
|
if (!Array.isArray(src)) {
|
|
1302
1162
|
src = [src];
|
|
@@ -1309,19 +1169,19 @@ function SzClinicalObservation_default(props) {
|
|
|
1309
1169
|
resource.referenceRange.push(_referenceRange);
|
|
1310
1170
|
}
|
|
1311
1171
|
}
|
|
1312
|
-
if (!
|
|
1172
|
+
if (!_10.isNil(props.hasMember)) {
|
|
1313
1173
|
if (!Array.isArray(props.hasMember)) {
|
|
1314
1174
|
props.hasMember = [props.hasMember];
|
|
1315
1175
|
}
|
|
1316
|
-
resource.hasMember =
|
|
1176
|
+
resource.hasMember = dt10.reference(props.hasMember);
|
|
1317
1177
|
}
|
|
1318
|
-
if (!
|
|
1178
|
+
if (!_10.isNil(props.derivedFrom)) {
|
|
1319
1179
|
if (!Array.isArray(props.derivedFrom)) {
|
|
1320
1180
|
props.derivedFrom = [props.derivedFrom];
|
|
1321
1181
|
}
|
|
1322
|
-
resource.derivedFrom =
|
|
1182
|
+
resource.derivedFrom = dt10.reference(props.derivedFrom);
|
|
1323
1183
|
}
|
|
1324
|
-
if (!
|
|
1184
|
+
if (!_10.isNil(props.component)) {
|
|
1325
1185
|
let src = props.component;
|
|
1326
1186
|
if (!Array.isArray(src)) {
|
|
1327
1187
|
src = [src];
|
|
@@ -1343,88 +1203,106 @@ function SzClinicalObservation_default(props) {
|
|
|
1343
1203
|
}
|
|
1344
1204
|
|
|
1345
1205
|
// src/profiles/SzLabResult.ts
|
|
1346
|
-
import
|
|
1347
|
-
import { b as
|
|
1206
|
+
import _11 from "lodash";
|
|
1207
|
+
import { b as dt11 } from "@openfn/language-fhir-4";
|
|
1348
1208
|
function SzLabResult_default(props) {
|
|
1349
1209
|
const resource = {
|
|
1350
1210
|
resourceType: "Observation",
|
|
1351
1211
|
...props
|
|
1352
1212
|
};
|
|
1353
|
-
if (!
|
|
1213
|
+
if (!_11.isNil(props.authorizer)) {
|
|
1214
|
+
let src = props.authorizer;
|
|
1215
|
+
delete resource.authorizer;
|
|
1216
|
+
dt11.addExtension(
|
|
1217
|
+
resource,
|
|
1218
|
+
"http://172.209.216.154:3447/fhir/StructureDefinition/SzAuthorizerExtension",
|
|
1219
|
+
src
|
|
1220
|
+
);
|
|
1221
|
+
}
|
|
1222
|
+
if (!_11.isNil(props.testingLaboratory)) {
|
|
1223
|
+
let src = props.testingLaboratory;
|
|
1224
|
+
delete resource.testingLaboratory;
|
|
1225
|
+
dt11.addExtension(
|
|
1226
|
+
resource,
|
|
1227
|
+
"http://172.209.216.154:3447/fhir/StructureDefinition/SzTestingLabExtension",
|
|
1228
|
+
src
|
|
1229
|
+
);
|
|
1230
|
+
}
|
|
1231
|
+
if (!_11.isNil(props.identifier)) {
|
|
1354
1232
|
if (!Array.isArray(props.identifier)) {
|
|
1355
1233
|
props.identifier = [props.identifier];
|
|
1356
1234
|
}
|
|
1357
|
-
resource.identifier =
|
|
1235
|
+
resource.identifier = dt11.identifier(props.identifier);
|
|
1358
1236
|
}
|
|
1359
|
-
if (!
|
|
1237
|
+
if (!_11.isNil(props.basedOn)) {
|
|
1360
1238
|
if (!Array.isArray(props.basedOn)) {
|
|
1361
1239
|
props.basedOn = [props.basedOn];
|
|
1362
1240
|
}
|
|
1363
|
-
resource.basedOn =
|
|
1241
|
+
resource.basedOn = dt11.reference(props.basedOn);
|
|
1364
1242
|
}
|
|
1365
|
-
if (!
|
|
1243
|
+
if (!_11.isNil(props.partOf)) {
|
|
1366
1244
|
if (!Array.isArray(props.partOf)) {
|
|
1367
1245
|
props.partOf = [props.partOf];
|
|
1368
1246
|
}
|
|
1369
|
-
resource.partOf =
|
|
1247
|
+
resource.partOf = dt11.reference(props.partOf);
|
|
1370
1248
|
}
|
|
1371
|
-
if (!
|
|
1249
|
+
if (!_11.isNil(props.category)) {
|
|
1372
1250
|
if (!Array.isArray(props.category)) {
|
|
1373
1251
|
props.category = [props.category];
|
|
1374
1252
|
}
|
|
1375
|
-
resource.category =
|
|
1253
|
+
resource.category = dt11.concept(props.category);
|
|
1376
1254
|
}
|
|
1377
|
-
if (!
|
|
1378
|
-
resource.code =
|
|
1255
|
+
if (!_11.isNil(props.code)) {
|
|
1256
|
+
resource.code = dt11.concept(props.code);
|
|
1379
1257
|
}
|
|
1380
|
-
if (!
|
|
1381
|
-
resource.subject =
|
|
1258
|
+
if (!_11.isNil(props.subject)) {
|
|
1259
|
+
resource.subject = dt11.reference(props.subject);
|
|
1382
1260
|
}
|
|
1383
|
-
if (!
|
|
1261
|
+
if (!_11.isNil(props.focus)) {
|
|
1384
1262
|
if (!Array.isArray(props.focus)) {
|
|
1385
1263
|
props.focus = [props.focus];
|
|
1386
1264
|
}
|
|
1387
|
-
resource.focus =
|
|
1265
|
+
resource.focus = dt11.reference(props.focus);
|
|
1388
1266
|
}
|
|
1389
|
-
if (!
|
|
1390
|
-
resource.encounter =
|
|
1267
|
+
if (!_11.isNil(props.encounter)) {
|
|
1268
|
+
resource.encounter = dt11.reference(props.encounter);
|
|
1391
1269
|
}
|
|
1392
|
-
if (!
|
|
1270
|
+
if (!_11.isNil(props.effective)) {
|
|
1393
1271
|
delete resource.effective;
|
|
1394
|
-
|
|
1272
|
+
dt11.composite(resource, "effective", props.effective);
|
|
1395
1273
|
}
|
|
1396
|
-
if (!
|
|
1274
|
+
if (!_11.isNil(props.performer)) {
|
|
1397
1275
|
if (!Array.isArray(props.performer)) {
|
|
1398
1276
|
props.performer = [props.performer];
|
|
1399
1277
|
}
|
|
1400
|
-
resource.performer =
|
|
1278
|
+
resource.performer = dt11.reference(props.performer);
|
|
1401
1279
|
}
|
|
1402
|
-
if (!
|
|
1280
|
+
if (!_11.isNil(props.value)) {
|
|
1403
1281
|
delete resource.value;
|
|
1404
|
-
|
|
1282
|
+
dt11.composite(resource, "value", props.value);
|
|
1405
1283
|
}
|
|
1406
|
-
if (!
|
|
1407
|
-
resource.dataAbsentReason =
|
|
1284
|
+
if (!_11.isNil(props.dataAbsentReason)) {
|
|
1285
|
+
resource.dataAbsentReason = dt11.concept(props.dataAbsentReason);
|
|
1408
1286
|
}
|
|
1409
|
-
if (!
|
|
1287
|
+
if (!_11.isNil(props.interpretation)) {
|
|
1410
1288
|
if (!Array.isArray(props.interpretation)) {
|
|
1411
1289
|
props.interpretation = [props.interpretation];
|
|
1412
1290
|
}
|
|
1413
|
-
resource.interpretation =
|
|
1291
|
+
resource.interpretation = dt11.concept(props.interpretation);
|
|
1414
1292
|
}
|
|
1415
|
-
if (!
|
|
1416
|
-
resource.bodySite =
|
|
1293
|
+
if (!_11.isNil(props.bodySite)) {
|
|
1294
|
+
resource.bodySite = dt11.concept(props.bodySite);
|
|
1417
1295
|
}
|
|
1418
|
-
if (!
|
|
1419
|
-
resource.method =
|
|
1296
|
+
if (!_11.isNil(props.method)) {
|
|
1297
|
+
resource.method = dt11.concept(props.method);
|
|
1420
1298
|
}
|
|
1421
|
-
if (!
|
|
1422
|
-
resource.specimen =
|
|
1299
|
+
if (!_11.isNil(props.specimen)) {
|
|
1300
|
+
resource.specimen = dt11.reference(props.specimen);
|
|
1423
1301
|
}
|
|
1424
|
-
if (!
|
|
1425
|
-
resource.device =
|
|
1302
|
+
if (!_11.isNil(props.device)) {
|
|
1303
|
+
resource.device = dt11.reference(props.device);
|
|
1426
1304
|
}
|
|
1427
|
-
if (!
|
|
1305
|
+
if (!_11.isNil(props.referenceRange)) {
|
|
1428
1306
|
let src = props.referenceRange;
|
|
1429
1307
|
if (!Array.isArray(src)) {
|
|
1430
1308
|
src = [src];
|
|
@@ -1437,19 +1315,19 @@ function SzLabResult_default(props) {
|
|
|
1437
1315
|
resource.referenceRange.push(_referenceRange);
|
|
1438
1316
|
}
|
|
1439
1317
|
}
|
|
1440
|
-
if (!
|
|
1318
|
+
if (!_11.isNil(props.hasMember)) {
|
|
1441
1319
|
if (!Array.isArray(props.hasMember)) {
|
|
1442
1320
|
props.hasMember = [props.hasMember];
|
|
1443
1321
|
}
|
|
1444
|
-
resource.hasMember =
|
|
1322
|
+
resource.hasMember = dt11.reference(props.hasMember);
|
|
1445
1323
|
}
|
|
1446
|
-
if (!
|
|
1324
|
+
if (!_11.isNil(props.derivedFrom)) {
|
|
1447
1325
|
if (!Array.isArray(props.derivedFrom)) {
|
|
1448
1326
|
props.derivedFrom = [props.derivedFrom];
|
|
1449
1327
|
}
|
|
1450
|
-
resource.derivedFrom =
|
|
1328
|
+
resource.derivedFrom = dt11.reference(props.derivedFrom);
|
|
1451
1329
|
}
|
|
1452
|
-
if (!
|
|
1330
|
+
if (!_11.isNil(props.component)) {
|
|
1453
1331
|
let src = props.component;
|
|
1454
1332
|
if (!Array.isArray(src)) {
|
|
1455
1333
|
src = [src];
|
|
@@ -1471,90 +1349,90 @@ function SzLabResult_default(props) {
|
|
|
1471
1349
|
}
|
|
1472
1350
|
|
|
1473
1351
|
// src/profiles/SzMannerOfDeath.ts
|
|
1474
|
-
import
|
|
1475
|
-
import { b as
|
|
1352
|
+
import _12 from "lodash";
|
|
1353
|
+
import { b as dt12 } from "@openfn/language-fhir-4";
|
|
1476
1354
|
function SzMannerOfDeath_default(props) {
|
|
1477
1355
|
const resource = {
|
|
1478
1356
|
resourceType: "Observation",
|
|
1479
1357
|
...props
|
|
1480
1358
|
};
|
|
1481
|
-
if (!
|
|
1359
|
+
if (!_12.isNil(props.identifier)) {
|
|
1482
1360
|
if (!Array.isArray(props.identifier)) {
|
|
1483
1361
|
props.identifier = [props.identifier];
|
|
1484
1362
|
}
|
|
1485
|
-
resource.identifier =
|
|
1363
|
+
resource.identifier = dt12.identifier(props.identifier);
|
|
1486
1364
|
}
|
|
1487
|
-
if (!
|
|
1365
|
+
if (!_12.isNil(props.basedOn)) {
|
|
1488
1366
|
if (!Array.isArray(props.basedOn)) {
|
|
1489
1367
|
props.basedOn = [props.basedOn];
|
|
1490
1368
|
}
|
|
1491
|
-
resource.basedOn =
|
|
1369
|
+
resource.basedOn = dt12.reference(props.basedOn);
|
|
1492
1370
|
}
|
|
1493
|
-
if (!
|
|
1371
|
+
if (!_12.isNil(props.partOf)) {
|
|
1494
1372
|
if (!Array.isArray(props.partOf)) {
|
|
1495
1373
|
props.partOf = [props.partOf];
|
|
1496
1374
|
}
|
|
1497
|
-
resource.partOf =
|
|
1375
|
+
resource.partOf = dt12.reference(props.partOf);
|
|
1498
1376
|
}
|
|
1499
|
-
if (!
|
|
1377
|
+
if (!_12.isNil(props.category)) {
|
|
1500
1378
|
if (!Array.isArray(props.category)) {
|
|
1501
1379
|
props.category = [props.category];
|
|
1502
1380
|
}
|
|
1503
|
-
resource.category =
|
|
1381
|
+
resource.category = dt12.concept(props.category);
|
|
1504
1382
|
}
|
|
1505
|
-
if (!
|
|
1506
|
-
resource.code =
|
|
1383
|
+
if (!_12.isNil(props.code)) {
|
|
1384
|
+
resource.code = dt12.concept(props.code);
|
|
1507
1385
|
} else {
|
|
1508
1386
|
resource.code = { "coding": [{ "system": "http://loinc.org", "code": "69449-7" }] };
|
|
1509
1387
|
}
|
|
1510
|
-
if (!
|
|
1511
|
-
resource.subject =
|
|
1388
|
+
if (!_12.isNil(props.subject)) {
|
|
1389
|
+
resource.subject = dt12.reference(props.subject);
|
|
1512
1390
|
}
|
|
1513
|
-
if (!
|
|
1391
|
+
if (!_12.isNil(props.focus)) {
|
|
1514
1392
|
if (!Array.isArray(props.focus)) {
|
|
1515
1393
|
props.focus = [props.focus];
|
|
1516
1394
|
}
|
|
1517
|
-
resource.focus =
|
|
1395
|
+
resource.focus = dt12.reference(props.focus);
|
|
1518
1396
|
}
|
|
1519
|
-
if (!
|
|
1520
|
-
resource.encounter =
|
|
1397
|
+
if (!_12.isNil(props.encounter)) {
|
|
1398
|
+
resource.encounter = dt12.reference(props.encounter);
|
|
1521
1399
|
}
|
|
1522
|
-
if (!
|
|
1400
|
+
if (!_12.isNil(props.effective)) {
|
|
1523
1401
|
delete resource.effective;
|
|
1524
|
-
|
|
1402
|
+
dt12.composite(resource, "effective", props.effective);
|
|
1525
1403
|
}
|
|
1526
|
-
if (!
|
|
1404
|
+
if (!_12.isNil(props.performer)) {
|
|
1527
1405
|
if (!Array.isArray(props.performer)) {
|
|
1528
1406
|
props.performer = [props.performer];
|
|
1529
1407
|
}
|
|
1530
|
-
resource.performer =
|
|
1408
|
+
resource.performer = dt12.reference(props.performer);
|
|
1531
1409
|
}
|
|
1532
|
-
if (!
|
|
1410
|
+
if (!_12.isNil(props.value)) {
|
|
1533
1411
|
delete resource.value;
|
|
1534
|
-
|
|
1412
|
+
dt12.composite(resource, "value", props.value);
|
|
1535
1413
|
}
|
|
1536
|
-
if (!
|
|
1537
|
-
resource.dataAbsentReason =
|
|
1414
|
+
if (!_12.isNil(props.dataAbsentReason)) {
|
|
1415
|
+
resource.dataAbsentReason = dt12.concept(props.dataAbsentReason);
|
|
1538
1416
|
}
|
|
1539
|
-
if (!
|
|
1417
|
+
if (!_12.isNil(props.interpretation)) {
|
|
1540
1418
|
if (!Array.isArray(props.interpretation)) {
|
|
1541
1419
|
props.interpretation = [props.interpretation];
|
|
1542
1420
|
}
|
|
1543
|
-
resource.interpretation =
|
|
1421
|
+
resource.interpretation = dt12.concept(props.interpretation);
|
|
1544
1422
|
}
|
|
1545
|
-
if (!
|
|
1546
|
-
resource.bodySite =
|
|
1423
|
+
if (!_12.isNil(props.bodySite)) {
|
|
1424
|
+
resource.bodySite = dt12.concept(props.bodySite);
|
|
1547
1425
|
}
|
|
1548
|
-
if (!
|
|
1549
|
-
resource.method =
|
|
1426
|
+
if (!_12.isNil(props.method)) {
|
|
1427
|
+
resource.method = dt12.concept(props.method);
|
|
1550
1428
|
}
|
|
1551
|
-
if (!
|
|
1552
|
-
resource.specimen =
|
|
1429
|
+
if (!_12.isNil(props.specimen)) {
|
|
1430
|
+
resource.specimen = dt12.reference(props.specimen);
|
|
1553
1431
|
}
|
|
1554
|
-
if (!
|
|
1555
|
-
resource.device =
|
|
1432
|
+
if (!_12.isNil(props.device)) {
|
|
1433
|
+
resource.device = dt12.reference(props.device);
|
|
1556
1434
|
}
|
|
1557
|
-
if (!
|
|
1435
|
+
if (!_12.isNil(props.referenceRange)) {
|
|
1558
1436
|
let src = props.referenceRange;
|
|
1559
1437
|
if (!Array.isArray(src)) {
|
|
1560
1438
|
src = [src];
|
|
@@ -1567,19 +1445,19 @@ function SzMannerOfDeath_default(props) {
|
|
|
1567
1445
|
resource.referenceRange.push(_referenceRange);
|
|
1568
1446
|
}
|
|
1569
1447
|
}
|
|
1570
|
-
if (!
|
|
1448
|
+
if (!_12.isNil(props.hasMember)) {
|
|
1571
1449
|
if (!Array.isArray(props.hasMember)) {
|
|
1572
1450
|
props.hasMember = [props.hasMember];
|
|
1573
1451
|
}
|
|
1574
|
-
resource.hasMember =
|
|
1452
|
+
resource.hasMember = dt12.reference(props.hasMember);
|
|
1575
1453
|
}
|
|
1576
|
-
if (!
|
|
1454
|
+
if (!_12.isNil(props.derivedFrom)) {
|
|
1577
1455
|
if (!Array.isArray(props.derivedFrom)) {
|
|
1578
1456
|
props.derivedFrom = [props.derivedFrom];
|
|
1579
1457
|
}
|
|
1580
|
-
resource.derivedFrom =
|
|
1458
|
+
resource.derivedFrom = dt12.reference(props.derivedFrom);
|
|
1581
1459
|
}
|
|
1582
|
-
if (!
|
|
1460
|
+
if (!_12.isNil(props.component)) {
|
|
1583
1461
|
let src = props.component;
|
|
1584
1462
|
if (!Array.isArray(src)) {
|
|
1585
1463
|
src = [src];
|
|
@@ -1601,32 +1479,32 @@ function SzMannerOfDeath_default(props) {
|
|
|
1601
1479
|
}
|
|
1602
1480
|
|
|
1603
1481
|
// src/profiles/SzVitalSigns.ts
|
|
1604
|
-
import
|
|
1605
|
-
import { b as
|
|
1482
|
+
import _13 from "lodash";
|
|
1483
|
+
import { b as dt13 } from "@openfn/language-fhir-4";
|
|
1606
1484
|
function SzVitalSigns_default(props) {
|
|
1607
1485
|
const resource = {
|
|
1608
1486
|
resourceType: "Observation",
|
|
1609
1487
|
...props
|
|
1610
1488
|
};
|
|
1611
|
-
if (!
|
|
1489
|
+
if (!_13.isNil(props.identifier)) {
|
|
1612
1490
|
if (!Array.isArray(props.identifier)) {
|
|
1613
1491
|
props.identifier = [props.identifier];
|
|
1614
1492
|
}
|
|
1615
|
-
resource.identifier =
|
|
1493
|
+
resource.identifier = dt13.identifier(props.identifier);
|
|
1616
1494
|
}
|
|
1617
|
-
if (!
|
|
1495
|
+
if (!_13.isNil(props.basedOn)) {
|
|
1618
1496
|
if (!Array.isArray(props.basedOn)) {
|
|
1619
1497
|
props.basedOn = [props.basedOn];
|
|
1620
1498
|
}
|
|
1621
|
-
resource.basedOn =
|
|
1499
|
+
resource.basedOn = dt13.reference(props.basedOn);
|
|
1622
1500
|
}
|
|
1623
|
-
if (!
|
|
1501
|
+
if (!_13.isNil(props.partOf)) {
|
|
1624
1502
|
if (!Array.isArray(props.partOf)) {
|
|
1625
1503
|
props.partOf = [props.partOf];
|
|
1626
1504
|
}
|
|
1627
|
-
resource.partOf =
|
|
1505
|
+
resource.partOf = dt13.reference(props.partOf);
|
|
1628
1506
|
}
|
|
1629
|
-
if (!
|
|
1507
|
+
if (!_13.isNil(props.category)) {
|
|
1630
1508
|
let src = props.category;
|
|
1631
1509
|
if (!Array.isArray(src)) {
|
|
1632
1510
|
src = [src];
|
|
@@ -1639,57 +1517,57 @@ function SzVitalSigns_default(props) {
|
|
|
1639
1517
|
resource.category.push(_category);
|
|
1640
1518
|
}
|
|
1641
1519
|
}
|
|
1642
|
-
if (!
|
|
1643
|
-
resource.code =
|
|
1520
|
+
if (!_13.isNil(props.code)) {
|
|
1521
|
+
resource.code = dt13.concept(props.code);
|
|
1644
1522
|
}
|
|
1645
|
-
if (!
|
|
1646
|
-
resource.subject =
|
|
1523
|
+
if (!_13.isNil(props.subject)) {
|
|
1524
|
+
resource.subject = dt13.reference(props.subject);
|
|
1647
1525
|
}
|
|
1648
|
-
if (!
|
|
1526
|
+
if (!_13.isNil(props.focus)) {
|
|
1649
1527
|
if (!Array.isArray(props.focus)) {
|
|
1650
1528
|
props.focus = [props.focus];
|
|
1651
1529
|
}
|
|
1652
|
-
resource.focus =
|
|
1530
|
+
resource.focus = dt13.reference(props.focus);
|
|
1653
1531
|
}
|
|
1654
|
-
if (!
|
|
1655
|
-
resource.encounter =
|
|
1532
|
+
if (!_13.isNil(props.encounter)) {
|
|
1533
|
+
resource.encounter = dt13.reference(props.encounter);
|
|
1656
1534
|
}
|
|
1657
|
-
if (!
|
|
1535
|
+
if (!_13.isNil(props.effective)) {
|
|
1658
1536
|
delete resource.effective;
|
|
1659
|
-
|
|
1537
|
+
dt13.composite(resource, "effective", props.effective);
|
|
1660
1538
|
}
|
|
1661
|
-
if (!
|
|
1539
|
+
if (!_13.isNil(props.performer)) {
|
|
1662
1540
|
if (!Array.isArray(props.performer)) {
|
|
1663
1541
|
props.performer = [props.performer];
|
|
1664
1542
|
}
|
|
1665
|
-
resource.performer =
|
|
1543
|
+
resource.performer = dt13.reference(props.performer);
|
|
1666
1544
|
}
|
|
1667
|
-
if (!
|
|
1545
|
+
if (!_13.isNil(props.value)) {
|
|
1668
1546
|
delete resource.value;
|
|
1669
|
-
|
|
1547
|
+
dt13.composite(resource, "value", props.value);
|
|
1670
1548
|
}
|
|
1671
|
-
if (!
|
|
1672
|
-
resource.dataAbsentReason =
|
|
1549
|
+
if (!_13.isNil(props.dataAbsentReason)) {
|
|
1550
|
+
resource.dataAbsentReason = dt13.concept(props.dataAbsentReason);
|
|
1673
1551
|
}
|
|
1674
|
-
if (!
|
|
1552
|
+
if (!_13.isNil(props.interpretation)) {
|
|
1675
1553
|
if (!Array.isArray(props.interpretation)) {
|
|
1676
1554
|
props.interpretation = [props.interpretation];
|
|
1677
1555
|
}
|
|
1678
|
-
resource.interpretation =
|
|
1556
|
+
resource.interpretation = dt13.concept(props.interpretation);
|
|
1679
1557
|
}
|
|
1680
|
-
if (!
|
|
1681
|
-
resource.bodySite =
|
|
1558
|
+
if (!_13.isNil(props.bodySite)) {
|
|
1559
|
+
resource.bodySite = dt13.concept(props.bodySite);
|
|
1682
1560
|
}
|
|
1683
|
-
if (!
|
|
1684
|
-
resource.method =
|
|
1561
|
+
if (!_13.isNil(props.method)) {
|
|
1562
|
+
resource.method = dt13.concept(props.method);
|
|
1685
1563
|
}
|
|
1686
|
-
if (!
|
|
1687
|
-
resource.specimen =
|
|
1564
|
+
if (!_13.isNil(props.specimen)) {
|
|
1565
|
+
resource.specimen = dt13.reference(props.specimen);
|
|
1688
1566
|
}
|
|
1689
|
-
if (!
|
|
1690
|
-
resource.device =
|
|
1567
|
+
if (!_13.isNil(props.device)) {
|
|
1568
|
+
resource.device = dt13.reference(props.device);
|
|
1691
1569
|
}
|
|
1692
|
-
if (!
|
|
1570
|
+
if (!_13.isNil(props.referenceRange)) {
|
|
1693
1571
|
let src = props.referenceRange;
|
|
1694
1572
|
if (!Array.isArray(src)) {
|
|
1695
1573
|
src = [src];
|
|
@@ -1702,19 +1580,19 @@ function SzVitalSigns_default(props) {
|
|
|
1702
1580
|
resource.referenceRange.push(_referenceRange);
|
|
1703
1581
|
}
|
|
1704
1582
|
}
|
|
1705
|
-
if (!
|
|
1583
|
+
if (!_13.isNil(props.hasMember)) {
|
|
1706
1584
|
if (!Array.isArray(props.hasMember)) {
|
|
1707
1585
|
props.hasMember = [props.hasMember];
|
|
1708
1586
|
}
|
|
1709
|
-
resource.hasMember =
|
|
1587
|
+
resource.hasMember = dt13.reference(props.hasMember);
|
|
1710
1588
|
}
|
|
1711
|
-
if (!
|
|
1589
|
+
if (!_13.isNil(props.derivedFrom)) {
|
|
1712
1590
|
if (!Array.isArray(props.derivedFrom)) {
|
|
1713
1591
|
props.derivedFrom = [props.derivedFrom];
|
|
1714
1592
|
}
|
|
1715
|
-
resource.derivedFrom =
|
|
1593
|
+
resource.derivedFrom = dt13.reference(props.derivedFrom);
|
|
1716
1594
|
}
|
|
1717
|
-
if (!
|
|
1595
|
+
if (!_13.isNil(props.component)) {
|
|
1718
1596
|
let src = props.component;
|
|
1719
1597
|
if (!Array.isArray(src)) {
|
|
1720
1598
|
src = [src];
|
|
@@ -1736,29 +1614,29 @@ function SzVitalSigns_default(props) {
|
|
|
1736
1614
|
}
|
|
1737
1615
|
|
|
1738
1616
|
// src/profiles/SzOrganization.ts
|
|
1739
|
-
import
|
|
1740
|
-
import { b as
|
|
1617
|
+
import _14 from "lodash";
|
|
1618
|
+
import { b as dt14 } from "@openfn/language-fhir-4";
|
|
1741
1619
|
function SzOrganization_default(props) {
|
|
1742
1620
|
const resource = {
|
|
1743
1621
|
resourceType: "Organization",
|
|
1744
1622
|
...props
|
|
1745
1623
|
};
|
|
1746
|
-
if (!
|
|
1624
|
+
if (!_14.isNil(props.identifier)) {
|
|
1747
1625
|
if (!Array.isArray(props.identifier)) {
|
|
1748
1626
|
props.identifier = [props.identifier];
|
|
1749
1627
|
}
|
|
1750
|
-
resource.identifier =
|
|
1628
|
+
resource.identifier = dt14.identifier(props.identifier);
|
|
1751
1629
|
}
|
|
1752
|
-
if (!
|
|
1630
|
+
if (!_14.isNil(props.type)) {
|
|
1753
1631
|
if (!Array.isArray(props.type)) {
|
|
1754
1632
|
props.type = [props.type];
|
|
1755
1633
|
}
|
|
1756
|
-
resource.type =
|
|
1634
|
+
resource.type = dt14.concept(props.type);
|
|
1757
1635
|
}
|
|
1758
|
-
if (!
|
|
1759
|
-
resource.partOf =
|
|
1636
|
+
if (!_14.isNil(props.partOf)) {
|
|
1637
|
+
resource.partOf = dt14.reference(props.partOf);
|
|
1760
1638
|
}
|
|
1761
|
-
if (!
|
|
1639
|
+
if (!_14.isNil(props.contact)) {
|
|
1762
1640
|
let src = props.contact;
|
|
1763
1641
|
if (!Array.isArray(src)) {
|
|
1764
1642
|
src = [src];
|
|
@@ -1771,11 +1649,11 @@ function SzOrganization_default(props) {
|
|
|
1771
1649
|
resource.contact.push(_contact);
|
|
1772
1650
|
}
|
|
1773
1651
|
}
|
|
1774
|
-
if (!
|
|
1652
|
+
if (!_14.isNil(props.endpoint)) {
|
|
1775
1653
|
if (!Array.isArray(props.endpoint)) {
|
|
1776
1654
|
props.endpoint = [props.endpoint];
|
|
1777
1655
|
}
|
|
1778
|
-
resource.endpoint =
|
|
1656
|
+
resource.endpoint = dt14.reference(props.endpoint);
|
|
1779
1657
|
}
|
|
1780
1658
|
resource.meta = {
|
|
1781
1659
|
profile: [
|
|
@@ -1786,29 +1664,75 @@ function SzOrganization_default(props) {
|
|
|
1786
1664
|
}
|
|
1787
1665
|
|
|
1788
1666
|
// src/profiles/SzPatient.ts
|
|
1789
|
-
import
|
|
1790
|
-
import { b as
|
|
1667
|
+
import _15 from "lodash";
|
|
1668
|
+
import { b as dt15 } from "@openfn/language-fhir-4";
|
|
1791
1669
|
function SzPatient_default(props) {
|
|
1792
1670
|
const resource = {
|
|
1793
1671
|
resourceType: "Patient",
|
|
1794
1672
|
...props
|
|
1795
1673
|
};
|
|
1796
|
-
if (!
|
|
1674
|
+
if (!_15.isNil(props.nationality)) {
|
|
1675
|
+
let src = props.nationality;
|
|
1676
|
+
delete resource.nationality;
|
|
1677
|
+
dt15.addExtension(
|
|
1678
|
+
resource,
|
|
1679
|
+
"http://hl7.org/fhir/StructureDefinition/patient-nationality",
|
|
1680
|
+
src
|
|
1681
|
+
);
|
|
1682
|
+
}
|
|
1683
|
+
if (!_15.isNil(props.inkhundla)) {
|
|
1684
|
+
let src = props.inkhundla;
|
|
1685
|
+
if (typeof src === "string") {
|
|
1686
|
+
src = dt15.lookupValue("http://172.209.216.154:3447/fhir/ValueSet/SzTinkhundlaVS", src);
|
|
1687
|
+
}
|
|
1688
|
+
src = dt15.concept(src);
|
|
1689
|
+
dt15.ensureConceptText(src);
|
|
1690
|
+
delete resource.inkhundla;
|
|
1691
|
+
dt15.addExtension(
|
|
1692
|
+
resource,
|
|
1693
|
+
"http://172.209.216.154:3447/fhir/StructureDefinition/SzInkhundlaExtension",
|
|
1694
|
+
src
|
|
1695
|
+
);
|
|
1696
|
+
}
|
|
1697
|
+
if (!_15.isNil(props.chiefdom)) {
|
|
1698
|
+
let src = props.chiefdom;
|
|
1699
|
+
if (typeof src === "string") {
|
|
1700
|
+
src = dt15.lookupValue("http://172.209.216.154:3447/fhir/ValueSet/SzChiefdomVS", src);
|
|
1701
|
+
}
|
|
1702
|
+
src = dt15.concept(src);
|
|
1703
|
+
dt15.ensureConceptText(src);
|
|
1704
|
+
delete resource.chiefdom;
|
|
1705
|
+
dt15.addExtension(
|
|
1706
|
+
resource,
|
|
1707
|
+
"http://172.209.216.154:3447/fhir/StructureDefinition/SzChiefdomExtension",
|
|
1708
|
+
src
|
|
1709
|
+
);
|
|
1710
|
+
}
|
|
1711
|
+
if (!_15.isNil(props.registrationDate)) {
|
|
1712
|
+
let src = props.registrationDate;
|
|
1713
|
+
delete resource.registrationDate;
|
|
1714
|
+
dt15.addExtension(
|
|
1715
|
+
resource,
|
|
1716
|
+
"http://172.209.216.154:3447/fhir/StructureDefinition/SzRegistrationDate",
|
|
1717
|
+
src
|
|
1718
|
+
);
|
|
1719
|
+
}
|
|
1720
|
+
if (!_15.isNil(props.identifier)) {
|
|
1797
1721
|
let src = props.identifier;
|
|
1798
1722
|
if (!Array.isArray(src)) {
|
|
1799
1723
|
src = [src];
|
|
1800
1724
|
}
|
|
1801
1725
|
resource.identifier = [];
|
|
1802
1726
|
for (let item2 of src) {
|
|
1803
|
-
let _identifier =
|
|
1727
|
+
let _identifier = dt15.identifier(item2, [], {
|
|
1804
1728
|
"use": "http://hl7.org/fhir/ValueSet/identifier-use|4.0.1",
|
|
1805
1729
|
"type": "http://172.209.216.154:3447/fhir/ValueSet/PersonIdentifiersVS"
|
|
1806
1730
|
});
|
|
1807
|
-
_identifier =
|
|
1731
|
+
_identifier = dt15.mapSystems(_identifier);
|
|
1808
1732
|
resource.identifier.push(_identifier);
|
|
1809
1733
|
}
|
|
1810
1734
|
}
|
|
1811
|
-
if (!
|
|
1735
|
+
if (!_15.isNil(props.name)) {
|
|
1812
1736
|
let src = props.name;
|
|
1813
1737
|
if (!Array.isArray(src)) {
|
|
1814
1738
|
src = [src];
|
|
@@ -1821,18 +1745,11 @@ function SzPatient_default(props) {
|
|
|
1821
1745
|
resource.name.push(_name);
|
|
1822
1746
|
}
|
|
1823
1747
|
}
|
|
1824
|
-
if (!
|
|
1825
|
-
let src = props.birthDate;
|
|
1826
|
-
let _birthDate = {
|
|
1827
|
-
...item
|
|
1828
|
-
};
|
|
1829
|
-
resource.birthDate = _birthDate;
|
|
1830
|
-
}
|
|
1831
|
-
if (!_22.isNil(props.deceased)) {
|
|
1748
|
+
if (!_15.isNil(props.deceased)) {
|
|
1832
1749
|
delete resource.deceased;
|
|
1833
|
-
|
|
1750
|
+
dt15.composite(resource, "deceased", props.deceased);
|
|
1834
1751
|
}
|
|
1835
|
-
if (!
|
|
1752
|
+
if (!_15.isNil(props.address)) {
|
|
1836
1753
|
let src = props.address;
|
|
1837
1754
|
if (!Array.isArray(src)) {
|
|
1838
1755
|
src = [src];
|
|
@@ -1845,14 +1762,14 @@ function SzPatient_default(props) {
|
|
|
1845
1762
|
resource.address.push(_address);
|
|
1846
1763
|
}
|
|
1847
1764
|
}
|
|
1848
|
-
if (!
|
|
1849
|
-
resource.maritalStatus =
|
|
1765
|
+
if (!_15.isNil(props.maritalStatus)) {
|
|
1766
|
+
resource.maritalStatus = dt15.concept(props.maritalStatus);
|
|
1850
1767
|
}
|
|
1851
|
-
if (!
|
|
1768
|
+
if (!_15.isNil(props.multipleBirth)) {
|
|
1852
1769
|
delete resource.multipleBirth;
|
|
1853
|
-
|
|
1770
|
+
dt15.composite(resource, "multipleBirth", props.multipleBirth);
|
|
1854
1771
|
}
|
|
1855
|
-
if (!
|
|
1772
|
+
if (!_15.isNil(props.contact)) {
|
|
1856
1773
|
let src = props.contact;
|
|
1857
1774
|
if (!Array.isArray(src)) {
|
|
1858
1775
|
src = [src];
|
|
@@ -1865,7 +1782,7 @@ function SzPatient_default(props) {
|
|
|
1865
1782
|
resource.contact.push(_contact);
|
|
1866
1783
|
}
|
|
1867
1784
|
}
|
|
1868
|
-
if (!
|
|
1785
|
+
if (!_15.isNil(props.communication)) {
|
|
1869
1786
|
let src = props.communication;
|
|
1870
1787
|
if (!Array.isArray(src)) {
|
|
1871
1788
|
src = [src];
|
|
@@ -1878,16 +1795,16 @@ function SzPatient_default(props) {
|
|
|
1878
1795
|
resource.communication.push(_communication);
|
|
1879
1796
|
}
|
|
1880
1797
|
}
|
|
1881
|
-
if (!
|
|
1798
|
+
if (!_15.isNil(props.generalPractitioner)) {
|
|
1882
1799
|
if (!Array.isArray(props.generalPractitioner)) {
|
|
1883
1800
|
props.generalPractitioner = [props.generalPractitioner];
|
|
1884
1801
|
}
|
|
1885
|
-
resource.generalPractitioner =
|
|
1802
|
+
resource.generalPractitioner = dt15.reference(props.generalPractitioner);
|
|
1886
1803
|
}
|
|
1887
|
-
if (!
|
|
1888
|
-
resource.managingOrganization =
|
|
1804
|
+
if (!_15.isNil(props.managingOrganization)) {
|
|
1805
|
+
resource.managingOrganization = dt15.reference(props.managingOrganization);
|
|
1889
1806
|
}
|
|
1890
|
-
if (!
|
|
1807
|
+
if (!_15.isNil(props.link)) {
|
|
1891
1808
|
let src = props.link;
|
|
1892
1809
|
if (!Array.isArray(src)) {
|
|
1893
1810
|
src = [src];
|
|
@@ -1909,20 +1826,20 @@ function SzPatient_default(props) {
|
|
|
1909
1826
|
}
|
|
1910
1827
|
|
|
1911
1828
|
// src/profiles/SzPractitioner.ts
|
|
1912
|
-
import
|
|
1913
|
-
import { b as
|
|
1829
|
+
import _16 from "lodash";
|
|
1830
|
+
import { b as dt16 } from "@openfn/language-fhir-4";
|
|
1914
1831
|
function SzPractitioner_default(props) {
|
|
1915
1832
|
const resource = {
|
|
1916
1833
|
resourceType: "Practitioner",
|
|
1917
1834
|
...props
|
|
1918
1835
|
};
|
|
1919
|
-
if (!
|
|
1836
|
+
if (!_16.isNil(props.identifier)) {
|
|
1920
1837
|
if (!Array.isArray(props.identifier)) {
|
|
1921
1838
|
props.identifier = [props.identifier];
|
|
1922
1839
|
}
|
|
1923
|
-
resource.identifier =
|
|
1840
|
+
resource.identifier = dt16.identifier(props.identifier);
|
|
1924
1841
|
}
|
|
1925
|
-
if (!
|
|
1842
|
+
if (!_16.isNil(props.name)) {
|
|
1926
1843
|
let src = props.name;
|
|
1927
1844
|
if (!Array.isArray(src)) {
|
|
1928
1845
|
src = [src];
|
|
@@ -1935,7 +1852,7 @@ function SzPractitioner_default(props) {
|
|
|
1935
1852
|
resource.name.push(_name);
|
|
1936
1853
|
}
|
|
1937
1854
|
}
|
|
1938
|
-
if (!
|
|
1855
|
+
if (!_16.isNil(props.qualification)) {
|
|
1939
1856
|
let src = props.qualification;
|
|
1940
1857
|
if (!Array.isArray(src)) {
|
|
1941
1858
|
src = [src];
|
|
@@ -1948,11 +1865,11 @@ function SzPractitioner_default(props) {
|
|
|
1948
1865
|
resource.qualification.push(_qualification);
|
|
1949
1866
|
}
|
|
1950
1867
|
}
|
|
1951
|
-
if (!
|
|
1868
|
+
if (!_16.isNil(props.communication)) {
|
|
1952
1869
|
if (!Array.isArray(props.communication)) {
|
|
1953
1870
|
props.communication = [props.communication];
|
|
1954
1871
|
}
|
|
1955
|
-
resource.communication =
|
|
1872
|
+
resource.communication = dt16.concept(props.communication);
|
|
1956
1873
|
}
|
|
1957
1874
|
resource.meta = {
|
|
1958
1875
|
profile: [
|
|
@@ -1963,57 +1880,57 @@ function SzPractitioner_default(props) {
|
|
|
1963
1880
|
}
|
|
1964
1881
|
|
|
1965
1882
|
// src/profiles/SzProcedure.ts
|
|
1966
|
-
import
|
|
1967
|
-
import { b as
|
|
1883
|
+
import _17 from "lodash";
|
|
1884
|
+
import { b as dt17 } from "@openfn/language-fhir-4";
|
|
1968
1885
|
function SzProcedure_default(props) {
|
|
1969
1886
|
const resource = {
|
|
1970
1887
|
resourceType: "Procedure",
|
|
1971
1888
|
...props
|
|
1972
1889
|
};
|
|
1973
|
-
if (!
|
|
1890
|
+
if (!_17.isNil(props.identifier)) {
|
|
1974
1891
|
if (!Array.isArray(props.identifier)) {
|
|
1975
1892
|
props.identifier = [props.identifier];
|
|
1976
1893
|
}
|
|
1977
|
-
resource.identifier =
|
|
1894
|
+
resource.identifier = dt17.identifier(props.identifier);
|
|
1978
1895
|
}
|
|
1979
|
-
if (!
|
|
1896
|
+
if (!_17.isNil(props.basedOn)) {
|
|
1980
1897
|
if (!Array.isArray(props.basedOn)) {
|
|
1981
1898
|
props.basedOn = [props.basedOn];
|
|
1982
1899
|
}
|
|
1983
|
-
resource.basedOn =
|
|
1900
|
+
resource.basedOn = dt17.reference(props.basedOn);
|
|
1984
1901
|
}
|
|
1985
|
-
if (!
|
|
1902
|
+
if (!_17.isNil(props.partOf)) {
|
|
1986
1903
|
if (!Array.isArray(props.partOf)) {
|
|
1987
1904
|
props.partOf = [props.partOf];
|
|
1988
1905
|
}
|
|
1989
|
-
resource.partOf =
|
|
1906
|
+
resource.partOf = dt17.reference(props.partOf);
|
|
1990
1907
|
}
|
|
1991
|
-
if (!
|
|
1992
|
-
resource.statusReason =
|
|
1908
|
+
if (!_17.isNil(props.statusReason)) {
|
|
1909
|
+
resource.statusReason = dt17.concept(props.statusReason);
|
|
1993
1910
|
}
|
|
1994
|
-
if (!
|
|
1995
|
-
resource.category =
|
|
1911
|
+
if (!_17.isNil(props.category)) {
|
|
1912
|
+
resource.category = dt17.concept(props.category);
|
|
1996
1913
|
}
|
|
1997
|
-
if (!
|
|
1998
|
-
resource.code =
|
|
1914
|
+
if (!_17.isNil(props.code)) {
|
|
1915
|
+
resource.code = dt17.concept(props.code);
|
|
1999
1916
|
}
|
|
2000
|
-
if (!
|
|
2001
|
-
resource.subject =
|
|
1917
|
+
if (!_17.isNil(props.subject)) {
|
|
1918
|
+
resource.subject = dt17.reference(props.subject);
|
|
2002
1919
|
}
|
|
2003
|
-
if (!
|
|
2004
|
-
resource.encounter =
|
|
1920
|
+
if (!_17.isNil(props.encounter)) {
|
|
1921
|
+
resource.encounter = dt17.reference(props.encounter);
|
|
2005
1922
|
}
|
|
2006
|
-
if (!
|
|
1923
|
+
if (!_17.isNil(props.performed)) {
|
|
2007
1924
|
delete resource.performed;
|
|
2008
|
-
|
|
1925
|
+
dt17.composite(resource, "performed", props.performed);
|
|
2009
1926
|
}
|
|
2010
|
-
if (!
|
|
2011
|
-
resource.recorder =
|
|
1927
|
+
if (!_17.isNil(props.recorder)) {
|
|
1928
|
+
resource.recorder = dt17.reference(props.recorder);
|
|
2012
1929
|
}
|
|
2013
|
-
if (!
|
|
2014
|
-
resource.asserter =
|
|
1930
|
+
if (!_17.isNil(props.asserter)) {
|
|
1931
|
+
resource.asserter = dt17.reference(props.asserter);
|
|
2015
1932
|
}
|
|
2016
|
-
if (!
|
|
1933
|
+
if (!_17.isNil(props.performer)) {
|
|
2017
1934
|
let src = props.performer;
|
|
2018
1935
|
if (!Array.isArray(src)) {
|
|
2019
1936
|
src = [src];
|
|
@@ -2026,55 +1943,55 @@ function SzProcedure_default(props) {
|
|
|
2026
1943
|
resource.performer.push(_performer);
|
|
2027
1944
|
}
|
|
2028
1945
|
}
|
|
2029
|
-
if (!
|
|
2030
|
-
resource.location =
|
|
1946
|
+
if (!_17.isNil(props.location)) {
|
|
1947
|
+
resource.location = dt17.reference(props.location);
|
|
2031
1948
|
}
|
|
2032
|
-
if (!
|
|
1949
|
+
if (!_17.isNil(props.reasonCode)) {
|
|
2033
1950
|
if (!Array.isArray(props.reasonCode)) {
|
|
2034
1951
|
props.reasonCode = [props.reasonCode];
|
|
2035
1952
|
}
|
|
2036
|
-
resource.reasonCode =
|
|
1953
|
+
resource.reasonCode = dt17.concept(props.reasonCode);
|
|
2037
1954
|
}
|
|
2038
|
-
if (!
|
|
1955
|
+
if (!_17.isNil(props.reasonReference)) {
|
|
2039
1956
|
if (!Array.isArray(props.reasonReference)) {
|
|
2040
1957
|
props.reasonReference = [props.reasonReference];
|
|
2041
1958
|
}
|
|
2042
|
-
resource.reasonReference =
|
|
1959
|
+
resource.reasonReference = dt17.reference(props.reasonReference);
|
|
2043
1960
|
}
|
|
2044
|
-
if (!
|
|
1961
|
+
if (!_17.isNil(props.bodySite)) {
|
|
2045
1962
|
if (!Array.isArray(props.bodySite)) {
|
|
2046
1963
|
props.bodySite = [props.bodySite];
|
|
2047
1964
|
}
|
|
2048
|
-
resource.bodySite =
|
|
1965
|
+
resource.bodySite = dt17.concept(props.bodySite);
|
|
2049
1966
|
}
|
|
2050
|
-
if (!
|
|
2051
|
-
resource.outcome =
|
|
1967
|
+
if (!_17.isNil(props.outcome)) {
|
|
1968
|
+
resource.outcome = dt17.concept(props.outcome);
|
|
2052
1969
|
}
|
|
2053
|
-
if (!
|
|
1970
|
+
if (!_17.isNil(props.report)) {
|
|
2054
1971
|
if (!Array.isArray(props.report)) {
|
|
2055
1972
|
props.report = [props.report];
|
|
2056
1973
|
}
|
|
2057
|
-
resource.report =
|
|
1974
|
+
resource.report = dt17.reference(props.report);
|
|
2058
1975
|
}
|
|
2059
|
-
if (!
|
|
1976
|
+
if (!_17.isNil(props.complication)) {
|
|
2060
1977
|
if (!Array.isArray(props.complication)) {
|
|
2061
1978
|
props.complication = [props.complication];
|
|
2062
1979
|
}
|
|
2063
|
-
resource.complication =
|
|
1980
|
+
resource.complication = dt17.concept(props.complication);
|
|
2064
1981
|
}
|
|
2065
|
-
if (!
|
|
1982
|
+
if (!_17.isNil(props.complicationDetail)) {
|
|
2066
1983
|
if (!Array.isArray(props.complicationDetail)) {
|
|
2067
1984
|
props.complicationDetail = [props.complicationDetail];
|
|
2068
1985
|
}
|
|
2069
|
-
resource.complicationDetail =
|
|
1986
|
+
resource.complicationDetail = dt17.reference(props.complicationDetail);
|
|
2070
1987
|
}
|
|
2071
|
-
if (!
|
|
1988
|
+
if (!_17.isNil(props.followUp)) {
|
|
2072
1989
|
if (!Array.isArray(props.followUp)) {
|
|
2073
1990
|
props.followUp = [props.followUp];
|
|
2074
1991
|
}
|
|
2075
|
-
resource.followUp =
|
|
1992
|
+
resource.followUp = dt17.concept(props.followUp);
|
|
2076
1993
|
}
|
|
2077
|
-
if (!
|
|
1994
|
+
if (!_17.isNil(props.focalDevice)) {
|
|
2078
1995
|
let src = props.focalDevice;
|
|
2079
1996
|
if (!Array.isArray(src)) {
|
|
2080
1997
|
src = [src];
|
|
@@ -2087,17 +2004,17 @@ function SzProcedure_default(props) {
|
|
|
2087
2004
|
resource.focalDevice.push(_focalDevice);
|
|
2088
2005
|
}
|
|
2089
2006
|
}
|
|
2090
|
-
if (!
|
|
2007
|
+
if (!_17.isNil(props.usedReference)) {
|
|
2091
2008
|
if (!Array.isArray(props.usedReference)) {
|
|
2092
2009
|
props.usedReference = [props.usedReference];
|
|
2093
2010
|
}
|
|
2094
|
-
resource.usedReference =
|
|
2011
|
+
resource.usedReference = dt17.reference(props.usedReference);
|
|
2095
2012
|
}
|
|
2096
|
-
if (!
|
|
2013
|
+
if (!_17.isNil(props.usedCode)) {
|
|
2097
2014
|
if (!Array.isArray(props.usedCode)) {
|
|
2098
2015
|
props.usedCode = [props.usedCode];
|
|
2099
2016
|
}
|
|
2100
|
-
resource.usedCode =
|
|
2017
|
+
resource.usedCode = dt17.concept(props.usedCode);
|
|
2101
2018
|
}
|
|
2102
2019
|
resource.meta = {
|
|
2103
2020
|
profile: [
|
|
@@ -2108,35 +2025,35 @@ function SzProcedure_default(props) {
|
|
|
2108
2025
|
}
|
|
2109
2026
|
|
|
2110
2027
|
// src/profiles/SzLabRequest.ts
|
|
2111
|
-
import
|
|
2112
|
-
import { b as
|
|
2028
|
+
import _18 from "lodash";
|
|
2029
|
+
import { b as dt18 } from "@openfn/language-fhir-4";
|
|
2113
2030
|
function SzLabRequest_default(props) {
|
|
2114
2031
|
const resource = {
|
|
2115
2032
|
resourceType: "ServiceRequest",
|
|
2116
2033
|
...props
|
|
2117
2034
|
};
|
|
2118
|
-
if (!
|
|
2035
|
+
if (!_18.isNil(props.identifier)) {
|
|
2119
2036
|
if (!Array.isArray(props.identifier)) {
|
|
2120
2037
|
props.identifier = [props.identifier];
|
|
2121
2038
|
}
|
|
2122
|
-
resource.identifier =
|
|
2039
|
+
resource.identifier = dt18.identifier(props.identifier);
|
|
2123
2040
|
}
|
|
2124
|
-
if (!
|
|
2041
|
+
if (!_18.isNil(props.basedOn)) {
|
|
2125
2042
|
if (!Array.isArray(props.basedOn)) {
|
|
2126
2043
|
props.basedOn = [props.basedOn];
|
|
2127
2044
|
}
|
|
2128
|
-
resource.basedOn =
|
|
2045
|
+
resource.basedOn = dt18.reference(props.basedOn);
|
|
2129
2046
|
}
|
|
2130
|
-
if (!
|
|
2047
|
+
if (!_18.isNil(props.replaces)) {
|
|
2131
2048
|
if (!Array.isArray(props.replaces)) {
|
|
2132
2049
|
props.replaces = [props.replaces];
|
|
2133
2050
|
}
|
|
2134
|
-
resource.replaces =
|
|
2051
|
+
resource.replaces = dt18.reference(props.replaces);
|
|
2135
2052
|
}
|
|
2136
|
-
if (!
|
|
2137
|
-
resource.requisition =
|
|
2053
|
+
if (!_18.isNil(props.requisition)) {
|
|
2054
|
+
resource.requisition = dt18.identifier(props.requisition);
|
|
2138
2055
|
}
|
|
2139
|
-
if (!
|
|
2056
|
+
if (!_18.isNil(props.category)) {
|
|
2140
2057
|
let src = props.category;
|
|
2141
2058
|
if (!Array.isArray(src)) {
|
|
2142
2059
|
src = [src];
|
|
@@ -2149,98 +2066,98 @@ function SzLabRequest_default(props) {
|
|
|
2149
2066
|
resource.category.push(_category);
|
|
2150
2067
|
}
|
|
2151
2068
|
}
|
|
2152
|
-
if (!
|
|
2153
|
-
resource.code =
|
|
2069
|
+
if (!_18.isNil(props.code)) {
|
|
2070
|
+
resource.code = dt18.concept(props.code);
|
|
2154
2071
|
}
|
|
2155
|
-
if (!
|
|
2072
|
+
if (!_18.isNil(props.orderDetail)) {
|
|
2156
2073
|
if (!Array.isArray(props.orderDetail)) {
|
|
2157
2074
|
props.orderDetail = [props.orderDetail];
|
|
2158
2075
|
}
|
|
2159
|
-
resource.orderDetail =
|
|
2076
|
+
resource.orderDetail = dt18.concept(props.orderDetail);
|
|
2160
2077
|
}
|
|
2161
|
-
if (!
|
|
2078
|
+
if (!_18.isNil(props.quantity)) {
|
|
2162
2079
|
delete resource.quantity;
|
|
2163
|
-
|
|
2080
|
+
dt18.composite(resource, "quantity", props.quantity);
|
|
2164
2081
|
}
|
|
2165
|
-
if (!
|
|
2166
|
-
resource.subject =
|
|
2082
|
+
if (!_18.isNil(props.subject)) {
|
|
2083
|
+
resource.subject = dt18.reference(props.subject);
|
|
2167
2084
|
}
|
|
2168
|
-
if (!
|
|
2169
|
-
resource.encounter =
|
|
2085
|
+
if (!_18.isNil(props.encounter)) {
|
|
2086
|
+
resource.encounter = dt18.reference(props.encounter);
|
|
2170
2087
|
}
|
|
2171
|
-
if (!
|
|
2088
|
+
if (!_18.isNil(props.occurrence)) {
|
|
2172
2089
|
delete resource.occurrence;
|
|
2173
|
-
|
|
2090
|
+
dt18.composite(resource, "occurrence", props.occurrence);
|
|
2174
2091
|
}
|
|
2175
|
-
if (!
|
|
2092
|
+
if (!_18.isNil(props.asNeeded)) {
|
|
2176
2093
|
delete resource.asNeeded;
|
|
2177
|
-
|
|
2094
|
+
dt18.composite(resource, "asNeeded", props.asNeeded);
|
|
2178
2095
|
}
|
|
2179
|
-
if (!
|
|
2180
|
-
resource.requester =
|
|
2096
|
+
if (!_18.isNil(props.requester)) {
|
|
2097
|
+
resource.requester = dt18.reference(props.requester);
|
|
2181
2098
|
}
|
|
2182
|
-
if (!
|
|
2183
|
-
resource.performerType =
|
|
2099
|
+
if (!_18.isNil(props.performerType)) {
|
|
2100
|
+
resource.performerType = dt18.concept(props.performerType);
|
|
2184
2101
|
}
|
|
2185
|
-
if (!
|
|
2102
|
+
if (!_18.isNil(props.performer)) {
|
|
2186
2103
|
if (!Array.isArray(props.performer)) {
|
|
2187
2104
|
props.performer = [props.performer];
|
|
2188
2105
|
}
|
|
2189
|
-
resource.performer =
|
|
2106
|
+
resource.performer = dt18.reference(props.performer);
|
|
2190
2107
|
}
|
|
2191
|
-
if (!
|
|
2108
|
+
if (!_18.isNil(props.locationCode)) {
|
|
2192
2109
|
if (!Array.isArray(props.locationCode)) {
|
|
2193
2110
|
props.locationCode = [props.locationCode];
|
|
2194
2111
|
}
|
|
2195
|
-
resource.locationCode =
|
|
2112
|
+
resource.locationCode = dt18.concept(props.locationCode);
|
|
2196
2113
|
}
|
|
2197
|
-
if (!
|
|
2114
|
+
if (!_18.isNil(props.locationReference)) {
|
|
2198
2115
|
if (!Array.isArray(props.locationReference)) {
|
|
2199
2116
|
props.locationReference = [props.locationReference];
|
|
2200
2117
|
}
|
|
2201
|
-
resource.locationReference =
|
|
2118
|
+
resource.locationReference = dt18.reference(props.locationReference);
|
|
2202
2119
|
}
|
|
2203
|
-
if (!
|
|
2120
|
+
if (!_18.isNil(props.reasonCode)) {
|
|
2204
2121
|
if (!Array.isArray(props.reasonCode)) {
|
|
2205
2122
|
props.reasonCode = [props.reasonCode];
|
|
2206
2123
|
}
|
|
2207
|
-
resource.reasonCode =
|
|
2124
|
+
resource.reasonCode = dt18.concept(props.reasonCode);
|
|
2208
2125
|
}
|
|
2209
|
-
if (!
|
|
2126
|
+
if (!_18.isNil(props.reasonReference)) {
|
|
2210
2127
|
if (!Array.isArray(props.reasonReference)) {
|
|
2211
2128
|
props.reasonReference = [props.reasonReference];
|
|
2212
2129
|
}
|
|
2213
|
-
resource.reasonReference =
|
|
2130
|
+
resource.reasonReference = dt18.reference(props.reasonReference);
|
|
2214
2131
|
}
|
|
2215
|
-
if (!
|
|
2132
|
+
if (!_18.isNil(props.insurance)) {
|
|
2216
2133
|
if (!Array.isArray(props.insurance)) {
|
|
2217
2134
|
props.insurance = [props.insurance];
|
|
2218
2135
|
}
|
|
2219
|
-
resource.insurance =
|
|
2136
|
+
resource.insurance = dt18.reference(props.insurance);
|
|
2220
2137
|
}
|
|
2221
|
-
if (!
|
|
2138
|
+
if (!_18.isNil(props.supportingInfo)) {
|
|
2222
2139
|
if (!Array.isArray(props.supportingInfo)) {
|
|
2223
2140
|
props.supportingInfo = [props.supportingInfo];
|
|
2224
2141
|
}
|
|
2225
|
-
resource.supportingInfo =
|
|
2142
|
+
resource.supportingInfo = dt18.reference(props.supportingInfo);
|
|
2226
2143
|
}
|
|
2227
|
-
if (!
|
|
2144
|
+
if (!_18.isNil(props.specimen)) {
|
|
2228
2145
|
if (!Array.isArray(props.specimen)) {
|
|
2229
2146
|
props.specimen = [props.specimen];
|
|
2230
2147
|
}
|
|
2231
|
-
resource.specimen =
|
|
2148
|
+
resource.specimen = dt18.reference(props.specimen);
|
|
2232
2149
|
}
|
|
2233
|
-
if (!
|
|
2150
|
+
if (!_18.isNil(props.bodySite)) {
|
|
2234
2151
|
if (!Array.isArray(props.bodySite)) {
|
|
2235
2152
|
props.bodySite = [props.bodySite];
|
|
2236
2153
|
}
|
|
2237
|
-
resource.bodySite =
|
|
2154
|
+
resource.bodySite = dt18.concept(props.bodySite);
|
|
2238
2155
|
}
|
|
2239
|
-
if (!
|
|
2156
|
+
if (!_18.isNil(props.relevantHistory)) {
|
|
2240
2157
|
if (!Array.isArray(props.relevantHistory)) {
|
|
2241
2158
|
props.relevantHistory = [props.relevantHistory];
|
|
2242
2159
|
}
|
|
2243
|
-
resource.relevantHistory =
|
|
2160
|
+
resource.relevantHistory = dt18.reference(props.relevantHistory);
|
|
2244
2161
|
}
|
|
2245
2162
|
resource.meta = {
|
|
2246
2163
|
profile: [
|
|
@@ -2251,132 +2168,143 @@ function SzLabRequest_default(props) {
|
|
|
2251
2168
|
}
|
|
2252
2169
|
|
|
2253
2170
|
// src/profiles/SzReferral.ts
|
|
2254
|
-
import
|
|
2255
|
-
import { b as
|
|
2171
|
+
import _19 from "lodash";
|
|
2172
|
+
import { b as dt19 } from "@openfn/language-fhir-4";
|
|
2256
2173
|
function SzReferral_default(props) {
|
|
2257
2174
|
const resource = {
|
|
2258
2175
|
resourceType: "ServiceRequest",
|
|
2259
2176
|
...props
|
|
2260
2177
|
};
|
|
2261
|
-
if (!
|
|
2178
|
+
if (!_19.isNil(props.recipient)) {
|
|
2179
|
+
let src = props.recipient;
|
|
2180
|
+
src = dt19.concept(src);
|
|
2181
|
+
dt19.ensureConceptText(src);
|
|
2182
|
+
delete resource.recipient;
|
|
2183
|
+
dt19.addExtension(
|
|
2184
|
+
resource,
|
|
2185
|
+
"http://172.209.216.154:3447/fhir/StructureDefinition/SzReferralRecipientExtension",
|
|
2186
|
+
src
|
|
2187
|
+
);
|
|
2188
|
+
}
|
|
2189
|
+
if (!_19.isNil(props.identifier)) {
|
|
2262
2190
|
if (!Array.isArray(props.identifier)) {
|
|
2263
2191
|
props.identifier = [props.identifier];
|
|
2264
2192
|
}
|
|
2265
|
-
resource.identifier =
|
|
2193
|
+
resource.identifier = dt19.identifier(props.identifier);
|
|
2266
2194
|
}
|
|
2267
|
-
if (!
|
|
2195
|
+
if (!_19.isNil(props.basedOn)) {
|
|
2268
2196
|
if (!Array.isArray(props.basedOn)) {
|
|
2269
2197
|
props.basedOn = [props.basedOn];
|
|
2270
2198
|
}
|
|
2271
|
-
resource.basedOn =
|
|
2199
|
+
resource.basedOn = dt19.reference(props.basedOn);
|
|
2272
2200
|
}
|
|
2273
|
-
if (!
|
|
2201
|
+
if (!_19.isNil(props.replaces)) {
|
|
2274
2202
|
if (!Array.isArray(props.replaces)) {
|
|
2275
2203
|
props.replaces = [props.replaces];
|
|
2276
2204
|
}
|
|
2277
|
-
resource.replaces =
|
|
2205
|
+
resource.replaces = dt19.reference(props.replaces);
|
|
2278
2206
|
}
|
|
2279
|
-
if (!
|
|
2280
|
-
resource.requisition =
|
|
2207
|
+
if (!_19.isNil(props.requisition)) {
|
|
2208
|
+
resource.requisition = dt19.identifier(props.requisition);
|
|
2281
2209
|
}
|
|
2282
|
-
if (!
|
|
2210
|
+
if (!_19.isNil(props.category)) {
|
|
2283
2211
|
if (!Array.isArray(props.category)) {
|
|
2284
2212
|
props.category = [props.category];
|
|
2285
2213
|
}
|
|
2286
|
-
resource.category =
|
|
2214
|
+
resource.category = dt19.concept(props.category);
|
|
2287
2215
|
}
|
|
2288
|
-
if (!
|
|
2289
|
-
resource.code =
|
|
2216
|
+
if (!_19.isNil(props.code)) {
|
|
2217
|
+
resource.code = dt19.concept(props.code);
|
|
2290
2218
|
}
|
|
2291
|
-
if (!
|
|
2219
|
+
if (!_19.isNil(props.orderDetail)) {
|
|
2292
2220
|
if (!Array.isArray(props.orderDetail)) {
|
|
2293
2221
|
props.orderDetail = [props.orderDetail];
|
|
2294
2222
|
}
|
|
2295
|
-
resource.orderDetail =
|
|
2223
|
+
resource.orderDetail = dt19.concept(props.orderDetail);
|
|
2296
2224
|
}
|
|
2297
|
-
if (!
|
|
2225
|
+
if (!_19.isNil(props.quantity)) {
|
|
2298
2226
|
delete resource.quantity;
|
|
2299
|
-
|
|
2227
|
+
dt19.composite(resource, "quantity", props.quantity);
|
|
2300
2228
|
}
|
|
2301
|
-
if (!
|
|
2302
|
-
resource.subject =
|
|
2229
|
+
if (!_19.isNil(props.subject)) {
|
|
2230
|
+
resource.subject = dt19.reference(props.subject);
|
|
2303
2231
|
}
|
|
2304
|
-
if (!
|
|
2305
|
-
resource.encounter =
|
|
2232
|
+
if (!_19.isNil(props.encounter)) {
|
|
2233
|
+
resource.encounter = dt19.reference(props.encounter);
|
|
2306
2234
|
}
|
|
2307
|
-
if (!
|
|
2235
|
+
if (!_19.isNil(props.occurrence)) {
|
|
2308
2236
|
delete resource.occurrence;
|
|
2309
|
-
|
|
2237
|
+
dt19.composite(resource, "occurrence", props.occurrence);
|
|
2310
2238
|
}
|
|
2311
|
-
if (!
|
|
2239
|
+
if (!_19.isNil(props.asNeeded)) {
|
|
2312
2240
|
delete resource.asNeeded;
|
|
2313
|
-
|
|
2241
|
+
dt19.composite(resource, "asNeeded", props.asNeeded);
|
|
2314
2242
|
}
|
|
2315
|
-
if (!
|
|
2316
|
-
resource.requester =
|
|
2243
|
+
if (!_19.isNil(props.requester)) {
|
|
2244
|
+
resource.requester = dt19.reference(props.requester);
|
|
2317
2245
|
}
|
|
2318
|
-
if (!
|
|
2319
|
-
resource.performerType =
|
|
2246
|
+
if (!_19.isNil(props.performerType)) {
|
|
2247
|
+
resource.performerType = dt19.concept(props.performerType);
|
|
2320
2248
|
}
|
|
2321
|
-
if (!
|
|
2249
|
+
if (!_19.isNil(props.performer)) {
|
|
2322
2250
|
if (!Array.isArray(props.performer)) {
|
|
2323
2251
|
props.performer = [props.performer];
|
|
2324
2252
|
}
|
|
2325
|
-
resource.performer =
|
|
2253
|
+
resource.performer = dt19.reference(props.performer);
|
|
2326
2254
|
}
|
|
2327
|
-
if (!
|
|
2255
|
+
if (!_19.isNil(props.locationCode)) {
|
|
2328
2256
|
if (!Array.isArray(props.locationCode)) {
|
|
2329
2257
|
props.locationCode = [props.locationCode];
|
|
2330
2258
|
}
|
|
2331
|
-
resource.locationCode =
|
|
2259
|
+
resource.locationCode = dt19.concept(props.locationCode);
|
|
2332
2260
|
}
|
|
2333
|
-
if (!
|
|
2261
|
+
if (!_19.isNil(props.locationReference)) {
|
|
2334
2262
|
if (!Array.isArray(props.locationReference)) {
|
|
2335
2263
|
props.locationReference = [props.locationReference];
|
|
2336
2264
|
}
|
|
2337
|
-
resource.locationReference =
|
|
2265
|
+
resource.locationReference = dt19.reference(props.locationReference);
|
|
2338
2266
|
}
|
|
2339
|
-
if (!
|
|
2267
|
+
if (!_19.isNil(props.reasonCode)) {
|
|
2340
2268
|
if (!Array.isArray(props.reasonCode)) {
|
|
2341
2269
|
props.reasonCode = [props.reasonCode];
|
|
2342
2270
|
}
|
|
2343
|
-
resource.reasonCode =
|
|
2271
|
+
resource.reasonCode = dt19.concept(props.reasonCode);
|
|
2344
2272
|
}
|
|
2345
|
-
if (!
|
|
2273
|
+
if (!_19.isNil(props.reasonReference)) {
|
|
2346
2274
|
if (!Array.isArray(props.reasonReference)) {
|
|
2347
2275
|
props.reasonReference = [props.reasonReference];
|
|
2348
2276
|
}
|
|
2349
|
-
resource.reasonReference =
|
|
2277
|
+
resource.reasonReference = dt19.reference(props.reasonReference);
|
|
2350
2278
|
}
|
|
2351
|
-
if (!
|
|
2279
|
+
if (!_19.isNil(props.insurance)) {
|
|
2352
2280
|
if (!Array.isArray(props.insurance)) {
|
|
2353
2281
|
props.insurance = [props.insurance];
|
|
2354
2282
|
}
|
|
2355
|
-
resource.insurance =
|
|
2283
|
+
resource.insurance = dt19.reference(props.insurance);
|
|
2356
2284
|
}
|
|
2357
|
-
if (!
|
|
2285
|
+
if (!_19.isNil(props.supportingInfo)) {
|
|
2358
2286
|
if (!Array.isArray(props.supportingInfo)) {
|
|
2359
2287
|
props.supportingInfo = [props.supportingInfo];
|
|
2360
2288
|
}
|
|
2361
|
-
resource.supportingInfo =
|
|
2289
|
+
resource.supportingInfo = dt19.reference(props.supportingInfo);
|
|
2362
2290
|
}
|
|
2363
|
-
if (!
|
|
2291
|
+
if (!_19.isNil(props.specimen)) {
|
|
2364
2292
|
if (!Array.isArray(props.specimen)) {
|
|
2365
2293
|
props.specimen = [props.specimen];
|
|
2366
2294
|
}
|
|
2367
|
-
resource.specimen =
|
|
2295
|
+
resource.specimen = dt19.reference(props.specimen);
|
|
2368
2296
|
}
|
|
2369
|
-
if (!
|
|
2297
|
+
if (!_19.isNil(props.bodySite)) {
|
|
2370
2298
|
if (!Array.isArray(props.bodySite)) {
|
|
2371
2299
|
props.bodySite = [props.bodySite];
|
|
2372
2300
|
}
|
|
2373
|
-
resource.bodySite =
|
|
2301
|
+
resource.bodySite = dt19.concept(props.bodySite);
|
|
2374
2302
|
}
|
|
2375
|
-
if (!
|
|
2303
|
+
if (!_19.isNil(props.relevantHistory)) {
|
|
2376
2304
|
if (!Array.isArray(props.relevantHistory)) {
|
|
2377
2305
|
props.relevantHistory = [props.relevantHistory];
|
|
2378
2306
|
}
|
|
2379
|
-
resource.relevantHistory =
|
|
2307
|
+
resource.relevantHistory = dt19.reference(props.relevantHistory);
|
|
2380
2308
|
}
|
|
2381
2309
|
resource.meta = {
|
|
2382
2310
|
profile: [
|
|
@@ -2387,48 +2315,48 @@ function SzReferral_default(props) {
|
|
|
2387
2315
|
}
|
|
2388
2316
|
|
|
2389
2317
|
// src/profiles/SzLabSpecimen.ts
|
|
2390
|
-
import
|
|
2391
|
-
import { b as
|
|
2318
|
+
import _20 from "lodash";
|
|
2319
|
+
import { b as dt20 } from "@openfn/language-fhir-4";
|
|
2392
2320
|
function SzLabSpecimen_default(props) {
|
|
2393
2321
|
const resource = {
|
|
2394
2322
|
resourceType: "Specimen",
|
|
2395
2323
|
...props
|
|
2396
2324
|
};
|
|
2397
|
-
if (!
|
|
2325
|
+
if (!_20.isNil(props.identifier)) {
|
|
2398
2326
|
if (!Array.isArray(props.identifier)) {
|
|
2399
2327
|
props.identifier = [props.identifier];
|
|
2400
2328
|
}
|
|
2401
|
-
resource.identifier =
|
|
2329
|
+
resource.identifier = dt20.identifier(props.identifier);
|
|
2402
2330
|
}
|
|
2403
|
-
if (!
|
|
2404
|
-
resource.accessionIdentifier =
|
|
2331
|
+
if (!_20.isNil(props.accessionIdentifier)) {
|
|
2332
|
+
resource.accessionIdentifier = dt20.identifier(props.accessionIdentifier);
|
|
2405
2333
|
}
|
|
2406
|
-
if (!
|
|
2407
|
-
resource.type =
|
|
2334
|
+
if (!_20.isNil(props.type)) {
|
|
2335
|
+
resource.type = dt20.concept(props.type);
|
|
2408
2336
|
}
|
|
2409
|
-
if (!
|
|
2410
|
-
resource.subject =
|
|
2337
|
+
if (!_20.isNil(props.subject)) {
|
|
2338
|
+
resource.subject = dt20.reference(props.subject);
|
|
2411
2339
|
}
|
|
2412
|
-
if (!
|
|
2340
|
+
if (!_20.isNil(props.parent)) {
|
|
2413
2341
|
if (!Array.isArray(props.parent)) {
|
|
2414
2342
|
props.parent = [props.parent];
|
|
2415
2343
|
}
|
|
2416
|
-
resource.parent =
|
|
2344
|
+
resource.parent = dt20.reference(props.parent);
|
|
2417
2345
|
}
|
|
2418
|
-
if (!
|
|
2346
|
+
if (!_20.isNil(props.request)) {
|
|
2419
2347
|
if (!Array.isArray(props.request)) {
|
|
2420
2348
|
props.request = [props.request];
|
|
2421
2349
|
}
|
|
2422
|
-
resource.request =
|
|
2350
|
+
resource.request = dt20.reference(props.request);
|
|
2423
2351
|
}
|
|
2424
|
-
if (!
|
|
2352
|
+
if (!_20.isNil(props.collection)) {
|
|
2425
2353
|
let src = props.collection;
|
|
2426
2354
|
let _collection = {
|
|
2427
2355
|
...item
|
|
2428
2356
|
};
|
|
2429
2357
|
resource.collection = _collection;
|
|
2430
2358
|
}
|
|
2431
|
-
if (!
|
|
2359
|
+
if (!_20.isNil(props.processing)) {
|
|
2432
2360
|
let src = props.processing;
|
|
2433
2361
|
if (!Array.isArray(src)) {
|
|
2434
2362
|
src = [src];
|
|
@@ -2441,7 +2369,7 @@ function SzLabSpecimen_default(props) {
|
|
|
2441
2369
|
resource.processing.push(_processing);
|
|
2442
2370
|
}
|
|
2443
2371
|
}
|
|
2444
|
-
if (!
|
|
2372
|
+
if (!_20.isNil(props.container)) {
|
|
2445
2373
|
let src = props.container;
|
|
2446
2374
|
if (!Array.isArray(src)) {
|
|
2447
2375
|
src = [src];
|
|
@@ -2454,11 +2382,11 @@ function SzLabSpecimen_default(props) {
|
|
|
2454
2382
|
resource.container.push(_container);
|
|
2455
2383
|
}
|
|
2456
2384
|
}
|
|
2457
|
-
if (!
|
|
2385
|
+
if (!_20.isNil(props.condition)) {
|
|
2458
2386
|
if (!Array.isArray(props.condition)) {
|
|
2459
2387
|
props.condition = [props.condition];
|
|
2460
2388
|
}
|
|
2461
|
-
resource.condition =
|
|
2389
|
+
resource.condition = dt20.concept(props.condition);
|
|
2462
2390
|
}
|
|
2463
2391
|
resource.meta = {
|
|
2464
2392
|
profile: [
|
|
@@ -2547,21 +2475,6 @@ function episodeOfCare(type, props) {
|
|
|
2547
2475
|
}
|
|
2548
2476
|
throw new Error(`Error: profile "${type}" not recognised`);
|
|
2549
2477
|
}
|
|
2550
|
-
function extension2(type, props) {
|
|
2551
|
-
const mappings = {
|
|
2552
|
-
"SzAuthorizerExtension": SzAuthorizerExtension_default,
|
|
2553
|
-
"SzChiefdomExtension": SzChiefdomExtension_default,
|
|
2554
|
-
"SzInkhundlaExtension": SzInkhundlaExtension_default,
|
|
2555
|
-
"SzLocationCodeExtension": SzLocationCodeExtension_default,
|
|
2556
|
-
"SzReferralRecipientExtension": SzReferralRecipientExtension_default,
|
|
2557
|
-
"SzRegistrationDate": SzRegistrationDate_default,
|
|
2558
|
-
"SzTestingLabExtension": SzTestingLabExtension_default
|
|
2559
|
-
};
|
|
2560
|
-
if (type in mappings) {
|
|
2561
|
-
return mappings[type](props);
|
|
2562
|
-
}
|
|
2563
|
-
throw new Error(`Error: profile "${type}" not recognised`);
|
|
2564
|
-
}
|
|
2565
2478
|
function location(type, props) {
|
|
2566
2479
|
const mappings = {
|
|
2567
2480
|
"SzLocation": SzLocation_default
|