primarycare-binder 1.1.7 → 1.1.11

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 +625 -198
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -8016,9 +8016,15 @@ var query_ids = {
8016
8016
  "db_name": dbName,
8017
8017
  "entity": "Schedule",
8018
8018
  "filter": "Schedule.start >= ".concat(start, " AND Schedule.end <= ").concat(end, " AND Schedule.activestatus == true AND DOCUMENT(Schedule.resourceCode).id == ").concat(id),
8019
- "return_fields": "MERGE(Schedule, {slots : (FOR slt IN Slot FILTER Schedule.id IN slt.ScheduleID AND slt.start >= ".concat(moment().unix(), " RETURN slt)})")
8019
+ "return_fields": "MERGE(Schedule, {slots : (FOR slt IN Slot FILTER Schedule.id IN slt.ScheduleID AND slt.status!='blocked' AND slt.start >= ".concat(moment().unix(), " AND slt.activestatus==true sort slt._id asc RETURN slt)})")
8020
8020
  };
8021
- }
8021
+ } // query: ({ start, end, id }) => ({
8022
+ // "db_name": dbName,
8023
+ // "entity": "Schedule",
8024
+ // "filter": `Schedule.start >= ${start} AND Schedule.end <= ${end} AND Schedule.activestatus == true AND DOCUMENT(Schedule.resourceCode).id == ${id}`,
8025
+ // "return_fields": `MERGE(Schedule, {slots : (FOR slt IN Slot FILTER Schedule.id IN slt.ScheduleID AND slt.start >= ${moment().unix()} RETURN slt)})`
8026
+ // }),
8027
+
8022
8028
  },
8023
8029
  "appointmentReducer/allAppointments": "ff38b85a-7363-4fb3-9a8a-2b861f06aeff",
8024
8030
  "appointmentReducer/reasonForAppointment": "ff38b85a-7363-4fb3-9a8a-2b861f05ceff",
@@ -20973,8 +20979,14 @@ var queries$9 = {
20973
20979
  deleteCC: function deleteCC(id) {
20974
20980
  return "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CA_ChiefComplaints\",\n \"filter\": \"CA_ChiefComplaints._id =='").concat(id, "'\"\n }");
20975
20981
  },
20982
+ // encounterDetails: (encounterId) => `{
20983
+ // "db_name": "${dbName}",
20984
+ // "entity": "Encounter",
20985
+ // "filter": "Encounter.id == ${encounterId}",
20986
+ // "return_fields": "MERGE(Encounter, {practitioner_details:(FOR practdet IN TO_ARRAY(Encounter.practitioner_details) RETURN MERGE(practdet,{speciality:MERGE(DOCUMENT(practdet.speciality),{coding:(FOR cod IN TO_ARRAY(DOCUMENT(practdet.speciality).coding) RETURN DOCUMENT(cod))})})),Patient: (for p in Patient filter p.id == Encounter.patient_id let hname = (FOR hn IN HumanNameMaster filter hn._id in p.name RETURN merge(hn,{prefix:document(hn.prefix)},{suffix:document(hn.suffix)},{use:document(hn.use)})) let gender = document(p.gender) let pidentifier = (FOR hn IN p.identifier RETURN DOCUMENT(hn)) return MERGE(p, {name: hname, pidentifier,gender})) })"
20987
+ // }`,
20976
20988
  encounterDetails: function encounterDetails(encounterId) {
20977
- return "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"Encounter\",\n \"filter\": \"Encounter.id == ").concat(encounterId, "\",\n \"return_fields\": \"MERGE(Encounter, {practitioner_details:(FOR practdet IN TO_ARRAY(Encounter.practitioner_details) RETURN MERGE(practdet,{speciality:MERGE(DOCUMENT(practdet.speciality),{coding:(FOR cod IN TO_ARRAY(DOCUMENT(practdet.speciality).coding) RETURN DOCUMENT(cod))})})),Patient: (for p in Patient filter p.id == Encounter.patient_id let hname = (FOR hn IN HumanNameMaster filter hn._id in p.name RETURN merge(hn,{prefix:document(hn.prefix)},{suffix:document(hn.suffix)},{use:document(hn.use)})) let gender = document(p.gender) let pidentifier = (FOR hn IN p.identifier RETURN DOCUMENT(hn)) return MERGE(p, {name: hname, pidentifier,gender})) })\"\n }");
20989
+ return "{\n \"db_name\": \"primarycare\",\n \"entity\": \"Encounter\",\n \"filter\": \"Encounter.id == ".concat(encounterId, "\",\n \"return_fields\": \"MERGE(Encounter, {practitioner_details:(FOR practdet IN TO_ARRAY(Encounter.practitioner_details) RETURN MERGE(practdet,{speciality:MERGE(DOCUMENT(practdet.speciality),{coding:(FOR cod IN TO_ARRAY(DOCUMENT(practdet.speciality).coding) RETURN DOCUMENT(cod))})})),Patient: (for p in Patient filter p.id == Encounter.patient_id let hname = (FOR hn IN HumanNameMaster filter hn._id in p.name RETURN merge(hn,{prefix:document(hn.prefix)},{suffix:document(hn.suffix)},{use:document(hn.use)})) let gender = document(p.gender) let pidentifier = (FOR hn IN p.identifier RETURN DOCUMENT(hn)) return MERGE(p, {name: hname, pidentifier,gender,communicationLanguage:document(p.communicationLanguage)})) })\"\n }");
20978
20990
  }
20979
20991
  };
20980
20992
 
@@ -21678,10 +21690,10 @@ var GET_ENCOUNTER = createAsyncThunk("chiefCompilenceMastersSlice/encounter", /*
21678
21690
  data = _context12.sent;
21679
21691
  arr = [];
21680
21692
  data.result.map(function (val) {
21681
- var _val$Patient, _val$Patient$, _val$Patient$$communi, _val$Patient$$communi2, _val$Patient$$communi3, _val$_id, _val$_id$split, _val$practitioner_det, _val$practitioner_det2, _val$practitioner_det3, _val$practitioner_det4, _val$practitioner_det5, _ref25, _val$Patient2, _val$Patient2$, _val$Patient2$$name, _val$Patient2$$name$, _val$Patient2$$name$$, _val$Patient3, _val$Patient3$, _val$Patient3$$name, _val$Patient3$$name$, _val$Patient4, _val$Patient4$, _val$Patient4$$name, _val$Patient4$$name$, _val$Patient5, _val$Patient5$, _val$Patient5$$name, _val$Patient5$$name$, _val$Patient5$$name$$, _val$Patient6, _val$Patient6$, _val$Patient7, _val$Patient7$, _val$Patient8, _val$Patient8$, _val$Patient8$$gender, _val$Patient9, _val$Patient9$, _val$Patient$0$pident, _val$Patient10, _val$Patient10$, _val$Patient10$$piden, _val$Patient10$$piden2, _lang, _val$practitioner_det6, _val$practitioner_det7, _val$practitioner_det8;
21693
+ var _val$Patient, _val$Patient$, _val$Patient$$communi, _val$_id, _val$_id$split, _val$practitioner_det, _val$practitioner_det2, _val$practitioner_det3, _val$practitioner_det4, _val$practitioner_det5, _ref25, _val$Patient2, _val$Patient2$, _val$Patient2$$name, _val$Patient2$$name$, _val$Patient2$$name$$, _val$Patient3, _val$Patient3$, _val$Patient3$$name, _val$Patient3$$name$, _val$Patient4, _val$Patient4$, _val$Patient4$$name, _val$Patient4$$name$, _val$Patient5, _val$Patient5$, _val$Patient5$$name, _val$Patient5$$name$, _val$Patient5$$name$$, _val$Patient6, _val$Patient6$, _val$Patient7, _val$Patient7$, _val$Patient8, _val$Patient8$, _val$Patient8$$gender, _val$Patient9, _val$Patient9$, _val$Patient$0$pident, _val$Patient10, _val$Patient10$, _val$Patient10$$piden, _val$Patient10$$piden2, _lang, _val$practitioner_det6, _val$practitioner_det7, _val$practitioner_det8;
21682
21694
 
21683
- var lang = val === null || val === void 0 ? void 0 : (_val$Patient = val.Patient) === null || _val$Patient === void 0 ? void 0 : (_val$Patient$ = _val$Patient[0]) === null || _val$Patient$ === void 0 ? void 0 : (_val$Patient$$communi = _val$Patient$.communication) === null || _val$Patient$$communi === void 0 ? void 0 : (_val$Patient$$communi2 = _val$Patient$$communi[0]) === null || _val$Patient$$communi2 === void 0 ? void 0 : (_val$Patient$$communi3 = _val$Patient$$communi2.language) === null || _val$Patient$$communi3 === void 0 ? void 0 : _val$Patient$$communi3.map(function (val) {
21684
- return val.language;
21695
+ var lang = val === null || val === void 0 ? void 0 : (_val$Patient = val.Patient) === null || _val$Patient === void 0 ? void 0 : (_val$Patient$ = _val$Patient[0]) === null || _val$Patient$ === void 0 ? void 0 : (_val$Patient$$communi = _val$Patient$.communicationLanguage) === null || _val$Patient$$communi === void 0 ? void 0 : _val$Patient$$communi.map(function (val) {
21696
+ return val.display;
21685
21697
  });
21686
21698
  lang = lang ? lang : null;
21687
21699
  arr.push({
@@ -24215,6 +24227,7 @@ var GET_VITALS_JSON = createAsyncThunk("VitalsApiSlice/getvitalsjson", /*#__PURE
24215
24227
  body1,
24216
24228
  data1,
24217
24229
  vitelsJson,
24230
+ newObservations,
24218
24231
  adjArray,
24219
24232
  extraArr,
24220
24233
  _args3 = arguments;
@@ -24306,7 +24319,11 @@ var GET_VITALS_JSON = createAsyncThunk("VitalsApiSlice/getvitalsjson", /*#__PURE
24306
24319
  vitelsJson = [];
24307
24320
 
24308
24321
  if (Array.isArray(data1[0].Observations)) {
24309
- vitelsJson = data1[0].Observations.map(function (val) {
24322
+ newObservations = data1[0].Observations;
24323
+ newObservations.sort(function (a, b) {
24324
+ return Number(a.obsseq) - Number(b.obsseq);
24325
+ });
24326
+ vitelsJson = newObservations.map(function (val) {
24310
24327
  var _val$obscode, _val$obscode2;
24311
24328
 
24312
24329
  if ((val === null || val === void 0 ? void 0 : (_val$obscode = val.obscode) === null || _val$obscode === void 0 ? void 0 : _val$obscode.VitalsCodesReferenceRanges.length) > 0 && (val === null || val === void 0 ? void 0 : (_val$obscode2 = val.obscode) === null || _val$obscode2 === void 0 ? void 0 : _val$obscode2.vitalscode)) {
@@ -24319,7 +24336,9 @@ var GET_VITALS_JSON = createAsyncThunk("VitalsApiSlice/getvitalsjson", /*#__PURE
24319
24336
  return element !== undefined;
24320
24337
  });
24321
24338
  adjArray = vitelsJson.filter(function (val, i) {
24322
- return val.vitalscode == "HEIGHT";
24339
+ var _val$vitalscode, _val$vitalscode$toUpp, _val$vitalscode2, _val$vitalscode2$toUp;
24340
+
24341
+ return ((_val$vitalscode = val.vitalscode) === null || _val$vitalscode === void 0 ? void 0 : (_val$vitalscode$toUpp = _val$vitalscode.toUpperCase) === null || _val$vitalscode$toUpp === void 0 ? void 0 : _val$vitalscode$toUpp.call(_val$vitalscode)) === "HEIGHT" || ((_val$vitalscode2 = val.vitalscode) === null || _val$vitalscode2 === void 0 ? void 0 : (_val$vitalscode2$toUp = _val$vitalscode2.toUpperCase) === null || _val$vitalscode2$toUp === void 0 ? void 0 : _val$vitalscode2$toUp.call(_val$vitalscode2)) === "WEIGHT";
24323
24342
  });
24324
24343
  extraArr = [_objectSpread2(_objectSpread2({}, adjArray[0]), {}, {
24325
24344
  vitalscode: "BMI",
@@ -24337,7 +24356,7 @@ var GET_VITALS_JSON = createAsyncThunk("VitalsApiSlice/getvitalsjson", /*#__PURE
24337
24356
  disabled: true
24338
24357
  })];
24339
24358
 
24340
- if (adjArray) {
24359
+ if (adjArray.length === 2) {
24341
24360
  vitelsJson = vitelsJson.concat(extraArr);
24342
24361
  }
24343
24362
 
@@ -24587,10 +24606,10 @@ var queries$7 = {
24587
24606
  // "return_fields": "CA_AllergyIntolerance"
24588
24607
  // }
24589
24608
  return {
24590
- db_name: "primarycare",
24609
+ db_name: dbName,
24591
24610
  entity: "CA_AllergyIntolerance",
24592
24611
  filter: "CA_AllergyIntolerance.encounter_id=='".concat(encounter_id, "'"),
24593
- return_fields: " MERGE(CA_AllergyIntolerance,{statushistory: (FOR sths IN TO_ARRAY(CA_AllergyIntolerance.statushistory) RETURN MERGE(sths,{PersonID:(FOR hn IN DOCUMENT(sths.PersonID).name RETURN MERGE(DOCUMENT(sths.PersonID),{name:DOCUMENT(hn)}))}))},{practitioner_id:(for prac in Practitioner filter prac._id == CA_AllergyIntolerance.practitioner_id return merge(prac,{name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for us in CodeableConceptMaster filter us._id == nam.use return merge(us,{coding:document(us.coding)}))},{prefix:(for pre in CodeableConceptMaster filter pre._id == nam.prefix return merge(pre,{coding:document(pre.coding)}))},{suffix:(for suf in CodeableConceptMaster filter suf._id == nam.suffix return merge(suf,{coding:document(suf.coding)}))}))}))})"
24612
+ return_fields: " MERGE(CA_AllergyIntolerance,{statushistory: (FOR sths IN TO_ARRAY(CA_AllergyIntolerance.statushistory) RETURN MERGE(sths,{PersonID:(FOR hn IN DOCUMENT(sths.PersonID).name RETURN MERGE(DOCUMENT(sths.PersonID),{name:DOCUMENT(hn)}))}))},{practitioner_id:(for prac in Practitioner filter prac._id == CA_AllergyIntolerance.practitioner_id return merge(prac,{name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for us in CodeableConceptMaster filter us._id == nam.use return merge(us,{coding:document(us.coding)}))},{prefix:(for pre in CodeableConceptMaster filter pre._id == nam.prefix return merge(pre,{coding:document(pre.coding)}))},{suffix:(for suf in CodeableConceptMaster filter suf._id == nam.suffix return merge(suf,{coding:document(suf.coding)}))}))}))},{code:keep(document(CA_AllergyIntolerance.code),'_id','longdesc','id','code','_key')})"
24594
24613
  };
24595
24614
  },
24596
24615
  reactionMaster: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"filter\": \"CodeableConceptMaster.Type=='ALREACTIONCODE'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
@@ -24612,7 +24631,7 @@ var queries$7 = {
24612
24631
  filter: {
24613
24632
  CA_AllergyIntolerance: "CA_AllergyIntolerance.patient_id=='".concat(patientId, "'")
24614
24633
  },
24615
- return_fields: " MERGE(CA_AllergyIntolerance, {practitioner_id: (FOR hn IN TO_ARRAY(DOCUMENT(CA_AllergyIntolerance.practitioner_id).name) RETURN MERGE(DOCUMENT(CA_AllergyIntolerance.practitioner_id), {name:DOCUMENT(hn)})) }, {statushistory: (FOR sths IN TO_ARRAY(CA_AllergyIntolerance.statushistory) RETURN MERGE(sths,{PersonID:(FOR hn IN DOCUMENT(sths.PersonID).name RETURN MERGE(DOCUMENT(sths.PersonID),{name:DOCUMENT(hn)}))}))})"
24634
+ return_fields: " MERGE(CA_AllergyIntolerance, {practitioner_id: (FOR hn IN TO_ARRAY(DOCUMENT(CA_AllergyIntolerance.practitioner_id).name) RETURN MERGE(DOCUMENT(CA_AllergyIntolerance.practitioner_id), {name:DOCUMENT(hn)})) }, {statushistory: (FOR sths IN TO_ARRAY(CA_AllergyIntolerance.statushistory) RETURN MERGE(sths,{PersonID:(FOR hn IN DOCUMENT(sths.PersonID).name RETURN MERGE(DOCUMENT(sths.PersonID),{name:DOCUMENT(hn)}))}))},{code:keep(document(CA_AllergyIntolerance.code),'_id','longdesc','id','code','_key')})"
24616
24635
  };
24617
24636
  }
24618
24637
  };
@@ -24786,7 +24805,7 @@ var generateJSON$3 = function generateJSON(data) {
24786
24805
 
24787
24806
  var generateResJson$4 = function generateResJson(dataList, state) {
24788
24807
  var list = dataList.map(function (data) {
24789
- var _data$code, _data$category, _data$category2, _data$clinicalstatus, _data$lastoccurrence, _data$lastoccurrence$, _data$lastoccurrence2, _data$lastoccurrence3, _data$lastoccurrence4, _data$lastoccurrence5, _data$lastoccurrence6, _data$lastoccurrence7, _data$lastoccurrence8, _data$lastoccurrence9, _data$lastoccurrence10, _data$lastoccurrence11, _data$lastoccurrence12, _data$lastoccurrence13, _data$lastoccurrence14, _data$lastoccurrence15, _data$lastoccurrence16, _data$lastoccurrence17, _data$lastoccurrence18, _data$lastoccurrence19, _data$lastoccurrence20, _data$lastoccurrence21, _data$note, _data$onset, _data$onset$, _data$onset2, _data$onset2$, _data$onset3, _data$onset3$, _data$onset4, _data$onset4$, _data$onset5, _data$onset5$, _data$onset6, _data$onset6$, _data$onset7, _data$onset7$, _data$onset8, _data$onset8$, _data$onset9, _data$onset9$, _data$onset10, _data$onset10$, _data$onset11, _data$onset11$, _data$relationName, _data$criticality, _data$type, _data$verificationsta, _data$reaction, _data$createddate;
24808
+ var _data$code, _data$code2, _data$category, _data$category2, _data$clinicalstatus, _data$lastoccurrence, _data$lastoccurrence$, _data$lastoccurrence2, _data$lastoccurrence3, _data$lastoccurrence4, _data$lastoccurrence5, _data$lastoccurrence6, _data$lastoccurrence7, _data$lastoccurrence8, _data$lastoccurrence9, _data$lastoccurrence10, _data$lastoccurrence11, _data$lastoccurrence12, _data$lastoccurrence13, _data$lastoccurrence14, _data$lastoccurrence15, _data$lastoccurrence16, _data$lastoccurrence17, _data$lastoccurrence18, _data$lastoccurrence19, _data$lastoccurrence20, _data$lastoccurrence21, _data$note, _data$onset, _data$onset$, _data$onset2, _data$onset2$, _data$onset3, _data$onset3$, _data$onset4, _data$onset4$, _data$onset5, _data$onset5$, _data$onset6, _data$onset6$, _data$onset7, _data$onset7$, _data$onset8, _data$onset8$, _data$onset9, _data$onset9$, _data$onset10, _data$onset10$, _data$onset11, _data$onset11$, _data$relationName, _data$criticality, _data$type, _data$verificationsta, _data$reaction, _data$createddate;
24790
24809
 
24791
24810
  // let clicnicalstatushistory = val?.clicnicalstatushistory?.map(val => {
24792
24811
  // return {
@@ -24796,7 +24815,10 @@ var generateResJson$4 = function generateResJson(dataList, state) {
24796
24815
  // }
24797
24816
  // })
24798
24817
  return {
24799
- "allergenCode": (_data$code = data === null || data === void 0 ? void 0 : data.code) !== null && _data$code !== void 0 ? _data$code : null,
24818
+ "allergenCode": {
24819
+ label: data === null || data === void 0 ? void 0 : (_data$code = data.code) === null || _data$code === void 0 ? void 0 : _data$code.longdesc,
24820
+ value: data === null || data === void 0 ? void 0 : (_data$code2 = data.code) === null || _data$code2 === void 0 ? void 0 : _data$code2._id
24821
+ },
24800
24822
  "asserted": (_data$category = data === null || data === void 0 ? void 0 : data.category) !== null && _data$category !== void 0 ? _data$category : null,
24801
24823
  "category": (_data$category2 = data === null || data === void 0 ? void 0 : data.category) !== null && _data$category2 !== void 0 ? _data$category2 : null,
24802
24824
  "clinicalStatus": (_data$clinicalstatus = data === null || data === void 0 ? void 0 : data.clinicalstatus) !== null && _data$clinicalstatus !== void 0 ? _data$clinicalstatus : null,
@@ -25979,7 +26001,7 @@ var queries$6 = {
25979
26001
  db_name: "primarycare",
25980
26002
  entity: "CA_OrderLine",
25981
26003
  filter: "CA_OrderLine.encounter_Id==\"".concat(encounter_id, "\" && CA_OrderLine.Oltype=='LAB' && CA_OrderLine.parentOrderId=='' && CA_OrderLine.activestatus==true"),
25982
- return_fields: "MERGE(CA_OrderLine,{childRecurrent:(for doc in CA_OrderLine_CA_OrderLine_E filter doc._to == CA_OrderLine._id RETURN MERGE(DOCUMENT(doc._from),{Requestor:(for req in TO_ARRAY(DOCUMENT(doc._from).Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})),org_Id:DOCUMENT(CA_OrderLine.org_Id),Requestor:(for req in TO_ARRAY(CA_OrderLine.Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})" // db_name: `${dbName}`,
26004
+ return_fields: "MERGE(CA_OrderLine,{childRecurrent:(for doc in CA_OrderLine_CA_OrderLine_E filter doc._to == CA_OrderLine._id RETURN MERGE(DOCUMENT(doc._from),{Requestor:(for req in TO_ARRAY(DOCUMENT(doc._from).Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {practitioner_id: prac.practitioner_id, id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})),org_Id:DOCUMENT(CA_OrderLine.org_Id),Requestor:(for req in TO_ARRAY(CA_OrderLine.Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {practitioner_id: prac.practitioner_id, id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})" // db_name: `${dbName}`,
25983
26005
  // entity: "CA_OrderLine",
25984
26006
  // filter: `CA_OrderLine.encounter_Id=="${encounter_id}" && CA_OrderLine.Oltype=='LAB' && CA_OrderLine.parentOrderId=="${order_id}" && CA_OrderLine.activestatus==true`,
25985
26007
  // filter: `CA_OrderLine.encounter_Id=="${encounter_id}" && CA_OrderLine.Oltype=='LAB' && CA_OrderLine.parentOrderId=='' && CA_OrderLine.activestatus==true`,
@@ -26056,7 +26078,7 @@ var queries$6 = {
26056
26078
 
26057
26079
  var generateResJson$3 = function generateResJson(dataList, arr) {
26058
26080
  var list = dataList.map(function (val) {
26059
- var _val$diagnosis, _val$performer, _val$recurrent, _val$recurrent$, _val$priority, _val$OrderNature, _moment$unix$format, _val$recurrent2, _val$recurrent2$, _moment$unix$format2, _val$recurrent3, _val$recurrent3$, _JSON$stringify, _val$recurrent4, _val$recurrent4$, _val$recurrent$0$ever, _val$recurrent5, _val$recurrent5$, _val$recurrent$0$ever2, _val$recurrent6, _val$recurrent6$, _moment$unix$format3, _val$recurrent7, _val$recurrent7$, _JSON$stringify2, _val$recurrent8, _val$recurrent8$, _val$recurrent9, _val$recurrent9$, _moment$unix$format4, _val$recurrent10, _val$recurrent10$, _moment$unix$format5, _val$Requestor, _val$Requestor$, _val$Requestor$$organ, _val$Requestor2, _val$Requestor2$, _val$Requestor2$$orga, _val$Requestor3, _val$Requestor3$, _val$Requestor3$$orga, _val$Requestor$0$prac, _val$Requestor4, _val$Requestor4$, _val$Requestor4$$prac, _val$Requestor$0$prac2, _val$Requestor5, _val$Requestor5$, _val$Requestor5$$prac, _val$Requestor6, _val$Requestor6$, _val$Requestor6$$prac, _val$Requestor7, _val$Requestor7$, _val$Requestor7$$prac, _val$Requestor8, _val$Requestor8$, _val$Requestor8$$prac, _val$Requestor8$$prac2, _val$Requestor8$$prac3, _val$Requestor9, _val$Requestor9$, _val$Requestor9$$prac, _val$Requestor9$$prac2, _val$Requestor10, _val$Requestor10$, _val$Requestor10$$pra, _val$Requestor10$$pra2, _val$Requestor10$$pra3, _val$specimenRelated$, _val$specimenRelated$2, _val$specimenRelated$3, _val$specimenRelated$4, _val$specimenRelated$5, _val$specimenRelated$6, _val$specimenRelated$7, _val$specimenRelated$8, _val$specimenRelated$9, _val$specimenRelated$10, _val$specimenRelated$11, _val$patientInstructi, _val$patientInstructi2, _val$patientInstructi3, _val$patientInstructi4, _val$patientInstructi5, _val$patientInstructi6, _val$patientInstructi7, _val$patientInstructi8, _val$preparatoryInstr, _val$preparatoryInstr2, _val$preparatoryInstr3, _val$preparatoryInstr4, _val$preparatoryInstr5, _val$preparatoryInstr6, _val$preparatoryInstr7, _val$preparatoryInstr8, _val$departmentalInst, _val$departmentalInst2, _val$departmentalInst3, _val$departmentalInst4, _val$departmentalInst5, _val$departmentalInst6, _val$departmentalInst7, _val$departmentalInst8, _val$attribute, _val$attribute$, _val$attribute2, _val$attribute2$, _val$attribute$0$bedS, _val$attribute3, _val$attribute3$, _val$attribute$0$cont, _val$attribute4, _val$attribute4$, _val$createddate, _val$changeStatus, _val$changeStatus2, _val$changeStatus3, _val$statushistory, _val$statusreason, _val$accessionNum;
26081
+ var _val$diagnosis, _val$performer, _val$recurrent, _val$recurrent$, _val$priority, _val$OrderNature, _moment$unix$format, _val$recurrent2, _val$recurrent2$, _moment$unix$format2, _val$recurrent3, _val$recurrent3$, _JSON$stringify, _val$recurrent4, _val$recurrent4$, _val$recurrent$0$ever, _val$recurrent5, _val$recurrent5$, _val$recurrent$0$ever2, _val$recurrent6, _val$recurrent6$, _moment$unix$format3, _val$recurrent7, _val$recurrent7$, _JSON$stringify2, _val$recurrent8, _val$recurrent8$, _val$recurrent9, _val$recurrent9$, _moment$unix$format4, _val$recurrent10, _val$recurrent10$, _moment$unix$format5, _val$Requestor, _val$Requestor$, _val$Requestor$$organ, _val$Requestor2, _val$Requestor2$, _val$Requestor2$$orga, _val$Requestor3, _val$Requestor3$, _val$Requestor3$$orga, _val$Requestor$0$prac, _val$Requestor4, _val$Requestor4$, _val$Requestor4$$prac, _val$Requestor$0$prac2, _val$Requestor5, _val$Requestor5$, _val$Requestor5$$prac, _val$Requestor6, _val$Requestor6$, _val$Requestor6$$prac, _val$Requestor7, _val$Requestor7$, _val$Requestor7$$prac, _val$Requestor8, _val$Requestor8$, _val$Requestor8$$prac, _val$Requestor8$$prac2, _val$Requestor8$$prac3, _val$Requestor9, _val$Requestor9$, _val$Requestor9$$prac, _val$Requestor9$$prac2, _val$Requestor10, _val$Requestor10$, _val$Requestor10$$pra, _val$Requestor10$$pra2, _val$Requestor11, _val$Requestor11$, _val$Requestor11$$pra, _val$Requestor11$$pra2, _val$Requestor11$$pra3, _val$specimenRelated$, _val$specimenRelated$2, _val$specimenRelated$3, _val$specimenRelated$4, _val$specimenRelated$5, _val$specimenRelated$6, _val$specimenRelated$7, _val$specimenRelated$8, _val$specimenRelated$9, _val$specimenRelated$10, _val$specimenRelated$11, _val$patientInstructi, _val$patientInstructi2, _val$patientInstructi3, _val$patientInstructi4, _val$patientInstructi5, _val$patientInstructi6, _val$patientInstructi7, _val$patientInstructi8, _val$preparatoryInstr, _val$preparatoryInstr2, _val$preparatoryInstr3, _val$preparatoryInstr4, _val$preparatoryInstr5, _val$preparatoryInstr6, _val$preparatoryInstr7, _val$preparatoryInstr8, _val$departmentalInst, _val$departmentalInst2, _val$departmentalInst3, _val$departmentalInst4, _val$departmentalInst5, _val$departmentalInst6, _val$departmentalInst7, _val$departmentalInst8, _val$attribute, _val$attribute$, _val$attribute2, _val$attribute2$, _val$attribute$0$bedS, _val$attribute3, _val$attribute3$, _val$attribute$0$cont, _val$attribute4, _val$attribute4$, _val$createddate, _val$changeStatus, _val$changeStatus2, _val$changeStatus3, _val$statushistory, _val$statusreason, _val$accessionNum;
26060
26082
 
26061
26083
  var diagnosisData = val === null || val === void 0 ? void 0 : (_val$diagnosis = val.diagnosis) === null || _val$diagnosis === void 0 ? void 0 : _val$diagnosis.map(function (v) {
26062
26084
  return {
@@ -26149,7 +26171,8 @@ var generateResJson$3 = function generateResJson(dataList, arr) {
26149
26171
  practitionerId: val === null || val === void 0 ? void 0 : (_val$Requestor8 = val.Requestor) === null || _val$Requestor8 === void 0 ? void 0 : (_val$Requestor8$ = _val$Requestor8[0]) === null || _val$Requestor8$ === void 0 ? void 0 : (_val$Requestor8$$prac = _val$Requestor8$.practId) === null || _val$Requestor8$$prac === void 0 ? void 0 : (_val$Requestor8$$prac2 = _val$Requestor8$$prac[0]) === null || _val$Requestor8$$prac2 === void 0 ? void 0 : (_val$Requestor8$$prac3 = _val$Requestor8$$prac2.name) === null || _val$Requestor8$$prac3 === void 0 ? void 0 : _val$Requestor8$$prac3[0],
26150
26172
  orderBy: {
26151
26173
  value: val === null || val === void 0 ? void 0 : (_val$Requestor9 = val.Requestor) === null || _val$Requestor9 === void 0 ? void 0 : (_val$Requestor9$ = _val$Requestor9[0]) === null || _val$Requestor9$ === void 0 ? void 0 : (_val$Requestor9$$prac = _val$Requestor9$.practId) === null || _val$Requestor9$$prac === void 0 ? void 0 : (_val$Requestor9$$prac2 = _val$Requestor9$$prac[0]) === null || _val$Requestor9$$prac2 === void 0 ? void 0 : _val$Requestor9$$prac2.id,
26152
- label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor10 = val.Requestor) === null || _val$Requestor10 === void 0 ? void 0 : (_val$Requestor10$ = _val$Requestor10[0]) === null || _val$Requestor10$ === void 0 ? void 0 : (_val$Requestor10$$pra = _val$Requestor10$.practId) === null || _val$Requestor10$$pra === void 0 ? void 0 : (_val$Requestor10$$pra2 = _val$Requestor10$$pra[0]) === null || _val$Requestor10$$pra2 === void 0 ? void 0 : (_val$Requestor10$$pra3 = _val$Requestor10$$pra2.name) === null || _val$Requestor10$$pra3 === void 0 ? void 0 : _val$Requestor10$$pra3[0]) || {})
26174
+ practitioner_id: val === null || val === void 0 ? void 0 : (_val$Requestor10 = val.Requestor) === null || _val$Requestor10 === void 0 ? void 0 : (_val$Requestor10$ = _val$Requestor10[0]) === null || _val$Requestor10$ === void 0 ? void 0 : (_val$Requestor10$$pra = _val$Requestor10$.practId) === null || _val$Requestor10$$pra === void 0 ? void 0 : (_val$Requestor10$$pra2 = _val$Requestor10$$pra[0]) === null || _val$Requestor10$$pra2 === void 0 ? void 0 : _val$Requestor10$$pra2.practitioner_id,
26175
+ label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor11 = val.Requestor) === null || _val$Requestor11 === void 0 ? void 0 : (_val$Requestor11$ = _val$Requestor11[0]) === null || _val$Requestor11$ === void 0 ? void 0 : (_val$Requestor11$$pra = _val$Requestor11$.practId) === null || _val$Requestor11$$pra === void 0 ? void 0 : (_val$Requestor11$$pra2 = _val$Requestor11$$pra[0]) === null || _val$Requestor11$$pra2 === void 0 ? void 0 : (_val$Requestor11$$pra3 = _val$Requestor11$$pra2.name) === null || _val$Requestor11$$pra3 === void 0 ? void 0 : _val$Requestor11$$pra3[0]) || {})
26153
26176
  }
26154
26177
  },
26155
26178
  indication: {
@@ -26231,7 +26254,7 @@ var RecurrentgenerateResJson$2 = function RecurrentgenerateResJson(dataList, arr
26231
26254
  return el != null;
26232
26255
  });
26233
26256
  var list = dataList.map(function (val) {
26234
- var _val$diagnosis2, _val$performer2, _val$recurrent11, _val$recurrent11$, _val$priority2, _val$OrderNature2, _moment$unix$format6, _JSON$stringify3, _val$recurrent12, _val$recurrent12$, _val$recurrent$0$ever3, _val$recurrent13, _val$recurrent13$, _val$recurrent$0$ever4, _val$recurrent14, _val$recurrent14$, _moment$unix$format7, _val$recurrent15, _val$recurrent15$, _JSON$stringify4, _val$recurrent16, _val$recurrent16$, _val$recurrent17, _val$recurrent17$, _moment$unix$format8, _val$recurrent18, _val$recurrent18$, _moment$unix$format9, _val$Requestor11, _val$Requestor11$, _val$Requestor11$$org, _val$Requestor12, _val$Requestor12$, _val$Requestor12$$org, _val$Requestor13, _val$Requestor13$, _val$Requestor13$$org, _val$Requestor$0$prac3, _val$Requestor14, _val$Requestor14$, _val$Requestor14$$pra, _val$Requestor$0$prac4, _val$Requestor15, _val$Requestor15$, _val$Requestor15$$pra, _val$Requestor16, _val$Requestor16$, _val$Requestor16$$pra, _val$Requestor17, _val$Requestor17$, _val$Requestor17$$pra, _val$Requestor18, _val$Requestor18$, _val$Requestor18$$pra, _val$Requestor18$$pra2, _val$Requestor18$$pra3, _val$Requestor19, _val$Requestor19$, _val$Requestor19$$pra, _val$Requestor19$$pra2, _val$Requestor20, _val$Requestor20$, _val$Requestor20$$pra, _val$Requestor20$$pra2, _val$Requestor20$$pra3, _val$specimenRelated, _val$specimenRelated$12, _val$specimenRelated2, _val$specimenRelated3, _val$specimenRelated4, _val$specimenRelated5, _val$specimenRelated6, _val$specimenRelated7, _val$specimenRelated8, _val$specimenRelated9, _val$specimenRelated10, _val$specimenRelated11, _val$specimenRelated12, _val$specimenRelated13, _val$specimenRelated14, _val$specimenRelated15, _val$specimenRelated16, _val$specimenRelated17, _val$specimenRelated18, _val$specimenRelated19, _val$specimenRelated20, _val$specimenRelated21, _val$specimenRelated22, _val$patientInstructi9, _val$patientInstructi10, _val$patientInstructi11, _val$patientInstructi12, _val$patientInstructi13, _val$patientInstructi14, _val$patientInstructi15, _val$patientInstructi16, _val$preparatoryInstr9, _val$preparatoryInstr10, _val$preparatoryInstr11, _val$preparatoryInstr12, _val$preparatoryInstr13, _val$preparatoryInstr14, _val$preparatoryInstr15, _val$preparatoryInstr16, _val$departmentalInst9, _val$departmentalInst10, _val$departmentalInst11, _val$departmentalInst12, _val$departmentalInst13, _val$departmentalInst14, _val$departmentalInst15, _val$departmentalInst16, _val$attribute5, _val$attribute5$, _val$attribute6, _val$attribute6$, _val$attribute$0$bedS2, _val$attribute7, _val$attribute7$, _val$attribute$0$cont2, _val$attribute8, _val$attribute8$, _val$createddate2, _val$changeStatus4, _val$changeStatus5, _val$changeStatus6, _val$statushistory2, _val$statusreason2, _val$accessionNum2;
26257
+ var _val$diagnosis2, _val$performer2, _val$recurrent11, _val$recurrent11$, _val$priority2, _val$OrderNature2, _moment$unix$format6, _JSON$stringify3, _val$recurrent12, _val$recurrent12$, _val$recurrent$0$ever3, _val$recurrent13, _val$recurrent13$, _val$recurrent$0$ever4, _val$recurrent14, _val$recurrent14$, _moment$unix$format7, _val$recurrent15, _val$recurrent15$, _JSON$stringify4, _val$recurrent16, _val$recurrent16$, _val$recurrent17, _val$recurrent17$, _moment$unix$format8, _val$recurrent18, _val$recurrent18$, _moment$unix$format9, _val$Requestor12, _val$Requestor12$, _val$Requestor12$$org, _val$Requestor13, _val$Requestor13$, _val$Requestor13$$org, _val$Requestor14, _val$Requestor14$, _val$Requestor14$$org, _val$Requestor$0$prac3, _val$Requestor15, _val$Requestor15$, _val$Requestor15$$pra, _val$Requestor$0$prac4, _val$Requestor16, _val$Requestor16$, _val$Requestor16$$pra, _val$Requestor17, _val$Requestor17$, _val$Requestor17$$pra, _val$Requestor18, _val$Requestor18$, _val$Requestor18$$pra, _val$Requestor19, _val$Requestor19$, _val$Requestor19$$pra, _val$Requestor19$$pra2, _val$Requestor19$$pra3, _val$Requestor20, _val$Requestor20$, _val$Requestor20$$pra, _val$Requestor20$$pra2, _val$Requestor21, _val$Requestor21$, _val$Requestor21$$pra, _val$Requestor21$$pra2, _val$Requestor22, _val$Requestor22$, _val$Requestor22$$pra, _val$Requestor22$$pra2, _val$Requestor22$$pra3, _val$specimenRelated, _val$specimenRelated$12, _val$specimenRelated2, _val$specimenRelated3, _val$specimenRelated4, _val$specimenRelated5, _val$specimenRelated6, _val$specimenRelated7, _val$specimenRelated8, _val$specimenRelated9, _val$specimenRelated10, _val$specimenRelated11, _val$specimenRelated12, _val$specimenRelated13, _val$specimenRelated14, _val$specimenRelated15, _val$specimenRelated16, _val$specimenRelated17, _val$specimenRelated18, _val$specimenRelated19, _val$specimenRelated20, _val$specimenRelated21, _val$specimenRelated22, _val$patientInstructi9, _val$patientInstructi10, _val$patientInstructi11, _val$patientInstructi12, _val$patientInstructi13, _val$patientInstructi14, _val$patientInstructi15, _val$patientInstructi16, _val$preparatoryInstr9, _val$preparatoryInstr10, _val$preparatoryInstr11, _val$preparatoryInstr12, _val$preparatoryInstr13, _val$preparatoryInstr14, _val$preparatoryInstr15, _val$preparatoryInstr16, _val$departmentalInst9, _val$departmentalInst10, _val$departmentalInst11, _val$departmentalInst12, _val$departmentalInst13, _val$departmentalInst14, _val$departmentalInst15, _val$departmentalInst16, _val$attribute5, _val$attribute5$, _val$attribute6, _val$attribute6$, _val$attribute$0$bedS2, _val$attribute7, _val$attribute7$, _val$attribute$0$cont2, _val$attribute8, _val$attribute8$, _val$createddate2, _val$changeStatus4, _val$changeStatus5, _val$changeStatus6, _val$statushistory2, _val$statusreason2, _val$accessionNum2;
26235
26258
 
26236
26259
  var diagnosisData = val === null || val === void 0 ? void 0 : (_val$diagnosis2 = val.diagnosis) === null || _val$diagnosis2 === void 0 ? void 0 : _val$diagnosis2.map(function (v) {
26237
26260
  return {
@@ -26310,20 +26333,21 @@ var RecurrentgenerateResJson$2 = function RecurrentgenerateResJson(dataList, arr
26310
26333
  qty: JSON.stringify(val === null || val === void 0 ? void 0 : val.orderQty),
26311
26334
  requestorDetails: {
26312
26335
  organization: {
26313
- label: val === null || val === void 0 ? void 0 : (_val$Requestor11 = val.Requestor) === null || _val$Requestor11 === void 0 ? void 0 : (_val$Requestor11$ = _val$Requestor11[0]) === null || _val$Requestor11$ === void 0 ? void 0 : (_val$Requestor11$$org = _val$Requestor11$.organization) === null || _val$Requestor11$$org === void 0 ? void 0 : _val$Requestor11$$org._id,
26314
- value: val === null || val === void 0 ? void 0 : (_val$Requestor12 = val.Requestor) === null || _val$Requestor12 === void 0 ? void 0 : (_val$Requestor12$ = _val$Requestor12[0]) === null || _val$Requestor12$ === void 0 ? void 0 : (_val$Requestor12$$org = _val$Requestor12$.organization) === null || _val$Requestor12$$org === void 0 ? void 0 : _val$Requestor12$$org.name,
26315
- id: val === null || val === void 0 ? void 0 : (_val$Requestor13 = val.Requestor) === null || _val$Requestor13 === void 0 ? void 0 : (_val$Requestor13$ = _val$Requestor13[0]) === null || _val$Requestor13$ === void 0 ? void 0 : (_val$Requestor13$$org = _val$Requestor13$.organization) === null || _val$Requestor13$$org === void 0 ? void 0 : _val$Requestor13$$org.id
26336
+ label: val === null || val === void 0 ? void 0 : (_val$Requestor12 = val.Requestor) === null || _val$Requestor12 === void 0 ? void 0 : (_val$Requestor12$ = _val$Requestor12[0]) === null || _val$Requestor12$ === void 0 ? void 0 : (_val$Requestor12$$org = _val$Requestor12$.organization) === null || _val$Requestor12$$org === void 0 ? void 0 : _val$Requestor12$$org._id,
26337
+ value: val === null || val === void 0 ? void 0 : (_val$Requestor13 = val.Requestor) === null || _val$Requestor13 === void 0 ? void 0 : (_val$Requestor13$ = _val$Requestor13[0]) === null || _val$Requestor13$ === void 0 ? void 0 : (_val$Requestor13$$org = _val$Requestor13$.organization) === null || _val$Requestor13$$org === void 0 ? void 0 : _val$Requestor13$$org.name,
26338
+ id: val === null || val === void 0 ? void 0 : (_val$Requestor14 = val.Requestor) === null || _val$Requestor14 === void 0 ? void 0 : (_val$Requestor14$ = _val$Requestor14[0]) === null || _val$Requestor14$ === void 0 ? void 0 : (_val$Requestor14$$org = _val$Requestor14$.organization) === null || _val$Requestor14$$org === void 0 ? void 0 : _val$Requestor14$$org.id
26316
26339
  },
26317
26340
  practitionerRole: {
26318
- label: (_val$Requestor$0$prac3 = val === null || val === void 0 ? void 0 : (_val$Requestor14 = val.Requestor) === null || _val$Requestor14 === void 0 ? void 0 : (_val$Requestor14$ = _val$Requestor14[0]) === null || _val$Requestor14$ === void 0 ? void 0 : (_val$Requestor14$$pra = _val$Requestor14$.practRole) === null || _val$Requestor14$$pra === void 0 ? void 0 : _val$Requestor14$$pra.display) !== null && _val$Requestor$0$prac3 !== void 0 ? _val$Requestor$0$prac3 : "",
26319
- value: (_val$Requestor$0$prac4 = val === null || val === void 0 ? void 0 : (_val$Requestor15 = val.Requestor) === null || _val$Requestor15 === void 0 ? void 0 : (_val$Requestor15$ = _val$Requestor15[0]) === null || _val$Requestor15$ === void 0 ? void 0 : (_val$Requestor15$$pra = _val$Requestor15$.practRole) === null || _val$Requestor15$$pra === void 0 ? void 0 : _val$Requestor15$$pra.display) !== null && _val$Requestor$0$prac4 !== void 0 ? _val$Requestor$0$prac4 : "",
26320
- id: val === null || val === void 0 ? void 0 : (_val$Requestor16 = val.Requestor) === null || _val$Requestor16 === void 0 ? void 0 : (_val$Requestor16$ = _val$Requestor16[0]) === null || _val$Requestor16$ === void 0 ? void 0 : (_val$Requestor16$$pra = _val$Requestor16$.practRole) === null || _val$Requestor16$$pra === void 0 ? void 0 : _val$Requestor16$$pra.id,
26321
- _id: val === null || val === void 0 ? void 0 : (_val$Requestor17 = val.Requestor) === null || _val$Requestor17 === void 0 ? void 0 : (_val$Requestor17$ = _val$Requestor17[0]) === null || _val$Requestor17$ === void 0 ? void 0 : (_val$Requestor17$$pra = _val$Requestor17$.practRole) === null || _val$Requestor17$$pra === void 0 ? void 0 : _val$Requestor17$$pra._id
26341
+ label: (_val$Requestor$0$prac3 = val === null || val === void 0 ? void 0 : (_val$Requestor15 = val.Requestor) === null || _val$Requestor15 === void 0 ? void 0 : (_val$Requestor15$ = _val$Requestor15[0]) === null || _val$Requestor15$ === void 0 ? void 0 : (_val$Requestor15$$pra = _val$Requestor15$.practRole) === null || _val$Requestor15$$pra === void 0 ? void 0 : _val$Requestor15$$pra.display) !== null && _val$Requestor$0$prac3 !== void 0 ? _val$Requestor$0$prac3 : "",
26342
+ value: (_val$Requestor$0$prac4 = val === null || val === void 0 ? void 0 : (_val$Requestor16 = val.Requestor) === null || _val$Requestor16 === void 0 ? void 0 : (_val$Requestor16$ = _val$Requestor16[0]) === null || _val$Requestor16$ === void 0 ? void 0 : (_val$Requestor16$$pra = _val$Requestor16$.practRole) === null || _val$Requestor16$$pra === void 0 ? void 0 : _val$Requestor16$$pra.display) !== null && _val$Requestor$0$prac4 !== void 0 ? _val$Requestor$0$prac4 : "",
26343
+ id: val === null || val === void 0 ? void 0 : (_val$Requestor17 = val.Requestor) === null || _val$Requestor17 === void 0 ? void 0 : (_val$Requestor17$ = _val$Requestor17[0]) === null || _val$Requestor17$ === void 0 ? void 0 : (_val$Requestor17$$pra = _val$Requestor17$.practRole) === null || _val$Requestor17$$pra === void 0 ? void 0 : _val$Requestor17$$pra.id,
26344
+ _id: val === null || val === void 0 ? void 0 : (_val$Requestor18 = val.Requestor) === null || _val$Requestor18 === void 0 ? void 0 : (_val$Requestor18$ = _val$Requestor18[0]) === null || _val$Requestor18$ === void 0 ? void 0 : (_val$Requestor18$$pra = _val$Requestor18$.practRole) === null || _val$Requestor18$$pra === void 0 ? void 0 : _val$Requestor18$$pra._id
26322
26345
  },
26323
- practitionerId: val === null || val === void 0 ? void 0 : (_val$Requestor18 = val.Requestor) === null || _val$Requestor18 === void 0 ? void 0 : (_val$Requestor18$ = _val$Requestor18[0]) === null || _val$Requestor18$ === void 0 ? void 0 : (_val$Requestor18$$pra = _val$Requestor18$.practId) === null || _val$Requestor18$$pra === void 0 ? void 0 : (_val$Requestor18$$pra2 = _val$Requestor18$$pra[0]) === null || _val$Requestor18$$pra2 === void 0 ? void 0 : (_val$Requestor18$$pra3 = _val$Requestor18$$pra2.name) === null || _val$Requestor18$$pra3 === void 0 ? void 0 : _val$Requestor18$$pra3[0],
26346
+ practitionerId: val === null || val === void 0 ? void 0 : (_val$Requestor19 = val.Requestor) === null || _val$Requestor19 === void 0 ? void 0 : (_val$Requestor19$ = _val$Requestor19[0]) === null || _val$Requestor19$ === void 0 ? void 0 : (_val$Requestor19$$pra = _val$Requestor19$.practId) === null || _val$Requestor19$$pra === void 0 ? void 0 : (_val$Requestor19$$pra2 = _val$Requestor19$$pra[0]) === null || _val$Requestor19$$pra2 === void 0 ? void 0 : (_val$Requestor19$$pra3 = _val$Requestor19$$pra2.name) === null || _val$Requestor19$$pra3 === void 0 ? void 0 : _val$Requestor19$$pra3[0],
26324
26347
  orderBy: {
26325
- value: val === null || val === void 0 ? void 0 : (_val$Requestor19 = val.Requestor) === null || _val$Requestor19 === void 0 ? void 0 : (_val$Requestor19$ = _val$Requestor19[0]) === null || _val$Requestor19$ === void 0 ? void 0 : (_val$Requestor19$$pra = _val$Requestor19$.practId) === null || _val$Requestor19$$pra === void 0 ? void 0 : (_val$Requestor19$$pra2 = _val$Requestor19$$pra[0]) === null || _val$Requestor19$$pra2 === void 0 ? void 0 : _val$Requestor19$$pra2.id,
26326
- label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor20 = val.Requestor) === null || _val$Requestor20 === void 0 ? void 0 : (_val$Requestor20$ = _val$Requestor20[0]) === null || _val$Requestor20$ === void 0 ? void 0 : (_val$Requestor20$$pra = _val$Requestor20$.practId) === null || _val$Requestor20$$pra === void 0 ? void 0 : (_val$Requestor20$$pra2 = _val$Requestor20$$pra[0]) === null || _val$Requestor20$$pra2 === void 0 ? void 0 : (_val$Requestor20$$pra3 = _val$Requestor20$$pra2.name) === null || _val$Requestor20$$pra3 === void 0 ? void 0 : _val$Requestor20$$pra3[0]) || {})
26348
+ value: val === null || val === void 0 ? void 0 : (_val$Requestor20 = val.Requestor) === null || _val$Requestor20 === void 0 ? void 0 : (_val$Requestor20$ = _val$Requestor20[0]) === null || _val$Requestor20$ === void 0 ? void 0 : (_val$Requestor20$$pra = _val$Requestor20$.practId) === null || _val$Requestor20$$pra === void 0 ? void 0 : (_val$Requestor20$$pra2 = _val$Requestor20$$pra[0]) === null || _val$Requestor20$$pra2 === void 0 ? void 0 : _val$Requestor20$$pra2.id,
26349
+ practitioner_id: val === null || val === void 0 ? void 0 : (_val$Requestor21 = val.Requestor) === null || _val$Requestor21 === void 0 ? void 0 : (_val$Requestor21$ = _val$Requestor21[0]) === null || _val$Requestor21$ === void 0 ? void 0 : (_val$Requestor21$$pra = _val$Requestor21$.practId) === null || _val$Requestor21$$pra === void 0 ? void 0 : (_val$Requestor21$$pra2 = _val$Requestor21$$pra[0]) === null || _val$Requestor21$$pra2 === void 0 ? void 0 : _val$Requestor21$$pra2.practitioner_id,
26350
+ label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor22 = val.Requestor) === null || _val$Requestor22 === void 0 ? void 0 : (_val$Requestor22$ = _val$Requestor22[0]) === null || _val$Requestor22$ === void 0 ? void 0 : (_val$Requestor22$$pra = _val$Requestor22$.practId) === null || _val$Requestor22$$pra === void 0 ? void 0 : (_val$Requestor22$$pra2 = _val$Requestor22$$pra[0]) === null || _val$Requestor22$$pra2 === void 0 ? void 0 : (_val$Requestor22$$pra3 = _val$Requestor22$$pra2.name) === null || _val$Requestor22$$pra3 === void 0 ? void 0 : _val$Requestor22$$pra3[0]) || {})
26327
26351
  }
26328
26352
  },
26329
26353
  indication: {
@@ -27717,12 +27741,13 @@ var LABORDER_ORGANIZATION = createAsyncThunk("LabOrderApiSlice/laborder_orgnniza
27717
27741
  data3 = _context23.sent;
27718
27742
  arr3 = [];
27719
27743
  data3 === null || data3 === void 0 ? void 0 : (_data3$result = data3.result) === null || _data3$result === void 0 ? void 0 : _data3$result.map(function (val) {
27720
- var _val$shortdesc, _val$shortdesc2, _val$_id6;
27744
+ var _val$shortdesc, _val$shortdesc2, _val$_id6, _val$locationID;
27721
27745
 
27722
27746
  arr3.push({
27723
27747
  label: (_val$shortdesc = val === null || val === void 0 ? void 0 : val.shortdesc) !== null && _val$shortdesc !== void 0 ? _val$shortdesc : "",
27724
27748
  value: (_val$shortdesc2 = val === null || val === void 0 ? void 0 : val.shortdesc) !== null && _val$shortdesc2 !== void 0 ? _val$shortdesc2 : "",
27725
- id: (_val$_id6 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id6 !== void 0 ? _val$_id6 : ""
27749
+ id: (_val$_id6 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id6 !== void 0 ? _val$_id6 : "",
27750
+ locationID: (_val$locationID = val === null || val === void 0 ? void 0 : val.locationID) !== null && _val$locationID !== void 0 ? _val$locationID : ""
27726
27751
  });
27727
27752
  });
27728
27753
  _context23.next = 26;
@@ -27794,7 +27819,7 @@ var ORDER_TYPE_REQ_DETAILS_LAB = createAsyncThunk("LabOrderApiSlice/order_type_r
27794
27819
  data2 = _context24.sent;
27795
27820
  arr2 = [];
27796
27821
  data2 === null || data2 === void 0 ? void 0 : (_data2$result2 = data2.result) === null || _data2$result2 === void 0 ? void 0 : _data2$result2.map(function (val) {
27797
- var _val$name2, _val$_id7;
27822
+ var _val$name2, _val$_id7, _val$practitioner_id;
27798
27823
 
27799
27824
  // if (
27800
27825
  // val.name[0]?.prefix[0]?.coding.display +
@@ -27803,7 +27828,8 @@ var ORDER_TYPE_REQ_DETAILS_LAB = createAsyncThunk("LabOrderApiSlice/order_type_r
27803
27828
  // ) {
27804
27829
  arr2.push({
27805
27830
  label: makeName((val === null || val === void 0 ? void 0 : (_val$name2 = val.name) === null || _val$name2 === void 0 ? void 0 : _val$name2[0]) || {}),
27806
- value: (_val$_id7 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id7 !== void 0 ? _val$_id7 : ""
27831
+ value: (_val$_id7 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id7 !== void 0 ? _val$_id7 : "",
27832
+ practitioner_id: (_val$practitioner_id = val === null || val === void 0 ? void 0 : val.practitioner_id) !== null && _val$practitioner_id !== void 0 ? _val$practitioner_id : ""
27807
27833
  }); // }
27808
27834
  });
27809
27835
  return _context24.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
@@ -28569,7 +28595,7 @@ var LabOrderApiSlice$1 = LabOrderApiSlice.reducer;
28569
28595
 
28570
28596
  var queries$5 = {
28571
28597
  drugType: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"DrugType\",\n \"return_fields\": \"DrugType\"\n }"),
28572
- drugMaster: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"DrugMaster\",\n \"return_fields\": \"MERGE(DrugMaster,{DrugType:DOCUMENT(DrugMaster.DrugType),FormCode:DOCUMENT(DrugMaster.FormCode)})\"\n }"),
28598
+ drugMaster: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"DrugMaster\",\n \"limit\":{\n \"count\":100,\n \"offset\":0\n \n },\n \"return_fields\": \"MERGE(DrugMaster,{DrugType:DOCUMENT(DrugMaster.DrugType),FormCode:DOCUMENT(DrugMaster.FormCode)})\"\n }"),
28573
28599
  getMedications: function getMedications(id) {
28574
28600
  return "{\n \"db_name\": \"".concat(dbName, "\",\n \"filter\": \"PH_OrderLine.patient_Id=='").concat(id, "'\",\n \"entity\": \"PH_OrderLine\",\n \"return_fields\": \"MERGE(PH_OrderLine, { patient_Id:(FOR pname IN TO_ARRAY(DOCUMENT(PH_OrderLine.patient_Id).name) RETURN MERGE(DOCUMENT(PH_OrderLine.patient_Id), { name:DOCUMENT(pname), telecom:(FOR ptel IN TO_ARRAY(DOCUMENT(PH_OrderLine.patient_Id).telecom) RETURN DOCUMENT(ptel)), martialStatus:(FOR mstatus IN TO_ARRAY(DOCUMENT(PH_OrderLine.patient_Id).martialStatus) RETURN DOCUMENT(mstatus)) } ) ) ,org_Id:MERGE(DOCUMENT(PH_OrderLine.org_Id), { telecom:(FOR otel IN TO_ARRAY(DOCUMENT(PH_OrderLine.org_Id).telecom) RETURN DOCUMENT(otel) ), address:(FOR oadd IN TO_ARRAY(DOCUMENT(PH_OrderLine.org_Id).address) RETURN DOCUMENT(oadd) ) }) ,encounter_Id:DOCUMENT(PH_OrderLine.encounter_Id) ,dosageDurationUOM:DOCUMENT(PH_OrderLine.dosageDurationUOM) ,dosageFreqCode:DOCUMENT(PH_OrderLine.dosageFreqCode) ,dosageUOM:DOCUMENT(PH_OrderLine.dosageUOM) ,drugCode:DOCUMENT(PH_OrderLine.drugCode) ,drugType:DOCUMENT(PH_OrderLine.drugType) , createdby:(FOR hn IN TO_ARRAY(DOCUMENT(PH_OrderLine.createdby).name) RETURN MERGE(DOCUMENT(PH_OrderLine.createdby),{name:DOCUMENT(hn)})) , updatedby:(FOR hn IN TO_ARRAY(DOCUMENT(PH_OrderLine.updatedby).name) RETURN MERGE(DOCUMENT(PH_OrderLine.updatedby),{name:DOCUMENT(hn)})) , statushistory:(FOR sth IN TO_ARRAY(PH_OrderLine.statushistory) RETURN MERGE(sth,{PersonID:(FOR hn IN TO_ARRAY(DOCUMENT(sth.PersonID).name) RETURN MERGE(DOCUMENT(sth.PersonID),{name:DOCUMENT(hn)}))})) } )\"\n }");
28575
28601
  },
@@ -28640,6 +28666,25 @@ var queries$5 = {
28640
28666
  // }
28641
28667
  // ]
28642
28668
 
28669
+ var codeQuery = {
28670
+ AllergyCodes: function AllergyCodes(list) {
28671
+ return {
28672
+ db_name: dbName,
28673
+ entity: "CA_AllergyIntolerance",
28674
+ filter: "CA_AllergyIntolerance.encounter_id=='".concat(list, "' && CA_AllergyIntolerance.activestatus==true"),
28675
+ "return_fields": "{code:document(CA_AllergyIntolerance.code)}"
28676
+ };
28677
+ },
28678
+ DrugCodes: function DrugCodes(list) {
28679
+ return {
28680
+ db_name: dbName,
28681
+ entity: "CA_Diagnosis",
28682
+ filter: "CA_Diagnosis.encounter_id=='".concat(list, "' && CA_Diagnosis.activestatus==true"),
28683
+ return_fields: "{diagcode:document(CA_Diagnosis.diagcode)}"
28684
+ };
28685
+ }
28686
+ };
28687
+
28643
28688
  var _extraReducers$g;
28644
28689
  var DRUGTYPE_MASTER = createAsyncThunk("MedicationMastersSlice/drugType_masters", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
28645
28690
  var payload,
@@ -28715,7 +28760,7 @@ var DRUGMASTER_MASTER = createAsyncThunk("MedicationMastersSlice/drugMaster_mast
28715
28760
  data = _context2.sent;
28716
28761
  arr = [];
28717
28762
  data.result.map(function (val) {
28718
- var _val$FormCode, _val$FormCode2, _val$StrengthValuesPo, _val$StrengthValuesPo2, _val$StrengthValuesPo3, _val$StrengthValuesPo4, _val$DrugType, _val$DrugType2, _val$DrugType3, _val$DrugType4;
28763
+ var _val$FormCode, _val$FormCode2, _val$StrengthValuesPo, _val$StrengthValuesPo2, _val$StrengthValuesPo3, _val$StrengthValuesPo4, _val$DrugType, _val$DrugType2, _val$DrugType3, _val$DrugType4, _val$drugroutegenid;
28719
28764
 
28720
28765
  var json = {
28721
28766
  value: val === null || val === void 0 ? void 0 : val._id,
@@ -28727,7 +28772,8 @@ var DRUGMASTER_MASTER = createAsyncThunk("MedicationMastersSlice/drugMaster_mast
28727
28772
  drugType: val === null || val === void 0 ? void 0 : (_val$DrugType = val.DrugType) === null || _val$DrugType === void 0 ? void 0 : _val$DrugType.drugtype,
28728
28773
  drugTypeLong: val === null || val === void 0 ? void 0 : (_val$DrugType2 = val.DrugType) === null || _val$DrugType2 === void 0 ? void 0 : _val$DrugType2.longdesc,
28729
28774
  drugTypeShort: val === null || val === void 0 ? void 0 : (_val$DrugType3 = val.DrugType) === null || _val$DrugType3 === void 0 ? void 0 : _val$DrugType3.shortdesc,
28730
- drugTypeId: val === null || val === void 0 ? void 0 : (_val$DrugType4 = val.DrugType) === null || _val$DrugType4 === void 0 ? void 0 : _val$DrugType4._id // formValue
28775
+ drugTypeId: val === null || val === void 0 ? void 0 : (_val$DrugType4 = val.DrugType) === null || _val$DrugType4 === void 0 ? void 0 : _val$DrugType4._id,
28776
+ drugroutegenid: (_val$drugroutegenid = val === null || val === void 0 ? void 0 : val.drugroutegenid) !== null && _val$drugroutegenid !== void 0 ? _val$drugroutegenid : "" // formValue
28731
28777
 
28732
28778
  };
28733
28779
  arr.push(_objectSpread2(_objectSpread2({}, json), {}, {
@@ -30583,18 +30629,13 @@ var MedicationMastersActions = {
30583
30629
  var MedicationMastersSlice$1 = MedicationMastersSlice.reducer;
30584
30630
 
30585
30631
  var _extraReducers$f;
30586
- var SAVE_MEDICATIONS = createAsyncThunk("medicationsSlice/save_medication", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
30632
+ var ALERT_CODES = createAsyncThunk("medicationsSlice/alert_codes", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
30587
30633
  var payload,
30588
30634
  _ref2,
30589
30635
  rejectWithValue,
30590
- _data$Result,
30591
- _data$Result$,
30592
- _data$Result$$propert,
30593
- _data$Result$$propert2,
30594
30636
  list,
30595
- orgData,
30596
- body,
30597
30637
  data,
30638
+ code,
30598
30639
  _args = arguments;
30599
30640
 
30600
30641
  return regeneratorRuntime.wrap(function _callee$(_context) {
@@ -30604,44 +30645,143 @@ var SAVE_MEDICATIONS = createAsyncThunk("medicationsSlice/save_medication", /*#_
30604
30645
  payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
30605
30646
  _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
30606
30647
  _context.prev = 2;
30607
- list = payload;
30648
+ list = payload.list;
30608
30649
  _context.next = 6;
30650
+ return fetchData$3({
30651
+ body: JSON.stringify(codeQuery.AllergyCodes(list))
30652
+ }, __readDocumentUrl__);
30653
+
30654
+ case 6:
30655
+ data = _context.sent;
30656
+ code = data.result.map(function (val) {
30657
+ return {
30658
+ codes: val.code.code
30659
+ };
30660
+ });
30661
+ return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
30662
+ data: code
30663
+ }));
30664
+
30665
+ case 11:
30666
+ _context.prev = 11;
30667
+ _context.t0 = _context["catch"](2);
30668
+ return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30669
+ message: _context.t0.message
30670
+ })));
30671
+
30672
+ case 14:
30673
+ case "end":
30674
+ return _context.stop();
30675
+ }
30676
+ }
30677
+ }, _callee, null, [[2, 11]]);
30678
+ })));
30679
+ var DRUG_CODES = createAsyncThunk("medicationsSlice/drug_codes", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
30680
+ var payload,
30681
+ _ref4,
30682
+ rejectWithValue,
30683
+ list,
30684
+ data,
30685
+ code,
30686
+ _args2 = arguments;
30687
+
30688
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
30689
+ while (1) {
30690
+ switch (_context2.prev = _context2.next) {
30691
+ case 0:
30692
+ payload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
30693
+ _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
30694
+ _context2.prev = 2;
30695
+ list = payload.list;
30696
+ _context2.next = 6;
30697
+ return fetchData$3({
30698
+ body: JSON.stringify(codeQuery.DrugCodes(list))
30699
+ }, __readDocumentUrl__);
30700
+
30701
+ case 6:
30702
+ data = _context2.sent;
30703
+ code = data.result.map(function (val) {
30704
+ return {
30705
+ codes: val.diagcode.icdcode
30706
+ };
30707
+ });
30708
+ return _context2.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
30709
+ data: code
30710
+ }));
30711
+
30712
+ case 11:
30713
+ _context2.prev = 11;
30714
+ _context2.t0 = _context2["catch"](2);
30715
+ return _context2.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30716
+ message: _context2.t0.message
30717
+ })));
30718
+
30719
+ case 14:
30720
+ case "end":
30721
+ return _context2.stop();
30722
+ }
30723
+ }
30724
+ }, _callee2, null, [[2, 11]]);
30725
+ })));
30726
+ var SAVE_MEDICATIONS = createAsyncThunk("medicationsSlice/save_medication", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
30727
+ var payload,
30728
+ _ref6,
30729
+ rejectWithValue,
30730
+ _data$Result,
30731
+ _data$Result$,
30732
+ _data$Result$$propert,
30733
+ _data$Result$$propert2,
30734
+ list,
30735
+ orgData,
30736
+ body,
30737
+ data,
30738
+ _args3 = arguments;
30739
+
30740
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
30741
+ while (1) {
30742
+ switch (_context3.prev = _context3.next) {
30743
+ case 0:
30744
+ payload = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
30745
+ _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue;
30746
+ _context3.prev = 2;
30747
+ list = payload;
30748
+ _context3.next = 6;
30609
30749
  return fetchData$3({
30610
30750
  body: queries$5.getOrganizationId(payload.orgId)
30611
30751
  }, __readDocumentUrl__);
30612
30752
 
30613
30753
  case 6:
30614
- orgData = _context.sent;
30754
+ orgData = _context3.sent;
30615
30755
  body = generateJSON$4(list, orgData.result[0]);
30616
- _context.next = 10;
30756
+ _context3.next = 10;
30617
30757
  return fetchData$3({
30618
30758
  body: JSON.stringify(body)
30619
30759
  }, __uspsertUrl__);
30620
30760
 
30621
30761
  case 10:
30622
- data = _context.sent;
30623
- return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
30762
+ data = _context3.sent;
30763
+ return _context3.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
30624
30764
  data: data === null || data === void 0 ? void 0 : (_data$Result = data.Result) === null || _data$Result === void 0 ? void 0 : (_data$Result$ = _data$Result[0]) === null || _data$Result$ === void 0 ? void 0 : (_data$Result$$propert = _data$Result$.properties) === null || _data$Result$$propert === void 0 ? void 0 : (_data$Result$$propert2 = _data$Result$$propert.doc) === null || _data$Result$$propert2 === void 0 ? void 0 : _data$Result$$propert2._id
30625
30765
  }));
30626
30766
 
30627
30767
  case 14:
30628
- _context.prev = 14;
30629
- _context.t0 = _context["catch"](2);
30630
- console.log(_context.t0);
30631
- return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30632
- message: _context.t0.message
30768
+ _context3.prev = 14;
30769
+ _context3.t0 = _context3["catch"](2);
30770
+ console.log(_context3.t0);
30771
+ return _context3.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30772
+ message: _context3.t0.message
30633
30773
  })));
30634
30774
 
30635
30775
  case 18:
30636
30776
  case "end":
30637
- return _context.stop();
30777
+ return _context3.stop();
30638
30778
  }
30639
30779
  }
30640
- }, _callee, null, [[2, 14]]);
30780
+ }, _callee3, null, [[2, 14]]);
30641
30781
  })));
30642
- var UPDATE_MEDICATIONS = createAsyncThunk("medicationsSlice/update_medication", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
30782
+ var UPDATE_MEDICATIONS = createAsyncThunk("medicationsSlice/update_medication", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
30643
30783
  var payload,
30644
- _ref4,
30784
+ _ref8,
30645
30785
  rejectWithValue,
30646
30786
  _list$status,
30647
30787
  _data$Result2,
@@ -30651,15 +30791,15 @@ var UPDATE_MEDICATIONS = createAsyncThunk("medicationsSlice/update_medication",
30651
30791
  list,
30652
30792
  body,
30653
30793
  data,
30654
- _args2 = arguments;
30794
+ _args4 = arguments;
30655
30795
 
30656
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
30796
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
30657
30797
  while (1) {
30658
- switch (_context2.prev = _context2.next) {
30798
+ switch (_context4.prev = _context4.next) {
30659
30799
  case 0:
30660
- payload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
30661
- _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
30662
- _context2.prev = 2;
30800
+ payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
30801
+ _ref8 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref8.rejectWithValue;
30802
+ _context4.prev = 2;
30663
30803
  list = payload; // const states = getState();
30664
30804
 
30665
30805
  body = [{
@@ -30683,76 +30823,76 @@ var UPDATE_MEDICATIONS = createAsyncThunk("medicationsSlice/update_medication",
30683
30823
  // ))
30684
30824
  // }
30685
30825
 
30686
- _context2.next = 7;
30826
+ _context4.next = 7;
30687
30827
  return fetchData$3({
30688
30828
  body: JSON.stringify(body)
30689
30829
  }, __update__);
30690
30830
 
30691
30831
  case 7:
30692
- data = _context2.sent;
30693
- return _context2.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
30832
+ data = _context4.sent;
30833
+ return _context4.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
30694
30834
  data: data === null || data === void 0 ? void 0 : (_data$Result2 = data.Result) === null || _data$Result2 === void 0 ? void 0 : (_data$Result2$ = _data$Result2[0]) === null || _data$Result2$ === void 0 ? void 0 : (_data$Result2$$proper = _data$Result2$.properties) === null || _data$Result2$$proper === void 0 ? void 0 : (_data$Result2$$proper2 = _data$Result2$$proper.doc) === null || _data$Result2$$proper2 === void 0 ? void 0 : _data$Result2$$proper2._id
30695
30835
  }));
30696
30836
 
30697
30837
  case 11:
30698
- _context2.prev = 11;
30699
- _context2.t0 = _context2["catch"](2);
30700
- console.log(_context2.t0);
30701
- return _context2.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30702
- message: _context2.t0.message
30838
+ _context4.prev = 11;
30839
+ _context4.t0 = _context4["catch"](2);
30840
+ console.log(_context4.t0);
30841
+ return _context4.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30842
+ message: _context4.t0.message
30703
30843
  })));
30704
30844
 
30705
30845
  case 15:
30706
30846
  case "end":
30707
- return _context2.stop();
30847
+ return _context4.stop();
30708
30848
  }
30709
30849
  }
30710
- }, _callee2, null, [[2, 11]]);
30850
+ }, _callee4, null, [[2, 11]]);
30711
30851
  })));
30712
- var GET_MEDICATIONS = createAsyncThunk("medicationsSlice/medication_list", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
30852
+ var GET_MEDICATIONS = createAsyncThunk("medicationsSlice/medication_list", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
30713
30853
  var payload,
30714
- _ref6,
30854
+ _ref10,
30715
30855
  rejectWithValue,
30716
30856
  id,
30717
30857
  data,
30718
- _args3 = arguments;
30858
+ _args5 = arguments;
30719
30859
 
30720
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
30860
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
30721
30861
  while (1) {
30722
- switch (_context3.prev = _context3.next) {
30862
+ switch (_context5.prev = _context5.next) {
30723
30863
  case 0:
30724
- payload = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
30725
- _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue;
30726
- _context3.prev = 2;
30864
+ payload = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
30865
+ _ref10 = _args5.length > 1 ? _args5[1] : undefined, rejectWithValue = _ref10.rejectWithValue;
30866
+ _context5.prev = 2;
30727
30867
  id = payload.id;
30728
- _context3.next = 6;
30868
+ _context5.next = 6;
30729
30869
  return fetchData$3({
30730
30870
  body: queries$5.getMedications(id)
30731
30871
  }, __readDocumentUrl__);
30732
30872
 
30733
30873
  case 6:
30734
- data = _context3.sent;
30735
- return _context3.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
30874
+ data = _context5.sent;
30875
+ return _context5.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
30736
30876
  data: data === null || data === void 0 ? void 0 : data.result
30737
30877
  }));
30738
30878
 
30739
30879
  case 10:
30740
- _context3.prev = 10;
30741
- _context3.t0 = _context3["catch"](2);
30742
- return _context3.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30743
- message: _context3.t0.message
30880
+ _context5.prev = 10;
30881
+ _context5.t0 = _context5["catch"](2);
30882
+ return _context5.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30883
+ message: _context5.t0.message
30744
30884
  })));
30745
30885
 
30746
30886
  case 13:
30747
30887
  case "end":
30748
- return _context3.stop();
30888
+ return _context5.stop();
30749
30889
  }
30750
30890
  }
30751
- }, _callee3, null, [[2, 10]]);
30891
+ }, _callee5, null, [[2, 10]]);
30752
30892
  })));
30753
- var UPDATE_ALL_WORKFLOW_STATUS = createAsyncThunk("medicationsSlice/update_workflow_status", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
30893
+ var UPDATE_ALL_WORKFLOW_STATUS = createAsyncThunk("medicationsSlice/update_workflow_status", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
30754
30894
  var payload,
30755
- _ref8,
30895
+ _ref12,
30756
30896
  rejectWithValue,
30757
30897
  getState,
30758
30898
  personId,
@@ -30765,15 +30905,15 @@ var UPDATE_ALL_WORKFLOW_STATUS = createAsyncThunk("medicationsSlice/update_workf
30765
30905
  arr,
30766
30906
  data,
30767
30907
  PH_PresWorkflowStatusTrx,
30768
- _args4 = arguments;
30908
+ _args6 = arguments;
30769
30909
 
30770
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
30910
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
30771
30911
  while (1) {
30772
- switch (_context4.prev = _context4.next) {
30912
+ switch (_context6.prev = _context6.next) {
30773
30913
  case 0:
30774
- payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
30775
- _ref8 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref8.rejectWithValue, getState = _ref8.getState;
30776
- _context4.prev = 2;
30914
+ payload = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
30915
+ _ref12 = _args6.length > 1 ? _args6[1] : undefined, rejectWithValue = _ref12.rejectWithValue, getState = _ref12.getState;
30916
+ _context6.prev = 2;
30777
30917
  personId = payload.personId;
30778
30918
  states = getState();
30779
30919
  flowStatus = states.MedicationMastersSlice.workflow_status_masters.data.filter(function (val) {
@@ -30810,39 +30950,39 @@ var UPDATE_ALL_WORKFLOW_STATUS = createAsyncThunk("medicationsSlice/update_workf
30810
30950
  }
30811
30951
  };
30812
30952
  });
30813
- _context4.next = 13;
30953
+ _context6.next = 13;
30814
30954
  return fetchData$3({
30815
30955
  body: JSON.stringify(arr)
30816
30956
  }, __update__);
30817
30957
 
30818
30958
  case 13:
30819
- data = _context4.sent;
30820
- _context4.next = 16;
30959
+ data = _context6.sent;
30960
+ _context6.next = 16;
30821
30961
  return fetchData$3({
30822
30962
  body: JSON.stringify(flowStatusList)
30823
30963
  }, __uspsertUrl__);
30824
30964
 
30825
30965
  case 16:
30826
- PH_PresWorkflowStatusTrx = _context4.sent;
30827
- return _context4.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
30966
+ PH_PresWorkflowStatusTrx = _context6.sent;
30967
+ return _context6.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
30828
30968
  data: data,
30829
30969
  PH_PresWorkflowStatusTrx: PH_PresWorkflowStatusTrx
30830
30970
  }));
30831
30971
 
30832
30972
  case 20:
30833
- _context4.prev = 20;
30834
- _context4.t0 = _context4["catch"](2);
30835
- console.log(_context4.t0);
30836
- return _context4.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30837
- message: _context4.t0.message
30973
+ _context6.prev = 20;
30974
+ _context6.t0 = _context6["catch"](2);
30975
+ console.log(_context6.t0);
30976
+ return _context6.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30977
+ message: _context6.t0.message
30838
30978
  })));
30839
30979
 
30840
30980
  case 24:
30841
30981
  case "end":
30842
- return _context4.stop();
30982
+ return _context6.stop();
30843
30983
  }
30844
30984
  }
30845
- }, _callee4, null, [[2, 20]]);
30985
+ }, _callee6, null, [[2, 20]]);
30846
30986
  })));
30847
30987
  var medicationsSlice = createSlice({
30848
30988
  name: "medicationsSlice",
@@ -30850,55 +30990,79 @@ var medicationsSlice = createSlice({
30850
30990
  save_medication: _objectSpread2({}, defaultState.Info),
30851
30991
  update_medication: _objectSpread2({}, defaultState.Info),
30852
30992
  update_workflow_status: _objectSpread2({}, defaultState.Info),
30853
- medication_list: _objectSpread2({}, defaultState.List)
30993
+ medication_list: _objectSpread2({}, defaultState.List),
30994
+ alert_codes: _objectSpread2({}, defaultState.list),
30995
+ drug_codes: _objectSpread2({}, defaultState.list)
30854
30996
  },
30855
- extraReducers: (_extraReducers$f = {}, _defineProperty(_extraReducers$f, SAVE_MEDICATIONS.fulfilled, function (state, action) {
30997
+ extraReducers: (_extraReducers$f = {}, _defineProperty(_extraReducers$f, ALERT_CODES.fulfilled, function (state, action) {
30856
30998
  var _action$payload;
30857
30999
 
30858
- state.save_medication.loading = false, state.save_medication.error = false, state.save_medication = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
31000
+ state.alert_codes.loading = false, state.alert_codes.error = false, state.alert_codes = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
31001
+ }), _defineProperty(_extraReducers$f, ALERT_CODES.pending, function (state, action) {
31002
+ state.alert_codes.error = false, state.alert_codes.loading = true;
31003
+ }), _defineProperty(_extraReducers$f, ALERT_CODES.rejected, function (state, action) {
31004
+ var _action$payload2;
31005
+
31006
+ state.alert_codes.loading = false, state.alert_codes.error = true, state.alert_codes = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
31007
+ }), _defineProperty(_extraReducers$f, DRUG_CODES.fulfilled, function (state, action) {
31008
+ var _action$payload3;
31009
+
31010
+ state.drug_codes.loading = false, state.drug_codes.error = false, state.drug_codes = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
31011
+ }), _defineProperty(_extraReducers$f, DRUG_CODES.pending, function (state, action) {
31012
+ state.drug_codes.error = false, state.drug_codes.loading = true;
31013
+ }), _defineProperty(_extraReducers$f, DRUG_CODES.rejected, function (state, action) {
31014
+ var _action$payload4;
31015
+
31016
+ state.drug_codes.loading = false, state.drug_codes.error = true, state.drug_codes = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
31017
+ }), _defineProperty(_extraReducers$f, SAVE_MEDICATIONS.fulfilled, function (state, action) {
31018
+ var _action$payload5;
31019
+
31020
+ state.save_medication.loading = false, state.save_medication.error = false, state.save_medication = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
30859
31021
  }), _defineProperty(_extraReducers$f, SAVE_MEDICATIONS.pending, function (state, action) {
30860
31022
  state.save_medication.error = false, state.save_medication.loading = true;
30861
31023
  }), _defineProperty(_extraReducers$f, SAVE_MEDICATIONS.rejected, function (state, action) {
30862
- var _action$payload2;
31024
+ var _action$payload6;
30863
31025
 
30864
- state.save_medication.loading = false, state.save_medication.error = true, state.save_medication = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
31026
+ state.save_medication.loading = false, state.save_medication.error = true, state.save_medication = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
30865
31027
  }), _defineProperty(_extraReducers$f, UPDATE_MEDICATIONS.fulfilled, function (state, action) {
30866
- var _action$payload3;
31028
+ var _action$payload7;
30867
31029
 
30868
- state.update_medication.loading = false, state.update_medication.error = false, state.update_medication = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
31030
+ state.update_medication.loading = false, state.update_medication.error = false, state.update_medication = (_action$payload7 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload7 !== void 0 ? _action$payload7 : {};
30869
31031
  }), _defineProperty(_extraReducers$f, UPDATE_MEDICATIONS.pending, function (state, action) {
30870
31032
  state.update_medication.error = false, state.update_medication.loading = true;
30871
31033
  }), _defineProperty(_extraReducers$f, UPDATE_MEDICATIONS.rejected, function (state, action) {
30872
- var _action$payload4;
31034
+ var _action$payload8;
30873
31035
 
30874
- state.update_medication.loading = false, state.update_medication.error = true, state.update_medication = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
31036
+ state.update_medication.loading = false, state.update_medication.error = true, state.update_medication = (_action$payload8 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload8 !== void 0 ? _action$payload8 : {};
30875
31037
  }), _defineProperty(_extraReducers$f, GET_MEDICATIONS.fulfilled, function (state, action) {
30876
- var _action$payload5;
31038
+ var _action$payload9;
30877
31039
 
30878
- state.medication_list.loading = false, state.medication_list.error = false, state.medication_list = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
31040
+ state.medication_list.loading = false, state.medication_list.error = false, state.medication_list = (_action$payload9 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload9 !== void 0 ? _action$payload9 : {};
30879
31041
  }), _defineProperty(_extraReducers$f, GET_MEDICATIONS.pending, function (state, action) {
30880
31042
  state.medication_list.error = false, state.medication_list.loading = true;
30881
31043
  }), _defineProperty(_extraReducers$f, GET_MEDICATIONS.rejected, function (state, action) {
30882
- var _action$payload6;
31044
+ var _action$payload10;
30883
31045
 
30884
- state.medication_list.loading = false, state.medication_list.error = true, state.medication_list = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
31046
+ state.medication_list.loading = false, state.medication_list.error = true, state.medication_list = (_action$payload10 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload10 !== void 0 ? _action$payload10 : {};
30885
31047
  }), _defineProperty(_extraReducers$f, UPDATE_ALL_WORKFLOW_STATUS.fulfilled, function (state, action) {
30886
- var _action$payload7;
31048
+ var _action$payload11;
30887
31049
 
30888
- state.update_workflow_status.loading = false, state.update_workflow_status.error = false, state.update_workflow_status = (_action$payload7 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload7 !== void 0 ? _action$payload7 : {};
31050
+ state.update_workflow_status.loading = false, state.update_workflow_status.error = false, state.update_workflow_status = (_action$payload11 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload11 !== void 0 ? _action$payload11 : {};
30889
31051
  }), _defineProperty(_extraReducers$f, UPDATE_ALL_WORKFLOW_STATUS.pending, function (state, action) {
30890
31052
  state.update_workflow_status.error = false, state.update_workflow_status.loading = true;
30891
31053
  }), _defineProperty(_extraReducers$f, UPDATE_ALL_WORKFLOW_STATUS.rejected, function (state, action) {
30892
- var _action$payload8;
31054
+ var _action$payload12;
30893
31055
 
30894
- state.update_workflow_status.loading = false, state.update_workflow_status.error = true, state.update_workflow_status = (_action$payload8 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload8 !== void 0 ? _action$payload8 : {};
31056
+ state.update_workflow_status.loading = false, state.update_workflow_status.error = true, state.update_workflow_status = (_action$payload12 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload12 !== void 0 ? _action$payload12 : {};
30895
31057
  }), _extraReducers$f)
30896
31058
  });
30897
31059
  var medicationsActions = {
30898
31060
  SAVE_MEDICATIONS: SAVE_MEDICATIONS,
30899
31061
  GET_MEDICATIONS: GET_MEDICATIONS,
30900
31062
  UPDATE_MEDICATIONS: UPDATE_MEDICATIONS,
30901
- UPDATE_ALL_WORKFLOW_STATUS: UPDATE_ALL_WORKFLOW_STATUS
31063
+ UPDATE_ALL_WORKFLOW_STATUS: UPDATE_ALL_WORKFLOW_STATUS,
31064
+ ALERT_CODES: ALERT_CODES,
31065
+ DRUG_CODES: DRUG_CODES
30902
31066
  };
30903
31067
  var medicationsSlice$1 = medicationsSlice.reducer;
30904
31068
 
@@ -30933,7 +31097,7 @@ var queries$4 = {
30933
31097
  db_name: "primarycare",
30934
31098
  entity: "CA_OrderLine",
30935
31099
  filter: "CA_OrderLine.encounter_Id==\"".concat(encounter_id, "\" && CA_OrderLine.Oltype=='TREAT' && CA_OrderLine.parentOrderId=='' && CA_OrderLine.activestatus==true"),
30936
- return_fields: "MERGE(CA_OrderLine,{childRecurrent:(for doc in CA_OrderLine_CA_OrderLine_E filter doc._to == CA_OrderLine._id RETURN MERGE(DOCUMENT(doc._from),{Requestor:(for req in TO_ARRAY(DOCUMENT(doc._from).Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})),org_Id:DOCUMENT(CA_OrderLine.org_Id),Requestor:(for req in TO_ARRAY(CA_OrderLine.Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})"
31100
+ return_fields: "MERGE(CA_OrderLine,{childRecurrent:(for doc in CA_OrderLine_CA_OrderLine_E filter doc._to == CA_OrderLine._id RETURN MERGE(DOCUMENT(doc._from),{Requestor:(for req in TO_ARRAY(DOCUMENT(doc._from).Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {practitioner_id: prac.practitioner_id, id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})),org_Id:DOCUMENT(CA_OrderLine.org_Id),Requestor:(for req in TO_ARRAY(CA_OrderLine.Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {practitioner_id: prac.practitioner_id, id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})"
30937
31101
  };
30938
31102
  },
30939
31103
  treatment_delete: function treatment_delete(id) {
@@ -31213,7 +31377,7 @@ var generateJSON$1 = function generateJSON(dataList) {
31213
31377
 
31214
31378
  var generateResJson$2 = function generateResJson(dataList, arr) {
31215
31379
  var list = dataList.map(function (val) {
31216
- var _val$diagnosis, _val$performer, _val$recurrent, _val$recurrent$, _val$priority, _val$OrderNature, _moment$unix$format, _val$recurrent2, _val$recurrent2$, _moment$unix$format2, _val$recurrent3, _val$recurrent3$, _JSON$stringify, _val$recurrent4, _val$recurrent4$, _val$recurrent$0$ever, _val$recurrent5, _val$recurrent5$, _val$recurrent$0$ever2, _val$recurrent6, _val$recurrent6$, _moment$unix$format3, _val$recurrent7, _val$recurrent7$, _JSON$stringify2, _val$recurrent8, _val$recurrent8$, _val$recurrent9, _val$recurrent9$, _moment$unix$format4, _val$recurrent10, _val$recurrent10$, _moment$unix$format5, _val$Requestor, _val$Requestor$, _val$Requestor$$organ, _val$Requestor2, _val$Requestor2$, _val$Requestor2$$orga, _val$Requestor3, _val$Requestor3$, _val$Requestor3$$orga, _val$Requestor$0$prac, _val$Requestor4, _val$Requestor4$, _val$Requestor4$$prac, _val$Requestor$0$prac2, _val$Requestor5, _val$Requestor5$, _val$Requestor5$$prac, _val$Requestor6, _val$Requestor6$, _val$Requestor6$$prac, _val$Requestor7, _val$Requestor7$, _val$Requestor7$$prac, _val$Requestor8, _val$Requestor8$, _val$Requestor8$$prac, _val$Requestor8$$prac2, _val$Requestor8$$prac3, _val$Requestor9, _val$Requestor9$, _val$Requestor9$$prac, _val$Requestor9$$prac2, _val$Requestor10, _val$Requestor10$, _val$Requestor10$$pra, _val$Requestor10$$pra2, _val$Requestor10$$pra3, _val$patientInstructi, _val$patientInstructi2, _val$patientInstructi3, _val$patientInstructi4, _val$patientInstructi5, _val$patientInstructi6, _val$patientInstructi7, _val$patientInstructi8, _val$preparatoryInstr, _val$preparatoryInstr2, _val$preparatoryInstr3, _val$preparatoryInstr4, _val$preparatoryInstr5, _val$preparatoryInstr6, _val$preparatoryInstr7, _val$preparatoryInstr8, _val$departmentalInst, _val$departmentalInst2, _val$departmentalInst3, _val$departmentalInst4, _val$departmentalInst5, _val$departmentalInst6, _val$departmentalInst7, _val$departmentalInst8, _val$attribute, _val$attribute$, _val$attribute2, _val$attribute2$, _val$attribute$0$bedS, _val$attribute3, _val$attribute3$, _val$attribute$0$cont, _val$attribute4, _val$attribute4$, _val$createddate, _val$changeStatus, _val$changeStatus2, _val$changeStatus3, _val$statushistory, _val$statusreason, _val$accessionNum;
31380
+ var _val$diagnosis, _val$performer, _val$recurrent, _val$recurrent$, _val$priority, _val$OrderNature, _moment$unix$format, _val$recurrent2, _val$recurrent2$, _moment$unix$format2, _val$recurrent3, _val$recurrent3$, _JSON$stringify, _val$recurrent4, _val$recurrent4$, _val$recurrent$0$ever, _val$recurrent5, _val$recurrent5$, _val$recurrent$0$ever2, _val$recurrent6, _val$recurrent6$, _moment$unix$format3, _val$recurrent7, _val$recurrent7$, _JSON$stringify2, _val$recurrent8, _val$recurrent8$, _val$recurrent9, _val$recurrent9$, _moment$unix$format4, _val$recurrent10, _val$recurrent10$, _moment$unix$format5, _val$Requestor, _val$Requestor$, _val$Requestor$$organ, _val$Requestor2, _val$Requestor2$, _val$Requestor2$$orga, _val$Requestor3, _val$Requestor3$, _val$Requestor3$$orga, _val$Requestor$0$prac, _val$Requestor4, _val$Requestor4$, _val$Requestor4$$prac, _val$Requestor$0$prac2, _val$Requestor5, _val$Requestor5$, _val$Requestor5$$prac, _val$Requestor6, _val$Requestor6$, _val$Requestor6$$prac, _val$Requestor7, _val$Requestor7$, _val$Requestor7$$prac, _val$Requestor8, _val$Requestor8$, _val$Requestor8$$prac, _val$Requestor8$$prac2, _val$Requestor8$$prac3, _val$Requestor9, _val$Requestor9$, _val$Requestor9$$prac, _val$Requestor9$$prac2, _val$Requestor10, _val$Requestor10$, _val$Requestor10$$pra, _val$Requestor10$$pra2, _val$Requestor11, _val$Requestor11$, _val$Requestor11$$pra, _val$Requestor11$$pra2, _val$Requestor11$$pra3, _val$patientInstructi, _val$patientInstructi2, _val$patientInstructi3, _val$patientInstructi4, _val$patientInstructi5, _val$patientInstructi6, _val$patientInstructi7, _val$patientInstructi8, _val$preparatoryInstr, _val$preparatoryInstr2, _val$preparatoryInstr3, _val$preparatoryInstr4, _val$preparatoryInstr5, _val$preparatoryInstr6, _val$preparatoryInstr7, _val$preparatoryInstr8, _val$departmentalInst, _val$departmentalInst2, _val$departmentalInst3, _val$departmentalInst4, _val$departmentalInst5, _val$departmentalInst6, _val$departmentalInst7, _val$departmentalInst8, _val$attribute, _val$attribute$, _val$attribute2, _val$attribute2$, _val$attribute$0$bedS, _val$attribute3, _val$attribute3$, _val$attribute$0$cont, _val$attribute4, _val$attribute4$, _val$createddate, _val$changeStatus, _val$changeStatus2, _val$changeStatus3, _val$statushistory, _val$statusreason, _val$accessionNum;
31217
31381
 
31218
31382
  var diagnosisData = val === null || val === void 0 ? void 0 : (_val$diagnosis = val.diagnosis) === null || _val$diagnosis === void 0 ? void 0 : _val$diagnosis.map(function (v) {
31219
31383
  return {
@@ -31309,8 +31473,9 @@ var generateResJson$2 = function generateResJson(dataList, arr) {
31309
31473
  },
31310
31474
  practitionerId: val === null || val === void 0 ? void 0 : (_val$Requestor8 = val.Requestor) === null || _val$Requestor8 === void 0 ? void 0 : (_val$Requestor8$ = _val$Requestor8[0]) === null || _val$Requestor8$ === void 0 ? void 0 : (_val$Requestor8$$prac = _val$Requestor8$.practId) === null || _val$Requestor8$$prac === void 0 ? void 0 : (_val$Requestor8$$prac2 = _val$Requestor8$$prac[0]) === null || _val$Requestor8$$prac2 === void 0 ? void 0 : (_val$Requestor8$$prac3 = _val$Requestor8$$prac2.name) === null || _val$Requestor8$$prac3 === void 0 ? void 0 : _val$Requestor8$$prac3[0],
31311
31475
  orderBy: {
31312
- value: val === null || val === void 0 ? void 0 : (_val$Requestor9 = val.Requestor) === null || _val$Requestor9 === void 0 ? void 0 : (_val$Requestor9$ = _val$Requestor9[0]) === null || _val$Requestor9$ === void 0 ? void 0 : (_val$Requestor9$$prac = _val$Requestor9$.practId) === null || _val$Requestor9$$prac === void 0 ? void 0 : (_val$Requestor9$$prac2 = _val$Requestor9$$prac[0]) === null || _val$Requestor9$$prac2 === void 0 ? void 0 : _val$Requestor9$$prac2.id,
31313
- label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor10 = val.Requestor) === null || _val$Requestor10 === void 0 ? void 0 : (_val$Requestor10$ = _val$Requestor10[0]) === null || _val$Requestor10$ === void 0 ? void 0 : (_val$Requestor10$$pra = _val$Requestor10$.practId) === null || _val$Requestor10$$pra === void 0 ? void 0 : (_val$Requestor10$$pra2 = _val$Requestor10$$pra[0]) === null || _val$Requestor10$$pra2 === void 0 ? void 0 : (_val$Requestor10$$pra3 = _val$Requestor10$$pra2.name) === null || _val$Requestor10$$pra3 === void 0 ? void 0 : _val$Requestor10$$pra3[0]) || {})
31476
+ practitioner_id: val === null || val === void 0 ? void 0 : (_val$Requestor9 = val.Requestor) === null || _val$Requestor9 === void 0 ? void 0 : (_val$Requestor9$ = _val$Requestor9[0]) === null || _val$Requestor9$ === void 0 ? void 0 : (_val$Requestor9$$prac = _val$Requestor9$.practId) === null || _val$Requestor9$$prac === void 0 ? void 0 : (_val$Requestor9$$prac2 = _val$Requestor9$$prac[0]) === null || _val$Requestor9$$prac2 === void 0 ? void 0 : _val$Requestor9$$prac2.practitioner_id,
31477
+ value: val === null || val === void 0 ? void 0 : (_val$Requestor10 = val.Requestor) === null || _val$Requestor10 === void 0 ? void 0 : (_val$Requestor10$ = _val$Requestor10[0]) === null || _val$Requestor10$ === void 0 ? void 0 : (_val$Requestor10$$pra = _val$Requestor10$.practId) === null || _val$Requestor10$$pra === void 0 ? void 0 : (_val$Requestor10$$pra2 = _val$Requestor10$$pra[0]) === null || _val$Requestor10$$pra2 === void 0 ? void 0 : _val$Requestor10$$pra2.id,
31478
+ label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor11 = val.Requestor) === null || _val$Requestor11 === void 0 ? void 0 : (_val$Requestor11$ = _val$Requestor11[0]) === null || _val$Requestor11$ === void 0 ? void 0 : (_val$Requestor11$$pra = _val$Requestor11$.practId) === null || _val$Requestor11$$pra === void 0 ? void 0 : (_val$Requestor11$$pra2 = _val$Requestor11$$pra[0]) === null || _val$Requestor11$$pra2 === void 0 ? void 0 : (_val$Requestor11$$pra3 = _val$Requestor11$$pra2.name) === null || _val$Requestor11$$pra3 === void 0 ? void 0 : _val$Requestor11$$pra3[0]) || {})
31314
31479
  }
31315
31480
  },
31316
31481
  indication: {
@@ -31366,7 +31531,7 @@ var RecurrentgenerateResJson$1 = function RecurrentgenerateResJson(dataList, arr
31366
31531
  return el != null;
31367
31532
  });
31368
31533
  var list = dataList.map(function (val) {
31369
- var _val$diagnosis2, _val$performer2, _val$recurrent11, _val$recurrent11$, _val$priority2, _val$OrderNature2, _moment$unix$format6, _JSON$stringify3, _val$recurrent12, _val$recurrent12$, _val$recurrent$0$ever3, _val$recurrent13, _val$recurrent13$, _val$recurrent$0$ever4, _val$recurrent14, _val$recurrent14$, _moment$unix$format7, _val$recurrent15, _val$recurrent15$, _JSON$stringify4, _val$recurrent16, _val$recurrent16$, _val$recurrent17, _val$recurrent17$, _moment$unix$format8, _val$recurrent18, _val$recurrent18$, _moment$unix$format9, _val$Requestor11, _val$Requestor11$, _val$Requestor11$$org, _val$Requestor12, _val$Requestor12$, _val$Requestor12$$org, _val$Requestor13, _val$Requestor13$, _val$Requestor13$$org, _val$Requestor$0$prac3, _val$Requestor14, _val$Requestor14$, _val$Requestor14$$pra, _val$Requestor$0$prac4, _val$Requestor15, _val$Requestor15$, _val$Requestor15$$pra, _val$Requestor16, _val$Requestor16$, _val$Requestor16$$pra, _val$Requestor17, _val$Requestor17$, _val$Requestor17$$pra, _val$Requestor18, _val$Requestor18$, _val$Requestor18$$pra, _val$Requestor18$$pra2, _val$Requestor18$$pra3, _val$Requestor19, _val$Requestor19$, _val$Requestor19$$pra, _val$Requestor19$$pra2, _val$Requestor20, _val$Requestor20$, _val$Requestor20$$pra, _val$Requestor20$$pra2, _val$Requestor20$$pra3, _val$patientInstructi9, _val$patientInstructi10, _val$patientInstructi11, _val$patientInstructi12, _val$patientInstructi13, _val$patientInstructi14, _val$patientInstructi15, _val$patientInstructi16, _val$preparatoryInstr9, _val$preparatoryInstr10, _val$preparatoryInstr11, _val$preparatoryInstr12, _val$preparatoryInstr13, _val$preparatoryInstr14, _val$preparatoryInstr15, _val$preparatoryInstr16, _val$departmentalInst9, _val$departmentalInst10, _val$departmentalInst11, _val$departmentalInst12, _val$departmentalInst13, _val$departmentalInst14, _val$departmentalInst15, _val$departmentalInst16, _val$attribute5, _val$attribute5$, _val$attribute6, _val$attribute6$, _val$attribute$0$bedS2, _val$attribute7, _val$attribute7$, _val$attribute$0$cont2, _val$attribute8, _val$attribute8$, _val$createddate2, _val$changeStatus4, _val$changeStatus5, _val$changeStatus6, _val$statushistory2, _val$statusreason2, _val$accessionNum2;
31534
+ var _val$diagnosis2, _val$performer2, _val$recurrent11, _val$recurrent11$, _val$priority2, _val$OrderNature2, _moment$unix$format6, _JSON$stringify3, _val$recurrent12, _val$recurrent12$, _val$recurrent$0$ever3, _val$recurrent13, _val$recurrent13$, _val$recurrent$0$ever4, _val$recurrent14, _val$recurrent14$, _moment$unix$format7, _val$recurrent15, _val$recurrent15$, _JSON$stringify4, _val$recurrent16, _val$recurrent16$, _val$recurrent17, _val$recurrent17$, _moment$unix$format8, _val$recurrent18, _val$recurrent18$, _moment$unix$format9, _val$Requestor12, _val$Requestor12$, _val$Requestor12$$org, _val$Requestor13, _val$Requestor13$, _val$Requestor13$$org, _val$Requestor14, _val$Requestor14$, _val$Requestor14$$org, _val$Requestor$0$prac3, _val$Requestor15, _val$Requestor15$, _val$Requestor15$$pra, _val$Requestor$0$prac4, _val$Requestor16, _val$Requestor16$, _val$Requestor16$$pra, _val$Requestor17, _val$Requestor17$, _val$Requestor17$$pra, _val$Requestor18, _val$Requestor18$, _val$Requestor18$$pra, _val$Requestor19, _val$Requestor19$, _val$Requestor19$$pra, _val$Requestor19$$pra2, _val$Requestor19$$pra3, _val$Requestor20, _val$Requestor20$, _val$Requestor20$$pra, _val$Requestor20$$pra2, _val$Requestor21, _val$Requestor21$, _val$Requestor21$$pra, _val$Requestor21$$pra2, _val$Requestor22, _val$Requestor22$, _val$Requestor22$$pra, _val$Requestor22$$pra2, _val$Requestor22$$pra3, _val$patientInstructi9, _val$patientInstructi10, _val$patientInstructi11, _val$patientInstructi12, _val$patientInstructi13, _val$patientInstructi14, _val$patientInstructi15, _val$patientInstructi16, _val$preparatoryInstr9, _val$preparatoryInstr10, _val$preparatoryInstr11, _val$preparatoryInstr12, _val$preparatoryInstr13, _val$preparatoryInstr14, _val$preparatoryInstr15, _val$preparatoryInstr16, _val$departmentalInst9, _val$departmentalInst10, _val$departmentalInst11, _val$departmentalInst12, _val$departmentalInst13, _val$departmentalInst14, _val$departmentalInst15, _val$departmentalInst16, _val$attribute5, _val$attribute5$, _val$attribute6, _val$attribute6$, _val$attribute$0$bedS2, _val$attribute7, _val$attribute7$, _val$attribute$0$cont2, _val$attribute8, _val$attribute8$, _val$createddate2, _val$changeStatus4, _val$changeStatus5, _val$changeStatus6, _val$statushistory2, _val$statusreason2, _val$accessionNum2;
31370
31535
 
31371
31536
  var diagnosisData = val === null || val === void 0 ? void 0 : (_val$diagnosis2 = val.diagnosis) === null || _val$diagnosis2 === void 0 ? void 0 : _val$diagnosis2.map(function (v) {
31372
31537
  return {
@@ -31445,20 +31610,21 @@ var RecurrentgenerateResJson$1 = function RecurrentgenerateResJson(dataList, arr
31445
31610
  qty: JSON.stringify(val === null || val === void 0 ? void 0 : val.orderQty),
31446
31611
  requestorDetails: {
31447
31612
  organization: {
31448
- label: val === null || val === void 0 ? void 0 : (_val$Requestor11 = val.Requestor) === null || _val$Requestor11 === void 0 ? void 0 : (_val$Requestor11$ = _val$Requestor11[0]) === null || _val$Requestor11$ === void 0 ? void 0 : (_val$Requestor11$$org = _val$Requestor11$.organization) === null || _val$Requestor11$$org === void 0 ? void 0 : _val$Requestor11$$org._id,
31449
- value: val === null || val === void 0 ? void 0 : (_val$Requestor12 = val.Requestor) === null || _val$Requestor12 === void 0 ? void 0 : (_val$Requestor12$ = _val$Requestor12[0]) === null || _val$Requestor12$ === void 0 ? void 0 : (_val$Requestor12$$org = _val$Requestor12$.organization) === null || _val$Requestor12$$org === void 0 ? void 0 : _val$Requestor12$$org.name,
31450
- id: val === null || val === void 0 ? void 0 : (_val$Requestor13 = val.Requestor) === null || _val$Requestor13 === void 0 ? void 0 : (_val$Requestor13$ = _val$Requestor13[0]) === null || _val$Requestor13$ === void 0 ? void 0 : (_val$Requestor13$$org = _val$Requestor13$.organization) === null || _val$Requestor13$$org === void 0 ? void 0 : _val$Requestor13$$org.id
31613
+ label: val === null || val === void 0 ? void 0 : (_val$Requestor12 = val.Requestor) === null || _val$Requestor12 === void 0 ? void 0 : (_val$Requestor12$ = _val$Requestor12[0]) === null || _val$Requestor12$ === void 0 ? void 0 : (_val$Requestor12$$org = _val$Requestor12$.organization) === null || _val$Requestor12$$org === void 0 ? void 0 : _val$Requestor12$$org._id,
31614
+ value: val === null || val === void 0 ? void 0 : (_val$Requestor13 = val.Requestor) === null || _val$Requestor13 === void 0 ? void 0 : (_val$Requestor13$ = _val$Requestor13[0]) === null || _val$Requestor13$ === void 0 ? void 0 : (_val$Requestor13$$org = _val$Requestor13$.organization) === null || _val$Requestor13$$org === void 0 ? void 0 : _val$Requestor13$$org.name,
31615
+ id: val === null || val === void 0 ? void 0 : (_val$Requestor14 = val.Requestor) === null || _val$Requestor14 === void 0 ? void 0 : (_val$Requestor14$ = _val$Requestor14[0]) === null || _val$Requestor14$ === void 0 ? void 0 : (_val$Requestor14$$org = _val$Requestor14$.organization) === null || _val$Requestor14$$org === void 0 ? void 0 : _val$Requestor14$$org.id
31451
31616
  },
31452
31617
  practitionerRole: {
31453
- label: (_val$Requestor$0$prac3 = val === null || val === void 0 ? void 0 : (_val$Requestor14 = val.Requestor) === null || _val$Requestor14 === void 0 ? void 0 : (_val$Requestor14$ = _val$Requestor14[0]) === null || _val$Requestor14$ === void 0 ? void 0 : (_val$Requestor14$$pra = _val$Requestor14$.practRole) === null || _val$Requestor14$$pra === void 0 ? void 0 : _val$Requestor14$$pra.display) !== null && _val$Requestor$0$prac3 !== void 0 ? _val$Requestor$0$prac3 : "",
31454
- value: (_val$Requestor$0$prac4 = val === null || val === void 0 ? void 0 : (_val$Requestor15 = val.Requestor) === null || _val$Requestor15 === void 0 ? void 0 : (_val$Requestor15$ = _val$Requestor15[0]) === null || _val$Requestor15$ === void 0 ? void 0 : (_val$Requestor15$$pra = _val$Requestor15$.practRole) === null || _val$Requestor15$$pra === void 0 ? void 0 : _val$Requestor15$$pra.display) !== null && _val$Requestor$0$prac4 !== void 0 ? _val$Requestor$0$prac4 : "",
31455
- id: val === null || val === void 0 ? void 0 : (_val$Requestor16 = val.Requestor) === null || _val$Requestor16 === void 0 ? void 0 : (_val$Requestor16$ = _val$Requestor16[0]) === null || _val$Requestor16$ === void 0 ? void 0 : (_val$Requestor16$$pra = _val$Requestor16$.practRole) === null || _val$Requestor16$$pra === void 0 ? void 0 : _val$Requestor16$$pra.id,
31456
- _id: val === null || val === void 0 ? void 0 : (_val$Requestor17 = val.Requestor) === null || _val$Requestor17 === void 0 ? void 0 : (_val$Requestor17$ = _val$Requestor17[0]) === null || _val$Requestor17$ === void 0 ? void 0 : (_val$Requestor17$$pra = _val$Requestor17$.practRole) === null || _val$Requestor17$$pra === void 0 ? void 0 : _val$Requestor17$$pra._id
31618
+ label: (_val$Requestor$0$prac3 = val === null || val === void 0 ? void 0 : (_val$Requestor15 = val.Requestor) === null || _val$Requestor15 === void 0 ? void 0 : (_val$Requestor15$ = _val$Requestor15[0]) === null || _val$Requestor15$ === void 0 ? void 0 : (_val$Requestor15$$pra = _val$Requestor15$.practRole) === null || _val$Requestor15$$pra === void 0 ? void 0 : _val$Requestor15$$pra.display) !== null && _val$Requestor$0$prac3 !== void 0 ? _val$Requestor$0$prac3 : "",
31619
+ value: (_val$Requestor$0$prac4 = val === null || val === void 0 ? void 0 : (_val$Requestor16 = val.Requestor) === null || _val$Requestor16 === void 0 ? void 0 : (_val$Requestor16$ = _val$Requestor16[0]) === null || _val$Requestor16$ === void 0 ? void 0 : (_val$Requestor16$$pra = _val$Requestor16$.practRole) === null || _val$Requestor16$$pra === void 0 ? void 0 : _val$Requestor16$$pra.display) !== null && _val$Requestor$0$prac4 !== void 0 ? _val$Requestor$0$prac4 : "",
31620
+ id: val === null || val === void 0 ? void 0 : (_val$Requestor17 = val.Requestor) === null || _val$Requestor17 === void 0 ? void 0 : (_val$Requestor17$ = _val$Requestor17[0]) === null || _val$Requestor17$ === void 0 ? void 0 : (_val$Requestor17$$pra = _val$Requestor17$.practRole) === null || _val$Requestor17$$pra === void 0 ? void 0 : _val$Requestor17$$pra.id,
31621
+ _id: val === null || val === void 0 ? void 0 : (_val$Requestor18 = val.Requestor) === null || _val$Requestor18 === void 0 ? void 0 : (_val$Requestor18$ = _val$Requestor18[0]) === null || _val$Requestor18$ === void 0 ? void 0 : (_val$Requestor18$$pra = _val$Requestor18$.practRole) === null || _val$Requestor18$$pra === void 0 ? void 0 : _val$Requestor18$$pra._id
31457
31622
  },
31458
- practitionerId: val === null || val === void 0 ? void 0 : (_val$Requestor18 = val.Requestor) === null || _val$Requestor18 === void 0 ? void 0 : (_val$Requestor18$ = _val$Requestor18[0]) === null || _val$Requestor18$ === void 0 ? void 0 : (_val$Requestor18$$pra = _val$Requestor18$.practId) === null || _val$Requestor18$$pra === void 0 ? void 0 : (_val$Requestor18$$pra2 = _val$Requestor18$$pra[0]) === null || _val$Requestor18$$pra2 === void 0 ? void 0 : (_val$Requestor18$$pra3 = _val$Requestor18$$pra2.name) === null || _val$Requestor18$$pra3 === void 0 ? void 0 : _val$Requestor18$$pra3[0],
31623
+ practitionerId: val === null || val === void 0 ? void 0 : (_val$Requestor19 = val.Requestor) === null || _val$Requestor19 === void 0 ? void 0 : (_val$Requestor19$ = _val$Requestor19[0]) === null || _val$Requestor19$ === void 0 ? void 0 : (_val$Requestor19$$pra = _val$Requestor19$.practId) === null || _val$Requestor19$$pra === void 0 ? void 0 : (_val$Requestor19$$pra2 = _val$Requestor19$$pra[0]) === null || _val$Requestor19$$pra2 === void 0 ? void 0 : (_val$Requestor19$$pra3 = _val$Requestor19$$pra2.name) === null || _val$Requestor19$$pra3 === void 0 ? void 0 : _val$Requestor19$$pra3[0],
31459
31624
  orderBy: {
31460
- value: val === null || val === void 0 ? void 0 : (_val$Requestor19 = val.Requestor) === null || _val$Requestor19 === void 0 ? void 0 : (_val$Requestor19$ = _val$Requestor19[0]) === null || _val$Requestor19$ === void 0 ? void 0 : (_val$Requestor19$$pra = _val$Requestor19$.practId) === null || _val$Requestor19$$pra === void 0 ? void 0 : (_val$Requestor19$$pra2 = _val$Requestor19$$pra[0]) === null || _val$Requestor19$$pra2 === void 0 ? void 0 : _val$Requestor19$$pra2.id,
31461
- label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor20 = val.Requestor) === null || _val$Requestor20 === void 0 ? void 0 : (_val$Requestor20$ = _val$Requestor20[0]) === null || _val$Requestor20$ === void 0 ? void 0 : (_val$Requestor20$$pra = _val$Requestor20$.practId) === null || _val$Requestor20$$pra === void 0 ? void 0 : (_val$Requestor20$$pra2 = _val$Requestor20$$pra[0]) === null || _val$Requestor20$$pra2 === void 0 ? void 0 : (_val$Requestor20$$pra3 = _val$Requestor20$$pra2.name) === null || _val$Requestor20$$pra3 === void 0 ? void 0 : _val$Requestor20$$pra3[0]) || {})
31625
+ practitioner_id: val === null || val === void 0 ? void 0 : (_val$Requestor20 = val.Requestor) === null || _val$Requestor20 === void 0 ? void 0 : (_val$Requestor20$ = _val$Requestor20[0]) === null || _val$Requestor20$ === void 0 ? void 0 : (_val$Requestor20$$pra = _val$Requestor20$.practId) === null || _val$Requestor20$$pra === void 0 ? void 0 : (_val$Requestor20$$pra2 = _val$Requestor20$$pra[0]) === null || _val$Requestor20$$pra2 === void 0 ? void 0 : _val$Requestor20$$pra2.practitioner_id,
31626
+ value: val === null || val === void 0 ? void 0 : (_val$Requestor21 = val.Requestor) === null || _val$Requestor21 === void 0 ? void 0 : (_val$Requestor21$ = _val$Requestor21[0]) === null || _val$Requestor21$ === void 0 ? void 0 : (_val$Requestor21$$pra = _val$Requestor21$.practId) === null || _val$Requestor21$$pra === void 0 ? void 0 : (_val$Requestor21$$pra2 = _val$Requestor21$$pra[0]) === null || _val$Requestor21$$pra2 === void 0 ? void 0 : _val$Requestor21$$pra2.id,
31627
+ label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor22 = val.Requestor) === null || _val$Requestor22 === void 0 ? void 0 : (_val$Requestor22$ = _val$Requestor22[0]) === null || _val$Requestor22$ === void 0 ? void 0 : (_val$Requestor22$$pra = _val$Requestor22$.practId) === null || _val$Requestor22$$pra === void 0 ? void 0 : (_val$Requestor22$$pra2 = _val$Requestor22$$pra[0]) === null || _val$Requestor22$$pra2 === void 0 ? void 0 : (_val$Requestor22$$pra3 = _val$Requestor22$$pra2.name) === null || _val$Requestor22$$pra3 === void 0 ? void 0 : _val$Requestor22$$pra3[0]) || {})
31462
31628
  }
31463
31629
  },
31464
31630
  indication: {
@@ -32296,12 +32462,13 @@ var TREATMENT_ORGANIZATION = createAsyncThunk("TreatmentSlice/getorderorganizati
32296
32462
  data3 = _context14.sent;
32297
32463
  arr3 = [];
32298
32464
  data3 === null || data3 === void 0 ? void 0 : (_data3$result = data3.result) === null || _data3$result === void 0 ? void 0 : _data3$result.map(function (val) {
32299
- var _val$shortdesc4, _val$shortdesc5, _val$_id6;
32465
+ var _val$shortdesc4, _val$shortdesc5, _val$_id6, _val$locationID;
32300
32466
 
32301
32467
  arr3.push({
32302
32468
  label: (_val$shortdesc4 = val === null || val === void 0 ? void 0 : val.shortdesc) !== null && _val$shortdesc4 !== void 0 ? _val$shortdesc4 : "",
32303
32469
  value: (_val$shortdesc5 = val === null || val === void 0 ? void 0 : val.shortdesc) !== null && _val$shortdesc5 !== void 0 ? _val$shortdesc5 : "",
32304
- id: (_val$_id6 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id6 !== void 0 ? _val$_id6 : ""
32470
+ id: (_val$_id6 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id6 !== void 0 ? _val$_id6 : "",
32471
+ locationID: (_val$locationID = val === null || val === void 0 ? void 0 : val.locationID) !== null && _val$locationID !== void 0 ? _val$locationID : ""
32305
32472
  });
32306
32473
  });
32307
32474
  _context14.next = 26;
@@ -32845,7 +33012,7 @@ var queries$3 = (_queries = {
32845
33012
  db_name: "primarycare",
32846
33013
  entity: "CA_OrderLine",
32847
33014
  filter: "CA_OrderLine.encounter_Id==\"".concat(encounter_id, "\" && CA_OrderLine.Oltype=='RAD' && CA_OrderLine.parentOrderId=='' && CA_OrderLine.activestatus==true"),
32848
- return_fields: "MERGE(CA_OrderLine,{childRecurrent:(for doc in CA_OrderLine_CA_OrderLine_E filter doc._to == CA_OrderLine._id RETURN MERGE(DOCUMENT(doc._from),{Requestor:(for req in TO_ARRAY(DOCUMENT(doc._from).Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})),org_Id:DOCUMENT(CA_OrderLine.org_Id),Requestor:(for req in TO_ARRAY(CA_OrderLine.Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})"
33015
+ return_fields: "MERGE(CA_OrderLine,{childRecurrent:(for doc in CA_OrderLine_CA_OrderLine_E filter doc._to == CA_OrderLine._id RETURN MERGE(DOCUMENT(doc._from),{Requestor:(for req in TO_ARRAY(DOCUMENT(doc._from).Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {practitioner_id: prac.practitioner_id, id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})),org_Id:DOCUMENT(CA_OrderLine.org_Id),Requestor:(for req in TO_ARRAY(CA_OrderLine.Requestor) return merge(req,{organization:(document(req.organization)),practId:(for prac in Practitioner filter prac._id==req.practId return {practitioner_id: prac.practitioner_id, id:prac._id,name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)[*].display),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)[*].display),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding)[*].display)}))}),practRole:document(req.practRole)}))})"
32849
33016
  };
32850
33017
  },
32851
33018
  treatment_delete: function treatment_delete(id) {
@@ -33127,7 +33294,7 @@ var generateJSON = function generateJSON(dataList) {
33127
33294
 
33128
33295
  var generateResJson$1 = function generateResJson(dataList, arr) {
33129
33296
  var list = dataList.map(function (val) {
33130
- var _val$diagnosis, _val$performer, _val$recurrent, _val$recurrent$, _val$priority, _val$OrderNature, _moment$unix$format, _val$recurrent2, _val$recurrent2$, _moment$unix$format2, _val$recurrent3, _val$recurrent3$, _JSON$stringify, _val$recurrent4, _val$recurrent4$, _val$recurrent$0$ever, _val$recurrent5, _val$recurrent5$, _val$recurrent$0$ever2, _val$recurrent6, _val$recurrent6$, _moment$unix$format3, _val$recurrent7, _val$recurrent7$, _JSON$stringify2, _val$recurrent8, _val$recurrent8$, _val$recurrent9, _val$recurrent9$, _moment$unix$format4, _val$recurrent10, _val$recurrent10$, _moment$unix$format5, _val$Requestor, _val$Requestor$, _val$Requestor$$organ, _val$Requestor2, _val$Requestor2$, _val$Requestor2$$orga, _val$Requestor3, _val$Requestor3$, _val$Requestor3$$orga, _val$Requestor$0$prac, _val$Requestor4, _val$Requestor4$, _val$Requestor4$$prac, _val$Requestor$0$prac2, _val$Requestor5, _val$Requestor5$, _val$Requestor5$$prac, _val$Requestor6, _val$Requestor6$, _val$Requestor6$$prac, _val$Requestor7, _val$Requestor7$, _val$Requestor7$$prac, _val$Requestor8, _val$Requestor8$, _val$Requestor8$$prac, _val$Requestor8$$prac2, _val$Requestor8$$prac3, _val$Requestor9, _val$Requestor9$, _val$Requestor9$$prac, _val$Requestor9$$prac2, _val$Requestor10, _val$Requestor10$, _val$Requestor10$$pra, _val$Requestor10$$pra2, _val$Requestor10$$pra3, _val$patientInstructi, _val$patientInstructi2, _val$patientInstructi3, _val$patientInstructi4, _val$patientInstructi5, _val$patientInstructi6, _val$patientInstructi7, _val$patientInstructi8, _val$preparatoryInstr, _val$preparatoryInstr2, _val$preparatoryInstr3, _val$preparatoryInstr4, _val$preparatoryInstr5, _val$preparatoryInstr6, _val$preparatoryInstr7, _val$preparatoryInstr8, _val$departmentalInst, _val$departmentalInst2, _val$departmentalInst3, _val$departmentalInst4, _val$departmentalInst5, _val$departmentalInst6, _val$departmentalInst7, _val$departmentalInst8, _val$attribute, _val$attribute$, _val$attribute2, _val$attribute2$, _val$attribute$0$bedS, _val$attribute3, _val$attribute3$, _val$attribute$0$cont, _val$attribute4, _val$attribute4$, _val$createddate, _val$changeStatus, _val$changeStatus2, _val$changeStatus3, _val$statushistory, _val$statusreason, _val$accessionNum;
33297
+ var _val$diagnosis, _val$performer, _val$recurrent, _val$recurrent$, _val$priority, _val$OrderNature, _moment$unix$format, _val$recurrent2, _val$recurrent2$, _moment$unix$format2, _val$recurrent3, _val$recurrent3$, _JSON$stringify, _val$recurrent4, _val$recurrent4$, _val$recurrent$0$ever, _val$recurrent5, _val$recurrent5$, _val$recurrent$0$ever2, _val$recurrent6, _val$recurrent6$, _moment$unix$format3, _val$recurrent7, _val$recurrent7$, _JSON$stringify2, _val$recurrent8, _val$recurrent8$, _val$recurrent9, _val$recurrent9$, _moment$unix$format4, _val$recurrent10, _val$recurrent10$, _moment$unix$format5, _val$Requestor, _val$Requestor$, _val$Requestor$$organ, _val$Requestor2, _val$Requestor2$, _val$Requestor2$$orga, _val$Requestor3, _val$Requestor3$, _val$Requestor3$$orga, _val$Requestor$0$prac, _val$Requestor4, _val$Requestor4$, _val$Requestor4$$prac, _val$Requestor$0$prac2, _val$Requestor5, _val$Requestor5$, _val$Requestor5$$prac, _val$Requestor6, _val$Requestor6$, _val$Requestor6$$prac, _val$Requestor7, _val$Requestor7$, _val$Requestor7$$prac, _val$Requestor8, _val$Requestor8$, _val$Requestor8$$prac, _val$Requestor8$$prac2, _val$Requestor8$$prac3, _val$Requestor9, _val$Requestor9$, _val$Requestor9$$prac, _val$Requestor9$$prac2, _val$Requestor10, _val$Requestor10$, _val$Requestor10$$pra, _val$Requestor10$$pra2, _val$Requestor11, _val$Requestor11$, _val$Requestor11$$pra, _val$Requestor11$$pra2, _val$Requestor11$$pra3, _val$patientInstructi, _val$patientInstructi2, _val$patientInstructi3, _val$patientInstructi4, _val$patientInstructi5, _val$patientInstructi6, _val$patientInstructi7, _val$patientInstructi8, _val$preparatoryInstr, _val$preparatoryInstr2, _val$preparatoryInstr3, _val$preparatoryInstr4, _val$preparatoryInstr5, _val$preparatoryInstr6, _val$preparatoryInstr7, _val$preparatoryInstr8, _val$departmentalInst, _val$departmentalInst2, _val$departmentalInst3, _val$departmentalInst4, _val$departmentalInst5, _val$departmentalInst6, _val$departmentalInst7, _val$departmentalInst8, _val$attribute, _val$attribute$, _val$attribute2, _val$attribute2$, _val$attribute$0$bedS, _val$attribute3, _val$attribute3$, _val$attribute$0$cont, _val$attribute4, _val$attribute4$, _val$createddate, _val$changeStatus, _val$changeStatus2, _val$changeStatus3, _val$statushistory, _val$statusreason, _val$accessionNum;
33131
33298
 
33132
33299
  var diagnosisData = val === null || val === void 0 ? void 0 : (_val$diagnosis = val.diagnosis) === null || _val$diagnosis === void 0 ? void 0 : _val$diagnosis.map(function (v) {
33133
33300
  return {
@@ -33223,8 +33390,9 @@ var generateResJson$1 = function generateResJson(dataList, arr) {
33223
33390
  },
33224
33391
  practitionerId: val === null || val === void 0 ? void 0 : (_val$Requestor8 = val.Requestor) === null || _val$Requestor8 === void 0 ? void 0 : (_val$Requestor8$ = _val$Requestor8[0]) === null || _val$Requestor8$ === void 0 ? void 0 : (_val$Requestor8$$prac = _val$Requestor8$.practId) === null || _val$Requestor8$$prac === void 0 ? void 0 : (_val$Requestor8$$prac2 = _val$Requestor8$$prac[0]) === null || _val$Requestor8$$prac2 === void 0 ? void 0 : (_val$Requestor8$$prac3 = _val$Requestor8$$prac2.name) === null || _val$Requestor8$$prac3 === void 0 ? void 0 : _val$Requestor8$$prac3[0],
33225
33392
  orderBy: {
33226
- value: val === null || val === void 0 ? void 0 : (_val$Requestor9 = val.Requestor) === null || _val$Requestor9 === void 0 ? void 0 : (_val$Requestor9$ = _val$Requestor9[0]) === null || _val$Requestor9$ === void 0 ? void 0 : (_val$Requestor9$$prac = _val$Requestor9$.practId) === null || _val$Requestor9$$prac === void 0 ? void 0 : (_val$Requestor9$$prac2 = _val$Requestor9$$prac[0]) === null || _val$Requestor9$$prac2 === void 0 ? void 0 : _val$Requestor9$$prac2.id,
33227
- label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor10 = val.Requestor) === null || _val$Requestor10 === void 0 ? void 0 : (_val$Requestor10$ = _val$Requestor10[0]) === null || _val$Requestor10$ === void 0 ? void 0 : (_val$Requestor10$$pra = _val$Requestor10$.practId) === null || _val$Requestor10$$pra === void 0 ? void 0 : (_val$Requestor10$$pra2 = _val$Requestor10$$pra[0]) === null || _val$Requestor10$$pra2 === void 0 ? void 0 : (_val$Requestor10$$pra3 = _val$Requestor10$$pra2.name) === null || _val$Requestor10$$pra3 === void 0 ? void 0 : _val$Requestor10$$pra3[0]) || {})
33393
+ practitioner_id: val === null || val === void 0 ? void 0 : (_val$Requestor9 = val.Requestor) === null || _val$Requestor9 === void 0 ? void 0 : (_val$Requestor9$ = _val$Requestor9[0]) === null || _val$Requestor9$ === void 0 ? void 0 : (_val$Requestor9$$prac = _val$Requestor9$.practId) === null || _val$Requestor9$$prac === void 0 ? void 0 : (_val$Requestor9$$prac2 = _val$Requestor9$$prac[0]) === null || _val$Requestor9$$prac2 === void 0 ? void 0 : _val$Requestor9$$prac2.practitioner_id,
33394
+ value: val === null || val === void 0 ? void 0 : (_val$Requestor10 = val.Requestor) === null || _val$Requestor10 === void 0 ? void 0 : (_val$Requestor10$ = _val$Requestor10[0]) === null || _val$Requestor10$ === void 0 ? void 0 : (_val$Requestor10$$pra = _val$Requestor10$.practId) === null || _val$Requestor10$$pra === void 0 ? void 0 : (_val$Requestor10$$pra2 = _val$Requestor10$$pra[0]) === null || _val$Requestor10$$pra2 === void 0 ? void 0 : _val$Requestor10$$pra2.id,
33395
+ label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor11 = val.Requestor) === null || _val$Requestor11 === void 0 ? void 0 : (_val$Requestor11$ = _val$Requestor11[0]) === null || _val$Requestor11$ === void 0 ? void 0 : (_val$Requestor11$$pra = _val$Requestor11$.practId) === null || _val$Requestor11$$pra === void 0 ? void 0 : (_val$Requestor11$$pra2 = _val$Requestor11$$pra[0]) === null || _val$Requestor11$$pra2 === void 0 ? void 0 : (_val$Requestor11$$pra3 = _val$Requestor11$$pra2.name) === null || _val$Requestor11$$pra3 === void 0 ? void 0 : _val$Requestor11$$pra3[0]) || {})
33228
33396
  }
33229
33397
  },
33230
33398
  indication: {
@@ -33280,7 +33448,7 @@ var RecurrentgenerateResJson = function RecurrentgenerateResJson(dataList, arr)
33280
33448
  return el != null;
33281
33449
  });
33282
33450
  var list = dataList.map(function (val) {
33283
- var _val$diagnosis2, _val$performer2, _val$recurrent11, _val$recurrent11$, _val$priority2, _val$OrderNature2, _moment$unix$format6, _JSON$stringify3, _val$recurrent12, _val$recurrent12$, _val$recurrent$0$ever3, _val$recurrent13, _val$recurrent13$, _val$recurrent$0$ever4, _val$recurrent14, _val$recurrent14$, _moment$unix$format7, _val$recurrent15, _val$recurrent15$, _JSON$stringify4, _val$recurrent16, _val$recurrent16$, _val$recurrent17, _val$recurrent17$, _moment$unix$format8, _val$recurrent18, _val$recurrent18$, _moment$unix$format9, _val$Requestor11, _val$Requestor11$, _val$Requestor11$$org, _val$Requestor12, _val$Requestor12$, _val$Requestor12$$org, _val$Requestor13, _val$Requestor13$, _val$Requestor13$$org, _val$Requestor$0$prac3, _val$Requestor14, _val$Requestor14$, _val$Requestor14$$pra, _val$Requestor$0$prac4, _val$Requestor15, _val$Requestor15$, _val$Requestor15$$pra, _val$Requestor16, _val$Requestor16$, _val$Requestor16$$pra, _val$Requestor17, _val$Requestor17$, _val$Requestor17$$pra, _val$Requestor18, _val$Requestor18$, _val$Requestor18$$pra, _val$Requestor18$$pra2, _val$Requestor18$$pra3, _val$Requestor19, _val$Requestor19$, _val$Requestor19$$pra, _val$Requestor19$$pra2, _val$Requestor20, _val$Requestor20$, _val$Requestor20$$pra, _val$Requestor20$$pra2, _val$Requestor20$$pra3, _val$patientInstructi9, _val$patientInstructi10, _val$patientInstructi11, _val$patientInstructi12, _val$patientInstructi13, _val$patientInstructi14, _val$patientInstructi15, _val$patientInstructi16, _val$preparatoryInstr9, _val$preparatoryInstr10, _val$preparatoryInstr11, _val$preparatoryInstr12, _val$preparatoryInstr13, _val$preparatoryInstr14, _val$preparatoryInstr15, _val$preparatoryInstr16, _val$departmentalInst9, _val$departmentalInst10, _val$departmentalInst11, _val$departmentalInst12, _val$departmentalInst13, _val$departmentalInst14, _val$departmentalInst15, _val$departmentalInst16, _val$attribute5, _val$attribute5$, _val$attribute6, _val$attribute6$, _val$attribute$0$bedS2, _val$attribute7, _val$attribute7$, _val$attribute$0$cont2, _val$attribute8, _val$attribute8$, _val$createddate2, _val$changeStatus4, _val$changeStatus5, _val$changeStatus6, _val$statushistory2, _val$statusreason2, _val$accessionNum2;
33451
+ var _val$diagnosis2, _val$performer2, _val$recurrent11, _val$recurrent11$, _val$priority2, _val$OrderNature2, _moment$unix$format6, _JSON$stringify3, _val$recurrent12, _val$recurrent12$, _val$recurrent$0$ever3, _val$recurrent13, _val$recurrent13$, _val$recurrent$0$ever4, _val$recurrent14, _val$recurrent14$, _moment$unix$format7, _val$recurrent15, _val$recurrent15$, _JSON$stringify4, _val$recurrent16, _val$recurrent16$, _val$recurrent17, _val$recurrent17$, _moment$unix$format8, _val$recurrent18, _val$recurrent18$, _moment$unix$format9, _val$Requestor12, _val$Requestor12$, _val$Requestor12$$org, _val$Requestor13, _val$Requestor13$, _val$Requestor13$$org, _val$Requestor14, _val$Requestor14$, _val$Requestor14$$org, _val$Requestor$0$prac3, _val$Requestor15, _val$Requestor15$, _val$Requestor15$$pra, _val$Requestor$0$prac4, _val$Requestor16, _val$Requestor16$, _val$Requestor16$$pra, _val$Requestor17, _val$Requestor17$, _val$Requestor17$$pra, _val$Requestor18, _val$Requestor18$, _val$Requestor18$$pra, _val$Requestor19, _val$Requestor19$, _val$Requestor19$$pra, _val$Requestor19$$pra2, _val$Requestor19$$pra3, _val$Requestor20, _val$Requestor20$, _val$Requestor20$$pra, _val$Requestor20$$pra2, _val$Requestor21, _val$Requestor21$, _val$Requestor21$$pra, _val$Requestor21$$pra2, _val$Requestor22, _val$Requestor22$, _val$Requestor22$$pra, _val$Requestor22$$pra2, _val$Requestor22$$pra3, _val$patientInstructi9, _val$patientInstructi10, _val$patientInstructi11, _val$patientInstructi12, _val$patientInstructi13, _val$patientInstructi14, _val$patientInstructi15, _val$patientInstructi16, _val$preparatoryInstr9, _val$preparatoryInstr10, _val$preparatoryInstr11, _val$preparatoryInstr12, _val$preparatoryInstr13, _val$preparatoryInstr14, _val$preparatoryInstr15, _val$preparatoryInstr16, _val$departmentalInst9, _val$departmentalInst10, _val$departmentalInst11, _val$departmentalInst12, _val$departmentalInst13, _val$departmentalInst14, _val$departmentalInst15, _val$departmentalInst16, _val$attribute5, _val$attribute5$, _val$attribute6, _val$attribute6$, _val$attribute$0$bedS2, _val$attribute7, _val$attribute7$, _val$attribute$0$cont2, _val$attribute8, _val$attribute8$, _val$createddate2, _val$changeStatus4, _val$changeStatus5, _val$changeStatus6, _val$statushistory2, _val$statusreason2, _val$accessionNum2;
33284
33452
 
33285
33453
  var diagnosisData = val === null || val === void 0 ? void 0 : (_val$diagnosis2 = val.diagnosis) === null || _val$diagnosis2 === void 0 ? void 0 : _val$diagnosis2.map(function (v) {
33286
33454
  return {
@@ -33363,20 +33531,21 @@ var RecurrentgenerateResJson = function RecurrentgenerateResJson(dataList, arr)
33363
33531
  qty: JSON.stringify(val === null || val === void 0 ? void 0 : val.orderQty),
33364
33532
  requestorDetails: {
33365
33533
  organization: {
33366
- label: val === null || val === void 0 ? void 0 : (_val$Requestor11 = val.Requestor) === null || _val$Requestor11 === void 0 ? void 0 : (_val$Requestor11$ = _val$Requestor11[0]) === null || _val$Requestor11$ === void 0 ? void 0 : (_val$Requestor11$$org = _val$Requestor11$.organization) === null || _val$Requestor11$$org === void 0 ? void 0 : _val$Requestor11$$org._id,
33367
- value: val === null || val === void 0 ? void 0 : (_val$Requestor12 = val.Requestor) === null || _val$Requestor12 === void 0 ? void 0 : (_val$Requestor12$ = _val$Requestor12[0]) === null || _val$Requestor12$ === void 0 ? void 0 : (_val$Requestor12$$org = _val$Requestor12$.organization) === null || _val$Requestor12$$org === void 0 ? void 0 : _val$Requestor12$$org.name,
33368
- id: val === null || val === void 0 ? void 0 : (_val$Requestor13 = val.Requestor) === null || _val$Requestor13 === void 0 ? void 0 : (_val$Requestor13$ = _val$Requestor13[0]) === null || _val$Requestor13$ === void 0 ? void 0 : (_val$Requestor13$$org = _val$Requestor13$.organization) === null || _val$Requestor13$$org === void 0 ? void 0 : _val$Requestor13$$org.id
33534
+ label: val === null || val === void 0 ? void 0 : (_val$Requestor12 = val.Requestor) === null || _val$Requestor12 === void 0 ? void 0 : (_val$Requestor12$ = _val$Requestor12[0]) === null || _val$Requestor12$ === void 0 ? void 0 : (_val$Requestor12$$org = _val$Requestor12$.organization) === null || _val$Requestor12$$org === void 0 ? void 0 : _val$Requestor12$$org._id,
33535
+ value: val === null || val === void 0 ? void 0 : (_val$Requestor13 = val.Requestor) === null || _val$Requestor13 === void 0 ? void 0 : (_val$Requestor13$ = _val$Requestor13[0]) === null || _val$Requestor13$ === void 0 ? void 0 : (_val$Requestor13$$org = _val$Requestor13$.organization) === null || _val$Requestor13$$org === void 0 ? void 0 : _val$Requestor13$$org.name,
33536
+ id: val === null || val === void 0 ? void 0 : (_val$Requestor14 = val.Requestor) === null || _val$Requestor14 === void 0 ? void 0 : (_val$Requestor14$ = _val$Requestor14[0]) === null || _val$Requestor14$ === void 0 ? void 0 : (_val$Requestor14$$org = _val$Requestor14$.organization) === null || _val$Requestor14$$org === void 0 ? void 0 : _val$Requestor14$$org.id
33369
33537
  },
33370
33538
  practitionerRole: {
33371
- label: (_val$Requestor$0$prac3 = val === null || val === void 0 ? void 0 : (_val$Requestor14 = val.Requestor) === null || _val$Requestor14 === void 0 ? void 0 : (_val$Requestor14$ = _val$Requestor14[0]) === null || _val$Requestor14$ === void 0 ? void 0 : (_val$Requestor14$$pra = _val$Requestor14$.practRole) === null || _val$Requestor14$$pra === void 0 ? void 0 : _val$Requestor14$$pra.display) !== null && _val$Requestor$0$prac3 !== void 0 ? _val$Requestor$0$prac3 : "",
33372
- value: (_val$Requestor$0$prac4 = val === null || val === void 0 ? void 0 : (_val$Requestor15 = val.Requestor) === null || _val$Requestor15 === void 0 ? void 0 : (_val$Requestor15$ = _val$Requestor15[0]) === null || _val$Requestor15$ === void 0 ? void 0 : (_val$Requestor15$$pra = _val$Requestor15$.practRole) === null || _val$Requestor15$$pra === void 0 ? void 0 : _val$Requestor15$$pra.display) !== null && _val$Requestor$0$prac4 !== void 0 ? _val$Requestor$0$prac4 : "",
33373
- id: val === null || val === void 0 ? void 0 : (_val$Requestor16 = val.Requestor) === null || _val$Requestor16 === void 0 ? void 0 : (_val$Requestor16$ = _val$Requestor16[0]) === null || _val$Requestor16$ === void 0 ? void 0 : (_val$Requestor16$$pra = _val$Requestor16$.practRole) === null || _val$Requestor16$$pra === void 0 ? void 0 : _val$Requestor16$$pra.id,
33374
- _id: val === null || val === void 0 ? void 0 : (_val$Requestor17 = val.Requestor) === null || _val$Requestor17 === void 0 ? void 0 : (_val$Requestor17$ = _val$Requestor17[0]) === null || _val$Requestor17$ === void 0 ? void 0 : (_val$Requestor17$$pra = _val$Requestor17$.practRole) === null || _val$Requestor17$$pra === void 0 ? void 0 : _val$Requestor17$$pra._id
33539
+ label: (_val$Requestor$0$prac3 = val === null || val === void 0 ? void 0 : (_val$Requestor15 = val.Requestor) === null || _val$Requestor15 === void 0 ? void 0 : (_val$Requestor15$ = _val$Requestor15[0]) === null || _val$Requestor15$ === void 0 ? void 0 : (_val$Requestor15$$pra = _val$Requestor15$.practRole) === null || _val$Requestor15$$pra === void 0 ? void 0 : _val$Requestor15$$pra.display) !== null && _val$Requestor$0$prac3 !== void 0 ? _val$Requestor$0$prac3 : "",
33540
+ value: (_val$Requestor$0$prac4 = val === null || val === void 0 ? void 0 : (_val$Requestor16 = val.Requestor) === null || _val$Requestor16 === void 0 ? void 0 : (_val$Requestor16$ = _val$Requestor16[0]) === null || _val$Requestor16$ === void 0 ? void 0 : (_val$Requestor16$$pra = _val$Requestor16$.practRole) === null || _val$Requestor16$$pra === void 0 ? void 0 : _val$Requestor16$$pra.display) !== null && _val$Requestor$0$prac4 !== void 0 ? _val$Requestor$0$prac4 : "",
33541
+ id: val === null || val === void 0 ? void 0 : (_val$Requestor17 = val.Requestor) === null || _val$Requestor17 === void 0 ? void 0 : (_val$Requestor17$ = _val$Requestor17[0]) === null || _val$Requestor17$ === void 0 ? void 0 : (_val$Requestor17$$pra = _val$Requestor17$.practRole) === null || _val$Requestor17$$pra === void 0 ? void 0 : _val$Requestor17$$pra.id,
33542
+ _id: val === null || val === void 0 ? void 0 : (_val$Requestor18 = val.Requestor) === null || _val$Requestor18 === void 0 ? void 0 : (_val$Requestor18$ = _val$Requestor18[0]) === null || _val$Requestor18$ === void 0 ? void 0 : (_val$Requestor18$$pra = _val$Requestor18$.practRole) === null || _val$Requestor18$$pra === void 0 ? void 0 : _val$Requestor18$$pra._id
33375
33543
  },
33376
- practitionerId: val === null || val === void 0 ? void 0 : (_val$Requestor18 = val.Requestor) === null || _val$Requestor18 === void 0 ? void 0 : (_val$Requestor18$ = _val$Requestor18[0]) === null || _val$Requestor18$ === void 0 ? void 0 : (_val$Requestor18$$pra = _val$Requestor18$.practId) === null || _val$Requestor18$$pra === void 0 ? void 0 : (_val$Requestor18$$pra2 = _val$Requestor18$$pra[0]) === null || _val$Requestor18$$pra2 === void 0 ? void 0 : (_val$Requestor18$$pra3 = _val$Requestor18$$pra2.name) === null || _val$Requestor18$$pra3 === void 0 ? void 0 : _val$Requestor18$$pra3[0],
33544
+ practitionerId: val === null || val === void 0 ? void 0 : (_val$Requestor19 = val.Requestor) === null || _val$Requestor19 === void 0 ? void 0 : (_val$Requestor19$ = _val$Requestor19[0]) === null || _val$Requestor19$ === void 0 ? void 0 : (_val$Requestor19$$pra = _val$Requestor19$.practId) === null || _val$Requestor19$$pra === void 0 ? void 0 : (_val$Requestor19$$pra2 = _val$Requestor19$$pra[0]) === null || _val$Requestor19$$pra2 === void 0 ? void 0 : (_val$Requestor19$$pra3 = _val$Requestor19$$pra2.name) === null || _val$Requestor19$$pra3 === void 0 ? void 0 : _val$Requestor19$$pra3[0],
33377
33545
  orderBy: {
33378
- value: val === null || val === void 0 ? void 0 : (_val$Requestor19 = val.Requestor) === null || _val$Requestor19 === void 0 ? void 0 : (_val$Requestor19$ = _val$Requestor19[0]) === null || _val$Requestor19$ === void 0 ? void 0 : (_val$Requestor19$$pra = _val$Requestor19$.practId) === null || _val$Requestor19$$pra === void 0 ? void 0 : (_val$Requestor19$$pra2 = _val$Requestor19$$pra[0]) === null || _val$Requestor19$$pra2 === void 0 ? void 0 : _val$Requestor19$$pra2.id,
33379
- label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor20 = val.Requestor) === null || _val$Requestor20 === void 0 ? void 0 : (_val$Requestor20$ = _val$Requestor20[0]) === null || _val$Requestor20$ === void 0 ? void 0 : (_val$Requestor20$$pra = _val$Requestor20$.practId) === null || _val$Requestor20$$pra === void 0 ? void 0 : (_val$Requestor20$$pra2 = _val$Requestor20$$pra[0]) === null || _val$Requestor20$$pra2 === void 0 ? void 0 : (_val$Requestor20$$pra3 = _val$Requestor20$$pra2.name) === null || _val$Requestor20$$pra3 === void 0 ? void 0 : _val$Requestor20$$pra3[0]) || {})
33546
+ practitioner_id: val === null || val === void 0 ? void 0 : (_val$Requestor20 = val.Requestor) === null || _val$Requestor20 === void 0 ? void 0 : (_val$Requestor20$ = _val$Requestor20[0]) === null || _val$Requestor20$ === void 0 ? void 0 : (_val$Requestor20$$pra = _val$Requestor20$.practId) === null || _val$Requestor20$$pra === void 0 ? void 0 : (_val$Requestor20$$pra2 = _val$Requestor20$$pra[0]) === null || _val$Requestor20$$pra2 === void 0 ? void 0 : _val$Requestor20$$pra2.practitioner_id,
33547
+ value: val === null || val === void 0 ? void 0 : (_val$Requestor21 = val.Requestor) === null || _val$Requestor21 === void 0 ? void 0 : (_val$Requestor21$ = _val$Requestor21[0]) === null || _val$Requestor21$ === void 0 ? void 0 : (_val$Requestor21$$pra = _val$Requestor21$.practId) === null || _val$Requestor21$$pra === void 0 ? void 0 : (_val$Requestor21$$pra2 = _val$Requestor21$$pra[0]) === null || _val$Requestor21$$pra2 === void 0 ? void 0 : _val$Requestor21$$pra2.id,
33548
+ label: makeName((val === null || val === void 0 ? void 0 : (_val$Requestor22 = val.Requestor) === null || _val$Requestor22 === void 0 ? void 0 : (_val$Requestor22$ = _val$Requestor22[0]) === null || _val$Requestor22$ === void 0 ? void 0 : (_val$Requestor22$$pra = _val$Requestor22$.practId) === null || _val$Requestor22$$pra === void 0 ? void 0 : (_val$Requestor22$$pra2 = _val$Requestor22$$pra[0]) === null || _val$Requestor22$$pra2 === void 0 ? void 0 : (_val$Requestor22$$pra3 = _val$Requestor22$$pra2.name) === null || _val$Requestor22$$pra3 === void 0 ? void 0 : _val$Requestor22$$pra3[0]) || {})
33380
33549
  }
33381
33550
  },
33382
33551
  indication: {
@@ -34276,12 +34445,13 @@ var RAD_ORGANIZATION = createAsyncThunk("RadiologySlice/getorderorganization", /
34276
34445
  data3 = _context15.sent;
34277
34446
  arr3 = [];
34278
34447
  data3 === null || data3 === void 0 ? void 0 : (_data3$result = data3.result) === null || _data3$result === void 0 ? void 0 : _data3$result.map(function (val) {
34279
- var _val$shortdesc5, _val$shortdesc6, _val$_id6;
34448
+ var _val$shortdesc5, _val$shortdesc6, _val$_id6, _val$locationID;
34280
34449
 
34281
34450
  arr3.push({
34282
34451
  label: (_val$shortdesc5 = val === null || val === void 0 ? void 0 : val.shortdesc) !== null && _val$shortdesc5 !== void 0 ? _val$shortdesc5 : "",
34283
34452
  value: (_val$shortdesc6 = val === null || val === void 0 ? void 0 : val.shortdesc) !== null && _val$shortdesc6 !== void 0 ? _val$shortdesc6 : "",
34284
- id: (_val$_id6 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id6 !== void 0 ? _val$_id6 : ""
34453
+ id: (_val$_id6 = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id6 !== void 0 ? _val$_id6 : "",
34454
+ locationID: (_val$locationID = val === null || val === void 0 ? void 0 : val.locationID) !== null && _val$locationID !== void 0 ? _val$locationID : ""
34285
34455
  });
34286
34456
  });
34287
34457
  _context15.next = 26;
@@ -38605,50 +38775,179 @@ var appointmentStatsApiActions = {
38605
38775
  var dashboardComponentApiSlice = appointmentStatsApiSlice.reducer;
38606
38776
 
38607
38777
  var alertInteractionsQuery = {
38608
- alertInteractions: function alertInteractions() {
38778
+ alertInteractions: function alertInteractions(alertList) {
38779
+ var _alertList$creatinine, _alertList$creatinine2, _alertList$drugCodes, _alertList$diseaseCod, _alertList$allergyCod;
38780
+
38609
38781
  return {
38610
- "Patient": {
38611
- "Age": 25,
38612
- "PatientName": "Fraklin Stephen",
38613
- "Weight": 5450,
38614
- "Height": 50,
38615
- "CreatinineClearance": {
38616
- "Value": 67,
38617
- "UOM": "MG/DAY"
38782
+ // "Patient": {
38783
+ // "Age": 25,
38784
+ // "PatientName": "Fraklin Stephen",
38785
+ // "Weight": 5450,
38786
+ // "Height": 50,
38787
+ // "CreatinineClearance": {
38788
+ // "Value": 67,
38789
+ // "UOM": "MG/DAY"
38790
+ // },
38791
+ // "GestationalBirthAge": 22
38792
+ // },
38793
+ // "DrugCodes": [
38794
+ // 1049997,
38795
+ // 1052518,
38796
+ // 1052594,
38797
+ // 1052598,
38798
+ // 1050231,
38799
+ // 1048580,
38800
+ // 1066660,
38801
+ // 1049125,
38802
+ // 1050215,
38803
+ // 1048649,
38804
+ // 1054917,
38805
+ // 1051477
38806
+ // ],
38807
+ // "DiseaseCodes": [
38808
+ // "346",
38809
+ // "G43.909",
38810
+ // "D64.3",
38811
+ // "1052614"
38812
+ // ],
38813
+ // "AllergyCodes": [
38814
+ // 83,
38815
+ // 281,
38816
+ // 306,
38817
+ // 476,
38818
+ // 543,
38819
+ // 568,
38820
+ // 571,
38821
+ // 572,
38822
+ // 590,
38823
+ // 592,
38824
+ // 593,
38825
+ // 2715,
38826
+ // 2755,
38827
+ // 900028,
38828
+ // 1088
38829
+ // ],
38830
+ // "Doses": [
38831
+ // {
38832
+ // "DrugName": "Amoxlin 450 mg",
38833
+ // "GCNSEQNO": 8997,
38834
+ // "ICDCode": "A181",
38835
+ // "DoseTypeIndicator": "02",
38836
+ // "Route": "064",
38837
+ // "Dose": {
38838
+ // "Value": 0.125,
38839
+ // "UOM": "G/DAY"
38840
+ // },
38841
+ // "Frequency": {
38842
+ // "Code": "QD"
38843
+ // },
38844
+ // "Duration": {
38845
+ // "Value": 1
38846
+ // }
38847
+ // },
38848
+ // {
38849
+ // "DrugName": "sghd",
38850
+ // "GCNSEQNO": 8997,
38851
+ // "ICDCode": "sdf",
38852
+ // "DoseTypeIndicator": "02",
38853
+ // "Route": "sd",
38854
+ // "Dose": {
38855
+ // "Value": 0.125,
38856
+ // "UOM": "G/DAY"
38857
+ // },
38858
+ // "Frequency": {
38859
+ // "Code": "QD"
38860
+ // },
38861
+ // "Duration": {
38862
+ // "Value": 1
38863
+ // }
38864
+ // }
38865
+ // ]
38866
+ Patient: {
38867
+ Age: alertList === null || alertList === void 0 ? void 0 : alertList.age,
38868
+ PatientName: alertList === null || alertList === void 0 ? void 0 : alertList.patientName,
38869
+ Weight: alertList === null || alertList === void 0 ? void 0 : alertList.weight,
38870
+ Height: alertList === null || alertList === void 0 ? void 0 : alertList.height,
38871
+ CreatinineClearance: {
38872
+ Value: alertList === null || alertList === void 0 ? void 0 : (_alertList$creatinine = alertList.creatinineClearance) === null || _alertList$creatinine === void 0 ? void 0 : _alertList$creatinine.Value,
38873
+ UOM: alertList === null || alertList === void 0 ? void 0 : (_alertList$creatinine2 = alertList.creatinineClearance) === null || _alertList$creatinine2 === void 0 ? void 0 : _alertList$creatinine2.UOM
38618
38874
  },
38619
- "GestationalBirthAge": 22
38875
+ GestationalBirthAge: alertList === null || alertList === void 0 ? void 0 : alertList.age
38620
38876
  },
38621
- "DrugCodes": [1049997, 1052518, 1052594, 1052598, 1050231, 1048580, 1066660, 1049125, 1050215, 1048649, 1054917, 1051477],
38622
- "DiseaseCodes": ["346", "G43.909", "D64.3", "1052614"],
38623
- "AllergyCodes": [83, 281, 306, 476, 543, 568, 571, 572, 590, 592, 593, 2715, 2755, 900028, 1088],
38624
- "Doses": [{
38625
- "DrugName": "Amoxlin 450 mg",
38626
- "GCNSEQNO": 8997,
38627
- "ICDCode": "A181",
38628
- "DoseTypeIndicator": "02",
38629
- "Route": "064",
38630
- "Dose": {
38631
- "Value": 0.125,
38632
- "UOM": "G/DAY"
38877
+ DrugCodes: (_alertList$drugCodes = alertList === null || alertList === void 0 ? void 0 : alertList.drugCodes) !== null && _alertList$drugCodes !== void 0 ? _alertList$drugCodes : [],
38878
+ DiseaseCodes: (_alertList$diseaseCod = alertList === null || alertList === void 0 ? void 0 : alertList.diseaseCodes) !== null && _alertList$diseaseCod !== void 0 ? _alertList$diseaseCod : [],
38879
+ AllergyCodes: (_alertList$allergyCod = alertList === null || alertList === void 0 ? void 0 : alertList.allergyCodes) !== null && _alertList$allergyCod !== void 0 ? _alertList$allergyCod : [],
38880
+ Doses: [{
38881
+ DrugName: "Amoxlin 450 mg",
38882
+ GCNSEQNO: 8997,
38883
+ ICDCode: "A181",
38884
+ DoseTypeIndicator: "02",
38885
+ Route: "064",
38886
+ Dose: {
38887
+ Value: 0.125,
38888
+ UOM: "G/DAY"
38633
38889
  },
38634
- "Frequency": {
38635
- "Code": "QD"
38890
+ Frequency: {
38891
+ Code: "QD"
38636
38892
  },
38637
- "Duration": {
38638
- "Value": 1
38893
+ Duration: {
38894
+ Value: 1
38639
38895
  }
38640
38896
  }]
38641
38897
  };
38642
38898
  }
38643
38899
  };
38900
+ var alertIntractionUpsert = {
38901
+ UpsertAlertInterations: function UpsertAlertInterations(data) {
38902
+ var _data$presType, _data$alerts, _data$alerts$, _data$addForm, _data$addForm$reason, _data$addForm2, _data$addForm3, _data$addForm3$reason;
38903
+
38904
+ return [{
38905
+ db_name: dbName,
38906
+ entity: "PH_OrderLineAlertLogs",
38907
+ is_metadata: true,
38908
+ metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd",
38909
+ doc: {
38910
+ id: 0,
38911
+ orgEntityType: data === null || data === void 0 ? void 0 : data.orgEntityType,
38912
+ org_Id: data === null || data === void 0 ? void 0 : data.orgId,
38913
+ patient_Id: data === null || data === void 0 ? void 0 : data.patientid,
38914
+ encountertype: data === null || data === void 0 ? void 0 : data.encountertype,
38915
+ encounter_Id: data === null || data === void 0 ? void 0 : data.encounterid,
38916
+ presType: data === null || data === void 0 ? void 0 : (_data$presType = data.presType) === null || _data$presType === void 0 ? void 0 : _data$presType.Value,
38917
+ rxId: "",
38918
+ rxDate: data === null || data === void 0 ? void 0 : data.rxDate,
38919
+ interactionMessage: [{
38920
+ seqNo: 1,
38921
+ reactionCode: data === null || data === void 0 ? void 0 : data.alertReasonCode,
38922
+ alertMessage: data === null || data === void 0 ? void 0 : (_data$alerts = data.alerts) === null || _data$alerts === void 0 ? void 0 : (_data$alerts$ = _data$alerts[0]) === null || _data$alerts$ === void 0 ? void 0 : _data$alerts$.Message,
38923
+ overrideReasonCode: data === null || data === void 0 ? void 0 : (_data$addForm = data.addForm) === null || _data$addForm === void 0 ? void 0 : (_data$addForm$reason = _data$addForm.reason) === null || _data$addForm$reason === void 0 ? void 0 : _data$addForm$reason.label,
38924
+ overrideNotes: data === null || data === void 0 ? void 0 : (_data$addForm2 = data.addForm) === null || _data$addForm2 === void 0 ? void 0 : _data$addForm2.Others,
38925
+ overrideById: data === null || data === void 0 ? void 0 : (_data$addForm3 = data.addForm) === null || _data$addForm3 === void 0 ? void 0 : (_data$addForm3$reason = _data$addForm3.reason) === null || _data$addForm3$reason === void 0 ? void 0 : _data$addForm3$reason.label
38926
+ }]
38927
+ }
38928
+ }];
38929
+ }
38930
+ };
38931
+ var reasonTypeCode = {
38932
+ reasonTypeCodeRead: function reasonTypeCodeRead(display) {
38933
+ return {
38934
+ db_name: dbName,
38935
+ entity: "CodingMaster",
38936
+ filter: "CodingMaster.Type=='REACTIONTYPE' && CodingMaster.activestatus==true && CodingMaster.status==true and lower(CodingMaster.display)==lower('".concat(display, "')"),
38937
+ return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')"
38938
+ };
38939
+ }
38940
+ };
38644
38941
 
38645
38942
  var _extraReducers$5;
38646
38943
  var ALERT_INTERACTIONS = createAsyncThunk("alertIntractionsSlice/alertIntractions", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
38647
38944
  var payload,
38648
38945
  _ref2,
38649
38946
  rejectWithValue,
38947
+ alertList,
38650
38948
  queriesjson,
38651
38949
  res,
38950
+ alertInteratcion,
38652
38951
  _args = arguments;
38653
38952
 
38654
38953
  return regeneratorRuntime.wrap(function _callee$(_context) {
@@ -38658,10 +38957,8 @@ var ALERT_INTERACTIONS = createAsyncThunk("alertIntractionsSlice/alertIntraction
38658
38957
  payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
38659
38958
  _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
38660
38959
  _context.prev = 2;
38661
-
38662
- _objectDestructuringEmpty(payload);
38663
-
38664
- queriesjson = alertInteractionsQuery.alertInteractions();
38960
+ alertList = payload.alertList;
38961
+ queriesjson = alertInteractionsQuery.alertInteractions(alertList);
38665
38962
  _context.next = 7;
38666
38963
  return fetchData$3({
38667
38964
  body: JSON.stringify(queriesjson)
@@ -38669,28 +38966,136 @@ var ALERT_INTERACTIONS = createAsyncThunk("alertIntractionsSlice/alertIntraction
38669
38966
 
38670
38967
  case 7:
38671
38968
  res = _context.sent;
38969
+ alertInteratcion = res.result.find(function (val) {
38970
+ var keys = Object.keys(val);
38971
+
38972
+ if (keys.includes("Drug-AllergyIngredient-Interaction")) {
38973
+ return true;
38974
+ }
38975
+
38976
+ return false;
38977
+ });
38672
38978
  return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
38673
- data: res
38979
+ data: alertInteratcion
38674
38980
  }));
38675
38981
 
38676
- case 11:
38677
- _context.prev = 11;
38982
+ case 12:
38983
+ _context.prev = 12;
38678
38984
  _context.t0 = _context["catch"](2);
38679
38985
  return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
38680
38986
  message: _context.t0.message
38681
38987
  })));
38682
38988
 
38683
- case 14:
38989
+ case 15:
38684
38990
  case "end":
38685
38991
  return _context.stop();
38686
38992
  }
38687
38993
  }
38688
- }, _callee, null, [[2, 11]]);
38994
+ }, _callee, null, [[2, 12]]);
38995
+ })));
38996
+ var ALERT_INTERACTIONS_UPERT = createAsyncThunk("alertIntractionsSlice/alertInteraction_upsert", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
38997
+ var payload,
38998
+ _ref4,
38999
+ rejectWithValue,
39000
+ list,
39001
+ queriesjson,
39002
+ res,
39003
+ _args2 = arguments;
39004
+
39005
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
39006
+ while (1) {
39007
+ switch (_context2.prev = _context2.next) {
39008
+ case 0:
39009
+ payload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
39010
+ _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
39011
+ _context2.prev = 2;
39012
+ list = payload.list;
39013
+ queriesjson = alertIntractionUpsert.UpsertAlertInterations(list);
39014
+ _context2.next = 7;
39015
+ return fetchData$3({
39016
+ body: JSON.stringify(queriesjson)
39017
+ }, __uspsertUrl__);
39018
+
39019
+ case 7:
39020
+ res = _context2.sent;
39021
+ return _context2.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
39022
+ data: res
39023
+ }));
39024
+
39025
+ case 11:
39026
+ _context2.prev = 11;
39027
+ _context2.t0 = _context2["catch"](2);
39028
+ debugger;
39029
+ return _context2.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
39030
+ message: _context2.t0.message
39031
+ })));
39032
+
39033
+ case 15:
39034
+ case "end":
39035
+ return _context2.stop();
39036
+ }
39037
+ }
39038
+ }, _callee2, null, [[2, 11]]);
39039
+ })));
39040
+ var REASON_TYPE_CODE_READ = createAsyncThunk("alertIntractionsSlice/reason_type_code", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
39041
+ var payload,
39042
+ _ref6,
39043
+ rejectWithValue,
39044
+ list,
39045
+ display,
39046
+ queriesjson,
39047
+ res,
39048
+ _args3 = arguments;
39049
+
39050
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
39051
+ while (1) {
39052
+ switch (_context3.prev = _context3.next) {
39053
+ case 0:
39054
+ payload = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
39055
+ _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue;
39056
+ _context3.prev = 2;
39057
+ list = payload.list;
39058
+
39059
+ if (list === "Drug-AllergyIngredient-Interaction") {
39060
+ display = "Drug-to-Allergy Interaction";
39061
+ } else if (list === "Drug-Drug-Interaction") {
39062
+ display = "Drug-to-Drug Interaction";
39063
+ } else if (list === "Drug-Disease-Interaction") {
39064
+ display = "Drug-to-Disease Interaction";
39065
+ }
39066
+
39067
+ queriesjson = reasonTypeCode.reasonTypeCodeRead(display);
39068
+ _context3.next = 8;
39069
+ return fetchData$3({
39070
+ body: JSON.stringify(queriesjson)
39071
+ }, __readDocumentUrl__);
39072
+
39073
+ case 8:
39074
+ res = _context3.sent;
39075
+ return _context3.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
39076
+ data: res
39077
+ }));
39078
+
39079
+ case 12:
39080
+ _context3.prev = 12;
39081
+ _context3.t0 = _context3["catch"](2);
39082
+ return _context3.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
39083
+ message: _context3.t0.message
39084
+ })));
39085
+
39086
+ case 15:
39087
+ case "end":
39088
+ return _context3.stop();
39089
+ }
39090
+ }
39091
+ }, _callee3, null, [[2, 12]]);
38689
39092
  })));
38690
39093
  var alertIntractionsSlice = createSlice({
38691
39094
  name: "alertIntractionsSlice",
38692
39095
  initialState: {
38693
- alert_interactions: _objectSpread2({}, defaultState.Info)
39096
+ alert_interactions: _objectSpread2({}, defaultState.Info),
39097
+ alertInteraction_upsert: _objectSpread2({}, defaultState.Info),
39098
+ reason_type_code: _objectSpread2({}, defaultState.Info)
38694
39099
  },
38695
39100
  extraReducers: (_extraReducers$5 = {}, _defineProperty(_extraReducers$5, ALERT_INTERACTIONS.fulfilled, function (state, action) {
38696
39101
  var _action$payload;
@@ -38702,10 +39107,32 @@ var alertIntractionsSlice = createSlice({
38702
39107
  var _action$payload2;
38703
39108
 
38704
39109
  state.alert_interactions.loading = false, state.alert_interactions.error = true, state.alert_interactions = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
39110
+ }), _defineProperty(_extraReducers$5, ALERT_INTERACTIONS_UPERT.fulfilled, function (state, action) {
39111
+ var _action$payload3;
39112
+
39113
+ state.alertInteraction_upsert.loading = false, state.alertInteraction_upsert.error = false, state.alertInteraction_upsert = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
39114
+ }), _defineProperty(_extraReducers$5, ALERT_INTERACTIONS_UPERT.pending, function (state, action) {
39115
+ state.alertInteraction_upsert.error = false, state.alertInteraction_upsert.loading = true;
39116
+ }), _defineProperty(_extraReducers$5, ALERT_INTERACTIONS_UPERT.rejected, function (state, action) {
39117
+ var _action$payload4;
39118
+
39119
+ state.alertInteraction_upsert.loading = false, state.alertInteraction_upsert.error = true, state.alertInteraction_upsert = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
39120
+ }), _defineProperty(_extraReducers$5, REASON_TYPE_CODE_READ.fulfilled, function (state, action) {
39121
+ var _action$payload5;
39122
+
39123
+ state.reason_type_code.loading = false, state.reason_type_code.error = false, state.reason_type_code = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
39124
+ }), _defineProperty(_extraReducers$5, REASON_TYPE_CODE_READ.pending, function (state, action) {
39125
+ state.reason_type_code.error = false, state.reason_type_code.loading = true;
39126
+ }), _defineProperty(_extraReducers$5, REASON_TYPE_CODE_READ.rejected, function (state, action) {
39127
+ var _action$payload6;
39128
+
39129
+ state.reason_type_code.loading = false, state.reason_type_code.error = true, state.reason_type_code = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
38705
39130
  }), _extraReducers$5)
38706
39131
  });
38707
39132
  var alertIntractionActions = {
38708
- ALERT_INTERACTIONS: ALERT_INTERACTIONS
39133
+ ALERT_INTERACTIONS: ALERT_INTERACTIONS,
39134
+ ALERT_INTERACTIONS_UPERT: ALERT_INTERACTIONS_UPERT,
39135
+ REASON_TYPE_CODE_READ: REASON_TYPE_CODE_READ
38709
39136
  };
38710
39137
  var alertIntractionsSlice$1 = alertIntractionsSlice.reducer;
38711
39138