primary_care_admin_binder 0.1.143 → 0.1.146

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.
Files changed (2) hide show
  1. package/dist/index.cjs.js +522 -356
  2. 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
- // insdata.map((v, i) => {
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
- // fredata.map((v) => {
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
- var getInstruction = function getInstruction(insdata) {
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.map(function (v, i) {
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.encounterType ? v.encounterType._id : "",
25640
- gendercode: v.gender ? v.gender._id : "",
25641
- agegroup: v.ageRange ? v.ageRange.value : "",
25642
- agecatgcode: v.agecategory ? v.agecategory.map(function (a) {
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
- var getFrequency = function getFrequency(fredata, freapp) {
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.map(function (v) {
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
- ordercatalog: "string",
25664
- encountertype: v.encounterType ? v.encounterType._id : "",
25665
- gendercode: v.gender ? v.gender._id : "",
25666
- agegroup: v.ageRange ? v.ageRange.value : "",
25667
- agecatgcode: v.agecategory ? v.agecategory.map(function (a) {
25668
- return a.value;
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.freqValSelect ? v.freqValSelect._id : "",
25673
- dfltfreqRate: v.freqrate ? parseInt(v.freqrate) : 0,
25674
- dfltfreqRateUnit: v.freqRatSelect ? v.freqRatSelect._id : "",
25675
- dfltduration: v.freqdura ? parseInt(v.freqdura) : 0,
25676
- dfltdurationType: v.freqDuraSelect ? v.freqDuraSelect._id : "",
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, _generateAttribute2, _val$dfltSpecimenType2, _val$dfltSpecimenVolu2, _val$dfltSpecimenBody2, _val$dfltFastingPerio2, _val$dfltSpecimenCont2, _val$dfltSpecimenColl2, _generateResoure2, _generateObservation2;
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 && val.ordercategory && val !== null && val !== void 0 && (_val$ordercategory2 = val.ordercategory) !== null && _val$ordercategory2 !== void 0 && _val$ordercategory2._id ? val === null || val === void 0 ? void 0 : val.ordercategory : null,
25738
- orderType: val !== null && val !== void 0 && val.ordertype && val !== null && val !== void 0 && (_val$ordertype2 = val.ordertype) !== null && _val$ordertype2 !== void 0 && _val$ordertype2._id ? val === null || val === void 0 ? void 0 : val.ordertype : null,
25739
- healthcareService: val !== null && val !== void 0 && val.healthcareservicecode && val !== null && val !== void 0 && (_val$healthcareservic2 = val.healthcareservicecode) !== null && _val$healthcareservic2 !== void 0 && _val$healthcareservic2._id ? val === null || val === void 0 ? void 0 : val.healthcareservicecode : null,
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 && val.dfltqtyUOM && val !== null && val !== void 0 && (_val$dfltqtyUOM2 = val.dfltqtyUOM) !== null && _val$dfltqtyUOM2 !== void 0 && _val$dfltqtyUOM2._id ? val.dfltqtyUOM : null,
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 && val.maxorderqtyUOM && val !== null && val !== void 0 && (_val$maxorderqtyUOM2 = val.maxorderqtyUOM) !== null && _val$maxorderqtyUOM2 !== void 0 && _val$maxorderqtyUOM2._id ? val === null || val === void 0 ? void 0 : val.maxorderqtyUOM : null,
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 && val.repeatCheckUOM && val !== null && val !== void 0 && (_val$repeatCheckUOM2 = val.repeatCheckUOM) !== null && _val$repeatCheckUOM2 !== void 0 && _val$repeatCheckUOM2._id ? val === null || val === void 0 ? void 0 : val.repeatCheckUOM : null,
25774
- CheckAction: val !== null && val !== void 0 && val.repeatCheckAction && val !== null && val !== void 0 && (_val$repeatCheckActio2 = val.repeatCheckAction) !== null && _val$repeatCheckActio2 !== void 0 && _val$repeatCheckActio2._id ? val === null || val === void 0 ? void 0 : val.repeatCheckAction : null,
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 : val.OrderAttribApplicability.length) > 0 ? val === null || val === void 0 ? void 0 : val.OrderAttribApplicability[0].winlabelName : "",
25778
- AttributeList: (_generateAttribute2 = generateAttribute(val === null || val === void 0 ? void 0 : val.OrderAttribApplicability, state)) !== null && _generateAttribute2 !== void 0 ? _generateAttribute2 : [],
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 && val.dfltSpecimenType && val !== null && val !== void 0 && (_val$dfltSpecimenType2 = val.dfltSpecimenType) !== null && _val$dfltSpecimenType2 !== void 0 && _val$dfltSpecimenType2._id ? val === null || val === void 0 ? void 0 : val.dfltSpecimenType : null,
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 && val.dfltSpecimenVolumeUOM && val !== null && val !== void 0 && (_val$dfltSpecimenVolu2 = val.dfltSpecimenVolumeUOM) !== null && _val$dfltSpecimenVolu2 !== void 0 && _val$dfltSpecimenVolu2._id ? val === null || val === void 0 ? void 0 : val.dfltSpecimenVolumeUOM : null,
25783
- BodyType: val !== null && val !== void 0 && val.dfltSpecimenBodySite && 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,
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 && val.dfltFastingPeriodUOM && 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,
25786
- SpecimenContainer: val !== null && val !== void 0 && val.dfltSpecimenContainer && 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,
25787
- CollectionMethod: val !== null && val !== void 0 && val.dfltSpecimenCollectionMethod && 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,
25788
- instructions: generateInstruction(val === null || val === void 0 ? void 0 : val.instruction),
25789
- Frequency_applicability: generateFrequency(val === null || val === void 0 ? void 0 : val.frequency).length > 0 ? true : false,
25790
- frequency: generateFrequency(val === null || val === void 0 ? void 0 : val.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
- var generateAttribute = function generateAttribute(data, state) {
25801
- var arr = data === null || data === void 0 ? void 0 : data.map(function (v) {
25802
- var _state$order_catalog_, _v$AttribComponents$2, _v$AttribComponents$3, _v$AttribComponents$4, _v$AttribComponents$5, _v$AttribComponents$6, _v$AttribComponents$7;
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
- var _v$AttribComponents$;
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: (_v$AttribComponents$2 = v.AttribComponents[0]) === null || _v$AttribComponents$2 === void 0 ? void 0 : _v$AttribComponents$2.attribLabel,
25809
- type: (_v$AttribComponents$3 = v.AttribComponents[0]) === null || _v$AttribComponents$3 === void 0 ? void 0 : _v$AttribComponents$3.attribType,
25810
- defaultValue: (v === null || v === void 0 || (_v$AttribComponents$4 = v.AttribComponents[0]) === null || _v$AttribComponents$4 === void 0 ? void 0 : _v$AttribComponents$4.attribType) === "Number" || (v === null || v === void 0 || (_v$AttribComponents$5 = v.AttribComponents[0]) === null || _v$AttribComponents$5 === void 0 ? void 0 : _v$AttribComponents$5.attribType) === "Text" ? {
25811
- label: v === null || v === void 0 || (_v$AttribComponents$6 = v.AttribComponents[0]) === null || _v$AttribComponents$6 === void 0 ? void 0 : _v$AttribComponents$6.attribdefaultVal
25812
- } : getDefautlValue(v, state.order_catalog_attrcode.data),
25813
- _id: v._key,
25814
- isMandatory: v === null || v === void 0 || (_v$AttribComponents$7 = v.AttribComponents[0]) === null || _v$AttribComponents$7 === void 0 ? void 0 : _v$AttribComponents$7.mandatory
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(data, state) {
25820
- var arr = data === null || data === void 0 ? void 0 : data.map(function (v) {
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(data) {
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
- var getDefautlValue = function getDefautlValue(v, attr) {
25842
- var _obj$AttribValidValue;
25843
- var obj = attr === null || attr === void 0 ? void 0 : attr.find(function (sys) {
25844
- var _v$AttribComponents$8;
25845
- return (v === null || v === void 0 || (_v$AttribComponents$8 = v.AttribComponents[0]) === null || _v$AttribComponents$8 === void 0 || (_v$AttribComponents$8 = _v$AttribComponents$8.attribCode) === null || _v$AttribComponents$8 === void 0 ? void 0 : _v$AttribComponents$8.indexOf(sys === null || sys === void 0 ? void 0 : sys.value)) > -1;
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
- var _v$AttribComponents$9;
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(data, state) {
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(data, state) {
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(data, state) {
25986
- var facilityArr = data.map(function (v) {
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
  }));
@@ -41047,79 +41302,41 @@ var pendingRescheduleListActions = {
41047
41302
  var pendingRescheduleListSlice = getPendingRescheduleListApiSlice.reducer;
41048
41303
 
41049
41304
  var queries$3 = {
41050
- geoCodeType: function geoCodeType(type) {
41305
+ geoMasterTypeRead: function geoMasterTypeRead() {
41306
+ var filterType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "GEOCODE";
41051
41307
  return {
41052
41308
  db_name: dbName,
41053
- entity: "CodingMaster",
41054
- sort: "CodingMaster.display",
41055
- filter: "CodingMaster.activestatus==true && CodingMaster.Type=='GEOCODE'",
41056
- return_fields: "CodingMaster"
41309
+ queryid: "b283129b-9841-419b-bdfc-de5105ebbad7",
41310
+ filter: {
41311
+ type: filterType,
41312
+ code: "",
41313
+ sortField: "",
41314
+ status: ""
41315
+ }
41057
41316
  };
41058
41317
  },
41059
- geoParentType: function geoParentType(type) {
41318
+ geoHierarchicalRead: function geoHierarchicalRead(displayLevel) {
41319
+ var parentCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
41060
41320
  return {
41061
41321
  db_name: dbName,
41062
- entity: "CodingMaster",
41063
- sort: "CodingMaster.display",
41064
- filter: "CodingMaster.activestatus==true && CodingMaster.Type=='GEOCODE'",
41065
- return_fields: "CodingMaster"
41322
+ queryid: "ad647bcf-edcc-44ac-9ca9-67c3b277b8df",
41323
+ filter: {
41324
+ activestatus: true,
41325
+ display: displayLevel.toUpperCase(),
41326
+ geoglevelcode: parentCode || ""
41327
+ }
41066
41328
  };
41067
41329
  },
41068
- //COUNTRY READ
41069
41330
  geoCountryRead: function geoCountryRead() {
41070
41331
  return {
41071
41332
  db_name: dbName,
41072
- entity: "SMGeographicMaster",
41073
- filter: "SMGeographicMaster.activestatus==true && lower(document(SMGeographicMaster.geogLevelType).display)=='country'",
41074
- sort: "SMGeographicMaster.createddate desc",
41075
- return_fields: "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, GeoLocationISDCode :SMGeographicMaster.GeoLocationISDCode, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.active,_key:SMGeographicMaster._key}"
41076
- };
41077
- },
41078
- //STATE READ
41079
- geoStateRead: function geoStateRead(id) {
41080
- var _ref, _ref$toUpperCase;
41081
- return {
41082
- db_name: dbName,
41083
- entity: "SMGeographicMaster",
41084
- filter: "SMGeographicMaster.activestatus==true && upper(document(SMGeographicMaster.geogLevelType).display)=='STATE' && upper(document(SMGeographicMaster.parentGeogLevelCode).geogLevelCode)=='".concat((_ref = id || "") === null || _ref === void 0 || (_ref$toUpperCase = _ref.toUpperCase) === null || _ref$toUpperCase === void 0 ? void 0 : _ref$toUpperCase.call(_ref), "'"),
41085
- sort: "SMGeographicMaster.createddate desc",
41086
- return_fields: "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.active,_key:SMGeographicMaster._key}"
41087
- };
41088
- },
41089
- //DISTRICT READ
41090
- geoDistrictRead: function geoDistrictRead(id) {
41091
- var _ref2, _ref2$toUpperCase;
41092
- return {
41093
- db_name: dbName,
41094
- entity: "SMGeographicMaster",
41095
- filter: "SMGeographicMaster.activestatus==true && upper(document(SMGeographicMaster.geogLevelType).display)=='DISTRICT' && upper(document(SMGeographicMaster.parentGeogLevelCode).geogLevelCode)=='".concat((_ref2 = id || "") === null || _ref2 === void 0 || (_ref2$toUpperCase = _ref2.toUpperCase) === null || _ref2$toUpperCase === void 0 ? void 0 : _ref2$toUpperCase.call(_ref2), "'"),
41096
- sort: "SMGeographicMaster.createddate desc",
41097
- return_fields: "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.active,_key:SMGeographicMaster._key}"
41098
- };
41099
- },
41100
- //CITY READ
41101
- geoCityRead: function geoCityRead(id) {
41102
- var _ref3, _ref3$toUpperCase;
41103
- return {
41104
- db_name: dbName,
41105
- entity: "SMGeographicMaster",
41106
- filter: "SMGeographicMaster.activestatus==true && upper(document(SMGeographicMaster.geogLevelType).display)=='CITY' && upper(document(SMGeographicMaster.parentGeogLevelCode).geogLevelCode)=='".concat((_ref3 = id || "") === null || _ref3 === void 0 || (_ref3$toUpperCase = _ref3.toUpperCase) === null || _ref3$toUpperCase === void 0 ? void 0 : _ref3$toUpperCase.call(_ref3), "'"),
41107
- sort: "SMGeographicMaster.createddate desc",
41108
- return_fields: "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.active,_key:SMGeographicMaster._key}"
41109
- };
41110
- },
41111
- //PINCODE READ
41112
- geoPincodeRead: function geoPincodeRead(id) {
41113
- var _ref4, _ref4$toUpperCase;
41114
- return {
41115
- db_name: dbName,
41116
- entity: "SMGeographicMaster",
41117
- filter: "SMGeographicMaster.activestatus==true && upper(document(SMGeographicMaster.geogLevelType).display)=='PINCODE' && upper(document(SMGeographicMaster.parentGeogLevelCode).geogLevelCode)=='".concat((_ref4 = id || "") === null || _ref4 === void 0 || (_ref4$toUpperCase = _ref4.toUpperCase) === null || _ref4$toUpperCase === void 0 ? void 0 : _ref4$toUpperCase.call(_ref4), "'"),
41118
- sort: "SMGeographicMaster.createddate desc",
41119
- return_fields: "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.active,_key:SMGeographicMaster._key}"
41333
+ queryid: "e2cb9d5c-3491-40da-8a5b-c8f90c39e286",
41334
+ filter: {
41335
+ Leveltype: "country",
41336
+ activestatus: true
41337
+ }
41120
41338
  };
41121
41339
  },
41122
- //STATUS CHANGE
41123
41340
  geoStatusChange: function geoStatusChange(data) {
41124
41341
  return [{
41125
41342
  db_name: dbName,
@@ -41135,73 +41352,77 @@ var queries$3 = {
41135
41352
  }
41136
41353
  }];
41137
41354
  },
41138
- //GEOGRAPHIC_MASTER_MASTER
41139
- geoMasterMaster: function geoMasterMaster() {
41355
+ editGeoGraphicSingleRead: function editGeoGraphicSingleRead(id) {
41140
41356
  return {
41141
41357
  db_name: dbName,
41142
- entity: "CodingMaster",
41143
- sort: "CodingMaster.display",
41144
- filter: "CodingMaster.activestatus==true && CodingMaster.Type=='GEOCODE'",
41145
- return_fields: "CodingMaster"
41358
+ queryid: "be0b63d3-9d9a-46e3-8073-94a66c050541",
41359
+ filter: {
41360
+ activestatus: true,
41361
+ key: id || ""
41362
+ }
41146
41363
  };
41147
41364
  },
41148
- //GEOGRAPHIC_PARENT_CODE
41149
41365
  geoMasterParentCode: function geoMasterParentCode(id) {
41150
41366
  return {
41151
41367
  db_name: dbName,
41152
- entity: "SMGeographicMaster",
41153
- sort: "SMGeographicMaster.geogLevelName",
41154
- filter: "SMGeographicMaster.geogLevelType=='".concat(id, "' && SMGeographicMaster.activestatus==true"),
41155
- return_fields: "{id:SMGeographicMaster.id,_id:SMGeographicMaster._id,geogLevelCode:SMGeographicMaster.geogLevelCode,geogLevelName:SMGeographicMaster.geogLevelName,geogLevelType:document(SMGeographicMaster.geogLevelType).display,parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType),parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode),GeoLocationISDCode:SMGeographicMaster.GeoLocationISDCode,_key:SMGeographicMaster._key}"
41368
+ queryid: "063ee1f3-c2ea-4cb9-bcf5-75e434b7e583",
41369
+ filter: {
41370
+ activestatus: true,
41371
+ Leveltype: id || "",
41372
+ code: ""
41373
+ }
41156
41374
  };
41157
41375
  },
41158
- //GEOGRAPHIC_SINGLE_READ
41159
- editGeoGraphicSingleRead: function editGeoGraphicSingleRead(id) {
41376
+ geoCodeExits: function geoCodeExits(_ref) {
41377
+ var levelType = _ref.levelType,
41378
+ geoLevelCode = _ref.geoLevelCode;
41160
41379
  return {
41161
41380
  db_name: dbName,
41162
- entity: "SMGeographicMaster",
41163
- filter: "SMGeographicMaster.activestatus==true && SMGeographicMaster._key=='".concat(id, "'"),
41164
- return_fields: "{_id:SMGeographicMaster._id, id:SMGeographicMaster.id, geogLevelType:document(SMGeographicMaster.geogLevelType), geogLevelCode:SMGeographicMaster.geogLevelCode, geogLevelName:SMGeographicMaster.geogLevelName, parentGeogLevelType:document(SMGeographicMaster.parentGeogLevelType), GeoLocationISDCode :SMGeographicMaster.GeoLocationISDCode, parentGeogLevelCode:document(SMGeographicMaster.parentGeogLevelCode), active: SMGeographicMaster.activestatus,_key:SMGeographicMaster._key}"
41381
+ queryid: "063ee1f3-c2ea-4cb9-bcf5-75e434b7e583",
41382
+ filter: {
41383
+ Leveltype: levelType,
41384
+ code: geoLevelCode,
41385
+ activestatus: true
41386
+ }
41165
41387
  };
41166
- },
41167
- //geo code exits checking
41168
- geoCodeExits: function geoCodeExits(_ref5) {
41169
- var levelType = _ref5.levelType,
41170
- geoLevelCode = _ref5.geoLevelCode;
41171
- return "{\n\t\t\t\"db_name\": \"".concat(dbName, "\",\n\t\t\t\"entity\": \"SMGeographicMaster\",\n\t\t\t\"filter\": \"SMGeographicMaster.geogLevelType=='").concat(levelType, "' && SMGeographicMaster.geogLevelCode=='").concat(geoLevelCode, "'\",\n\t\t\t\"return_fields\": \"SMGeographicMaster\"\n\t\t }");
41172
41388
  }
41173
41389
  };
41174
41390
 
41175
41391
  var generateJson = function generateJson(data) {
41176
- var _data$id, _data$type$value, _data$code, _data$name, _data$parentType$valu, _data$parentCode$valu, _data$status, _data$geolocationISD;
41177
- var filter = {};
41178
- if (data._key) {
41179
- filter = {
41180
- filter: {
41181
- _key: data._key
41182
- }
41392
+ var _data$id, _data$type, _data$code, _data$name, _data$parentType, _ref, _data$parentCode$valu, _data$parentCode, _data$status, _data$geolocationISD;
41393
+ var isEdit = !!data._key;
41394
+ var doc = _objectSpread2(_objectSpread2(_objectSpread2({}, isEdit && data._id && data._id !== "" ? {
41395
+ _id: data._id
41396
+ } : {}), !isEdit ? {
41397
+ id: ((_data$id = data.id) === null || _data$id === void 0 ? void 0 : _data$id.toString()) || ""
41398
+ } : {}), {}, {
41399
+ geogLevelType: (_data$type = data.type) !== null && _data$type !== void 0 && _data$type.value ? data.type.value : null,
41400
+ geogLevelCode: ((_data$code = data.code) !== null && _data$code !== void 0 ? _data$code : "").trim() || null,
41401
+ geogLevelName: ((_data$name = data.name) !== null && _data$name !== void 0 ? _data$name : "").trim() || null,
41402
+ parentGeogLevelType: (_data$parentType = data.parentType) !== null && _data$parentType !== void 0 && _data$parentType.value ? data.parentType.value : null,
41403
+ parentGeogLevelCode: ((_ref = (_data$parentCode$valu = (_data$parentCode = data.parentCode) === null || _data$parentCode === void 0 ? void 0 : _data$parentCode.value) !== null && _data$parentCode$valu !== void 0 ? _data$parentCode$valu : data.parentCode) !== null && _ref !== void 0 ? _ref : "").trim() || null,
41404
+ active: (_data$status = data.status) !== null && _data$status !== void 0 ? _data$status : true,
41405
+ GeoLocationISDCode: ((_data$geolocationISD = data.geolocationISD) !== null && _data$geolocationISD !== void 0 ? _data$geolocationISD : "").trim() || null
41406
+ });
41407
+ Object.keys(doc).forEach(function (key) {
41408
+ if (doc[key] === null || doc[key] === "" || doc[key] === undefined) {
41409
+ delete doc[key];
41410
+ }
41411
+ });
41412
+ var payloadItem = {
41413
+ db_name: dbName,
41414
+ entity: "SMGeographicMaster",
41415
+ is_metadata: true,
41416
+ metadataId: metaDataId$1,
41417
+ metadata_dbname: metaDatadbName$1,
41418
+ doc: doc
41419
+ };
41420
+ if (isEdit) {
41421
+ payloadItem.filter = {
41422
+ _key: data._key
41183
41423
  };
41184
41424
  }
41185
- var arr = [_objectSpread2(_objectSpread2({
41186
- "db_name": dbName,
41187
- "entity": "SMGeographicMaster",
41188
- "is_metadata": true
41189
- }, filter), {}, {
41190
- "metadataId": metaDataId$1,
41191
- "metadata_dbname": metaDatadbName$1,
41192
- "doc": {
41193
- "_id": "",
41194
- "id": (_data$id = data.id) !== null && _data$id !== void 0 ? _data$id : "",
41195
- "geogLevelType": (_data$type$value = data.type.value) !== null && _data$type$value !== void 0 ? _data$type$value : "",
41196
- "geogLevelCode": (_data$code = data.code) !== null && _data$code !== void 0 ? _data$code : "",
41197
- "geogLevelName": (_data$name = data.name) !== null && _data$name !== void 0 ? _data$name : "",
41198
- "parentGeogLevelType": (_data$parentType$valu = data.parentType.value) !== null && _data$parentType$valu !== void 0 ? _data$parentType$valu : "",
41199
- "parentGeogLevelCode": (_data$parentCode$valu = data.parentCode.value) !== null && _data$parentCode$valu !== void 0 ? _data$parentCode$valu : "",
41200
- "active": (_data$status = data.status) !== null && _data$status !== void 0 ? _data$status : "",
41201
- "GeoLocationISDCode": (_data$geolocationISD = data.geolocationISD) !== null && _data$geolocationISD !== void 0 ? _data$geolocationISD : ""
41202
- }
41203
- })];
41204
- return arr;
41425
+ return [payloadItem];
41205
41426
  };
41206
41427
 
41207
41428
  //EDIT READ JSON
@@ -41235,6 +41456,7 @@ var _extraReducers$4;
41235
41456
  var GEOGRAPHIC_TYPE_READ = createAsyncThunk("geographicSlice/geoGraphicTypeRead", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
41236
41457
  var _ref2,
41237
41458
  rejectWithValue,
41459
+ _data$result,
41238
41460
  queriesjson,
41239
41461
  data,
41240
41462
  arry,
@@ -41245,15 +41467,15 @@ var GEOGRAPHIC_TYPE_READ = createAsyncThunk("geographicSlice/geoGraphicTypeRead"
41245
41467
  case 0:
41246
41468
  _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
41247
41469
  _context.p = 1;
41248
- queriesjson = queries$3.geoCodeType();
41470
+ queriesjson = queries$3.geoMasterTypeRead();
41249
41471
  _context.n = 2;
41250
41472
  return fetchData({
41251
41473
  body: JSON.stringify(queriesjson)
41252
- }, __readDocumentUrl__);
41474
+ }, __baseUrl__$1);
41253
41475
  case 2:
41254
41476
  data = _context.v;
41255
41477
  arry = [];
41256
- data.result.map(function (val, i) {
41478
+ (_data$result = data.result) === null || _data$result === void 0 || _data$result.forEach(function (val) {
41257
41479
  if (val !== null && val !== void 0 && val._id && val !== null && val !== void 0 && val.display) {
41258
41480
  arry.push({
41259
41481
  id: val === null || val === void 0 ? void 0 : val.id,
@@ -41278,6 +41500,7 @@ var GEOGRAPHIC_TYPE_READ = createAsyncThunk("geographicSlice/geoGraphicTypeRead"
41278
41500
  var GEOGRAPHIC_PARENT_READ = createAsyncThunk("geographicSlice/geoParentRead", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
41279
41501
  var _ref4,
41280
41502
  rejectWithValue,
41503
+ _data$result2,
41281
41504
  queriesjson,
41282
41505
  data,
41283
41506
  arry,
@@ -41288,15 +41511,15 @@ var GEOGRAPHIC_PARENT_READ = createAsyncThunk("geographicSlice/geoParentRead", /
41288
41511
  case 0:
41289
41512
  _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
41290
41513
  _context2.p = 1;
41291
- queriesjson = queries$3.geoParentType();
41514
+ queriesjson = queries$3.geoMasterTypeRead();
41292
41515
  _context2.n = 2;
41293
41516
  return fetchData({
41294
41517
  body: JSON.stringify(queriesjson)
41295
- }, __readDocumentUrl__);
41518
+ }, __baseUrl__$1);
41296
41519
  case 2:
41297
41520
  data = _context2.v;
41298
41521
  arry = [];
41299
- data.result.map(function (val, i) {
41522
+ (_data$result2 = data.result) === null || _data$result2 === void 0 || _data$result2.forEach(function (val) {
41300
41523
  if (val !== null && val !== void 0 && val._id && val !== null && val !== void 0 && val.display) {
41301
41524
  arry.push({
41302
41525
  id: val === null || val === void 0 ? void 0 : val.id,
@@ -41318,12 +41541,9 @@ var GEOGRAPHIC_PARENT_READ = createAsyncThunk("geographicSlice/geoParentRead", /
41318
41541
  }
41319
41542
  }, _callee2, null, [[1, 3]]);
41320
41543
  })));
41321
-
41322
- //GEOGRAPHIC_COUNTRY_READ
41323
- var GEOGRAPHIC_COUNTRY_READ = createAsyncThunk("geographicSlice/geoCountryRead", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
41544
+ var GEOGRAPHIC_MASTER_MASTER = createAsyncThunk("geographicSlice/geoMasterMaster", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
41324
41545
  var _ref6,
41325
41546
  rejectWithValue,
41326
- _data$result,
41327
41547
  queriesjson,
41328
41548
  data,
41329
41549
  arry,
@@ -41334,24 +41554,19 @@ var GEOGRAPHIC_COUNTRY_READ = createAsyncThunk("geographicSlice/geoCountryRead",
41334
41554
  case 0:
41335
41555
  _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue;
41336
41556
  _context3.p = 1;
41337
- queriesjson = queries$3.geoCountryRead();
41557
+ queriesjson = queries$3.geoMasterTypeRead("GEOCODE");
41338
41558
  _context3.n = 2;
41339
41559
  return fetchData({
41340
41560
  body: JSON.stringify(queriesjson)
41341
- }, __readDocumentUrl__);
41561
+ }, __baseUrl__$1);
41342
41562
  case 2:
41343
41563
  data = _context3.v;
41344
41564
  arry = [];
41345
- data === null || data === void 0 || (_data$result = data.result) === null || _data$result === void 0 || _data$result.map(function (val, i) {
41346
- var _val$id, _val$_id, _val$_key, _val$geogLevelCode, _val$geogLevelName, _val$GeoLocationISDCo;
41565
+ data === null || data === void 0 || data.forEach(function (val) {
41566
+ var _val$_id, _val$display;
41347
41567
  arry.push({
41348
- id: (_val$id = val === null || val === void 0 ? void 0 : val.id) !== null && _val$id !== void 0 ? _val$id : "",
41349
- _id: (_val$_id = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id !== void 0 ? _val$_id : "",
41350
- _key: (_val$_key = val._key) !== null && _val$_key !== void 0 ? _val$_key : "",
41351
- code: (_val$geogLevelCode = val === null || val === void 0 ? void 0 : val.geogLevelCode) !== null && _val$geogLevelCode !== void 0 ? _val$geogLevelCode : "",
41352
- name: (_val$geogLevelName = val === null || val === void 0 ? void 0 : val.geogLevelName) !== null && _val$geogLevelName !== void 0 ? _val$geogLevelName : "",
41353
- geoLocationISDCode: (_val$GeoLocationISDCo = val === null || val === void 0 ? void 0 : val.GeoLocationISDCode) !== null && _val$GeoLocationISDCo !== void 0 ? _val$GeoLocationISDCo : "",
41354
- status: val === null || val === void 0 ? void 0 : val.active
41568
+ value: (_val$_id = val._id) !== null && _val$_id !== void 0 ? _val$_id : "",
41569
+ label: (_val$display = val.display) !== null && _val$display !== void 0 ? _val$display : ""
41355
41570
  });
41356
41571
  });
41357
41572
  return _context3.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -41367,15 +41582,13 @@ var GEOGRAPHIC_COUNTRY_READ = createAsyncThunk("geographicSlice/geoCountryRead",
41367
41582
  }, _callee3, null, [[1, 3]]);
41368
41583
  })));
41369
41584
 
41370
- //GEOGRAPHIC_STATE_READ
41585
+ // HIERARCHICAL READS
41371
41586
  var GEOGRAPHIC_STATE_READ = createAsyncThunk("geographicSlice/geoStateRead", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
41372
41587
  var payload,
41373
41588
  _ref8,
41374
41589
  rejectWithValue,
41375
- _data$result2,
41376
41590
  queriesjson,
41377
41591
  data,
41378
- arry,
41379
41592
  _args4 = arguments,
41380
41593
  _t4;
41381
41594
  return _regenerator().w(function (_context4) {
@@ -41384,28 +41597,14 @@ var GEOGRAPHIC_STATE_READ = createAsyncThunk("geographicSlice/geoStateRead", /*#
41384
41597
  payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
41385
41598
  _ref8 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref8.rejectWithValue;
41386
41599
  _context4.p = 1;
41387
- queriesjson = queries$3.geoStateRead(payload === null || payload === void 0 ? void 0 : payload.id);
41600
+ queriesjson = queries$3.geoHierarchicalRead("STATE", payload === null || payload === void 0 ? void 0 : payload.id);
41388
41601
  _context4.n = 2;
41389
41602
  return fetchData({
41390
41603
  body: JSON.stringify(queriesjson)
41391
- }, __readDocumentUrl__);
41604
+ }, __baseUrl__$1);
41392
41605
  case 2:
41393
41606
  data = _context4.v;
41394
- arry = [];
41395
- data === null || data === void 0 || (_data$result2 = data.result) === null || _data$result2 === void 0 || _data$result2.map(function (val, i) {
41396
- var _val$id2, _val$_id2, _val$_key2, _val$geogLevelCode2, _val$geogLevelName2;
41397
- arry.push({
41398
- id: (_val$id2 = val === null || val === void 0 ? void 0 : val.id) !== null && _val$id2 !== void 0 ? _val$id2 : "",
41399
- _id: (_val$_id2 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id2 !== void 0 ? _val$_id2 : "",
41400
- _key: (_val$_key2 = val._key) !== null && _val$_key2 !== void 0 ? _val$_key2 : "",
41401
- code: (_val$geogLevelCode2 = val === null || val === void 0 ? void 0 : val.geogLevelCode) !== null && _val$geogLevelCode2 !== void 0 ? _val$geogLevelCode2 : "",
41402
- name: (_val$geogLevelName2 = val === null || val === void 0 ? void 0 : val.geogLevelName) !== null && _val$geogLevelName2 !== void 0 ? _val$geogLevelName2 : "",
41403
- status: val === null || val === void 0 ? void 0 : val.active
41404
- });
41405
- });
41406
- return _context4.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
41407
- data: arry
41408
- }));
41607
+ return _context4.a(2, mapToList(data));
41409
41608
  case 3:
41410
41609
  _context4.p = 3;
41411
41610
  _t4 = _context4.v;
@@ -41415,16 +41614,12 @@ var GEOGRAPHIC_STATE_READ = createAsyncThunk("geographicSlice/geoStateRead", /*#
41415
41614
  }
41416
41615
  }, _callee4, null, [[1, 3]]);
41417
41616
  })));
41418
-
41419
- //GEOGRAPHIC_DISTRICT_READ
41420
41617
  var GEOGRAPHIC_DISTRICT_READ = createAsyncThunk("geographicSlice/geoDistrictRead", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
41421
41618
  var payload,
41422
41619
  _ref0,
41423
41620
  rejectWithValue,
41424
- _data$result3,
41425
41621
  queriesjson,
41426
41622
  data,
41427
- arry,
41428
41623
  _args5 = arguments,
41429
41624
  _t5;
41430
41625
  return _regenerator().w(function (_context5) {
@@ -41433,28 +41628,14 @@ var GEOGRAPHIC_DISTRICT_READ = createAsyncThunk("geographicSlice/geoDistrictRead
41433
41628
  payload = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
41434
41629
  _ref0 = _args5.length > 1 ? _args5[1] : undefined, rejectWithValue = _ref0.rejectWithValue;
41435
41630
  _context5.p = 1;
41436
- queriesjson = queries$3.geoDistrictRead(payload === null || payload === void 0 ? void 0 : payload.id);
41631
+ queriesjson = queries$3.geoHierarchicalRead("DISTRICT", payload === null || payload === void 0 ? void 0 : payload.id);
41437
41632
  _context5.n = 2;
41438
41633
  return fetchData({
41439
41634
  body: JSON.stringify(queriesjson)
41440
- }, __readDocumentUrl__);
41635
+ }, __baseUrl__$1);
41441
41636
  case 2:
41442
41637
  data = _context5.v;
41443
- arry = [];
41444
- data === null || data === void 0 || (_data$result3 = data.result) === null || _data$result3 === void 0 || _data$result3.map(function (val, i) {
41445
- var _val$id3, _val$_id3, _val$_key3, _val$geogLevelCode3, _val$geogLevelName3;
41446
- arry.push({
41447
- id: (_val$id3 = val === null || val === void 0 ? void 0 : val.id) !== null && _val$id3 !== void 0 ? _val$id3 : "",
41448
- _id: (_val$_id3 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id3 !== void 0 ? _val$_id3 : "",
41449
- _key: (_val$_key3 = val._key) !== null && _val$_key3 !== void 0 ? _val$_key3 : "",
41450
- code: (_val$geogLevelCode3 = val === null || val === void 0 ? void 0 : val.geogLevelCode) !== null && _val$geogLevelCode3 !== void 0 ? _val$geogLevelCode3 : "",
41451
- name: (_val$geogLevelName3 = val === null || val === void 0 ? void 0 : val.geogLevelName) !== null && _val$geogLevelName3 !== void 0 ? _val$geogLevelName3 : "",
41452
- status: val === null || val === void 0 ? void 0 : val.active
41453
- });
41454
- });
41455
- return _context5.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
41456
- data: arry
41457
- }));
41638
+ return _context5.a(2, mapToList(data));
41458
41639
  case 3:
41459
41640
  _context5.p = 3;
41460
41641
  _t5 = _context5.v;
@@ -41464,16 +41645,12 @@ var GEOGRAPHIC_DISTRICT_READ = createAsyncThunk("geographicSlice/geoDistrictRead
41464
41645
  }
41465
41646
  }, _callee5, null, [[1, 3]]);
41466
41647
  })));
41467
-
41468
- //GEOGRAPHIC_CITY_READ
41469
41648
  var GEOGRAPHIC_CITY_READ = createAsyncThunk("geographicSlice/geoCityRead", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
41470
41649
  var payload,
41471
41650
  _ref10,
41472
41651
  rejectWithValue,
41473
- _data$result4,
41474
41652
  queriesjson,
41475
41653
  data,
41476
- arry,
41477
41654
  _args6 = arguments,
41478
41655
  _t6;
41479
41656
  return _regenerator().w(function (_context6) {
@@ -41482,28 +41659,14 @@ var GEOGRAPHIC_CITY_READ = createAsyncThunk("geographicSlice/geoCityRead", /*#__
41482
41659
  payload = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
41483
41660
  _ref10 = _args6.length > 1 ? _args6[1] : undefined, rejectWithValue = _ref10.rejectWithValue;
41484
41661
  _context6.p = 1;
41485
- queriesjson = queries$3.geoCityRead(payload === null || payload === void 0 ? void 0 : payload.id);
41662
+ queriesjson = queries$3.geoHierarchicalRead("CITY", payload === null || payload === void 0 ? void 0 : payload.id);
41486
41663
  _context6.n = 2;
41487
41664
  return fetchData({
41488
41665
  body: JSON.stringify(queriesjson)
41489
- }, __readDocumentUrl__);
41666
+ }, __baseUrl__$1);
41490
41667
  case 2:
41491
41668
  data = _context6.v;
41492
- arry = [];
41493
- data === null || data === void 0 || (_data$result4 = data.result) === null || _data$result4 === void 0 || _data$result4.map(function (val, i) {
41494
- var _val$id4, _val$_id4, _val$_key4, _val$geogLevelCode4, _val$geogLevelName4;
41495
- arry.push({
41496
- id: (_val$id4 = val === null || val === void 0 ? void 0 : val.id) !== null && _val$id4 !== void 0 ? _val$id4 : "",
41497
- _id: (_val$_id4 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id4 !== void 0 ? _val$_id4 : "",
41498
- _key: (_val$_key4 = val._key) !== null && _val$_key4 !== void 0 ? _val$_key4 : "",
41499
- code: (_val$geogLevelCode4 = val === null || val === void 0 ? void 0 : val.geogLevelCode) !== null && _val$geogLevelCode4 !== void 0 ? _val$geogLevelCode4 : "",
41500
- name: (_val$geogLevelName4 = val === null || val === void 0 ? void 0 : val.geogLevelName) !== null && _val$geogLevelName4 !== void 0 ? _val$geogLevelName4 : "",
41501
- status: val === null || val === void 0 ? void 0 : val.active
41502
- });
41503
- });
41504
- return _context6.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
41505
- data: arry
41506
- }));
41669
+ return _context6.a(2, mapToList(data));
41507
41670
  case 3:
41508
41671
  _context6.p = 3;
41509
41672
  _t6 = _context6.v;
@@ -41513,16 +41676,12 @@ var GEOGRAPHIC_CITY_READ = createAsyncThunk("geographicSlice/geoCityRead", /*#__
41513
41676
  }
41514
41677
  }, _callee6, null, [[1, 3]]);
41515
41678
  })));
41516
-
41517
- //GEOGRAPHIC_PINCODE_READ
41518
41679
  var GEOGRAPHIC_PINCODE_READ = createAsyncThunk("geographicSlice/geoPincodeRead", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
41519
41680
  var payload,
41520
41681
  _ref12,
41521
41682
  rejectWithValue,
41522
- _data$result5,
41523
41683
  queriesjson,
41524
41684
  data,
41525
- arry,
41526
41685
  _args7 = arguments,
41527
41686
  _t7;
41528
41687
  return _regenerator().w(function (_context7) {
@@ -41531,28 +41690,14 @@ var GEOGRAPHIC_PINCODE_READ = createAsyncThunk("geographicSlice/geoPincodeRead",
41531
41690
  payload = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
41532
41691
  _ref12 = _args7.length > 1 ? _args7[1] : undefined, rejectWithValue = _ref12.rejectWithValue;
41533
41692
  _context7.p = 1;
41534
- queriesjson = queries$3.geoPincodeRead(payload === null || payload === void 0 ? void 0 : payload.id);
41693
+ queriesjson = queries$3.geoHierarchicalRead("PINCODE", payload === null || payload === void 0 ? void 0 : payload.id);
41535
41694
  _context7.n = 2;
41536
41695
  return fetchData({
41537
41696
  body: JSON.stringify(queriesjson)
41538
- }, __readDocumentUrl__);
41697
+ }, __baseUrl__$1);
41539
41698
  case 2:
41540
41699
  data = _context7.v;
41541
- arry = [];
41542
- data === null || data === void 0 || (_data$result5 = data.result) === null || _data$result5 === void 0 || _data$result5.map(function (val, i) {
41543
- var _val$id5, _val$_id5, _val$_key5, _val$geogLevelCode5, _val$geogLevelName5;
41544
- arry.push({
41545
- id: (_val$id5 = val === null || val === void 0 ? void 0 : val.id) !== null && _val$id5 !== void 0 ? _val$id5 : "",
41546
- _id: (_val$_id5 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id5 !== void 0 ? _val$_id5 : "",
41547
- _key: (_val$_key5 = val._key) !== null && _val$_key5 !== void 0 ? _val$_key5 : "",
41548
- code: (_val$geogLevelCode5 = val === null || val === void 0 ? void 0 : val.geogLevelCode) !== null && _val$geogLevelCode5 !== void 0 ? _val$geogLevelCode5 : "",
41549
- name: (_val$geogLevelName5 = val === null || val === void 0 ? void 0 : val.geogLevelName) !== null && _val$geogLevelName5 !== void 0 ? _val$geogLevelName5 : "",
41550
- status: val === null || val === void 0 ? void 0 : val.active
41551
- });
41552
- });
41553
- return _context7.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
41554
- data: arry
41555
- }));
41700
+ return _context7.a(2, mapToList(data));
41556
41701
  case 3:
41557
41702
  _context7.p = 3;
41558
41703
  _t7 = _context7.v;
@@ -41562,36 +41707,58 @@ var GEOGRAPHIC_PINCODE_READ = createAsyncThunk("geographicSlice/geoPincodeRead",
41562
41707
  }
41563
41708
  }, _callee7, null, [[1, 3]]);
41564
41709
  })));
41565
-
41566
- //GEOGRAPHIC_STATUS_CHANGE
41567
- var GEOGRAPHIC_STATUS_CHANGE = createAsyncThunk("geographicSlice/geoStatusChange", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
41568
- var payload,
41569
- _ref14,
41710
+ var mapToList = function mapToList(data) {
41711
+ var arry = [];
41712
+ data === null || data === void 0 || data.forEach(function (val) {
41713
+ var _val$id, _val$_id2, _val$_key, _val$geogLevelCode, _val$geogLevelName;
41714
+ arry.push({
41715
+ id: (_val$id = val === null || val === void 0 ? void 0 : val.id) !== null && _val$id !== void 0 ? _val$id : "",
41716
+ _id: (_val$_id2 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id2 !== void 0 ? _val$_id2 : "",
41717
+ _key: (_val$_key = val._key) !== null && _val$_key !== void 0 ? _val$_key : "",
41718
+ code: (_val$geogLevelCode = val === null || val === void 0 ? void 0 : val.geogLevelCode) !== null && _val$geogLevelCode !== void 0 ? _val$geogLevelCode : "",
41719
+ name: (_val$geogLevelName = val === null || val === void 0 ? void 0 : val.geogLevelName) !== null && _val$geogLevelName !== void 0 ? _val$geogLevelName : "",
41720
+ status: val === null || val === void 0 ? void 0 : val.active
41721
+ });
41722
+ });
41723
+ return _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
41724
+ data: arry
41725
+ });
41726
+ };
41727
+ var GEOGRAPHIC_COUNTRY_READ = createAsyncThunk("geographicSlice/geoCountryRead", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
41728
+ var _ref14,
41570
41729
  rejectWithValue,
41571
- statuschange,
41572
41730
  queriesjson,
41573
41731
  data,
41732
+ arry,
41574
41733
  _args8 = arguments,
41575
41734
  _t8;
41576
41735
  return _regenerator().w(function (_context8) {
41577
41736
  while (1) switch (_context8.p = _context8.n) {
41578
41737
  case 0:
41579
- payload = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
41580
41738
  _ref14 = _args8.length > 1 ? _args8[1] : undefined, rejectWithValue = _ref14.rejectWithValue;
41581
41739
  _context8.p = 1;
41582
- statuschange = {
41583
- _key: payload._key,
41584
- status: payload.status
41585
- };
41586
- queriesjson = queries$3.geoStatusChange(statuschange);
41740
+ queriesjson = queries$3.geoCountryRead();
41587
41741
  _context8.n = 2;
41588
41742
  return fetchData({
41589
41743
  body: JSON.stringify(queriesjson)
41590
- }, __uspsertUrl__);
41744
+ }, __baseUrl__$1);
41591
41745
  case 2:
41592
41746
  data = _context8.v;
41747
+ arry = [];
41748
+ data === null || data === void 0 || data.map(function (val, i) {
41749
+ var _val$id2, _val$_id3, _val$_key2, _val$geogLevelCode2, _val$geogLevelName2, _val$GeoLocationISDCo;
41750
+ arry.push({
41751
+ id: (_val$id2 = val === null || val === void 0 ? void 0 : val.id) !== null && _val$id2 !== void 0 ? _val$id2 : "",
41752
+ _id: (_val$_id3 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id3 !== void 0 ? _val$_id3 : "",
41753
+ _key: (_val$_key2 = val._key) !== null && _val$_key2 !== void 0 ? _val$_key2 : "",
41754
+ code: (_val$geogLevelCode2 = val === null || val === void 0 ? void 0 : val.geogLevelCode) !== null && _val$geogLevelCode2 !== void 0 ? _val$geogLevelCode2 : "",
41755
+ name: (_val$geogLevelName2 = val === null || val === void 0 ? void 0 : val.geogLevelName) !== null && _val$geogLevelName2 !== void 0 ? _val$geogLevelName2 : "",
41756
+ geoLocationISDCode: (_val$GeoLocationISDCo = val === null || val === void 0 ? void 0 : val.GeoLocationISDCode) !== null && _val$GeoLocationISDCo !== void 0 ? _val$GeoLocationISDCo : "",
41757
+ status: val === null || val === void 0 ? void 0 : val.active
41758
+ });
41759
+ });
41593
41760
  return _context8.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
41594
- data: data
41761
+ data: arry
41595
41762
  }));
41596
41763
  case 3:
41597
41764
  _context8.p = 3;
@@ -41603,40 +41770,39 @@ var GEOGRAPHIC_STATUS_CHANGE = createAsyncThunk("geographicSlice/geoStatusChange
41603
41770
  }, _callee8, null, [[1, 3]]);
41604
41771
  })));
41605
41772
 
41606
- //GEOGRAPHIC_MASTER_MASTER
41607
- var GEOGRAPHIC_MASTER_MASTER = createAsyncThunk("geographicSlice/geoMasterMaster", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
41608
- var _ref16,
41773
+ //GEOGRAPHIC_STATUS_CHANGE
41774
+ var GEOGRAPHIC_STATUS_CHANGE = createAsyncThunk("geographicSlice/geoStatusChange", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
41775
+ var payload,
41776
+ _ref16,
41609
41777
  rejectWithValue,
41778
+ statuschange,
41779
+ queriesjson,
41610
41780
  data,
41611
- arry,
41612
41781
  _args9 = arguments,
41613
41782
  _t9;
41614
41783
  return _regenerator().w(function (_context9) {
41615
41784
  while (1) switch (_context9.p = _context9.n) {
41616
41785
  case 0:
41786
+ payload = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
41617
41787
  _ref16 = _args9.length > 1 ? _args9[1] : undefined, rejectWithValue = _ref16.rejectWithValue;
41618
41788
  _context9.p = 1;
41789
+ statuschange = {
41790
+ _key: payload._key,
41791
+ status: payload.status
41792
+ };
41793
+ queriesjson = queries$3.geoStatusChange(statuschange);
41619
41794
  _context9.n = 2;
41620
41795
  return fetchData({
41621
- body: JSON.stringify(queries$3.geoMasterMaster())
41622
- }, __readDocumentUrl__);
41796
+ body: JSON.stringify(queriesjson)
41797
+ }, __uspsertUrl__);
41623
41798
  case 2:
41624
41799
  data = _context9.v;
41625
- arry = [];
41626
- data.result.map(function (val) {
41627
- var _val$_id6, _val$display;
41628
- arry.push({
41629
- value: (_val$_id6 = val._id) !== null && _val$_id6 !== void 0 ? _val$_id6 : "",
41630
- label: (_val$display = val.display) !== null && _val$display !== void 0 ? _val$display : ""
41631
- });
41632
- });
41633
41800
  return _context9.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
41634
- data: arry
41801
+ data: data
41635
41802
  }));
41636
41803
  case 3:
41637
41804
  _context9.p = 3;
41638
41805
  _t9 = _context9.v;
41639
- alert("error");
41640
41806
  return _context9.a(2, rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
41641
41807
  message: _t9.message
41642
41808
  })));
@@ -41664,15 +41830,15 @@ var GEOGRAPHIC_PARENT_CODE = createAsyncThunk("geographicSlice/geoMasterParentCo
41664
41830
  _context0.n = 2;
41665
41831
  return fetchData({
41666
41832
  body: JSON.stringify(queries$3.geoMasterParentCode(id))
41667
- }, __readDocumentUrl__);
41833
+ }, __baseUrl__$1);
41668
41834
  case 2:
41669
41835
  data = _context0.v;
41670
41836
  arry = [];
41671
- data.result.map(function (val) {
41672
- var _val$_id7, _val$geogLevelName6;
41837
+ data === null || data === void 0 || data.map(function (val) {
41838
+ var _val$_id4, _val$geogLevelName3;
41673
41839
  arry.push({
41674
- value: (_val$_id7 = val._id) !== null && _val$_id7 !== void 0 ? _val$_id7 : "",
41675
- label: (_val$geogLevelName6 = val.geogLevelName) !== null && _val$geogLevelName6 !== void 0 ? _val$geogLevelName6 : ""
41840
+ value: (_val$_id4 = val._id) !== null && _val$_id4 !== void 0 ? _val$_id4 : "",
41841
+ label: (_val$geogLevelName3 = val.geogLevelName) !== null && _val$geogLevelName3 !== void 0 ? _val$geogLevelName3 : ""
41676
41842
  });
41677
41843
  });
41678
41844
  return _context0.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
@@ -41749,7 +41915,7 @@ var GEOGRAPIC_EXITS_DATA = createAsyncThunk("geographicSlice/geogrpicExitsData",
41749
41915
  levelType: levelType,
41750
41916
  geoLevelCode: geoLevelCode
41751
41917
  })
41752
- }, __readDocumentUrl__);
41918
+ }, __baseUrl__$1);
41753
41919
  case 2:
41754
41920
  data = _context10.v;
41755
41921
  return _context10.a(2, _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
@@ -41787,7 +41953,7 @@ var GEOGRAPHIC_SINGLE_READ = createAsyncThunk("geographicSlice/geoGraphicSingleR
41787
41953
  _context11.n = 2;
41788
41954
  return fetchData({
41789
41955
  body: JSON.stringify(queries$3.editGeoGraphicSingleRead(_key))
41790
- }, __readDocumentUrl__);
41956
+ }, __baseUrl__$1);
41791
41957
  case 2:
41792
41958
  data = _context11.v;
41793
41959
  res = generateReadJSON(data.result[0]);