primary_care_admin_binder 0.1.143 → 0.1.145
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.js +361 -106
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -25535,7 +25535,7 @@ var generateSaveJSON = function generateSaveJSON(data, rcchargeCode) {
|
|
|
25535
25535
|
})];
|
|
25536
25536
|
};
|
|
25537
25537
|
var getAvailability = function getAvailability(data) {
|
|
25538
|
-
var arr = data.map(function (v) {
|
|
25538
|
+
var arr = (data !== null && data !== void 0 ? data : []).map(function (v) {
|
|
25539
25539
|
var _v$entity_name$_id, _v$entity_name, _v$entity_name2, _v$appointment, _parseInt, _v$bill_nature$_id, _v$bill_nature, _v$entity_type$_id, _v$entity_type;
|
|
25540
25540
|
return {
|
|
25541
25541
|
perforganizationId: (_v$entity_name$_id = v === null || v === void 0 || (_v$entity_name = v.entity_name) === null || _v$entity_name === void 0 ? void 0 : _v$entity_name._id) !== null && _v$entity_name$_id !== void 0 ? _v$entity_name$_id : v === null || v === void 0 || (_v$entity_name2 = v.entity_name) === null || _v$entity_name2 === void 0 ? void 0 : _v$entity_name2.value,
|
|
@@ -25550,7 +25550,7 @@ var getAvailability = function getAvailability(data) {
|
|
|
25550
25550
|
return arr;
|
|
25551
25551
|
};
|
|
25552
25552
|
var getAttributes = function getAttributes(data, attri) {
|
|
25553
|
-
var arr = data.map(function (v, i) {
|
|
25553
|
+
var arr = (data !== null && data !== void 0 ? data : []).map(function (v, i) {
|
|
25554
25554
|
var _v$isMandatory;
|
|
25555
25555
|
return {
|
|
25556
25556
|
_id: v._id,
|
|
@@ -25573,7 +25573,7 @@ var getAttributes = function getAttributes(data, attri) {
|
|
|
25573
25573
|
// const getInstructionAndFrequency = (insdata, fredata, freapp) => {
|
|
25574
25574
|
// let arr = [];
|
|
25575
25575
|
|
|
25576
|
-
//
|
|
25576
|
+
// ins(data ?? []).map((v, i) => {
|
|
25577
25577
|
// arr.push({
|
|
25578
25578
|
// _id: v._id,
|
|
25579
25579
|
// id: 0,
|
|
@@ -25600,7 +25600,7 @@ var getAttributes = function getAttributes(data, attri) {
|
|
|
25600
25600
|
// });
|
|
25601
25601
|
// });
|
|
25602
25602
|
|
|
25603
|
-
//
|
|
25603
|
+
// fre(data ?? []).map((v) => {
|
|
25604
25604
|
// arr.push({
|
|
25605
25605
|
// _id: v._id,
|
|
25606
25606
|
// id: 0,
|
|
@@ -25628,60 +25628,126 @@ var getAttributes = function getAttributes(data, attri) {
|
|
|
25628
25628
|
|
|
25629
25629
|
// return arr;
|
|
25630
25630
|
// };
|
|
25631
|
-
|
|
25631
|
+
// const getInstruction = (insdata) => {
|
|
25632
|
+
// let arr = [];
|
|
25633
|
+
// ins(data ?? []).map((v, i) => {
|
|
25634
|
+
// arr.push({
|
|
25635
|
+
// _id: v._id,
|
|
25636
|
+
// id: 0,
|
|
25637
|
+
// serviceapplicability: "Service",
|
|
25638
|
+
// setuptypeInd: "Instruction",
|
|
25639
|
+
|
|
25640
|
+
// encountertype: v.encounterType ? v.encounterType._id : "",
|
|
25641
|
+
// gendercode: v.gender ? v.gender._id : "",
|
|
25642
|
+
// agegroup: v.ageRange ? v.ageRange.value : "",
|
|
25643
|
+
// agecatgcode: v.agecategory
|
|
25644
|
+
// ? v.agecategory.map((a) => {
|
|
25645
|
+
// return a.value;
|
|
25646
|
+
// })
|
|
25647
|
+
// : [],
|
|
25648
|
+
|
|
25649
|
+
// OrderInstr: [
|
|
25650
|
+
// {
|
|
25651
|
+
// patientInst: v.patientInstrction,
|
|
25652
|
+
// practionerInst: v.practitionerInstrction,
|
|
25653
|
+
// prepInstr: v.prepratoryInstrction,
|
|
25654
|
+
// deptInstr: v.departmentInstrction,
|
|
25655
|
+
// },
|
|
25656
|
+
// ],
|
|
25657
|
+
// });
|
|
25658
|
+
// });
|
|
25659
|
+
// return arr;
|
|
25660
|
+
// };
|
|
25661
|
+
|
|
25662
|
+
var getInstruction = function getInstruction() {
|
|
25663
|
+
var insdata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
25632
25664
|
var arr = [];
|
|
25633
|
-
insdata.
|
|
25665
|
+
(insdata !== null && insdata !== void 0 ? insdata : []).forEach(function (v) {
|
|
25666
|
+
var _v$encounterType$_id, _v$encounterType, _v$gender$_id, _v$gender, _v$ageRange$value, _v$ageRange, _v$agecategory, _v$patientInstrction, _v$practitionerInstrc, _v$prepratoryInstrcti, _v$departmentInstrcti;
|
|
25634
25667
|
arr.push({
|
|
25635
|
-
_id: v._id,
|
|
25668
|
+
_id: v === null || v === void 0 ? void 0 : v._id,
|
|
25636
25669
|
id: 0,
|
|
25637
25670
|
serviceapplicability: "Service",
|
|
25638
25671
|
setuptypeInd: "Instruction",
|
|
25639
|
-
encountertype: v
|
|
25640
|
-
gendercode: v
|
|
25641
|
-
agegroup: v
|
|
25642
|
-
agecatgcode:
|
|
25643
|
-
return a.value;
|
|
25644
|
-
})
|
|
25672
|
+
encountertype: (_v$encounterType$_id = v === null || v === void 0 || (_v$encounterType = v.encounterType) === null || _v$encounterType === void 0 ? void 0 : _v$encounterType._id) !== null && _v$encounterType$_id !== void 0 ? _v$encounterType$_id : "",
|
|
25673
|
+
gendercode: (_v$gender$_id = v === null || v === void 0 || (_v$gender = v.gender) === null || _v$gender === void 0 ? void 0 : _v$gender._id) !== null && _v$gender$_id !== void 0 ? _v$gender$_id : "",
|
|
25674
|
+
agegroup: (_v$ageRange$value = v === null || v === void 0 || (_v$ageRange = v.ageRange) === null || _v$ageRange === void 0 ? void 0 : _v$ageRange.value) !== null && _v$ageRange$value !== void 0 ? _v$ageRange$value : "",
|
|
25675
|
+
agecatgcode: ((_v$agecategory = v === null || v === void 0 ? void 0 : v.agecategory) !== null && _v$agecategory !== void 0 ? _v$agecategory : []).map(function (a) {
|
|
25676
|
+
return a === null || a === void 0 ? void 0 : a.value;
|
|
25677
|
+
}),
|
|
25645
25678
|
OrderInstr: [{
|
|
25646
|
-
patientInst: v.patientInstrction,
|
|
25647
|
-
practionerInst: v.practitionerInstrction,
|
|
25648
|
-
prepInstr: v.prepratoryInstrction,
|
|
25649
|
-
deptInstr: v.departmentInstrction
|
|
25679
|
+
patientInst: (_v$patientInstrction = v === null || v === void 0 ? void 0 : v.patientInstrction) !== null && _v$patientInstrction !== void 0 ? _v$patientInstrction : "",
|
|
25680
|
+
practionerInst: (_v$practitionerInstrc = v === null || v === void 0 ? void 0 : v.practitionerInstrction) !== null && _v$practitionerInstrc !== void 0 ? _v$practitionerInstrc : "",
|
|
25681
|
+
prepInstr: (_v$prepratoryInstrcti = v === null || v === void 0 ? void 0 : v.prepratoryInstrction) !== null && _v$prepratoryInstrcti !== void 0 ? _v$prepratoryInstrcti : "",
|
|
25682
|
+
deptInstr: (_v$departmentInstrcti = v === null || v === void 0 ? void 0 : v.departmentInstrction) !== null && _v$departmentInstrcti !== void 0 ? _v$departmentInstrcti : ""
|
|
25650
25683
|
}]
|
|
25651
25684
|
});
|
|
25652
25685
|
});
|
|
25653
25686
|
return arr;
|
|
25654
25687
|
};
|
|
25655
|
-
|
|
25688
|
+
|
|
25689
|
+
// const getFrequency = (fredata, freapp) => {
|
|
25690
|
+
// let arr = [];
|
|
25691
|
+
// fre(data ?? []).map((v) => {
|
|
25692
|
+
// arr.push({
|
|
25693
|
+
// _id: v._id,
|
|
25694
|
+
// id: 0,
|
|
25695
|
+
// serviceapplicability: "Service",
|
|
25696
|
+
// setuptypeInd: "DefaultValues",
|
|
25697
|
+
// ordercatalog: "string",
|
|
25698
|
+
// encountertype: v.encounterType ? v.encounterType._id : "",
|
|
25699
|
+
// gendercode: v.gender ? v.gender._id : "",
|
|
25700
|
+
// agegroup: v.ageRange ? v.ageRange.value : "",
|
|
25701
|
+
// agecatgcode: v.agecategory
|
|
25702
|
+
// ? v.agecategory.map((a) => {
|
|
25703
|
+
// return a.value;
|
|
25704
|
+
// })
|
|
25705
|
+
// : [],
|
|
25706
|
+
// freqappl: freapp,
|
|
25707
|
+
// dfltfreqValue: v.freqvalue ? parseInt(v.freqvalue) : 0,
|
|
25708
|
+
// dfltfreqValueUnit: v.freqValSelect ? v.freqValSelect._id : "",
|
|
25709
|
+
// dfltfreqRate: v.freqrate ? parseInt(v.freqrate) : 0,
|
|
25710
|
+
// dfltfreqRateUnit: v.freqRatSelect ? v.freqRatSelect._id : "",
|
|
25711
|
+
// dfltduration: v.freqdura ? parseInt(v.freqdura) : 0,
|
|
25712
|
+
// dfltdurationType: v.freqDuraSelect ? v.freqDuraSelect._id : "",
|
|
25713
|
+
// maxdurnallowedinDays: v.freqmax ? parseInt(v.freqmax) : 0,
|
|
25714
|
+
// });
|
|
25715
|
+
// });
|
|
25716
|
+
// return arr;
|
|
25717
|
+
// };
|
|
25718
|
+
//for table response (readJSon)
|
|
25719
|
+
|
|
25720
|
+
var getFrequency = function getFrequency() {
|
|
25721
|
+
var fredata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
25722
|
+
var freapp = arguments.length > 1 ? arguments[1] : undefined;
|
|
25656
25723
|
var arr = [];
|
|
25657
|
-
fredata.
|
|
25724
|
+
(fredata !== null && fredata !== void 0 ? fredata : []).forEach(function (v) {
|
|
25725
|
+
var _v$encounterType$_id2, _v$encounterType2, _v$gender$_id2, _v$gender2, _v$ageRange$value2, _v$ageRange2, _v$agecategory2, _v$freqValSelect$_id, _v$freqValSelect, _v$freqRatSelect$_id, _v$freqRatSelect, _v$freqDuraSelect$_id, _v$freqDuraSelect;
|
|
25658
25726
|
arr.push({
|
|
25659
|
-
_id: v._id,
|
|
25727
|
+
_id: v === null || v === void 0 ? void 0 : v._id,
|
|
25660
25728
|
id: 0,
|
|
25661
25729
|
serviceapplicability: "Service",
|
|
25662
25730
|
setuptypeInd: "DefaultValues",
|
|
25663
|
-
|
|
25664
|
-
|
|
25665
|
-
|
|
25666
|
-
|
|
25667
|
-
|
|
25668
|
-
|
|
25669
|
-
}) : [],
|
|
25731
|
+
encountertype: (_v$encounterType$_id2 = v === null || v === void 0 || (_v$encounterType2 = v.encounterType) === null || _v$encounterType2 === void 0 ? void 0 : _v$encounterType2._id) !== null && _v$encounterType$_id2 !== void 0 ? _v$encounterType$_id2 : "",
|
|
25732
|
+
gendercode: (_v$gender$_id2 = v === null || v === void 0 || (_v$gender2 = v.gender) === null || _v$gender2 === void 0 ? void 0 : _v$gender2._id) !== null && _v$gender$_id2 !== void 0 ? _v$gender$_id2 : "",
|
|
25733
|
+
agegroup: (_v$ageRange$value2 = v === null || v === void 0 || (_v$ageRange2 = v.ageRange) === null || _v$ageRange2 === void 0 ? void 0 : _v$ageRange2.value) !== null && _v$ageRange$value2 !== void 0 ? _v$ageRange$value2 : "",
|
|
25734
|
+
agecatgcode: ((_v$agecategory2 = v === null || v === void 0 ? void 0 : v.agecategory) !== null && _v$agecategory2 !== void 0 ? _v$agecategory2 : []).map(function (a) {
|
|
25735
|
+
return a === null || a === void 0 ? void 0 : a.value;
|
|
25736
|
+
}),
|
|
25670
25737
|
freqappl: freapp,
|
|
25671
|
-
dfltfreqValue: v.freqvalue ? parseInt(v.freqvalue) : 0,
|
|
25672
|
-
dfltfreqValueUnit: v
|
|
25673
|
-
dfltfreqRate: v.freqrate ? parseInt(v.freqrate) : 0,
|
|
25674
|
-
dfltfreqRateUnit: v
|
|
25675
|
-
dfltduration: v.freqdura ? parseInt(v.freqdura) : 0,
|
|
25676
|
-
dfltdurationType: v
|
|
25677
|
-
maxdurnallowedinDays: v.freqmax ? parseInt(v.freqmax) : 0
|
|
25738
|
+
dfltfreqValue: v !== null && v !== void 0 && v.freqvalue ? parseInt(v.freqvalue) : 0,
|
|
25739
|
+
dfltfreqValueUnit: (_v$freqValSelect$_id = v === null || v === void 0 || (_v$freqValSelect = v.freqValSelect) === null || _v$freqValSelect === void 0 ? void 0 : _v$freqValSelect._id) !== null && _v$freqValSelect$_id !== void 0 ? _v$freqValSelect$_id : "",
|
|
25740
|
+
dfltfreqRate: v !== null && v !== void 0 && v.freqrate ? parseInt(v.freqrate) : 0,
|
|
25741
|
+
dfltfreqRateUnit: (_v$freqRatSelect$_id = v === null || v === void 0 || (_v$freqRatSelect = v.freqRatSelect) === null || _v$freqRatSelect === void 0 ? void 0 : _v$freqRatSelect._id) !== null && _v$freqRatSelect$_id !== void 0 ? _v$freqRatSelect$_id : "",
|
|
25742
|
+
dfltduration: v !== null && v !== void 0 && v.freqdura ? parseInt(v.freqdura) : 0,
|
|
25743
|
+
dfltdurationType: (_v$freqDuraSelect$_id = v === null || v === void 0 || (_v$freqDuraSelect = v.freqDuraSelect) === null || _v$freqDuraSelect === void 0 ? void 0 : _v$freqDuraSelect._id) !== null && _v$freqDuraSelect$_id !== void 0 ? _v$freqDuraSelect$_id : "",
|
|
25744
|
+
maxdurnallowedinDays: v !== null && v !== void 0 && v.freqmax ? parseInt(v.freqmax) : 0
|
|
25678
25745
|
});
|
|
25679
25746
|
});
|
|
25680
25747
|
return arr;
|
|
25681
25748
|
};
|
|
25682
|
-
//for table response (readJSon)
|
|
25683
25749
|
var generateResJson = function generateResJson(data) {
|
|
25684
|
-
var list = data.map(function (val) {
|
|
25750
|
+
var list = (data !== null && data !== void 0 ? data : []).map(function (val) {
|
|
25685
25751
|
return _objectSpread2({
|
|
25686
25752
|
code: val.ordercatalog ? val.ordercatalog : "",
|
|
25687
25753
|
"short": val.shortdesc ? val.shortdesc : "",
|
|
@@ -25711,7 +25777,7 @@ var generateUpdateJSON = function generateUpdateJSON(editID, Status) {
|
|
|
25711
25777
|
var photoData = function photoData(data) {
|
|
25712
25778
|
var photo_Data = [];
|
|
25713
25779
|
if (data && data.length > 0) {
|
|
25714
|
-
data.map(function (val) {
|
|
25780
|
+
(data !== null && data !== void 0 ? data : []).map(function (val) {
|
|
25715
25781
|
var photo_data_obj = {
|
|
25716
25782
|
_id: val._id,
|
|
25717
25783
|
date: val.date,
|
|
@@ -25727,21 +25793,128 @@ var photoData = function photoData(data) {
|
|
|
25727
25793
|
}
|
|
25728
25794
|
return photo_Data;
|
|
25729
25795
|
};
|
|
25796
|
+
|
|
25797
|
+
// export const generateReadResJsonData = (val, state,resState) => {
|
|
25798
|
+
// return {
|
|
25799
|
+
// code: val?.ordercatalog,
|
|
25800
|
+
// longdes: val?.longdesc,
|
|
25801
|
+
// shortdes: val?.shortdesc,
|
|
25802
|
+
// catalogSynonym: val?.catalogsynonym ?? "",
|
|
25803
|
+
// orderCategory: (val?.ordercategory && val?.ordercategory?._id) ? val?.ordercategory : null,
|
|
25804
|
+
// orderType: (val?.ordertype && val?.ordertype?._id) ? val?.ordertype : null,
|
|
25805
|
+
// healthcareService: (val?.healthcareservicecode && val?.healthcareservicecode?._id) ? val?.healthcareservicecode : null,
|
|
25806
|
+
// Qtyno: val?.dfltqty,
|
|
25807
|
+
// DefaultQuantity:
|
|
25808
|
+
// ( val?.dfltqtyUOM && val?.dfltqtyUOM?._id)
|
|
25809
|
+
// ? val.dfltqtyUOM
|
|
25810
|
+
// : null,
|
|
25811
|
+
// AllowQtyCheck: val?.allowqtychange,
|
|
25812
|
+
// maxno: val?.maxorderqty,
|
|
25813
|
+
// Maxorder:
|
|
25814
|
+
// (val?.maxorderqtyUOM && val?.maxorderqtyUOM?._id) ? val?.maxorderqtyUOM : null,
|
|
25815
|
+
// explantorymsg: val?.explanatorynote,
|
|
25816
|
+
// photo: photoData(val?.photo) ?? [],
|
|
25817
|
+
// characteristicJson: [
|
|
25818
|
+
// {
|
|
25819
|
+
// label: "Complete On Order",
|
|
25820
|
+
// checked: val?.completeonorder,
|
|
25821
|
+
// },
|
|
25822
|
+
// {
|
|
25823
|
+
// label: "Hold Applicable",
|
|
25824
|
+
// checked: val?.holdappl,
|
|
25825
|
+
// },
|
|
25826
|
+
// {
|
|
25827
|
+
// label: "Discontinue Applicable",
|
|
25828
|
+
// checked: val?.discontinuappl,
|
|
25829
|
+
// },
|
|
25830
|
+
// {
|
|
25831
|
+
// label: "Chargeable",
|
|
25832
|
+
// checked: val?.chargeable,
|
|
25833
|
+
// },
|
|
25834
|
+
// {
|
|
25835
|
+
// label: "Result Applicable",
|
|
25836
|
+
// checked: val?.resultappl,
|
|
25837
|
+
// },
|
|
25838
|
+
// {
|
|
25839
|
+
// label: "Result Authentication Required",
|
|
25840
|
+
// checked: val?.resultauthreqd,
|
|
25841
|
+
// },
|
|
25842
|
+
// ],
|
|
25843
|
+
// // itemdesc:(val.itemdesc)
|
|
25844
|
+
// // ? state.order_catalog_serviceItem.data.find(
|
|
25845
|
+
// // (sys) => val.itemdesc.indexOf(sys.value) > -1
|
|
25846
|
+
// // )
|
|
25847
|
+
// // : null,
|
|
25848
|
+
// checkSwitch: val?.checkforrepeatorders,
|
|
25849
|
+
// no: val?.repeatcheckperiod,
|
|
25850
|
+
// DuplicatePeriod: (val?.repeatCheckUOM && val?.repeatCheckUOM?._id) ? val?.repeatCheckUOM : null,
|
|
25851
|
+
// CheckAction: (val?.repeatCheckAction && val?.repeatCheckAction?._id) ? val?.repeatCheckAction : null,
|
|
25852
|
+
// consentSwitch: val?.consentreqd,
|
|
25853
|
+
// ConsentForm: null,
|
|
25854
|
+
// attribute:
|
|
25855
|
+
// val?.OrderAttribApplicability.length > 0
|
|
25856
|
+
// ? val?.OrderAttribApplicability[0].winlabelName
|
|
25857
|
+
// : "",
|
|
25858
|
+
// AttributeList: generateAttribute(val?.OrderAttribApplicability, state) ?? [],
|
|
25859
|
+
// FacilityData: generatefaciltity(val?.AvailablebyPerOrganization),
|
|
25860
|
+
// SpecimenType: (val?.dfltSpecimenType && val?.dfltSpecimenType?._id)
|
|
25861
|
+
// ? val?.dfltSpecimenType : null,
|
|
25862
|
+
// VolumeQuantity: val?.dfltSpecimenVolume,
|
|
25863
|
+
// Volume:
|
|
25864
|
+
// (val?.dfltSpecimenVolumeUOM && val?.dfltSpecimenVolumeUOM?._id)
|
|
25865
|
+
// ? val?.dfltSpecimenVolumeUOM : null,
|
|
25866
|
+
// BodyType:
|
|
25867
|
+
// (val?.dfltSpecimenBodySite && val?.dfltSpecimenBodySite?._id)
|
|
25868
|
+
// ? val?.dfltSpecimenBodySite : null,
|
|
25869
|
+
// FastingPeriodQuantity: val?.dfltFastingPeriod,
|
|
25870
|
+
// FastingPeriod:
|
|
25871
|
+
// (val?.dfltFastingPeriodUOM && val?.dfltFastingPeriodUOM?._id)
|
|
25872
|
+
// ? val?.dfltFastingPeriodUOM
|
|
25873
|
+
// : null,
|
|
25874
|
+
// SpecimenContainer:
|
|
25875
|
+
// (val?.dfltSpecimenContainer && val?.dfltSpecimenContainer?._id)
|
|
25876
|
+
// ? val?.dfltSpecimenContainer
|
|
25877
|
+
// : null,
|
|
25878
|
+
// CollectionMethod:
|
|
25879
|
+
// (val?.dfltSpecimenCollectionMethod && val?.dfltSpecimenCollectionMethod?._id)
|
|
25880
|
+
// ? val?.dfltSpecimenCollectionMethod
|
|
25881
|
+
// : null,
|
|
25882
|
+
// instructions: generateInstruction(
|
|
25883
|
+
// val?.instruction,
|
|
25884
|
+
// state
|
|
25885
|
+
// ),
|
|
25886
|
+
// Frequency_applicability:
|
|
25887
|
+
// generateFrequency(val?.frequency, state).length > 0
|
|
25888
|
+
// ? true
|
|
25889
|
+
// : false,
|
|
25890
|
+
// frequency: generateFrequency(val?.frequency, state),
|
|
25891
|
+
// editData: val?._key,
|
|
25892
|
+
// id: val?.id,
|
|
25893
|
+
// draftstatus: val?.draftstatus,
|
|
25894
|
+
// status: val?.status,
|
|
25895
|
+
// resourceList: generateResoure(val?.resourcedefinition
|
|
25896
|
+
// ,resState) ?? [],
|
|
25897
|
+
// observationList: generateObservation(val?.observationdetails) ?? [],
|
|
25898
|
+
// // observationList: val.observationdetails
|
|
25899
|
+
// };
|
|
25900
|
+
// };
|
|
25901
|
+
|
|
25730
25902
|
var generateReadResJsonData = function generateReadResJsonData(val, state, resState) {
|
|
25731
|
-
var _val$catalogsynonym2, _val$ordercategory2, _val$ordertype2, _val$healthcareservic2, _val$dfltqtyUOM2, _val$maxorderqtyUOM2, _photoData, _val$repeatCheckUOM2, _val$repeatCheckActio2,
|
|
25903
|
+
var _val$catalogsynonym2, _val$ordercategory2, _val$ordertype2, _val$healthcareservic2, _val$dfltqtyUOM2, _val$maxorderqtyUOM2, _photoData, _val$repeatCheckUOM2, _val$repeatCheckActio2, _val$OrderAttribAppli, _val$OrderAttribAppli2, _val$OrderAttribAppli3, _val$dfltSpecimenType2, _val$dfltSpecimenVolu2, _val$dfltSpecimenBody2, _val$dfltFastingPerio2, _val$dfltSpecimenCont2, _val$dfltSpecimenColl2, _generateResoure2, _generateObservation2;
|
|
25904
|
+
var frequencyData = generateFrequency(val === null || val === void 0 ? void 0 : val.frequency, state);
|
|
25732
25905
|
return {
|
|
25733
25906
|
code: val === null || val === void 0 ? void 0 : val.ordercatalog,
|
|
25734
25907
|
longdes: val === null || val === void 0 ? void 0 : val.longdesc,
|
|
25735
25908
|
shortdes: val === null || val === void 0 ? void 0 : val.shortdesc,
|
|
25736
25909
|
catalogSynonym: (_val$catalogsynonym2 = val === null || val === void 0 ? void 0 : val.catalogsynonym) !== null && _val$catalogsynonym2 !== void 0 ? _val$catalogsynonym2 : "",
|
|
25737
|
-
orderCategory: val !== null && val !== void 0 &&
|
|
25738
|
-
orderType: val !== null && val !== void 0 &&
|
|
25739
|
-
healthcareService: val !== null && val !== void 0 &&
|
|
25910
|
+
orderCategory: val !== null && val !== void 0 && (_val$ordercategory2 = val.ordercategory) !== null && _val$ordercategory2 !== void 0 && _val$ordercategory2._id ? val.ordercategory : null,
|
|
25911
|
+
orderType: val !== null && val !== void 0 && (_val$ordertype2 = val.ordertype) !== null && _val$ordertype2 !== void 0 && _val$ordertype2._id ? val.ordertype : null,
|
|
25912
|
+
healthcareService: val !== null && val !== void 0 && (_val$healthcareservic2 = val.healthcareservicecode) !== null && _val$healthcareservic2 !== void 0 && _val$healthcareservic2._id ? val.healthcareservicecode : null,
|
|
25740
25913
|
Qtyno: val === null || val === void 0 ? void 0 : val.dfltqty,
|
|
25741
|
-
DefaultQuantity: val !== null && val !== void 0 &&
|
|
25914
|
+
DefaultQuantity: val !== null && val !== void 0 && (_val$dfltqtyUOM2 = val.dfltqtyUOM) !== null && _val$dfltqtyUOM2 !== void 0 && _val$dfltqtyUOM2._id ? val.dfltqtyUOM : null,
|
|
25742
25915
|
AllowQtyCheck: val === null || val === void 0 ? void 0 : val.allowqtychange,
|
|
25743
25916
|
maxno: val === null || val === void 0 ? void 0 : val.maxorderqty,
|
|
25744
|
-
Maxorder: val !== null && val !== void 0 &&
|
|
25917
|
+
Maxorder: val !== null && val !== void 0 && (_val$maxorderqtyUOM2 = val.maxorderqtyUOM) !== null && _val$maxorderqtyUOM2 !== void 0 && _val$maxorderqtyUOM2._id ? val.maxorderqtyUOM : null,
|
|
25745
25918
|
explantorymsg: val === null || val === void 0 ? void 0 : val.explanatorynote,
|
|
25746
25919
|
photo: (_photoData = photoData(val === null || val === void 0 ? void 0 : val.photo)) !== null && _photoData !== void 0 ? _photoData : [],
|
|
25747
25920
|
characteristicJson: [{
|
|
@@ -25763,71 +25936,130 @@ var generateReadResJsonData = function generateReadResJsonData(val, state, resSt
|
|
|
25763
25936
|
label: "Result Authentication Required",
|
|
25764
25937
|
checked: val === null || val === void 0 ? void 0 : val.resultauthreqd
|
|
25765
25938
|
}],
|
|
25766
|
-
// itemdesc:(val.itemdesc)
|
|
25767
|
-
// ? state.order_catalog_serviceItem.data.find(
|
|
25768
|
-
// (sys) => val.itemdesc.indexOf(sys.value) > -1
|
|
25769
|
-
// )
|
|
25770
|
-
// : null,
|
|
25771
25939
|
checkSwitch: val === null || val === void 0 ? void 0 : val.checkforrepeatorders,
|
|
25772
25940
|
no: val === null || val === void 0 ? void 0 : val.repeatcheckperiod,
|
|
25773
|
-
DuplicatePeriod: val !== null && val !== void 0 &&
|
|
25774
|
-
CheckAction: val !== null && val !== void 0 &&
|
|
25941
|
+
DuplicatePeriod: val !== null && val !== void 0 && (_val$repeatCheckUOM2 = val.repeatCheckUOM) !== null && _val$repeatCheckUOM2 !== void 0 && _val$repeatCheckUOM2._id ? val.repeatCheckUOM : null,
|
|
25942
|
+
CheckAction: val !== null && val !== void 0 && (_val$repeatCheckActio2 = val.repeatCheckAction) !== null && _val$repeatCheckActio2 !== void 0 && _val$repeatCheckActio2._id ? val.repeatCheckAction : null,
|
|
25775
25943
|
consentSwitch: val === null || val === void 0 ? void 0 : val.consentreqd,
|
|
25776
25944
|
ConsentForm: null,
|
|
25777
|
-
attribute: (val === null || val === void 0 ? void 0 :
|
|
25778
|
-
AttributeList: (
|
|
25945
|
+
attribute: (val === null || val === void 0 || (_val$OrderAttribAppli = val.OrderAttribApplicability) === null || _val$OrderAttribAppli === void 0 ? void 0 : _val$OrderAttribAppli.length) > 0 ? val === null || val === void 0 || (_val$OrderAttribAppli2 = val.OrderAttribApplicability[0]) === null || _val$OrderAttribAppli2 === void 0 ? void 0 : _val$OrderAttribAppli2.winlabelName : "",
|
|
25946
|
+
AttributeList: generateAttribute((_val$OrderAttribAppli3 = val === null || val === void 0 ? void 0 : val.OrderAttribApplicability) !== null && _val$OrderAttribAppli3 !== void 0 ? _val$OrderAttribAppli3 : [], state),
|
|
25779
25947
|
FacilityData: generatefaciltity(val === null || val === void 0 ? void 0 : val.AvailablebyPerOrganization),
|
|
25780
|
-
SpecimenType: val !== null && val !== void 0 &&
|
|
25948
|
+
SpecimenType: val !== null && val !== void 0 && (_val$dfltSpecimenType2 = val.dfltSpecimenType) !== null && _val$dfltSpecimenType2 !== void 0 && _val$dfltSpecimenType2._id ? val.dfltSpecimenType : null,
|
|
25781
25949
|
VolumeQuantity: val === null || val === void 0 ? void 0 : val.dfltSpecimenVolume,
|
|
25782
|
-
Volume: val !== null && val !== void 0 &&
|
|
25783
|
-
BodyType: val !== null && val !== void 0 &&
|
|
25950
|
+
Volume: val !== null && val !== void 0 && (_val$dfltSpecimenVolu2 = val.dfltSpecimenVolumeUOM) !== null && _val$dfltSpecimenVolu2 !== void 0 && _val$dfltSpecimenVolu2._id ? val.dfltSpecimenVolumeUOM : null,
|
|
25951
|
+
BodyType: val !== null && val !== void 0 && (_val$dfltSpecimenBody2 = val.dfltSpecimenBodySite) !== null && _val$dfltSpecimenBody2 !== void 0 && _val$dfltSpecimenBody2._id ? val === null || val === void 0 ? void 0 : val.dfltSpecimenBodySite : null,
|
|
25784
25952
|
FastingPeriodQuantity: val === null || val === void 0 ? void 0 : val.dfltFastingPeriod,
|
|
25785
|
-
FastingPeriod: val !== null && val !== void 0 &&
|
|
25786
|
-
SpecimenContainer: val !== null && val !== void 0 &&
|
|
25787
|
-
CollectionMethod: val !== null && val !== void 0 &&
|
|
25788
|
-
instructions: generateInstruction(val === null || val === void 0 ? void 0 : val.instruction),
|
|
25789
|
-
Frequency_applicability:
|
|
25790
|
-
frequency:
|
|
25953
|
+
FastingPeriod: val !== null && val !== void 0 && (_val$dfltFastingPerio2 = val.dfltFastingPeriodUOM) !== null && _val$dfltFastingPerio2 !== void 0 && _val$dfltFastingPerio2._id ? val === null || val === void 0 ? void 0 : val.dfltFastingPeriodUOM : null,
|
|
25954
|
+
SpecimenContainer: val !== null && val !== void 0 && (_val$dfltSpecimenCont2 = val.dfltSpecimenContainer) !== null && _val$dfltSpecimenCont2 !== void 0 && _val$dfltSpecimenCont2._id ? val === null || val === void 0 ? void 0 : val.dfltSpecimenContainer : null,
|
|
25955
|
+
CollectionMethod: val !== null && val !== void 0 && (_val$dfltSpecimenColl2 = val.dfltSpecimenCollectionMethod) !== null && _val$dfltSpecimenColl2 !== void 0 && _val$dfltSpecimenColl2._id ? val === null || val === void 0 ? void 0 : val.dfltSpecimenCollectionMethod : null,
|
|
25956
|
+
instructions: generateInstruction(val === null || val === void 0 ? void 0 : val.instruction, state),
|
|
25957
|
+
Frequency_applicability: frequencyData.length > 0,
|
|
25958
|
+
frequency: frequencyData,
|
|
25791
25959
|
editData: val === null || val === void 0 ? void 0 : val._key,
|
|
25792
25960
|
id: val === null || val === void 0 ? void 0 : val.id,
|
|
25793
25961
|
draftstatus: val === null || val === void 0 ? void 0 : val.draftstatus,
|
|
25794
25962
|
status: val === null || val === void 0 ? void 0 : val.status,
|
|
25795
|
-
resourceList: (_generateResoure2 = generateResoure(val === null || val === void 0 ? void 0 : val.resourcedefinition)) !== null && _generateResoure2 !== void 0 ? _generateResoure2 : [],
|
|
25963
|
+
resourceList: (_generateResoure2 = generateResoure(val === null || val === void 0 ? void 0 : val.resourcedefinition, resState)) !== null && _generateResoure2 !== void 0 ? _generateResoure2 : [],
|
|
25796
25964
|
observationList: (_generateObservation2 = generateObservation(val === null || val === void 0 ? void 0 : val.observationdetails)) !== null && _generateObservation2 !== void 0 ? _generateObservation2 : []
|
|
25797
|
-
// observationList: val.observationdetails
|
|
25798
25965
|
};
|
|
25799
25966
|
};
|
|
25800
|
-
|
|
25801
|
-
|
|
25802
|
-
|
|
25967
|
+
|
|
25968
|
+
// const generateAttribute = (data, state) => {
|
|
25969
|
+
// let arr = data?.map((v) => {
|
|
25970
|
+
// return {
|
|
25971
|
+
// Attcode: state?.order_catalog_attrcode?.data?.find(
|
|
25972
|
+
// (sys) => v?.AttribComponents?.[0]?.attribCode?.indexOf(sys?.value) > -1
|
|
25973
|
+
// ),
|
|
25974
|
+
// label: v?.AttribComponents?.[0]?.attribLabel,
|
|
25975
|
+
// type: v?.AttribComponents?.[0]?.attribType,
|
|
25976
|
+
// defaultValue:
|
|
25977
|
+
// v?.AttribComponents[0]?.attribType === "Number" ||
|
|
25978
|
+
// v?.AttribComponents[0]?.attribType === "Text"
|
|
25979
|
+
// ? { label: v?.AttribComponents[0]?.attribdefaultVal }
|
|
25980
|
+
// : getDefautlValue(v, state.order_catalog_attrcode.data),
|
|
25981
|
+
// _id: v._key,
|
|
25982
|
+
// isMandatory: v?.AttribComponents[0]?.mandatory
|
|
25983
|
+
// };
|
|
25984
|
+
// });
|
|
25985
|
+
// return arr;
|
|
25986
|
+
// };
|
|
25987
|
+
|
|
25988
|
+
// const generateResoure=(data,state)=>{
|
|
25989
|
+
// let arr = data?.map((v) =>{
|
|
25990
|
+
// return{
|
|
25991
|
+
// resourcetype: v?.resourcetype,
|
|
25992
|
+
// resourcerole: v?.resourcerole,
|
|
25993
|
+
// resourcedepartment: v?.[0].resourcedepartment,
|
|
25994
|
+
// resourcename: v?.[0].resourcename
|
|
25995
|
+
// }
|
|
25996
|
+
// } )
|
|
25997
|
+
// return arr
|
|
25998
|
+
// }
|
|
25999
|
+
|
|
26000
|
+
// const generateAttribute = (data = [], state) => {
|
|
26001
|
+
// return (data ?? []).map((v) => {
|
|
26002
|
+
// const comp = v?.AttribComponents?.[0];
|
|
26003
|
+
|
|
26004
|
+
// return {
|
|
26005
|
+
// Attcode: state?.order_catalog_attrcode?.data?.find((sys) =>
|
|
26006
|
+
// comp?.attribCode && sys?.value
|
|
26007
|
+
// ? comp.attribCode.indexOf(sys.value) > -1
|
|
26008
|
+
// : false
|
|
26009
|
+
// ),
|
|
26010
|
+
|
|
26011
|
+
// label: comp?.attribLabel ?? "",
|
|
26012
|
+
// type: comp?.attribType ?? "",
|
|
26013
|
+
|
|
26014
|
+
// defaultValue:
|
|
26015
|
+
// comp?.attribType === "Number" || comp?.attribType === "Text"
|
|
26016
|
+
// ? { label: comp?.attribdefaultVal ?? "" }
|
|
26017
|
+
// : getDefautlValue(v, state?.order_catalog_attrcode?.data),
|
|
26018
|
+
|
|
26019
|
+
// _id: v?._key ?? "",
|
|
26020
|
+
// isMandatory: comp?.mandatory ?? false,
|
|
26021
|
+
// };
|
|
26022
|
+
// });
|
|
26023
|
+
// };
|
|
26024
|
+
|
|
26025
|
+
var generateAttribute = function generateAttribute() {
|
|
26026
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
26027
|
+
var state = arguments.length > 1 ? arguments[1] : undefined;
|
|
26028
|
+
return (data !== null && data !== void 0 ? data : []).filter(function (v) {
|
|
26029
|
+
var _v$AttribComponents;
|
|
26030
|
+
return (v === null || v === void 0 || (_v$AttribComponents = v.AttribComponents) === null || _v$AttribComponents === void 0 ? void 0 : _v$AttribComponents.length) > 0;
|
|
26031
|
+
}) // 👈 ADD THIS
|
|
26032
|
+
.map(function (v) {
|
|
26033
|
+
var _v$AttribComponents2, _state$order_catalog_, _comp$attribLabel, _comp$attribType, _comp$attribdefaultVa, _state$order_catalog_2, _v$_key, _comp$mandatory;
|
|
26034
|
+
var comp = v === null || v === void 0 || (_v$AttribComponents2 = v.AttribComponents) === null || _v$AttribComponents2 === void 0 ? void 0 : _v$AttribComponents2[0];
|
|
25803
26035
|
return {
|
|
25804
26036
|
Attcode: state === null || state === void 0 || (_state$order_catalog_ = state.order_catalog_attrcode) === null || _state$order_catalog_ === void 0 || (_state$order_catalog_ = _state$order_catalog_.data) === null || _state$order_catalog_ === void 0 ? void 0 : _state$order_catalog_.find(function (sys) {
|
|
25805
|
-
|
|
25806
|
-
return ((_v$AttribComponents$ = v.AttribComponents[0]) === null || _v$AttribComponents$ === void 0 || (_v$AttribComponents$ = _v$AttribComponents$.attribCode) === null || _v$AttribComponents$ === void 0 ? void 0 : _v$AttribComponents$.indexOf(sys === null || sys === void 0 ? void 0 : sys.value)) > -1;
|
|
26037
|
+
return comp !== null && comp !== void 0 && comp.attribCode && sys !== null && sys !== void 0 && sys.value ? comp.attribCode.indexOf(sys.value) > -1 : false;
|
|
25807
26038
|
}),
|
|
25808
|
-
label: (
|
|
25809
|
-
type: (
|
|
25810
|
-
defaultValue: (
|
|
25811
|
-
label:
|
|
25812
|
-
} : getDefautlValue(v, state.order_catalog_attrcode.data),
|
|
25813
|
-
_id: v._key,
|
|
25814
|
-
isMandatory:
|
|
26039
|
+
label: (_comp$attribLabel = comp === null || comp === void 0 ? void 0 : comp.attribLabel) !== null && _comp$attribLabel !== void 0 ? _comp$attribLabel : "",
|
|
26040
|
+
type: (_comp$attribType = comp === null || comp === void 0 ? void 0 : comp.attribType) !== null && _comp$attribType !== void 0 ? _comp$attribType : "",
|
|
26041
|
+
defaultValue: (comp === null || comp === void 0 ? void 0 : comp.attribType) === "Number" || (comp === null || comp === void 0 ? void 0 : comp.attribType) === "Text" ? {
|
|
26042
|
+
label: (_comp$attribdefaultVa = comp === null || comp === void 0 ? void 0 : comp.attribdefaultVal) !== null && _comp$attribdefaultVa !== void 0 ? _comp$attribdefaultVa : ""
|
|
26043
|
+
} : getDefautlValue(v, state === null || state === void 0 || (_state$order_catalog_2 = state.order_catalog_attrcode) === null || _state$order_catalog_2 === void 0 ? void 0 : _state$order_catalog_2.data),
|
|
26044
|
+
_id: (_v$_key = v === null || v === void 0 ? void 0 : v._key) !== null && _v$_key !== void 0 ? _v$_key : "",
|
|
26045
|
+
isMandatory: (_comp$mandatory = comp === null || comp === void 0 ? void 0 : comp.mandatory) !== null && _comp$mandatory !== void 0 ? _comp$mandatory : false
|
|
25815
26046
|
};
|
|
25816
26047
|
});
|
|
25817
|
-
return arr;
|
|
25818
26048
|
};
|
|
25819
|
-
var generateResoure = function generateResoure(
|
|
25820
|
-
var
|
|
26049
|
+
var generateResoure = function generateResoure() {
|
|
26050
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
26051
|
+
return data.map(function (v) {
|
|
26052
|
+
var _v$resourcetype, _v$resourcerole, _v$resourcedepartment, _v$resourcename;
|
|
25821
26053
|
return {
|
|
25822
|
-
resourcetype: v === null || v === void 0 ? void 0 : v.resourcetype,
|
|
25823
|
-
resourcerole: v === null || v === void 0 ? void 0 : v.resourcerole,
|
|
25824
|
-
resourcedepartment: v === null || v === void 0 ? void 0 : v.resourcedepartment,
|
|
25825
|
-
resourcename: v === null || v === void 0 ? void 0 : v.resourcename
|
|
26054
|
+
resourcetype: (_v$resourcetype = v === null || v === void 0 ? void 0 : v.resourcetype) !== null && _v$resourcetype !== void 0 ? _v$resourcetype : null,
|
|
26055
|
+
resourcerole: (_v$resourcerole = v === null || v === void 0 ? void 0 : v.resourcerole) !== null && _v$resourcerole !== void 0 ? _v$resourcerole : null,
|
|
26056
|
+
resourcedepartment: (_v$resourcedepartment = v === null || v === void 0 ? void 0 : v.resourcedepartment) !== null && _v$resourcedepartment !== void 0 ? _v$resourcedepartment : [],
|
|
26057
|
+
resourcename: (_v$resourcename = v === null || v === void 0 ? void 0 : v.resourcename) !== null && _v$resourcename !== void 0 ? _v$resourcename : []
|
|
25826
26058
|
};
|
|
25827
26059
|
});
|
|
25828
|
-
return arr;
|
|
25829
26060
|
};
|
|
25830
|
-
var generateObservation = function generateObservation(
|
|
26061
|
+
var generateObservation = function generateObservation() {
|
|
26062
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
25831
26063
|
var arr = data === null || data === void 0 ? void 0 : data.map(function (v) {
|
|
25832
26064
|
var _v$Sequence, _v$ismandatory, _v$vitalcode;
|
|
25833
26065
|
return {
|
|
@@ -25838,22 +26070,36 @@ var generateObservation = function generateObservation(data) {
|
|
|
25838
26070
|
});
|
|
25839
26071
|
return arr;
|
|
25840
26072
|
};
|
|
25841
|
-
|
|
25842
|
-
|
|
25843
|
-
|
|
25844
|
-
|
|
25845
|
-
|
|
26073
|
+
|
|
26074
|
+
// const getDefautlValue = (v, attr) => {
|
|
26075
|
+
// let obj = attr?.find(
|
|
26076
|
+
// (sys) => v?.AttribComponents[0]?.attribCode?.indexOf(sys?.value) > -1
|
|
26077
|
+
// );
|
|
26078
|
+
|
|
26079
|
+
// let value = obj?.AttribValidValues?.find(
|
|
26080
|
+
// (sys) => v?.AttribComponents[0]?.attribdefaultVal?.indexOf(sys?.label) > -1
|
|
26081
|
+
// );
|
|
26082
|
+
// return value;
|
|
26083
|
+
// };
|
|
26084
|
+
|
|
26085
|
+
var getDefautlValue = function getDefautlValue(v) {
|
|
26086
|
+
var _v$AttribComponents3, _obj$AttribValidValue;
|
|
26087
|
+
var attr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
26088
|
+
var comp = v === null || v === void 0 || (_v$AttribComponents3 = v.AttribComponents) === null || _v$AttribComponents3 === void 0 ? void 0 : _v$AttribComponents3[0];
|
|
26089
|
+
if (!comp) return null;
|
|
26090
|
+
var obj = (attr !== null && attr !== void 0 ? attr : []).find(function (sys) {
|
|
26091
|
+
return comp !== null && comp !== void 0 && comp.attribCode && sys !== null && sys !== void 0 && sys.value ? comp.attribCode.indexOf(sys.value) > -1 : false;
|
|
25846
26092
|
});
|
|
25847
26093
|
var value = obj === null || obj === void 0 || (_obj$AttribValidValue = obj.AttribValidValues) === null || _obj$AttribValidValue === void 0 ? void 0 : _obj$AttribValidValue.find(function (sys) {
|
|
25848
|
-
|
|
25849
|
-
return (v === null || v === void 0 || (_v$AttribComponents$9 = v.AttribComponents[0]) === null || _v$AttribComponents$9 === void 0 || (_v$AttribComponents$9 = _v$AttribComponents$9.attribdefaultVal) === null || _v$AttribComponents$9 === void 0 ? void 0 : _v$AttribComponents$9.indexOf(sys === null || sys === void 0 ? void 0 : sys.label)) > -1;
|
|
26094
|
+
return comp !== null && comp !== void 0 && comp.attribdefaultVal && sys !== null && sys !== void 0 && sys.label ? comp.attribdefaultVal.indexOf(sys.label) > -1 : false;
|
|
25850
26095
|
});
|
|
25851
|
-
return value;
|
|
26096
|
+
return value !== null && value !== void 0 ? value : null;
|
|
25852
26097
|
};
|
|
25853
|
-
var generateInstruction = function generateInstruction(
|
|
26098
|
+
var generateInstruction = function generateInstruction() {
|
|
25854
26099
|
var _obj$Instruction;
|
|
26100
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
25855
26101
|
var obj = {};
|
|
25856
|
-
data.forEach(function (element) {
|
|
26102
|
+
(data !== null && data !== void 0 ? data : []).forEach(function (element) {
|
|
25857
26103
|
var name = element.setuptypeInd;
|
|
25858
26104
|
if (name in obj) {
|
|
25859
26105
|
obj[name].data.push(element);
|
|
@@ -25894,30 +26140,36 @@ var generateInstruction = function generateInstruction(data, state) {
|
|
|
25894
26140
|
// }
|
|
25895
26141
|
|
|
25896
26142
|
var instructionArr = obj === null || obj === void 0 || (_obj$Instruction = obj.Instruction) === null || _obj$Instruction === void 0 || (_obj$Instruction = _obj$Instruction.data) === null || _obj$Instruction === void 0 ? void 0 : _obj$Instruction.map(function (v) {
|
|
26143
|
+
var _v$agecatgcode, _v$OrderInstr$0$patie, _v$OrderInstr, _v$OrderInstr$0$pract, _v$OrderInstr2, _v$OrderInstr$0$prepI, _v$OrderInstr3, _v$OrderInstr$0$deptI, _v$OrderInstr4;
|
|
25897
26144
|
return {
|
|
25898
26145
|
encounterType: v.encountertype ? v.encountertype : null,
|
|
25899
26146
|
gender: v.gendercode ? v.gendercode : null,
|
|
25900
26147
|
ageRange: v.agegroup ? v.agegroup : null,
|
|
25901
|
-
agecategory: v.agecatgcode.map(function (v) {
|
|
26148
|
+
agecategory: ((_v$agecatgcode = v.agecatgcode) !== null && _v$agecatgcode !== void 0 ? _v$agecatgcode : []).map(function (v) {
|
|
25902
26149
|
return {
|
|
25903
26150
|
label: "",
|
|
25904
26151
|
value: v
|
|
25905
26152
|
};
|
|
25906
26153
|
}),
|
|
25907
|
-
patientInstrction: v.OrderInstr[0].patientInst,
|
|
25908
|
-
practitionerInstrction: v.OrderInstr[0].practionerInst,
|
|
25909
|
-
prepratoryInstrction: v.OrderInstr[0].prepInstr,
|
|
25910
|
-
departmentInstrction: v.OrderInstr[0].deptInstr,
|
|
26154
|
+
// patientInstrction: v.OrderInstr[0].patientInst ?? "",
|
|
26155
|
+
// practitionerInstrction: v.OrderInstr[0].practionerInst ?? "",
|
|
26156
|
+
// prepratoryInstrction: v.OrderInstr[0].prepInstr ?? "",
|
|
26157
|
+
// departmentInstrction: v.OrderInstr[0].deptInstr ?? "",
|
|
26158
|
+
patientInstrction: (_v$OrderInstr$0$patie = v === null || v === void 0 || (_v$OrderInstr = v.OrderInstr) === null || _v$OrderInstr === void 0 || (_v$OrderInstr = _v$OrderInstr[0]) === null || _v$OrderInstr === void 0 ? void 0 : _v$OrderInstr.patientInst) !== null && _v$OrderInstr$0$patie !== void 0 ? _v$OrderInstr$0$patie : "",
|
|
26159
|
+
practitionerInstrction: (_v$OrderInstr$0$pract = v === null || v === void 0 || (_v$OrderInstr2 = v.OrderInstr) === null || _v$OrderInstr2 === void 0 || (_v$OrderInstr2 = _v$OrderInstr2[0]) === null || _v$OrderInstr2 === void 0 ? void 0 : _v$OrderInstr2.practionerInst) !== null && _v$OrderInstr$0$pract !== void 0 ? _v$OrderInstr$0$pract : "",
|
|
26160
|
+
prepratoryInstrction: (_v$OrderInstr$0$prepI = v === null || v === void 0 || (_v$OrderInstr3 = v.OrderInstr) === null || _v$OrderInstr3 === void 0 || (_v$OrderInstr3 = _v$OrderInstr3[0]) === null || _v$OrderInstr3 === void 0 ? void 0 : _v$OrderInstr3.prepInstr) !== null && _v$OrderInstr$0$prepI !== void 0 ? _v$OrderInstr$0$prepI : "",
|
|
26161
|
+
departmentInstrction: (_v$OrderInstr$0$deptI = v === null || v === void 0 || (_v$OrderInstr4 = v.OrderInstr) === null || _v$OrderInstr4 === void 0 || (_v$OrderInstr4 = _v$OrderInstr4[0]) === null || _v$OrderInstr4 === void 0 ? void 0 : _v$OrderInstr4.deptInstr) !== null && _v$OrderInstr$0$deptI !== void 0 ? _v$OrderInstr$0$deptI : "",
|
|
25911
26162
|
_id: v._id
|
|
25912
26163
|
};
|
|
25913
26164
|
});
|
|
25914
26165
|
var ActualData = instructionArr !== undefined ? instructionArr : [];
|
|
25915
26166
|
return ActualData;
|
|
25916
26167
|
};
|
|
25917
|
-
var generateFrequency = function generateFrequency(
|
|
26168
|
+
var generateFrequency = function generateFrequency() {
|
|
25918
26169
|
var _obj$DefaultValues;
|
|
26170
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
25919
26171
|
var obj = {};
|
|
25920
|
-
data.forEach(function (element) {
|
|
26172
|
+
(data !== null && data !== void 0 ? data : []).forEach(function (element) {
|
|
25921
26173
|
var name = element.setuptypeInd;
|
|
25922
26174
|
if (name in obj) {
|
|
25923
26175
|
obj[name].data.push(element);
|
|
@@ -25959,11 +26211,12 @@ var generateFrequency = function generateFrequency(data, state) {
|
|
|
25959
26211
|
|
|
25960
26212
|
var frequency = [];
|
|
25961
26213
|
frequency = obj === null || obj === void 0 || (_obj$DefaultValues = obj.DefaultValues) === null || _obj$DefaultValues === void 0 || (_obj$DefaultValues = _obj$DefaultValues.data) === null || _obj$DefaultValues === void 0 ? void 0 : _obj$DefaultValues.map(function (v) {
|
|
26214
|
+
var _v$agecatgcode2;
|
|
25962
26215
|
return {
|
|
25963
26216
|
encounterType: v.encountertype ? v.encountertype : null,
|
|
25964
26217
|
gender: v.gendercode ? v.gendercode : null,
|
|
25965
26218
|
ageRange: v.agegroup ? v.agegroup : null,
|
|
25966
|
-
agecategory: v.agecatgcode.map(function (v) {
|
|
26219
|
+
agecategory: ((_v$agecatgcode2 = v.agecatgcode) !== null && _v$agecatgcode2 !== void 0 ? _v$agecatgcode2 : []).map(function (v) {
|
|
25967
26220
|
return {
|
|
25968
26221
|
label: "",
|
|
25969
26222
|
value: v
|
|
@@ -25982,8 +26235,9 @@ var generateFrequency = function generateFrequency(data, state) {
|
|
|
25982
26235
|
var ActualData = frequency !== undefined ? frequency : [];
|
|
25983
26236
|
return ActualData;
|
|
25984
26237
|
};
|
|
25985
|
-
var generatefaciltity = function generatefaciltity(
|
|
25986
|
-
var
|
|
26238
|
+
var generatefaciltity = function generatefaciltity() {
|
|
26239
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
26240
|
+
var facilityArr = (data !== null && data !== void 0 ? data : []).map(function (v) {
|
|
25987
26241
|
var _v$apptreqd, _v$apptDurnInMinutes, _v$billnature;
|
|
25988
26242
|
return {
|
|
25989
26243
|
entity_type: v.perfOrganizationEntity && v.perfOrganizationEntity._id ? v.perfOrganizationEntity : null,
|
|
@@ -26856,6 +27110,7 @@ var EDIT_ORDER_CATALOG = createAsyncThunk("orderCatalogApiSlice/editOrderCatalog
|
|
|
26856
27110
|
id,
|
|
26857
27111
|
state,
|
|
26858
27112
|
ccState,
|
|
27113
|
+
resState,
|
|
26859
27114
|
data,
|
|
26860
27115
|
res,
|
|
26861
27116
|
_args18 = arguments,
|
|
@@ -26869,14 +27124,14 @@ var EDIT_ORDER_CATALOG = createAsyncThunk("orderCatalogApiSlice/editOrderCatalog
|
|
|
26869
27124
|
id = payload.id;
|
|
26870
27125
|
state = getState();
|
|
26871
27126
|
ccState = state.orderCatalogSlice;
|
|
26872
|
-
state.resourceByAppointmentTypesSlice;
|
|
27127
|
+
resState = state.resourceByAppointmentTypesSlice;
|
|
26873
27128
|
_context18.n = 2;
|
|
26874
27129
|
return fetchData({
|
|
26875
27130
|
body: JSON.stringify(Query.editOrderCatalog(id))
|
|
26876
27131
|
}, __baseUrl__$1);
|
|
26877
27132
|
case 2:
|
|
26878
27133
|
data = _context18.v;
|
|
26879
|
-
res = generateReadResJsonData(data[0], ccState);
|
|
27134
|
+
res = generateReadResJsonData(data[0], ccState, resState);
|
|
26880
27135
|
return _context18.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
|
|
26881
27136
|
data: res
|
|
26882
27137
|
}));
|