primary_care_admin_binder 0.1.51 → 0.1.52

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 +249 -1497
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -2235,10 +2235,6 @@ function unwrapResult(action) {
2235
2235
  // src/index.ts
2236
2236
  N();
2237
2237
 
2238
- var httpMessage = {
2239
- OkMessage: "200 Successful",
2240
- ErroMessage: "500 Internal server error"
2241
- };
2242
2238
  var defaultReject = {
2243
2239
  loading: false,
2244
2240
  error: true,
@@ -8268,11 +8264,8 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8268
8264
 
8269
8265
  if (data.identification && data.identification.length > 0) {
8270
8266
  data.identification.map(function (val) {
8271
- var _val$_key;
8272
-
8273
8267
  var data = {
8274
8268
  // "_id": "string",
8275
- "_key": (_val$_key = val === null || val === void 0 ? void 0 : val._key) !== null && _val$_key !== void 0 ? _val$_key : "",
8276
8269
  "user": val.id_type.value ? val.id_type.value : "",
8277
8270
  "system": "",
8278
8271
  "value": val.id_number ? val.id_number : "",
@@ -8296,11 +8289,8 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8296
8289
 
8297
8290
  if (data.names && data.names.length > 0) {
8298
8291
  data.names.map(function (val) {
8299
- var _val$_key2;
8300
-
8301
8292
  var nameData = {
8302
8293
  // "_id": "string",
8303
- "_key": (_val$_key2 = val === null || val === void 0 ? void 0 : val._key) !== null && _val$_key2 !== void 0 ? _val$_key2 : "",
8304
8294
  "use": val.use ? val.use.value : "",
8305
8295
  "text": val.first_name ? val.first_name : "",
8306
8296
  "family": val.last_name ? val.last_name : "",
@@ -8356,8 +8346,6 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8356
8346
 
8357
8347
  if (data.practitionerbyrole && data.practitionerbyrole.length > 0) {
8358
8348
  data.practitionerbyrole.map(function (val) {
8359
- var _val$speciality, _val$speciality2, _val$select_entity, _val$select_entity2, _val$entity_name, _val$entity_name2, _val$entity_name3, _val$entity_name4, _val$select_location, _val$select_location2;
8360
-
8361
8349
  var key = {};
8362
8350
  var roleId = {};
8363
8351
 
@@ -8381,14 +8369,14 @@ var generateJSON$2 = function generateJSON(data, _key, person_id) {
8381
8369
  end: val.end_date ? getUtcTime(moment(val.end_date)) : null // "id": "number"
8382
8370
 
8383
8371
  }],
8384
- SpecialtyID: val !== null && val !== void 0 && (_val$speciality = val.speciality) !== null && _val$speciality !== void 0 && _val$speciality.value ? val === null || val === void 0 ? void 0 : (_val$speciality2 = val.speciality) === null || _val$speciality2 === void 0 ? void 0 : _val$speciality2.value : "",
8385
- EntityType: val !== null && val !== void 0 && (_val$select_entity = val.select_entity) !== null && _val$select_entity !== void 0 && _val$select_entity._id ? val === null || val === void 0 ? void 0 : (_val$select_entity2 = val.select_entity) === null || _val$select_entity2 === void 0 ? void 0 : _val$select_entity2._id : "",
8386
- OrgID: val !== null && val !== void 0 && (_val$entity_name = val.entity_name) !== null && _val$entity_name !== void 0 && _val$entity_name.value ? "".concat(val === null || val === void 0 ? void 0 : (_val$entity_name2 = val.entity_name) === null || _val$entity_name2 === void 0 ? void 0 : _val$entity_name2.value) : "",
8387
- EntityName: val !== null && val !== void 0 && (_val$entity_name3 = val.entity_name) !== null && _val$entity_name3 !== void 0 && _val$entity_name3.value ? "".concat(val === null || val === void 0 ? void 0 : (_val$entity_name4 = val.entity_name) === null || _val$entity_name4 === void 0 ? void 0 : _val$entity_name4.value) : "",
8388
- locationID: val !== null && val !== void 0 && (_val$select_location = val.select_location) !== null && _val$select_location !== void 0 && _val$select_location.value ? val === null || val === void 0 ? void 0 : (_val$select_location2 = val.select_location) === null || _val$select_location2 === void 0 ? void 0 : _val$select_location2.value : "",
8389
- primary_specialty: val !== null && val !== void 0 && val.primary_specialty ? val === null || val === void 0 ? void 0 : val.primary_specialty : false,
8372
+ SpecialtyID: val.speciality ? val.speciality.value : "",
8373
+ EntityType: val.select_entity ? val.select_entity._id : "",
8374
+ OrgID: val.entity_name ? "".concat(val.entity_name.value) : "",
8375
+ EntityName: val.entity_name ? "".concat(val.entity_name.value) : "",
8376
+ locationID: val.select_location ? val.select_location.value : "",
8377
+ primary_specialty: val.primary_specialty ? val.primary_specialty : false,
8390
8378
  telecom: contactList(val.contact),
8391
- files: val !== null && val !== void 0 && val.doc ? val === null || val === void 0 ? void 0 : val.doc : []
8379
+ files: val.doc ? val.doc : []
8392
8380
  }, roleId), key);
8393
8381
 
8394
8382
  practitioner_list.push(practitionerData);
@@ -8924,7 +8912,7 @@ var practitionerActions$1 = {
8924
8912
  };
8925
8913
  var practitionerSlice$1 = practitionerSlice.reducer;
8926
8914
 
8927
- var masterQuery$6 = {
8915
+ var masterQuery$7 = {
8928
8916
  "id_type": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\":\"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='ALTERNATEIDTYPE' && CodeableConceptMaster.status == true\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
8929
8917
  "id_number": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\":\"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='RELATIONSHIP'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
8930
8918
  "prefix": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\":\"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='NAMEPREFIX'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
@@ -8953,7 +8941,7 @@ var masterQuery$6 = {
8953
8941
  "priority": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\":\"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='PRIORITY'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
8954
8942
  "address_type": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\":\"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='ADDRESSTYPE'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
8955
8943
  "role": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\":\"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='PRACTROLE' && CodeableConceptMaster.status == true\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
8956
- "location": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"LocationMaster\",\n \"sort\":\"LocationMaster.shortdesc\",\n \"filter\": \"LocationMaster.activestatus==true && lower(LocationMaster.status)=='active'\", \n \"return_fields\": \"LocationMaster\"\n }"),
8944
+ "location": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"LocationMaster\",\n \"sort\":\"LocationMaster.shortdesc\",\n \"filter\": \"LocationMaster.activestatus==true && LocationMaster.status=='active'\",\n \"return_fields\": \"LocationMaster\"\n }"),
8957
8945
  // "city": `{
8958
8946
  // "db_name": "${dbName}",
8959
8947
  // "entity": "SMGeographicMaster",
@@ -9171,7 +9159,7 @@ var generateReadJSON$5 = function generateReadJSON(data, masters, countryData, s
9171
9159
 
9172
9160
  if (data.identifier && ((_data$identifier = data.identifier) === null || _data$identifier === void 0 ? void 0 : _data$identifier.length) > 0) {
9173
9161
  data.identifier.map(function (val) {
9174
- var _val$user, _val$_key;
9162
+ var _val$user;
9175
9163
 
9176
9164
  var identifierData = {
9177
9165
  "id_type": ((_val$user = val.user) === null || _val$user === void 0 ? void 0 : _val$user.length) > 0 && masters.id_type.filter(function (idlabel) {
@@ -9181,8 +9169,7 @@ var generateReadJSON$5 = function generateReadJSON(data, masters, countryData, s
9181
9169
  })[0] : {},
9182
9170
  "id_number": val.value,
9183
9171
  "expiry_date": val.period[0].end ? utcTOLocal(val.period[0].end, "YYYY-MM-DD") : null,
9184
- "doc": val.files,
9185
- _key: (_val$_key = val === null || val === void 0 ? void 0 : val._key) !== null && _val$_key !== void 0 ? _val$_key : ""
9172
+ "doc": val.files
9186
9173
  };
9187
9174
  identifier.push(identifierData);
9188
9175
  });
@@ -9192,8 +9179,6 @@ var generateReadJSON$5 = function generateReadJSON(data, masters, countryData, s
9192
9179
 
9193
9180
  if (data.name && ((_data$name = data.name) === null || _data$name === void 0 ? void 0 : _data$name.length) > 0) {
9194
9181
  data.name.map(function (val) {
9195
- var _val$_key2;
9196
-
9197
9182
  var namedatas = {
9198
9183
  use: val.use ? masters.use.filter(function (idlabel) {
9199
9184
  return idlabel.value === val.use;
@@ -9206,8 +9191,7 @@ var generateReadJSON$5 = function generateReadJSON(data, masters, countryData, s
9206
9191
  last_name: val.family,
9207
9192
  suffix: val.suffix ? masters.suffix.filter(function (idlabel) {
9208
9193
  return idlabel.value === val.suffix;
9209
- })[0] : {},
9210
- _key: (_val$_key2 = val === null || val === void 0 ? void 0 : val._key) !== null && _val$_key2 !== void 0 ? _val$_key2 : ""
9194
+ })[0] : {}
9211
9195
  };
9212
9196
  nameslist.push(namedatas);
9213
9197
  });
@@ -9444,14 +9428,14 @@ var loopMasters$8 = function loopMasters() {
9444
9428
  while (1) {
9445
9429
  switch (_context2.prev = _context2.next) {
9446
9430
  case 0:
9447
- calls = Object.keys(masterQuery$6).map( /*#__PURE__*/function () {
9431
+ calls = Object.keys(masterQuery$7).map( /*#__PURE__*/function () {
9448
9432
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(val) {
9449
9433
  return regeneratorRuntime.wrap(function _callee$(_context) {
9450
9434
  while (1) {
9451
9435
  switch (_context.prev = _context.next) {
9452
9436
  case 0:
9453
9437
  _context.next = 2;
9454
- return fetchMaster$8(val, masterQuery$6[val]);
9438
+ return fetchMaster$8(val, masterQuery$7[val]);
9455
9439
 
9456
9440
  case 2:
9457
9441
  return _context.abrupt("return", _context.sent);
@@ -12879,7 +12863,7 @@ var locationActions$1 = {
12879
12863
  };
12880
12864
  var locationSlice$1 = locationSlice.reducer;
12881
12865
 
12882
- var masterQuery$5 = {
12866
+ var masterQuery$6 = {
12883
12867
  locationMasterEntityType: function locationMasterEntityType() {
12884
12868
  return {
12885
12869
  db_name: dbName$1,
@@ -13399,7 +13383,7 @@ var LOCATION_MASTERS_ENTITYTYPE = createAsyncThunk("locationMasterSlice/location
13399
13383
  _context.prev = 2;
13400
13384
  _context.next = 5;
13401
13385
  return fetchData({
13402
- body: JSON.stringify(masterQuery$5.locationMasterEntityType())
13386
+ body: JSON.stringify(masterQuery$6.locationMasterEntityType())
13403
13387
  }, __readDocumentUrl__);
13404
13388
 
13405
13389
  case 5:
@@ -13452,7 +13436,7 @@ var LOCATION_MASTERS_ENTITYNAME = createAsyncThunk("locationMasterSlice/location
13452
13436
  type = payload.type;
13453
13437
  _context2.next = 6;
13454
13438
  return fetchData({
13455
- body: JSON.stringify(masterQuery$5.locationMasterEntityName(type))
13439
+ body: JSON.stringify(masterQuery$6.locationMasterEntityName(type))
13456
13440
  }, __readDocumentUrl__);
13457
13441
 
13458
13442
  case 6:
@@ -13501,7 +13485,7 @@ var LOCATION_MASTERS_LOCATIONTYPE = createAsyncThunk("locationMasterSlice/locati
13501
13485
  _context3.prev = 2;
13502
13486
  _context3.next = 5;
13503
13487
  return fetchData({
13504
- body: JSON.stringify(masterQuery$5.locationMasterLocationType())
13488
+ body: JSON.stringify(masterQuery$6.locationMasterLocationType())
13505
13489
  }, __readDocumentUrl__);
13506
13490
 
13507
13491
  case 5:
@@ -13549,7 +13533,7 @@ var LOCATION_MASTERS_OPERATIONALSTATUS = createAsyncThunk("locationMasterSlice/l
13549
13533
  _context4.prev = 2;
13550
13534
  _context4.next = 5;
13551
13535
  return fetchData({
13552
- body: JSON.stringify(masterQuery$5.locationMasterOperationalStatus())
13536
+ body: JSON.stringify(masterQuery$6.locationMasterOperationalStatus())
13553
13537
  }, __readDocumentUrl__);
13554
13538
 
13555
13539
  case 5:
@@ -13597,7 +13581,7 @@ var LOCATION_MASTERS_PARENT_LOCATION_ID_DESCRIPTION = createAsyncThunk("location
13597
13581
  _context5.prev = 2;
13598
13582
  _context5.next = 5;
13599
13583
  return fetchData({
13600
- body: JSON.stringify(masterQuery$5.locationMasterParentLocationIdDescription())
13584
+ body: JSON.stringify(masterQuery$6.locationMasterParentLocationIdDescription())
13601
13585
  }, __readDocumentUrl__);
13602
13586
 
13603
13587
  case 5:
@@ -13645,7 +13629,7 @@ var LOCATION_MASTERS_LOCATIONROLETYPE = createAsyncThunk("locationMasterSlice/lo
13645
13629
  _context6.prev = 2;
13646
13630
  _context6.next = 5;
13647
13631
  return fetchData({
13648
- body: JSON.stringify(masterQuery$5.locationMasterLocationRoleType())
13632
+ body: JSON.stringify(masterQuery$6.locationMasterLocationRoleType())
13649
13633
  }, __readDocumentUrl__);
13650
13634
 
13651
13635
  case 5:
@@ -13699,7 +13683,7 @@ var LOCATION_MASTER_SPECIALITY = createAsyncThunk("locationMasterSlice/location_
13699
13683
  id = payload.id;
13700
13684
  _context7.next = 6;
13701
13685
  return fetchData({
13702
- body: JSON.stringify(masterQuery$5.locationMasterSpeciality(id))
13686
+ body: JSON.stringify(masterQuery$6.locationMasterSpeciality(id))
13703
13687
  }, __readDocumentUrl__);
13704
13688
 
13705
13689
  case 6:
@@ -13749,7 +13733,7 @@ var LOCATION_MASTER_CONTACTMODE = createAsyncThunk("locationMasterSlice/location
13749
13733
  _context8.prev = 2;
13750
13734
  _context8.next = 5;
13751
13735
  return fetchData({
13752
- body: JSON.stringify(masterQuery$5.locationMasterContactMode())
13736
+ body: JSON.stringify(masterQuery$6.locationMasterContactMode())
13753
13737
  }, __readDocumentUrl__);
13754
13738
 
13755
13739
  case 5:
@@ -13797,7 +13781,7 @@ var LOCATION_MASTER_ISD = createAsyncThunk("locationMasterSlice/location_masters
13797
13781
  _context9.prev = 2;
13798
13782
  _context9.next = 5;
13799
13783
  return fetchData({
13800
- body: JSON.stringify(masterQuery$5.locationMasterISD())
13784
+ body: JSON.stringify(masterQuery$6.locationMasterISD())
13801
13785
  }, __readDocumentUrl__);
13802
13786
 
13803
13787
  case 5:
@@ -13845,7 +13829,7 @@ var LOCATION_MASTER_USE = createAsyncThunk("locationMasterSlice/location_masters
13845
13829
  _context10.prev = 2;
13846
13830
  _context10.next = 5;
13847
13831
  return fetchData({
13848
- body: JSON.stringify(masterQuery$5.locationMasterUse())
13832
+ body: JSON.stringify(masterQuery$6.locationMasterUse())
13849
13833
  }, __readDocumentUrl__);
13850
13834
 
13851
13835
  case 5:
@@ -13893,7 +13877,7 @@ var LOCATION_MASTER_PRIORITY = createAsyncThunk("locationMasterSlice/location_ma
13893
13877
  _context11.prev = 2;
13894
13878
  _context11.next = 5;
13895
13879
  return fetchData({
13896
- body: JSON.stringify(masterQuery$5.locationMasterPriority())
13880
+ body: JSON.stringify(masterQuery$6.locationMasterPriority())
13897
13881
  }, __readDocumentUrl__);
13898
13882
 
13899
13883
  case 5:
@@ -17679,134 +17663,134 @@ var queries$f = {
17679
17663
  // "filter": "DrugMaster.activestatus==true ",
17680
17664
  // "return_fields": "{id:DrugMaster.id,_id:DrugMaster._id,DrugCode:DrugMaster.DrugCode,ShortDesc:DrugMaster.ShortDesc,LongDesc:DrugMaster.LongDesc,statusactive:DrugMaster.statusactive,draftstatus:DrugMaster.draftstatus}"
17681
17665
  // }`,
17682
- drug_master: function drug_master(page, perpage, searchQuery) {
17666
+ drug_master: function drug_master(page, perpage) {
17683
17667
  return {
17684
17668
  db_name: dbName$1,
17685
17669
  entity: "DrugMaster",
17686
- sort: "DrugMaster.createddate desc",
17687
- filter: "(LIKE(DrugMaster.DrugCode,'%".concat(searchQuery, "%',true) || LIKE(document(DrugMaster.DrugType).longdesc,'%").concat(searchQuery, "%',true) || LIKE(DrugMaster.ShortDesc,'%").concat(searchQuery, "%',true)) && DrugMaster.activestatus == true "),
17670
+ sort: "DrugMaster.DrugCode",
17671
+ filter: "DrugMaster.activestatus==true ",
17688
17672
  limit: {
17689
17673
  offset: page,
17690
17674
  count: perpage
17691
17675
  },
17692
- return_fields: "merge(DrugMaster,{DrugCode:DrugMaster.DrugCode},{Count:count( for drgmst in DrugMaster filter (LIKE(drgmst.DrugCode,'%".concat(searchQuery, "%',true) || LIKE(document(drgmst.DrugType).longdesc,'%").concat(searchQuery, "%',true) || LIKE(drgmst.ShortDesc,'%").concat(searchQuery, "%',true)) && drgmst.activestatus == true return drgmst._id )},{ShortDesc:DrugMaster.ShortDesc},{DrugClass:DOCUMENT(DrugMaster.DrugClass)},{DrugType:DOCUMENT(DrugMaster.DrugType)},{DrugCategory:DOCUMENT(DrugMaster.DrugCategory)},{FormCode:DOCUMENT(DrugMaster.FormCode)},{StrengthValuesPossible:(for strValPoss in to_array(DrugMaster.StrengthValuesPossible) return merge(strValPoss,{StrengthUOM:document(strValPoss.StrengthUOM)},{StrengthVolumeUoM:document(strValPoss.StrengthVolumeUoM)},{OrderUOMAllowed:(for OrderUOMAllowed in to_array(strValPoss.OrderUOMAllowed) return merge(OrderUOMAllowed,{AllowedOrderDoseUOM:document(OrderUOMAllowed.AllowedOrderDoseUOM)},{AllowedOrderDoseVolUoM:document(OrderUOMAllowed.AllowedOrderDoseVolUoM)}))}))},{RoutesAllowed:document(DrugMaster.RoutesAllowed)})")
17676
+ return_fields: "{TotalCount:COUNT(FOR cnt IN DrugMaster RETURN cnt._key),id:DrugMaster.id,_id:DrugMaster._id,DrugCode:DrugMaster.DrugCode,ShortDesc:DrugMaster.ShortDesc,LongDesc:DrugMaster.LongDesc,statusactive:DrugMaster.statusactive,draftstatus:DrugMaster.draftstatus}"
17693
17677
  };
17694
17678
  },
17695
17679
  drug_master_upsert: [{
17696
- db_name: dbName$1,
17697
- entity: "DrugMaster",
17698
- is_metadata: true,
17699
- metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd",
17700
- doc: (_doc = {
17701
- _id: "string",
17702
- id: "number",
17703
- DrugCode: "string",
17704
- ShortDesc: "string",
17705
- LongDesc: "string",
17706
- Formulary: "boolean",
17707
- DrugSynonyms: "string",
17680
+ "db_name": dbName$1,
17681
+ "entity": "DrugMaster",
17682
+ "is_metadata": true,
17683
+ "metadataId": "04ecb73d-f048-44ce-8563-c9be015812dd",
17684
+ "doc": (_doc = {
17685
+ "_id": "string",
17686
+ "id": "number",
17687
+ "DrugCode": "string",
17688
+ "ShortDesc": "string",
17689
+ "LongDesc": "string",
17690
+ "Formulary": "boolean",
17691
+ "DrugSynonyms": "string",
17708
17692
  //Array of string
17709
- DrugClass: "string",
17710
- DrugCategory: "string",
17711
- DrugType: "string",
17712
- FormCode: "string",
17713
- RoutesAllowed: "array",
17714
- DefaultRouteCode: "string",
17693
+ "DrugClass": "string",
17694
+ "DrugCategory": "string",
17695
+ "DrugType": "string",
17696
+ "FormCode": "string",
17697
+ "RoutesAllowed": "array",
17698
+ "DefaultRouteCode": "string",
17715
17699
  //AVAILABLE STRENGTHS
17716
- StrengthValuesPossible: [{
17717
- StrengthValue: "number",
17718
- StrengthUOM: "string",
17719
- StrengthVolume: "number",
17720
- StrengthVolumeUoM: "string",
17721
- OrderUOMAllowed: [{
17722
- AllowedOrderDoseVal: "number",
17723
- AllowedOrderDoseUOM: "string",
17724
- AllowedOrderDoseVolVal: "number",
17725
- AllowedOrderDoseVolUoM: "string"
17700
+ "StrengthValuesPossible": [{
17701
+ "StrengthValue": "number",
17702
+ "StrengthUOM": "string",
17703
+ "StrengthVolume": "number",
17704
+ "StrengthVolumeUoM": "string",
17705
+ "OrderUOMAllowed": [{
17706
+ "AllowedOrderDoseVal": "number",
17707
+ "AllowedOrderDoseUOM": "string",
17708
+ "AllowedOrderDoseVolVal": "number",
17709
+ "AllowedOrderDoseVolUoM": "string"
17726
17710
  }]
17727
17711
  }],
17728
17712
  //Drug Other Attributes
17729
- TrialDrug: "boolean",
17730
- Additive: "boolean",
17731
- ApplicableForCompounding: "boolean",
17732
- DispenseviaprescriptionOnly: "boolean",
17733
- CounsellingRequired: "boolean",
17713
+ "TrialDrug": "boolean",
17714
+ "Additive": "boolean",
17715
+ "ApplicableForCompounding": "boolean",
17716
+ "DispenseviaprescriptionOnly": "boolean",
17717
+ "CounsellingRequired": "boolean",
17734
17718
  //Alternate drugs
17735
- AlternateDrugs: "array",
17719
+ "AlternateDrugs": "array",
17736
17720
  //INSTRUCTIONS
17737
- Instruction_FrequencyRules: [{
17738
- _id: "string",
17739
- id: "number",
17740
- encountertype: "string",
17741
- gendercode: "string",
17742
- agegroup: "string",
17743
- agecatgcode: "array",
17744
- OrderInstr: [{
17745
- patientInst: "string",
17746
- practionerInst: "string",
17747
- prepInstr: "string",
17748
- deptInstr: "string"
17721
+ "Instruction_FrequencyRules": [{
17722
+ "_id": "string",
17723
+ "id": "number",
17724
+ "encountertype": "string",
17725
+ "gendercode": "string",
17726
+ "agegroup": "string",
17727
+ "agecatgcode": "array",
17728
+ "OrderInstr": [{
17729
+ "patientInst": "string",
17730
+ "practionerInst": "string",
17731
+ "prepInstr": "string",
17732
+ "deptInstr": "string"
17749
17733
  }],
17750
- setuptypeInd: "string",
17734
+ "setuptypeInd": "string",
17751
17735
  //No use
17752
- serviceapplicability: "string",
17753
- ordercatalog: "string",
17754
- freqappl: "boolean",
17755
- dfltfreqValue: "number",
17736
+ "serviceapplicability": "string",
17737
+ "ordercatalog": "string",
17738
+ "freqappl": "boolean",
17739
+ "dfltfreqValue": "number",
17756
17740
  //Default Frequency number
17757
- dfltfreqValueUnit: "string",
17741
+ "dfltfreqValueUnit": "string",
17758
17742
  //Default Frequency sel
17759
- dfltfreqRate: "number",
17743
+ "dfltfreqRate": "number",
17760
17744
  //Dose number
17761
- dfltfreqRateUnit: "string",
17745
+ "dfltfreqRateUnit": "string",
17762
17746
  //Dose select
17763
- dfltduration: "number",
17747
+ "dfltduration": "number",
17764
17748
  //valu
17765
- dfltdurationType: "string",
17749
+ "dfltdurationType": "string",
17766
17750
  //select
17767
- maxdurnallowedinDays: "number"
17751
+ "maxdurnallowedinDays": "number"
17768
17752
  }],
17769
17753
  //FREQUENCY RULES
17770
17754
  //DISPENSE RULES
17771
- DrugDispRules: [{
17772
- _id: "string",
17773
- id: "number",
17774
- DrugCode: "string",
17775
- MaxDispDurnRulebyEnctype: [{
17776
- EncounterType: "string",
17777
- MaxDispDurationVal: "number",
17778
- MaxDispDurationUOM: "string",
17779
- Action: "string",
17780
- ActionMessage: "string",
17781
- Status: "boolean"
17755
+ "DrugDispRules": [{
17756
+ "_id": "string",
17757
+ "id": "number",
17758
+ "DrugCode": "string",
17759
+ "MaxDispDurnRulebyEnctype": [{
17760
+ "EncounterType": "string",
17761
+ "MaxDispDurationVal": "number",
17762
+ "MaxDispDurationUOM": "string",
17763
+ "Action": "string",
17764
+ "ActionMessage": "string",
17765
+ "Status": "boolean"
17782
17766
  }]
17783
17767
  }],
17784
17768
  //STATUS
17785
- Status: "string",
17786
- EffectiveFrom: "number",
17787
- EffectiveTo: "number",
17788
- InactiveReason: "string",
17789
- draftstatus: "boolean",
17769
+ "Status": "string",
17770
+ "EffectiveFrom": "number",
17771
+ "EffectiveTo": "number",
17772
+ "InactiveReason": "string",
17773
+ "draftstatus": "boolean",
17790
17774
  //No use
17791
- Charge: "boolean",
17792
- OrderUOMAllowed: "string",
17793
- DoseRoundUpVal: "number",
17794
- AdminUOM: "string",
17795
- TotalVolContent: "string",
17796
- TotalVolContentUoM: "string"
17775
+ "Charge": "boolean",
17776
+ "OrderUOMAllowed": "string",
17777
+ "DoseRoundUpVal": "number",
17778
+ "AdminUOM": "string",
17779
+ "TotalVolContent": "string",
17780
+ "TotalVolContentUoM": "string"
17797
17781
  }, _defineProperty(_doc, "FormCode", "string"), _defineProperty(_doc, "IVFluid", "boolean"), _defineProperty(_doc, "DfltInfuseOverDurationvalue", "number"), _defineProperty(_doc, "DfltInfuseOverDurationType", "string"), _defineProperty(_doc, "DfltFluidCode", "string"), _defineProperty(_doc, "InactiveDate", "number"), _defineProperty(_doc, "InactiveByid", "string"), _defineProperty(_doc, "DispenseAlternateDrug", "boolean"), _defineProperty(_doc, "SpecialInstructionText", "array"), _defineProperty(_doc, "DrugImageID", "number"), _defineProperty(_doc, "DrugItem", "boolean"), _defineProperty(_doc, "SourceOfDrugOrderCatalog", "string"), _defineProperty(_doc, "DrugGenericId", "string"), _defineProperty(_doc, "IngredientListId", "string"), _defineProperty(_doc, "statusactive", "boolean"), _doc)
17798
17782
  }],
17799
- status_update_drug_master: function status_update_drug_master(key, status) {
17783
+ status_update_drug_master: function status_update_drug_master(data) {
17800
17784
  return [{
17801
- db_name: dbName$1,
17802
- entity: "DrugMaster",
17803
- filter: {
17804
- _key: key
17785
+ "db_name": dbName$1,
17786
+ "entity": "DrugMaster",
17787
+ "filter": {
17788
+ "_id": data._id
17805
17789
  },
17806
- is_metadata: true,
17807
- metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd",
17808
- doc: {
17809
- status: status
17790
+ "is_metadata": true,
17791
+ "metadataId": "04ecb73d-f048-44ce-8563-c9be015812dd",
17792
+ "doc": {
17793
+ "statusactive": data.status
17810
17794
  }
17811
17795
  }];
17812
17796
  },
@@ -17819,20 +17803,20 @@ var queries$f = {
17819
17803
  // "return_fields": "merge(DrugMaster,{Status:document(DrugMaster.Status).display},{DrugClass:document(DrugMaster.DrugClass)},{DrugType:document(DrugMaster.DrugType)},{DrugCategory:document(DrugMaster.DrugCategory)},{FormCode:document(DrugMaster.FormCode)},{DefaultRouteCode:document(DrugMaster.DefaultRouteCode)},{RoutesAllowed:document(DrugMaster.RoutesAllowed)},{DfltInfuseOverDurationType:document(DrugMaster.DfltInfuseOverDurationType)},{Instruction: (for i in CA_OrderCatalogByEncounterTypeAge filter i._id in DrugMaster.Instruction return merge(i,{encountertype: (for en in CodingMaster filter en._id == i.encountertype return en)},{gendercode:(for gen in CodingMaster filter gen._id == i.gendercode return gen)},{agegroup:(for ag in AgeRanges filter ag._id == i.agegroup return ag)},{agecatgcode:(for ac in AgeCategory filter ac._id in i.agecatgcode return ac)},{dfltfreqValueUnit:(for df in FrequencyMaster filter df._id == i.dfltfreqValueUnit return df)},{dfltfreqRateUnit:(for dfr in DrugUOM filter dfr._id == i.dfltfreqRateUnit return dfr)},{dfltdurationType:(for ddt in DrugUOM filter ddt._id == i.dfltdurationType return ddt)}))},{FrequencyRules: (for fr in DrugDefaultFeqRules filter fr._id in DrugMaster.FrequencyRules return merge(fr,{DfltFreqbyPatAttrib:(for dfpa in fr.DfltFreqbyPatAttrib return merge(dfpa,{encountertype:document(dfpa.encountertype)},{AgeCatgCode:document(dfpa.AgeCatgCode)},{DfltInfuseOverDurationType:document(dfpa.DfltInfuseOverDurationType)},{agegroup:document(dfpa.agegroup)},{ageunit:document(dfpa.ageunit)},{dfltdoseUOM:document(dfpa.dfltdoseUOM)},{dfltdurnUOM:document(dfpa.dfltdurnUOM)},{dfltfreqcode:document(dfpa.dfltfreqcode)}))}))},{DrugDispRules:(for dd in DrugDispRules filter dd._id in DrugMaster.DrugDispRules return merge(dd,{MaxDispDurnRulebyEnctype: (for mdd in dd.MaxDispDurnRulebyEnctype return merge(mdd,{Action:(document(mdd.Action).display)},{EncounterType:(for etype in CodingMaster filter etype._id == mdd.EncounterType return etype)},{MaxDispDurationUOM:(for mduom in DrugUOM filter mduom._id == mdd.MaxDispDurationUOM return mduom)}))}))},{StrengthValuesPossible:(for dr in DrugMaster.StrengthValuesPossible return merge(dr,{StrengthUOM:(document(dr.StrengthUOM))},{StrengthVolumeUoM:(document(dr.StrengthVolumeUoM))},{OrderUOMAllowed:(for od in dr.OrderUOMAllowed return merge(od,{AllowedOrderDoseUOM:(document(od.AllowedOrderDoseUOM))},{AllowedOrderDoseVolUoM:(document(od.AllowedOrderDoseVolUoM))}))}))})"
17820
17804
  // }
17821
17805
  return {
17822
- db_name: dbName$1,
17823
- entity: "DrugMaster",
17824
- filter: "DrugMaster.activestatus==true && DrugMaster._id=='".concat(_id, "'"),
17825
- return_fields: "merge(DrugMaster,{Status:document(DrugMaster.Status).display},{DrugClass:document(DrugMaster.DrugClass)},{DrugType:document(DrugMaster.DrugType)},{DrugCategory:document(DrugMaster.DrugCategory)},{FormCode:document(DrugMaster.FormCode)},{DefaultRouteCode:document(DrugMaster.DefaultRouteCode)},{RoutesAllowed:document(DrugMaster.RoutesAllowed)},{DfltInfuseOverDurationType:document(DrugMaster.DfltInfuseOverDurationType)},{Instruction: (for i in CA_OrderCatalogByEncounterTypeAge filter i._id in DrugMaster.Instruction return merge(i,{encountertype: (for en in CodingMaster filter en._id == i.encountertype return en)},{gendercode:(for gen in CodingMaster filter gen._id == i.gendercode return gen)},{agegroup:(for ag in AgeRanges filter ag._id == i.agegroup return ag)},{agecatgcode:(for ac in AgeCategory filter ac._id in i.agecatgcode return ac)},{dfltfreqValueUnit:(for df in FrequencyMaster filter df._id == i.dfltfreqValueUnit return df)},{dfltfreqRateUnit:(for dfr in DrugUOM filter dfr._id == i.dfltfreqRateUnit return dfr)},{dfltdurationType:(for ddt in DrugUOM filter ddt._id == i.dfltdurationType return ddt)}))},{FrequencyRules: (for fr in DrugDefaultFeqRules filter fr._id in DrugMaster.FrequencyRules return merge(fr,{DfltFreqbyPatAttrib:(for dfpa in fr.DfltFreqbyPatAttrib return merge(dfpa,{encountertype:document(dfpa.encountertype)},{AgeCatgCode:document(dfpa.AgeCatgCode)},{DfltInfuseOverDurationType:document(dfpa.DfltInfuseOverDurationType)},{agegroup:document(dfpa.agegroup)},{ageunit:document(dfpa.ageunit)},{dfltdoseUOM:document(dfpa.dfltdoseUOM)},{dfltdurnUOM:document(dfpa.dfltdurnUOM)},{dfltfreqcode:document(dfpa.dfltfreqcode)}))}))},{mappedItems:(for SIDC in StockItemsbyDrugCode filter SIDC._id in DrugMaster.mappedItems return merge(SIDC, {StockItemCodes:(for ssidc in SIDC.StockItemCodes return merge (ssidc,{stkitemcode:(for sic in DrugItemMaster filter sic._id ==ssidc.stkitemcode return {_id:sic._id,id:sic.id,itemcode:sic.itemcode,shortdesc:sic.shortdesc,longdesc:sic.longdesc})} ))}))},{DrugDispRules:(for dd in DrugDispRules filter dd._id in DrugMaster.DrugDispRules return merge(dd,{MaxDispDurnRulebyEnctype: (for mdd in dd.MaxDispDurnRulebyEnctype return merge(mdd,{Action:(document(mdd.Action).display)},{EncounterType:(for etype in CodingMaster filter etype._id == mdd.EncounterType return etype)},{MaxDispDurationUOM:(for mduom in DrugUOM filter mduom._id == mdd.MaxDispDurationUOM return mduom)}))}))},{StrengthValuesPossible:(for dr in DrugMaster.StrengthValuesPossible return merge(dr,{StrengthUOM:(document(dr.StrengthUOM))},{StrengthVolumeUoM:(document(dr.StrengthVolumeUoM))},{OrderUOMAllowed:(for od in dr.OrderUOMAllowed return merge(od,{AllowedOrderDoseUOM:(document(od.AllowedOrderDoseUOM))},{AllowedOrderDoseVolUoM:(document(od.AllowedOrderDoseVolUoM))}))}))})"
17806
+ "db_name": dbName$1,
17807
+ "entity": "DrugMaster",
17808
+ "filter": "DrugMaster.activestatus==true && DrugMaster._id=='".concat(_id, "'"),
17809
+ "return_fields": "merge(DrugMaster,{Status:document(DrugMaster.Status).display},{DrugClass:document(DrugMaster.DrugClass)},{DrugType:document(DrugMaster.DrugType)},{DrugCategory:document(DrugMaster.DrugCategory)},{FormCode:document(DrugMaster.FormCode)},{DefaultRouteCode:document(DrugMaster.DefaultRouteCode)},{RoutesAllowed:document(DrugMaster.RoutesAllowed)},{DfltInfuseOverDurationType:document(DrugMaster.DfltInfuseOverDurationType)},{Instruction: (for i in CA_OrderCatalogByEncounterTypeAge filter i._id in DrugMaster.Instruction return merge(i,{encountertype: (for en in CodingMaster filter en._id == i.encountertype return en)},{gendercode:(for gen in CodingMaster filter gen._id == i.gendercode return gen)},{agegroup:(for ag in AgeRanges filter ag._id == i.agegroup return ag)},{agecatgcode:(for ac in AgeCategory filter ac._id in i.agecatgcode return ac)},{dfltfreqValueUnit:(for df in FrequencyMaster filter df._id == i.dfltfreqValueUnit return df)},{dfltfreqRateUnit:(for dfr in DrugUOM filter dfr._id == i.dfltfreqRateUnit return dfr)},{dfltdurationType:(for ddt in DrugUOM filter ddt._id == i.dfltdurationType return ddt)}))},{FrequencyRules: (for fr in DrugDefaultFeqRules filter fr._id in DrugMaster.FrequencyRules return merge(fr,{DfltFreqbyPatAttrib:(for dfpa in fr.DfltFreqbyPatAttrib return merge(dfpa,{encountertype:document(dfpa.encountertype)},{AgeCatgCode:document(dfpa.AgeCatgCode)},{DfltInfuseOverDurationType:document(dfpa.DfltInfuseOverDurationType)},{agegroup:document(dfpa.agegroup)},{ageunit:document(dfpa.ageunit)},{dfltdoseUOM:document(dfpa.dfltdoseUOM)},{dfltdurnUOM:document(dfpa.dfltdurnUOM)},{dfltfreqcode:document(dfpa.dfltfreqcode)}))}))},{mappedItems:(for SIDC in StockItemsbyDrugCode filter SIDC._id in DrugMaster.mappedItems return merge(SIDC, {StockItemCodes:(for ssidc in SIDC.StockItemCodes return merge (ssidc,{stkitemcode:(for sic in DrugItemMaster filter sic._id ==ssidc.stkitemcode return {_id:sic._id,id:sic.id,itemcode:sic.itemcode,shortdesc:sic.shortdesc,longdesc:sic.longdesc})} ))}))},{DrugDispRules:(for dd in DrugDispRules filter dd._id in DrugMaster.DrugDispRules return merge(dd,{MaxDispDurnRulebyEnctype: (for mdd in dd.MaxDispDurnRulebyEnctype return merge(mdd,{Action:(document(mdd.Action).display)},{EncounterType:(for etype in CodingMaster filter etype._id == mdd.EncounterType return etype)},{MaxDispDurationUOM:(for mduom in DrugUOM filter mduom._id == mdd.MaxDispDurationUOM return mduom)}))}))},{StrengthValuesPossible:(for dr in DrugMaster.StrengthValuesPossible return merge(dr,{StrengthUOM:(document(dr.StrengthUOM))},{StrengthVolumeUoM:(document(dr.StrengthVolumeUoM))},{OrderUOMAllowed:(for od in dr.OrderUOMAllowed return merge(od,{AllowedOrderDoseUOM:(document(od.AllowedOrderDoseUOM))},{AllowedOrderDoseVolUoM:(document(od.AllowedOrderDoseVolUoM))}))}))})"
17826
17810
  };
17827
17811
  },
17828
17812
  age_category_by_id: function age_category_by_id(ids) {
17829
17813
  // ['${AllowedUnit.join("','")}']
17830
17814
  return {
17831
- db_name: dbName$1,
17832
- entity: "AgeCategory",
17833
- filter: "AgeCategory.activestatus == true && AgeCategory._id in ['".concat(ids.join("','"), "']"),
17834
- return_fields: "{id:AgeCategory.id, _id:AgeCategory._id, code:AgeCategory.code, age_minimum:AgeCategory.age_minimum, age_maximum:AgeCategory.age_maximum, description:AgeCategory.description,UOM:document(document(AgeCategory.UOM).coding)}",
17835
- sort: "AgeCategory.description"
17815
+ "db_name": dbName$1,
17816
+ "entity": "AgeCategory",
17817
+ "filter": "AgeCategory.activestatus == true && AgeCategory._id in ['".concat(ids.join("','"), "']"),
17818
+ "return_fields": "{id:AgeCategory.id, _id:AgeCategory._id, code:AgeCategory.code, age_minimum:AgeCategory.age_minimum, age_maximum:AgeCategory.age_maximum, description:AgeCategory.description,UOM:document(document(AgeCategory.UOM).coding)}",
17819
+ "sort": "AgeCategory.description"
17836
17820
  };
17837
17821
  },
17838
17822
  ageCategory: function ageCategory(ageRangeId) {
@@ -17844,354 +17828,43 @@ var queries$f = {
17844
17828
  },
17845
17829
  return_fields: "DOCUMENT( AgeRanges.AgeCategory)"
17846
17830
  };
17847
- },
17848
- entityNameOptionsQuery: function entityNameOptionsQuery() {
17849
- var entityTypeCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "OT003";
17850
- return {
17851
- db_name: dbName$1,
17852
- entity: "Organization",
17853
- filter: "FIRST(DOCUMENT(Organization.OrgType)[*].code) == '".concat(entityTypeCode, "' && Organization.active==true && Organization.activestatus== true"),
17854
- return_fields: "KEEP(Organization,'_id','id','_key','name','entitycode','active','activestatus','isExternal')"
17855
- };
17856
17831
  }
17857
17832
  };
17858
- var masterNewQuery = {
17859
- code_standara: function code_standara() {
17860
- return {
17861
- db_name: dbName$1,
17862
- entity: "CodingMaster",
17863
- filter: "CodingMaster.Type=='DBSOURCE' && CodingMaster.activestatus==true && CodingMaster.status == true",
17864
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
17865
- sort: "CodingMaster.shortdesc"
17866
- };
17867
- },
17868
- drug_category: function drug_category() {
17869
- return {
17870
- db_name: dbName$1,
17871
- entity: "DrugCategory",
17872
- filter: "DrugCategory.activestatus == true && DrugCategory.status==true",
17873
- return_fields: "KEEP(DrugCategory,'_key','_id','id','drugcategory','shortdesc','longdesc','status','activestatus')",
17874
- sort: "DrugCategory.longdesc"
17875
- };
17876
- },
17877
- drug_class: function drug_class() {
17878
- return {
17879
- db_name: dbName$1,
17880
- entity: "DrugClass",
17881
- filter: "DrugClass.activestatus == true && DrugClass.status == true",
17882
- return_fields: "KEEP(DrugClass,'_key','_id','id','drugclass','shortdesc','longdesc','status','activestatus')",
17883
- sort: "DrugClass.longdesc"
17884
- };
17885
- },
17886
- drug_generic: function drug_generic() {
17887
- return {
17888
- db_name: dbName$1,
17889
- entity: "GenericDrugMaster",
17890
- filter: "GenericDrugMaster.activestatus == true ",
17891
- limit: {
17892
- count: 20,
17893
- offset: 0
17894
- },
17895
- return_fields: "keep(GenericDrugMaster,'id','_id','longdesc','shortdesc','activestatus','mappedextsourcedb')",
17896
- sort: "GenericDrugMaster.shortdesc"
17897
- };
17898
- },
17899
- drug_type: function drug_type() {
17900
- return {
17901
- db_name: dbName$1,
17902
- entity: "DrugType",
17903
- filter: "DrugType.status==true && DrugType.activestatus == true ",
17904
- return_fields: "KEEP(DrugType,'_key','_id','id','drugtype','shortdesc','longdesc','status','activestatus')",
17905
- sort: "DrugType.longdesc"
17906
- };
17907
- },
17908
- form: function form() {
17909
- return {
17910
- db_name: dbName$1,
17911
- entity: "DosageForm",
17912
- filter: "DosageForm.activestatus == true && DosageForm.status==true",
17913
- return_fields: "KEEP(DosageForm,'_key','_id','id','dosageform','shortdesc','longdesc','status','activestatus')",
17914
- sort: "DosageForm.longdesc"
17915
- };
17916
- },
17917
- synonym_type: function synonym_type() {
17918
- return {
17919
- db_name: dbName$1,
17920
- entity: "CodingMaster",
17921
- filter: "CodingMaster.Type=='SYNONYMTYPE' && CodingMaster.activestatus==true && CodingMaster.status==true",
17922
- return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')",
17923
- sort: "CodingMaster.display"
17924
- };
17925
- },
17926
- source: function source() {
17927
- return {
17928
- db_name: dbName$1,
17929
- entity: "CodingMaster",
17930
- filter: "CodingMaster.Type=='ALIASSOURCE' && CodingMaster.activestatus==true && CodingMaster.status==true",
17931
- return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')",
17932
- sort: "CodingMaster.display"
17933
- };
17934
- },
17935
- drug_uom: function drug_uom() {
17936
- return {
17937
- db_name: dbName$1,
17938
- entity: "CodingMaster",
17939
- filter: "CodingMaster.Type=='DRUGUOMCODE' && CodingMaster.activestatus==true && CodingMaster.status == true",
17940
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
17941
- sort: "CodingMaster.shortdesc"
17942
- };
17943
- },
17944
- default_route: function default_route() {
17945
- return {
17946
- db_name: dbName$1,
17947
- entity: "DrugRoutes",
17948
- filter: "DrugRoutes.activestatus==true && DrugRoutes.status == true",
17949
- return_fields: "kEEP(DrugRoutes,'id','_id','_key','routecode','shortdesc','longdesc','status','activestatus')",
17950
- sort: "DrugRoutes.shortdesc"
17951
- };
17952
- },
17953
- frequency: function frequency() {
17954
- return {
17955
- db_name: dbName$1,
17956
- entity: "FrequencyMaster",
17957
- filter: "FrequencyMaster.activestatus==true && FrequencyMaster.status == true",
17958
- return_fields: "kEEP(FrequencyMaster,'id','_id','_key','freqcode','shortdesc','longdesc','status','activestatus')",
17959
- sort: "CodingMaster.shortdesc"
17960
- };
17961
- },
17962
- routes_allowed: function routes_allowed() {
17963
- return {
17964
- db_name: dbName$1,
17965
- entity: "DrugRoutes",
17966
- filter: "DrugRoutes.activestatus==true && DrugRoutes.status == true",
17967
- return_fields: "kEEP(DrugRoutes,'id','_id','_key','routecode','shortdesc','longdesc','status','activestatus')",
17968
- sort: "DrugRoutes.shortdesc"
17969
- };
17970
- },
17971
- drug_followUom: function drug_followUom() {
17972
- return {
17973
- db_name: dbName$1,
17974
- entity: "CodingMaster",
17975
- filter: "CodingMaster.Type=='FOLLOWUOM' && CodingMaster.activestatus==true && CodingMaster.status == true",
17976
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
17977
- sort: "CodingMaster.shortdesc"
17978
- };
17979
- },
17980
- action: function action() {
17981
- return {
17982
- db_name: dbName$1,
17983
- entity: "CodingMaster",
17984
- filter: "CodingMaster.Type=='DRUGACTION' && CodingMaster.activestatus==true && CodingMaster.status == true",
17985
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
17986
- sort: "CodingMaster.shortdesc"
17987
- };
17988
- },
17989
- instruction_type: function instruction_type() {
17990
- return {
17991
- db_name: dbName$1,
17992
- entity: "CodingMaster",
17993
- filter: "CodingMaster.Type=='INSTRUCTIONTYPE' && CodingMaster.activestatus==true && CodingMaster.status==true",
17994
- return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')",
17995
- sort: "CodingMaster.display"
17996
- };
17997
- },
17998
- drug_status: function drug_status() {
17999
- return {
18000
- db_name: dbName$1,
18001
- entity: "CodingMaster",
18002
- filter: "CodingMaster.Type=='DRUGSTATUS' && CodingMaster.activestatus==true && CodingMaster.status==true",
18003
- return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')",
18004
- sort: "CodingMaster.display"
18005
- };
18006
- },
18007
- entity_type: function entity_type() {
18008
- return {
18009
- db_name: dbName$1,
18010
- entity: "CodingMaster",
18011
- filter: "CodingMaster.Type=='ORGTYPE' && CodingMaster.activestatus==true && CodingMaster.status == true",
18012
- return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status','shortdesc','activestatus')",
18013
- sort: "CodingMaster.display"
18014
- };
18015
- },
18016
- applicability: function applicability() {
18017
- return {
18018
- db_name: dbName$1,
18019
- entity: "CodingMaster",
18020
- filter: "CodingMaster.Type=='APPLICABLEUOM' && CodingMaster.activestatus==true && CodingMaster.status==true",
18021
- return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')",
18022
- sort: "CodingMaster.display"
18023
- };
18024
- },
18025
- privilege_type: function privilege_type() {
18026
- return {
18027
- db_name: dbName$1,
18028
- entity: "CodingMaster",
18029
- filter: "CodingMaster.Type == 'PRIVILEGETYPE' && CodingMaster.activestatus==true && CodingMaster.status == true",
18030
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
18031
- sort: "CodingMaster.shortdesc"
18032
- };
18033
- },
18034
- rule_type: function rule_type() {
18035
- return {
18036
- db_name: dbName$1,
18037
- entity: "CodingMaster",
18038
- filter: "CodingMaster.Type == 'RULETYPE' && CodingMaster.activestatus==true && CodingMaster.status == true",
18039
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
18040
- sort: "CodingMaster.shortdesc"
18041
- };
18042
- },
18043
- round_off_type: function round_off_type() {
18044
- return {
18045
- db_name: dbName$1,
18046
- entity: "CodingMaster",
18047
- filter: "CodingMaster.Type=='ROUNDOFFTYPE' && CodingMaster.activestatus==true && CodingMaster.status==true",
18048
- return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')",
18049
- sort: "CodingMaster.display"
18050
- };
18051
- },
18052
- drug_code: function drug_code() {
18053
- return {
18054
- db_name: dbName$1,
18055
- entity: "DrugMaster",
18056
- filter: "DrugMaster.activestatus == true ",
18057
- limit: {
18058
- count: 20,
18059
- offset: 0
18060
- },
18061
- return_fields: "keep(DrugMaster,'_id','id','_key','DrugCode','ShortDesc','StrengthValuesPossible','activestatus')",
18062
- sort: "DrugMaster.shortdesc"
18063
- };
18064
- },
18065
- item_code: function item_code(_ref) {
18066
- var id = _ref.id;
18067
- return {
18068
- db_name: dbName$1,
18069
- entity: "DrugMaster",
18070
- filter: "DrugMaster._id !='".concat(id, "' && DrugMaster.activestatus == true && DrugMaster.IsDispensible == true"),
18071
- limit: {
18072
- count: 20,
18073
- offset: 0
18074
- },
18075
- return_fields: "keep(DrugMaster,'_id','id','_key','DrugCode', 'ShortDesc','StrengthValuesPossible','activestatus')",
18076
- sort: "DrugMaster.shortdesc"
18077
- };
18078
- },
18079
- return_reason: function return_reason() {
18080
- return {
18081
- db_name: dbName$1,
18082
- entity: "CodingMaster",
18083
- filter: "CodingMaster.Type=='MEDRETURNREASON' && CodingMaster.activestatus==true && CodingMaster.status==true",
18084
- return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')",
18085
- sort: "CodingMaster.display"
18086
- };
18087
- },
18088
- duration_uom: function duration_uom() {
18089
- return {
18090
- db_name: dbName$1,
18091
- entity: "CodingMaster",
18092
- filter: "CodingMaster.Type=='DURATIONUOM' && CodingMaster.activestatus==true && CodingMaster.status == true",
18093
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
18094
- sort: "CodingMaster.shortdesc"
18095
- };
18096
- }
18097
- };
18098
- var drugCatalogMasterQuery = {
18099
- drugCatalogMasterRead: function drugCatalogMasterRead(page, perPage) {
18100
- var searchQuery = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
18101
- return {
18102
- db_name: dbName$1,
18103
- entity: "DrugMaster",
18104
- filter: "(LIKE(DrugMaster.DrugCode,'%".concat(searchQuery, "%',true) || LIKE(document(DrugMaster.DrugType).longdesc,'%").concat(searchQuery, "%',true) || LIKE(DrugMaster.ShortDesc,'%").concat(searchQuery, "%',true)) && DrugMaster.activestatus == true "),
18105
- limit: {
18106
- count: perPage,
18107
- offset: page
18108
- },
18109
- return_fields: "merge(DrugMaster,{DrugCode:DrugMaster.DrugCode},{Count:count( for drgmst in DrugMaster filter (LIKE(drgmst.DrugCode,'%".concat(searchQuery, "%',true) || LIKE(document(drgmst.DrugType).longdesc,'%").concat(searchQuery, "%',true) || LIKE(drgmst.ShortDesc,'%").concat(searchQuery, "%',true)) && drgmst.activestatus == true return drgmst._id )},{ShortDesc:DrugMaster.ShortDesc},{DrugClass:DOCUMENT(DrugMaster.DrugClass)},{DrugType:DOCUMENT(DrugMaster.DrugType)},{DrugCategory:DOCUMENT(DrugMaster.DrugCategory)},{FormCode:DOCUMENT(DrugMaster.FormCode)},{StrengthValuesPossible:(for strValPoss in to_array(DrugMaster.StrengthValuesPossible) return merge(strValPoss,{StrengthUOM:document(strValPoss.StrengthUOM)},{StrengthVolumeUoM:document(strValPoss.StrengthVolumeUoM)},{OrderUOMAllowed:(for OrderUOMAllowed in to_array(strValPoss.OrderUOMAllowed) return merge(OrderUOMAllowed,{AllowedOrderDoseUOM:document(OrderUOMAllowed.AllowedOrderDoseUOM)},{AllowedOrderDoseVolUoM:document(OrderUOMAllowed.AllowedOrderDoseVolUoM)}))}))},{RoutesAllowed:document(DrugMaster.RoutesAllowed)})"),
18110
- sort: "DrugMaster.createddate desc"
18111
- };
18112
- },
18113
- drugCatalogMasterSingleRead: function drugCatalogMasterSingleRead(id) {
18114
- return {
18115
- db_name: dbName$1,
18116
- entity: "DrugMaster",
18117
- filter: "DrugMaster._id == '".concat(id, "' && DrugMaster.activestatus == true"),
18118
- return_fields: "merge(DrugMaster,{DrugClass:document(DrugMaster.DrugClass)},{DrugType:DOCUMENT(DrugMaster.DrugType)},{DrugGenericId:DOCUMENT(DrugMaster.DrugGenericId)},{DrugCategory:DOCUMENT(DrugMaster.DrugCategory)},{StrengthValuesPossible:(for strValPoss in to_array(DrugMaster.StrengthValuesPossible) return merge(strValPoss,{StrengthUOM:document(strValPoss.StrengthUOM)},{StrengthVolumeUoM:document(strValPoss.StrengthVolumeUoM)},{OrderUOMAllowed:(for OrderUOMAllowed in to_array(strValPoss.OrderUOMAllowed) return merge(OrderUOMAllowed,{AllowedOrderDoseUOM:document(OrderUOMAllowed.AllowedOrderDoseUOM)},{AllowedOrderDoseVolUoM:document(OrderUOMAllowed.AllowedOrderDoseVolUoM)}))}))},{TotalVolContentUoM:(for DrugUOM in to_array(document(DrugMaster.TotalVolContentUoM)) return merge(DrugUOM,{UOMType:document(DrugUOM.UOMType)}))},{FormCode:DOCUMENT(DrugMaster.FormCode)},{DefaultRouteCode:DOCUMENT(DrugMaster.DefaultRouteCode)},{RoutesAllowed:document(DrugMaster.RoutesAllowed)},{AlternateDrugs:DOCUMENT(DrugMaster.AlternateDrugs)},{GenericIngrListId:DOCUMENT(DrugMaster.GenericIngrListId)},{DrugDispRules:(for DrugDispRules in to_array(document(DrugMaster.DrugDispRules)) return merge(DrugDispRules,{Action:document(DrugDispRules.Action)},{maxDispDurationUOM:document(DrugDispRules.maxDispDurationUOM)},{dfltDispDurationUOM:document(DrugDispRules.dfltDispDurationUOM)}))},{FrequencyRules:(for FrequencyRules in to_array(document(DrugMaster.FrequencyRules)) return merge(FrequencyRules,{freqcode:document(FrequencyRules.freqcode) },{durnUOM:document(FrequencyRules.durnUOM)},{doseUOM:document(FrequencyRules.doseUOM)},{InfuseOverDurType:document(FrequencyRules.InfuseOverDurType)},{InfuseRateUom:document(FrequencyRules.InfuseRateUom)}))},{mappedItems:(for mappedItems in to_array(DrugMaster.mappedItems) return merge(mappedItems,{dispensedrugcode:document(mappedItems.dispensedrugcode)}))},{codeStandard:DOCUMENT(DrugMaster.codeStandard)},{entityLevelStatus:(for entityLevelStatus in to_array(document(DrugMaster.entityLevelStatus)) return merge(entityLevelStatus,{status:document(entityLevelStatus.status)},{entityCode:document(entityLevelStatus.entityCode)},{entityType:document(entityLevelStatus.entityType)}))},{packSizeApplicability:(for packSizeApplicability in to_array(document(DrugMaster.packSizeApplicability)) return merge(packSizeApplicability,{applicableInd:document(packSizeApplicability.applicableInd)},{roundtype:document(packSizeApplicability.roundtype)},{applicablityUOM:document(packSizeApplicability.applicablityUOM)},{packSizeUoM:document(packSizeApplicability.packSizeUoM)},{packUnitUoM:document(packSizeApplicability.packUnitUoM)}))},{aliasDtls:(for aliasDtls in to_array(DrugMaster.aliasDtls) return merge(aliasDtls,{aliasType:document(aliasDtls.aliasType)}) )},{instrDtls:(for instrDtls in to_array(DrugMaster.instrDtls) return merge(instrDtls,{instrType:document(instrDtls.instrType)}))},{drugSynonyms:(for drugSynonyms in to_array(DrugMaster.drugSynonyms) return merge(drugSynonyms,{synonymType:document(drugSynonyms.synonymType)}))},{photo:(for ph in document(to_array(DrugMaster.photo)) return ph)},{baseStkUoM:document(DrugMaster.baseStkUoM)},{compondCompDTls:(for compondCompDTls in to_array(DrugMaster.compondCompDTls) return merge(compondCompDTls,{compDrugCode:(for compDrugCode in to_array(compondCompDTls.compDrugCode) return document(compDrugCode))},{compQtyUom:document(compondCompDTls.compQtyUom)},{compStrengthUOM:document(compondCompDTls.compStrengthUOM)},{compStrengthVolumeUoM:document(compondCompDTls.compStrengthVolumeUoM)} ))},{directiontag:DrugMaster.directiontag},{directiontaglocal:DrugMaster.directiontaglocal},{returnPeriodUOM:document(DrugMaster.returnPeriodUOM)},{newReturnParams:(for nr in to_array(DrugMaster.newReturnParams) return merge(nr,{returnReason:document(nr.returnReason)}))})"
18119
- };
18120
- },
18121
- status_update: function status_update(key, status) {
18122
- return [{
18123
- db_name: dbName$1,
18124
- entity: "DrugMaster",
18125
- filter: {
18126
- _key: key
18127
- },
18128
- is_metadata: true,
18129
- metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd",
18130
- doc: {
18131
- status: status
18132
- }
18133
- }];
18134
- },
18135
- // Alerts & Restrictions Query
18136
- drugRuleType: function drugRuleType() {
18137
- return {
18138
- db_name: dbName$1,
18139
- entity: "CodingMaster",
18140
- filter: "CodingMaster.Type == 'RULETYPE' && CodingMaster.activestatus==true && CodingMaster.status == true",
18141
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
18142
- sort: "CodingMaster.shortdesc"
18143
- };
18144
- },
18145
- drugPrivilegeType: function drugPrivilegeType() {
18146
- return {
18147
- db_name: dbName$1,
18148
- entity: "CodingMaster",
18149
- filter: "CodingMaster.Type == 'PRIVILEGETYPE' && CodingMaster.activestatus==true && CodingMaster.status == true",
18150
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
18151
- sort: "CodingMaster.shortdesc"
18152
- };
18153
- },
18154
- drugServiceApplicabilityType: function drugServiceApplicabilityType() {
18155
- return {
18156
- db_name: dbName$1,
18157
- entity: "CodingMaster",
18158
- filter: "CodingMaster.Type == 'SERVICEAPPLICABILITY' && CodingMaster.activestatus==true && CodingMaster.status == true",
18159
- return_fields: "KEEP(CodingMaster,'_id','id','_key','Type','status','activestatus','shortdesc','display','code')",
18160
- sort: "CodingMaster.shortdesc"
18161
- };
18162
- },
18163
- drugFacilityOptions: function drugFacilityOptions() {
18164
- return {
18165
- db_name: dbName$1,
18166
- entity: "Organization",
18167
- filter: "DOCUMENT(Organization.OrgType)[*].code ANY == 'OT003'",
18168
- return_fields: "{_id:Organization._id,name:Organization.name}"
18169
- };
18170
- },
18171
- drugApprovalWorkflowOptions: function drugApprovalWorkflowOptions() {
18172
- return {
18173
- db_name: dbName$1,
18174
- entity: "queuescenarios",
18175
- filter: "queuescenarios.activestatus==true && queuescenarios.status==true",
18176
- return_fields: "Keep(queuescenarios,'_id','queueid','scenarioid','scenarioname')"
18177
- };
18178
- },
18179
- drugalertRestrictionSingleRead: function drugalertRestrictionSingleRead(id) {
18180
- return {
18181
- db_name: dbName$1,
18182
- entity: "CA_OrderCatalogPrivilegeLevel",
18183
- filter: "CA_OrderCatalogPrivilegeLevel.activestatus == true && CA_OrderCatalogPrivilegeLevel.status==true && CA_OrderCatalogPrivilegeLevel.relationID=='".concat(id, "'"),
18184
- return_fields: "{id:CA_OrderCatalogPrivilegeLevel.id,orgn_code:CA_OrderCatalogPrivilegeLevel.orgn_code,service_applicablity:CA_OrderCatalogPrivilegeLevel.service_applicablity,patient_criteria:CA_OrderCatalogPrivilegeLevel.patient_criteria,pract_criteria:CA_OrderCatalogPrivilegeLevel.pract_criteria,rule_type:CA_OrderCatalogPrivilegeLevel.rule_type,privilege_type:CA_OrderCatalogPrivilegeLevel.privilege_type,alert_test_message:CA_OrderCatalogPrivilegeLevel.alert_test_message,workflow:CA_OrderCatalogPrivilegeLevel.workflow}"
18185
- };
18186
- },
18187
- ruleGroup: function ruleGroup() {
18188
- return {
18189
- db_name: "RuleBuilder",
18190
- entity: "Groups",
18191
- filter: "Groups.activestatus==true",
18192
- return_fields: "{label : Groups.name, value:Groups.id}"
18193
- };
18194
- }
17833
+ var masterQuery$5 = {
17834
+ "drug_class": "{ \n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"DrugClass\",\n \"filter\": \"DrugClass.activestatus == true && DrugClass.status == true\", \n \"return_fields\": \"{id:DrugClass.id, _id:DrugClass._id, drugclass:DrugClass.drugclass, longdesc:DrugClass.longdesc, shortdesc:DrugClass.shortdesc}\",\n \"sort\": \"DrugClass.longdesc\"\n }"),
17835
+ "drug_category": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"DrugCategory\",\n \"filter\":\"DrugCategory.activestatus == true && DrugCategory.status==true\",\n \"return_fields\": \"{id:DrugCategory.id, _id:DrugCategory._id, drugcategory:DrugCategory.drugcategory, longdesc:DrugCategory.longdesc, shortdesc:DrugCategory.shortdesc}\",\n \"sort\": \"DrugCategory.longdesc\"\n }"),
17836
+ "drug_type": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"DrugType\",\n \"filter\":\"DrugType.activestatus == true && DrugType.status==true\",\n \"return_fields\": \"{id:DrugType.id, _id:DrugType._id, drugtype:DrugType.drugtype, longdesc:DrugType.longdesc, shortdesc:DrugType.shortdesc}\",\n \"sort\": \"DrugType.longdesc\"\n }"),
17837
+ "form": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"DosageForm\", \n \"filter\": \"DosageForm.activestatus == true && DosageForm.status==true\",\n \"return_fields\": \"{id:DosageForm.id, _id:DosageForm._id, dosageform:DosageForm.dosageform, longdesc:DosageForm.longdesc, shortdesc:DosageForm.shortdesc}\",\n \"sort\": \"DosageForm.longdesc\"\n }"),
17838
+ // "routes_allowed": `{
17839
+ // "db_name": "${dbName}",
17840
+ // "entity": "CodeableConceptMaster",
17841
+ // "filter": "CodeableConceptMaster.Type=='ROUTE' && CodeableConceptMaster.activestatus==true",
17842
+ // "return_fields": "MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})"
17843
+ // }`,
17844
+ // "default_route": `{
17845
+ // "db_name": "${dbName}",
17846
+ // "entity": "CodeableConceptMaster",
17847
+ // "filter": "CodeableConceptMaster.Type=='ROUTE' && CodeableConceptMaster.activestatus==true",
17848
+ // "return_fields": "MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})"
17849
+ // }`,
17850
+ "routes_allowed": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"DrugRoutes\",\n \"sort\": \"DrugRoutes.shortdesc\",\n \"filter\": \"DrugRoutes.activestatus==true && DrugRoutes.status==true\",\n \"return_fields\": \"KEEP(DrugRoutes,'id','_id','_key','routecode','shortdesc','longdesc','routeadverb')\"\n }"),
17851
+ "default_route": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"DrugRoutes\",\n \"sort\": \"DrugRoutes.shortdesc\",\n \"filter\": \"DrugRoutes.activestatus==true && DrugRoutes.status==true\",\n \"return_fields\": \"KEEP(DrugRoutes,'id','_id','_key','routecode','shortdesc','longdesc','routeadverb')\"\n }"),
17852
+ "drug_UOM": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"DrugUOM\",\n \"sort\": \"DrugUOM.shortdesc\",\n \"filter\": \"DrugUOM.activestatus == true && DrugUOM.status==true\", \n \"return_fields\": \"{id:DrugUOM.id, _id:DrugUOM._id, UOM:DrugUOM.UOM, longdesc:DrugUOM.longdesc, shortdesc:DrugUOM.shortdesc}\"\n }"),
17853
+ "alternate_drug_code": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"DrugMaster\",\n \"sort\": \"DrugMaster.ShortDesc\",\n \"filter\": \"DrugMaster.activestatus == true && DrugMaster.DrugCode != 'MA007'\",\n \"return_fields\": \"{_id:DrugMaster._id,id:DrugMaster.id,DrugCode:DrugMaster.DrugCode,ShortDesc:DrugMaster.ShortDesc,LongDesc:DrugMaster.LongDesc}\"\n }"),
17854
+ "encounter_type": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\": \"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='ENCOUNTERTYPE' && CodeableConceptMaster.activestatus==true\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
17855
+ "gender": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\": \"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='GENDER' && CodeableConceptMaster.activestatus==true\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
17856
+ // "age_range_group": `{
17857
+ // "db_name": "${dbName}",
17858
+ // "entity": "AgeRanges",
17859
+ // "filter":"AgeRanges.activestatus == true && AgeRanges.status==true",
17860
+ // "return_fields": "{id:AgeRanges.id, _id:AgeRanges._id, agerangecode:AgeRanges.agerangecode, longdesc:AgeRanges.longdesc, shortdesc:AgeRanges.shortdesc}"
17861
+ // }`,
17862
+ "age_range_group": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"AgeRanges\",\n \"sort\":\"AgeRanges.agerangecode\",\n \"filter\":\"AgeRanges.activestatus == true && AgeRanges.status==true\",\n \"return_fields\": \"{id:AgeRanges.id, _id:AgeRanges._id, agerangecode:AgeRanges.agerangecode, longdesc:AgeRanges.longdesc, shortdesc:AgeRanges.shortdesc,AgeCategory:AgeRanges.AgeCategory}\"\n }"),
17863
+ "age_category": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"AgeCategory\",\n \"filter\":\"AgeCategory.activestatus == true\",\n \"return_fields\": \"{id:AgeCategory.id, _id:AgeCategory._id, code:AgeCategory.code, age_minimum:AgeCategory.age_minimum, age_maximum:AgeCategory.age_maximum, description:AgeCategory.description,UOM:document(document(AgeCategory.UOM).coding)}\",\n \"sort\": \"AgeCategory.description\"\n }"),
17864
+ "default_frequency": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"FrequencyMaster\",\n \"sort\": \"FrequencyMaster.shortdesc\",\n \"filter\": \"FrequencyMaster._key != null && FrequencyMaster.longdesc != null && FrequencyMaster.activestatus==true && FrequencyMaster.status==true\",\n \"return_fields\": \"{_id:FrequencyMaster._id,id:FrequencyMaster.id,freqcode:FrequencyMaster.freqcode,longdesc:FrequencyMaster.longdesc,shortdesc:FrequencyMaster.shortdesc}\"\n }"),
17865
+ "actions": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\": \"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='DRUGACTION' && CodeableConceptMaster.activestatus==true\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
17866
+ "status": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\": \"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='DRUGSTATUS' && CodeableConceptMaster.activestatus==true\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
17867
+ "drug_item_master": "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"DrugItemMaster\",\n \"sort\": \"DrugItemMaster.shortdesc\",\n \"filter\": \"DrugItemMaster.activestatus==true && DrugItemMaster.effectivefrom <= DATE_TIMESTAMP(DATE_NOW()/1000) && (DrugItemMaster.effectiveto == 0 || DrugItemMaster.effectiveto == null ? DrugItemMaster.effectiveto==0: DrugItemMaster.effectiveto >= DATE_TIMESTAMP(DATE_NOW()/1000))\",\n \"return_fields\": \"{_id:DrugItemMaster._id,id:DrugItemMaster.id,itemcode:DrugItemMaster.itemcode,shortdesc:DrugItemMaster.shortdesc,longdesc:DrugItemMaster.longdesc,effectivefrom:DrugItemMaster.effectivefrom,effectiveto:DrugItemMaster.effectiveto}\"\n }")
18195
17868
  };
18196
17869
 
18197
17870
  var allowedJsonFun = function allowedJsonFun(val) {
@@ -18862,126 +18535,9 @@ var readDrugMasterJSON = function readDrugMasterJSON(data, state) {
18862
18535
  return json;
18863
18536
  };
18864
18537
 
18865
- var GenerateUpsert = function GenerateUpsert(data) {
18866
- var filter = {};
18867
-
18868
- if (data !== null && data !== void 0 && data.isEdit) {
18869
- filter = {
18870
- filter: {
18871
- _key: data === null || data === void 0 ? void 0 : data._key
18872
- }
18873
- };
18874
- }
18875
-
18876
- return [_objectSpread2(_objectSpread2({
18877
- db_name: dbName$1,
18878
- entity: "DrugMaster",
18879
- is_metadata: true,
18880
- metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd"
18881
- }, filter), {}, {
18882
- doc: {
18883
- id: 0,
18884
- DrugCode: data === null || data === void 0 ? void 0 : data.DrugCode,
18885
- ShortDesc: data === null || data === void 0 ? void 0 : data.ShortDesc,
18886
- LongDesc: data === null || data === void 0 ? void 0 : data.LongDesc,
18887
- // Charge: "boolean",
18888
- DrugClass: data === null || data === void 0 ? void 0 : data.DrugClass,
18889
- DrugType: data === null || data === void 0 ? void 0 : data.DrugType,
18890
- DrugCategory: data === null || data === void 0 ? void 0 : data.DrugCategory,
18891
- StrengthValuesPossible: data === null || data === void 0 ? void 0 : data.StrengthValuesPossible,
18892
- // TotalVolContent: "string",
18893
- // TotalVolContentUoM: "string",
18894
- FormCode: data === null || data === void 0 ? void 0 : data.FormCode,
18895
- DefaultRouteCode: data === null || data === void 0 ? void 0 : data.DefaultRouteCode,
18896
- RoutesAllowed: data === null || data === void 0 ? void 0 : data.RoutesAllowed,
18897
- DispenseviaprescriptionOnly: data === null || data === void 0 ? void 0 : data.DispenseviaprescriptionOnly,
18898
- // IVFluid: "boolean",
18899
- // DfltFluidCode: "string",
18900
- // DispenseAlternateDrug: "boolean",
18901
- // AlternateDrugs: "array",
18902
- // SpecialInstructionText: "array",
18903
- CounsellingRequired: data === null || data === void 0 ? void 0 : data.CounsellingRequired,
18904
- // DrugImageID: "number",
18905
- ApplicableForCompounding: data === null || data === void 0 ? void 0 : data.ApplicableForCompounding,
18906
- Additive: data === null || data === void 0 ? void 0 : data.Additive,
18907
- // SourceOfDrugOrderCatalog: "string",
18908
- DrugGenericId: data === null || data === void 0 ? void 0 : data.DrugGenericId,
18909
- // GenericIngrListId: "string",
18910
- status: data === null || data === void 0 ? void 0 : data.status,
18911
- // statusactive: data?.status,
18912
- DrugDispRules: data === null || data === void 0 ? void 0 : data.DrugDispRules,
18913
- FrequencyRules: data === null || data === void 0 ? void 0 : data.FrequencyRules,
18914
- mappedItems: data === null || data === void 0 ? void 0 : data.mappedItems,
18915
- // drugroutegenid: "string",
18916
- codeStandard: data === null || data === void 0 ? void 0 : data.codeStandard,
18917
- IsDispensible: data === null || data === void 0 ? void 0 : data.IsDispensible,
18918
- entityLevelStatus: data === null || data === void 0 ? void 0 : data.entityLevelStatus,
18919
- packSizeApplicability: data === null || data === void 0 ? void 0 : data.packSizeApplicability,
18920
- aliasDtls: data === null || data === void 0 ? void 0 : data.aliasDtls,
18921
- instrDtls: data === null || data === void 0 ? void 0 : data.instrDtls,
18922
- directiontag: data === null || data === void 0 ? void 0 : data.directiontag,
18923
- directiontaglocal: data === null || data === void 0 ? void 0 : data.directiontaglocal,
18924
- drugSynonyms: data === null || data === void 0 ? void 0 : data.drugSynonyms,
18925
- photo: data === null || data === void 0 ? void 0 : data.photo,
18926
- // baseStkUoM: "string",
18927
- // avgRate: "number",
18928
- compondCompDTls: data === null || data === void 0 ? void 0 : data.compondCompDTls,
18929
- // privilegeID: "array",
18930
- // extDrugGenericId: "string",
18931
- returnApplicable: data === null || data === void 0 ? void 0 : data.returnApplicable,
18932
- returnPeriodVal: data === null || data === void 0 ? void 0 : data.returnPeriodVal,
18933
- returnPeriodUOM: data === null || data === void 0 ? void 0 : data.returnPeriodUOM,
18934
- partialQtyAllow: data === null || data === void 0 ? void 0 : data.partialQtyAllow,
18935
- returnPolicy: data === null || data === void 0 ? void 0 : data.returnPolicy,
18936
- newReturnParams: data === null || data === void 0 ? void 0 : data.newReturnParams
18937
- }
18938
- })];
18939
- };
18940
- var GenerateAlertRestrictionUpsert = function GenerateAlertRestrictionUpsert(data) {
18941
- var filter = {};
18942
-
18943
- if (data !== null && data !== void 0 && data.isEdit) {
18944
- filter = {
18945
- filter: {
18946
- _key: data === null || data === void 0 ? void 0 : data._key
18947
- }
18948
- };
18949
- }
18950
-
18951
- return [_objectSpread2(_objectSpread2({
18952
- db_name: dbName$1,
18953
- entity: "CA_OrderCatalogPrivilegeLevel",
18954
- is_metadata: true,
18955
- metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd"
18956
- }, filter), {}, {
18957
- doc: {
18958
- id: 0,
18959
- orgn_code: data === null || data === void 0 ? void 0 : data.orgn_code,
18960
- service_applicablity: data === null || data === void 0 ? void 0 : data.service_applicablity,
18961
- order_catalog_criteria: data === null || data === void 0 ? void 0 : data.order_catalog_criteria,
18962
- patient_criteria: data === null || data === void 0 ? void 0 : data.patient_criteria,
18963
- pract_criteria: data === null || data === void 0 ? void 0 : data.pract_criteria,
18964
- // appr_leveles: [
18965
- // {
18966
- // appr_level: "string",
18967
- // appr_level_description: "string",
18968
- // approval_authority_criteria: "array",
18969
- // },
18970
- // ],
18971
- rule_type: data === null || data === void 0 ? void 0 : data.rule_type,
18972
- privilege_type: data === null || data === void 0 ? void 0 : data.privilege_type,
18973
- status: data === null || data === void 0 ? void 0 : data.status,
18974
- alert_test_message: data === null || data === void 0 ? void 0 : data.alert_test_message,
18975
- workflow: data === null || data === void 0 ? void 0 : data.workflow,
18976
- relationID: data === null || data === void 0 ? void 0 : data.relationID // This is mandatory for further reading of documents on Update mode. Do not remove this field.
18977
-
18978
- }
18979
- })];
18980
- };
18981
-
18982
18538
  var _extraReducers$t;
18983
18539
 
18984
- var loopMasters$6 = function loopMasters(params) {
18540
+ var loopMasters$6 = function loopMasters() {
18985
18541
  return new es6Promise.Promise( /*#__PURE__*/function () {
18986
18542
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(resolve, reject) {
18987
18543
  var calls;
@@ -18989,31 +18545,19 @@ var loopMasters$6 = function loopMasters(params) {
18989
18545
  while (1) {
18990
18546
  switch (_context2.prev = _context2.next) {
18991
18547
  case 0:
18992
- calls = Object.keys(masterNewQuery).map( /*#__PURE__*/function () {
18548
+ calls = Object.keys(masterQuery$5).map( /*#__PURE__*/function () {
18993
18549
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(val) {
18994
18550
  return regeneratorRuntime.wrap(function _callee$(_context) {
18995
18551
  while (1) {
18996
18552
  switch (_context.prev = _context.next) {
18997
18553
  case 0:
18998
- if (!(val === "item_code")) {
18999
- _context.next = 4;
19000
- break;
19001
- }
19002
-
19003
- _context.next = 3;
19004
- return fetchMaster$6(val, masterNewQuery[val], params === null || params === void 0 ? void 0 : params[val]);
19005
-
19006
- case 3:
19007
- return _context.abrupt("return", _context.sent);
19008
-
19009
- case 4:
19010
- _context.next = 6;
19011
- return fetchMaster$6(val, masterNewQuery[val]);
18554
+ _context.next = 2;
18555
+ return fetchMaster$6(val, masterQuery$5[val]);
19012
18556
 
19013
- case 6:
18557
+ case 2:
19014
18558
  return _context.abrupt("return", _context.sent);
19015
18559
 
19016
- case 7:
18560
+ case 3:
19017
18561
  case "end":
19018
18562
  return _context.stop();
19019
18563
  }
@@ -19030,48 +18574,59 @@ var loopMasters$6 = function loopMasters(params) {
19030
18574
  data.map(function (val) {
19031
18575
  var arr = [];
19032
18576
  val.data.map(function (value) {
18577
+ var _value$coding;
18578
+
19033
18579
  switch (val.name) {
19034
- case "synonym_type":
19035
- case "source":
19036
- case "drug_uom":
19037
- case "instruction_type":
19038
- case "drug_status":
19039
- case "applicability":
19040
- case "rule_type":
19041
- case "round_off_type":
19042
- case "return_reason":
19043
- case "duration_uom":
19044
- arr.push({
19045
- label: value !== null && value !== void 0 && value.display ? value === null || value === void 0 ? void 0 : value.display : "",
19046
- value: value !== null && value !== void 0 && value._id ? value === null || value === void 0 ? void 0 : value._id : ""
18580
+ case "status":
18581
+ case "actions":
18582
+ (_value$coding = value.coding) === null || _value$coding === void 0 ? void 0 : _value$coding.map(function (dat) {
18583
+ arr.push(_objectSpread2({
18584
+ label: dat !== null && dat !== void 0 && dat.display ? dat === null || dat === void 0 ? void 0 : dat.display : "",
18585
+ value: dat !== null && dat !== void 0 && dat._id ? dat === null || dat === void 0 ? void 0 : dat._id : ""
18586
+ }, dat));
19047
18587
  });
19048
18588
  break;
19049
18589
 
19050
- case "code_standara":
18590
+ case "encounter_type":
18591
+ case "gender":
18592
+ arr.push(_objectSpread2({
18593
+ label: value.coding ? value.coding[0] ? value.coding[0].display : "" : val,
18594
+ value: value.coding ? value.coding[0] ? value.coding[0]._id : "" : val
18595
+ }, value));
18596
+ break;
18597
+
18598
+ case "alternate_drug_code":
18599
+ arr.push(_objectSpread2({
18600
+ label: value.ShortDesc ? value.ShortDesc : "",
18601
+ value: value._id
18602
+ }, value));
18603
+ break;
18604
+
18605
+ case "age_range_group":
18606
+ arr.push(_objectSpread2({
18607
+ label: value.agerangecode,
18608
+ value: value._id
18609
+ }, value));
18610
+ break;
18611
+
18612
+ case "default_route":
18613
+ case "routes_allowed":
18614
+ case "default_frequency":
18615
+ case "drug_item_master":
19051
18616
  case "drug_class":
19052
- case "drug_generic":
19053
- case "drug_type":
19054
- case "form":
19055
18617
  case "drug_category":
19056
18618
  case "drug_type":
19057
18619
  case "form":
19058
- case "default_route":
19059
- case "frequency":
19060
- case "routes_allowed":
19061
- case "drug_followUom":
19062
- case "action":
19063
- case "entity_type":
19064
- case "privilege_type":
18620
+ case "drug_UOM":
19065
18621
  arr.push(_objectSpread2({
19066
18622
  label: value.shortdesc ? value.shortdesc : "",
19067
18623
  value: value._id
19068
18624
  }, value));
19069
18625
  break;
19070
18626
 
19071
- case "drug_code":
19072
- case "item_code":
18627
+ case "age_category":
19073
18628
  arr.push(_objectSpread2({
19074
- label: value.ShortDesc ? value.ShortDesc : "",
18629
+ label: value.code ? value.code : "",
19075
18630
  value: value._id
19076
18631
  }, value));
19077
18632
  break;
@@ -19106,7 +18661,7 @@ var loopMasters$6 = function loopMasters(params) {
19106
18661
  }());
19107
18662
  };
19108
18663
 
19109
- var fetchMaster$6 = function fetchMaster(name, query, params) {
18664
+ var fetchMaster$6 = function fetchMaster(name, query) {
19110
18665
  return new es6Promise.Promise( /*#__PURE__*/function () {
19111
18666
  var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(resolve, reject) {
19112
18667
  var data;
@@ -19116,7 +18671,7 @@ var fetchMaster$6 = function fetchMaster(name, query, params) {
19116
18671
  case 0:
19117
18672
  _context3.next = 2;
19118
18673
  return fetchData({
19119
- body: JSON.stringify(query(params))
18674
+ body: query
19120
18675
  }, __readDocumentUrl__);
19121
18676
 
19122
18677
  case 2:
@@ -19144,15 +18699,8 @@ var DRUG_MASTER_READ = createAsyncThunk("drugMasterSlice/drug_master_list", /*#_
19144
18699
  var payload,
19145
18700
  _ref5,
19146
18701
  rejectWithValue,
19147
- isWithoutLimit,
19148
18702
  page,
19149
18703
  perpage,
19150
- _payload$searchQuery,
19151
- searchQuery,
19152
- queryId,
19153
- withoutLimitFilter,
19154
- withLimitFilter,
19155
- fullReadQDMQuery,
19156
18704
  data,
19157
18705
  arry,
19158
18706
  _args4 = arguments;
@@ -19164,47 +18712,24 @@ var DRUG_MASTER_READ = createAsyncThunk("drugMasterSlice/drug_master_list", /*#_
19164
18712
  payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
19165
18713
  _ref5 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref5.rejectWithValue;
19166
18714
  _context4.prev = 2;
19167
- isWithoutLimit = payload.isWithoutLimit, page = payload.page, perpage = payload.perpage, _payload$searchQuery = payload.searchQuery, searchQuery = _payload$searchQuery === void 0 ? "" : _payload$searchQuery;
19168
- queryId = isWithoutLimit ? "b1656253-8d63-4954-98ea-3765c230a3d5" : "2d926ad5-19f5-4140-9158-f4cd17e7c307";
19169
- withoutLimitFilter = {
19170
- filter: {
19171
- search: "%".concat(searchQuery, "%")
19172
- }
19173
- };
19174
- withLimitFilter = {
19175
- filter: {
19176
- search: "%".concat(searchQuery, "%"),
19177
- page: page,
19178
- perPage: perpage
19179
- }
19180
- };
19181
- fullReadQDMQuery = _objectSpread2({
19182
- db_name: dbName$1,
19183
- queryid: queryId
19184
- }, isWithoutLimit ? withoutLimitFilter : withLimitFilter);
19185
- _context4.next = 10;
18715
+ page = payload.page, perpage = payload.perpage;
18716
+ _context4.next = 6;
19186
18717
  return fetchData({
19187
- body: JSON.stringify(fullReadQDMQuery)
19188
- }, __baseUrl__$1);
18718
+ body: JSON.stringify(queries$f.drug_master(page, perpage))
18719
+ }, __readDocumentUrl__);
19189
18720
 
19190
- case 10:
18721
+ case 6:
19191
18722
  data = _context4.sent;
19192
18723
  arry = [];
19193
- data.map(function (val) {
18724
+ data.result.map(function (val) {
19194
18725
  if (val._id) {
19195
- var _val$DrugCode, _val$LongDesc, _val$DrugClass$longde, _val$DrugClass, _val$DrugCategory$lon, _val$DrugCategory, _val$DrugType$longdes, _val$DrugType, _val$FormCode$longdes, _val$FormCode, _val$RoutesAllowed, _val$StrengthValuesPo;
19196
-
19197
18726
  arry.push(_objectSpread2(_objectSpread2({}, val), {}, {
19198
- code_des: "".concat((_val$DrugCode = val === null || val === void 0 ? void 0 : val.DrugCode) !== null && _val$DrugCode !== void 0 ? _val$DrugCode : "", " & ").concat((_val$LongDesc = val === null || val === void 0 ? void 0 : val.LongDesc) !== null && _val$LongDesc !== void 0 ? _val$LongDesc : ""),
19199
- "class": (_val$DrugClass$longde = val === null || val === void 0 ? void 0 : (_val$DrugClass = val.DrugClass) === null || _val$DrugClass === void 0 ? void 0 : _val$DrugClass.longdesc) !== null && _val$DrugClass$longde !== void 0 ? _val$DrugClass$longde : "",
19200
- category: (_val$DrugCategory$lon = val === null || val === void 0 ? void 0 : (_val$DrugCategory = val.DrugCategory) === null || _val$DrugCategory === void 0 ? void 0 : _val$DrugCategory.longdesc) !== null && _val$DrugCategory$lon !== void 0 ? _val$DrugCategory$lon : "",
19201
- type: (_val$DrugType$longdes = val === null || val === void 0 ? void 0 : (_val$DrugType = val.DrugType) === null || _val$DrugType === void 0 ? void 0 : _val$DrugType.longdesc) !== null && _val$DrugType$longdes !== void 0 ? _val$DrugType$longdes : "",
19202
- form: (_val$FormCode$longdes = val === null || val === void 0 ? void 0 : (_val$FormCode = val.FormCode) === null || _val$FormCode === void 0 ? void 0 : _val$FormCode.longdesc) !== null && _val$FormCode$longdes !== void 0 ? _val$FormCode$longdes : "",
19203
- route: val !== null && val !== void 0 && val.RoutesAllowed ? val === null || val === void 0 ? void 0 : (_val$RoutesAllowed = val.RoutesAllowed) === null || _val$RoutesAllowed === void 0 ? void 0 : _val$RoutesAllowed.map(function (data) {
19204
- return data === null || data === void 0 ? void 0 : data.longdesc;
19205
- }).join(", ") : [],
19206
- strength: (_val$StrengthValuesPo = val === null || val === void 0 ? void 0 : val.StrengthValuesPossible) !== null && _val$StrengthValuesPo !== void 0 ? _val$StrengthValuesPo : {},
19207
- status: val !== null && val !== void 0 && val.status ? true : false
18727
+ "drug_code": val.DrugCode ? val.DrugCode : "",
18728
+ "short_description": val.ShortDesc ? val.ShortDesc : "",
18729
+ "long_description": val.LongDesc ? val.LongDesc : "",
18730
+ "status_active": val.statusactive ? val.statusactive : false,
18731
+ "draft_status": val.draftstatus ? val.draftstatus : false,
18732
+ "_id": val._id
19208
18733
  }));
19209
18734
  }
19210
18735
  });
@@ -19212,19 +18737,19 @@ var DRUG_MASTER_READ = createAsyncThunk("drugMasterSlice/drug_master_list", /*#_
19212
18737
  data: arry
19213
18738
  }));
19214
18739
 
19215
- case 16:
19216
- _context4.prev = 16;
18740
+ case 12:
18741
+ _context4.prev = 12;
19217
18742
  _context4.t0 = _context4["catch"](2);
19218
- return _context4.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
18743
+ return _context4.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject.List), {}, {
19219
18744
  message: _context4.t0.message
19220
18745
  })));
19221
18746
 
19222
- case 19:
18747
+ case 15:
19223
18748
  case "end":
19224
18749
  return _context4.stop();
19225
18750
  }
19226
18751
  }
19227
- }, _callee4, null, [[2, 16]]);
18752
+ }, _callee4, null, [[2, 12]]);
19228
18753
  })));
19229
18754
  var DRUG_MASTER_UPSERT = createAsyncThunk("drugMasterSlice/drug_master_upsert", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
19230
18755
  var payload,
@@ -19279,8 +18804,7 @@ var DRUG_MASTER_STATUS_CHANGE = createAsyncThunk("drugMasterSlice/drug_master_st
19279
18804
  var payload,
19280
18805
  _ref9,
19281
18806
  rejectWithValue,
19282
- key,
19283
- status,
18807
+ statuschange,
19284
18808
  queriesjson,
19285
18809
  data,
19286
18810
  _args6 = arguments;
@@ -19292,8 +18816,11 @@ var DRUG_MASTER_STATUS_CHANGE = createAsyncThunk("drugMasterSlice/drug_master_st
19292
18816
  payload = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
19293
18817
  _ref9 = _args6.length > 1 ? _args6[1] : undefined, rejectWithValue = _ref9.rejectWithValue;
19294
18818
  _context6.prev = 2;
19295
- key = payload.key, status = payload.status;
19296
- queriesjson = queries$f.status_update_drug_master(key, status);
18819
+ statuschange = {
18820
+ _id: payload._id,
18821
+ status: payload.status
18822
+ };
18823
+ queriesjson = queries$f.status_update_drug_master(statuschange);
19297
18824
  _context6.next = 7;
19298
18825
  return fetchData({
19299
18826
  body: JSON.stringify(queriesjson)
@@ -19320,11 +18847,8 @@ var DRUG_MASTER_STATUS_CHANGE = createAsyncThunk("drugMasterSlice/drug_master_st
19320
18847
  }, _callee6, null, [[2, 11]]);
19321
18848
  })));
19322
18849
  var DRUG_MASTERS = createAsyncThunk("drugMasterSlice/masterlist", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
19323
- var payload,
19324
- _ref11,
18850
+ var _ref11,
19325
18851
  rejectWithValue,
19326
- itemCodeId,
19327
- params,
19328
18852
  data,
19329
18853
  _args7 = arguments;
19330
18854
 
@@ -19332,37 +18856,30 @@ var DRUG_MASTERS = createAsyncThunk("drugMasterSlice/masterlist", /*#__PURE__*/_
19332
18856
  while (1) {
19333
18857
  switch (_context7.prev = _context7.next) {
19334
18858
  case 0:
19335
- payload = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
19336
18859
  _ref11 = _args7.length > 1 ? _args7[1] : undefined, rejectWithValue = _ref11.rejectWithValue;
19337
18860
  _context7.prev = 2;
19338
- itemCodeId = payload.itemCodeId;
19339
- params = {
19340
- item_code: {
19341
- id: itemCodeId
19342
- }
19343
- };
19344
- _context7.next = 7;
19345
- return loopMasters$6(params);
18861
+ _context7.next = 6;
18862
+ return loopMasters$6();
19346
18863
 
19347
- case 7:
18864
+ case 6:
19348
18865
  data = _context7.sent;
19349
18866
  return _context7.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
19350
18867
  data: data
19351
18868
  }));
19352
18869
 
19353
- case 11:
19354
- _context7.prev = 11;
18870
+ case 10:
18871
+ _context7.prev = 10;
19355
18872
  _context7.t0 = _context7["catch"](2);
19356
18873
  return _context7.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
19357
18874
  message: _context7.t0.message
19358
18875
  })));
19359
18876
 
19360
- case 14:
18877
+ case 13:
19361
18878
  case "end":
19362
18879
  return _context7.stop();
19363
18880
  }
19364
18881
  }
19365
- }, _callee7, null, [[2, 11]]);
18882
+ }, _callee7, null, [[2, 10]]);
19366
18883
  })));
19367
18884
  var SAVE_DRUG_MASTER = createAsyncThunk("drugMasterSlice/create_drug_master", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
19368
18885
  var payload,
@@ -19555,610 +19072,6 @@ var AGE_CATEGORY_BY_ID = createAsyncThunk("drugMasterSlice/age_category_by_id",
19555
19072
  }
19556
19073
  }, _callee11, null, [[2, 13]]);
19557
19074
  })));
19558
- var DRUG_MASTER_ENTITY_NAME_OPTIONS = createAsyncThunk("drugMasterSlice/drug_catalog_master_entity_name_options", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
19559
- var payload,
19560
- _ref21,
19561
- rejectWithValue,
19562
- entityTypeCode,
19563
- data,
19564
- _data,
19565
- _data$result3,
19566
- _args12 = arguments;
19567
-
19568
- return regeneratorRuntime.wrap(function _callee12$(_context12) {
19569
- while (1) {
19570
- switch (_context12.prev = _context12.next) {
19571
- case 0:
19572
- payload = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
19573
- _ref21 = _args12.length > 1 ? _args12[1] : undefined, rejectWithValue = _ref21.rejectWithValue;
19574
- _context12.prev = 2;
19575
- entityTypeCode = payload.entityTypeCode;
19576
- _context12.next = 6;
19577
- return fetchData({
19578
- body: JSON.stringify(queries$f.entityNameOptionsQuery(entityTypeCode))
19579
- }, __readDocumentUrl__);
19580
-
19581
- case 6:
19582
- data = _context12.sent;
19583
-
19584
- if (!(data.result.length > 0)) {
19585
- _context12.next = 12;
19586
- break;
19587
- }
19588
-
19589
- data = (_data = data) === null || _data === void 0 ? void 0 : (_data$result3 = _data.result) === null || _data$result3 === void 0 ? void 0 : _data$result3.map(function (option) {
19590
- return _objectSpread2({
19591
- label: option,
19592
- value: option._id
19593
- }, option);
19594
- });
19595
- return _context12.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19596
- data: data
19597
- }));
19598
-
19599
- case 12:
19600
- return _context12.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19601
- data: []
19602
- }));
19603
-
19604
- case 13:
19605
- _context12.next = 18;
19606
- break;
19607
-
19608
- case 15:
19609
- _context12.prev = 15;
19610
- _context12.t0 = _context12["catch"](2);
19611
- return _context12.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
19612
- message: _context12.t0.message
19613
- })));
19614
-
19615
- case 18:
19616
- case "end":
19617
- return _context12.stop();
19618
- }
19619
- }
19620
- }, _callee12, null, [[2, 15]]);
19621
- })));
19622
- var DRUG_MASTER_SINGLE_READ = createAsyncThunk("drugMasterSlice/drug_catalog_master_singleRead", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
19623
- var payload,
19624
- _ref23,
19625
- rejectWithValue,
19626
- id,
19627
- data,
19628
- _args13 = arguments;
19629
-
19630
- return regeneratorRuntime.wrap(function _callee13$(_context13) {
19631
- while (1) {
19632
- switch (_context13.prev = _context13.next) {
19633
- case 0:
19634
- payload = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
19635
- _ref23 = _args13.length > 1 ? _args13[1] : undefined, rejectWithValue = _ref23.rejectWithValue;
19636
- _context13.prev = 2;
19637
- id = payload.id;
19638
- _context13.next = 6;
19639
- return fetchData({
19640
- body: JSON.stringify(drugCatalogMasterQuery.drugCatalogMasterSingleRead(id))
19641
- }, __readDocumentUrl__);
19642
-
19643
- case 6:
19644
- data = _context13.sent;
19645
- return _context13.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19646
- data: data.result
19647
- }));
19648
-
19649
- case 10:
19650
- _context13.prev = 10;
19651
- _context13.t0 = _context13["catch"](2);
19652
- return _context13.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
19653
- message: _context13.t0.message
19654
- })));
19655
-
19656
- case 13:
19657
- case "end":
19658
- return _context13.stop();
19659
- }
19660
- }
19661
- }, _callee13, null, [[2, 10]]);
19662
- })));
19663
- var DRUG_MASTER_SAVE = createAsyncThunk("drugMasterSlice/drug_catalog_master_save", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
19664
- var payload,
19665
- _ref25,
19666
- rejectWithValue,
19667
- body,
19668
- Body,
19669
- data,
19670
- _args14 = arguments;
19671
-
19672
- return regeneratorRuntime.wrap(function _callee14$(_context14) {
19673
- while (1) {
19674
- switch (_context14.prev = _context14.next) {
19675
- case 0:
19676
- payload = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
19677
- _ref25 = _args14.length > 1 ? _args14[1] : undefined, rejectWithValue = _ref25.rejectWithValue;
19678
- _context14.prev = 2;
19679
- body = payload.body;
19680
- Body = GenerateUpsert(body);
19681
- _context14.next = 7;
19682
- return fetchData({
19683
- body: JSON.stringify(Body)
19684
- }, __uspsertUrl__);
19685
-
19686
- case 7:
19687
- data = _context14.sent;
19688
- return _context14.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
19689
- data: data
19690
- }));
19691
-
19692
- case 11:
19693
- _context14.prev = 11;
19694
- _context14.t0 = _context14["catch"](2);
19695
- return _context14.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
19696
- message: _context14.t0.message
19697
- })));
19698
-
19699
- case 14:
19700
- case "end":
19701
- return _context14.stop();
19702
- }
19703
- }
19704
- }, _callee14, null, [[2, 11]]);
19705
- })));
19706
- var RULE_GROUP_DROPDOWN = createAsyncThunk("drugMasterSlice/getGroup", /*#__PURE__*/function () {
19707
- var _ref26 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15(payload, action) {
19708
- var _rejectWithValue, body, options, _res, response;
19709
-
19710
- return regeneratorRuntime.wrap(function _callee15$(_context15) {
19711
- while (1) {
19712
- switch (_context15.prev = _context15.next) {
19713
- case 0:
19714
- _context15.prev = 0;
19715
- _rejectWithValue = action.rejectWithValue;
19716
- body = {};
19717
- body = JSON.stringify(drugCatalogMasterQuery.ruleGroup());
19718
- options = {
19719
- method: "Post",
19720
- headers: {
19721
- "Content-Type": "application/json",
19722
- Accept: "application/json"
19723
- },
19724
- body: body
19725
- };
19726
- _context15.next = 7;
19727
- return fetch(__readDocumentUrl__, options);
19728
-
19729
- case 7:
19730
- _res = _context15.sent;
19731
-
19732
- if (_res.ok) {
19733
- _context15.next = 10;
19734
- break;
19735
- }
19736
-
19737
- return _context15.abrupt("return", _rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
19738
- message: _res === null || _res === void 0 ? void 0 : _res.statusText,
19739
- Code: _res.status
19740
- })));
19741
-
19742
- case 10:
19743
- _context15.next = 12;
19744
- return _res.json();
19745
-
19746
- case 12:
19747
- response = _context15.sent;
19748
- return _context15.abrupt("return", _objectSpread2(_objectSpread2({}, response), {}, {
19749
- Code: _res.status
19750
- }));
19751
-
19752
- case 16:
19753
- _context15.prev = 16;
19754
- _context15.t0 = _context15["catch"](0);
19755
- return _context15.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
19756
- message: _context15.t0.message
19757
- })));
19758
-
19759
- case 19:
19760
- case "end":
19761
- return _context15.stop();
19762
- }
19763
- }
19764
- }, _callee15, null, [[0, 16]]);
19765
- }));
19766
-
19767
- return function (_x6, _x7) {
19768
- return _ref26.apply(this, arguments);
19769
- };
19770
- }());
19771
- var DRUG_RULE_TYPE = createAsyncThunk("drugMasterSlice/drug_rule_type", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
19772
- var _ref28,
19773
- rejectWithValue,
19774
- _data$result4,
19775
- data,
19776
- _data$result5,
19777
- _data$result5$map,
19778
- res,
19779
- _args16 = arguments;
19780
-
19781
- return regeneratorRuntime.wrap(function _callee16$(_context16) {
19782
- while (1) {
19783
- switch (_context16.prev = _context16.next) {
19784
- case 0:
19785
- _ref28 = _args16.length > 1 ? _args16[1] : undefined, rejectWithValue = _ref28.rejectWithValue;
19786
- _context16.prev = 2;
19787
- _context16.next = 5;
19788
- return fetchData({
19789
- body: JSON.stringify(drugCatalogMasterQuery.drugRuleType())
19790
- }, __readDocumentUrl__);
19791
-
19792
- case 5:
19793
- data = _context16.sent;
19794
-
19795
- if (!((data === null || data === void 0 ? void 0 : (_data$result4 = data.result) === null || _data$result4 === void 0 ? void 0 : _data$result4.length) > 0)) {
19796
- _context16.next = 11;
19797
- break;
19798
- }
19799
-
19800
- res = data === null || data === void 0 ? void 0 : (_data$result5 = data.result) === null || _data$result5 === void 0 ? void 0 : (_data$result5$map = _data$result5.map(function (option) {
19801
- return _objectSpread2(_objectSpread2({}, option), {}, {
19802
- label: option === null || option === void 0 ? void 0 : option.display,
19803
- value: option === null || option === void 0 ? void 0 : option._id
19804
- });
19805
- })) === null || _data$result5$map === void 0 ? void 0 : _data$result5$map.reverse();
19806
- return _context16.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19807
- data: res
19808
- }));
19809
-
19810
- case 11:
19811
- return _context16.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19812
- data: []
19813
- }));
19814
-
19815
- case 12:
19816
- _context16.next = 17;
19817
- break;
19818
-
19819
- case 14:
19820
- _context16.prev = 14;
19821
- _context16.t0 = _context16["catch"](2);
19822
- return _context16.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
19823
- message: _context16.t0.message
19824
- })));
19825
-
19826
- case 17:
19827
- case "end":
19828
- return _context16.stop();
19829
- }
19830
- }
19831
- }, _callee16, null, [[2, 14]]);
19832
- })));
19833
- var DRUG_PRIVILEGE_TYPE = createAsyncThunk("drugMasterSlice/drug_privilege_type", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
19834
- var _ref30,
19835
- rejectWithValue,
19836
- _data$result6,
19837
- data,
19838
- _data$result7,
19839
- res,
19840
- _args17 = arguments;
19841
-
19842
- return regeneratorRuntime.wrap(function _callee17$(_context17) {
19843
- while (1) {
19844
- switch (_context17.prev = _context17.next) {
19845
- case 0:
19846
- _ref30 = _args17.length > 1 ? _args17[1] : undefined, rejectWithValue = _ref30.rejectWithValue;
19847
- _context17.prev = 2;
19848
- _context17.next = 5;
19849
- return fetchData({
19850
- body: JSON.stringify(drugCatalogMasterQuery.drugPrivilegeType())
19851
- }, __readDocumentUrl__);
19852
-
19853
- case 5:
19854
- data = _context17.sent;
19855
-
19856
- if (!((data === null || data === void 0 ? void 0 : (_data$result6 = data.result) === null || _data$result6 === void 0 ? void 0 : _data$result6.length) > 0)) {
19857
- _context17.next = 11;
19858
- break;
19859
- }
19860
-
19861
- res = data === null || data === void 0 ? void 0 : (_data$result7 = data.result) === null || _data$result7 === void 0 ? void 0 : _data$result7.map(function (option) {
19862
- return _objectSpread2(_objectSpread2({}, option), {}, {
19863
- label: option === null || option === void 0 ? void 0 : option.display,
19864
- value: option === null || option === void 0 ? void 0 : option._id
19865
- });
19866
- });
19867
- return _context17.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19868
- data: res
19869
- }));
19870
-
19871
- case 11:
19872
- return _context17.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19873
- data: []
19874
- }));
19875
-
19876
- case 12:
19877
- _context17.next = 17;
19878
- break;
19879
-
19880
- case 14:
19881
- _context17.prev = 14;
19882
- _context17.t0 = _context17["catch"](2);
19883
- return _context17.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
19884
- message: _context17.t0.message
19885
- })));
19886
-
19887
- case 17:
19888
- case "end":
19889
- return _context17.stop();
19890
- }
19891
- }
19892
- }, _callee17, null, [[2, 14]]);
19893
- })));
19894
- var DRUG_SERVICE_APPLICABILITY_TYPE = createAsyncThunk("drugMasterSlice/drug_service_applicability_type", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() {
19895
- var _ref32,
19896
- rejectWithValue,
19897
- _data$result8,
19898
- data,
19899
- _data$result9,
19900
- _data$result9$map,
19901
- res,
19902
- _args18 = arguments;
19903
-
19904
- return regeneratorRuntime.wrap(function _callee18$(_context18) {
19905
- while (1) {
19906
- switch (_context18.prev = _context18.next) {
19907
- case 0:
19908
- _ref32 = _args18.length > 1 ? _args18[1] : undefined, rejectWithValue = _ref32.rejectWithValue;
19909
- _context18.prev = 2;
19910
- _context18.next = 5;
19911
- return fetchData({
19912
- body: JSON.stringify(drugCatalogMasterQuery.drugServiceApplicabilityType())
19913
- }, __readDocumentUrl__);
19914
-
19915
- case 5:
19916
- data = _context18.sent;
19917
-
19918
- if (!((data === null || data === void 0 ? void 0 : (_data$result8 = data.result) === null || _data$result8 === void 0 ? void 0 : _data$result8.length) > 0)) {
19919
- _context18.next = 11;
19920
- break;
19921
- }
19922
-
19923
- res = data === null || data === void 0 ? void 0 : (_data$result9 = data.result) === null || _data$result9 === void 0 ? void 0 : (_data$result9$map = _data$result9.map(function (option) {
19924
- return _objectSpread2(_objectSpread2({}, option), {}, {
19925
- label: option === null || option === void 0 ? void 0 : option.display,
19926
- value: option === null || option === void 0 ? void 0 : option._id
19927
- });
19928
- })) === null || _data$result9$map === void 0 ? void 0 : _data$result9$map.reverse();
19929
- return _context18.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19930
- data: res
19931
- }));
19932
-
19933
- case 11:
19934
- return _context18.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19935
- data: []
19936
- }));
19937
-
19938
- case 12:
19939
- _context18.next = 17;
19940
- break;
19941
-
19942
- case 14:
19943
- _context18.prev = 14;
19944
- _context18.t0 = _context18["catch"](2);
19945
- return _context18.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
19946
- message: _context18.t0.message
19947
- })));
19948
-
19949
- case 17:
19950
- case "end":
19951
- return _context18.stop();
19952
- }
19953
- }
19954
- }, _callee18, null, [[2, 14]]);
19955
- })));
19956
- var DRUG_FACILITY_OPTIONS = createAsyncThunk("drugMasterSlice/drug_facility_options", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee19() {
19957
- var _ref34,
19958
- rejectWithValue,
19959
- _data$result10,
19960
- data,
19961
- _data$result11,
19962
- res,
19963
- _args19 = arguments;
19964
-
19965
- return regeneratorRuntime.wrap(function _callee19$(_context19) {
19966
- while (1) {
19967
- switch (_context19.prev = _context19.next) {
19968
- case 0:
19969
- _ref34 = _args19.length > 1 ? _args19[1] : undefined, rejectWithValue = _ref34.rejectWithValue;
19970
- _context19.prev = 2;
19971
- _context19.next = 5;
19972
- return fetchData({
19973
- body: JSON.stringify(drugCatalogMasterQuery.drugFacilityOptions())
19974
- }, __readDocumentUrl__);
19975
-
19976
- case 5:
19977
- data = _context19.sent;
19978
-
19979
- if (!((data === null || data === void 0 ? void 0 : (_data$result10 = data.result) === null || _data$result10 === void 0 ? void 0 : _data$result10.length) > 0)) {
19980
- _context19.next = 11;
19981
- break;
19982
- }
19983
-
19984
- res = data === null || data === void 0 ? void 0 : (_data$result11 = data.result) === null || _data$result11 === void 0 ? void 0 : _data$result11.map(function (option) {
19985
- return _objectSpread2(_objectSpread2({}, option), {}, {
19986
- label: option === null || option === void 0 ? void 0 : option.name,
19987
- value: option === null || option === void 0 ? void 0 : option._id
19988
- });
19989
- });
19990
- return _context19.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19991
- data: res
19992
- }));
19993
-
19994
- case 11:
19995
- return _context19.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
19996
- data: []
19997
- }));
19998
-
19999
- case 12:
20000
- _context19.next = 17;
20001
- break;
20002
-
20003
- case 14:
20004
- _context19.prev = 14;
20005
- _context19.t0 = _context19["catch"](2);
20006
- return _context19.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
20007
- message: _context19.t0.message
20008
- })));
20009
-
20010
- case 17:
20011
- case "end":
20012
- return _context19.stop();
20013
- }
20014
- }
20015
- }, _callee19, null, [[2, 14]]);
20016
- })));
20017
- var DRUG_APPROVAL_WORKFLOW_OPTIONS = createAsyncThunk("drugMasterSlice/drug_approval_workflow_options", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20() {
20018
- var _ref36,
20019
- rejectWithValue,
20020
- _data$result12,
20021
- data,
20022
- _data$result13,
20023
- res,
20024
- _args20 = arguments;
20025
-
20026
- return regeneratorRuntime.wrap(function _callee20$(_context20) {
20027
- while (1) {
20028
- switch (_context20.prev = _context20.next) {
20029
- case 0:
20030
- _ref36 = _args20.length > 1 ? _args20[1] : undefined, rejectWithValue = _ref36.rejectWithValue;
20031
- _context20.prev = 2;
20032
- _context20.next = 5;
20033
- return fetchData({
20034
- body: JSON.stringify(drugCatalogMasterQuery.drugApprovalWorkflowOptions())
20035
- }, __readDocumentUrl__);
20036
-
20037
- case 5:
20038
- data = _context20.sent;
20039
-
20040
- if (!((data === null || data === void 0 ? void 0 : (_data$result12 = data.result) === null || _data$result12 === void 0 ? void 0 : _data$result12.length) > 0)) {
20041
- _context20.next = 11;
20042
- break;
20043
- }
20044
-
20045
- res = data === null || data === void 0 ? void 0 : (_data$result13 = data.result) === null || _data$result13 === void 0 ? void 0 : _data$result13.map(function (option) {
20046
- return _objectSpread2(_objectSpread2({}, option), {}, {
20047
- label: option === null || option === void 0 ? void 0 : option.scenarioname,
20048
- value: option === null || option === void 0 ? void 0 : option._id
20049
- });
20050
- });
20051
- return _context20.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
20052
- data: res
20053
- }));
20054
-
20055
- case 11:
20056
- return _context20.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
20057
- data: []
20058
- }));
20059
-
20060
- case 12:
20061
- _context20.next = 17;
20062
- break;
20063
-
20064
- case 14:
20065
- _context20.prev = 14;
20066
- _context20.t0 = _context20["catch"](2);
20067
- return _context20.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
20068
- message: _context20.t0.message
20069
- })));
20070
-
20071
- case 17:
20072
- case "end":
20073
- return _context20.stop();
20074
- }
20075
- }
20076
- }, _callee20, null, [[2, 14]]);
20077
- })));
20078
- var DRUG_ALERTS_RESTRICTIONS_SINGLE_READ = createAsyncThunk("drugMasterSlice/drug_alerts_restriction_singleRead", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21() {
20079
- var payload,
20080
- _ref38,
20081
- rejectWithValue,
20082
- id,
20083
- data,
20084
- _args21 = arguments;
20085
-
20086
- return regeneratorRuntime.wrap(function _callee21$(_context21) {
20087
- while (1) {
20088
- switch (_context21.prev = _context21.next) {
20089
- case 0:
20090
- payload = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {};
20091
- _ref38 = _args21.length > 1 ? _args21[1] : undefined, rejectWithValue = _ref38.rejectWithValue;
20092
- _context21.prev = 2;
20093
- id = payload.id;
20094
- _context21.next = 6;
20095
- return fetchData({
20096
- body: JSON.stringify(drugCatalogMasterQuery.drugalertRestrictionSingleRead(id))
20097
- }, __readDocumentUrl__);
20098
-
20099
- case 6:
20100
- data = _context21.sent;
20101
- return _context21.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
20102
- data: data.result
20103
- }));
20104
-
20105
- case 10:
20106
- _context21.prev = 10;
20107
- _context21.t0 = _context21["catch"](2);
20108
- return _context21.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
20109
- message: _context21.t0.message
20110
- })));
20111
-
20112
- case 13:
20113
- case "end":
20114
- return _context21.stop();
20115
- }
20116
- }
20117
- }, _callee21, null, [[2, 10]]);
20118
- })));
20119
- var DRUG_ALERTS_RESTRICTIONS_SAVE = createAsyncThunk("drugMasterSlice/drug_alerts_restrictions_save", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee22() {
20120
- var payload,
20121
- _ref40,
20122
- rejectWithValue,
20123
- body,
20124
- Body,
20125
- data,
20126
- _args22 = arguments;
20127
-
20128
- return regeneratorRuntime.wrap(function _callee22$(_context22) {
20129
- while (1) {
20130
- switch (_context22.prev = _context22.next) {
20131
- case 0:
20132
- payload = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
20133
- _ref40 = _args22.length > 1 ? _args22[1] : undefined, rejectWithValue = _ref40.rejectWithValue;
20134
- _context22.prev = 2;
20135
- body = payload.body;
20136
- Body = GenerateAlertRestrictionUpsert(body);
20137
- _context22.next = 7;
20138
- return fetchData({
20139
- body: JSON.stringify(Body)
20140
- }, __uspsertUrl__);
20141
-
20142
- case 7:
20143
- data = _context22.sent;
20144
- return _context22.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
20145
- data: data
20146
- }));
20147
-
20148
- case 11:
20149
- _context22.prev = 11;
20150
- _context22.t0 = _context22["catch"](2);
20151
- return _context22.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
20152
- message: _context22.t0.message
20153
- })));
20154
-
20155
- case 14:
20156
- case "end":
20157
- return _context22.stop();
20158
- }
20159
- }
20160
- }, _callee22, null, [[2, 11]]);
20161
- })));
20162
19075
  var drugMasterSlice = createSlice({
20163
19076
  name: "drugMasterSlice",
20164
19077
  initialState: {
@@ -20169,18 +19082,7 @@ var drugMasterSlice = createSlice({
20169
19082
  upsert_drug_master: _objectSpread2({}, defaultState.List),
20170
19083
  drug_form_type: _objectSpread2({}, defaultState.List),
20171
19084
  drug_form_read: _objectSpread2({}, defaultState.List),
20172
- age_category_by_id: _objectSpread2({}, defaultState.List),
20173
- drugCatalogMasterEntityNameOptions: _objectSpread2({}, defaultState.List),
20174
- drugCatalogMasterSingleread: _objectSpread2({}, defaultState.List),
20175
- drugCatalogMasterSave: _objectSpread2({}, defaultState.Info),
20176
- getGroup: _objectSpread2({}, defaultState.Info),
20177
- drugRuleType: _objectSpread2({}, defaultState.List),
20178
- drugPrivilegeType: _objectSpread2({}, defaultState.List),
20179
- drugServiceApplicabilityType: _objectSpread2({}, defaultState.List),
20180
- drugFacilityOptions: _objectSpread2({}, defaultState.List),
20181
- drugApprovalWorkflowOptions: _objectSpread2({}, defaultState.List),
20182
- drugAlertsRestrictionSingleRead: _objectSpread2({}, defaultState.Info),
20183
- drugAlertsRestrictionSave: _objectSpread2({}, defaultState.Info)
19085
+ age_category_by_id: _objectSpread2({}, defaultState.List)
20184
19086
  },
20185
19087
  extraReducers: (_extraReducers$t = {}, _defineProperty(_extraReducers$t, DRUG_MASTER_READ.fulfilled, function (state, action) {
20186
19088
  state.drug_master_list.loading = false, state.drug_master_list.error = false, state.drug_master_list = action.payload;
@@ -20230,116 +19132,6 @@ var drugMasterSlice = createSlice({
20230
19132
  state.age_category_by_id.loading = true, state.age_category_by_id.error = false, state.age_category_by_id.loading = true;
20231
19133
  }), _defineProperty(_extraReducers$t, AGE_CATEGORY_BY_ID.rejected, function (state, action) {
20232
19134
  state.age_category_by_id.loading = false, state.age_category_by_id.error = true, state.age_category_by_id = action.payload;
20233
- }), _defineProperty(_extraReducers$t, DRUG_MASTER_ENTITY_NAME_OPTIONS.fulfilled, function (state, action) {
20234
- var _action$payload;
20235
-
20236
- state.drugCatalogMasterEntityNameOptions = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
20237
- }), _defineProperty(_extraReducers$t, DRUG_MASTER_ENTITY_NAME_OPTIONS.pending, function (state, action) {
20238
- state.drugCatalogMasterEntityNameOptions.loading = true;
20239
- }), _defineProperty(_extraReducers$t, DRUG_MASTER_ENTITY_NAME_OPTIONS.rejected, function (state, action) {
20240
- var _action$payload2;
20241
-
20242
- state.drugCatalogMasterEntityNameOptions = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
20243
- }), _defineProperty(_extraReducers$t, DRUG_MASTER_SINGLE_READ.fulfilled, function (state, action) {
20244
- var _action$payload3;
20245
-
20246
- state.drugCatalogMasterSingleread = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
20247
- }), _defineProperty(_extraReducers$t, DRUG_MASTER_SINGLE_READ.pending, function (state, action) {
20248
- state.drugCatalogMasterSingleread.loading = true;
20249
- }), _defineProperty(_extraReducers$t, DRUG_MASTER_SINGLE_READ.rejected, function (state, action) {
20250
- var _action$payload4;
20251
-
20252
- state.drugCatalogMasterSingleread = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
20253
- }), _defineProperty(_extraReducers$t, DRUG_MASTER_SAVE.fulfilled, function (state, action) {
20254
- var _action$payload5;
20255
-
20256
- state.drugCatalogMasterSave = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
20257
- }), _defineProperty(_extraReducers$t, DRUG_MASTER_SAVE.pending, function (state, action) {
20258
- state.drugCatalogMasterSave.loading = true;
20259
- }), _defineProperty(_extraReducers$t, DRUG_MASTER_SAVE.rejected, function (state, action) {
20260
- var _action$payload6;
20261
-
20262
- state.drugCatalogMasterSave = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
20263
- }), _defineProperty(_extraReducers$t, RULE_GROUP_DROPDOWN.fulfilled, function (state, action) {
20264
- var _action$payload$data, _action$payload7;
20265
-
20266
- state.getGroup.loading = false, state.getGroup.data = (_action$payload$data = action === null || action === void 0 ? void 0 : (_action$payload7 = action.payload) === null || _action$payload7 === void 0 ? void 0 : _action$payload7.data) !== null && _action$payload$data !== void 0 ? _action$payload$data : action === null || action === void 0 ? void 0 : action.payload, state.getGroup.error = false, state.getGroup.message = httpMessage.OkMessage;
20267
- }), _defineProperty(_extraReducers$t, RULE_GROUP_DROPDOWN.rejected, function (state, action) {
20268
- var _action$payload8;
20269
-
20270
- state.getGroup = (_action$payload8 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload8 !== void 0 ? _action$payload8 : {};
20271
- }), _defineProperty(_extraReducers$t, RULE_GROUP_DROPDOWN.pending, function (state, action) {
20272
- state.getGroup.loading = true;
20273
- }), _defineProperty(_extraReducers$t, DRUG_RULE_TYPE.fulfilled, function (state, action) {
20274
- var _action$payload9;
20275
-
20276
- state.drugRuleType = (_action$payload9 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload9 !== void 0 ? _action$payload9 : {};
20277
- }), _defineProperty(_extraReducers$t, DRUG_RULE_TYPE.pending, function (state, action) {
20278
- state.drugRuleType.loading = true;
20279
- }), _defineProperty(_extraReducers$t, DRUG_RULE_TYPE.rejected, function (state, action) {
20280
- var _action$payload10;
20281
-
20282
- state.drugRuleType = (_action$payload10 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload10 !== void 0 ? _action$payload10 : {};
20283
- }), _defineProperty(_extraReducers$t, DRUG_PRIVILEGE_TYPE.fulfilled, function (state, action) {
20284
- var _action$payload11;
20285
-
20286
- state.drugPrivilegeType = (_action$payload11 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload11 !== void 0 ? _action$payload11 : {};
20287
- }), _defineProperty(_extraReducers$t, DRUG_PRIVILEGE_TYPE.pending, function (state, action) {
20288
- state.drugPrivilegeType.loading = true;
20289
- }), _defineProperty(_extraReducers$t, DRUG_PRIVILEGE_TYPE.rejected, function (state, action) {
20290
- var _action$payload12;
20291
-
20292
- state.drugPrivilegeType = (_action$payload12 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload12 !== void 0 ? _action$payload12 : {};
20293
- }), _defineProperty(_extraReducers$t, DRUG_SERVICE_APPLICABILITY_TYPE.fulfilled, function (state, action) {
20294
- var _action$payload13;
20295
-
20296
- state.drugServiceApplicabilityType = (_action$payload13 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload13 !== void 0 ? _action$payload13 : {};
20297
- }), _defineProperty(_extraReducers$t, DRUG_SERVICE_APPLICABILITY_TYPE.pending, function (state, action) {
20298
- state.drugServiceApplicabilityType.loading = true;
20299
- }), _defineProperty(_extraReducers$t, DRUG_SERVICE_APPLICABILITY_TYPE.rejected, function (state, action) {
20300
- var _action$payload14;
20301
-
20302
- state.drugServiceApplicabilityType = (_action$payload14 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload14 !== void 0 ? _action$payload14 : {};
20303
- }), _defineProperty(_extraReducers$t, DRUG_FACILITY_OPTIONS.fulfilled, function (state, action) {
20304
- var _action$payload15;
20305
-
20306
- state.drugFacilityOptions = (_action$payload15 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload15 !== void 0 ? _action$payload15 : {};
20307
- }), _defineProperty(_extraReducers$t, DRUG_FACILITY_OPTIONS.pending, function (state, action) {
20308
- state.drugFacilityOptions.loading = true;
20309
- }), _defineProperty(_extraReducers$t, DRUG_FACILITY_OPTIONS.rejected, function (state, action) {
20310
- var _action$payload16;
20311
-
20312
- state.drugFacilityOptions = (_action$payload16 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload16 !== void 0 ? _action$payload16 : {};
20313
- }), _defineProperty(_extraReducers$t, DRUG_APPROVAL_WORKFLOW_OPTIONS.fulfilled, function (state, action) {
20314
- var _action$payload17;
20315
-
20316
- state.drugApprovalWorkflowOptions = (_action$payload17 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload17 !== void 0 ? _action$payload17 : {};
20317
- }), _defineProperty(_extraReducers$t, DRUG_APPROVAL_WORKFLOW_OPTIONS.pending, function (state, action) {
20318
- state.drugApprovalWorkflowOptions.loading = true;
20319
- }), _defineProperty(_extraReducers$t, DRUG_APPROVAL_WORKFLOW_OPTIONS.rejected, function (state, action) {
20320
- var _action$payload18;
20321
-
20322
- state.drugApprovalWorkflowOptions = (_action$payload18 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload18 !== void 0 ? _action$payload18 : {};
20323
- }), _defineProperty(_extraReducers$t, DRUG_ALERTS_RESTRICTIONS_SINGLE_READ.fulfilled, function (state, action) {
20324
- var _action$payload19;
20325
-
20326
- state.drugAlertsRestrictionSingleRead = (_action$payload19 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload19 !== void 0 ? _action$payload19 : {};
20327
- }), _defineProperty(_extraReducers$t, DRUG_ALERTS_RESTRICTIONS_SINGLE_READ.pending, function (state, action) {
20328
- state.drugAlertsRestrictionSingleRead.loading = true;
20329
- }), _defineProperty(_extraReducers$t, DRUG_ALERTS_RESTRICTIONS_SINGLE_READ.rejected, function (state, action) {
20330
- var _action$payload20;
20331
-
20332
- state.drugAlertsRestrictionSingleRead = (_action$payload20 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload20 !== void 0 ? _action$payload20 : {};
20333
- }), _defineProperty(_extraReducers$t, DRUG_ALERTS_RESTRICTIONS_SAVE.fulfilled, function (state, action) {
20334
- var _action$payload21;
20335
-
20336
- state.drugAlertsRestrictionSave = (_action$payload21 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload21 !== void 0 ? _action$payload21 : {};
20337
- }), _defineProperty(_extraReducers$t, DRUG_ALERTS_RESTRICTIONS_SAVE.pending, function (state, action) {
20338
- state.drugAlertsRestrictionSave.loading = true;
20339
- }), _defineProperty(_extraReducers$t, DRUG_ALERTS_RESTRICTIONS_SAVE.rejected, function (state, action) {
20340
- var _action$payload22;
20341
-
20342
- state.drugAlertsRestrictionSave = (_action$payload22 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload22 !== void 0 ? _action$payload22 : {};
20343
19135
  }), _extraReducers$t)
20344
19136
  });
20345
19137
  var drugMasterActions = {
@@ -20350,18 +19142,7 @@ var drugMasterActions = {
20350
19142
  SAVE_DRUG_MASTER: SAVE_DRUG_MASTER,
20351
19143
  DRUG_FORM_TYPE: DRUG_FORM_TYPE,
20352
19144
  DRUG_READ_FORM: DRUG_READ_FORM,
20353
- AGE_CATEGORY_BY_ID: AGE_CATEGORY_BY_ID,
20354
- DRUG_MASTER_ENTITY_NAME_OPTIONS: DRUG_MASTER_ENTITY_NAME_OPTIONS,
20355
- DRUG_MASTER_SINGLE_READ: DRUG_MASTER_SINGLE_READ,
20356
- DRUG_MASTER_SAVE: DRUG_MASTER_SAVE,
20357
- RULE_GROUP_DROPDOWN: RULE_GROUP_DROPDOWN,
20358
- DRUG_RULE_TYPE: DRUG_RULE_TYPE,
20359
- DRUG_PRIVILEGE_TYPE: DRUG_PRIVILEGE_TYPE,
20360
- DRUG_SERVICE_APPLICABILITY_TYPE: DRUG_SERVICE_APPLICABILITY_TYPE,
20361
- DRUG_FACILITY_OPTIONS: DRUG_FACILITY_OPTIONS,
20362
- DRUG_APPROVAL_WORKFLOW_OPTIONS: DRUG_APPROVAL_WORKFLOW_OPTIONS,
20363
- DRUG_ALERTS_RESTRICTIONS_SINGLE_READ: DRUG_ALERTS_RESTRICTIONS_SINGLE_READ,
20364
- DRUG_ALERTS_RESTRICTIONS_SAVE: DRUG_ALERTS_RESTRICTIONS_SAVE
19145
+ AGE_CATEGORY_BY_ID: AGE_CATEGORY_BY_ID
20365
19146
  };
20366
19147
  var drugMasterSlice$1 = drugMasterSlice.reducer;
20367
19148
 
@@ -37935,19 +36716,12 @@ var symptomAndSpecialtySlice$1 = symptomAndSpecialtySlice.reducer;
37935
36716
 
37936
36717
  var queries = {
37937
36718
  encounterType: function encounterType(type) {
37938
- // return {
37939
- // "db_name": dbName,
37940
- // "entity": "AMPatientClass",
37941
- // "filter": "AMPatientClass.activestatus==true",
37942
- // "return_fields": "merge(AMPatientClass,{encType:document(AMPatientClass.encType).code},{encTypeDesc:document(AMPatientClass.encTypeDesc).display},{encClsType:document(AMPatientClass.encClsType).code},{encClsDesc:document(AMPatientClass.encClsDesc).display})",
37943
- // "sort": "document(AMPatientClass.encTypeDesc).display"
37944
- // }
37945
36719
  return {
37946
36720
  "db_name": dbName$1,
37947
36721
  "entity": "AMPatientClass",
37948
36722
  "filter": "AMPatientClass.activestatus==true",
37949
- "return_fields": "merge(AMPatientClass,{encClsByTypes:(for encClsByTypes in (AMPatientClass.encClsByTypes) return merge(encClsByTypes,{encClsType:document(encClsByTypes.encClsType)}))},{encType:document(AMPatientClass.encType)})",
37950
- "sort": "document(AMPatientClass.encType).display "
36723
+ "return_fields": "merge(AMPatientClass,{encType:document(AMPatientClass.encType).code},{encTypeDesc:document(AMPatientClass.encTypeDesc).display},{encClsType:document(AMPatientClass.encClsType).code},{encClsDesc:document(AMPatientClass.encClsDesc).display})",
36724
+ "sort": "document(AMPatientClass.encTypeDesc).display"
37951
36725
  };
37952
36726
  },
37953
36727
  //STATUS CHANGE
@@ -37993,14 +36767,13 @@ var ENCOUNTER_TYPE_READ = createAsyncThunk("encouterTypeSlice/encouterTypeRead",
37993
36767
  arry = [];
37994
36768
  data.result.map(function (val, i) {
37995
36769
  if (val !== null && val !== void 0 && val._id) {
37996
- var _val$id, _val$_id, _val$encType$display, _val$encType, _val$encType$code, _val$encType2;
36770
+ var _val$encTypeDesc, _val$encType;
37997
36771
 
37998
36772
  arry.push(_objectSpread2({
37999
- id: (_val$id = val === null || val === void 0 ? void 0 : val.id) !== null && _val$id !== void 0 ? _val$id : "",
38000
- _id: (_val$_id = val === null || val === void 0 ? void 0 : val._id) !== null && _val$_id !== void 0 ? _val$_id : "",
38001
- description: (_val$encType$display = val === null || val === void 0 ? void 0 : (_val$encType = val.encType) === null || _val$encType === void 0 ? void 0 : _val$encType.display) !== null && _val$encType$display !== void 0 ? _val$encType$display : "",
38002
- code: (_val$encType$code = val === null || val === void 0 ? void 0 : (_val$encType2 = val.encType) === null || _val$encType2 === void 0 ? void 0 : _val$encType2.code) !== null && _val$encType$code !== void 0 ? _val$encType$code : "",
38003
- encounter_class: constructEncounterClassData(val === null || val === void 0 ? void 0 : val.encClsByTypes).toString()
36773
+ id: val === null || val === void 0 ? void 0 : val.id,
36774
+ description: (_val$encTypeDesc = val === null || val === void 0 ? void 0 : val.encTypeDesc) !== null && _val$encTypeDesc !== void 0 ? _val$encTypeDesc : "",
36775
+ code: (_val$encType = val === null || val === void 0 ? void 0 : val.encType) !== null && _val$encType !== void 0 ? _val$encType : "",
36776
+ encounter_class: val !== null && val !== void 0 && val.encClsDesc ? val === null || val === void 0 ? void 0 : val.encClsDesc : "" + " ( " + (val === null || val === void 0 ? void 0 : val.encClsType) ? val === null || val === void 0 ? void 0 : val.encClsType : "" + " )"
38004
36777
  }, val));
38005
36778
  }
38006
36779
  });
@@ -38021,28 +36794,7 @@ var ENCOUNTER_TYPE_READ = createAsyncThunk("encouterTypeSlice/encouterTypeRead",
38021
36794
  }
38022
36795
  }
38023
36796
  }, _callee, null, [[2, 12]]);
38024
- })));
38025
-
38026
- var constructEncounterClassData = function constructEncounterClassData(data) {
38027
- var arr = [];
38028
-
38029
- if (data.length > 0 && Array.isArray(data)) {
38030
- data.map(function (val) {
38031
- var _val$encClsType, _val$encClsType2;
38032
-
38033
- if (val !== null && val !== void 0 && (_val$encClsType = val.encClsType) !== null && _val$encClsType !== void 0 && _val$encClsType.display && val !== null && val !== void 0 && (_val$encClsType2 = val.encClsType) !== null && _val$encClsType2 !== void 0 && _val$encClsType2.code) {
38034
- var _val$encClsType3, _val$encClsType4, _val$encClsType5, _val$encClsType6;
38035
-
38036
- var dis = val !== null && val !== void 0 && (_val$encClsType3 = val.encClsType) !== null && _val$encClsType3 !== void 0 && _val$encClsType3.display ? val === null || val === void 0 ? void 0 : (_val$encClsType4 = val.encClsType) === null || _val$encClsType4 === void 0 ? void 0 : _val$encClsType4.display : "";
38037
- var co = val !== null && val !== void 0 && (_val$encClsType5 = val.encClsType) !== null && _val$encClsType5 !== void 0 && _val$encClsType5.code ? val === null || val === void 0 ? void 0 : (_val$encClsType6 = val.encClsType) === null || _val$encClsType6 === void 0 ? void 0 : _val$encClsType6.code : "" + " )";
38038
- arr.push(dis + " (" + co + ")");
38039
- }
38040
- });
38041
- }
38042
-
38043
- return arr;
38044
- }; //ENCOUNTER_TYPE_STATUS_CHANGE
38045
-
36797
+ }))); //ENCOUNTER_TYPE_STATUS_CHANGE
38046
36798
 
38047
36799
  var ENCOUNTER_TYPE_STATUS_CHANGE = createAsyncThunk("encouterTypeSlice/encouterStatusChange", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
38048
36800
  var payload,