primarycare-binder 1.1.127 → 1.1.129

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 +51 -40
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -8012,12 +8012,21 @@ var query_ids = {
8012
8012
  var start = _ref.start,
8013
8013
  end = _ref.end,
8014
8014
  id = _ref.id;
8015
- return {
8016
- "db_name": dbName,
8017
- "entity": "Schedule",
8018
- "filter": "Schedule.start >= ".concat(start, " AND Schedule.end <= ").concat(end, " AND Schedule.activestatus == true AND DOCUMENT(Schedule.resourceCode).id == ").concat(id),
8019
- "return_fields": "MERGE(Schedule, {slots : (FOR slt IN Slot FILTER Schedule.id IN slt.ScheduleID AND slt.status!='blocked' AND slt.start >= ".concat(moment$1.utc().unix(), " AND slt.activestatus==true sort slt._id asc RETURN merge(slt, {DayType: Document(slt.DayType)}))})")
8020
- };
8015
+ return (// ({
8016
+ // db_name: dbName,
8017
+ // entity: "Schedule",
8018
+ // filter: `Schedule.start >= ${start} AND Schedule.end <= ${end} AND Schedule.activestatus == true AND DOCUMENT(Schedule.resourceCode).id == ${id}`,
8019
+ // return_fields: `MERGE(Schedule, {slots : (FOR slt IN Slot FILTER Schedule.id IN slt.ScheduleID AND slt.status!='blocked' AND slt.start >= ${moment
8020
+ // .utc()
8021
+ // .unix()} AND slt.activestatus==true sort slt._id asc RETURN merge(slt, {DayType: Document(slt.DayType)}))})`,
8022
+ // }),
8023
+ {
8024
+ db_name: "".concat(dbName),
8025
+ entity: "ResourceTimeTable",
8026
+ filter: "ResourceTimeTable.effectivefrom<= ".concat(start, " and ResourceTimeTable.effectiveto>=").concat(end, " and DOCUMENT(ResourceTimeTable.resourcecode)[*].id any == ").concat(id, " and ResourceTimeTable.activestatus==true"),
8027
+ return_fields: "merge(ResourceTimeTable,{slot:(for slt in Slot filter slt.timetable_id==ResourceTimeTable._id AND slt.status!='blocked' AND slt.start >= ".concat(moment$1.utc().unix(), " AND slt.activestatus==true sort slt._id asc RETURN merge(slt, {DayType: Document(slt.DayType)}))}), and slt.activestatus==true return merge(slt,{DayType: document(Document(slt.app_duration_id).daytype)}))})")
8028
+ }
8029
+ );
8021
8030
  } // query: ({ start, end, id }) => ({
8022
8031
  // "db_name": dbName,
8023
8032
  // "entity": "Schedule",
@@ -11340,19 +11349,20 @@ var APPOINTMENT_CREATE = createAsyncThunk("appointmentReducer/upsertAppointment"
11340
11349
  bookedby: (authData === null || authData === void 0 ? void 0 : authData.practioner_id) || (authData === null || authData === void 0 ? void 0 : (_authData$persondata = authData.persondata) === null || _authData$persondata === void 0 ? void 0 : (_authData$persondata$ = _authData$persondata.payload) === null || _authData$persondata$ === void 0 ? void 0 : (_authData$persondata$2 = _authData$persondata$.data) === null || _authData$persondata$2 === void 0 ? void 0 : _authData$persondata$2.pid) || ""
11341
11350
  }
11342
11351
  }];
11343
- _context.next = 9;
11352
+ console.log(body, "body");
11353
+ _context.next = 10;
11344
11354
  return fetchData$3({
11345
11355
  body: JSON.stringify(body)
11346
11356
  }, __bookAppointmentUrl__);
11347
11357
 
11348
- case 9:
11358
+ case 10:
11349
11359
  data = _context.sent;
11350
11360
  return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
11351
11361
  data: data
11352
11362
  }));
11353
11363
 
11354
- case 13:
11355
- _context.prev = 13;
11364
+ case 14:
11365
+ _context.prev = 14;
11356
11366
  _context.t0 = _context["catch"](2);
11357
11367
  return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
11358
11368
  data: {
@@ -11360,12 +11370,12 @@ var APPOINTMENT_CREATE = createAsyncThunk("appointmentReducer/upsertAppointment"
11360
11370
  }
11361
11371
  })));
11362
11372
 
11363
- case 16:
11373
+ case 17:
11364
11374
  case "end":
11365
11375
  return _context.stop();
11366
11376
  }
11367
11377
  }
11368
- }, _callee, null, [[2, 13]]);
11378
+ }, _callee, null, [[2, 14]]);
11369
11379
  }))); // end
11370
11380
  // APPOINTMENT_UPDATE
11371
11381
 
@@ -12685,6 +12695,7 @@ var RECCURANCE_APPOINTMENT = createAsyncThunk("appointmentReducer/reccuranceAppo
12685
12695
  queryId = query_ids["appointmentReducer/reccuranceAppointment"]["practioner"];
12686
12696
  }
12687
12697
 
12698
+ console.log(queryId, "queryId");
12688
12699
  body = {
12689
12700
  db_name: dbName,
12690
12701
  // queryid: queryId,
@@ -12694,30 +12705,30 @@ var RECCURANCE_APPOINTMENT = createAsyncThunk("appointmentReducer/reccuranceAppo
12694
12705
  slotdate: getUtcTime(new Date())
12695
12706
  })
12696
12707
  };
12697
- _context15.next = 11;
12708
+ _context15.next = 12;
12698
12709
  return fetchData$3({
12699
12710
  body: JSON.stringify(body)
12700
12711
  });
12701
12712
 
12702
- case 11:
12713
+ case 12:
12703
12714
  data = _context15.sent;
12704
12715
  return _context15.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12705
12716
  data: data
12706
12717
  }));
12707
12718
 
12708
- case 15:
12709
- _context15.prev = 15;
12719
+ case 16:
12720
+ _context15.prev = 16;
12710
12721
  _context15.t0 = _context15["catch"](2);
12711
12722
  return _context15.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12712
12723
  message: _context15.t0.message
12713
12724
  })));
12714
12725
 
12715
- case 18:
12726
+ case 19:
12716
12727
  case "end":
12717
12728
  return _context15.stop();
12718
12729
  }
12719
12730
  }
12720
- }, _callee15, null, [[2, 15]]);
12731
+ }, _callee15, null, [[2, 16]]);
12721
12732
  }))); // UPDATE_APPOINTMENT_STATUS
12722
12733
 
12723
12734
  var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppointmentStatus", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
@@ -14699,13 +14710,13 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
14699
14710
 
14700
14711
  if (doctorId !== 0) {
14701
14712
  body = {
14702
- "db_name": dbName,
14703
- "queryid": query_ids.doctorListing_practitioner,
14704
- "filter": {
14705
- "org_id": hospital,
14706
- "practionerId": doctorId,
14707
- "startdate": getUtcTime(startDate),
14708
- "enddate": getUtcTime(endDate)
14713
+ db_name: dbName,
14714
+ queryid: query_ids.doctorListing_practitioner,
14715
+ filter: {
14716
+ org_id: hospital,
14717
+ practionerId: doctorId,
14718
+ startdate: getUtcTime(startDate),
14719
+ enddate: getUtcTime(endDate)
14709
14720
  }
14710
14721
  };
14711
14722
  } // body = {
@@ -14888,7 +14899,7 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
14888
14899
  s === null || s === void 0 ? void 0 : (_s$coding2 = s.coding) === null || _s$coding2 === void 0 ? void 0 : _s$coding2.forEach(function (val) {
14889
14900
  if (val === null || val === void 0 ? void 0 : val.display) {
14890
14901
  if (designation) {
14891
- designation += ', ';
14902
+ designation += ", ";
14892
14903
  }
14893
14904
 
14894
14905
  designation += val === null || val === void 0 ? void 0 : val.display;
@@ -14903,13 +14914,13 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
14903
14914
  restData === null || restData === void 0 ? void 0 : (_restData$communicati = restData.communication) === null || _restData$communicati === void 0 ? void 0 : _restData$communicati.forEach(function (c) {
14904
14915
  var _c$Type;
14905
14916
 
14906
- if ((c === null || c === void 0 ? void 0 : (_c$Type = c.Type) === null || _c$Type === void 0 ? void 0 : _c$Type.toLowerCase()) === 'language') {
14917
+ if ((c === null || c === void 0 ? void 0 : (_c$Type = c.Type) === null || _c$Type === void 0 ? void 0 : _c$Type.toLowerCase()) === "language") {
14907
14918
  var _c$coding;
14908
14919
 
14909
14920
  c === null || c === void 0 ? void 0 : (_c$coding = c.coding) === null || _c$coding === void 0 ? void 0 : _c$coding.forEach(function (cd) {
14910
14921
  var _cd$Type;
14911
14922
 
14912
- if ((cd === null || cd === void 0 ? void 0 : (_cd$Type = cd.Type) === null || _cd$Type === void 0 ? void 0 : _cd$Type.toLowerCase()) === 'language') {
14923
+ if ((cd === null || cd === void 0 ? void 0 : (_cd$Type = cd.Type) === null || _cd$Type === void 0 ? void 0 : _cd$Type.toLowerCase()) === "language") {
14913
14924
  languages.add(cd === null || cd === void 0 ? void 0 : cd.display);
14914
14925
  allLangs.add(cd === null || cd === void 0 ? void 0 : cd.display);
14915
14926
  }
@@ -15842,7 +15853,7 @@ var GET_ENCOUNTER_MASTER_TYPE = createAsyncThunk('searchApiSlice/masterEncounter
15842
15853
  // }
15843
15854
 
15844
15855
  encounterTypeBody = {
15845
- "db_name": "primarycare",
15856
+ "db_name": dbName,
15846
15857
  "entity": "AMPatientClass",
15847
15858
  "filter": "AMPatientClass.status==true && AMPatientClass.activestatus==true",
15848
15859
  "return_fields": "keep(AMPatientClass,'_id','_key','id', 'encType', 'shortDesc','longDesc','status')",
@@ -15904,7 +15915,7 @@ var GET_ENCOUNTER_MASTER_CLASS = createAsyncThunk('searchApiSlice/masterEncounte
15904
15915
  // }
15905
15916
 
15906
15917
  encounterClassBody = {
15907
- "db_name": "primarycare",
15918
+ "db_name": dbName,
15908
15919
  "entity": "AMPatientClass",
15909
15920
  "filter": "AMPatientClass.encType=='".concat(encType, "' && AMPatientClass.status==true && AMPatientClass.activestatus==true"),
15910
15921
  "return_fields": "{encClsByTypes:AMPatientClass.encClsByTypes}"
@@ -17356,7 +17367,7 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
17356
17367
  _context.next = 12;
17357
17368
  return fetchData$3({
17358
17369
  body: JSON.stringify({
17359
- "db_name": "primarycare",
17370
+ "db_name": dbName,
17360
17371
  "entity": "Person",
17361
17372
  "filter": "first(document(document(Person.identifier)[*].Type)[*].display) in [".concat(id_type, "] && first(document(Person.identifier)[*].value) in [").concat(id_number, "] && Person.activestatus==true"),
17362
17373
  "return_fields": "merge(Person,{identifier:document(Person.identifier)})"
@@ -28435,10 +28446,10 @@ var queries$7 = {
28435
28446
  return "{\n\t\t\t\"db_name\": \"".concat(dbName, "\",\n\t\t\t\"entity\": \"Practitioner\",\n \"filter\": \"Practitioner._id == '").concat(id, "'\",\n\t\t\t\"return_fields\": \"Practitioner\"\n\t\t}");
28436
28447
  },
28437
28448
  alertOrderRule: function alertOrderRule(orgId) {
28438
- return "{\n \"db_name\": \"primarycare\",\n \"entity\": \"CA_OrderCatalogPrivilegeLevel\",\n \"filter\" :\"CA_OrderCatalogPrivilegeLevel.orgn_code == '".concat(orgId, "' && LOWER(DOCUMENT(CA_OrderCatalogPrivilegeLevel.service_applicablity).display) like LOWER('%service%')\",\n \"return_fields\": \"MERGE(CA_OrderCatalogPrivilegeLevel,{privilege_type: DOCUMENT(CA_OrderCatalogPrivilegeLevel.privilege_type)})\"\n }");
28449
+ return "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CA_OrderCatalogPrivilegeLevel\",\n \"filter\" :\"CA_OrderCatalogPrivilegeLevel.orgn_code == '").concat(orgId, "' && LOWER(DOCUMENT(CA_OrderCatalogPrivilegeLevel.service_applicablity).display) like LOWER('%service%')\",\n \"return_fields\": \"MERGE(CA_OrderCatalogPrivilegeLevel,{privilege_type: DOCUMENT(CA_OrderCatalogPrivilegeLevel.privilege_type)})\"\n }");
28439
28450
  },
28440
28451
  alertMedicationRule: function alertMedicationRule(orgId) {
28441
- return "{\n \"db_name\": \"primarycare\",\n \"entity\": \"CA_OrderCatalogPrivilegeLevel\",\n \"filter\" :\"CA_OrderCatalogPrivilegeLevel.orgn_code == '".concat(orgId, "' && LOWER(DOCUMENT(CA_OrderCatalogPrivilegeLevel.service_applicablity).display) like LOWER('%medication%')\",\n \"return_fields\": \"MERGE(CA_OrderCatalogPrivilegeLevel,{privilege_type: DOCUMENT(CA_OrderCatalogPrivilegeLevel.privilege_type)})\"\n }");
28452
+ return "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CA_OrderCatalogPrivilegeLevel\",\n \"filter\" :\"CA_OrderCatalogPrivilegeLevel.orgn_code == '").concat(orgId, "' && LOWER(DOCUMENT(CA_OrderCatalogPrivilegeLevel.service_applicablity).display) like LOWER('%medication%')\",\n \"return_fields\": \"MERGE(CA_OrderCatalogPrivilegeLevel,{privilege_type: DOCUMENT(CA_OrderCatalogPrivilegeLevel.privilege_type)})\"\n }");
28442
28453
  }
28443
28454
  };
28444
28455
 
@@ -31125,7 +31136,7 @@ var GET_SPECIMENTYPE = createAsyncThunk("LabOrderApiSlice/get_specimentype", /*#
31125
31136
  // filter: "CodeableConceptMaster.Type=='SPECIMENTYPE'",
31126
31137
  // return_fields:
31127
31138
  // "MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})",
31128
- db_name: "primarycare",
31139
+ db_name: dbName,
31129
31140
  entity: "CodingMaster",
31130
31141
  filter: "CodingMaster.Type == 'SPECIMENTYPE' && CodingMaster.status == true && CodingMaster.activestatus == true",
31131
31142
  return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status','activestatus')",
@@ -31191,7 +31202,7 @@ var GET_UOM = createAsyncThunk("LabOrderApiSlice/get_uom", /*#__PURE__*/_asyncTo
31191
31202
  // filter: "CodeableConceptMaster.Type=='SPECIMENTYPE'",
31192
31203
  // return_fields:
31193
31204
  // "MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})",
31194
- db_name: "primarycare",
31205
+ db_name: dbName,
31195
31206
  entity: "CodingMaster",
31196
31207
  filter: "CodingMaster.Type == 'UOM' && CodingMaster.status == true && CodingMaster.activestatus == true",
31197
31208
  return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status','activestatus')",
@@ -31975,7 +31986,7 @@ var GET_INDICATION = createAsyncThunk("LabOrderApiSlice/get_indication", /*#__PU
31975
31986
  // "entity": "CodingMaster",
31976
31987
  // "filter": "CodingMaster.Type=='INDICATIONREASON' && CodingMaster.activestatus==true && CodingMaster.status==true",
31977
31988
  // "return_fields": "KEEP(CodingMaster,'_id','id','_key','code','display','Type')"
31978
- db_name: "primarycare",
31989
+ db_name: dbName,
31979
31990
  entity: "CodingMaster",
31980
31991
  filter: "CodingMaster.Type == 'INDICATIONREASON' && CodingMaster.status == true && CodingMaster.activestatus == true",
31981
31992
  return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status','activestatus')",
@@ -35706,7 +35717,7 @@ var queries$4 = {
35706
35717
  // db_name: `${dbName}`,
35707
35718
  // entity: "ReasonMaster",
35708
35719
  // return_fields: "ReasonMaster",
35709
- db_name: "primarycare",
35720
+ db_name: dbName,
35710
35721
  entity: "CodingMaster",
35711
35722
  filter: "CodingMaster.Type == 'INDICATIONREASON' && CodingMaster.status == true && CodingMaster.activestatus == true",
35712
35723
  return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status','activestatus')",
@@ -37640,7 +37651,7 @@ var queries$3 = (_queries = {
37640
37651
  // db_name: `${dbName}`,
37641
37652
  // entity: "ReasonMaster",
37642
37653
  // return_fields: "ReasonMaster",
37643
- db_name: "primarycare",
37654
+ db_name: "".concat(dbName),
37644
37655
  entity: "CodingMaster",
37645
37656
  filter: "CodingMaster.Type == 'INDICATIONREASON' && CodingMaster.status == true && CodingMaster.activestatus == true",
37646
37657
  return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type','status','activestatus')",
@@ -46392,7 +46403,7 @@ var tableData = function tableData(patientId, encounterId) {
46392
46403
  };
46393
46404
  var searchCodeDesc = function searchCodeDesc(patientId, encounterId, search) {
46394
46405
  return {
46395
- db_name: "primarycare",
46406
+ db_name: dbName,
46396
46407
  entity: "RCM_PatientChargeTrx",
46397
46408
  filter: "RCM_PatientChargeTrx.patientid=='".concat(patientId, "' && RCM_PatientChargeTrx.encounterid=='").concat(encounterId, "' && RCM_PatientChargeTrx.activestatus==true && (like(document(document(RCM_PatientChargeTrx.orderrefid).drugCode).ShortDesc,'%").concat(search, "%',true) || like(document(document(RCM_PatientChargeTrx.orderrefid).drugCode).DrugCode,'%").concat(search, "%',true) || like(document(document(RCM_PatientChargeTrx.orderrefid).orderCatalog).ordercatalog,'%").concat(search, "%',true) ||like(document(document(RCM_PatientChargeTrx.orderrefid).orderCatalog).shortdesc,'%").concat(search, "%',true)) && (false==true ? RCM_PatientChargeTrx.billstatus == false: RCM_PatientChargeTrx.billstatus == RCM_PatientChargeTrx.billstatus)"),
46398
46409
  return_fields: // "merge(RCM_PatientChargeTrx,{chargestatus:contains(RCM_PatientChargeTrx.chargestatus,'CodingMaster')?document(RCM_PatientChargeTrx.chargestatus).display:contains(RCM_PatientChargeTrx.chargestatus,'CodeableConceptMaster')?document(document(RCM_PatientChargeTrx.chargestatus).coding)[0].display:''},{service:contains(RCM_PatientChargeTrx.orderrefid,'PH_OrderLine')?document(document(RCM_PatientChargeTrx.orderrefid).drugCode).DrugCode:contains(RCM_PatientChargeTrx.orderrefid,'CA_OrderLine')?document(document(RCM_PatientChargeTrx.orderrefid).orderCatalog).ordercatalog:false,servicedesc:contains(RCM_PatientChargeTrx.orderrefid,'PH_OrderLine')?document(document(RCM_PatientChargeTrx.orderrefid).drugCode).ShortDesc:contains(RCM_PatientChargeTrx.orderrefid,'CA_OrderLine')?document(document(RCM_PatientChargeTrx.orderrefid).orderCatalog).shortdesc:false,orderref:contains(RCM_PatientChargeTrx.orderrefid,'PH_OrderLine')?document(RCM_PatientChargeTrx.orderrefid).prescriptionId:contains(RCM_PatientChargeTrx.orderrefid,'CA_OrderLine')?document(RCM_PatientChargeTrx.orderrefid).order_Id:false,ordcatOrdrugclass:contains(RCM_PatientChargeTrx.orderrefid,'PH_OrderLine')?document(document(document(RCM_PatientChargeTrx.orderrefid).drugCode).DrugCategory).shortdesc:contains(RCM_PatientChargeTrx.orderrefid,'CA_OrderLine')?document(document(document(RCM_PatientChargeTrx.orderrefid).orderCatalog).ordercategory).ordercategory:false,chargeuom:document(RCM_PatientChargeTrx.chargeuom).UOM},{orderdatetime:contains(RCM_PatientChargeTrx.orderrefid,'PH_OrderLine')?document(RCM_PatientChargeTrx.orderrefid).PrescriptionDate:contains(RCM_PatientChargeTrx.orderrefid,'CA_OrderLine')?document(RCM_PatientChargeTrx.orderrefid).orderDateTime:false})"
@@ -46542,7 +46553,7 @@ var saveBill = {
46542
46553
  };
46543
46554
  var billRounding = function billRounding(orgId) {
46544
46555
  return {
46545
- db_name: "primarycare",
46556
+ db_name: dbName,
46546
46557
  entity: "EntityParametersSetup",
46547
46558
  filter: "EntityParametersSetup.entityid=='".concat(orgId, "' && document(EntityParametersSetup.parameterid).code=='BILLROUNDDECVAL' && EntityParametersSetup.activestatus==true"),
46548
46559
  return_fields: "unset(EntityParametersSetup,'createdby','createddate','updatedby','updatedate')"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primarycare-binder",
3
- "version": "1.1.127",
3
+ "version": "1.1.129",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",