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