primary_care_admin_binder 0.1.67 → 0.1.70

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 +213 -63
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -10069,6 +10069,22 @@ var practitionerMasterActions = {
10069
10069
  };
10070
10070
  var practitionerMasterSlice$1 = practitionerMasterSlice.reducer;
10071
10071
 
10072
+ var getAgeRangeSort = function getAgeRangeSort(sort) {
10073
+ switch (sort) {
10074
+ case 'Long Description':
10075
+ return "AgeRanges.longdesc";
10076
+
10077
+ case 'Short Description':
10078
+ return "AgeRanges.shortdesc";
10079
+
10080
+ case 'Code':
10081
+ return "AgeRanges.agerangecode";
10082
+
10083
+ default:
10084
+ return "AgeRanges.createddate";
10085
+ }
10086
+ };
10087
+
10072
10088
  var query$c = {
10073
10089
  unitUom: "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"sort\": \"document(CodeableConceptMaster.coding[0]).display\",\n \"filter\": \"CodeableConceptMaster.Type=='VITALSUOM'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
10074
10090
  // getAgeRange: `{
@@ -10076,8 +10092,8 @@ var query$c = {
10076
10092
  // "entity": "AgeRanges",
10077
10093
  // "return_fields": "MERGE(AgeRanges, {AgeCategory: (FOR cat IN TO_ARRAY(AgeRanges.AgeCategory) RETURN MERGE(DOCUMENT(cat), {UOM:(FOR cod IN TO_ARRAY(DOCUMENT(DOCUMENT(cat).UOM).coding) RETURN MERGE(DOCUMENT(DOCUMENT(cat).UOM),{coding:DOCUMENT(cod)} ) ) } ) ) } )"
10078
10094
  // }`,
10079
- getAgeRange: function getAgeRange(page, perPage, search) {
10080
- return "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"AgeRanges\",\n \"filter\": \"(LIKE(AgeRanges.agerangecode,'%").concat(search, "%',true) || LIKE(AgeRanges.longdesc,'%").concat(search, "%',true) || LIKE(AgeRanges.shortdesc,'%").concat(search, "%',true)) && AgeRanges.activestatus == true\",\n \"limit\" : { \"offset\" : ").concat(page, ", \"count\": ").concat(perPage, "},\n \"return_fields\": \"MERGE(AgeRanges, {TotalCount:COUNT(").concat(search ? "FOR cnt IN AgeRanges filter UPPER(cnt.agerangecode) LIKE '%".concat(search.toUpperCase(), "%' || UPPER(cnt.longdesc) LIKE '%").concat(search.toUpperCase(), "%' || UPPER(cnt.shortdesc) LIKE '%").concat(search.toUpperCase(), "%' RETURN cnt._key") : "FOR cnt IN AgeRanges RETURN cnt._key", "), AgeCategory: (FOR cat IN TO_ARRAY(AgeRanges.AgeCategory) RETURN MERGE(DOCUMENT(cat), {UOM:(FOR cod IN TO_ARRAY(DOCUMENT(DOCUMENT(cat).UOM).coding) RETURN MERGE(DOCUMENT(DOCUMENT(cat).UOM),{coding:DOCUMENT(cod)} ) ) } ) ) } )\",\n \"sort\":\"AgeRanges.createddate\"\n }");
10095
+ getAgeRange: function getAgeRange(page, perPage, sort, direction, search) {
10096
+ return "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"AgeRanges\",\n \"filter\": \"(LIKE(AgeRanges.agerangecode,'%").concat(search, "%',true) || LIKE(AgeRanges.longdesc,'%").concat(search, "%',true) || LIKE(AgeRanges.shortdesc,'%").concat(search, "%',true)) && AgeRanges.activestatus == true\",\n \"limit\" : { \"offset\" : ").concat(page, ", \"count\": ").concat(perPage, "},\n \"return_fields\": \"MERGE(AgeRanges, {TotalCount:COUNT(").concat(search ? "FOR cnt IN AgeRanges filter UPPER(cnt.agerangecode) LIKE '%".concat(search.toUpperCase(), "%' || UPPER(cnt.longdesc) LIKE '%").concat(search.toUpperCase(), "%' || UPPER(cnt.shortdesc) LIKE '%").concat(search.toUpperCase(), "%' RETURN cnt._key") : "FOR cnt IN AgeRanges RETURN cnt._key", "), AgeCategory: (FOR cat IN TO_ARRAY(AgeRanges.AgeCategory) RETURN MERGE(DOCUMENT(cat), {UOM:(FOR cod IN TO_ARRAY(DOCUMENT(DOCUMENT(cat).UOM).coding) RETURN MERGE(DOCUMENT(DOCUMENT(cat).UOM),{coding:DOCUMENT(cod)} ) ) } ) ) } )\",\n \"sort\":\"").concat(getAgeRangeSort(sort), " ").concat(direction, "\"\n }");
10081
10097
  }
10082
10098
  };
10083
10099
 
@@ -10284,32 +10300,33 @@ var GET_AGE_RANGE_MASTER = createAsyncThunk("ageRangeMasterApiSlice/age_range_li
10284
10300
  case 0:
10285
10301
  payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
10286
10302
  _ref8 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref8.rejectWithValue;
10287
- debugger;
10288
- _context4.prev = 3;
10289
- _context4.next = 6;
10303
+ console.clear();
10304
+ console.log(payload === null || payload === void 0 ? void 0 : payload.sort, payload === null || payload === void 0 ? void 0 : payload.search);
10305
+ _context4.prev = 4;
10306
+ _context4.next = 7;
10290
10307
  return fetchData({
10291
- body: query$c.getAgeRange(payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.search ? payload === null || payload === void 0 ? void 0 : payload.search : '')
10308
+ body: query$c.getAgeRange(payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.sort ? payload === null || payload === void 0 ? void 0 : payload.sort : '', payload !== null && payload !== void 0 && payload.direction ? '' : 'DESC', payload !== null && payload !== void 0 && payload.search ? payload === null || payload === void 0 ? void 0 : payload.search : '')
10292
10309
  }, __readDocumentUrl__);
10293
10310
 
10294
- case 6:
10311
+ case 7:
10295
10312
  data = _context4.sent;
10296
10313
  return _context4.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
10297
10314
  data: data.result
10298
10315
  }));
10299
10316
 
10300
- case 10:
10301
- _context4.prev = 10;
10302
- _context4.t0 = _context4["catch"](3);
10317
+ case 11:
10318
+ _context4.prev = 11;
10319
+ _context4.t0 = _context4["catch"](4);
10303
10320
  return _context4.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
10304
10321
  message: _context4.t0.message
10305
10322
  })));
10306
10323
 
10307
- case 13:
10324
+ case 14:
10308
10325
  case "end":
10309
10326
  return _context4.stop();
10310
10327
  }
10311
10328
  }
10312
- }, _callee4, null, [[3, 10]]);
10329
+ }, _callee4, null, [[4, 11]]);
10313
10330
  })));
10314
10331
  var ageRangeMasterSlice = createSlice({
10315
10332
  name: "ageRangeMasterApiSlice",
@@ -12460,8 +12477,28 @@ var vitalsMasterSectionActions = {
12460
12477
  };
12461
12478
  var vitalsMasterSectionSlice$1 = vitalsMasterSectionSlice.reducer;
12462
12479
 
12480
+ var getLocationSort = function getLocationSort(sort) {
12481
+ switch (sort) {
12482
+ case 'Long Description':
12483
+ return "LocationMaster.longdesc";
12484
+
12485
+ case 'Short Description':
12486
+ return "LocationMaster.shortdesc";
12487
+
12488
+ case 'Location Type':
12489
+ //return "document(document(LocationMaster.locationType)[0].coding)[0].display"
12490
+ return "LocationMaster.locationType";
12491
+
12492
+ case 'Location ID':
12493
+ return "LocationMaster.locationID";
12494
+
12495
+ default:
12496
+ return "LocationMaster.createddate";
12497
+ }
12498
+ };
12499
+
12463
12500
  var queries$m = {
12464
- locationlist: function locationlist(type, page, perPage, search) {
12501
+ locationlist: function locationlist(type, page, perPage, search, sort, direction) {
12465
12502
  debugger; // return {
12466
12503
  // db_name: dbName,
12467
12504
  // entity:
@@ -12481,8 +12518,9 @@ var queries$m = {
12481
12518
  },
12482
12519
  filter: "(LIKE(LocationMaster.shortdesc,'%".concat(search !== null && search !== void 0 ? search : '', "%',true) || LIKE(LocationMaster.longdesc,'%").concat(search !== null && search !== void 0 ? search : '', "%',true) || LIKE(LocationMaster.locationID,'%").concat(search !== null && search !== void 0 ? search : '', "%',true) || LIKE(document(LocationMaster.locationRoletype).display,'%").concat(search !== null && search !== void 0 ? search : '', "%',true) ) && LocationMaster.activestatus==true"),
12483
12520
  // return_fields: "merge(LocationMaster,{TotalCount:COUNT(FOR cnt IN LocationMaster RETURN cnt._key) , operationalStatus:(for ops in CodeableConceptMaster filter ops._id==LocationMaster.operationalStatus return merge(ops,{coding:document(ops.coding)}))},{managingOrgEntityType:(for moe in CodeableConceptMaster filter moe._id==LocationMaster.managingOrgEntityType return merge(moe,{coding:document(moe.coding)}))}, {parentLocationID_desc:document(to_array(LocationMaster.parentLocationID_desc))},{address:document(LocationMaster.address)},{locationType:(for lt in CodeableConceptMaster filter lt._id==LocationMaster.locationType return (merge(lt,{coding:document(lt.coding)})))},{managingOrgID:document(to_array(LocationMaster.managingOrgID))},{locationRoletype:document(to_array(LocationMaster.locationRoletype))},{specialty:document(to_array(LocationMaster.specialty))},{photo:document(LocationMaster.photo)}, {pharmacy:(for ph in LocationMaster.pharmacy return merge(ph,{inventorySubStore:document(ph.inventorySubStore)}))}, {telecom:(for tel in document(LocationMaster.telecom) return merge(tel,{use:document(tel.use)},{rank:document(tel.rank)},{system:document(tel.system)}))})"
12484
- return_fields: "merge(LocationMaster,{locationType:(for cod in document(to_array(LocationMaster.locationType)) return merge(cod,{coding:document(cod.coding)}))},{TotalCount:count(( FOR locat IN LocationMaster FILTER ( LIKE(locat.shortdesc,'%".concat(search !== null && search !== void 0 ? search : '', "%',true) || LIKE(locat.longdesc,'%").concat(search !== null && search !== void 0 ? search : '', "%',true) || LIKE(locat.locationID,'%").concat(search !== null && search !== void 0 ? search : '', "%',true) || LIKE(document(locat.locationRoletype).display,'%").concat(search !== null && search !== void 0 ? search : '', "%',true) ) && locat.activestatus==true return locat._id ))})") // return_fields: "merge(LocationMaster,{operationalStatus:(for ops in CodeableConceptMaster filter ops._id==LocationMaster.operationalStatus return merge(ops,{coding:document(ops.coding)}))},{managingOrgEntityType:(for moe in CodeableConceptMaster filter moe._id==LocationMaster.managingOrgEntityType return merge(moe,{coding:document(moe.coding)}))}, {parentLocationID_desc:document(to_array(LocationMaster.parentLocationID_desc))},{address:document(LocationMaster.address)},{locationType:(for lt in CodeableConceptMaster filter lt._id==LocationMaster.locationType return (merge(lt,{coding:document(lt.coding)})))},{managingOrgID:document(to_array(LocationMaster.managingOrgID))},{locationRoletype:document(to_array(LocationMaster.locationRoletype))},{specialty:document(to_array(LocationMaster.specialty))},{photo:document(LocationMaster.photo)}, {pharmacy:(for ph in LocationMaster.pharmacy return merge(ph,{inventorySubStore:document(ph.inventorySubStore)}))}, {telecom:(for tel in document(LocationMaster.telecom) return merge(tel,{use:document(tel.use)},{rank:document(tel.rank)},{system:document(tel.system)}))})"
12485
-
12521
+ return_fields: "merge(LocationMaster,{locationType:(for cod in document(to_array(LocationMaster.locationType)) return merge(cod,{coding:document(cod.coding)}))},{TotalCount:count(( FOR locat IN LocationMaster FILTER ( LIKE(locat.shortdesc,'%".concat(search !== null && search !== void 0 ? search : '', "%',true) || LIKE(locat.longdesc,'%").concat(search !== null && search !== void 0 ? search : '', "%',true) || LIKE(locat.locationID,'%").concat(search !== null && search !== void 0 ? search : '', "%',true) || LIKE(document(locat.locationRoletype).display,'%").concat(search !== null && search !== void 0 ? search : '', "%',true) ) && locat.activestatus==true return locat._id ))})"),
12522
+ // return_fields: "merge(LocationMaster,{operationalStatus:(for ops in CodeableConceptMaster filter ops._id==LocationMaster.operationalStatus return merge(ops,{coding:document(ops.coding)}))},{managingOrgEntityType:(for moe in CodeableConceptMaster filter moe._id==LocationMaster.managingOrgEntityType return merge(moe,{coding:document(moe.coding)}))}, {parentLocationID_desc:document(to_array(LocationMaster.parentLocationID_desc))},{address:document(LocationMaster.address)},{locationType:(for lt in CodeableConceptMaster filter lt._id==LocationMaster.locationType return (merge(lt,{coding:document(lt.coding)})))},{managingOrgID:document(to_array(LocationMaster.managingOrgID))},{locationRoletype:document(to_array(LocationMaster.locationRoletype))},{specialty:document(to_array(LocationMaster.specialty))},{photo:document(LocationMaster.photo)}, {pharmacy:(for ph in LocationMaster.pharmacy return merge(ph,{inventorySubStore:document(ph.inventorySubStore)}))}, {telecom:(for tel in document(LocationMaster.telecom) return merge(tel,{use:document(tel.use)},{rank:document(tel.rank)},{system:document(tel.system)}))})"
12523
+ sort: "".concat(getLocationSort(sort), " ").concat(direction)
12486
12524
  };
12487
12525
  },
12488
12526
  locationlistupsert: function locationlistupsert(data) {
@@ -12803,6 +12841,8 @@ var LOCATION_READ = createAsyncThunk("locationSlice/locationlist", /*#__PURE__*/
12803
12841
  page,
12804
12842
  perPage,
12805
12843
  search,
12844
+ sort,
12845
+ direction,
12806
12846
  data,
12807
12847
  arry,
12808
12848
  _args = arguments;
@@ -12814,10 +12854,10 @@ var LOCATION_READ = createAsyncThunk("locationSlice/locationlist", /*#__PURE__*/
12814
12854
  payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
12815
12855
  _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
12816
12856
  _context.prev = 2;
12817
- type = payload.type, page = payload.page, perPage = payload.perPage, search = payload.search;
12857
+ type = payload.type, page = payload.page, perPage = payload.perPage, search = payload.search, sort = payload.sort, direction = payload.direction;
12818
12858
  _context.next = 6;
12819
12859
  return fetchData({
12820
- body: JSON.stringify(queries$m.locationlist(type, page, perPage, search))
12860
+ body: JSON.stringify(queries$m.locationlist(type, page, perPage, search ? search : '', sort ? sort : "", direction ? "" : 'DESC'))
12821
12861
  }, __readDocumentUrl__);
12822
12862
 
12823
12863
  case 6:
@@ -12828,15 +12868,15 @@ var LOCATION_READ = createAsyncThunk("locationSlice/locationlist", /*#__PURE__*/
12828
12868
  _context.next = 12;
12829
12869
  return data.result.map(function (val) {
12830
12870
  if (val.locationID) {
12831
- var _val$locationType, _val$locationType$, _val$locationType2, _val$locationType2$, _val$locationType2$$c, _val$locationType2$$c2, _val$locationType3, _val$locationType3$, _val$locationType4, _val$locationType4$, _val$locationType4$$c, _val$locationType4$$c2, _val$locationType5, _val$locationType5$, _val$locationType5$$c, _val$locationType5$$c2, _val$locationType6, _val$locationType6$, _val$locationType6$$c, _val$locationType6$$c2, _val$locationType7, _val$locationType7$, _val$locationType7$$c, _val$locationType7$$c2, _val$locationType8, _val$locationType8$, _val$locationType8$$c, _val$locationType8$$c2;
12871
+ var _val$locationType$, _val$locationType$2, _val$locationType, _val$locationType$3, _val$locationType$3$c, _val$locationType$3$c2, _val$locationType2, _val$locationType2$, _val$locationType2$$c, _val$locationType2$$c2, _val$locationType3, _val$locationType3$, _val$locationType3$$c, _val$locationType3$$c2, _val$locationType4, _val$locationType4$, _val$locationType4$$c, _val$locationType4$$c2;
12832
12872
 
12833
12873
  arry.push({
12834
12874
  location_id: val.locationID,
12835
- location_type: val.locationType.length > 0 ? (((_val$locationType = val.locationType) === null || _val$locationType === void 0 ? void 0 : (_val$locationType$ = _val$locationType[0]) === null || _val$locationType$ === void 0 ? void 0 : _val$locationType$.coding) !== null ? (_val$locationType2 = val.locationType) === null || _val$locationType2 === void 0 ? void 0 : (_val$locationType2$ = _val$locationType2[0]) === null || _val$locationType2$ === void 0 ? void 0 : (_val$locationType2$$c = _val$locationType2$.coding) === null || _val$locationType2$$c === void 0 ? void 0 : (_val$locationType2$$c2 = _val$locationType2$$c[0]) === null || _val$locationType2$$c2 === void 0 ? void 0 : _val$locationType2$$c2.code : "") + " - " + (((_val$locationType3 = val.locationType) === null || _val$locationType3 === void 0 ? void 0 : (_val$locationType3$ = _val$locationType3[0]) === null || _val$locationType3$ === void 0 ? void 0 : _val$locationType3$.coding) !== null ? (_val$locationType4 = val.locationType) === null || _val$locationType4 === void 0 ? void 0 : (_val$locationType4$ = _val$locationType4[0]) === null || _val$locationType4$ === void 0 ? void 0 : (_val$locationType4$$c = _val$locationType4$.coding) === null || _val$locationType4$$c === void 0 ? void 0 : (_val$locationType4$$c2 = _val$locationType4$$c[0]) === null || _val$locationType4$$c2 === void 0 ? void 0 : _val$locationType4$$c2.Type : "") : "-",
12836
- location_type_code: (_val$locationType5 = val.locationType) === null || _val$locationType5 === void 0 ? void 0 : (_val$locationType5$ = _val$locationType5[0]) === null || _val$locationType5$ === void 0 ? void 0 : (_val$locationType5$$c = _val$locationType5$.coding) === null || _val$locationType5$$c === void 0 ? void 0 : (_val$locationType5$$c2 = _val$locationType5$$c[0]) === null || _val$locationType5$$c2 === void 0 ? void 0 : _val$locationType5$$c2.code,
12837
- location_type_name: (_val$locationType6 = val.locationType) === null || _val$locationType6 === void 0 ? void 0 : (_val$locationType6$ = _val$locationType6[0]) === null || _val$locationType6$ === void 0 ? void 0 : (_val$locationType6$$c = _val$locationType6$.coding) === null || _val$locationType6$$c === void 0 ? void 0 : (_val$locationType6$$c2 = _val$locationType6$$c[0]) === null || _val$locationType6$$c2 === void 0 ? void 0 : _val$locationType6$$c2.Type,
12838
- location_type_id: (_val$locationType7 = val.locationType) === null || _val$locationType7 === void 0 ? void 0 : (_val$locationType7$ = _val$locationType7[0]) === null || _val$locationType7$ === void 0 ? void 0 : (_val$locationType7$$c = _val$locationType7$.coding) === null || _val$locationType7$$c === void 0 ? void 0 : (_val$locationType7$$c2 = _val$locationType7$$c[0]) === null || _val$locationType7$$c2 === void 0 ? void 0 : _val$locationType7$$c2._id,
12839
- location_type_key: (_val$locationType8 = val.locationType) === null || _val$locationType8 === void 0 ? void 0 : (_val$locationType8$ = _val$locationType8[0]) === null || _val$locationType8$ === void 0 ? void 0 : (_val$locationType8$$c = _val$locationType8$.coding) === null || _val$locationType8$$c === void 0 ? void 0 : (_val$locationType8$$c2 = _val$locationType8$$c[0]) === null || _val$locationType8$$c2 === void 0 ? void 0 : _val$locationType8$$c2._key,
12875
+ location_type: val.locationType.length > 0 ? ((_val$locationType$ = val.locationType[0]) === null || _val$locationType$ === void 0 ? void 0 : _val$locationType$.display) !== null ? (_val$locationType$2 = val.locationType[0]) === null || _val$locationType$2 === void 0 ? void 0 : _val$locationType$2.display : "-" : "-",
12876
+ location_type_code: (_val$locationType = val.locationType) === null || _val$locationType === void 0 ? void 0 : (_val$locationType$3 = _val$locationType[0]) === null || _val$locationType$3 === void 0 ? void 0 : (_val$locationType$3$c = _val$locationType$3.coding) === null || _val$locationType$3$c === void 0 ? void 0 : (_val$locationType$3$c2 = _val$locationType$3$c[0]) === null || _val$locationType$3$c2 === void 0 ? void 0 : _val$locationType$3$c2.code,
12877
+ location_type_name: (_val$locationType2 = val.locationType) === null || _val$locationType2 === void 0 ? void 0 : (_val$locationType2$ = _val$locationType2[0]) === null || _val$locationType2$ === void 0 ? void 0 : (_val$locationType2$$c = _val$locationType2$.coding) === null || _val$locationType2$$c === void 0 ? void 0 : (_val$locationType2$$c2 = _val$locationType2$$c[0]) === null || _val$locationType2$$c2 === void 0 ? void 0 : _val$locationType2$$c2.Type,
12878
+ location_type_id: (_val$locationType3 = val.locationType) === null || _val$locationType3 === void 0 ? void 0 : (_val$locationType3$ = _val$locationType3[0]) === null || _val$locationType3$ === void 0 ? void 0 : (_val$locationType3$$c = _val$locationType3$.coding) === null || _val$locationType3$$c === void 0 ? void 0 : (_val$locationType3$$c2 = _val$locationType3$$c[0]) === null || _val$locationType3$$c2 === void 0 ? void 0 : _val$locationType3$$c2._id,
12879
+ location_type_key: (_val$locationType4 = val.locationType) === null || _val$locationType4 === void 0 ? void 0 : (_val$locationType4$ = _val$locationType4[0]) === null || _val$locationType4$ === void 0 ? void 0 : (_val$locationType4$$c = _val$locationType4$.coding) === null || _val$locationType4$$c === void 0 ? void 0 : (_val$locationType4$$c2 = _val$locationType4$$c[0]) === null || _val$locationType4$$c2 === void 0 ? void 0 : _val$locationType4$$c2._key,
12840
12880
  long_description: val.longdesc,
12841
12881
  short_description: val.shortdesc,
12842
12882
  _key: val._key,
@@ -30052,10 +30092,10 @@ var queries$6 = {
30052
30092
  user_upsert: function user_upsert(data) {
30053
30093
  var filter = {};
30054
30094
 
30055
- if (data._key) {
30095
+ if (data.check_key) {
30056
30096
  filter = {
30057
30097
  filter: {
30058
- _key: data._key
30098
+ _key: data.prect_key
30059
30099
  }
30060
30100
  };
30061
30101
  }
@@ -30066,18 +30106,23 @@ var queries$6 = {
30066
30106
  "is_metadata": true,
30067
30107
  "metadataId": "04ecb73d-f048-44ce-8563-c9be015812dd"
30068
30108
  }, filter), {}, {
30069
- "doc": _objectSpread2({}, data)
30109
+ "doc": _objectSpread2({}, data.payload)
30070
30110
  })];
30071
30111
  },
30072
30112
  practitioner_by_id: function practitioner_by_id(data) {
30073
30113
  return {
30074
30114
  "db_name": dbName$1,
30075
- // "entity": "Practitioner",
30076
30115
  "entity": "Person",
30077
- // "filter": `Practitioner.PersonID==${data.id} && Practitioner.activestatus==true`,
30078
30116
  "filter": "Person._id =='".concat(data.id, "' && Person.activestatus == true "),
30079
- // "return_fields": "merge(Practitioner,{identifier:(for doc in IdentifierMaster filter doc._id in Practitioner.identifier return merge(doc,{period:(for cod in doc.period return document(cod))})),address:(for a in Practitioner.address return document(a)),communication:( FOR cod IN CodeableConceptMaster filter cod._id in Practitioner.communication RETURN MERGE(cod,{coding:(FOR d IN cod.coding RETURN DOCUMENT(d))})),marital_status:(FOR cod IN CodeableConceptMaster filter cod._id==Practitioner.marital_status RETURN MERGE(cod,{coding:(FOR d IN cod.coding RETURN DOCUMENT(d))})),name:(for a in Practitioner.name return MERGE(document(a),{period:DOCUMENT(document(a).period)})),nationality:(FOR cod IN SMGeographicMaster filter cod._id==Practitioner.nationality RETURN cod),photo:(for a in Practitioner.photo return document(a)),position:(for pt in CodeableConceptMaster filter pt._id==Practitioner.position return merge(pt,{coding:(FOR d IN pt.coding RETURN DOCUMENT(d))})),practitioner_type:(for pt in CodeableConceptMaster filter pt._id==Practitioner.practitioner_type return merge(pt,{coding:(FOR d IN pt.coding RETURN DOCUMENT(d))})),telecom:(for a in Practitioner.telecom return document(a)),job_experience:(for c in Practitioner.job_experience RETURN merge(c,{jobexperience_contact_details:(for con in c.jobexperience_contact_details return document(con)), jobexperience_address:(for add in c.jobexperience_address return document(add))})),training_details:(for c in Practitioner.training_details RETURN merge(c,{training_contact_details:(for con in c.training_contact_details return document(con)), training_address:(for add in c.training_address return document(add))})),practitioner_role:(for doc in PractitionerRole filter doc._id IN Practitioner.practitioner_role return MERGE(doc,{telecom:(for rol in ContactPointMaster filter rol._id in doc.telecom return rol),role:(for cod in CodeableConceptMaster filter cod._id==doc.role return merge(cod,{coding:(for code in CodingMaster filter code._id in cod.coding return code)})),period:(for per in periodMaster filter per._id in doc.period return per)})),gender:(FOR cod IN CodeableConceptMaster filter cod._id==Practitioner.gender RETURN MERGE(cod,{coding:(FOR d IN cod.coding RETURN DOCUMENT(d))})),employee_status:(for pt in CodeableConceptMaster filter pt._id==Practitioner.employee_status return merge(pt,{coding:(FOR d IN pt.coding RETURN DOCUMENT(d))}))})"
30080
- "return_fields": "merge(Person,{OrgID: document(Person.OrgID)},{address: document(Person.address)},{gender: document(Person.gender)},{orgType: document(Person.orgType)},{name: (for doc in document(Person.name) return merge(doc,{period: document(doc.period)},{ use: document(doc.use)},{prefix: document(doc.prefix)},{ suffix: document(doc.suffix)}))},{identifier: (for ide in document(Person.identifier)return merge(ide,{ period: document(ide.period)}))},{ telecom: (for doc in document(Person.telecom) return merge(doc, { system: document(doc.system)},{use: document(document(doc.use).coding)},{ period: document(Person.Person)},{ valueprefix: document(doc.valueprefix) }, {rank: document(document(doc.rank).coding)}))})"
30117
+ "return_fields": "merge(Person, {Practitioner: (for x in Practitioner filter x.PersonID == ".concat(data.PersonID, " return { PersonID: x.PersonID, userId: x.practitioner_id, practitioner_role: (for z in x.practitioner_role return document(document(document(z).role).coding)[0] ), SpecialtyID: document(x.practitioner_role)[0].SpecialtyID , role: (for z in x.practitioner_role return {coding: document(document(document(z).role).coding), \"_key\": document(document(z).role)._key,\"_id\": document(document(z).role)._id,\"_rev\": document(document(z).role)._rev,\"Type\": document(document(z).role).Type,\"activestatus\": document(document(z).role).activestatus,\"createdby\": \"\",\"createddate\": document(document(z).role).createddate,\"id\": document(document(z).role).id,\"status\": document(document(z).role).status,\"text\": document(document(z).role).text,\"updatedate\": document(document(z).role).updatedate, \"updatedby\": \"\"} ) })} ,{reporting_entity_type: document(Person.orgType)}, {reporting_entity_name: document(Person.OrgID[0])},{OrgID: document(Person.OrgID)},{address: document(Person.address)},{gender: document(Person.gender)},{orgType: document(Person.orgType)},{name: (for doc in document(Person.name) return merge(doc,{period: document(doc.period)},{ use: document(doc.use)},{prefix: document(doc.prefix)},{ suffix: document(doc.suffix)}))},{identifier: (for ide in document(Person.identifier)return merge(ide,{ period: document(ide.period)}))},{ telecom: (for doc in document(Person.telecom) return merge(doc, { system: document(doc.system)},{use: document(document(doc.use).coding)},{ period: document(Person.Person)},{ valueprefix: document(doc.valueprefix) }, {rank: document(document(doc.rank).coding)}))})")
30118
+ };
30119
+ },
30120
+ check_practioner: function check_practioner(data) {
30121
+ return {
30122
+ "db_name": dbName$1,
30123
+ "entity": "Practitioner",
30124
+ "filter": "Practitioner.PersonID == ".concat(data),
30125
+ "return_fields": "Practitioner "
30081
30126
  };
30082
30127
  }
30083
30128
  };
@@ -30087,6 +30132,8 @@ var USER_UPSERT = createAsyncThunk("userSlice/user_upsert", /*#__PURE__*/_asyncT
30087
30132
  var payload,
30088
30133
  _ref2,
30089
30134
  rejectWithValue,
30135
+ temp_data,
30136
+ qry,
30090
30137
  params,
30091
30138
  queriesjson,
30092
30139
  data,
@@ -30099,35 +30146,61 @@ var USER_UPSERT = createAsyncThunk("userSlice/user_upsert", /*#__PURE__*/_asyncT
30099
30146
  payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
30100
30147
  _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
30101
30148
  _context.prev = 2;
30102
- params = _objectSpread2({
30103
- _key: payload._key
30104
- }, payload);
30149
+ console.clear();
30150
+ console.log(payload);
30151
+
30152
+ if (!payload.PersonID) {
30153
+ _context.next = 11;
30154
+ break;
30155
+ }
30156
+
30157
+ qry = queries$6.check_practioner(payload.PersonID);
30158
+ _context.next = 9;
30159
+ return fetchData({
30160
+ body: JSON.stringify(qry)
30161
+ }, __readDocumentUrl__);
30162
+
30163
+ case 9:
30164
+ temp_data = _context.sent;
30165
+ console.log(temp_data.result);
30166
+
30167
+ case 11:
30168
+ params = {
30169
+ payload: payload
30170
+ };
30171
+
30172
+ if (temp_data.result.length > 0) {
30173
+ params.check_key = payload._key;
30174
+ params.prect_key = temp_data.result[0]._key;
30175
+ }
30176
+
30105
30177
  queriesjson = queries$6.user_upsert(params);
30106
- _context.next = 7;
30178
+ _context.next = 16;
30107
30179
  return fetchData({
30108
30180
  body: JSON.stringify(queriesjson)
30109
30181
  }, __uspsertUrl__);
30110
30182
 
30111
- case 7:
30183
+ case 16:
30112
30184
  data = _context.sent;
30113
30185
  return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
30114
30186
  _key: data._key,
30115
30187
  data: data
30116
30188
  }));
30117
30189
 
30118
- case 11:
30119
- _context.prev = 11;
30190
+ case 20:
30191
+ _context.prev = 20;
30120
30192
  _context.t0 = _context["catch"](2);
30193
+ console.log(_context.t0);
30121
30194
  return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
30122
30195
  message: _context.t0.message
30123
30196
  })));
30124
30197
 
30125
- case 14:
30198
+ case 24:
30126
30199
  case "end":
30127
30200
  return _context.stop();
30128
30201
  }
30129
30202
  }
30130
- }, _callee, null, [[2, 11]]);
30203
+ }, _callee, null, [[2, 20]]);
30131
30204
  })));
30132
30205
  var USER_DELETE = createAsyncThunk("userSlice/user_delete", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
30133
30206
  var payload,
@@ -31901,8 +31974,24 @@ var drugFrequencySlice = drugMasterFREQUENCYSlice.reducer;
31901
31974
 
31902
31975
  var drug_actions = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, drugCategoryActions), drugDosageActions), drugClassActions), drugRoutesActions), drugDirectionRoutesActions), drugMasterUomActions), drugMasterActions), drugMasterFrequencyActions);
31903
31976
 
31977
+ var orderSetSort = function orderSetSort(val) {
31978
+ switch (val) {
31979
+ case 'Short Description':
31980
+ return "CA_OrderSet.shortDesc";
31981
+
31982
+ case 'Long Description':
31983
+ return "CA_OrderSet.longDesc";
31984
+
31985
+ case 'Order Set Code':
31986
+ return "CA_OrderSet.orderSetCode";
31987
+
31988
+ default:
31989
+ return "CA_OrderSet.createddate";
31990
+ }
31991
+ };
31992
+
31904
31993
  var query$5 = {
31905
- orderSetList: function orderSetList(page, perPage, search) {
31994
+ orderSetList: function orderSetList(page, perPage, search, sort, direction) {
31906
31995
  return {
31907
31996
  db_name: "".concat(dbName$1),
31908
31997
  entity: "CA_OrderSet",
@@ -31912,7 +32001,7 @@ var query$5 = {
31912
32001
  "count": perPage
31913
32002
  },
31914
32003
  return_fields: "MERGE(keep(CA_OrderSet,'id','_key','_id','longDesc','shortDesc','orderSetCode','status'),{TotalCount:COUNT(".concat(search ? "FOR cnt IN CA_OrderSet filter UPPER(cnt.orderSetCode) LIKE '%".concat(search.toUpperCase(), "%' || UPPER(cnt.shortDesc) LIKE '%").concat(search.toUpperCase(), "%' || UPPER(cnt.longDesc) LIKE '%").concat(search.toUpperCase(), "%' RETURN cnt._key") : "FOR cnt IN CA_OrderSet RETURN cnt._key", ")})"),
31915
- sort: "CA_OrderSet.createddate"
32004
+ sort: "".concat(orderSetSort(sort), " ").concat(direction)
31916
32005
  };
31917
32006
  },
31918
32007
  orderSetListById: function orderSetListById(_key) {
@@ -32471,6 +32560,8 @@ var GET_ORDER_SET_LIST = createAsyncThunk("orderSetMasterApiSlice/order_set_mast
32471
32560
  var payload,
32472
32561
  _ref5,
32473
32562
  rejectWithValue,
32563
+ sort,
32564
+ direction,
32474
32565
  data,
32475
32566
  _args4 = arguments;
32476
32567
 
@@ -32481,9 +32572,10 @@ var GET_ORDER_SET_LIST = createAsyncThunk("orderSetMasterApiSlice/order_set_mast
32481
32572
  payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
32482
32573
  _ref5 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref5.rejectWithValue;
32483
32574
  _context4.prev = 2;
32575
+ sort = payload.sort, direction = payload.direction;
32484
32576
  _context4.next = 6;
32485
32577
  return fetchData({
32486
- body: JSON.stringify(query$5.orderSetList(payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.search ? payload === null || payload === void 0 ? void 0 : payload.search : ''))
32578
+ body: JSON.stringify(query$5.orderSetList(payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.search ? payload === null || payload === void 0 ? void 0 : payload.search : '', sort ? sort : '', direction ? '' : 'DESC'))
32487
32579
  }, __readDocumentUrl__);
32488
32580
 
32489
32581
  case 6:
@@ -34426,11 +34518,30 @@ var allergenMasterActions = {
34426
34518
  };
34427
34519
  var allergenMasterSlice$1 = allergenMasterSlice.reducer;
34428
34520
 
34521
+ var flexAttributeSort = function flexAttributeSort(val) {
34522
+ switch (val) {
34523
+ case 'Attribute Code':
34524
+ return "CA_OrderAttribMaster.attribcode";
34525
+
34526
+ case 'Attribute Label':
34527
+ return "CA_OrderAttribMaster.attriblabel";
34528
+
34529
+ case 'Attribute Type':
34530
+ return "CA_OrderAttribMaster.attribtype";
34531
+
34532
+ case 'Attribute Size':
34533
+ return "CA_OrderAttribMaster.attribsize";
34534
+
34535
+ default:
34536
+ return "CA_OrderAttribMaster.createddate";
34537
+ }
34538
+ };
34539
+
34429
34540
  var flexQuery = {
34430
34541
  attributeTypeDropDown: "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CodingMaster\",\n \"filter\": \"CodingMaster.Type=='FLEXDATATYPE' && CodingMaster.activestatus==true && CodingMaster.status==true\",\n \"return_fields\": \"KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')\",\n \"sort\": \"CodingMaster.display\"\n }"),
34431
34542
  numUomDropDown: "{\n \"db_name\":\"".concat(dbName$1, "\",\n \"entity\": \"CodingMaster\",\n \"filter\": \"CodingMaster.Type=='UOM' && CodingMaster.activestatus==true && CodingMaster.status==true\",\n \"return_fields\": \"KEEP(CodingMaster,'_id','id','_key','code','display','Type','status')\",\n \"sort\": \"CodingMaster.display\"\n }"),
34432
34543
  flexAttributeFullRead: "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"CA_OrderAttribMaster\",\n \"filter\": \"CA_OrderAttribMaster.activestatus==true\",\n \"limit\": {\n \"offset\": \"page\",\n \"count\": \"perpage\",\n },\n \"return_fields\": \"merge(CA_OrderAttribMaster,{attribtype:document(CA_OrderAttribMaster.attribtype).display},{attribnumUOM:to_array(document(CA_OrderAttribMaster.attribnumUOM).display)})\"\n }"),
34433
- flexAttrFullRead: function flexAttrFullRead(page, perpage, search) {
34544
+ flexAttrFullRead: function flexAttrFullRead(page, perpage, search, sort, direction) {
34434
34545
  return {
34435
34546
  db_name: dbName$1,
34436
34547
  entity: "CA_OrderAttribMaster",
@@ -34440,7 +34551,7 @@ var flexQuery = {
34440
34551
  count: perpage
34441
34552
  },
34442
34553
  return_fields: "merge(CA_OrderAttribMaster,{TotalCount:COUNT(FOR cnt IN CA_OrderAttribMaster FILTER (LIKE(cnt.attribcode,'%".concat(search, "%',true) ) && cnt.activestatus==true return cnt._id),attribtype:document(CA_OrderAttribMaster.attribtype).display},{attribnumUOM:to_array(document(CA_OrderAttribMaster.attribnumUOM).display)})"),
34443
- sort: "CA_OrderAttribMaster.createddate desc"
34554
+ sort: "".concat(flexAttributeSort(sort), " ").concat(direction)
34444
34555
  };
34445
34556
  },
34446
34557
  flexStatusChange: function flexStatusChange(list, key) {
@@ -34665,6 +34776,8 @@ var FLEX_ATTRIBUTE_READ = createAsyncThunk("flexAttributeApiSlice/flexFullRead",
34665
34776
  page,
34666
34777
  perpage,
34667
34778
  search,
34779
+ sort,
34780
+ direction,
34668
34781
  data,
34669
34782
  _args3 = arguments;
34670
34783
 
@@ -34675,10 +34788,10 @@ var FLEX_ATTRIBUTE_READ = createAsyncThunk("flexAttributeApiSlice/flexFullRead",
34675
34788
  payload = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
34676
34789
  _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue;
34677
34790
  _context3.prev = 2;
34678
- page = payload.page, perpage = payload.perpage, search = payload.search;
34791
+ page = payload.page, perpage = payload.perpage, search = payload.search, sort = payload.sort, direction = payload.direction;
34679
34792
  _context3.next = 6;
34680
34793
  return fetchData({
34681
- body: JSON.stringify(flexQuery.flexAttrFullRead(page, perpage, search ? search : ''))
34794
+ body: JSON.stringify(flexQuery.flexAttrFullRead(page, perpage, search ? search : '', sort ? sort : '', direction ? '' : 'DESC'))
34682
34795
  }, __readDocumentUrl__);
34683
34796
 
34684
34797
  case 6:
@@ -37029,9 +37142,40 @@ var additionalcolumns = function additionalcolumns(list) {
37029
37142
  return datas;
37030
37143
  };
37031
37144
 
37145
+ var getMasterSort = function getMasterSort(sort) {
37146
+ switch (sort) {
37147
+ case 'Long Description':
37148
+ return "document(CodeableConceptMaster.coding)[0].display";
37149
+
37150
+ case 'Short Description':
37151
+ return "document(CodeableConceptMaster.coding)[0].shortdesc";
37152
+
37153
+ case 'Code':
37154
+ return "document(CodeableConceptMaster.coding)[0].code";
37155
+
37156
+ case 'Visit Type Indicator':
37157
+ return "document(CodeableConceptMaster.coding)[0].gmconfigvalues[\"Visit Type Indicator\"].label";
37158
+
37159
+ case 'Grade':
37160
+ return "((document(CodeableConceptMaster.coding[0]).gmconfigvalues).Grade).display";
37161
+
37162
+ default:
37163
+ return "CodeableConceptMaster.createddate";
37164
+ }
37165
+ };
37166
+
37032
37167
  var queries$2 = {
37033
37168
  generalMasterlist_val: "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"GMvalues\",\n \"filter\": \"GMvalues.activestatus==true\",\n \"return_fields\": \"merge(GMvalues,{gentype:document(GMvalues.gentype)})\"\n }"),
37034
- generalMasterlist: "{\n \"db_name\": \"".concat(dbName$1, "\",\n \"entity\": \"GMdefinition\",\n \"sort\":\"GMdefinition.gentype\",\n \"filter\": \"GMdefinition.activestatus==true\",\n \"return_fields\": \"merge(GMdefinition,{additionalcolumns:(for ad in GMdefinition.additionalcolumns return merge(ad,{columntype:document(ad.columntype)}))})\"\n }"),
37169
+ generalMasterlist: function generalMasterlist() {
37170
+ var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
37171
+ return {
37172
+ "db_name": "".concat(dbName$1),
37173
+ "entity": "GMdefinition",
37174
+ "sort": "GMdefinition.gentype",
37175
+ "filter": "".concat(search != '' ? "LIKE(GMdefinition.genname, \"%".concat(search, "%\", true) && GMdefinition.activestatus==true") : "GMdefinition.activestatus==true"),
37176
+ "return_fields": "merge(GMdefinition,{additionalcolumns:(for ad in GMdefinition.additionalcolumns return merge(ad,{columntype:document(ad.columntype)}))})"
37177
+ };
37178
+ },
37035
37179
  // column_type: `{
37036
37180
  // "db_name": "${dbName}",
37037
37181
  // "entity": "CodingMaster",
@@ -37081,17 +37225,18 @@ var queries$2 = {
37081
37225
  })];
37082
37226
  }
37083
37227
  },
37084
- get_general_master_type: function get_general_master_type(type, page, perPage, search) {
37228
+ get_general_master_type: function get_general_master_type(type, page, perPage, search, sort, direction) {
37085
37229
  debugger;
37086
37230
  return {
37087
37231
  "db_name": dbName$1,
37088
37232
  "entity": "CodeableConceptMaster",
37089
- "filter": "CodeableConceptMaster.Type == '".concat(type, "' &&(LIKE(document(CodeableConceptMaster.coding[0]).code,'%").concat(search, "%',true) ||LIKE(document(CodeableConceptMaster.coding[0]).shortdesc,'%").concat(search, "%',true) || LIKE(document(CodeableConceptMaster.coding[0]).longdesc,'%").concat(search, "%',true)) && CodeableConceptMaster.status == true && CodeableConceptMaster.activestatus == true"),
37233
+ "filter": "CodeableConceptMaster.Type == '".concat(type, "' &&(LIKE(document(CodeableConceptMaster.coding[0]).code,'%").concat(search, "%',true) ||LIKE(document(CodeableConceptMaster.coding[0]).shortdesc,'%").concat(search, "%',true) || LIKE(document(CodeableConceptMaster.coding[0]).longdesc,'%").concat(search, "%',true)) && CodeableConceptMaster.activestatus == true"),
37090
37234
  "limit": {
37091
37235
  "offset": "".concat(page),
37092
37236
  "count": "".concat(perPage)
37093
37237
  },
37094
- "return_fields": "MERGE(CodeableConceptMaster,{coding:document(CodeableConceptMaster.coding)},{TotalCount:COUNT(FOR cnt IN CodeableConceptMaster filter cnt.Type=='".concat(type, "' filter cnt.activestatus==true RETURN cnt._key)})")
37238
+ "return_fields": "MERGE(CodeableConceptMaster,{coding:document(CodeableConceptMaster.coding)},{TotalCount:COUNT(FOR cnt IN CodeableConceptMaster filter cnt.Type=='".concat(type, "' filter cnt.activestatus==true RETURN cnt._key)})"),
37239
+ "sort": "".concat(getMasterSort(sort), " ").concat(direction)
37095
37240
  };
37096
37241
  },
37097
37242
  add_new_general_type: function add_new_general_type(data) {
@@ -37377,7 +37522,8 @@ var fetchMaster = function fetchMaster(name, query) {
37377
37522
  };
37378
37523
 
37379
37524
  var GENERAL_MASTERS_READ = createAsyncThunk("generalMasterSlice/generalMastersRead", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
37380
- var _ref5,
37525
+ var payload,
37526
+ _ref5,
37381
37527
  rejectWithValue,
37382
37528
  queriesjson,
37383
37529
  data,
@@ -37388,12 +37534,14 @@ var GENERAL_MASTERS_READ = createAsyncThunk("generalMasterSlice/generalMastersRe
37388
37534
  while (1) {
37389
37535
  switch (_context4.prev = _context4.next) {
37390
37536
  case 0:
37537
+ payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
37391
37538
  _ref5 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref5.rejectWithValue;
37392
37539
  _context4.prev = 2;
37393
- queriesjson = queries$2.generalMasterlist;
37540
+ queriesjson = queries$2.generalMasterlist(payload.search); // alert(JSON.stringify(queriesjson))
37541
+
37394
37542
  _context4.next = 6;
37395
37543
  return fetchData({
37396
- body: queriesjson
37544
+ body: JSON.stringify(queriesjson)
37397
37545
  }, __readDocumentUrl__);
37398
37546
 
37399
37547
  case 6:
@@ -37528,6 +37676,8 @@ var GET_GENERAL_MASTER_TYPE = createAsyncThunk("generalMasterSlice/get_general_m
37528
37676
  page,
37529
37677
  perPage,
37530
37678
  search,
37679
+ sort,
37680
+ direction,
37531
37681
  data,
37532
37682
  readData,
37533
37683
  _args7 = arguments;
@@ -37539,10 +37689,10 @@ var GET_GENERAL_MASTER_TYPE = createAsyncThunk("generalMasterSlice/get_general_m
37539
37689
  payload = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
37540
37690
  actions = _args7.length > 1 ? _args7[1] : undefined;
37541
37691
  _context7.prev = 2;
37542
- type = payload.type, page = payload.page, perPage = payload.perPage, search = payload.search;
37692
+ type = payload.type, page = payload.page, perPage = payload.perPage, search = payload.search, sort = payload.sort, direction = payload.direction;
37543
37693
  _context7.next = 7;
37544
37694
  return fetchData({
37545
- body: JSON.stringify(queries$2.get_general_master_type(type, page, perPage, search ? search : ''))
37695
+ body: JSON.stringify(queries$2.get_general_master_type(type, page, perPage, search ? search : '', sort ? sort : '', direction ? '' : 'DESC'))
37546
37696
  }, __readDocumentUrl__);
37547
37697
 
37548
37698
  case 7:
@@ -37925,7 +38075,7 @@ var queries$1 = {
37925
38075
  }
37926
38076
  })];
37927
38077
  },
37928
- symptom_and_specialty_read: function symptom_and_specialty_read(search, page, perPage) {
38078
+ symptom_and_specialty_read: function symptom_and_specialty_read(search, page, perPage, sort, direction) {
37929
38079
  return {
37930
38080
  db_name: dbName$1,
37931
38081
  entity: "SymptomsMapping",
@@ -37935,7 +38085,7 @@ var queries$1 = {
37935
38085
  count: perPage
37936
38086
  },
37937
38087
  return_fields: "merge(SymptomsMapping,{TotalCount:COUNT(".concat(search ? "FOR cnt IN SymptomsMapping filter UPPER(cnt.SymptomsName) LIKE '%".concat(search.toUpperCase(), "%' || UPPER(cnt.symptomsCode) LIKE '%").concat(search.toUpperCase(), "%' RETURN cnt._key") : "FOR cnt IN SymptomsMapping RETURN cnt._key", " ), specialty:(FOR cod IN CodeableConceptMaster filter cod._id in SymptomsMapping.specialty RETURN merge(cod,{coding:document(cod.coding)}))})"),
37938
- sort: "SymptomsMapping.createddate"
38088
+ sort: "".concat(sort === "Symptom Code" ? "SymptomsMapping.symptomsCode ".concat(direction) : "SymptomsMapping.SymptomsName ".concat(direction))
37939
38089
  };
37940
38090
  },
37941
38091
  symptom_and_specialty_single_read: function symptom_and_specialty_single_read(_key) {
@@ -38085,7 +38235,7 @@ var SYMPTOM_AND_SPECIALTY_READ = createAsyncThunk("symptomAndSpecialtySlice/symp
38085
38235
  payload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
38086
38236
  _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
38087
38237
  _context2.prev = 2;
38088
- readqueries = queries$1.symptom_and_specialty_read(payload === null || payload === void 0 ? void 0 : payload.search, payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage);
38238
+ readqueries = queries$1.symptom_and_specialty_read(payload === null || payload === void 0 ? void 0 : payload.search, payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.sort ? payload === null || payload === void 0 ? void 0 : payload.sort : '', payload !== null && payload !== void 0 && payload.direction ? payload === null || payload === void 0 ? void 0 : payload.direction : '');
38089
38239
  _context2.next = 6;
38090
38240
  return fetchData({
38091
38241
  body: JSON.stringify(readqueries)
@@ -38320,7 +38470,7 @@ var symptomAndSpecialtyActions = {
38320
38470
  var symptomAndSpecialtySlice$1 = symptomAndSpecialtySlice.reducer;
38321
38471
 
38322
38472
  var queries = {
38323
- encounterType: function encounterType(page, perPage, search) {
38473
+ encounterType: function encounterType(page, perPage, search, sort, direction) {
38324
38474
  return {
38325
38475
  "db_name": dbName$1,
38326
38476
  "entity": "AMPatientClass",
@@ -38329,9 +38479,9 @@ var queries = {
38329
38479
  "offset": page,
38330
38480
  "count": perPage
38331
38481
  },
38332
- "return_fields": "merge(AMPatientClass,{TotalCount:count(FOR cnt IN AMPatientClass FILTER (LIKE(cnt.shortDesc,'%".concat(search, "%',true)) && cnt.activestatus==true return cnt._key), encType:document(AMPatientClass.encType).code},{encTypeDesc:document(AMPatientClass.encTypeDesc).display},{encClsType:document(AMPatientClass.encClsType).code},{encClsDesc:document(AMPatientClass.encClsDesc).display})"),
38333
- // "merge(AMPatientClass,{encClsByTypes:(for encClsByTypes in (AMPatientClass.encClsByTypes) return merge(encClsByTypes,{encClsType:document(encClsByTypes.encClsType)}))},{encType:document(AMPatientClass.encType)})"
38334
- "sort": "document(AMPatientClass.encTypeDesc).display"
38482
+ "return_fields": "merge(AMPatientClass,{TotalCount:count(FOR cnt IN AMPatientClass FILTER (LIKE(cnt.shortDesc,'%".concat(search, "%',true)) && cnt.activestatus==true return cnt._key), encClsByTypes:(for encClsByTypes in (AMPatientClass.encClsByTypes) return merge(encClsByTypes,{encClsType:document(encClsByTypes.encClsType)})) ,encType:document(AMPatientClass.encType)},{encTypeDesc:document(AMPatientClass.encTypeDesc).display},{encClsType:document(AMPatientClass.encClsType).code},{encClsDesc:document(AMPatientClass.encClsDesc).display})"),
38483
+ //"return" : "merge(AMPatientClass,{encClsByTypes:(for encClsByTypes in (AMPatientClass.encClsByTypes) return merge(encClsByTypes,{encClsType:document(encClsByTypes.encClsType)}))},{encType:document(AMPatientClass.encType)})",
38484
+ "sort": "".concat(sort === 'code' ? "AMPatientClass.encType ".concat(direction) : "AMPatientClass.shortDesc ".concat(direction))
38335
38485
  };
38336
38486
  },
38337
38487
  //STATUS CHANGE
@@ -38368,7 +38518,7 @@ var ENCOUNTER_TYPE_READ = createAsyncThunk("encouterTypeSlice/encouterTypeRead",
38368
38518
  payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
38369
38519
  _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
38370
38520
  _context.prev = 2;
38371
- queriesjson = queries.encounterType(payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.search ? payload === null || payload === void 0 ? void 0 : payload.search : '');
38521
+ queriesjson = queries.encounterType(payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.search ? payload === null || payload === void 0 ? void 0 : payload.search : '', payload !== null && payload !== void 0 && payload.sort ? payload === null || payload === void 0 ? void 0 : payload.sort : "", payload !== null && payload !== void 0 && payload.direction ? payload === null || payload === void 0 ? void 0 : payload.direction : '');
38372
38522
  _context.next = 6;
38373
38523
  return fetchData({
38374
38524
  body: JSON.stringify(queriesjson)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primary_care_admin_binder",
3
- "version": "0.1.67",
3
+ "version": "0.1.70",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",