primarycare-binder 1.0.142 → 1.0.146

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs.js +2746 -698
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -2400,10 +2400,10 @@ var queries = {
2400
2400
  db_name: "".concat(dbName),
2401
2401
  entity: "Encounter,Patient",
2402
2402
  filter: {
2403
- Encounter: "".concat(appointmentId, " IN Encounter.appointmentId"),
2403
+ Encounter: "Encounter.appointmentId == [".concat(appointmentId, "]"),
2404
2404
  Patient: "Patient.id == Encounter.patient_id"
2405
2405
  },
2406
- return_fields: "MERGE(Encounter, {patient_id: (FOR pat IN Patient.identifier RETURN MERGE(Patient,{identifier:DOCUMENT(pat),name:(FOR hn IN Patient.name RETURN DOCUMENT(hn)), telecom:(FOR tel IN Patient.telecom RETURN DOCUMENT(tel)), photo:(FOR ph IN Patient.photo RETURN DOCUMENT(ph)), martialStatus:(FOR ms IN Patient.martialStatus RETURN DOCUMENT(ms)) } )), } )"
2406
+ "return_fields": "merge(Encounter,{patient_id:(for p in Patient.identifier return merge(Patient,{identifier:document(p),name:document(Patient.name),telecom:document(Patient.telecom),photo:document(Patient.photo),martialStatus:document(Patient.maritalstatus)}))})"
2407
2407
  };
2408
2408
  },
2409
2409
  visitmodify: {
@@ -2453,9 +2453,9 @@ var queries = {
2453
2453
  },
2454
2454
  codablemasterPractitioner: {
2455
2455
  query: function query(OrgID) {
2456
- return "Practitioner.PractitionerRoleID==PractitionerRole.id && PractitionerRole.SpecialtyID ANY ==".concat(OrgID);
2456
+ return "Practitioner.practitioner_role ANY == PractitionerRole._id && PractitionerRole.SpecialtyID == '".concat(OrgID, "'");
2457
2457
  },
2458
- returnFields: "MERGE(Practitioner,{name:TO_ARRAY(DOCUMENT( Practitioner.name)), practitioner_type:(FOR cod IN TO_ARRAY(DOCUMENT(Practitioner.practitioner_type).coding) RETURN MERGE(DOCUMENT(Practitioner.practitioner_type),{coding:DOCUMENT(cod) } ) ) } )"
2458
+ returnFields: "MERGE(Practitioner,{name:(for doc in HumanNameMaster filter doc._id in Practitioner.name return merge(doc,{use:document(doc.use),prefix:document(doc.prefix),suffix:document(doc.suffix)})), practitioner_type:(document(Practitioner.practitioner_type).display)})"
2459
2459
  },
2460
2460
  codablemasterGetFinancial: {
2461
2461
  query: function query(patientId) {
@@ -2480,15 +2480,15 @@ var queries = {
2480
2480
  },
2481
2481
  codablemasterGetAppointment: {
2482
2482
  query: function query(appointmentId) {
2483
- return "Patient.personID in Appointment.PersonID && Appointment.appno like '%".concat(appointmentId, "%'");
2483
+ return "Person.Id in Appointment.PersonID && Appointment.appno like '%".concat(appointmentId, "%'");
2484
2484
  },
2485
- returnFields: "{AppointmentID:Appointment.id,_id:Appointment._id,status:Appointment.status,avc:Appointment.avc,appnumber:Appointment.appno,end:Appointment.end,start:Appointment.start,createddate:Appointment.createddate,updatedate:Appointment.updatedate,patient:merge(Patient,{identifier:document(Patient.identifier)},{martialStatus:document(Patient.martialStatus)},{name:document(Patient.name)},{telecom:document(Patient.telecom)},{photo:document(Patient.photo)},{personID:(for pid in Person filter pid.Id == Patient.personID return pid)},{address:document(Patient.address)},{activereason:(DOCUMENT(Patient.activereason)),deceasedreason:(DOCUMENT(Patient.deceasedreason))},{isdeceased:(for doc in CodeableConceptMaster filter doc._id==Patient.isdeceased return merge(doc,{coding:(for cod in CodingMaster filter cod._id in doc.coding return cod)}))})}"
2485
+ returnFields: "{AppointmentID:Appointment.id,_id:Appointment._id,status:Appointment.status,avc:Appointment.avc,appnumber:Appointment.appno,end:Appointment.end,start:Appointment.start,createddate:Appointment.createddate,updatedate:Appointment.updatedate, personId:Appointment.PersonID, patient:(FOR adqolcPatient IN Patient FILTER adqolcPatient.personID IN Appointment.PersonID RETURN merge(adqolcPatient,{identifier:document(adqolcPatient.identifier)},{martialStatus:document(adqolcPatient.martialStatus)},{name:document(adqolcPatient.name)},{telecom:document(adqolcPatient.telecom)},{photo:document(adqolcPatient.photo)},{personID:(for pid in Person filter pid.Id == adqolcPatient.personID return pid)},{address:document(adqolcPatient.address)},{activereason:(DOCUMENT(adqolcPatient.activereason)),deceasedreason:(DOCUMENT(adqolcPatient.deceasedreason))},{isdeceased:(for doc in CodeableConceptMaster filter doc._id==adqolcPatient.isdeceased return merge(doc,{coding:(for cod in CodingMaster filter cod._id in doc.coding return cod)}))})) ,Person:MERGE(Person,{name:(FOR hn IN TO_ARRAY(Person.name) RETURN DOCUMENT(hn)),telecom:(FOR tel IN TO_ARRAY(Person.telecom) RETURN DOCUMENT(tel) )})}"
2486
2486
  },
2487
2487
  codablemasterGetPatientname: {
2488
2488
  query: function query(patientName) {
2489
- return JSON.parse("\n {\n \"HumanNameMaster\": \"HumanNameMaster.text LIKE '".concat(patientName, "'\",\n \"Person\": \"Person.name[*] ANY == HumanNameMaster._id\",\n \"Patient\": \"Patient.personID == Person.Id\"\n }"));
2489
+ return "DOCUMENT(Person.name)[*].text LIKE '%".concat(patientName, "%'");
2490
2490
  },
2491
- returnFields: "{'prefix': HumanNameMaster.prefix, 'name': HumanNameMaster.text, 'personId': Person.Id, 'patientDetails': Patient, 'telecom': Document(Person.telecom)}"
2491
+ returnFields: "{prefix: DOCUMENT(Person.name)[*].prefix,suffix: DOCUMENT(Person.name)[*].suffix, name: DOCUMENT(Person.name)[*].text, personId: Person.Id,patientDetail: (for pat in Patient FILTER pat.personID == Person.Id RETURN merge(pat,{name:(for nam in HumanNameMaster filter nam._id in pat.name return merge(nam,{use:document(nam.use),prefix:document(nam.prefix),suffix:document(nam.suffix)}))})),telecom: Document(Person.telecom)}"
2492
2492
  },
2493
2493
  specialityAgainstPractitioner: {
2494
2494
  query: function query() {
@@ -11194,6 +11194,14 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
11194
11194
  _payload$isCompleted,
11195
11195
  isCompleted,
11196
11196
  appBody,
11197
+ encounterStatus,
11198
+ _encounterInfo$result,
11199
+ encounterInfo,
11200
+ _ref27,
11201
+ _id,
11202
+ _key,
11203
+ statushistory,
11204
+ updateData,
11197
11205
  appData,
11198
11206
  appInfo,
11199
11207
  body,
@@ -11215,17 +11223,88 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
11215
11223
  appointment_id: appointmentId
11216
11224
  }
11217
11225
  };
11218
- _context13.next = 7;
11226
+
11227
+ if (status === "completed_assemble") {
11228
+ encounterStatus = "CodingMaster/11595";
11229
+ } else if (status === "completed_nurse") {
11230
+ encounterStatus = "CodingMaster/11596";
11231
+ } else if (status === "completed") {
11232
+ encounterStatus = "CodingMaster/11598";
11233
+ }
11234
+
11235
+ if (!encounterStatus) {
11236
+ _context13.next = 17;
11237
+ break;
11238
+ }
11239
+
11240
+ _context13.next = 9;
11241
+ return fetchData$1({
11242
+ body: JSON.stringify({
11243
+ db_name: dbName,
11244
+ entity: "Encounter",
11245
+ filter: "".concat(appointmentId, " IN Encounter.appointmentId"),
11246
+ return_fields: "merge(Encounter, {statushistory: (for a in Encounter.statushistory return merge(a, {period: Document(a.period)}))})"
11247
+ })
11248
+ }, __readDocumentUrl__);
11249
+
11250
+ case 9:
11251
+ encounterInfo = _context13.sent;
11252
+ _ref27 = (encounterInfo === null || encounterInfo === void 0 ? void 0 : (_encounterInfo$result = encounterInfo.result) === null || _encounterInfo$result === void 0 ? void 0 : _encounterInfo$result[0]) || {}, _id = _ref27._id, _key = _ref27._key, statushistory = _ref27.statushistory;
11253
+
11254
+ if (!(_id && _key && statushistory && Array.isArray(statushistory))) {
11255
+ _context13.next = 17;
11256
+ break;
11257
+ }
11258
+
11259
+ statushistory = statushistory.map(function (s) {
11260
+ var _s$period, _s$period$, _s$period2, _s$period2$;
11261
+
11262
+ return {
11263
+ period: [{
11264
+ start: s === null || s === void 0 ? void 0 : (_s$period = s.period) === null || _s$period === void 0 ? void 0 : (_s$period$ = _s$period[0]) === null || _s$period$ === void 0 ? void 0 : _s$period$.start,
11265
+ end: s === null || s === void 0 ? void 0 : (_s$period2 = s.period) === null || _s$period2 === void 0 ? void 0 : (_s$period2$ = _s$period2[0]) === null || _s$period2$ === void 0 ? void 0 : _s$period2$.end,
11266
+ id: 0
11267
+ }],
11268
+ status: s === null || s === void 0 ? void 0 : s.status
11269
+ };
11270
+ });
11271
+ statushistory.push({
11272
+ status: encounterStatus,
11273
+ period: [{
11274
+ start: moment().unix(),
11275
+ end: moment().unix(),
11276
+ id: 0
11277
+ }]
11278
+ });
11279
+ updateData = [{
11280
+ db_name: dbName,
11281
+ entity: "Encounter",
11282
+ filter: {
11283
+ _key: _key
11284
+ },
11285
+ is_metadata: true,
11286
+ metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd",
11287
+ doc: {
11288
+ statushistory: statushistory
11289
+ }
11290
+ }];
11291
+ _context13.next = 17;
11292
+ return fetchData$1({
11293
+ body: JSON.stringify(updateData)
11294
+ }, __uspsertUrl__);
11295
+
11296
+ case 17:
11297
+ _context13.next = 19;
11219
11298
  return fetchData$1({
11220
11299
  body: JSON.stringify(appBody)
11221
11300
  });
11222
11301
 
11223
- case 7:
11302
+ case 19:
11224
11303
  appData = _context13.sent;
11225
11304
  appInfo = (appData === null || appData === void 0 ? void 0 : (_appData$ = appData[0]) === null || _appData$ === void 0 ? void 0 : _appData$[0]) || {};
11226
11305
 
11227
11306
  if (!(Object.keys(appInfo).length > 0)) {
11228
- _context13.next = 31;
11307
+ _context13.next = 43;
11229
11308
  break;
11230
11309
  }
11231
11310
 
@@ -11262,38 +11341,38 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
11262
11341
  id: appointmentId
11263
11342
  }
11264
11343
  }];
11265
- _context13.next = 29;
11344
+ _context13.next = 41;
11266
11345
  return fetchData$1({
11267
11346
  body: JSON.stringify(body)
11268
11347
  }, __uspsertUrl__);
11269
11348
 
11270
- case 29:
11349
+ case 41:
11271
11350
  data = _context13.sent;
11272
11351
  return _context13.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
11273
11352
  data: data
11274
11353
  }));
11275
11354
 
11276
- case 31:
11277
- _context13.next = 36;
11355
+ case 43:
11356
+ _context13.next = 48;
11278
11357
  break;
11279
11358
 
11280
- case 33:
11281
- _context13.prev = 33;
11359
+ case 45:
11360
+ _context13.prev = 45;
11282
11361
  _context13.t0 = _context13["catch"](2);
11283
11362
  return _context13.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
11284
11363
  message: _context13.t0.message
11285
11364
  })));
11286
11365
 
11287
- case 36:
11366
+ case 48:
11288
11367
  case "end":
11289
11368
  return _context13.stop();
11290
11369
  }
11291
11370
  }
11292
- }, _callee13, null, [[2, 33]]);
11371
+ }, _callee13, null, [[2, 45]]);
11293
11372
  })));
11294
11373
  var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApoointmentStatus", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
11295
11374
  var payload,
11296
- _ref28,
11375
+ _ref29,
11297
11376
  rejectWithValue,
11298
11377
  _appData$2,
11299
11378
  _payload$appointmentI3,
@@ -11312,7 +11391,7 @@ var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApooi
11312
11391
  switch (_context14.prev = _context14.next) {
11313
11392
  case 0:
11314
11393
  payload = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
11315
- _ref28 = _args14.length > 1 ? _args14[1] : undefined, rejectWithValue = _ref28.rejectWithValue;
11394
+ _ref29 = _args14.length > 1 ? _args14[1] : undefined, rejectWithValue = _ref29.rejectWithValue;
11316
11395
  _context14.prev = 2;
11317
11396
  _payload$appointmentI3 = payload.appointmentId, appointmentId = _payload$appointmentI3 === void 0 ? 0 : _payload$appointmentI3, _payload$reason = payload.reason, reason = _payload$reason === void 0 ? "" : _payload$reason;
11318
11397
  appBody = {
@@ -13084,7 +13163,8 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
13084
13163
  specialities: [],
13085
13164
  healthCareId: healthCareId,
13086
13165
  orgId: isClinic ? id : restData === null || restData === void 0 ? void 0 : (_restData$hospital = restData.hospital) === null || _restData$hospital === void 0 ? void 0 : _restData$hospital.id,
13087
- _id: isClinic ? restData === null || restData === void 0 ? void 0 : (_restData$clinics4 = restData.clinics) === null || _restData$clinics4 === void 0 ? void 0 : (_restData$clinics4$ = _restData$clinics4[0]) === null || _restData$clinics4$ === void 0 ? void 0 : _restData$clinics4$._id : restData === null || restData === void 0 ? void 0 : restData._id
13166
+ _id: isClinic ? restData === null || restData === void 0 ? void 0 : (_restData$clinics4 = restData.clinics) === null || _restData$clinics4 === void 0 ? void 0 : (_restData$clinics4$ = _restData$clinics4[0]) === null || _restData$clinics4$ === void 0 ? void 0 : _restData$clinics4$._id : restData === null || restData === void 0 ? void 0 : restData._id,
13167
+ _key: restData === null || restData === void 0 ? void 0 : restData._key
13088
13168
  };
13089
13169
 
13090
13170
  if (isClinic) {
@@ -13124,6 +13204,7 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
13124
13204
  return "";
13125
13205
  });
13126
13206
  info["kms"] = (restData === null || restData === void 0 ? void 0 : (_restData$address3 = restData.address) === null || _restData$address3 === void 0 ? void 0 : (_restData$address3$ = _restData$address3[0]) === null || _restData$address3$ === void 0 ? void 0 : _restData$address3$.distance) ? "".concat(restData.address[0].distance) : "0";
13207
+ info["key"] = restData === null || restData === void 0 ? void 0 : restData._key;
13127
13208
  } else {
13128
13209
  var _restData$Specialties, _restData$communicati, _restData$hospital2, _restData$degree, _restData$hospital3, _restData$address4, _restData$address4$, _restData$name, _restData$photo, _restData$photo$, _restData$address5, _restData$address5$;
13129
13210
 
@@ -13174,6 +13255,7 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
13174
13255
  info["name"] = makeName(nameObj);
13175
13256
  info["img"] = getImgUrl(restData === null || restData === void 0 ? void 0 : (_restData$photo = restData.photo) === null || _restData$photo === void 0 ? void 0 : (_restData$photo$ = _restData$photo[0]) === null || _restData$photo$ === void 0 ? void 0 : _restData$photo$.fileid);
13176
13257
  info["kms"] = (restData === null || restData === void 0 ? void 0 : (_restData$address5 = restData.address) === null || _restData$address5 === void 0 ? void 0 : (_restData$address5$ = _restData$address5[0]) === null || _restData$address5$ === void 0 ? void 0 : _restData$address5$.distance) ? "".concat(restData.address[0].distance) : "0";
13258
+ info["key"] = restData === null || restData === void 0 ? void 0 : restData._key;
13177
13259
  }
13178
13260
 
13179
13261
  returnData.push(info);
@@ -15078,11 +15160,11 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
15078
15160
 
15079
15161
  if (photo) {
15080
15162
  /*{
15081
- fileName: "",
15082
- fileid: "",
15083
- filetype: "",
15084
- objectid: ""
15085
- }*/
15163
+ fileName: "",
15164
+ fileid: "",
15165
+ filetype: "",
15166
+ objectid: ""
15167
+ }*/
15086
15168
  imageInfo = photo.map(function (_ref3) {
15087
15169
  var _ref3$fileName = _ref3.fileName,
15088
15170
  fileName = _ref3$fileName === void 0 ? "" : _ref3$fileName,
@@ -15102,58 +15184,58 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
15102
15184
  }
15103
15185
 
15104
15186
  body = [{
15105
- "db_name": dbName,
15106
- "entity": "Person",
15107
- "is_metadata": true,
15108
- "metadataId": query_ids["personApiSlice/upsertPerson"],
15109
- "doc": {
15110
- "identifier": [],
15111
- "name": [{
15112
- "use": "string",
15113
- "text": firstName,
15114
- "family": lastName,
15115
- "given": firstName,
15116
- "prefix": gender.toLowerCase() === "male" ? "Mr" : "Mrs",
15117
- "suffix": "",
15118
- "period": [{
15119
- "start": Math.floor(Date.now() / 1000),
15120
- "end": 0
15187
+ db_name: dbName,
15188
+ entity: "Person",
15189
+ is_metadata: true,
15190
+ metadataId: query_ids["personApiSlice/upsertPerson"],
15191
+ doc: {
15192
+ identifier: [],
15193
+ name: [{
15194
+ use: "string",
15195
+ text: firstName,
15196
+ family: lastName,
15197
+ given: firstName,
15198
+ prefix: gender.toLowerCase() === "male" ? "Mr" : "Mrs",
15199
+ suffix: "",
15200
+ period: [{
15201
+ start: Math.floor(Date.now() / 1000),
15202
+ end: 0
15121
15203
  }]
15122
15204
  }],
15123
- "telecom": [{
15124
- "system": "Phone",
15125
- "value": phone,
15205
+ telecom: [{
15206
+ system: "Phone",
15207
+ value: phone,
15126
15208
  // number
15127
- "use": "Mobile",
15209
+ use: "Mobile",
15128
15210
  // phone
15129
- "rank": "1",
15211
+ rank: "1",
15130
15212
  // 1
15131
- "period": [{
15132
- "start": Math.floor(Date.now() / 1000),
15133
- "end": 0
15213
+ period: [{
15214
+ start: Math.floor(Date.now() / 1000),
15215
+ end: 0
15134
15216
  }]
15135
15217
  }, {
15136
- "system": "Email",
15137
- "value": email || "",
15218
+ system: "Email",
15219
+ value: email || "",
15138
15220
  // number
15139
- "use": "Work",
15221
+ use: "Work",
15140
15222
  // phone
15141
- "rank": "2",
15223
+ rank: "2",
15142
15224
  // 1
15143
- "period": [{
15144
- "start": Math.floor(Date.now() / 1000),
15145
- "end": 0
15225
+ period: [{
15226
+ start: Math.floor(Date.now() / 1000),
15227
+ end: 0
15146
15228
  }]
15147
15229
  }],
15148
- "gender": gender,
15149
- "birthDay": dob.replace(/-/g, '/'),
15150
- "address": [],
15151
- "photo": imageInfo,
15152
- "active": true,
15153
- "link": [],
15154
- "Id": 0,
15155
- "RelatedPersonID": [],
15156
- "OrgID": []
15230
+ gender: gender,
15231
+ birthDay: dob.replace(/-/g, "/"),
15232
+ address: [],
15233
+ photo: imageInfo,
15234
+ active: true,
15235
+ link: [],
15236
+ Id: 0,
15237
+ RelatedPersonID: [],
15238
+ OrgID: []
15157
15239
  }
15158
15240
  }];
15159
15241
  _context.next = 9;
@@ -15174,10 +15256,10 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
15174
15256
  case 12:
15175
15257
  return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
15176
15258
  data: {
15177
- id: (data === null || data === void 0 ? void 0 : (_data$Result = data['Result']) === null || _data$Result === void 0 ? void 0 : (_data$Result$ = _data$Result[0]) === null || _data$Result$ === void 0 ? void 0 : (_data$Result$$propert = _data$Result$.properties) === null || _data$Result$$propert === void 0 ? void 0 : (_data$Result$$propert2 = _data$Result$$propert.doc) === null || _data$Result$$propert2 === void 0 ? void 0 : _data$Result$$propert2.Id) || 0,
15178
- name: (data === null || data === void 0 ? void 0 : (_data$Result2 = data['Result']) === null || _data$Result2 === void 0 ? void 0 : (_data$Result2$ = _data$Result2[0]) === null || _data$Result2$ === void 0 ? void 0 : (_data$Result2$$proper = _data$Result2$.properties) === null || _data$Result2$$proper === void 0 ? void 0 : (_data$Result2$$proper2 = _data$Result2$$proper.doc) === null || _data$Result2$$proper2 === void 0 ? void 0 : _data$Result2$$proper2.name) || [],
15179
- telecom: (data === null || data === void 0 ? void 0 : (_data$Result3 = data['Result']) === null || _data$Result3 === void 0 ? void 0 : (_data$Result3$ = _data$Result3[0]) === null || _data$Result3$ === void 0 ? void 0 : (_data$Result3$$proper = _data$Result3$.properties) === null || _data$Result3$$proper === void 0 ? void 0 : (_data$Result3$$proper2 = _data$Result3$$proper.doc) === null || _data$Result3$$proper2 === void 0 ? void 0 : _data$Result3$$proper2.telecom) || [],
15180
- photo: (data === null || data === void 0 ? void 0 : (_data$Result4 = data['Result']) === null || _data$Result4 === void 0 ? void 0 : (_data$Result4$ = _data$Result4[0]) === null || _data$Result4$ === void 0 ? void 0 : (_data$Result4$$proper = _data$Result4$.properties) === null || _data$Result4$$proper === void 0 ? void 0 : (_data$Result4$$proper2 = _data$Result4$$proper.doc) === null || _data$Result4$$proper2 === void 0 ? void 0 : _data$Result4$$proper2.photo) || []
15259
+ id: (data === null || data === void 0 ? void 0 : (_data$Result = data["Result"]) === null || _data$Result === void 0 ? void 0 : (_data$Result$ = _data$Result[0]) === null || _data$Result$ === void 0 ? void 0 : (_data$Result$$propert = _data$Result$.properties) === null || _data$Result$$propert === void 0 ? void 0 : (_data$Result$$propert2 = _data$Result$$propert.doc) === null || _data$Result$$propert2 === void 0 ? void 0 : _data$Result$$propert2.Id) || 0,
15260
+ name: (data === null || data === void 0 ? void 0 : (_data$Result2 = data["Result"]) === null || _data$Result2 === void 0 ? void 0 : (_data$Result2$ = _data$Result2[0]) === null || _data$Result2$ === void 0 ? void 0 : (_data$Result2$$proper = _data$Result2$.properties) === null || _data$Result2$$proper === void 0 ? void 0 : (_data$Result2$$proper2 = _data$Result2$$proper.doc) === null || _data$Result2$$proper2 === void 0 ? void 0 : _data$Result2$$proper2.name) || [],
15261
+ telecom: (data === null || data === void 0 ? void 0 : (_data$Result3 = data["Result"]) === null || _data$Result3 === void 0 ? void 0 : (_data$Result3$ = _data$Result3[0]) === null || _data$Result3$ === void 0 ? void 0 : (_data$Result3$$proper = _data$Result3$.properties) === null || _data$Result3$$proper === void 0 ? void 0 : (_data$Result3$$proper2 = _data$Result3$$proper.doc) === null || _data$Result3$$proper2 === void 0 ? void 0 : _data$Result3$$proper2.telecom) || [],
15262
+ photo: (data === null || data === void 0 ? void 0 : (_data$Result4 = data["Result"]) === null || _data$Result4 === void 0 ? void 0 : (_data$Result4$ = _data$Result4[0]) === null || _data$Result4$ === void 0 ? void 0 : (_data$Result4$$proper = _data$Result4$.properties) === null || _data$Result4$$proper === void 0 ? void 0 : (_data$Result4$$proper2 = _data$Result4$$proper.doc) === null || _data$Result4$$proper2 === void 0 ? void 0 : _data$Result4$$proper2.photo) || []
15181
15263
  }
15182
15264
  }));
15183
15265
 
@@ -15245,25 +15327,7 @@ var ADD_RELATED_PERSON = createAsyncThunk("personApiSlice/addRelatedPerson", /*#
15245
15327
  // empty
15246
15328
  "active": true,
15247
15329
  // true
15248
- "relationship": [{
15249
- "text": relationType,
15250
- // relationType
15251
- "coding": [{
15252
- "system": "string",
15253
- "version": "string",
15254
- "code": "string",
15255
- "display": "string",
15256
- "userSelected": true,
15257
- "id": 0,
15258
- "Type": "string"
15259
- }],
15260
- // ??
15261
- "id": 0,
15262
- // ??
15263
- "Type": "string",
15264
- // ??
15265
- "status": true
15266
- }],
15330
+ "relationship": relationType,
15267
15331
  "name": [{
15268
15332
  "use": "string",
15269
15333
  "text": firstName,
@@ -15412,10 +15476,10 @@ var READ_PERSON = createAsyncThunk("personApiSlice/readPerson", /*#__PURE__*/_as
15412
15476
  _context3.prev = 2;
15413
15477
  _payload$phone3 = payload.phone, phone = _payload$phone3 === void 0 ? "" : _payload$phone3, _payload$allData = payload.allData, allData = _payload$allData === void 0 ? false : _payload$allData;
15414
15478
  body = {
15415
- "db_name": dbName,
15416
- "queryid": query_ids["personApiSlice/readPerson"],
15417
- "filter": {
15418
- "username": phone
15479
+ db_name: dbName,
15480
+ queryid: query_ids["personApiSlice/readPerson"],
15481
+ filter: {
15482
+ username: phone
15419
15483
  }
15420
15484
  };
15421
15485
  _context3.next = 7;
@@ -15484,11 +15548,11 @@ var SEARCH_PERSON = createAsyncThunk("personApiSlice/SearchPerson", /*#__PURE__*
15484
15548
  _context4.prev = 2;
15485
15549
  _payload$phone4 = payload.phone, phone = _payload$phone4 === void 0 ? "" : _payload$phone4, _payload$use = payload.use, use = _payload$use === void 0 ? "" : _payload$use;
15486
15550
  body = {
15487
- "db_name": dbName,
15488
- "queryid": query_ids["personApiSlice/SearchPerson"],
15489
- "filter": {
15490
- "mobile": "%".concat(phone, "%"),
15491
- "use": use
15551
+ db_name: dbName,
15552
+ queryid: query_ids["personApiSlice/SearchPerson"],
15553
+ filter: {
15554
+ mobile: "%".concat(phone, "%"),
15555
+ use: use
15492
15556
  }
15493
15557
  };
15494
15558
  _context4.next = 7;
@@ -15516,12 +15580,12 @@ var SEARCH_PERSON = createAsyncThunk("personApiSlice/SearchPerson", /*#__PURE__*
15516
15580
  }
15517
15581
  }, _callee4, null, [[2, 11]]);
15518
15582
  })));
15519
- var SEARCH_PRACTIONER = createAsyncThunk("personApiSlice/SearchPractioner", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
15583
+ var SEARCH_BY_ADHAAR = createAsyncThunk("personApiSlice/SearchByAdhaar", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
15520
15584
  var payload,
15521
15585
  _ref11,
15522
15586
  rejectWithValue,
15523
- _payload$email3,
15524
- email,
15587
+ _payload$adhaarNo,
15588
+ adhaarNo,
15525
15589
  body,
15526
15590
  data,
15527
15591
  _args5 = arguments;
@@ -15533,18 +15597,20 @@ var SEARCH_PRACTIONER = createAsyncThunk("personApiSlice/SearchPractioner", /*#_
15533
15597
  payload = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
15534
15598
  _ref11 = _args5.length > 1 ? _args5[1] : undefined, rejectWithValue = _ref11.rejectWithValue;
15535
15599
  _context5.prev = 2;
15536
- _payload$email3 = payload.email, email = _payload$email3 === void 0 ? "" : _payload$email3;
15600
+ _payload$adhaarNo = payload.adhaarNo, adhaarNo = _payload$adhaarNo === void 0 ? "" : _payload$adhaarNo;
15537
15601
  body = {
15538
- "db_name": dbName,
15539
- "queryid": query_ids["personApiSlice/SearchPractioner"],
15540
- "filter": {
15541
- "emailId": email
15542
- }
15602
+ db_name: dbName,
15603
+ entity: "Patient,IdentifierMaster,HumanNameMaster",
15604
+ filter: {
15605
+ IdentifierMaster: "Patient.identifier ANY == IdentifierMaster._id && LOWER(DOCUMENT(IdentifierMaster.user).display) like '%aadhaar%' && IdentifierMaster.value like '%".concat(adhaarNo, "%'"),
15606
+ HumanNameMaster: "Patient.name ANY == HumanNameMaster._id"
15607
+ },
15608
+ return_fields: "MERGE(Patient,{name: HumanNameMaster,telecom:document(Patient.telecom),person:(for per in Person filter per.Id == Patient.personID return merge(per,{name:document(per.name)},{telecom:document(per.telecom)})),identifier:(FOR iden IN TO_ARRAY(Patient.identifier) RETURN MERGE(DOCUMENT(iden),{user:DOCUMENT(DOCUMENT(iden).user)}))})"
15543
15609
  };
15544
15610
  _context5.next = 7;
15545
15611
  return fetchData$1({
15546
15612
  body: JSON.stringify(body)
15547
- });
15613
+ }, __readDocumentUrl__);
15548
15614
 
15549
15615
  case 7:
15550
15616
  data = _context5.sent;
@@ -15566,16 +15632,14 @@ var SEARCH_PRACTIONER = createAsyncThunk("personApiSlice/SearchPractioner", /*#_
15566
15632
  }
15567
15633
  }, _callee5, null, [[2, 11]]);
15568
15634
  })));
15569
- var GET_RELATED_PERSON = createAsyncThunk("personApiSlice/getRelatedPerson", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
15635
+ var SEARCH_PRACTIONER = createAsyncThunk("personApiSlice/SearchPractioner", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
15570
15636
  var payload,
15571
15637
  _ref13,
15572
15638
  rejectWithValue,
15573
- _payload$userid,
15574
- userid,
15639
+ _payload$email3,
15640
+ email,
15575
15641
  body,
15576
15642
  data,
15577
- returnData,
15578
- _data$10,
15579
15643
  _args6 = arguments;
15580
15644
 
15581
15645
  return regeneratorRuntime.wrap(function _callee6$(_context6) {
@@ -15585,12 +15649,12 @@ var GET_RELATED_PERSON = createAsyncThunk("personApiSlice/getRelatedPerson", /*#
15585
15649
  payload = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
15586
15650
  _ref13 = _args6.length > 1 ? _args6[1] : undefined, rejectWithValue = _ref13.rejectWithValue;
15587
15651
  _context6.prev = 2;
15588
- _payload$userid = payload.userid, userid = _payload$userid === void 0 ? 0 : _payload$userid;
15652
+ _payload$email3 = payload.email, email = _payload$email3 === void 0 ? "" : _payload$email3;
15589
15653
  body = {
15590
- "db_name": dbName,
15591
- "queryid": query_ids["personApiSlice/getRelatedPerson"],
15592
- "filter": {
15593
- userid: userid
15654
+ db_name: dbName,
15655
+ queryid: query_ids["personApiSlice/SearchPractioner"],
15656
+ filter: {
15657
+ emailId: email
15594
15658
  }
15595
15659
  };
15596
15660
  _context6.next = 7;
@@ -15600,38 +15664,34 @@ var GET_RELATED_PERSON = createAsyncThunk("personApiSlice/getRelatedPerson", /*#
15600
15664
 
15601
15665
  case 7:
15602
15666
  data = _context6.sent;
15603
- returnData = [];
15604
-
15605
- if (Array.isArray(data)) {
15606
- returnData = ((_data$10 = data[0]) === null || _data$10 === void 0 ? void 0 : _data$10.data) || [];
15607
- }
15608
-
15609
15667
  return _context6.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
15610
- data: returnData
15668
+ data: data
15611
15669
  }));
15612
15670
 
15613
- case 13:
15614
- _context6.prev = 13;
15671
+ case 11:
15672
+ _context6.prev = 11;
15615
15673
  _context6.t0 = _context6["catch"](2);
15616
15674
  return _context6.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
15617
15675
  message: _context6.t0.message
15618
15676
  })));
15619
15677
 
15620
- case 16:
15678
+ case 14:
15621
15679
  case "end":
15622
15680
  return _context6.stop();
15623
15681
  }
15624
15682
  }
15625
- }, _callee6, null, [[2, 13]]);
15683
+ }, _callee6, null, [[2, 11]]);
15626
15684
  })));
15627
- var DELETE_PERSON = createAsyncThunk("personApiSlice/deletePerson", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
15685
+ var GET_RELATED_PERSON = createAsyncThunk("personApiSlice/getRelatedPerson", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
15628
15686
  var payload,
15629
15687
  _ref15,
15630
15688
  rejectWithValue,
15631
- _payload$id,
15632
- id,
15689
+ _payload$userid,
15690
+ userid,
15633
15691
  body,
15634
15692
  data,
15693
+ returnData,
15694
+ _data$10,
15635
15695
  _args7 = arguments;
15636
15696
 
15637
15697
  return regeneratorRuntime.wrap(function _callee7$(_context7) {
@@ -15641,48 +15701,53 @@ var DELETE_PERSON = createAsyncThunk("personApiSlice/deletePerson", /*#__PURE__*
15641
15701
  payload = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
15642
15702
  _ref15 = _args7.length > 1 ? _args7[1] : undefined, rejectWithValue = _ref15.rejectWithValue;
15643
15703
  _context7.prev = 2;
15644
- _payload$id = payload.id, id = _payload$id === void 0 ? "" : _payload$id;
15704
+ _payload$userid = payload.userid, userid = _payload$userid === void 0 ? 0 : _payload$userid;
15645
15705
  body = {
15646
- db_name: "primarycare",
15647
- entity: "Person",
15706
+ db_name: dbName,
15707
+ queryid: query_ids["personApiSlice/getRelatedPerson"],
15648
15708
  filter: {
15649
- id: id
15709
+ userid: userid
15650
15710
  }
15651
15711
  };
15652
15712
  _context7.next = 7;
15653
- return fetchData$1(urls.delete_person, {
15654
- body: body
15713
+ return fetchData$1({
15714
+ body: JSON.stringify(body)
15655
15715
  });
15656
15716
 
15657
15717
  case 7:
15658
15718
  data = _context7.sent;
15659
- return _context7.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
15660
- data: data
15719
+ returnData = [];
15720
+
15721
+ if (Array.isArray(data)) {
15722
+ returnData = ((_data$10 = data[0]) === null || _data$10 === void 0 ? void 0 : _data$10.data) || [];
15723
+ }
15724
+
15725
+ return _context7.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
15726
+ data: returnData
15661
15727
  }));
15662
15728
 
15663
- case 11:
15664
- _context7.prev = 11;
15729
+ case 13:
15730
+ _context7.prev = 13;
15665
15731
  _context7.t0 = _context7["catch"](2);
15666
15732
  return _context7.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
15667
15733
  message: _context7.t0.message
15668
15734
  })));
15669
15735
 
15670
- case 14:
15736
+ case 16:
15671
15737
  case "end":
15672
15738
  return _context7.stop();
15673
15739
  }
15674
15740
  }
15675
- }, _callee7, null, [[2, 11]]);
15741
+ }, _callee7, null, [[2, 13]]);
15676
15742
  })));
15677
- var READ_PATIENT = createAsyncThunk("personApiSlice/deletePerson", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
15743
+ var DELETE_PERSON = createAsyncThunk("personApiSlice/deletePerson", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
15678
15744
  var payload,
15679
15745
  _ref17,
15680
15746
  rejectWithValue,
15681
- _payload$mrnnumber,
15682
- mrnnumber,
15747
+ _payload$id,
15748
+ id,
15683
15749
  body,
15684
15750
  data,
15685
- returnData,
15686
15751
  _args8 = arguments;
15687
15752
 
15688
15753
  return regeneratorRuntime.wrap(function _callee8$(_context8) {
@@ -15692,6 +15757,57 @@ var READ_PATIENT = createAsyncThunk("personApiSlice/deletePerson", /*#__PURE__*/
15692
15757
  payload = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
15693
15758
  _ref17 = _args8.length > 1 ? _args8[1] : undefined, rejectWithValue = _ref17.rejectWithValue;
15694
15759
  _context8.prev = 2;
15760
+ _payload$id = payload.id, id = _payload$id === void 0 ? "" : _payload$id;
15761
+ body = {
15762
+ db_name: "primarycare",
15763
+ entity: "Person",
15764
+ filter: {
15765
+ id: id
15766
+ }
15767
+ };
15768
+ _context8.next = 7;
15769
+ return fetchData$1(urls.delete_person, {
15770
+ body: body
15771
+ });
15772
+
15773
+ case 7:
15774
+ data = _context8.sent;
15775
+ return _context8.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
15776
+ data: data
15777
+ }));
15778
+
15779
+ case 11:
15780
+ _context8.prev = 11;
15781
+ _context8.t0 = _context8["catch"](2);
15782
+ return _context8.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
15783
+ message: _context8.t0.message
15784
+ })));
15785
+
15786
+ case 14:
15787
+ case "end":
15788
+ return _context8.stop();
15789
+ }
15790
+ }
15791
+ }, _callee8, null, [[2, 11]]);
15792
+ })));
15793
+ var READ_PATIENT = createAsyncThunk("personApiSlice/deletePerson", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
15794
+ var payload,
15795
+ _ref19,
15796
+ rejectWithValue,
15797
+ _payload$mrnnumber,
15798
+ mrnnumber,
15799
+ body,
15800
+ data,
15801
+ returnData,
15802
+ _args9 = arguments;
15803
+
15804
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
15805
+ while (1) {
15806
+ switch (_context9.prev = _context9.next) {
15807
+ case 0:
15808
+ payload = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
15809
+ _ref19 = _args9.length > 1 ? _args9[1] : undefined, rejectWithValue = _ref19.rejectWithValue;
15810
+ _context9.prev = 2;
15695
15811
  _payload$mrnnumber = payload.mrnnumber, mrnnumber = _payload$mrnnumber === void 0 ? "" : _payload$mrnnumber;
15696
15812
  body = {
15697
15813
  db_name: dbName,
@@ -15699,36 +15815,36 @@ var READ_PATIENT = createAsyncThunk("personApiSlice/deletePerson", /*#__PURE__*/
15699
15815
  filter: queries["getPatientByMRN"].query(mrnnumber),
15700
15816
  return_fields: queries["getPatientByMRN"].returnFields
15701
15817
  };
15702
- _context8.next = 7;
15818
+ _context9.next = 7;
15703
15819
  return fetchData$1({
15704
15820
  body: JSON.stringify(body)
15705
15821
  }, __readDocumentUrl__);
15706
15822
 
15707
15823
  case 7:
15708
- data = _context8.sent;
15824
+ data = _context9.sent;
15709
15825
  returnData = [];
15710
15826
 
15711
15827
  if (Array.isArray(data.result)) {
15712
15828
  returnData = data.result;
15713
15829
  }
15714
15830
 
15715
- return _context8.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
15831
+ return _context9.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
15716
15832
  data: returnData
15717
15833
  }));
15718
15834
 
15719
15835
  case 13:
15720
- _context8.prev = 13;
15721
- _context8.t0 = _context8["catch"](2);
15722
- return _context8.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
15723
- message: _context8.t0.message
15836
+ _context9.prev = 13;
15837
+ _context9.t0 = _context9["catch"](2);
15838
+ return _context9.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
15839
+ message: _context9.t0.message
15724
15840
  })));
15725
15841
 
15726
15842
  case 16:
15727
15843
  case "end":
15728
- return _context8.stop();
15844
+ return _context9.stop();
15729
15845
  }
15730
15846
  }
15731
- }, _callee8, null, [[2, 13]]);
15847
+ }, _callee9, null, [[2, 13]]);
15732
15848
  })));
15733
15849
  var personApiSlice = createSlice({
15734
15850
  name: "personApiSlice",
@@ -15740,7 +15856,8 @@ var personApiSlice = createSlice({
15740
15856
  addRelatedPerson: _objectSpread2({}, defaultState.Info),
15741
15857
  getRelatedPerson: _objectSpread2({}, defaultState.List),
15742
15858
  searchPerson: _objectSpread2({}, defaultState.List),
15743
- searchPractioner: _objectSpread2({}, defaultState.List)
15859
+ searchPractioner: _objectSpread2({}, defaultState.List),
15860
+ searchBYAdhaar: _objectSpread2({}, defaultState.List)
15744
15861
  },
15745
15862
  extraReducers: (_extraReducers$c = {}, _defineProperty(_extraReducers$c, UPSERT_PERSON.fulfilled, function (state, action) {
15746
15863
  var _action$payload;
@@ -15792,36 +15909,46 @@ var personApiSlice = createSlice({
15792
15909
  var _action$payload10;
15793
15910
 
15794
15911
  state.readPerson = (_action$payload10 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload10 !== void 0 ? _action$payload10 : [];
15795
- }), _defineProperty(_extraReducers$c, DELETE_PERSON.fulfilled, function (state, action) {
15912
+ }), _defineProperty(_extraReducers$c, SEARCH_BY_ADHAAR.fulfilled, function (state, action) {
15796
15913
  var _action$payload11;
15797
15914
 
15798
- state.deletePerson = (_action$payload11 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload11 !== void 0 ? _action$payload11 : [];
15915
+ state.searchBYAdhaar = (_action$payload11 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload11 !== void 0 ? _action$payload11 : [];
15916
+ }), _defineProperty(_extraReducers$c, SEARCH_BY_ADHAAR.pending, function (state, action) {
15917
+ state.searchBYAdhaar.loading = true;
15918
+ }), _defineProperty(_extraReducers$c, SEARCH_BY_ADHAAR.rejected, function (state, action) {
15919
+ var _action$payload12;
15920
+
15921
+ state.searchBYAdhaar = (_action$payload12 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload12 !== void 0 ? _action$payload12 : [];
15922
+ }), _defineProperty(_extraReducers$c, DELETE_PERSON.fulfilled, function (state, action) {
15923
+ var _action$payload13;
15924
+
15925
+ state.deletePerson = (_action$payload13 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload13 !== void 0 ? _action$payload13 : [];
15799
15926
  }), _defineProperty(_extraReducers$c, DELETE_PERSON.pending, function (state, action) {
15800
15927
  state.deletePerson.loading = true;
15801
15928
  }), _defineProperty(_extraReducers$c, DELETE_PERSON.rejected, function (state, action) {
15802
- var _action$payload12;
15929
+ var _action$payload14;
15803
15930
 
15804
- state.deletePerson = (_action$payload12 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload12 !== void 0 ? _action$payload12 : [];
15931
+ state.deletePerson = (_action$payload14 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload14 !== void 0 ? _action$payload14 : [];
15805
15932
  }), _defineProperty(_extraReducers$c, ADD_RELATED_PERSON.fulfilled, function (state, action) {
15806
- var _action$payload13;
15933
+ var _action$payload15;
15807
15934
 
15808
- state.addRelatedPerson = (_action$payload13 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload13 !== void 0 ? _action$payload13 : [];
15935
+ state.addRelatedPerson = (_action$payload15 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload15 !== void 0 ? _action$payload15 : [];
15809
15936
  }), _defineProperty(_extraReducers$c, ADD_RELATED_PERSON.pending, function (state, action) {
15810
15937
  state.addRelatedPerson.loading = true;
15811
15938
  }), _defineProperty(_extraReducers$c, ADD_RELATED_PERSON.rejected, function (state, action) {
15812
- var _action$payload14;
15939
+ var _action$payload16;
15813
15940
 
15814
- state.addRelatedPerson = (_action$payload14 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload14 !== void 0 ? _action$payload14 : [];
15941
+ state.addRelatedPerson = (_action$payload16 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload16 !== void 0 ? _action$payload16 : [];
15815
15942
  }), _defineProperty(_extraReducers$c, GET_RELATED_PERSON.fulfilled, function (state, action) {
15816
- var _action$payload15;
15943
+ var _action$payload17;
15817
15944
 
15818
- state.getRelatedPerson = (_action$payload15 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload15 !== void 0 ? _action$payload15 : [];
15945
+ state.getRelatedPerson = (_action$payload17 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload17 !== void 0 ? _action$payload17 : [];
15819
15946
  }), _defineProperty(_extraReducers$c, GET_RELATED_PERSON.pending, function (state, action) {
15820
15947
  state.getRelatedPerson.loading = true;
15821
15948
  }), _defineProperty(_extraReducers$c, GET_RELATED_PERSON.rejected, function (state, action) {
15822
- var _action$payload16;
15949
+ var _action$payload18;
15823
15950
 
15824
- state.getRelatedPerson = (_action$payload16 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload16 !== void 0 ? _action$payload16 : [];
15951
+ state.getRelatedPerson = (_action$payload18 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload18 !== void 0 ? _action$payload18 : [];
15825
15952
  }), _extraReducers$c)
15826
15953
  });
15827
15954
  var personApiActions = {
@@ -15832,7 +15959,8 @@ var personApiActions = {
15832
15959
  GET_RELATED_PERSON: GET_RELATED_PERSON,
15833
15960
  SEARCH_PERSON: SEARCH_PERSON,
15834
15961
  READ_PATIENT: READ_PATIENT,
15835
- SEARCH_PRACTIONER: SEARCH_PRACTIONER
15962
+ SEARCH_PRACTIONER: SEARCH_PRACTIONER,
15963
+ SEARCH_BY_ADHAAR: SEARCH_BY_ADHAAR
15836
15964
  };
15837
15965
  var personApiSlice$1 = personApiSlice.reducer;
15838
15966
 
@@ -16837,7 +16965,7 @@ var GET_PATIENT_APPOINTMENT = createAsyncThunk("OrganizationRegisterPatientApiSl
16837
16965
  _payload$appointmentI = payload.appointmentId, appointmentId = _payload$appointmentI === void 0 ? "" : _payload$appointmentI;
16838
16966
  body = {
16839
16967
  db_name: dbName,
16840
- entity: "Patient,Appointment",
16968
+ entity: "Person,Appointment",
16841
16969
  filter: queries["codablemasterGetAppointment"].query(appointmentId),
16842
16970
  return_fields: queries["codablemasterGetAppointment"].returnFields
16843
16971
  };
@@ -16893,7 +17021,7 @@ var GET_PATIENT_NAME = createAsyncThunk("OrganizationRegisterPatientApiSlice/get
16893
17021
  _payload$patientName = payload.patientName, patientName = _payload$patientName === void 0 ? "" : _payload$patientName;
16894
17022
  body = {
16895
17023
  db_name: dbName,
16896
- entity: "HumanNameMaster,Person,Patient",
17024
+ entity: "Person",
16897
17025
  filter: queries["codablemasterGetPatientname"].query(patientName),
16898
17026
  return_fields: queries["codablemasterGetPatientname"].returnFields
16899
17027
  };
@@ -17195,6 +17323,18 @@ var dashboardQuery = {
17195
17323
  }
17196
17324
  };
17197
17325
  },
17326
+ todayScheduleQuery: function todayScheduleQuery(startDate, endDate, startTime, endTime, loginId) {
17327
+ return {
17328
+ doctor: {
17329
+ db_name: dbName,
17330
+ entity: "Schedule",
17331
+ filter: "Schedule.start >=".concat(startDate, " AND Schedule.start<=").concat(endDate, " AND ").concat(loginId, " IN Schedule.practitionerID"),
17332
+ return_fields: "MERGE(Schedule,{slot:(FOR slt IN Slot FILTER Schedule.id IN slt.ScheduleID AND slt.start>=".concat(startTime, " AND slt.end<=").concat(endTime, " RETURN MERGE(slt,{Appointment:(FOR app IN Appointment FILTER slt.id IN app.slotID RETURN app),Type:slt.Maxbooking>0?'Slab':'Slot'}))})")
17333
+ } // Nurse: {},
17334
+ // Frontdesk: {},
17335
+
17336
+ };
17337
+ },
17198
17338
  patientStatusPendingAssessment: function patientStatusPendingAssessment(orgID, startDate, endDate, loginId) {
17199
17339
  return {
17200
17340
  // Doctor: {},
@@ -17283,6 +17423,27 @@ var dashboardQuery = {
17283
17423
  }
17284
17424
  };
17285
17425
  },
17426
+ patientWaitingTimeQuery: function patientWaitingTimeQuery(orgID, loginId) {
17427
+ return {
17428
+ doctor: {
17429
+ "db_name": dbName,
17430
+ "queryid": "4a129656-d8e2-4a3c-9626-7488903118f9",
17431
+ "filter": {
17432
+ "practid": loginId,
17433
+ "orgid": "".concat(orgID)
17434
+ }
17435
+ },
17436
+ nurse: {
17437
+ "db_name": dbName,
17438
+ "queryid": "4a129656-d8e2-4a3c-9626-7488903118f9",
17439
+ "filter": {
17440
+ "practid": loginId,
17441
+ "orgid": "".concat(orgID)
17442
+ }
17443
+ } // Frontdesk: {},
17444
+
17445
+ };
17446
+ },
17286
17447
  firstVisit: function firstVisit(orgID, startDate, endDate, loginId) {
17287
17448
  return {
17288
17449
  Doctor: {
@@ -17505,8 +17666,56 @@ var visitQuery = {
17505
17666
  };
17506
17667
  }
17507
17668
  };
17669
+ var patientCountQuery = {
17670
+ patientCount: function patientCount() {
17671
+ return {
17672
+ doctor: {
17673
+ db_name: dbName,
17674
+ entity: "Encounter,CodeableConceptMaster",
17675
+ filter: {
17676
+ Encounter: "(DOCUMENT(Encounter.priority).display=='High' || DOCUMENT(Encounter.priority).display=='arrived' || DOCUMENT(Encounter.priority).display=='triaged' || DOCUMENT(Encounter.priority).display=='in-progress' || DOCUMENT(Encounter.priority).display=='onleave' )",
17677
+ CodeableConceptMaster: "CodeableConceptMaster.Type=='ENCSTATUS' AND DOCUMENT(CodeableConceptMaster.coding)[*].display ANY==DOCUMENT(Encounter.status).display COLLECT WITH COUNT INTO length"
17678
+ },
17679
+ return_fields: "length"
17680
+ },
17681
+ nurse: {
17682
+ db_name: dbName,
17683
+ entity: "Practitioner,Encounter",
17684
+ filter: {
17685
+ Practitioner: "Practitioner.practitioner_type=='CodingMaster/10628' and Practitioner.id==86 AND DOCUMENT(Practitioner.practitioner_role[*])[*].OrgID ANY =='Organization/10026'",
17686
+ Encounter: " DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID ANY IN Encounter.practitioner_details[*].speciality AND Encounter.encounterdate>=1631679441 && Encounter.encounterdate<=1631730599 AND (DOCUMENT(Encounter.priority).display=='High' || DOCUMENT(Encounter.priority).display=='arrived' || DOCUMENT(Encounter.priority).display=='triaged' || DOCUMENT(Encounter.priority).display=='in-progress' || DOCUMENT(Encounter.priority).display=='onleave' ) COLLECT WITH COUNT INTO length "
17687
+ },
17688
+ return_fields: "length"
17689
+ }
17690
+ };
17691
+ }
17692
+ };
17693
+ var highPriorityPatientQuery = {
17694
+ PatientCard: function PatientCard() {
17695
+ return {
17696
+ doctor: {
17697
+ db_name: "primarycare",
17698
+ entity: "Encounter,CodeableConceptMaster",
17699
+ filter: {
17700
+ Encounter: "Encounter.participant[*].Practitioner_id ANY ==85 AND (DOCUMENT(Encounter.priority).display=='High' || DOCUMENT(Encounter.priority).display=='arrived' || DOCUMENT(Encounter.priority).display=='triaged' || DOCUMENT(Encounter.priority).display=='in-progress' || DOCUMENT(Encounter.priority).display=='onleave' )",
17701
+ CodeableConceptMaster: "CodeableConceptMaster.Type=='ENCSTATUS' AND DOCUMENT(CodeableConceptMaster.coding)[*].display ANY==DOCUMENT(Encounter.status).display"
17702
+ },
17703
+ return_fields: " MERGE(Encounter,{patient_id:(FOR pat IN Patient FILTER pat.id==Encounter.patient_id RETURN MERGE(pat,{name:(FOR hn IN TO_ARRAY(pat.name) RETURN DOCUMENT(hn))})),participant:(FOR pract IN TO_ARRAY(Encounter.participant) RETURN MERGE(pract,{Practitioner_id:(FOR prac IN Practitioner FILTER prac.id==pract.Practitioner_id RETURN MERGE(prac,{name:(FOR hn IN TO_ARRAY(prac.name) RETURN DOCUMENT(hn))}))})) ,priority:DOCUMENT(Encounter.priority),priorityreason:DOCUMENT(Encounter.priorityreason)})"
17704
+ },
17705
+ nurse: {
17706
+ "db_name": "primarycare",
17707
+ "entity": "Practitioner,Encounter",
17708
+ "filter": {
17709
+ "Practitioner": "Practitioner.practitioner_type=='CodingMaster/10628' and Practitioner.id==89 AND DOCUMENT(Practitioner.practitioner_role[*])[*].OrgID ANY =='Organization/10026'",
17710
+ "Encounter": " DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID ANY IN Encounter.practitioner_details[*].speciality AND Encounter.encounterdate>=1631679441 && Encounter.encounterdate<=1631730599 AND (DOCUMENT(Encounter.priority).display=='High' || DOCUMENT(Encounter.priority).display=='arrived' || DOCUMENT(Encounter.priority).display=='triaged' || DOCUMENT(Encounter.priority).display=='in-progress' || DOCUMENT(Encounter.priority).display=='onleave' )"
17711
+ },
17712
+ "return_fields": "MERGE(Encounter,{patient_id:(FOR pat IN Patient FILTER pat.id==Encounter.patient_id RETURN MERGE(pat,{name:(FOR hn IN TO_ARRAY(pat.name) RETURN DOCUMENT(hn)),photo:(FOR ph IN TO_ARRAY(pat.photo) RETURN DOCUMENT(ph))})),priority:DOCUMENT(Encounter.priority),priorityreason:DOCUMENT(Encounter.priorityreason)})"
17713
+ }
17714
+ };
17715
+ }
17716
+ };
17508
17717
 
17509
- var _extraReducers$h;
17718
+ var _extraReducers$h, _extraReducers2;
17510
17719
  var APPOINTMENTS = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
17511
17720
  var payload,
17512
17721
  _ref2,
@@ -17572,18 +17781,18 @@ var APPOINTMENTS = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_
17572
17781
  }
17573
17782
  }, _callee, null, [[2, 15]]);
17574
17783
  })));
17575
- var PATIENTSTATUSASSESSMENTPENDING = createAsyncThunk("dashboardApiSlice/patientStatusAssessmentPendin", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
17784
+ var TODAY_SCHEDULE = createAsyncThunk("dashboardApiSlice/today_schedul", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
17576
17785
  var payload,
17577
17786
  _ref4,
17578
17787
  rejectWithValue,
17579
- _data$result$0$Checke,
17580
- _data$result$2,
17581
- orgId,
17582
17788
  startDate,
17583
17789
  endDate,
17790
+ startTime,
17791
+ endTime,
17584
17792
  roleId,
17585
17793
  loginId,
17586
17794
  data,
17795
+ arr,
17587
17796
  _args2 = arguments;
17588
17797
 
17589
17798
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -17593,47 +17802,73 @@ var PATIENTSTATUSASSESSMENTPENDING = createAsyncThunk("dashboardApiSlice/patient
17593
17802
  payload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
17594
17803
  _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
17595
17804
  _context2.prev = 2;
17596
- orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId; // debugger;
17597
-
17805
+ startDate = payload.startDate, endDate = payload.endDate, startTime = payload.startTime, endTime = payload.endTime, roleId = payload.roleId, loginId = payload.loginId;
17598
17806
  _context2.next = 6;
17599
17807
  return fetchData$1({
17600
- body: JSON.stringify(dashboardQuery.patientStatusPendingAssessment(orgId, startDate, endDate, loginId)[roleId])
17808
+ body: JSON.stringify(dashboardQuery.todayScheduleQuery(startDate, endDate, startTime, endTime, loginId)[roleId])
17601
17809
  }, __readDocumentUrl__);
17602
17810
 
17603
17811
  case 6:
17604
17812
  data = _context2.sent;
17813
+ arr = [];
17814
+
17815
+ if (data === null || data === void 0 ? void 0 : data.result) {
17816
+ data === null || data === void 0 ? void 0 : data.result.map(function (val) {
17817
+ var _val$slot;
17818
+
17819
+ (_val$slot = val.slot) === null || _val$slot === void 0 ? void 0 : _val$slot.map(function (task) {
17820
+ var _task$Appointment$0$D, _task$Appointment, _task$Appointment$, _task$status, _task$start, _task$end, _task$Type;
17821
+
17822
+ return arr.push({
17823
+ title: (_task$Appointment$0$D = task === null || task === void 0 ? void 0 : (_task$Appointment = task.Appointment) === null || _task$Appointment === void 0 ? void 0 : (_task$Appointment$ = _task$Appointment[0]) === null || _task$Appointment$ === void 0 ? void 0 : _task$Appointment$.Description) !== null && _task$Appointment$0$D !== void 0 ? _task$Appointment$0$D : "",
17824
+ status: ((_task$status = task === null || task === void 0 ? void 0 : task.status) !== null && _task$status !== void 0 ? _task$status : (task === null || task === void 0 ? void 0 : task.status) === "available" && (task === null || task === void 0 ? void 0 : task.Appointment.length) > 0) ? true : false,
17825
+ timefrom: (_task$start = task === null || task === void 0 ? void 0 : task.start) !== null && _task$start !== void 0 ? _task$start : "",
17826
+ timeto: (_task$end = task === null || task === void 0 ? void 0 : task.end) !== null && _task$end !== void 0 ? _task$end : "",
17827
+ type: (_task$Type = task === null || task === void 0 ? void 0 : task.Type) !== null && _task$Type !== void 0 ? _task$Type : ""
17828
+ });
17829
+ });
17830
+ });
17831
+ }
17832
+
17605
17833
  return _context2.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
17606
- data: {
17607
- count: (_data$result$0$Checke = data === null || data === void 0 ? void 0 : (_data$result$2 = data.result[0]) === null || _data$result$2 === void 0 ? void 0 : _data$result$2.CheckedIn) !== null && _data$result$0$Checke !== void 0 ? _data$result$0$Checke : 0
17608
- }
17834
+ data: arr
17609
17835
  }));
17610
17836
 
17611
- case 10:
17612
- _context2.prev = 10;
17837
+ case 12:
17838
+ _context2.prev = 12;
17613
17839
  _context2.t0 = _context2["catch"](2);
17614
17840
  return _context2.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
17615
17841
  message: _context2.t0.message
17616
17842
  })));
17617
17843
 
17618
- case 13:
17844
+ case 15:
17619
17845
  case "end":
17620
17846
  return _context2.stop();
17621
17847
  }
17622
17848
  }
17623
- }, _callee2, null, [[2, 10]]);
17849
+ }, _callee2, null, [[2, 12]]);
17624
17850
  })));
17625
- var PATIENTSTATUSASSESSMENTCOMPLETED = createAsyncThunk("dashboardApiSlice/patientStatusAssessmentComplete", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
17851
+ var PATIENT_WAITING_TIME = createAsyncThunk("dashboardApiSlice/patientWaitingTime", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
17626
17852
  var payload,
17627
17853
  _ref6,
17628
17854
  rejectWithValue,
17629
- _data$result$0$Triage,
17630
- _data$result$3,
17855
+ _data$0$LessThan15$0$,
17856
+ _data$,
17857
+ _data$$LessThan,
17858
+ _data$$LessThan$,
17859
+ _data$0$MoreThan15$0$,
17860
+ _data$2,
17861
+ _data$2$MoreThan,
17862
+ _data$2$MoreThan$,
17863
+ _data$0$GreaterThan,
17864
+ _data$3,
17865
+ _data$3$GreaterThan,
17866
+ _data$3$GreaterThan$,
17631
17867
  orgId,
17632
- startDate,
17633
- endDate,
17634
17868
  roleId,
17635
17869
  loginId,
17636
17870
  data,
17871
+ arr,
17637
17872
  _args3 = arguments;
17638
17873
 
17639
17874
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -17643,41 +17878,40 @@ var PATIENTSTATUSASSESSMENTCOMPLETED = createAsyncThunk("dashboardApiSlice/patie
17643
17878
  payload = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
17644
17879
  _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue;
17645
17880
  _context3.prev = 2;
17646
- orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId; // debugger;
17647
-
17881
+ orgId = payload.orgId, roleId = payload.roleId, loginId = payload.loginId;
17648
17882
  _context3.next = 6;
17649
17883
  return fetchData$1({
17650
- body: JSON.stringify(dashboardQuery.patientStatusCompletedAssessment(orgId, startDate, endDate, loginId)[roleId])
17651
- }, __readDocumentUrl__);
17884
+ body: JSON.stringify(dashboardQuery.patientWaitingTimeQuery(orgId, JSON.parse(parseInt(loginId)))[roleId])
17885
+ }, __baseUrl__);
17652
17886
 
17653
17887
  case 6:
17654
17888
  data = _context3.sent;
17889
+ arr = [(_data$0$LessThan15$0$ = data === null || data === void 0 ? void 0 : (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : (_data$$LessThan = _data$.LessThan15) === null || _data$$LessThan === void 0 ? void 0 : (_data$$LessThan$ = _data$$LessThan[0]) === null || _data$$LessThan$ === void 0 ? void 0 : _data$$LessThan$.LessThan15) !== null && _data$0$LessThan15$0$ !== void 0 ? _data$0$LessThan15$0$ : 0, (_data$0$MoreThan15$0$ = data === null || data === void 0 ? void 0 : (_data$2 = data[0]) === null || _data$2 === void 0 ? void 0 : (_data$2$MoreThan = _data$2.MoreThan15) === null || _data$2$MoreThan === void 0 ? void 0 : (_data$2$MoreThan$ = _data$2$MoreThan[0]) === null || _data$2$MoreThan$ === void 0 ? void 0 : _data$2$MoreThan$.MoreThan15) !== null && _data$0$MoreThan15$0$ !== void 0 ? _data$0$MoreThan15$0$ : 0, (_data$0$GreaterThan = data === null || data === void 0 ? void 0 : (_data$3 = data[0]) === null || _data$3 === void 0 ? void 0 : (_data$3$GreaterThan = _data$3.GreaterThan30) === null || _data$3$GreaterThan === void 0 ? void 0 : (_data$3$GreaterThan$ = _data$3$GreaterThan[0]) === null || _data$3$GreaterThan$ === void 0 ? void 0 : _data$3$GreaterThan$.GreaterThan30) !== null && _data$0$GreaterThan !== void 0 ? _data$0$GreaterThan : 0];
17890
+ debugger;
17655
17891
  return _context3.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
17656
- data: {
17657
- count: (_data$result$0$Triage = data === null || data === void 0 ? void 0 : (_data$result$3 = data.result[0]) === null || _data$result$3 === void 0 ? void 0 : _data$result$3.Triage) !== null && _data$result$0$Triage !== void 0 ? _data$result$0$Triage : 0
17658
- }
17892
+ data: arr
17659
17893
  }));
17660
17894
 
17661
- case 10:
17662
- _context3.prev = 10;
17895
+ case 12:
17896
+ _context3.prev = 12;
17663
17897
  _context3.t0 = _context3["catch"](2);
17664
17898
  return _context3.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
17665
17899
  message: _context3.t0.message
17666
17900
  })));
17667
17901
 
17668
- case 13:
17902
+ case 15:
17669
17903
  case "end":
17670
17904
  return _context3.stop();
17671
17905
  }
17672
17906
  }
17673
- }, _callee3, null, [[2, 10]]);
17907
+ }, _callee3, null, [[2, 12]]);
17674
17908
  })));
17675
- var CONSULTATION_INPROGRESS = createAsyncThunk("dashboardApiSlice/consultationIn_progress", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
17909
+ var PATIENTSTATUSASSESSMENTPENDING = createAsyncThunk("dashboardApiSlice/patientStatusAssessmentPendin", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
17676
17910
  var payload,
17677
17911
  _ref8,
17678
17912
  rejectWithValue,
17679
- _data$result$0$InProg,
17680
- _data$result$4,
17913
+ _data$result$0$Checke,
17914
+ _data$result$2,
17681
17915
  orgId,
17682
17916
  startDate,
17683
17917
  endDate,
@@ -17697,14 +17931,14 @@ var CONSULTATION_INPROGRESS = createAsyncThunk("dashboardApiSlice/consultationIn
17697
17931
 
17698
17932
  _context4.next = 6;
17699
17933
  return fetchData$1({
17700
- body: JSON.stringify(dashboardQuery.consultationInProgress(orgId, startDate, endDate, loginId)[roleId])
17934
+ body: JSON.stringify(dashboardQuery.patientStatusPendingAssessment(orgId, startDate, endDate, loginId)[roleId])
17701
17935
  }, __readDocumentUrl__);
17702
17936
 
17703
17937
  case 6:
17704
17938
  data = _context4.sent;
17705
17939
  return _context4.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
17706
17940
  data: {
17707
- count: (_data$result$0$InProg = data === null || data === void 0 ? void 0 : (_data$result$4 = data.result[0]) === null || _data$result$4 === void 0 ? void 0 : _data$result$4.InProgress) !== null && _data$result$0$InProg !== void 0 ? _data$result$0$InProg : 0
17941
+ count: (_data$result$0$Checke = data === null || data === void 0 ? void 0 : (_data$result$2 = data.result[0]) === null || _data$result$2 === void 0 ? void 0 : _data$result$2.CheckedIn) !== null && _data$result$0$Checke !== void 0 ? _data$result$0$Checke : 0
17708
17942
  }
17709
17943
  }));
17710
17944
 
@@ -17722,12 +17956,12 @@ var CONSULTATION_INPROGRESS = createAsyncThunk("dashboardApiSlice/consultationIn
17722
17956
  }
17723
17957
  }, _callee4, null, [[2, 10]]);
17724
17958
  })));
17725
- var CONSULTATION_COMPLETED = createAsyncThunk("dashboardApiSlice/consultation_completed", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
17959
+ var PATIENTSTATUSASSESSMENTCOMPLETED = createAsyncThunk("dashboardApiSlice/patientStatusAssessmentComplete", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
17726
17960
  var payload,
17727
17961
  _ref10,
17728
17962
  rejectWithValue,
17729
- _data$result$0$Finish,
17730
- _data$result$5,
17963
+ _data$result$0$Triage,
17964
+ _data$result$3,
17731
17965
  orgId,
17732
17966
  startDate,
17733
17967
  endDate,
@@ -17747,14 +17981,14 @@ var CONSULTATION_COMPLETED = createAsyncThunk("dashboardApiSlice/consultation_co
17747
17981
 
17748
17982
  _context5.next = 6;
17749
17983
  return fetchData$1({
17750
- body: JSON.stringify(dashboardQuery.consultationCompleted(orgId, startDate, endDate, loginId)[roleId])
17984
+ body: JSON.stringify(dashboardQuery.patientStatusCompletedAssessment(orgId, startDate, endDate, loginId)[roleId])
17751
17985
  }, __readDocumentUrl__);
17752
17986
 
17753
17987
  case 6:
17754
17988
  data = _context5.sent;
17755
17989
  return _context5.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
17756
17990
  data: {
17757
- count: (_data$result$0$Finish = data === null || data === void 0 ? void 0 : (_data$result$5 = data.result[0]) === null || _data$result$5 === void 0 ? void 0 : _data$result$5.Finished) !== null && _data$result$0$Finish !== void 0 ? _data$result$0$Finish : 0
17991
+ count: (_data$result$0$Triage = data === null || data === void 0 ? void 0 : (_data$result$3 = data.result[0]) === null || _data$result$3 === void 0 ? void 0 : _data$result$3.Triage) !== null && _data$result$0$Triage !== void 0 ? _data$result$0$Triage : 0
17758
17992
  }
17759
17993
  }));
17760
17994
 
@@ -17772,13 +18006,12 @@ var CONSULTATION_COMPLETED = createAsyncThunk("dashboardApiSlice/consultation_co
17772
18006
  }
17773
18007
  }, _callee5, null, [[2, 10]]);
17774
18008
  })));
17775
- var FIRST_VISIT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
18009
+ var CONSULTATION_INPROGRESS = createAsyncThunk("dashboardApiSlice/consultationIn_progress", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
17776
18010
  var payload,
17777
18011
  _ref12,
17778
18012
  rejectWithValue,
17779
- _data$result$0$firstV,
17780
- _data$result,
17781
- _data$result$6,
18013
+ _data$result$0$InProg,
18014
+ _data$result$4,
17782
18015
  orgId,
17783
18016
  startDate,
17784
18017
  endDate,
@@ -17794,17 +18027,18 @@ var FIRST_VISIT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE
17794
18027
  payload = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
17795
18028
  _ref12 = _args6.length > 1 ? _args6[1] : undefined, rejectWithValue = _ref12.rejectWithValue;
17796
18029
  _context6.prev = 2;
17797
- orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId;
18030
+ orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId; // debugger;
18031
+
17798
18032
  _context6.next = 6;
17799
18033
  return fetchData$1({
17800
- body: JSON.stringify(dashboardQuery.firstVisit(orgId, startDate, endDate, loginId)[roleId])
18034
+ body: JSON.stringify(dashboardQuery.consultationInProgress(orgId, startDate, endDate, loginId)[roleId])
17801
18035
  }, __readDocumentUrl__);
17802
18036
 
17803
18037
  case 6:
17804
18038
  data = _context6.sent;
17805
18039
  return _context6.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
17806
18040
  data: {
17807
- count: (_data$result$0$firstV = data === null || data === void 0 ? void 0 : (_data$result = data.result) === null || _data$result === void 0 ? void 0 : (_data$result$6 = _data$result[0]) === null || _data$result$6 === void 0 ? void 0 : _data$result$6.firstVisitCount) !== null && _data$result$0$firstV !== void 0 ? _data$result$0$firstV : 0
18041
+ count: (_data$result$0$InProg = data === null || data === void 0 ? void 0 : (_data$result$4 = data.result[0]) === null || _data$result$4 === void 0 ? void 0 : _data$result$4.InProgress) !== null && _data$result$0$InProg !== void 0 ? _data$result$0$InProg : 0
17808
18042
  }
17809
18043
  }));
17810
18044
 
@@ -17822,13 +18056,12 @@ var FIRST_VISIT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE
17822
18056
  }
17823
18057
  }, _callee6, null, [[2, 10]]);
17824
18058
  })));
17825
- var OTHER_VISIT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
18059
+ var CONSULTATION_COMPLETED = createAsyncThunk("dashboardApiSlice/consultation_completed", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
17826
18060
  var payload,
17827
18061
  _ref14,
17828
18062
  rejectWithValue,
17829
- _data$result$0$otherV,
17830
- _data$result2,
17831
- _data$result2$,
18063
+ _data$result$0$Finish,
18064
+ _data$result$5,
17832
18065
  orgId,
17833
18066
  startDate,
17834
18067
  endDate,
@@ -17844,17 +18077,18 @@ var OTHER_VISIT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE
17844
18077
  payload = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
17845
18078
  _ref14 = _args7.length > 1 ? _args7[1] : undefined, rejectWithValue = _ref14.rejectWithValue;
17846
18079
  _context7.prev = 2;
17847
- orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId;
18080
+ orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId; // debugger;
18081
+
17848
18082
  _context7.next = 6;
17849
18083
  return fetchData$1({
17850
- body: JSON.stringify(dashboardQuery.OtherVisit(orgId, startDate, endDate, loginId)[roleId])
18084
+ body: JSON.stringify(dashboardQuery.consultationCompleted(orgId, startDate, endDate, loginId)[roleId])
17851
18085
  }, __readDocumentUrl__);
17852
18086
 
17853
18087
  case 6:
17854
18088
  data = _context7.sent;
17855
18089
  return _context7.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
17856
18090
  data: {
17857
- count: (_data$result$0$otherV = data === null || data === void 0 ? void 0 : (_data$result2 = data.result) === null || _data$result2 === void 0 ? void 0 : (_data$result2$ = _data$result2[0]) === null || _data$result2$ === void 0 ? void 0 : _data$result2$.otherVisitCount) !== null && _data$result$0$otherV !== void 0 ? _data$result$0$otherV : 0
18091
+ count: (_data$result$0$Finish = data === null || data === void 0 ? void 0 : (_data$result$5 = data.result[0]) === null || _data$result$5 === void 0 ? void 0 : _data$result$5.Finished) !== null && _data$result$0$Finish !== void 0 ? _data$result$0$Finish : 0
17858
18092
  }
17859
18093
  }));
17860
18094
 
@@ -17872,13 +18106,13 @@ var OTHER_VISIT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE
17872
18106
  }
17873
18107
  }, _callee7, null, [[2, 10]]);
17874
18108
  })));
17875
- var WALK_INS_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
18109
+ var FIRST_VISIT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
17876
18110
  var payload,
17877
18111
  _ref16,
17878
18112
  rejectWithValue,
17879
- _data$result$0$walkin,
17880
- _data$result3,
17881
- _data$result3$,
18113
+ _data$result$0$firstV,
18114
+ _data$result,
18115
+ _data$result$6,
17882
18116
  orgId,
17883
18117
  startDate,
17884
18118
  endDate,
@@ -17897,14 +18131,14 @@ var WALK_INS_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*
17897
18131
  orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId;
17898
18132
  _context8.next = 6;
17899
18133
  return fetchData$1({
17900
- body: JSON.stringify(dashboardQuery.walkIns(orgId, startDate, endDate, loginId)[roleId])
18134
+ body: JSON.stringify(dashboardQuery.firstVisit(orgId, startDate, endDate, loginId)[roleId])
17901
18135
  }, __readDocumentUrl__);
17902
18136
 
17903
18137
  case 6:
17904
18138
  data = _context8.sent;
17905
18139
  return _context8.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
17906
18140
  data: {
17907
- count: (_data$result$0$walkin = data === null || data === void 0 ? void 0 : (_data$result3 = data.result) === null || _data$result3 === void 0 ? void 0 : (_data$result3$ = _data$result3[0]) === null || _data$result3$ === void 0 ? void 0 : _data$result3$.walkinCount) !== null && _data$result$0$walkin !== void 0 ? _data$result$0$walkin : 0
18141
+ count: (_data$result$0$firstV = data === null || data === void 0 ? void 0 : (_data$result = data.result) === null || _data$result === void 0 ? void 0 : (_data$result$6 = _data$result[0]) === null || _data$result$6 === void 0 ? void 0 : _data$result$6.firstVisitCount) !== null && _data$result$0$firstV !== void 0 ? _data$result$0$firstV : 0
17908
18142
  }
17909
18143
  }));
17910
18144
 
@@ -17922,13 +18156,13 @@ var WALK_INS_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*
17922
18156
  }
17923
18157
  }, _callee8, null, [[2, 10]]);
17924
18158
  })));
17925
- var NEW_PATIENT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
18159
+ var OTHER_VISIT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
17926
18160
  var payload,
17927
18161
  _ref18,
17928
18162
  rejectWithValue,
17929
- _data$result$0$newPat,
17930
- _data$result4,
17931
- _data$result4$,
18163
+ _data$result$0$otherV,
18164
+ _data$result2,
18165
+ _data$result2$,
17932
18166
  orgId,
17933
18167
  startDate,
17934
18168
  endDate,
@@ -17947,14 +18181,14 @@ var NEW_PATIENT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE
17947
18181
  orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId;
17948
18182
  _context9.next = 6;
17949
18183
  return fetchData$1({
17950
- body: JSON.stringify(dashboardQuery.newPatient(orgId, startDate, endDate, loginId)[roleId])
18184
+ body: JSON.stringify(dashboardQuery.OtherVisit(orgId, startDate, endDate, loginId)[roleId])
17951
18185
  }, __readDocumentUrl__);
17952
18186
 
17953
18187
  case 6:
17954
18188
  data = _context9.sent;
17955
18189
  return _context9.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
17956
18190
  data: {
17957
- count: (_data$result$0$newPat = data === null || data === void 0 ? void 0 : (_data$result4 = data.result) === null || _data$result4 === void 0 ? void 0 : (_data$result4$ = _data$result4[0]) === null || _data$result4$ === void 0 ? void 0 : _data$result4$.newPatientCount) !== null && _data$result$0$newPat !== void 0 ? _data$result$0$newPat : 0
18191
+ count: (_data$result$0$otherV = data === null || data === void 0 ? void 0 : (_data$result2 = data.result) === null || _data$result2 === void 0 ? void 0 : (_data$result2$ = _data$result2[0]) === null || _data$result2$ === void 0 ? void 0 : _data$result2$.otherVisitCount) !== null && _data$result$0$otherV !== void 0 ? _data$result$0$otherV : 0
17958
18192
  }
17959
18193
  }));
17960
18194
 
@@ -17972,13 +18206,18 @@ var NEW_PATIENT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE
17972
18206
  }
17973
18207
  }, _callee9, null, [[2, 10]]);
17974
18208
  })));
17975
- var FOLLOW_UP_COUNT = createAsyncThunk("dashboardApiSlice/followUpCount", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
18209
+ var WALK_INS_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
17976
18210
  var payload,
17977
18211
  _ref20,
17978
18212
  rejectWithValue,
17979
- _data$result$0$Follow,
17980
- _data$result5,
17981
- _data$result5$,
18213
+ _data$result$0$walkin,
18214
+ _data$result3,
18215
+ _data$result3$,
18216
+ orgId,
18217
+ startDate,
18218
+ endDate,
18219
+ roleId,
18220
+ loginId,
17982
18221
  data,
17983
18222
  _args10 = arguments;
17984
18223
 
@@ -17989,45 +18228,46 @@ var FOLLOW_UP_COUNT = createAsyncThunk("dashboardApiSlice/followUpCount", /*#__P
17989
18228
  payload = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : {};
17990
18229
  _ref20 = _args10.length > 1 ? _args10[1] : undefined, rejectWithValue = _ref20.rejectWithValue;
17991
18230
  _context10.prev = 2;
17992
- _context10.next = 5;
18231
+ orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId;
18232
+ _context10.next = 6;
17993
18233
  return fetchData$1({
17994
- body: JSON.stringify({
17995
- db_name: dbName,
17996
- entity: "AppointmentRequest",
17997
- filter: "AppointmentRequest.appointmentid==''and DATE_TIMESTAMP(DATE_ADD(AppointmentRequest.encounterdate*1000,AppointmentRequest.followupdurval,DOCUMENT(AppointmentRequest.followupduruom).display=='Days'?'day':DOCUMENT(AppointmentRequest.followupduruom).display=='month'?'month':'week'))>=DATE_TIMESTAMP(DATE_NOW()) COLLECT WITH COUNT INTO length",
17998
- return_fields: "{FollowUpAppointments:length}"
17999
- })
18234
+ body: JSON.stringify(dashboardQuery.walkIns(orgId, startDate, endDate, loginId)[roleId])
18000
18235
  }, __readDocumentUrl__);
18001
18236
 
18002
- case 5:
18237
+ case 6:
18003
18238
  data = _context10.sent;
18004
- return _context10.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
18239
+ return _context10.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
18005
18240
  data: {
18006
- count: (_data$result$0$Follow = data === null || data === void 0 ? void 0 : (_data$result5 = data.result) === null || _data$result5 === void 0 ? void 0 : (_data$result5$ = _data$result5[0]) === null || _data$result5$ === void 0 ? void 0 : _data$result5$.FollowUpAppointments) !== null && _data$result$0$Follow !== void 0 ? _data$result$0$Follow : 0
18241
+ count: (_data$result$0$walkin = data === null || data === void 0 ? void 0 : (_data$result3 = data.result) === null || _data$result3 === void 0 ? void 0 : (_data$result3$ = _data$result3[0]) === null || _data$result3$ === void 0 ? void 0 : _data$result3$.walkinCount) !== null && _data$result$0$walkin !== void 0 ? _data$result$0$walkin : 0
18007
18242
  }
18008
18243
  }));
18009
18244
 
18010
- case 9:
18011
- _context10.prev = 9;
18245
+ case 10:
18246
+ _context10.prev = 10;
18012
18247
  _context10.t0 = _context10["catch"](2);
18013
18248
  return _context10.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
18014
18249
  message: _context10.t0.message
18015
18250
  })));
18016
18251
 
18017
- case 12:
18252
+ case 13:
18018
18253
  case "end":
18019
18254
  return _context10.stop();
18020
18255
  }
18021
18256
  }
18022
- }, _callee10, null, [[2, 9]]);
18257
+ }, _callee10, null, [[2, 10]]);
18023
18258
  })));
18024
- var REFERRAL_COUNT = createAsyncThunk("dashboardApiSlice/referralCount", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
18259
+ var NEW_PATIENT_COUNT = createAsyncThunk("dashboardApiSlice/runquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
18025
18260
  var payload,
18026
18261
  _ref22,
18027
18262
  rejectWithValue,
18028
- _data$result$0$Appoin,
18029
- _data$result6,
18030
- _data$result6$,
18263
+ _data$result$0$newPat,
18264
+ _data$result4,
18265
+ _data$result4$,
18266
+ orgId,
18267
+ startDate,
18268
+ endDate,
18269
+ roleId,
18270
+ loginId,
18031
18271
  data,
18032
18272
  _args11 = arguments;
18033
18273
 
@@ -18038,177 +18278,365 @@ var REFERRAL_COUNT = createAsyncThunk("dashboardApiSlice/referralCount", /*#__PU
18038
18278
  payload = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
18039
18279
  _ref22 = _args11.length > 1 ? _args11[1] : undefined, rejectWithValue = _ref22.rejectWithValue;
18040
18280
  _context11.prev = 2;
18041
- _context11.next = 5;
18281
+ orgId = payload.orgId, startDate = payload.startDate, endDate = payload.endDate, roleId = payload.roleId, loginId = payload.loginId;
18282
+ _context11.next = 6;
18042
18283
  return fetchData$1({
18043
- body: JSON.stringify({
18044
- db_name: dbName,
18045
- entity: "ReferralTrx",
18046
- filter: "ReferralTrx.activestatus==true && ReferralTrx.recipientBookingReqd==true collect with count into length",
18047
- return_fields: "{AppointmentReferral : length}"
18048
- })
18284
+ body: JSON.stringify(dashboardQuery.newPatient(orgId, startDate, endDate, loginId)[roleId])
18049
18285
  }, __readDocumentUrl__);
18050
18286
 
18051
- case 5:
18287
+ case 6:
18052
18288
  data = _context11.sent;
18053
- return _context11.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
18289
+ return _context11.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
18054
18290
  data: {
18055
- count: (_data$result$0$Appoin = data === null || data === void 0 ? void 0 : (_data$result6 = data.result) === null || _data$result6 === void 0 ? void 0 : (_data$result6$ = _data$result6[0]) === null || _data$result6$ === void 0 ? void 0 : _data$result6$.AppointmentReferral) !== null && _data$result$0$Appoin !== void 0 ? _data$result$0$Appoin : 0
18291
+ count: (_data$result$0$newPat = data === null || data === void 0 ? void 0 : (_data$result4 = data.result) === null || _data$result4 === void 0 ? void 0 : (_data$result4$ = _data$result4[0]) === null || _data$result4$ === void 0 ? void 0 : _data$result4$.newPatientCount) !== null && _data$result$0$newPat !== void 0 ? _data$result$0$newPat : 0
18056
18292
  }
18057
18293
  }));
18058
18294
 
18059
- case 9:
18060
- _context11.prev = 9;
18295
+ case 10:
18296
+ _context11.prev = 10;
18061
18297
  _context11.t0 = _context11["catch"](2);
18062
18298
  return _context11.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
18063
18299
  message: _context11.t0.message
18064
18300
  })));
18065
18301
 
18066
- case 12:
18302
+ case 13:
18067
18303
  case "end":
18068
18304
  return _context11.stop();
18069
18305
  }
18070
18306
  }
18071
- }, _callee11, null, [[2, 9]]);
18307
+ }, _callee11, null, [[2, 10]]);
18072
18308
  })));
18073
- var dashboardApiSlice = createSlice({
18074
- name: "dashboardApiSlice",
18075
- initialState: {
18076
- appointment: _objectSpread2({}, defaultState.Info),
18077
- firstVisitCount: _objectSpread2({}, defaultState.Info),
18078
- otherVisitCount: _objectSpread2({}, defaultState.Info),
18079
- walkinCount: _objectSpread2({}, defaultState.Info),
18080
- newPatientCount: _objectSpread2({}, defaultState.Info),
18081
- followUpCount: _objectSpread2({}, defaultState.Info),
18082
- referralCount: _objectSpread2({}, defaultState.Info),
18083
- patientStatusAssessmentPendin: _objectSpread2({}, defaultState.Info),
18084
- patientStatusAssessmentComplete: _objectSpread2({}, defaultState.Info),
18085
- consultation_in_progress: _objectSpread2({}, defaultState.Info),
18086
- consultation_completed: _objectSpread2({}, defaultState.Info)
18087
- },
18088
- extraReducers: (_extraReducers$h = {}, _defineProperty(_extraReducers$h, PATIENTSTATUSASSESSMENTPENDING.fulfilled, function (state, action) {
18089
- var _action$payload;
18309
+ var TOTAL_PATIENT_DOCTOR_COUNT = createAsyncThunk("dashboardApiSlice/countquery", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
18310
+ var payload,
18311
+ _ref24,
18312
+ rejectWithValue,
18313
+ _role,
18314
+ data,
18315
+ _args12 = arguments;
18090
18316
 
18091
- state.patientStatusAssessmentPendin = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
18092
- }), _defineProperty(_extraReducers$h, PATIENTSTATUSASSESSMENTPENDING.pending, function (state, action) {
18093
- state.patientStatusAssessmentPendin.loading = true;
18094
- }), _defineProperty(_extraReducers$h, PATIENTSTATUSASSESSMENTPENDING.rejected, function (state, action) {
18095
- var _action$payload2;
18317
+ return regeneratorRuntime.wrap(function _callee12$(_context12) {
18318
+ while (1) {
18319
+ switch (_context12.prev = _context12.next) {
18320
+ case 0:
18321
+ payload = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
18322
+ _ref24 = _args12.length > 1 ? _args12[1] : undefined, rejectWithValue = _ref24.rejectWithValue;
18323
+ _context12.prev = 2;
18324
+ _role = payload._role;
18325
+ _context12.next = 6;
18326
+ return fetchData$1({
18327
+ body: JSON.stringify(patientCountQuery.patientCount()[_role])
18328
+ }, __readDocumentUrl__);
18096
18329
 
18097
- state.patientStatusAssessmentPendin = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
18098
- }), _defineProperty(_extraReducers$h, PATIENTSTATUSASSESSMENTCOMPLETED.fulfilled, function (state, action) {
18099
- var _action$payload3;
18330
+ case 6:
18331
+ data = _context12.sent;
18332
+ return _context12.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
18333
+ data: data
18334
+ }));
18100
18335
 
18101
- state.patientStatusAssessmentComplete = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
18102
- }), _defineProperty(_extraReducers$h, PATIENTSTATUSASSESSMENTCOMPLETED.pending, function (state, action) {
18103
- state.patientStatusAssessmentComplete.loading = true;
18104
- }), _defineProperty(_extraReducers$h, PATIENTSTATUSASSESSMENTCOMPLETED.rejected, function (state, action) {
18105
- var _action$payload4;
18336
+ case 10:
18337
+ _context12.prev = 10;
18338
+ _context12.t0 = _context12["catch"](2);
18339
+ return _context12.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
18340
+ message: _context12.t0.message
18341
+ })));
18106
18342
 
18107
- state.patientStatusAssessmentComplete = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
18108
- }), _defineProperty(_extraReducers$h, CONSULTATION_INPROGRESS.fulfilled, function (state, action) {
18109
- var _action$payload5;
18110
-
18111
- state.consultation_in_progress = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
18112
- }), _defineProperty(_extraReducers$h, CONSULTATION_INPROGRESS.pending, function (state, action) {
18113
- state.consultation_in_progress.loading = true;
18114
- }), _defineProperty(_extraReducers$h, CONSULTATION_INPROGRESS.rejected, function (state, action) {
18115
- var _action$payload6;
18116
-
18117
- state.consultation_in_progress = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
18118
- }), _defineProperty(_extraReducers$h, CONSULTATION_COMPLETED.fulfilled, function (state, action) {
18119
- var _action$payload7;
18120
-
18121
- state.consultation_completed = (_action$payload7 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload7 !== void 0 ? _action$payload7 : {};
18122
- }), _defineProperty(_extraReducers$h, CONSULTATION_COMPLETED.pending, function (state, action) {
18123
- state.consultation_completed.loading = true;
18124
- }), _defineProperty(_extraReducers$h, CONSULTATION_COMPLETED.rejected, function (state, action) {
18125
- var _action$payload8;
18343
+ case 13:
18344
+ case "end":
18345
+ return _context12.stop();
18346
+ }
18347
+ }
18348
+ }, _callee12, null, [[2, 10]]);
18349
+ })));
18350
+ var HIGH_PRIORITY_PATIENT = createAsyncThunk("dashboardApiSlice/highPriorityPatient", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
18351
+ var payload,
18352
+ _ref26,
18353
+ rejectWithValue,
18354
+ _role,
18355
+ data,
18356
+ _args13 = arguments;
18126
18357
 
18127
- state.consultation_completed = (_action$payload8 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload8 !== void 0 ? _action$payload8 : {};
18128
- }), _defineProperty(_extraReducers$h, APPOINTMENTS.fulfilled, function (state, action) {
18129
- var _action$payload9;
18358
+ return regeneratorRuntime.wrap(function _callee13$(_context13) {
18359
+ while (1) {
18360
+ switch (_context13.prev = _context13.next) {
18361
+ case 0:
18362
+ payload = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
18363
+ _ref26 = _args13.length > 1 ? _args13[1] : undefined, rejectWithValue = _ref26.rejectWithValue;
18364
+ _context13.prev = 2;
18365
+ _role = payload._role;
18366
+ _context13.next = 6;
18367
+ return fetchData$1({
18368
+ body: JSON.stringify(highPriorityPatientQuery.PatientCard()[_role])
18369
+ }, __readDocumentUrl__);
18130
18370
 
18131
- state.appointment = (_action$payload9 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload9 !== void 0 ? _action$payload9 : {};
18132
- }), _defineProperty(_extraReducers$h, APPOINTMENTS.pending, function (state, action) {
18133
- state.appointment.loading = true;
18134
- }), _defineProperty(_extraReducers$h, APPOINTMENTS.rejected, function (state, action) {
18135
- var _action$payload10;
18371
+ case 6:
18372
+ data = _context13.sent;
18373
+ return _context13.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
18374
+ data: data
18375
+ }));
18136
18376
 
18137
- state.appointment = (_action$payload10 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload10 !== void 0 ? _action$payload10 : {};
18138
- }), _defineProperty(_extraReducers$h, FIRST_VISIT_COUNT.fulfilled, function (state, action) {
18139
- var _action$payload11;
18377
+ case 10:
18378
+ _context13.prev = 10;
18379
+ _context13.t0 = _context13["catch"](2);
18380
+ return _context13.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
18381
+ message: _context13.t0.message
18382
+ })));
18140
18383
 
18141
- state.firstVisitCount = (_action$payload11 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload11 !== void 0 ? _action$payload11 : {};
18142
- }), _defineProperty(_extraReducers$h, FIRST_VISIT_COUNT.pending, function (state, action) {
18143
- state.firstVisitCount.loading = true;
18144
- }), _defineProperty(_extraReducers$h, FIRST_VISIT_COUNT.rejected, function (state, action) {
18145
- var _action$payload12;
18384
+ case 13:
18385
+ case "end":
18386
+ return _context13.stop();
18387
+ }
18388
+ }
18389
+ }, _callee13, null, [[2, 10]]);
18390
+ })));
18391
+ var FOLLOW_UP_COUNT = createAsyncThunk("dashboardApiSlice/followUpCount", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
18392
+ var payload,
18393
+ _ref28,
18394
+ rejectWithValue,
18395
+ _data$result$0$Follow,
18396
+ _data$result5,
18397
+ _data$result5$,
18398
+ data,
18399
+ _args14 = arguments;
18146
18400
 
18147
- state.firstVisitCount = (_action$payload12 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload12 !== void 0 ? _action$payload12 : {};
18148
- }), _defineProperty(_extraReducers$h, OTHER_VISIT_COUNT.fulfilled, function (state, action) {
18149
- var _action$payload13;
18401
+ return regeneratorRuntime.wrap(function _callee14$(_context14) {
18402
+ while (1) {
18403
+ switch (_context14.prev = _context14.next) {
18404
+ case 0:
18405
+ payload = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
18406
+ _ref28 = _args14.length > 1 ? _args14[1] : undefined, rejectWithValue = _ref28.rejectWithValue;
18407
+ _context14.prev = 2;
18408
+ _context14.next = 5;
18409
+ return fetchData$1({
18410
+ body: JSON.stringify({
18411
+ db_name: dbName,
18412
+ entity: "AppointmentRequest",
18413
+ filter: "AppointmentRequest.appointmentid==''and DATE_TIMESTAMP(DATE_ADD(AppointmentRequest.encounterdate*1000,AppointmentRequest.followupdurval,DOCUMENT(AppointmentRequest.followupduruom).display=='Days'?'day':DOCUMENT(AppointmentRequest.followupduruom).display=='month'?'month':'week'))>=DATE_TIMESTAMP(DATE_NOW()) COLLECT WITH COUNT INTO length",
18414
+ return_fields: "{FollowUpAppointments:length}"
18415
+ })
18416
+ }, __readDocumentUrl__);
18150
18417
 
18151
- state.otherVisitCount = (_action$payload13 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload13 !== void 0 ? _action$payload13 : {};
18152
- }), _defineProperty(_extraReducers$h, OTHER_VISIT_COUNT.pending, function (state, action) {
18153
- state.otherVisitCount.loading = true;
18154
- }), _defineProperty(_extraReducers$h, OTHER_VISIT_COUNT.rejected, function (state, action) {
18155
- var _action$payload14;
18418
+ case 5:
18419
+ data = _context14.sent;
18420
+ return _context14.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
18421
+ data: {
18422
+ count: (_data$result$0$Follow = data === null || data === void 0 ? void 0 : (_data$result5 = data.result) === null || _data$result5 === void 0 ? void 0 : (_data$result5$ = _data$result5[0]) === null || _data$result5$ === void 0 ? void 0 : _data$result5$.FollowUpAppointments) !== null && _data$result$0$Follow !== void 0 ? _data$result$0$Follow : 0
18423
+ }
18424
+ }));
18156
18425
 
18157
- state.otherVisitCount = (_action$payload14 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload14 !== void 0 ? _action$payload14 : {};
18158
- }), _defineProperty(_extraReducers$h, WALK_INS_COUNT.fulfilled, function (state, action) {
18159
- var _action$payload15;
18426
+ case 9:
18427
+ _context14.prev = 9;
18428
+ _context14.t0 = _context14["catch"](2);
18429
+ return _context14.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
18430
+ message: _context14.t0.message
18431
+ })));
18160
18432
 
18161
- state.walkinCount = (_action$payload15 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload15 !== void 0 ? _action$payload15 : {};
18162
- }), _defineProperty(_extraReducers$h, WALK_INS_COUNT.pending, function (state, action) {
18163
- state.walkinCount.loading = true;
18164
- }), _defineProperty(_extraReducers$h, WALK_INS_COUNT.rejected, function (state, action) {
18165
- var _action$payload16;
18433
+ case 12:
18434
+ case "end":
18435
+ return _context14.stop();
18436
+ }
18437
+ }
18438
+ }, _callee14, null, [[2, 9]]);
18439
+ })));
18440
+ var REFERRAL_COUNT = createAsyncThunk("dashboardApiSlice/referralCount", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() {
18441
+ var payload,
18442
+ _ref30,
18443
+ rejectWithValue,
18444
+ _data$result$0$Appoin,
18445
+ _data$result6,
18446
+ _data$result6$,
18447
+ data,
18448
+ _args15 = arguments;
18166
18449
 
18167
- state.walkinCount = (_action$payload16 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload16 !== void 0 ? _action$payload16 : {};
18168
- }), _defineProperty(_extraReducers$h, NEW_PATIENT_COUNT.fulfilled, function (state, action) {
18169
- var _action$payload17;
18450
+ return regeneratorRuntime.wrap(function _callee15$(_context15) {
18451
+ while (1) {
18452
+ switch (_context15.prev = _context15.next) {
18453
+ case 0:
18454
+ payload = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
18455
+ _ref30 = _args15.length > 1 ? _args15[1] : undefined, rejectWithValue = _ref30.rejectWithValue;
18456
+ _context15.prev = 2;
18457
+ _context15.next = 5;
18458
+ return fetchData$1({
18459
+ body: JSON.stringify({
18460
+ db_name: dbName,
18461
+ entity: "ReferralTrx",
18462
+ filter: "ReferralTrx.activestatus==true && ReferralTrx.recipientBookingReqd==true collect with count into length",
18463
+ return_fields: "{AppointmentReferral : length}"
18464
+ })
18465
+ }, __readDocumentUrl__);
18170
18466
 
18171
- state.newPatientCount = (_action$payload17 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload17 !== void 0 ? _action$payload17 : {};
18172
- }), _defineProperty(_extraReducers$h, NEW_PATIENT_COUNT.pending, function (state, action) {
18173
- state.newPatientCount.loading = true;
18174
- }), _defineProperty(_extraReducers$h, NEW_PATIENT_COUNT.rejected, function (state, action) {
18175
- var _action$payload18;
18467
+ case 5:
18468
+ data = _context15.sent;
18469
+ return _context15.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
18470
+ data: {
18471
+ count: (_data$result$0$Appoin = data === null || data === void 0 ? void 0 : (_data$result6 = data.result) === null || _data$result6 === void 0 ? void 0 : (_data$result6$ = _data$result6[0]) === null || _data$result6$ === void 0 ? void 0 : _data$result6$.AppointmentReferral) !== null && _data$result$0$Appoin !== void 0 ? _data$result$0$Appoin : 0
18472
+ }
18473
+ }));
18176
18474
 
18177
- state.newPatientCount = (_action$payload18 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload18 !== void 0 ? _action$payload18 : {};
18178
- }), _defineProperty(_extraReducers$h, FOLLOW_UP_COUNT.fulfilled, function (state, action) {
18179
- var _action$payload19;
18475
+ case 9:
18476
+ _context15.prev = 9;
18477
+ _context15.t0 = _context15["catch"](2);
18478
+ return _context15.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
18479
+ message: _context15.t0.message
18480
+ })));
18180
18481
 
18181
- state.followUpCount = (_action$payload19 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload19 !== void 0 ? _action$payload19 : {};
18182
- }), _defineProperty(_extraReducers$h, FOLLOW_UP_COUNT.pending, function (state, action) {
18183
- state.followUpCount.loading = true;
18184
- }), _defineProperty(_extraReducers$h, FOLLOW_UP_COUNT.rejected, function (state, action) {
18185
- var _action$payload20;
18482
+ case 12:
18483
+ case "end":
18484
+ return _context15.stop();
18485
+ }
18486
+ }
18487
+ }, _callee15, null, [[2, 9]]);
18488
+ })));
18489
+ var dashboardApiSlice = createSlice(_defineProperty({
18490
+ name: "dashboardApiSlice",
18491
+ initialState: {
18492
+ appointment: _objectSpread2({}, defaultState.Info),
18493
+ firstVisitCount: _objectSpread2({}, defaultState.Info),
18494
+ otherVisitCount: _objectSpread2({}, defaultState.Info),
18495
+ walkinCount: _objectSpread2({}, defaultState.Info),
18496
+ newPatientCount: _objectSpread2({}, defaultState.Info),
18497
+ totalDoctorPatientCount: _objectSpread2({}, defaultState.Info),
18498
+ followUpCount: _objectSpread2({}, defaultState.Info),
18499
+ referralCount: _objectSpread2({}, defaultState.Info),
18500
+ highPriorityPatient: _objectSpread2({}, defaultState.Info),
18501
+ patientStatusAssessmentPendin: _objectSpread2({}, defaultState.Info),
18502
+ patientStatusAssessmentComplete: _objectSpread2({}, defaultState.Info),
18503
+ patientWaitingTimeInfo: _objectSpread2({}, defaultState.Info),
18504
+ consultation_in_progress: _objectSpread2({}, defaultState.Info),
18505
+ consultation_completed: _objectSpread2({}, defaultState.Info),
18506
+ today_schedule: _objectSpread2({}, defaultState.Info)
18507
+ },
18508
+ extraReducers: (_extraReducers$h = {}, _defineProperty(_extraReducers$h, TODAY_SCHEDULE.fulfilled, function (state, action) {
18509
+ var _action$payload;
18186
18510
 
18187
- state.followUpCount = (_action$payload20 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload20 !== void 0 ? _action$payload20 : {};
18188
- }), _defineProperty(_extraReducers$h, REFERRAL_COUNT.fulfilled, function (state, action) {
18189
- var _action$payload21;
18511
+ state.today_schedule = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
18512
+ }), _defineProperty(_extraReducers$h, TODAY_SCHEDULE.pending, function (state, action) {
18513
+ state.today_schedule.loading = true;
18514
+ }), _defineProperty(_extraReducers$h, TODAY_SCHEDULE.rejected, function (state, action) {
18515
+ var _action$payload2;
18190
18516
 
18191
- state.referralCount = (_action$payload21 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload21 !== void 0 ? _action$payload21 : {};
18192
- }), _defineProperty(_extraReducers$h, REFERRAL_COUNT.pending, function (state, action) {
18193
- state.referralCount.loading = true;
18194
- }), _defineProperty(_extraReducers$h, REFERRAL_COUNT.rejected, function (state, action) {
18195
- var _action$payload22;
18517
+ state.today_schedule = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
18518
+ }), _defineProperty(_extraReducers$h, PATIENTSTATUSASSESSMENTPENDING.fulfilled, function (state, action) {
18519
+ var _action$payload3;
18196
18520
 
18197
- state.referralCount = (_action$payload22 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload22 !== void 0 ? _action$payload22 : {};
18521
+ state.patientStatusAssessmentPendin = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
18198
18522
  }), _extraReducers$h)
18199
- });
18523
+ }, "extraReducers", (_extraReducers2 = {}, _defineProperty(_extraReducers2, PATIENT_WAITING_TIME.fulfilled, function (state, action) {
18524
+ var _action$payload4;
18525
+
18526
+ state.patientWaitingTimeInfo = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
18527
+ }), _defineProperty(_extraReducers2, PATIENT_WAITING_TIME.pending, function (state, action) {
18528
+ state.patientWaitingTimeInfo.loading = true;
18529
+ }), _defineProperty(_extraReducers2, PATIENT_WAITING_TIME.rejected, function (state, action) {
18530
+ var _action$payload5;
18531
+
18532
+ state.patientWaitingTimeInfo = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
18533
+ }), _defineProperty(_extraReducers2, APPOINTMENTS.fulfilled, function (state, action) {
18534
+ var _action$payload6;
18535
+
18536
+ state.appointment = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
18537
+ }), _defineProperty(_extraReducers2, APPOINTMENTS.pending, function (state, action) {
18538
+ state.appointment.loading = true;
18539
+ }), _defineProperty(_extraReducers2, APPOINTMENTS.rejected, function (state, action) {
18540
+ var _action$payload7;
18541
+
18542
+ state.appointment = (_action$payload7 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload7 !== void 0 ? _action$payload7 : {};
18543
+ }), _defineProperty(_extraReducers2, FIRST_VISIT_COUNT.fulfilled, function (state, action) {
18544
+ var _action$payload8;
18545
+
18546
+ state.firstVisitCount = (_action$payload8 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload8 !== void 0 ? _action$payload8 : {};
18547
+ }), _defineProperty(_extraReducers2, FIRST_VISIT_COUNT.pending, function (state, action) {
18548
+ state.firstVisitCount.loading = true;
18549
+ }), _defineProperty(_extraReducers2, FIRST_VISIT_COUNT.rejected, function (state, action) {
18550
+ var _action$payload9;
18551
+
18552
+ state.firstVisitCount = (_action$payload9 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload9 !== void 0 ? _action$payload9 : {};
18553
+ }), _defineProperty(_extraReducers2, OTHER_VISIT_COUNT.fulfilled, function (state, action) {
18554
+ var _action$payload10;
18555
+
18556
+ state.otherVisitCount = (_action$payload10 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload10 !== void 0 ? _action$payload10 : {};
18557
+ }), _defineProperty(_extraReducers2, OTHER_VISIT_COUNT.pending, function (state, action) {
18558
+ state.otherVisitCount.loading = true;
18559
+ }), _defineProperty(_extraReducers2, OTHER_VISIT_COUNT.rejected, function (state, action) {
18560
+ var _action$payload11;
18561
+
18562
+ state.otherVisitCount = (_action$payload11 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload11 !== void 0 ? _action$payload11 : {};
18563
+ }), _defineProperty(_extraReducers2, WALK_INS_COUNT.fulfilled, function (state, action) {
18564
+ var _action$payload12;
18565
+
18566
+ state.walkinCount = (_action$payload12 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload12 !== void 0 ? _action$payload12 : {};
18567
+ }), _defineProperty(_extraReducers2, WALK_INS_COUNT.pending, function (state, action) {
18568
+ state.walkinCount.loading = true;
18569
+ }), _defineProperty(_extraReducers2, WALK_INS_COUNT.rejected, function (state, action) {
18570
+ var _action$payload13;
18571
+
18572
+ state.walkinCount = (_action$payload13 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload13 !== void 0 ? _action$payload13 : {};
18573
+ }), _defineProperty(_extraReducers2, NEW_PATIENT_COUNT.fulfilled, function (state, action) {
18574
+ var _action$payload14;
18575
+
18576
+ state.newPatientCount = (_action$payload14 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload14 !== void 0 ? _action$payload14 : {};
18577
+ }), _defineProperty(_extraReducers2, NEW_PATIENT_COUNT.pending, function (state, action) {
18578
+ state.newPatientCount.loading = true;
18579
+ }), _defineProperty(_extraReducers2, NEW_PATIENT_COUNT.rejected, function (state, action) {
18580
+ var _action$payload15;
18581
+
18582
+ state.newPatientCount = (_action$payload15 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload15 !== void 0 ? _action$payload15 : {};
18583
+ }), _defineProperty(_extraReducers2, TOTAL_PATIENT_DOCTOR_COUNT.fulfilled, function (state, action) {
18584
+ var _action$payload16;
18585
+
18586
+ state.totalDoctorPatientCount = (_action$payload16 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload16 !== void 0 ? _action$payload16 : {};
18587
+ }), _defineProperty(_extraReducers2, TOTAL_PATIENT_DOCTOR_COUNT.pending, function (state, action) {
18588
+ state.totalDoctorPatientCount.loading = true;
18589
+ }), _defineProperty(_extraReducers2, TOTAL_PATIENT_DOCTOR_COUNT.rejected, function (state, action) {
18590
+ var _action$payload17;
18591
+
18592
+ state.totalDoctorPatientCount = (_action$payload17 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload17 !== void 0 ? _action$payload17 : {};
18593
+ }), _defineProperty(_extraReducers2, HIGH_PRIORITY_PATIENT.fulfilled, function (state, action) {
18594
+ var _action$payload18;
18595
+
18596
+ state.highPriorityPatient = (_action$payload18 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload18 !== void 0 ? _action$payload18 : {};
18597
+ }), _defineProperty(_extraReducers2, HIGH_PRIORITY_PATIENT.pending, function (state, action) {
18598
+ state.highPriorityPatient.loading = true;
18599
+ }), _defineProperty(_extraReducers2, HIGH_PRIORITY_PATIENT.rejected, function (state, action) {
18600
+ var _action$payload19;
18601
+
18602
+ state.highPriorityPatient = (_action$payload19 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload19 !== void 0 ? _action$payload19 : {};
18603
+ }), _defineProperty(_extraReducers2, FOLLOW_UP_COUNT.fulfilled, function (state, action) {
18604
+ var _action$payload20;
18605
+
18606
+ state.followUpCount = (_action$payload20 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload20 !== void 0 ? _action$payload20 : {};
18607
+ }), _defineProperty(_extraReducers2, FOLLOW_UP_COUNT.pending, function (state, action) {
18608
+ state.followUpCount.loading = true;
18609
+ }), _defineProperty(_extraReducers2, FOLLOW_UP_COUNT.rejected, function (state, action) {
18610
+ var _action$payload21;
18611
+
18612
+ state.followUpCount = (_action$payload21 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload21 !== void 0 ? _action$payload21 : {};
18613
+ }), _defineProperty(_extraReducers2, REFERRAL_COUNT.fulfilled, function (state, action) {
18614
+ var _action$payload22;
18615
+
18616
+ state.referralCount = (_action$payload22 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload22 !== void 0 ? _action$payload22 : {};
18617
+ }), _defineProperty(_extraReducers2, REFERRAL_COUNT.pending, function (state, action) {
18618
+ state.referralCount.loading = true;
18619
+ }), _defineProperty(_extraReducers2, REFERRAL_COUNT.rejected, function (state, action) {
18620
+ var _action$payload23;
18621
+
18622
+ state.referralCount = (_action$payload23 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload23 !== void 0 ? _action$payload23 : {};
18623
+ }), _extraReducers2)));
18200
18624
  var dashboardApiActions = {
18201
18625
  APPOINTMENTS: APPOINTMENTS,
18202
18626
  FIRST_VISIT_COUNT: FIRST_VISIT_COUNT,
18203
18627
  OTHER_VISIT_COUNT: OTHER_VISIT_COUNT,
18204
18628
  WALK_INS_COUNT: WALK_INS_COUNT,
18205
18629
  NEW_PATIENT_COUNT: NEW_PATIENT_COUNT,
18630
+ TOTAL_PATIENT_DOCTOR_COUNT: TOTAL_PATIENT_DOCTOR_COUNT,
18206
18631
  FOLLOW_UP_COUNT: FOLLOW_UP_COUNT,
18207
18632
  REFERRAL_COUNT: REFERRAL_COUNT,
18633
+ HIGH_PRIORITY_PATIENT: HIGH_PRIORITY_PATIENT,
18634
+ PATIENT_WAITING_TIME: PATIENT_WAITING_TIME,
18208
18635
  PATIENTSTATUSASSESSMENTPENDING: PATIENTSTATUSASSESSMENTPENDING,
18209
18636
  PATIENTSTATUSASSESSMENTCOMPLETED: PATIENTSTATUSASSESSMENTCOMPLETED,
18210
18637
  CONSULTATION_INPROGRESS: CONSULTATION_INPROGRESS,
18211
- CONSULTATION_COMPLETED: CONSULTATION_COMPLETED
18638
+ CONSULTATION_COMPLETED: CONSULTATION_COMPLETED,
18639
+ TODAY_SCHEDULE: TODAY_SCHEDULE
18212
18640
  };
18213
18641
  var dashboardApiSlice$1 = dashboardApiSlice.reducer;
18214
18642
 
@@ -18595,7 +19023,7 @@ var queries$1 = {
18595
19023
  return "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CA_ChiefComplaints\",\n \"filter\": \"CA_ChiefComplaints._id =='").concat(id, "'\"\n }");
18596
19024
  },
18597
19025
  encounterDetails: function encounterDetails(encounterId) {
18598
- return "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"Encounter\",\n \"filter\": \"Encounter.id == ").concat(encounterId, "\",\n \"return_fields\": \"MERGE(Encounter, {Patient: (for p in Patient filter p.id == Encounter.patient_id let hname = (FOR hn IN p.name RETURN DOCUMENT(hn)) let pidentifier = (FOR hn IN p.identifier RETURN DOCUMENT(hn)) return MERGE(p, {name: hname, pidentifier})) })\"\n }");
19026
+ return "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"Encounter\",\n \"filter\": \"Encounter.id == ").concat(encounterId, "\",\n \"return_fields\": \"MERGE(Encounter, {Patient: (for p in Patient filter p.id == Encounter.patient_id let hname = (FOR hn IN HumanNameMaster filter hn._id in p.name RETURN merge(hn,{prefix:document(hn.prefix)},{suffix:document(hn.suffix)},{use:document(hn.use)})) let gender = document(p.gender) let pidentifier = (FOR hn IN p.identifier RETURN DOCUMENT(hn)) return MERGE(p, {name: hname, pidentifier,gender})) })\"\n }");
18599
19027
  }
18600
19028
  };
18601
19029
 
@@ -19299,7 +19727,7 @@ var GET_ENCOUNTER = createAsyncThunk("chiefCompilenceMastersSlice/encounter", /*
19299
19727
  data = _context12.sent;
19300
19728
  arr = [];
19301
19729
  data.result.map(function (val) {
19302
- var _val$Patient, _val$Patient$, _val$Patient$$communi, _val$Patient$$communi2, _val$Patient$$communi3, _val$_id, _val$_id$split, _val$practitioner_det, _val$practitioner_det2, _ref25, _val$Patient2, _val$Patient2$, _val$Patient2$$name, _val$Patient2$$name$, _val$Patient3, _val$Patient3$, _val$Patient3$$name, _val$Patient3$$name$, _val$Patient4, _val$Patient4$, _val$Patient4$$name, _val$Patient4$$name$, _val$Patient5, _val$Patient5$, _val$Patient5$$name, _val$Patient5$$name$, _val$Patient6, _val$Patient6$, _val$Patient7, _val$Patient7$, _val$Patient8, _val$Patient8$, _val$Patient9, _val$Patient9$, _val$Patient$0$pident, _val$Patient10, _val$Patient10$, _val$Patient10$$piden, _val$Patient10$$piden2, _lang, _val$practitioner_det3, _val$practitioner_det4, _val$practitioner_det5;
19730
+ var _val$Patient, _val$Patient$, _val$Patient$$communi, _val$Patient$$communi2, _val$Patient$$communi3, _val$_id, _val$_id$split, _val$practitioner_det, _val$practitioner_det2, _ref25, _val$Patient2, _val$Patient2$, _val$Patient2$$name, _val$Patient2$$name$, _val$Patient2$$name$$, _val$Patient3, _val$Patient3$, _val$Patient3$$name, _val$Patient3$$name$, _val$Patient4, _val$Patient4$, _val$Patient4$$name, _val$Patient4$$name$, _val$Patient5, _val$Patient5$, _val$Patient5$$name, _val$Patient5$$name$, _val$Patient5$$name$$, _val$Patient6, _val$Patient6$, _val$Patient7, _val$Patient7$, _val$Patient8, _val$Patient8$, _val$Patient8$$gender, _val$Patient9, _val$Patient9$, _val$Patient$0$pident, _val$Patient10, _val$Patient10$, _val$Patient10$$piden, _val$Patient10$$piden2, _lang, _val$practitioner_det3, _val$practitioner_det4, _val$practitioner_det5;
19303
19731
 
19304
19732
  var lang = val === null || val === void 0 ? void 0 : (_val$Patient = val.Patient) === null || _val$Patient === void 0 ? void 0 : (_val$Patient$ = _val$Patient[0]) === null || _val$Patient$ === void 0 ? void 0 : (_val$Patient$$communi = _val$Patient$.communication) === null || _val$Patient$$communi === void 0 ? void 0 : (_val$Patient$$communi2 = _val$Patient$$communi[0]) === null || _val$Patient$$communi2 === void 0 ? void 0 : (_val$Patient$$communi3 = _val$Patient$$communi2.language) === null || _val$Patient$$communi3 === void 0 ? void 0 : _val$Patient$$communi3.map(function (val) {
19305
19733
  return val.language;
@@ -19313,10 +19741,10 @@ var GET_ENCOUNTER = createAsyncThunk("chiefCompilenceMastersSlice/encounter", /*
19313
19741
  speciality: (_val$practitioner_det = val.practitioner_details) === null || _val$practitioner_det === void 0 ? void 0 : (_val$practitioner_det2 = _val$practitioner_det[0]) === null || _val$practitioner_det2 === void 0 ? void 0 : _val$practitioner_det2.speciality,
19314
19742
  createdAt: val.createddate,
19315
19743
  // name: val?.Patient?.[0]?.name?.[0]?.text ?? "",
19316
- name: (_ref25 = (val === null || val === void 0 ? void 0 : (_val$Patient2 = val.Patient) === null || _val$Patient2 === void 0 ? void 0 : (_val$Patient2$ = _val$Patient2[0]) === null || _val$Patient2$ === void 0 ? void 0 : (_val$Patient2$$name = _val$Patient2$.name) === null || _val$Patient2$$name === void 0 ? void 0 : (_val$Patient2$$name$ = _val$Patient2$$name[0]) === null || _val$Patient2$$name$ === void 0 ? void 0 : _val$Patient2$$name$.prefix) + " " + (val === null || val === void 0 ? void 0 : (_val$Patient3 = val.Patient) === null || _val$Patient3 === void 0 ? void 0 : (_val$Patient3$ = _val$Patient3[0]) === null || _val$Patient3$ === void 0 ? void 0 : (_val$Patient3$$name = _val$Patient3$.name) === null || _val$Patient3$$name === void 0 ? void 0 : (_val$Patient3$$name$ = _val$Patient3$$name[0]) === null || _val$Patient3$$name$ === void 0 ? void 0 : _val$Patient3$$name$.given) + " " + (val === null || val === void 0 ? void 0 : (_val$Patient4 = val.Patient) === null || _val$Patient4 === void 0 ? void 0 : (_val$Patient4$ = _val$Patient4[0]) === null || _val$Patient4$ === void 0 ? void 0 : (_val$Patient4$$name = _val$Patient4$.name) === null || _val$Patient4$$name === void 0 ? void 0 : (_val$Patient4$$name$ = _val$Patient4$$name[0]) === null || _val$Patient4$$name$ === void 0 ? void 0 : _val$Patient4$$name$.family) + " " + (val === null || val === void 0 ? void 0 : (_val$Patient5 = val.Patient) === null || _val$Patient5 === void 0 ? void 0 : (_val$Patient5$ = _val$Patient5[0]) === null || _val$Patient5$ === void 0 ? void 0 : (_val$Patient5$$name = _val$Patient5$.name) === null || _val$Patient5$$name === void 0 ? void 0 : (_val$Patient5$$name$ = _val$Patient5$$name[0]) === null || _val$Patient5$$name$ === void 0 ? void 0 : _val$Patient5$$name$.suffix)) !== null && _ref25 !== void 0 ? _ref25 : "",
19744
+ name: (_ref25 = (val === null || val === void 0 ? void 0 : (_val$Patient2 = val.Patient) === null || _val$Patient2 === void 0 ? void 0 : (_val$Patient2$ = _val$Patient2[0]) === null || _val$Patient2$ === void 0 ? void 0 : (_val$Patient2$$name = _val$Patient2$.name) === null || _val$Patient2$$name === void 0 ? void 0 : (_val$Patient2$$name$ = _val$Patient2$$name[0]) === null || _val$Patient2$$name$ === void 0 ? void 0 : (_val$Patient2$$name$$ = _val$Patient2$$name$.prefix) === null || _val$Patient2$$name$$ === void 0 ? void 0 : _val$Patient2$$name$$.display) + " " + (val === null || val === void 0 ? void 0 : (_val$Patient3 = val.Patient) === null || _val$Patient3 === void 0 ? void 0 : (_val$Patient3$ = _val$Patient3[0]) === null || _val$Patient3$ === void 0 ? void 0 : (_val$Patient3$$name = _val$Patient3$.name) === null || _val$Patient3$$name === void 0 ? void 0 : (_val$Patient3$$name$ = _val$Patient3$$name[0]) === null || _val$Patient3$$name$ === void 0 ? void 0 : _val$Patient3$$name$.given) + " " + (val === null || val === void 0 ? void 0 : (_val$Patient4 = val.Patient) === null || _val$Patient4 === void 0 ? void 0 : (_val$Patient4$ = _val$Patient4[0]) === null || _val$Patient4$ === void 0 ? void 0 : (_val$Patient4$$name = _val$Patient4$.name) === null || _val$Patient4$$name === void 0 ? void 0 : (_val$Patient4$$name$ = _val$Patient4$$name[0]) === null || _val$Patient4$$name$ === void 0 ? void 0 : _val$Patient4$$name$.family) + " " + (val === null || val === void 0 ? void 0 : (_val$Patient5 = val.Patient) === null || _val$Patient5 === void 0 ? void 0 : (_val$Patient5$ = _val$Patient5[0]) === null || _val$Patient5$ === void 0 ? void 0 : (_val$Patient5$$name = _val$Patient5$.name) === null || _val$Patient5$$name === void 0 ? void 0 : (_val$Patient5$$name$ = _val$Patient5$$name[0]) === null || _val$Patient5$$name$ === void 0 ? void 0 : (_val$Patient5$$name$$ = _val$Patient5$$name$.suffix) === null || _val$Patient5$$name$$ === void 0 ? void 0 : _val$Patient5$$name$$.display)) !== null && _ref25 !== void 0 ? _ref25 : "",
19317
19745
  pID: val === null || val === void 0 ? void 0 : (_val$Patient6 = val.Patient) === null || _val$Patient6 === void 0 ? void 0 : (_val$Patient6$ = _val$Patient6[0]) === null || _val$Patient6$ === void 0 ? void 0 : _val$Patient6$._id,
19318
19746
  mrn: val === null || val === void 0 ? void 0 : (_val$Patient7 = val.Patient) === null || _val$Patient7 === void 0 ? void 0 : (_val$Patient7$ = _val$Patient7[0]) === null || _val$Patient7$ === void 0 ? void 0 : _val$Patient7$.alias,
19319
- gender: val === null || val === void 0 ? void 0 : (_val$Patient8 = val.Patient) === null || _val$Patient8 === void 0 ? void 0 : (_val$Patient8$ = _val$Patient8[0]) === null || _val$Patient8$ === void 0 ? void 0 : _val$Patient8$.gender,
19747
+ gender: val === null || val === void 0 ? void 0 : (_val$Patient8 = val.Patient) === null || _val$Patient8 === void 0 ? void 0 : (_val$Patient8$ = _val$Patient8[0]) === null || _val$Patient8$ === void 0 ? void 0 : (_val$Patient8$$gender = _val$Patient8$.gender) === null || _val$Patient8$$gender === void 0 ? void 0 : _val$Patient8$$gender.display,
19320
19748
  dob: val === null || val === void 0 ? void 0 : (_val$Patient9 = val.Patient) === null || _val$Patient9 === void 0 ? void 0 : (_val$Patient9$ = _val$Patient9[0]) === null || _val$Patient9$ === void 0 ? void 0 : _val$Patient9$.birthDate,
19321
19749
  pidentifier: (_val$Patient$0$pident = val === null || val === void 0 ? void 0 : (_val$Patient10 = val.Patient) === null || _val$Patient10 === void 0 ? void 0 : (_val$Patient10$ = _val$Patient10[0]) === null || _val$Patient10$ === void 0 ? void 0 : (_val$Patient10$$piden = _val$Patient10$.pidentifier) === null || _val$Patient10$$piden === void 0 ? void 0 : (_val$Patient10$$piden2 = _val$Patient10$$piden[0]) === null || _val$Patient10$$piden2 === void 0 ? void 0 : _val$Patient10$$piden2.value) !== null && _val$Patient$0$pident !== void 0 ? _val$Patient$0$pident : "",
19322
19750
  lang: (_lang = lang) === null || _lang === void 0 ? void 0 : _lang.join(", "),
@@ -32795,32 +33223,300 @@ var siginInActions = {
32795
33223
  };
32796
33224
  var SigninFollowup$1 = SigninFollowup.reducer;
32797
33225
 
33226
+ var queries$8 = {
33227
+ category: "{\n \"db_name\": \"primarycare\",\n \"entity\": \"CodeableConceptMaster\",\n \"filter\": \"CodeableConceptMaster.Type=='DOCCATEGORY' && CodeableConceptMaster.activestatus==true\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n}",
33228
+ document: function document(id) {
33229
+ return {
33230
+ db_name: "primarycare",
33231
+ entity: "CA_ClinicalDocumenttype",
33232
+ filter: "CA_ClinicalDocumenttype.doccategory=='".concat(id, "' && CA_ClinicalDocumenttype.activestatus==true"),
33233
+ return_fields: "{id:CA_ClinicalDocumenttype.id, _id:CA_ClinicalDocumenttype._id,docname:CA_ClinicalDocumenttype.docname,doccategory:CA_ClinicalDocumenttype.doccategory, formrefid:CA_ClinicalDocumenttype.formrefid}"
33234
+ };
33235
+ },
33236
+ speciality: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"filter\": \"CodeableConceptMaster.Type=='SPECIALTY' && CodeableConceptMaster.activestatus==true\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n}"),
33237
+ encounter: function encounter(id) {
33238
+ return {
33239
+ db_name: dbName,
33240
+ entity: "Encounter",
33241
+ filter: "Encounter.activestatus==true && Encounter.patient_id==".concat(id),
33242
+ return_fields: "{id:Encounter.id,_id:Encounter._id,encounter_no:Encounter.encounter_no,encounterdate:Encounter.encounterdate}"
33243
+ };
33244
+ },
33245
+ practitioner: function practitioner(patient_id, encounter_id) {
33246
+ return {
33247
+ db_name: dbName,
33248
+ entity: "Encounter",
33249
+ filter: "Encounter.activestatus==true && Encounter.patient_id == ".concat(patient_id, " && Encounter.id==").concat(encounter_id),
33250
+ return_fields: " {Practitioner_id:(for doc in Practitioner filter doc.id in Encounter.participant[*].Practitioner_id return {name:document(doc.name),_id:doc._id})}"
33251
+ };
33252
+ },
33253
+ doc_read: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CAPatientClinicalDocs\",\n \"filter\": \"CAPatientClinicalDocs.activestatus ==true\",\n \"return_fields\": \"MERGE(CAPatientClinicalDocs, {organizationid:document(CAPatientClinicalDocs.organizationid)},{doccategory:(document(CAPatientClinicalDocs.doccategory))}, {patientid:document(CAPatientClinicalDocs.patientid)},{practitionerid:document(CAPatientClinicalDocs.practitionerid)},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(document(CAPatientClinicalDocs.encountertype)),specialty:(document(CAPatientClinicalDocs.specialty))})\"\n}"),
33254
+ doc_single_read: function doc_single_read(key) {
33255
+ return {
33256
+ db_name: dbName,
33257
+ entity: "CAPatientClinicalDocs",
33258
+ filter: "CAPatientClinicalDocs.activestatus ==true && CAPatientClinicalDocs._key=='".concat(key, "'"),
33259
+ return_fields: "MERGE(CAPatientClinicalDocs, {organizationid:document(CAPatientClinicalDocs.organizationid)},{doccategory:(document(CAPatientClinicalDocs.doccategory))}, {patientid:document(CAPatientClinicalDocs.patientid)},{practitionerid:(for pract in Practitioner filter pract._id == CAPatientClinicalDocs.practitionerid return merge(pract,{name:(for doc in HumanNameMaster filter doc._id in pract.name return merge(doc,{use:(document(doc.use)),prefix:(document(doc.prefix)),suffix:(document(doc.suffix))}))}))},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(document(CAPatientClinicalDocs.encountertype)),specialty:(document(CAPatientClinicalDocs.specialty))})"
33260
+ };
33261
+ },
33262
+ doc_agnst_category: function doc_agnst_category(category, speciality, encoumter, practitioner) {
33263
+ return {
33264
+ db_name: dbName,
33265
+ entity: "CAPatientClinicalDocs",
33266
+ filter: "CAPatientClinicalDocs.activestatus ==true && CAPatientClinicalDocs.doccategory=='".concat(category, "' || CAPatientClinicalDocs.specialty=='").concat(speciality, "' || CAPatientClinicalDocs.encounterid=='").concat(encoumter, "' || CAPatientClinicalDocs.practitionerid=='").concat(practitioner, "'"),
33267
+ return_fields: "MERGE(CAPatientClinicalDocs, {organizationid:document(CAPatientClinicalDocs.organizationid)},{doccategory:(document(CAPatientClinicalDocs.doccategory))}, {patientid:document(CAPatientClinicalDocs.patientid)},{practitionerid:(for pract in Practitioner filter pract._id == CAPatientClinicalDocs.practitionerid return merge(pract,{name:(for doc in HumanNameMaster filter doc._id in pract.name return merge(doc,{use:(document(doc.use)),prefix:(document(doc.prefix)),suffix:(document(doc.suffix))}))}))},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(document(CAPatientClinicalDocs.encountertype)),specialty:(document(CAPatientClinicalDocs.specialty))})"
33268
+ };
33269
+ },
33270
+ doc_agnst_encounter: function doc_agnst_encounter(patient_id, encounter_id) {
33271
+ return {
33272
+ db_name: dbName,
33273
+ entity: "CAPatientClinicalDocs",
33274
+ filter: "CAPatientClinicalDocs.activestatus ==true || CAPatientClinicalDocs.patientid=='".concat(patient_id, "' && CAPatientClinicalDocs.encounterid !='").concat(encounter_id, "'"),
33275
+ return_fields: "MERGE(CAPatientClinicalDocs, {organizationid:document(CAPatientClinicalDocs.organizationid)},{doccategory:(for doc in CodeableConceptMaster filter doc._id==CAPatientClinicalDocs.doccategory return merge(doc,{coding:(for cod in doc.coding return document(cod).display)}))}, {patientid:document(CAPatientClinicalDocs.patientid)},{practitionerid:document(CAPatientClinicalDocs.practitionerid)},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(for doc in CodeableConceptMaster filter doc._id==CAPatientClinicalDocs.encountertype return merge(doc,{coding:(for cod in doc.coding return document(cod).display)})),specialty:(for doc in CodeableConceptMaster filter doc._id==CAPatientClinicalDocs.specialty return merge(doc,{coding:(for cod in doc.coding return document(cod).display)}))})"
33276
+ };
33277
+ },
33278
+ doc_agnst_speciality: function doc_agnst_speciality(speciality) {
33279
+ return {
33280
+ db_name: dbName,
33281
+ entity: "CAPatientClinicalDocs",
33282
+ filter: "CAPatientClinicalDocs.activestatus ==true && CAPatientClinicalDocs.specialty=='".concat(speciality, "'"),
33283
+ return_fields: "MERGE(CAPatientClinicalDocs, {organizationid:document(CAPatientClinicalDocs.organizationid)},{doccategory:(document(CAPatientClinicalDocs.doccategory))}, {patientid:document(CAPatientClinicalDocs.patientid)},{practitionerid:document(CAPatientClinicalDocs.practitionerid)},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(for doc in CodeableConceptMaster filter doc._id==CAPatientClinicalDocs.encountertype return merge(doc,{coding:(for cod in doc.coding return document(cod).display)})),specialty:(for doc in CodeableConceptMaster filter doc._id==CAPatientClinicalDocs.specialty return merge(doc,{coding:(for cod in doc.coding return document(cod).display)}))})"
33284
+ };
33285
+ },
33286
+ doc_agnst_doctype: function doc_agnst_doctype(doctype) {
33287
+ return {
33288
+ db_name: dbName,
33289
+ entity: "CAPatientClinicalDocs",
33290
+ filter: "CAPatientClinicalDocs.activestatus ==true && CAPatientClinicalDocs.doctype=='".concat(doctype, "'"),
33291
+ return_fields: "MERGE(CAPatientClinicalDocs, {organizationid:document(CAPatientClinicalDocs.organizationid)},{doccategory:(for doc in CodeableConceptMaster filter doc._id==CAPatientClinicalDocs.doccategory return merge(doc,{coding:(for cod in doc.coding return document(cod).display)}))}, {patientid:document(CAPatientClinicalDocs.patientid)},{practitionerid:document(CAPatientClinicalDocs.practitionerid)},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(for doc in CodeableConceptMaster filter doc._id==CAPatientClinicalDocs.encountertype return merge(doc,{coding:(for cod in doc.coding return document(cod).display)})),specialty:(for doc in CodeableConceptMaster filter doc._id==CAPatientClinicalDocs.specialty return merge(doc,{coding:(for cod in doc.coding return document(cod).display)}))})"
33292
+ };
33293
+ },
33294
+ practionerAgainstCategory: function practionerAgainstCategory(patient_id, doc_Category, doc_Type) {
33295
+ return {
33296
+ db_name: "primarycare",
33297
+ entity: "CAPatientClinicalDocs",
33298
+ filter: "CAPatientClinicalDocs.activestatus ==true && CAPatientClinicalDocs.patientid=='".concat(patient_id, "' && CAPatientClinicalDocs.doccategory=='").concat(doc_Category, "' && CAPatientClinicalDocs.doctype=='").concat(doc_Type, "'"),
33299
+ return_fields: "MERGE(CAPatientClinicalDocs, {organizationid:document(CAPatientClinicalDocs.organizationid)},{doccategory:(document(CAPatientClinicalDocs.doccategory))}, {patientid:document(CAPatientClinicalDocs.patientid)},{practitionerid:(for pract in Practitioner filter pract._id == CAPatientClinicalDocs.practitionerid return merge(pract,{name:(for doc in HumanNameMaster filter doc._id in pract.name return merge(doc,{use:(document(doc.use)),prefix:(document(doc.prefix)),suffix:(document(doc.suffix))}))}))},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(document(CAPatientClinicalDocs.encountertype)),specialty:(document(CAPatientClinicalDocs.specialty))})"
33300
+ };
33301
+ }
33302
+ };
33303
+
33304
+ var genereateSaveJson = function genereateSaveJson(data) {
33305
+ var _data$data, _data$encounterData$d, _data$encounterData, _data$personDetails$p, _data$personDetails, _data$personDetails$p2, _data$personDetails$p3, _details$OldselectCat, _details$selectCatago, _data$formdata, _patient$type, _details$selectDoccum, _details$selectReason, _details$selectReason2;
33306
+
33307
+ var extraJson = {};
33308
+ var filter = {};
33309
+
33310
+ if (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.editId) {
33311
+ var _data$data2, _data$data3;
33312
+
33313
+ extraJson = {
33314
+ _id: data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.editId
33315
+ };
33316
+ filter = {
33317
+ filter: {
33318
+ _id: (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.editId
33319
+ }
33320
+ };
33321
+ }
33322
+
33323
+ var patient = (_data$encounterData$d = data === null || data === void 0 ? void 0 : (_data$encounterData = data.encounterData) === null || _data$encounterData === void 0 ? void 0 : _data$encounterData.data) !== null && _data$encounterData$d !== void 0 ? _data$encounterData$d : {}; // const prac =
33324
+ // data?.personDetails?.practitioner?.[0]?.PractitionerRole?.[0]?.id ?? 0;
33325
+
33326
+ var prac = (_data$personDetails$p = data === null || data === void 0 ? void 0 : (_data$personDetails = data.personDetails) === null || _data$personDetails === void 0 ? void 0 : (_data$personDetails$p2 = _data$personDetails.practitioner) === null || _data$personDetails$p2 === void 0 ? void 0 : (_data$personDetails$p3 = _data$personDetails$p2[0]) === null || _data$personDetails$p3 === void 0 ? void 0 : _data$personDetails$p3._id) !== null && _data$personDetails$p !== void 0 ? _data$personDetails$p : "";
33327
+ var details = data === null || data === void 0 ? void 0 : data.data;
33328
+ return [_objectSpread2(_objectSpread2({
33329
+ db_name: dbName,
33330
+ entity: "CAPatientClinicalDocs",
33331
+ is_metadata: true,
33332
+ metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd"
33333
+ }, filter), {}, {
33334
+ doc: _objectSpread2(_objectSpread2({}, extraJson), {}, {
33335
+ id: 0,
33336
+ organizationid: JSON.stringify(patient === null || patient === void 0 ? void 0 : patient.Organization_id),
33337
+ patientid: patient.pID,
33338
+ encounterid: patient.eId,
33339
+ practitionerid: prac,
33340
+ doccategory: details.editId ? details === null || details === void 0 ? void 0 : (_details$OldselectCat = details.OldselectCatagory) === null || _details$OldselectCat === void 0 ? void 0 : _details$OldselectCat._id : details === null || details === void 0 ? void 0 : (_details$selectCatago = details.selectCatagory) === null || _details$selectCatago === void 0 ? void 0 : _details$selectCatago._id,
33341
+ docformid: data === null || data === void 0 ? void 0 : data.formID,
33342
+ formdata: (_data$formdata = data === null || data === void 0 ? void 0 : data.formdata) !== null && _data$formdata !== void 0 ? _data$formdata : {},
33343
+ status: (details === null || details === void 0 ? void 0 : details.saveMode) === "Draft" ? false : true,
33344
+ DocStatusHistoryLog: [{
33345
+ startdate: 0,
33346
+ enddate: 0,
33347
+ statusreasoncode: "",
33348
+ statushistory: ""
33349
+ }],
33350
+ encountertype: (_patient$type = patient === null || patient === void 0 ? void 0 : patient.type) !== null && _patient$type !== void 0 ? _patient$type : "",
33351
+ doctype: details.editId ? details === null || details === void 0 ? void 0 : details.OldselectDoccument._id : details === null || details === void 0 ? void 0 : (_details$selectDoccum = details.selectDoccument) === null || _details$selectDoccum === void 0 ? void 0 : _details$selectDoccum._id,
33352
+ docdate: details.editId ? data === null || data === void 0 ? void 0 : data.docdate : moment().unix(),
33353
+ documents: [{
33354
+ _id: "",
33355
+ date: "",
33356
+ url: "",
33357
+ id: 0,
33358
+ fileName: "",
33359
+ fileid: "",
33360
+ filetype: "",
33361
+ objectid: ""
33362
+ }],
33363
+ reason: (_details$selectReason = details === null || details === void 0 ? void 0 : (_details$selectReason2 = details.selectReason) === null || _details$selectReason2 === void 0 ? void 0 : _details$selectReason2._id) !== null && _details$selectReason !== void 0 ? _details$selectReason : "",
33364
+ specialty: (patient === null || patient === void 0 ? void 0 : patient.speciality) === "" ? "General" : patient === null || patient === void 0 ? void 0 : patient.speciality
33365
+ })
33366
+ })];
33367
+ }; //genreate json for read
33368
+
33369
+ var generateResJson$6 = function generateResJson(dataList, state) {
33370
+ var obj = {};
33371
+ dataList.forEach(function (element) {
33372
+ var _element$doccategory;
33373
+
33374
+ if (element === null || element === void 0 ? void 0 : (_element$doccategory = element.doccategory) === null || _element$doccategory === void 0 ? void 0 : _element$doccategory.display) {
33375
+ var _element$doccategory2;
33376
+
33377
+ var category = element === null || element === void 0 ? void 0 : (_element$doccategory2 = element.doccategory) === null || _element$doccategory2 === void 0 ? void 0 : _element$doccategory2.display;
33378
+
33379
+ if (category in obj) {
33380
+ obj[category].count = obj[category].count + 1;
33381
+ } else {
33382
+ obj[category] = {
33383
+ count: 1,
33384
+ data: {}
33385
+ };
33386
+ obj[category].data = element;
33387
+ }
33388
+ }
33389
+ });
33390
+ console.log(Object.values(obj));
33391
+ return Object.values(obj);
33392
+ }; //generate json for single read
33393
+
33394
+ var generatesingleRead = function generatesingleRead(val, state) {
33395
+ var _state$docc_cat_read, _val$doctype, _val$doctype2, _val$doctype3, _val$doctype4;
33396
+
33397
+ return _objectSpread2({
33398
+ OldselectCatagory: state === null || state === void 0 ? void 0 : (_state$docc_cat_read = state.docc_cat_read) === null || _state$docc_cat_read === void 0 ? void 0 : _state$docc_cat_read.data.find(function (sys) {
33399
+ var _val$doccategory;
33400
+
33401
+ return (val === null || val === void 0 ? void 0 : (_val$doccategory = val.doccategory) === null || _val$doccategory === void 0 ? void 0 : _val$doccategory._id) === sys._id;
33402
+ }),
33403
+ OldselectDoccument: (val === null || val === void 0 ? void 0 : val.doctype) ? {
33404
+ label: val === null || val === void 0 ? void 0 : (_val$doctype = val.doctype) === null || _val$doctype === void 0 ? void 0 : _val$doctype.docname,
33405
+ value: val === null || val === void 0 ? void 0 : (_val$doctype2 = val.doctype) === null || _val$doctype2 === void 0 ? void 0 : _val$doctype2.doccategory,
33406
+ formrefid: val === null || val === void 0 ? void 0 : (_val$doctype3 = val.doctype) === null || _val$doctype3 === void 0 ? void 0 : _val$doctype3.formrefid,
33407
+ _id: val === null || val === void 0 ? void 0 : (_val$doctype4 = val.doctype) === null || _val$doctype4 === void 0 ? void 0 : _val$doctype4._id
33408
+ } : null,
33409
+ formID: val === null || val === void 0 ? void 0 : val.docformid,
33410
+ createdOn: getData$2(val.createddate ? moment.unix(val.createddate) : new Date()),
33411
+ editId: val._id,
33412
+ formData: val.formdata,
33413
+ saveMode: val.status === true ? "Final" : "Draft"
33414
+ }, val);
33415
+ }; //generate doc against category
33416
+
33417
+ var genreateDocAgnstCategory = function genreateDocAgnstCategory(data) {
33418
+ var orderedData = data.sort(function (a, b) {
33419
+ return (b === null || b === void 0 ? void 0 : b.createddate) - (a === null || a === void 0 ? void 0 : a.createddate);
33420
+ });
33421
+ var obj = {};
33422
+ orderedData.forEach(function (element) {
33423
+ var _element$doccategory3;
33424
+
33425
+ if (element === null || element === void 0 ? void 0 : (_element$doccategory3 = element.doccategory) === null || _element$doccategory3 === void 0 ? void 0 : _element$doccategory3.display) {
33426
+ var _element$doccategory4;
33427
+
33428
+ var category = element === null || element === void 0 ? void 0 : (_element$doccategory4 = element.doccategory) === null || _element$doccategory4 === void 0 ? void 0 : _element$doccategory4.display;
33429
+
33430
+ if (category in obj) {
33431
+ var _element$practitioner, _element$practitioner2, _element$practitioner3, _element$practitioner4;
33432
+
33433
+ obj[category].count = obj[category].count + 1;
33434
+
33435
+ var userObj = _objectSpread2({
33436
+ // title:
33437
+ // element.practitionerid.length > 0
33438
+ // ? element?.practitionerid?.practitioner_role.length > 0
33439
+ // ? element?.practitionerid?.practitioner_role[0]?.name
33440
+ // : ""
33441
+ // : "Role",
33442
+ title: "Role",
33443
+ date: moment.unix(element.createddate).format("MMMM Do h:mm a"),
33444
+ name: element.practitionerid.length > 0 ? ((_element$practitioner = element.practitionerid[0]) === null || _element$practitioner === void 0 ? void 0 : (_element$practitioner2 = _element$practitioner.name[0]) === null || _element$practitioner2 === void 0 ? void 0 : _element$practitioner2.text) + ((_element$practitioner3 = element.practitionerid[0]) === null || _element$practitioner3 === void 0 ? void 0 : (_element$practitioner4 = _element$practitioner3.name[0]) === null || _element$practitioner4 === void 0 ? void 0 : _element$practitioner4.given) : "Dummy"
33445
+ }, element);
33446
+
33447
+ var childObj = {
33448
+ title: element.doctype.docname,
33449
+ user: [_objectSpread2({}, userObj)]
33450
+ };
33451
+ var findobj = obj[category].child.find(function (c) {
33452
+ return c.title === childObj.title;
33453
+ });
33454
+
33455
+ if (findobj) {
33456
+ findobj.user.push(userObj);
33457
+ } else {
33458
+ obj[category].child.push(childObj);
33459
+ }
33460
+ } else {
33461
+ var _element$practitioner5, _element$practitioner6, _element$practitioner7, _element$practitioner8;
33462
+
33463
+ obj[category] = {
33464
+ title: category,
33465
+ count: 1,
33466
+ child: []
33467
+ };
33468
+
33469
+ var _userObj = _objectSpread2({
33470
+ title: "Role",
33471
+ date: moment.unix(element.createddate).format("MMMM Do h:mm:ss a"),
33472
+ name: element.practitionerid.length > 0 ? ((_element$practitioner5 = element.practitionerid[0]) === null || _element$practitioner5 === void 0 ? void 0 : (_element$practitioner6 = _element$practitioner5.name[0]) === null || _element$practitioner6 === void 0 ? void 0 : _element$practitioner6.text) + ((_element$practitioner7 = element.practitionerid[0]) === null || _element$practitioner7 === void 0 ? void 0 : (_element$practitioner8 = _element$practitioner7.name[0]) === null || _element$practitioner8 === void 0 ? void 0 : _element$practitioner8.given) : "Dummy"
33473
+ }, element);
33474
+
33475
+ var childObj = {
33476
+ title: element.doctype.docname,
33477
+ user: [_objectSpread2({}, _userObj)]
33478
+ };
33479
+ obj[category].child.push(childObj);
33480
+ }
33481
+ }
33482
+ });
33483
+ console.log(Object.values(obj));
33484
+ return Object.values(obj);
33485
+ };
33486
+ var generatePractitoner = function generatePractitoner(data) {
33487
+ debugger;
33488
+ var orderedData = data.sort(function (a, b) {
33489
+ return (b === null || b === void 0 ? void 0 : b.createddate) - (a === null || a === void 0 ? void 0 : a.createddate);
33490
+ });
33491
+ var arr = [];
33492
+ orderedData.forEach(function (element) {
33493
+ var userObj = _objectSpread2({
33494
+ // title:
33495
+ // element.practitionerid.length > 0
33496
+ // ? element?.practitionerid?.practitioner_role[0]?.name
33497
+ // : "Role",
33498
+ title: "Role",
33499
+ date: moment.unix(element.createddate).format("MMMM Do h:mm a"),
33500
+ name: element.practitionerid.length > 0 ? "".concat(element.practitionerid[0].name[0].text + " " + element.practitionerid[0].name[0].given) : "Dummy"
33501
+ }, element);
33502
+
33503
+ arr.push(userObj);
33504
+ });
33505
+ debugger;
33506
+ return arr;
33507
+ };
33508
+ var getData$2 = function getData(date, time) {
33509
+ var da = date ? new Date(date) : new Date();
33510
+ var d = new Date(da).toDateString().split(" ");
33511
+ return "".concat(d[2], " ").concat(d[1], ", ").concat(d[3], " ").concat(time ? moment(da).format("LT") : "");
33512
+ };
33513
+
32798
33514
  var _extraReducers$v;
32799
33515
  var DOCC_SAVE_SERVICE = createAsyncThunk("DoccSlice/docc_save", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
32800
33516
  var payload,
32801
33517
  _ref2,
32802
33518
  rejectWithValue,
32803
- _data$encounterData$d,
32804
- _data$encounterData,
32805
- _data$personDetails$p,
32806
- _data$personDetails,
32807
- _data$personDetails$p2,
32808
- _data$personDetails$p3,
32809
- _data$personDetails$p4,
32810
- _data$personDetails$p5,
32811
- _details$selectCatago,
32812
- _details$selectCatago2,
32813
- _data$formdata,
32814
- _patient$type,
32815
- _details$selectDoccum,
32816
- _details$selectDoccum2,
32817
- _patient$speciality,
32818
33519
  data,
32819
- extraJson,
32820
- filter,
32821
- patient,
32822
- prac,
32823
- details,
32824
33520
  body,
32825
33521
  res,
32826
33522
  _args = arguments;
@@ -32833,95 +33529,1483 @@ var DOCC_SAVE_SERVICE = createAsyncThunk("DoccSlice/docc_save", /*#__PURE__*/_as
32833
33529
  _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
32834
33530
  _context.prev = 2;
32835
33531
  data = payload.data;
32836
- extraJson = {};
32837
- filter = {};
33532
+ body = genereateSaveJson(data);
33533
+ _context.next = 7;
33534
+ return fetchData$1({
33535
+ body: JSON.stringify(body)
33536
+ }, __uspsertUrl__);
32838
33537
 
32839
- if (data.editId) {
32840
- extraJson = {
32841
- _id: data.editId
32842
- };
32843
- filter = {
32844
- filter: {
32845
- _id: data.editId
32846
- }
32847
- };
32848
- }
33538
+ case 7:
33539
+ res = _context.sent;
33540
+ return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
33541
+ data: res
33542
+ }));
32849
33543
 
32850
- patient = (_data$encounterData$d = data === null || data === void 0 ? void 0 : (_data$encounterData = data.encounterData) === null || _data$encounterData === void 0 ? void 0 : _data$encounterData.data) !== null && _data$encounterData$d !== void 0 ? _data$encounterData$d : {};
32851
- prac = (_data$personDetails$p = data === null || data === void 0 ? void 0 : (_data$personDetails = data.personDetails) === null || _data$personDetails === void 0 ? void 0 : (_data$personDetails$p2 = _data$personDetails.practitioner) === null || _data$personDetails$p2 === void 0 ? void 0 : (_data$personDetails$p3 = _data$personDetails$p2[0]) === null || _data$personDetails$p3 === void 0 ? void 0 : (_data$personDetails$p4 = _data$personDetails$p3.PractitionerRole) === null || _data$personDetails$p4 === void 0 ? void 0 : (_data$personDetails$p5 = _data$personDetails$p4[0]) === null || _data$personDetails$p5 === void 0 ? void 0 : _data$personDetails$p5.id) !== null && _data$personDetails$p !== void 0 ? _data$personDetails$p : 0;
32852
- details = data === null || data === void 0 ? void 0 : data.data;
32853
- body = [_objectSpread2(_objectSpread2({
32854
- "db_name": dbName,
32855
- "entity": "CAPatientClinicalDocs",
32856
- "is_metadata": true,
32857
- "metadataId": "04ecb73d-f048-44ce-8563-c9be015812dd"
32858
- }, filter), {}, {
32859
- "doc": _objectSpread2(_objectSpread2({}, extraJson), {}, {
32860
- "id": 0,
32861
- "organizationid": JSON.stringify(patient === null || patient === void 0 ? void 0 : patient.Organization_id),
32862
- "patientid": patient.pID,
32863
- "encounterid": patient.eId,
32864
- "practitionerid": JSON.stringify(prac),
32865
- "doccategory": (_details$selectCatago = details === null || details === void 0 ? void 0 : (_details$selectCatago2 = details.selectCatagory) === null || _details$selectCatago2 === void 0 ? void 0 : _details$selectCatago2._id) !== null && _details$selectCatago !== void 0 ? _details$selectCatago : '',
32866
- "docformid": data === null || data === void 0 ? void 0 : data.formID,
32867
- "formdata": (_data$formdata = data === null || data === void 0 ? void 0 : data.formdata) !== null && _data$formdata !== void 0 ? _data$formdata : {},
32868
- "status": true,
32869
- "DocStatusHistoryLog": [{
32870
- "startdate": 0,
32871
- "enddate": 0,
32872
- "statusreasoncode": "",
32873
- "statushistory": ""
32874
- }],
32875
- "encountertype": (_patient$type = patient === null || patient === void 0 ? void 0 : patient.type) !== null && _patient$type !== void 0 ? _patient$type : '',
32876
- "doctype": (_details$selectDoccum = details === null || details === void 0 ? void 0 : (_details$selectDoccum2 = details.selectDoccument) === null || _details$selectDoccum2 === void 0 ? void 0 : _details$selectDoccum2._id) !== null && _details$selectDoccum !== void 0 ? _details$selectDoccum : '',
32877
- "docdate": moment().unix(),
32878
- "documents": [{
32879
- "_id": "",
32880
- "date": "",
32881
- "url": "",
32882
- "id": 0,
32883
- "fileName": "",
32884
- "fileid": "",
32885
- "filetype": "",
32886
- "objectid": ""
32887
- }],
32888
- "reason": "",
32889
- "specialty": (_patient$speciality = patient === null || patient === void 0 ? void 0 : patient.speciality) !== null && _patient$speciality !== void 0 ? _patient$speciality : ''
32890
- })
32891
- })];
32892
- _context.next = 13;
33544
+ case 11:
33545
+ _context.prev = 11;
33546
+ _context.t0 = _context["catch"](2);
33547
+ return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33548
+ message: _context.t0.message
33549
+ })));
33550
+
33551
+ case 14:
33552
+ case "end":
33553
+ return _context.stop();
33554
+ }
33555
+ }
33556
+ }, _callee, null, [[2, 11]]);
33557
+ })));
33558
+ var DOCC_CATE_READ = createAsyncThunk("DoccSlice/docc_cat_read", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
33559
+ var payload,
33560
+ _ref4,
33561
+ rejectWithValue,
33562
+ getState,
33563
+ data,
33564
+ arr,
33565
+ _args2 = arguments;
33566
+
33567
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
33568
+ while (1) {
33569
+ switch (_context2.prev = _context2.next) {
33570
+ case 0:
33571
+ payload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
33572
+ _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue, getState = _ref4.getState;
33573
+ _context2.prev = 2;
33574
+ _context2.next = 5;
33575
+ return fetchData$1({
33576
+ body: queries$8.category
33577
+ }, __readDocumentUrl__);
33578
+
33579
+ case 5:
33580
+ data = _context2.sent;
33581
+ arr = [];
33582
+ data.result.map(function (v) {
33583
+ var _v$coding$0$display, _v$coding, _v$coding$, _v$coding$0$Type, _v$coding2, _v$coding2$, _v$coding$0$_id, _v$coding3, _v$coding3$, _v$_id;
33584
+
33585
+ arr.push({
33586
+ label: (_v$coding$0$display = v === null || v === void 0 ? void 0 : (_v$coding = v.coding) === null || _v$coding === void 0 ? void 0 : (_v$coding$ = _v$coding[0]) === null || _v$coding$ === void 0 ? void 0 : _v$coding$.display) !== null && _v$coding$0$display !== void 0 ? _v$coding$0$display : "",
33587
+ value: (_v$coding$0$Type = v === null || v === void 0 ? void 0 : (_v$coding2 = v.coding) === null || _v$coding2 === void 0 ? void 0 : (_v$coding2$ = _v$coding2[0]) === null || _v$coding2$ === void 0 ? void 0 : _v$coding2$.Type) !== null && _v$coding$0$Type !== void 0 ? _v$coding$0$Type : "",
33588
+ _id: (_v$coding$0$_id = v === null || v === void 0 ? void 0 : (_v$coding3 = v.coding) === null || _v$coding3 === void 0 ? void 0 : (_v$coding3$ = _v$coding3[0]) === null || _v$coding3$ === void 0 ? void 0 : _v$coding3$._id) !== null && _v$coding$0$_id !== void 0 ? _v$coding$0$_id : "",
33589
+ __id: (_v$_id = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id !== void 0 ? _v$_id : ""
33590
+ });
33591
+ });
33592
+ return _context2.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33593
+ data: arr
33594
+ }));
33595
+
33596
+ case 11:
33597
+ _context2.prev = 11;
33598
+ _context2.t0 = _context2["catch"](2);
33599
+ return _context2.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33600
+ message: _context2.t0.message
33601
+ })));
33602
+
33603
+ case 14:
33604
+ case "end":
33605
+ return _context2.stop();
33606
+ }
33607
+ }
33608
+ }, _callee2, null, [[2, 11]]);
33609
+ })));
33610
+ var DOCC_DOCC_READ = createAsyncThunk("DoccSlice/docc_docc_read", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
33611
+ var payload,
33612
+ _ref6,
33613
+ rejectWithValue,
33614
+ getState,
33615
+ id,
33616
+ data,
33617
+ arr,
33618
+ _args3 = arguments;
33619
+
33620
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
33621
+ while (1) {
33622
+ switch (_context3.prev = _context3.next) {
33623
+ case 0:
33624
+ payload = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
33625
+ _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue, getState = _ref6.getState;
33626
+ _context3.prev = 2;
33627
+ id = payload.id;
33628
+ _context3.next = 6;
33629
+ return fetchData$1({
33630
+ body: JSON.stringify(queries$8.document(id))
33631
+ }, __readDocumentUrl__);
33632
+
33633
+ case 6:
33634
+ data = _context3.sent;
33635
+ arr = []; // console.log( data.result)
33636
+
33637
+ data.result.map(function (v) {
33638
+ var _v$docname, _v$doccategory, _v$formrefid, _v$_id2;
33639
+
33640
+ arr.push({
33641
+ label: (_v$docname = v === null || v === void 0 ? void 0 : v.docname) !== null && _v$docname !== void 0 ? _v$docname : "",
33642
+ value: (_v$doccategory = v === null || v === void 0 ? void 0 : v.doccategory) !== null && _v$doccategory !== void 0 ? _v$doccategory : "",
33643
+ formrefid: (_v$formrefid = v === null || v === void 0 ? void 0 : v.formrefid) !== null && _v$formrefid !== void 0 ? _v$formrefid : "",
33644
+ _id: (_v$_id2 = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id2 !== void 0 ? _v$_id2 : ""
33645
+ });
33646
+ });
33647
+ return _context3.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33648
+ data: arr
33649
+ }));
33650
+
33651
+ case 12:
33652
+ _context3.prev = 12;
33653
+ _context3.t0 = _context3["catch"](2);
33654
+ return _context3.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33655
+ message: _context3.t0.message
33656
+ })));
33657
+
33658
+ case 15:
33659
+ case "end":
33660
+ return _context3.stop();
33661
+ }
33662
+ }
33663
+ }, _callee3, null, [[2, 12]]);
33664
+ })));
33665
+ var DOCC_SPECIALITY = createAsyncThunk("DoccSlice/docc_speciality", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
33666
+ var payload,
33667
+ _ref8,
33668
+ rejectWithValue,
33669
+ getState,
33670
+ data,
33671
+ arr,
33672
+ _args4 = arguments;
33673
+
33674
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
33675
+ while (1) {
33676
+ switch (_context4.prev = _context4.next) {
33677
+ case 0:
33678
+ payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
33679
+ _ref8 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref8.rejectWithValue, getState = _ref8.getState;
33680
+ _context4.prev = 2;
33681
+ _context4.next = 5;
33682
+ return fetchData$1({
33683
+ body: queries$8.speciality
33684
+ }, __readDocumentUrl__);
33685
+
33686
+ case 5:
33687
+ data = _context4.sent;
33688
+ arr = [];
33689
+ data.result.map(function (v) {
33690
+ var _v$coding$0$display2, _v$coding4, _v$coding4$, _v$coding$0$Type2, _v$coding5, _v$coding5$, _v$coding$0$_id2, _v$coding6, _v$coding6$, _v$_id3;
33691
+
33692
+ arr.push({
33693
+ label: (_v$coding$0$display2 = v === null || v === void 0 ? void 0 : (_v$coding4 = v.coding) === null || _v$coding4 === void 0 ? void 0 : (_v$coding4$ = _v$coding4[0]) === null || _v$coding4$ === void 0 ? void 0 : _v$coding4$.display) !== null && _v$coding$0$display2 !== void 0 ? _v$coding$0$display2 : "",
33694
+ value: (_v$coding$0$Type2 = v === null || v === void 0 ? void 0 : (_v$coding5 = v.coding) === null || _v$coding5 === void 0 ? void 0 : (_v$coding5$ = _v$coding5[0]) === null || _v$coding5$ === void 0 ? void 0 : _v$coding5$.Type) !== null && _v$coding$0$Type2 !== void 0 ? _v$coding$0$Type2 : "",
33695
+ _id: (_v$coding$0$_id2 = v === null || v === void 0 ? void 0 : (_v$coding6 = v.coding) === null || _v$coding6 === void 0 ? void 0 : (_v$coding6$ = _v$coding6[0]) === null || _v$coding6$ === void 0 ? void 0 : _v$coding6$._id) !== null && _v$coding$0$_id2 !== void 0 ? _v$coding$0$_id2 : "",
33696
+ __id: (_v$_id3 = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id3 !== void 0 ? _v$_id3 : ""
33697
+ });
33698
+ });
33699
+ return _context4.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33700
+ data: arr
33701
+ }));
33702
+
33703
+ case 11:
33704
+ _context4.prev = 11;
33705
+ _context4.t0 = _context4["catch"](2);
33706
+ return _context4.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33707
+ message: _context4.t0.message
33708
+ })));
33709
+
33710
+ case 14:
33711
+ case "end":
33712
+ return _context4.stop();
33713
+ }
33714
+ }
33715
+ }, _callee4, null, [[2, 11]]);
33716
+ })));
33717
+ var DOCC_ENCOUNTER = createAsyncThunk("DoccSlice/docc_encounter", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
33718
+ var payload,
33719
+ _ref10,
33720
+ rejectWithValue,
33721
+ getState,
33722
+ id,
33723
+ data,
33724
+ arr,
33725
+ _args5 = arguments;
33726
+
33727
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
33728
+ while (1) {
33729
+ switch (_context5.prev = _context5.next) {
33730
+ case 0:
33731
+ payload = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
33732
+ _ref10 = _args5.length > 1 ? _args5[1] : undefined, rejectWithValue = _ref10.rejectWithValue, getState = _ref10.getState;
33733
+ _context5.prev = 2;
33734
+ id = payload.id;
33735
+ _context5.next = 6;
33736
+ return fetchData$1({
33737
+ body: JSON.stringify(queries$8.encounter(id))
33738
+ }, __readDocumentUrl__);
33739
+
33740
+ case 6:
33741
+ data = _context5.sent;
33742
+ arr = [];
33743
+ data.result.map(function (v) {
33744
+ var _v$_id4, _v$_id5, _v$_id6, _v$id, _v$encounterdate;
33745
+
33746
+ arr.push({
33747
+ label: (_v$_id4 = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id4 !== void 0 ? _v$_id4 : "label",
33748
+ //encounter_no
33749
+ value: (_v$_id5 = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id5 !== void 0 ? _v$_id5 : "",
33750
+ _id: (_v$_id6 = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id6 !== void 0 ? _v$_id6 : "",
33751
+ id: (_v$id = v === null || v === void 0 ? void 0 : v.id) !== null && _v$id !== void 0 ? _v$id : "",
33752
+ encounterDate: (_v$encounterdate = v === null || v === void 0 ? void 0 : v.encounterdate) !== null && _v$encounterdate !== void 0 ? _v$encounterdate : 0
33753
+ });
33754
+ });
33755
+ return _context5.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33756
+ data: arr
33757
+ }));
33758
+
33759
+ case 12:
33760
+ _context5.prev = 12;
33761
+ _context5.t0 = _context5["catch"](2);
33762
+ return _context5.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33763
+ message: _context5.t0.message
33764
+ })));
33765
+
33766
+ case 15:
33767
+ case "end":
33768
+ return _context5.stop();
33769
+ }
33770
+ }
33771
+ }, _callee5, null, [[2, 12]]);
33772
+ })));
33773
+ var DOCC_PRACTITIONER = createAsyncThunk("DoccSlice/docc_practitioner", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
33774
+ var payload,
33775
+ _ref12,
33776
+ rejectWithValue,
33777
+ getState,
33778
+ patient_id,
33779
+ encounter_id,
33780
+ data,
33781
+ res,
33782
+ arr,
33783
+ _args6 = arguments;
33784
+
33785
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
33786
+ while (1) {
33787
+ switch (_context6.prev = _context6.next) {
33788
+ case 0:
33789
+ payload = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
33790
+ _ref12 = _args6.length > 1 ? _args6[1] : undefined, rejectWithValue = _ref12.rejectWithValue, getState = _ref12.getState;
33791
+ _context6.prev = 2;
33792
+ patient_id = payload.patient_id, encounter_id = payload.encounter_id;
33793
+ _context6.next = 6;
33794
+ return fetchData$1({
33795
+ body: JSON.stringify(queries$8.practitioner(patient_id, encounter_id))
33796
+ }, __readDocumentUrl__);
33797
+
33798
+ case 6:
33799
+ data = _context6.sent;
33800
+ res = data.result[0].Practitioner_id;
33801
+ arr = [];
33802
+ res === null || res === void 0 ? void 0 : res.map(function (v) {
33803
+ var _v$_id7, _v$_id8;
33804
+
33805
+ arr.push({
33806
+ label: (v === null || v === void 0 ? void 0 : v.name[0].text) ? " ".concat((v === null || v === void 0 ? void 0 : v.name[0].family) + " " + (v === null || v === void 0 ? void 0 : v.name[0].text) + " " + (v === null || v === void 0 ? void 0 : v.name[0].given)) : "",
33807
+ value: (_v$_id7 = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id7 !== void 0 ? _v$_id7 : "",
33808
+ _id: (_v$_id8 = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id8 !== void 0 ? _v$_id8 : ""
33809
+ });
33810
+ });
33811
+ return _context6.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33812
+ data: arr
33813
+ }));
33814
+
33815
+ case 13:
33816
+ _context6.prev = 13;
33817
+ _context6.t0 = _context6["catch"](2);
33818
+ return _context6.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33819
+ message: _context6.t0.message
33820
+ })));
33821
+
33822
+ case 16:
33823
+ case "end":
33824
+ return _context6.stop();
33825
+ }
33826
+ }
33827
+ }, _callee6, null, [[2, 13]]);
33828
+ })));
33829
+ var DOCC_READ = createAsyncThunk("DoccSlice/docc_read", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
33830
+ var payload,
33831
+ _ref14,
33832
+ rejectWithValue,
33833
+ getState,
33834
+ data,
33835
+ res,
33836
+ _args7 = arguments;
33837
+
33838
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
33839
+ while (1) {
33840
+ switch (_context7.prev = _context7.next) {
33841
+ case 0:
33842
+ payload = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
33843
+ _ref14 = _args7.length > 1 ? _args7[1] : undefined, rejectWithValue = _ref14.rejectWithValue, getState = _ref14.getState;
33844
+ _context7.prev = 2;
33845
+ _context7.next = 5;
33846
+ return fetchData$1({
33847
+ body: queries$8.doc_read
33848
+ }, __readDocumentUrl__);
33849
+
33850
+ case 5:
33851
+ data = _context7.sent;
33852
+ res = generateResJson$6(data.result);
33853
+ return _context7.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33854
+ data: res
33855
+ }));
33856
+
33857
+ case 10:
33858
+ _context7.prev = 10;
33859
+ _context7.t0 = _context7["catch"](2);
33860
+ return _context7.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33861
+ message: _context7.t0.message
33862
+ })));
33863
+
33864
+ case 13:
33865
+ case "end":
33866
+ return _context7.stop();
33867
+ }
33868
+ }
33869
+ }, _callee7, null, [[2, 10]]);
33870
+ })));
33871
+ var DOCC_SINGLE_READ = createAsyncThunk("DoccSlice/docc_single_read", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
33872
+ var payload,
33873
+ _ref16,
33874
+ rejectWithValue,
33875
+ getState,
33876
+ key,
33877
+ state,
33878
+ ccState,
33879
+ data,
33880
+ res,
33881
+ _args8 = arguments;
33882
+
33883
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
33884
+ while (1) {
33885
+ switch (_context8.prev = _context8.next) {
33886
+ case 0:
33887
+ payload = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
33888
+ _ref16 = _args8.length > 1 ? _args8[1] : undefined, rejectWithValue = _ref16.rejectWithValue, getState = _ref16.getState;
33889
+ _context8.prev = 2;
33890
+ key = payload.key;
33891
+ state = getState();
33892
+ ccState = JSON.parse(JSON.stringify(state.DoccSlice));
33893
+ _context8.next = 8;
33894
+ return fetchData$1({
33895
+ body: JSON.stringify(queries$8.doc_single_read(key))
33896
+ }, __readDocumentUrl__);
33897
+
33898
+ case 8:
33899
+ data = _context8.sent;
33900
+ res = generatesingleRead(data.result[0], ccState);
33901
+ return _context8.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33902
+ data: res
33903
+ }));
33904
+
33905
+ case 13:
33906
+ _context8.prev = 13;
33907
+ _context8.t0 = _context8["catch"](2);
33908
+ return _context8.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33909
+ message: _context8.t0.message
33910
+ })));
33911
+
33912
+ case 16:
33913
+ case "end":
33914
+ return _context8.stop();
33915
+ }
33916
+ }
33917
+ }, _callee8, null, [[2, 13]]);
33918
+ })));
33919
+ var DOCC_AGAINST_CATEGORY = createAsyncThunk("DoccSlice/docc_agnst_category", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
33920
+ var payload,
33921
+ _ref18,
33922
+ rejectWithValue,
33923
+ getState,
33924
+ category,
33925
+ speciality,
33926
+ encoumter,
33927
+ practitioner,
33928
+ data,
33929
+ res,
33930
+ _args9 = arguments;
33931
+
33932
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
33933
+ while (1) {
33934
+ switch (_context9.prev = _context9.next) {
33935
+ case 0:
33936
+ payload = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
33937
+ _ref18 = _args9.length > 1 ? _args9[1] : undefined, rejectWithValue = _ref18.rejectWithValue, getState = _ref18.getState;
33938
+ _context9.prev = 2;
33939
+ category = payload.category, speciality = payload.speciality, encoumter = payload.encoumter, practitioner = payload.practitioner;
33940
+ _context9.next = 6;
33941
+ return fetchData$1({
33942
+ body: JSON.stringify(queries$8.doc_agnst_category(category, speciality, encoumter, practitioner))
33943
+ }, __readDocumentUrl__);
33944
+
33945
+ case 6:
33946
+ data = _context9.sent;
33947
+ res = genreateDocAgnstCategory(data.result);
33948
+ return _context9.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33949
+ data: res
33950
+ }));
33951
+
33952
+ case 11:
33953
+ _context9.prev = 11;
33954
+ _context9.t0 = _context9["catch"](2);
33955
+ return _context9.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33956
+ message: _context9.t0.message
33957
+ })));
33958
+
33959
+ case 14:
33960
+ case "end":
33961
+ return _context9.stop();
33962
+ }
33963
+ }
33964
+ }, _callee9, null, [[2, 11]]);
33965
+ })));
33966
+ var DOCC_AGAINST_ENCOUNTER = createAsyncThunk("DoccSlice/docc_agnst_encoumter", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
33967
+ var payload,
33968
+ _ref20,
33969
+ rejectWithValue,
33970
+ getState,
33971
+ patient_id,
33972
+ encounter_id,
33973
+ data,
33974
+ _args10 = arguments;
33975
+
33976
+ return regeneratorRuntime.wrap(function _callee10$(_context10) {
33977
+ while (1) {
33978
+ switch (_context10.prev = _context10.next) {
33979
+ case 0:
33980
+ payload = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : {};
33981
+ _ref20 = _args10.length > 1 ? _args10[1] : undefined, rejectWithValue = _ref20.rejectWithValue, getState = _ref20.getState;
33982
+ _context10.prev = 2;
33983
+ patient_id = payload.patient_id, encounter_id = payload.encounter_id;
33984
+ _context10.next = 6;
33985
+ return fetchData$1({
33986
+ body: JSON.stringify(queries$8.doc_agnst_encounter(patient_id, encounter_id))
33987
+ }, __readDocumentUrl__);
33988
+
33989
+ case 6:
33990
+ data = _context10.sent;
33991
+ return _context10.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33992
+ data: data.result
33993
+ }));
33994
+
33995
+ case 10:
33996
+ _context10.prev = 10;
33997
+ _context10.t0 = _context10["catch"](2);
33998
+ return _context10.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33999
+ message: _context10.t0.message
34000
+ })));
34001
+
34002
+ case 13:
34003
+ case "end":
34004
+ return _context10.stop();
34005
+ }
34006
+ }
34007
+ }, _callee10, null, [[2, 10]]);
34008
+ })));
34009
+ var DOCC_AGAINST_SPECIALITY = createAsyncThunk("DoccSlice/docc_agnst_speciality", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
34010
+ var payload,
34011
+ _ref22,
34012
+ rejectWithValue,
34013
+ getState,
34014
+ speciality,
34015
+ data,
34016
+ res,
34017
+ _args11 = arguments;
34018
+
34019
+ return regeneratorRuntime.wrap(function _callee11$(_context11) {
34020
+ while (1) {
34021
+ switch (_context11.prev = _context11.next) {
34022
+ case 0:
34023
+ payload = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
34024
+ _ref22 = _args11.length > 1 ? _args11[1] : undefined, rejectWithValue = _ref22.rejectWithValue, getState = _ref22.getState;
34025
+ _context11.prev = 2;
34026
+ speciality = payload.speciality;
34027
+ _context11.next = 6;
34028
+ return fetchData$1({
34029
+ body: JSON.stringify(queries$8.doc_agnst_speciality(speciality))
34030
+ }, __readDocumentUrl__);
34031
+
34032
+ case 6:
34033
+ data = _context11.sent;
34034
+ res = genreateDocAgnstCategory(data.result);
34035
+ return _context11.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
34036
+ data: res
34037
+ }));
34038
+
34039
+ case 11:
34040
+ _context11.prev = 11;
34041
+ _context11.t0 = _context11["catch"](2);
34042
+ return _context11.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
34043
+ message: _context11.t0.message
34044
+ })));
34045
+
34046
+ case 14:
34047
+ case "end":
34048
+ return _context11.stop();
34049
+ }
34050
+ }
34051
+ }, _callee11, null, [[2, 11]]);
34052
+ })));
34053
+ var DOCC_AGAINST_DOCTYPE = createAsyncThunk("DoccSlice/docc_agnst_doctype", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
34054
+ var payload,
34055
+ _ref24,
34056
+ rejectWithValue,
34057
+ getState,
34058
+ doctype,
34059
+ data,
34060
+ _args12 = arguments;
34061
+
34062
+ return regeneratorRuntime.wrap(function _callee12$(_context12) {
34063
+ while (1) {
34064
+ switch (_context12.prev = _context12.next) {
34065
+ case 0:
34066
+ payload = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
34067
+ _ref24 = _args12.length > 1 ? _args12[1] : undefined, rejectWithValue = _ref24.rejectWithValue, getState = _ref24.getState;
34068
+ _context12.prev = 2;
34069
+ doctype = payload.doctype;
34070
+ _context12.next = 6;
34071
+ return fetchData$1({
34072
+ body: JSON.stringify(queries$8.doc_agnst_doctype(doctype))
34073
+ }, __readDocumentUrl__);
34074
+
34075
+ case 6:
34076
+ data = _context12.sent;
34077
+ return _context12.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
34078
+ data: data.result
34079
+ }));
34080
+
34081
+ case 10:
34082
+ _context12.prev = 10;
34083
+ _context12.t0 = _context12["catch"](2);
34084
+ return _context12.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
34085
+ message: _context12.t0.message
34086
+ })));
34087
+
34088
+ case 13:
34089
+ case "end":
34090
+ return _context12.stop();
34091
+ }
34092
+ }
34093
+ }, _callee12, null, [[2, 10]]);
34094
+ })));
34095
+ var PRACTITIONER_AGAINST_CATEGORY = createAsyncThunk("DoccSlice/practioner_agnst_category", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
34096
+ var payload,
34097
+ _ref26,
34098
+ rejectWithValue,
34099
+ getState,
34100
+ patient_id,
34101
+ doc_Category,
34102
+ doc_Type,
34103
+ data,
34104
+ res,
34105
+ _args13 = arguments;
34106
+
34107
+ return regeneratorRuntime.wrap(function _callee13$(_context13) {
34108
+ while (1) {
34109
+ switch (_context13.prev = _context13.next) {
34110
+ case 0:
34111
+ payload = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
34112
+ _ref26 = _args13.length > 1 ? _args13[1] : undefined, rejectWithValue = _ref26.rejectWithValue, getState = _ref26.getState;
34113
+ _context13.prev = 2;
34114
+ patient_id = payload.patient_id, doc_Category = payload.doc_Category, doc_Type = payload.doc_Type;
34115
+ _context13.next = 6;
34116
+ return fetchData$1({
34117
+ body: JSON.stringify(queries$8.practionerAgainstCategory(patient_id, doc_Category, doc_Type))
34118
+ }, __readDocumentUrl__);
34119
+
34120
+ case 6:
34121
+ data = _context13.sent;
34122
+ res = generatePractitoner(data.result);
34123
+ return _context13.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
34124
+ data: res
34125
+ }));
34126
+
34127
+ case 11:
34128
+ _context13.prev = 11;
34129
+ _context13.t0 = _context13["catch"](2);
34130
+ return _context13.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
34131
+ message: _context13.t0.message
34132
+ })));
34133
+
34134
+ case 14:
34135
+ case "end":
34136
+ return _context13.stop();
34137
+ }
34138
+ }
34139
+ }, _callee13, null, [[2, 11]]);
34140
+ })));
34141
+ var DoccSlice = createSlice({
34142
+ name: "DoccSlice",
34143
+ initialState: {
34144
+ docc_save: _objectSpread2({}, defaultState.Info),
34145
+ docc_cat_read: _objectSpread2({}, defaultState.Info),
34146
+ docc_docc_read: _objectSpread2({}, defaultState.Info),
34147
+ docc_read: _objectSpread2({}, defaultState.Info),
34148
+ docc_single_read: _objectSpread2({}, defaultState.Info),
34149
+ docc_speciality: _objectSpread2({}, defaultState.List),
34150
+ doc_encounter: _objectSpread2({}, defaultState.List),
34151
+ doc_practitioner: _objectSpread2({}, defaultState.List),
34152
+ doc_agnst_category: _objectSpread2({}, defaultState.List),
34153
+ doc_agnst_encounter: _objectSpread2({}, defaultState.List),
34154
+ doc_agnst_speciality: _objectSpread2({}, defaultState.List),
34155
+ doc_agnst_docType: _objectSpread2({}, defaultState.List),
34156
+ practioner_agnst_category: _objectSpread2({}, defaultState.List)
34157
+ },
34158
+ extraReducers: (_extraReducers$v = {}, _defineProperty(_extraReducers$v, DOCC_SAVE_SERVICE.fulfilled, function (state, action) {
34159
+ var _action$payload;
34160
+
34161
+ state.docc_save = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
34162
+ }), _defineProperty(_extraReducers$v, DOCC_SAVE_SERVICE.pending, function (state, action) {
34163
+ state.docc_save.loading = true;
34164
+ }), _defineProperty(_extraReducers$v, DOCC_SAVE_SERVICE.rejected, function (state, action) {
34165
+ var _action$payload2;
34166
+
34167
+ state.docc_save = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
34168
+ }), _defineProperty(_extraReducers$v, DOCC_CATE_READ.fulfilled, function (state, action) {
34169
+ var _action$payload3;
34170
+
34171
+ state.docc_cat_read = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
34172
+ }), _defineProperty(_extraReducers$v, DOCC_CATE_READ.pending, function (state, action) {
34173
+ state.docc_cat_read.loading = true;
34174
+ }), _defineProperty(_extraReducers$v, DOCC_CATE_READ.rejected, function (state, action) {
34175
+ var _action$payload4;
34176
+
34177
+ state.docc_cat_read = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
34178
+ }), _defineProperty(_extraReducers$v, DOCC_DOCC_READ.fulfilled, function (state, action) {
34179
+ var _action$payload5;
34180
+
34181
+ state.docc_docc_read = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
34182
+ }), _defineProperty(_extraReducers$v, DOCC_DOCC_READ.pending, function (state, action) {
34183
+ state.docc_docc_read.loading = true;
34184
+ }), _defineProperty(_extraReducers$v, DOCC_DOCC_READ.rejected, function (state, action) {
34185
+ var _action$payload6;
34186
+
34187
+ state.docc_docc_read = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
34188
+ }), _defineProperty(_extraReducers$v, DOCC_SPECIALITY.fulfilled, function (state, action) {
34189
+ var _action$payload7;
34190
+
34191
+ state.docc_speciality = (_action$payload7 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload7 !== void 0 ? _action$payload7 : {};
34192
+ }), _defineProperty(_extraReducers$v, DOCC_SPECIALITY.pending, function (state, action) {
34193
+ state.docc_speciality.loading = true;
34194
+ }), _defineProperty(_extraReducers$v, DOCC_SPECIALITY.rejected, function (state, action) {
34195
+ var _action$payload8;
34196
+
34197
+ state.docc_speciality = (_action$payload8 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload8 !== void 0 ? _action$payload8 : {};
34198
+ }), _defineProperty(_extraReducers$v, DOCC_ENCOUNTER.fulfilled, function (state, action) {
34199
+ var _action$payload9;
34200
+
34201
+ state.doc_encounter = (_action$payload9 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload9 !== void 0 ? _action$payload9 : {};
34202
+ }), _defineProperty(_extraReducers$v, DOCC_ENCOUNTER.pending, function (state, action) {
34203
+ state.doc_encounter.loading = true;
34204
+ }), _defineProperty(_extraReducers$v, DOCC_ENCOUNTER.rejected, function (state, action) {
34205
+ var _action$payload10;
34206
+
34207
+ state.doc_encounter = (_action$payload10 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload10 !== void 0 ? _action$payload10 : {};
34208
+ }), _defineProperty(_extraReducers$v, DOCC_PRACTITIONER.fulfilled, function (state, action) {
34209
+ var _action$payload11;
34210
+
34211
+ state.doc_practitioner = (_action$payload11 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload11 !== void 0 ? _action$payload11 : {};
34212
+ }), _defineProperty(_extraReducers$v, DOCC_PRACTITIONER.pending, function (state, action) {
34213
+ state.doc_practitioner.loading = true;
34214
+ }), _defineProperty(_extraReducers$v, DOCC_PRACTITIONER.rejected, function (state, action) {
34215
+ var _action$payload12;
34216
+
34217
+ state.doc_practitioner = (_action$payload12 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload12 !== void 0 ? _action$payload12 : {};
34218
+ }), _defineProperty(_extraReducers$v, DOCC_READ.fulfilled, function (state, action) {
34219
+ var _action$payload13;
34220
+
34221
+ state.docc_read = (_action$payload13 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload13 !== void 0 ? _action$payload13 : {};
34222
+ }), _defineProperty(_extraReducers$v, DOCC_READ.pending, function (state, action) {
34223
+ state.docc_read.loading = true;
34224
+ }), _defineProperty(_extraReducers$v, DOCC_READ.rejected, function (state, action) {
34225
+ var _action$payload14;
34226
+
34227
+ state.docc_read = (_action$payload14 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload14 !== void 0 ? _action$payload14 : {};
34228
+ }), _defineProperty(_extraReducers$v, DOCC_SINGLE_READ.fulfilled, function (state, action) {
34229
+ var _action$payload15;
34230
+
34231
+ state.docc_single_read = (_action$payload15 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload15 !== void 0 ? _action$payload15 : {};
34232
+ }), _defineProperty(_extraReducers$v, DOCC_SINGLE_READ.pending, function (state, action) {
34233
+ state.docc_single_read.loading = true;
34234
+ }), _defineProperty(_extraReducers$v, DOCC_SINGLE_READ.rejected, function (state, action) {
34235
+ var _action$payload16;
34236
+
34237
+ state.docc_single_read = (_action$payload16 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload16 !== void 0 ? _action$payload16 : {};
34238
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_CATEGORY.fulfilled, function (state, action) {
34239
+ var _action$payload17;
34240
+
34241
+ state.doc_agnst_category = (_action$payload17 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload17 !== void 0 ? _action$payload17 : {};
34242
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_CATEGORY.pending, function (state, action) {
34243
+ state.doc_agnst_category.loading = true;
34244
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_CATEGORY.rejected, function (state, action) {
34245
+ var _action$payload18;
34246
+
34247
+ state.doc_agnst_category = (_action$payload18 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload18 !== void 0 ? _action$payload18 : {};
34248
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_ENCOUNTER.fulfilled, function (state, action) {
34249
+ var _action$payload19;
34250
+
34251
+ state.doc_agnst_encounter = (_action$payload19 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload19 !== void 0 ? _action$payload19 : {};
34252
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_ENCOUNTER.pending, function (state, action) {
34253
+ state.doc_agnst_encounter.loading = true;
34254
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_ENCOUNTER.rejected, function (state, action) {
34255
+ var _action$payload20;
34256
+
34257
+ state.doc_agnst_encounter = (_action$payload20 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload20 !== void 0 ? _action$payload20 : {};
34258
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_SPECIALITY.fulfilled, function (state, action) {
34259
+ var _action$payload21;
34260
+
34261
+ state.doc_agnst_speciality = (_action$payload21 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload21 !== void 0 ? _action$payload21 : {};
34262
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_SPECIALITY.pending, function (state, action) {
34263
+ state.doc_agnst_speciality.loading = true;
34264
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_SPECIALITY.rejected, function (state, action) {
34265
+ var _action$payload22;
34266
+
34267
+ state.doc_agnst_speciality = (_action$payload22 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload22 !== void 0 ? _action$payload22 : {};
34268
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_DOCTYPE.fulfilled, function (state, action) {
34269
+ var _action$payload23;
34270
+
34271
+ state.doc_agnst_docType = (_action$payload23 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload23 !== void 0 ? _action$payload23 : {};
34272
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_DOCTYPE.pending, function (state, action) {
34273
+ state.doc_agnst_docType.loading = true;
34274
+ }), _defineProperty(_extraReducers$v, DOCC_AGAINST_DOCTYPE.rejected, function (state, action) {
34275
+ var _action$payload24;
34276
+
34277
+ state.doc_agnst_docType = (_action$payload24 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload24 !== void 0 ? _action$payload24 : {};
34278
+ }), _defineProperty(_extraReducers$v, PRACTITIONER_AGAINST_CATEGORY.fulfilled, function (state, action) {
34279
+ var _action$payload25;
34280
+
34281
+ state.practioner_agnst_category = (_action$payload25 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload25 !== void 0 ? _action$payload25 : {};
34282
+ }), _defineProperty(_extraReducers$v, PRACTITIONER_AGAINST_CATEGORY.pending, function (state, action) {
34283
+ state.practioner_agnst_category.loading = true;
34284
+ }), _defineProperty(_extraReducers$v, PRACTITIONER_AGAINST_CATEGORY.rejected, function (state, action) {
34285
+ var _action$payload26;
34286
+
34287
+ state.practioner_agnst_category = (_action$payload26 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload26 !== void 0 ? _action$payload26 : {};
34288
+ }), _extraReducers$v)
34289
+ });
34290
+ var DoccActions = {
34291
+ DOCC_SAVE_SERVICE: DOCC_SAVE_SERVICE,
34292
+ DOCC_CATE_READ: DOCC_CATE_READ,
34293
+ DOCC_DOCC_READ: DOCC_DOCC_READ,
34294
+ DOCC_SPECIALITY: DOCC_SPECIALITY,
34295
+ DOCC_ENCOUNTER: DOCC_ENCOUNTER,
34296
+ DOCC_PRACTITIONER: DOCC_PRACTITIONER,
34297
+ DOCC_READ: DOCC_READ,
34298
+ DOCC_SINGLE_READ: DOCC_SINGLE_READ,
34299
+ DOCC_AGAINST_CATEGORY: DOCC_AGAINST_CATEGORY,
34300
+ DOCC_AGAINST_ENCOUNTER: DOCC_AGAINST_ENCOUNTER,
34301
+ DOCC_AGAINST_SPECIALITY: DOCC_AGAINST_SPECIALITY,
34302
+ DOCC_AGAINST_DOCTYPE: DOCC_AGAINST_DOCTYPE,
34303
+ PRACTITIONER_AGAINST_CATEGORY: PRACTITIONER_AGAINST_CATEGORY
34304
+ };
34305
+ var DoccSlice$1 = DoccSlice.reducer;
34306
+
34307
+ var clinicQuery = {
34308
+ readClinicData: function readClinicData(key) {
34309
+ return {
34310
+ db_name: dbName,
34311
+ entity: "LocationMaster,LocationMaster_CodeableConceptMaster_E,CodeableConceptMaster_CodingMaster_E,LocationMaster_LocationRoleType_E,LocationMaster_Organization_E,Organization_CodeableConceptMaster_E,LocationMaster_ContactPointMaster_E,LocationMaster_AddressMaster_E,LocationMaster_AttachmentMaster_E",
34312
+ filter: "LocationMaster.activestatus==true && LocationMaster._key=='".concat(key, "'"),
34313
+ isTraversal: "true",
34314
+ return_fields: "{vertices:v,orginatedata:LocationMaster}"
34315
+ };
34316
+ }
34317
+ };
34318
+
34319
+ var _extraReducers$w;
34320
+ var READ_CLINICINFO = createAsyncThunk("clinicInfoSlice/clinicInfoRead", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
34321
+ var payload,
34322
+ _ref2,
34323
+ rejectWithValue,
34324
+ key,
34325
+ data,
34326
+ _args = arguments;
34327
+
34328
+ return regeneratorRuntime.wrap(function _callee$(_context) {
34329
+ while (1) {
34330
+ switch (_context.prev = _context.next) {
34331
+ case 0:
34332
+ payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
34333
+ _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
34334
+ _context.prev = 2;
34335
+ key = payload.key;
34336
+ _context.next = 6;
34337
+ return fetchData$1({
34338
+ body: JSON.stringify(clinicQuery.readClinicData(key))
34339
+ }, __readDocumentUrl__);
34340
+
34341
+ case 6:
34342
+ data = _context.sent;
34343
+ return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
34344
+ data: data === null || data === void 0 ? void 0 : data.result[0]
34345
+ }));
34346
+
34347
+ case 10:
34348
+ _context.prev = 10;
34349
+ _context.t0 = _context["catch"](2);
34350
+ return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
34351
+ message: _context.t0.message
34352
+ })));
34353
+
34354
+ case 13:
34355
+ case "end":
34356
+ return _context.stop();
34357
+ }
34358
+ }
34359
+ }, _callee, null, [[2, 10]]);
34360
+ })));
34361
+ var clinicInfoSlice = createSlice({
34362
+ name: "ClinicInfoApiSlice",
34363
+ initialState: {
34364
+ read_clinic_info: _objectSpread2({}, defaultState.Info)
34365
+ },
34366
+ extraReducers: (_extraReducers$w = {}, _defineProperty(_extraReducers$w, READ_CLINICINFO.fulfilled, function (state, action) {
34367
+ var _action$payload;
34368
+
34369
+ state.read_clinic_info = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
34370
+ }), _defineProperty(_extraReducers$w, READ_CLINICINFO.pending, function (state, action) {
34371
+ state.read_clinic_info.loading = true;
34372
+ }), _defineProperty(_extraReducers$w, READ_CLINICINFO.rejected, function (state, action) {
34373
+ var _action$payload2;
34374
+
34375
+ state.read_clinic_info = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
34376
+ }), _extraReducers$w)
34377
+ }); // READ_CLINICINFO ACTION LISTS
34378
+
34379
+ var clinicInfoActions = {
34380
+ READ_CLINICINFO: READ_CLINICINFO
34381
+ };
34382
+ var clinicInfoSlice$1 = clinicInfoSlice.reducer;
34383
+
34384
+ var queries$9 = {
34385
+ getPractioner: function getPractioner() {
34386
+ var obj = {
34387
+ db_name: dbName,
34388
+ entity: "Practitioner",
34389
+ filter: "Practitioner.activestatus==true",
34390
+ return_fields: "{_id:Practitioner._id,id:Practitioner.id,_key:Practitioner._key,name:(FOR hn IN TO_ARRAY(Practitioner.name) RETURN DOCUMENT(hn))}"
34391
+ };
34392
+ return obj;
34393
+ },
34394
+ getOrganization: function getOrganization() {
34395
+ var obj = {
34396
+ db_name: dbName,
34397
+ entity: "Organization",
34398
+ filter: "Organization.activestatus==true",
34399
+ return_fields: "{_id:Organization._id,id:Organization.id,_key:Organization._key,name:Organization.name}"
34400
+ };
34401
+ return obj;
34402
+ },
34403
+ getSpeciality: function getSpeciality() {
34404
+ var obj = {
34405
+ db_name: dbName,
34406
+ entity: "CodeableConceptMaster",
34407
+ filter: "CodeableConceptMaster.Type=='SPECIALTY' AND CodeableConceptMaster.activestatus==true",
34408
+ return_fields: "MERGE(CodeableConceptMaster,{coding:(FOR cod IN TO_ARRAY(CodeableConceptMaster.coding) RETURN DOCUMENT(cod))})"
34409
+ };
34410
+ return obj;
34411
+ },
34412
+ getChartTime: function getChartTime(_ref) {
34413
+ var id = _ref.id,
34414
+ start = _ref.start,
34415
+ end = _ref.end,
34416
+ type = _ref.type;
34417
+
34418
+ if (type === "Specialty") {
34419
+ return {
34420
+ db_name: dbName,
34421
+ entity: "Practitioner,Encounter",
34422
+ filter: {
34423
+ Practitioner: "DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID ANY =='".concat(id, "' "),
34424
+ Encounter: "Encounter.status=='CodingMaster/11595' and DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID ANY IN Encounter.practitioner_details[*].speciality AND Encounter.encounterdate>=".concat(start, " && Encounter.encounterdate<=").concat(end, " LET checkInPer=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/12164' RETURN document(sh.period)[*].end ) LET triagePer=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11595' RETURN document(sh.period)[*].start) let triend=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11595' RETURN document(sh.period)[*].end) let inProg=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11596' RETURN document(sh.period)[*].start) let inProge=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11596' RETURN document(sh.period)[*].end) let completed=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11598' RETURN document(sh.period)[*].start)")
34425
+ },
34426
+ return_fields: "{differenceCheckedintoTriage:(FIRST(triagePer)-FIRST(checkInPer))/60,differenceTriagetoInprogress:(FIRST(inProg)-FIRST(triend))/60,differenceInprogresstoCompleted:(FIRST(completed)-FIRST(inProge))/60,Total:((FIRST(triagePer)-FIRST(checkInPer))/60)+((FIRST(inProg)-FIRST(triend))/60)+((FIRST(completed)-FIRST(inProge))/60),Average:(((FIRST(triagePer)-FIRST(checkInPer))/60)+((FIRST(inProg)-FIRST(triend))/60)+((FIRST(completed)-FIRST(inProge))/60))/3}"
34427
+ };
34428
+ }
34429
+
34430
+ if (type === "Clinic") {
34431
+ return {
34432
+ db_name: dbName,
34433
+ entity: "Practitioner,Encounter",
34434
+ filter: {
34435
+ Practitioner: "DOCUMENT(Practitioner.practitioner_role[*])[*].OrgID ANY =='".concat(id, "' "),
34436
+ Encounter: "Encounter.status=='CodingMaster/11595' and DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID ANY IN Encounter.practitioner_details[*].speciality AND Encounter.encounterdate>=".concat(start, " && Encounter.encounterdate<=").concat(end, " LET checkInPer=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/12164' RETURN document(sh.period)[*].end ) LET triagePer=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11595' RETURN document(sh.period)[*].start) let triend=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11595' RETURN document(sh.period)[*].end) let inProg=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11596' RETURN document(sh.period)[*].start) let inProge=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11596' RETURN document(sh.period)[*].end) let completed=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11598' RETURN document(sh.period)[*].start)")
34437
+ },
34438
+ return_fields: "{differenceCheckedintoTriage:(FIRST(triagePer)-FIRST(checkInPer))/60,differenceTriagetoInprogress:(FIRST(inProg)-FIRST(triend))/60,differenceInprogresstoCompleted:(FIRST(completed)-FIRST(inProge))/60,Total:((FIRST(triagePer)-FIRST(checkInPer))/60)+((FIRST(inProg)-FIRST(triend))/60)+((FIRST(completed)-FIRST(inProge))/60),Average:(((FIRST(triagePer)-FIRST(checkInPer))/60)+((FIRST(inProg)-FIRST(triend))/60)+((FIRST(completed)-FIRST(inProge))/60))/3}"
34439
+ };
34440
+ }
34441
+
34442
+ if (type === "Practitioner") {
34443
+ return {
34444
+ db_name: dbName,
34445
+ entity: "Practitioner,Encounter",
34446
+ filter: {
34447
+ Practitioner: "Practitioner.id==".concat(id, " "),
34448
+ Encounter: "Encounter.status=='CodingMaster/11595' and DOCUMENT(Practitioner.practitioner_role[*])[*].SpecialtyID ANY IN Encounter.practitioner_details[*].speciality AND Encounter.encounterdate>=".concat(start, " && Encounter.encounterdate<=").concat(end, " LET checkInPer=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/12164' RETURN document(sh.period)[*].end ) LET triagePer=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11595' RETURN document(sh.period)[*].start) let triend=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11595' RETURN document(sh.period)[*].end) let inProg=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11596' RETURN document(sh.period)[*].start) let inProge=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11596' RETURN document(sh.period)[*].end) let completed=(FOR sh IN Encounter.statushistory FILTER sh.status=='CodingMaster/11598' RETURN document(sh.period)[*].start)")
34449
+ },
34450
+ return_fields: "{differenceCheckedintoTriage:(FIRST(triagePer)-FIRST(checkInPer))/60,differenceTriagetoInprogress:(FIRST(inProg)-FIRST(triend))/60,differenceInprogresstoCompleted:(FIRST(completed)-FIRST(inProge))/60,Total:((FIRST(triagePer)-FIRST(checkInPer))/60)+((FIRST(inProg)-FIRST(triend))/60)+((FIRST(completed)-FIRST(inProge))/60),Average:(((FIRST(triagePer)-FIRST(checkInPer))/60)+((FIRST(inProg)-FIRST(triend))/60)+((FIRST(completed)-FIRST(inProge))/60))/3}"
34451
+ };
34452
+ }
34453
+ }
34454
+ };
34455
+
34456
+ var config$2 = [{
34457
+ name: "GET_ALL_PRACTIONER_WATING",
34458
+ sliceName: "getAllPractionerWaiting",
34459
+ queryName: "getPractioner",
34460
+ type: "List",
34461
+ url: __readDocumentUrl__,
34462
+ makeReturnData: function makeReturnData(data) {
34463
+ var returnData = [];
34464
+
34465
+ if (Array.isArray(data.result)) {
34466
+ returnData = data.result.map(function (pract) {
34467
+ var _id = pract._id,
34468
+ _key = pract._key,
34469
+ id = pract.id,
34470
+ _pract$name = pract.name,
34471
+ name = _pract$name === void 0 ? [] : _pract$name;
34472
+ return {
34473
+ _id: _id,
34474
+ id: id,
34475
+ value: id,
34476
+ label: makeName((name === null || name === void 0 ? void 0 : name[0]) || {}),
34477
+ _key: _key
34478
+ };
34479
+ });
34480
+ }
34481
+
34482
+ return returnData;
34483
+ }
34484
+ }, {
34485
+ name: "GET_ALL_ORGANIZATION_WATING",
34486
+ sliceName: "getAllOrganizationWaiting",
34487
+ queryName: "getOrganization",
34488
+ type: "List",
34489
+ url: __readDocumentUrl__,
34490
+ makeReturnData: function makeReturnData(data) {
34491
+ var returnData = [];
34492
+
34493
+ if (Array.isArray(data.result)) {
34494
+ returnData = data.result.map(function (pract) {
34495
+ var _id = pract._id,
34496
+ _key = pract._key,
34497
+ id = pract.id,
34498
+ _pract$name2 = pract.name,
34499
+ name = _pract$name2 === void 0 ? "" : _pract$name2;
34500
+ return {
34501
+ _id: _id,
34502
+ id: id,
34503
+ value: _id,
34504
+ label: name,
34505
+ _key: _key
34506
+ };
34507
+ });
34508
+ }
34509
+
34510
+ return returnData;
34511
+ }
34512
+ }, {
34513
+ name: "GET_ALL_SPECIALITY_WATING",
34514
+ sliceName: "getAllSpecialityWaiting",
34515
+ queryName: "getSpeciality",
34516
+ type: "List",
34517
+ url: __readDocumentUrl__,
34518
+ makeReturnData: function makeReturnData(data) {
34519
+ var returnData = [];
34520
+
34521
+ if (Array.isArray(data.result)) {
34522
+ returnData = data.result.map(function (spec) {
34523
+ var _coding$;
34524
+
34525
+ var _id = spec._id,
34526
+ _key = spec._key,
34527
+ id = spec.id,
34528
+ _spec$coding = spec.coding,
34529
+ coding = _spec$coding === void 0 ? [] : _spec$coding;
34530
+ return {
34531
+ _id: _id,
34532
+ id: id,
34533
+ value: _id,
34534
+ label: (coding === null || coding === void 0 ? void 0 : (_coding$ = coding[0]) === null || _coding$ === void 0 ? void 0 : _coding$.display) || "",
34535
+ _key: _key
34536
+ };
34537
+ });
34538
+ }
34539
+
34540
+ return returnData;
34541
+ }
34542
+ }, {
34543
+ name: "UPDATE_WAITING_TIME_CHART",
34544
+ sliceName: "updateWaitingTimeChart",
34545
+ queryName: "getChartTime",
34546
+ type: "List",
34547
+ url: __readDocumentUrl__,
34548
+ makeReturnData: function makeReturnData(data) {
34549
+ var arrivalCheckin = [];
34550
+ var checkinTriage = [];
34551
+ var triageConsultation = [];
34552
+ var overall = [];
34553
+
34554
+ if (Array.isArray(data.result)) {
34555
+ data.result.forEach(function (d) {
34556
+ checkinTriage.push(Number(Number(d.differenceCheckedintoTriage).toFixed(1)));
34557
+ triageConsultation.push(Number(Number(d.differenceTriagetoInprogress).toFixed(1)));
34558
+ overall.push(Number(Number(d.Total).toFixed(1)));
34559
+ });
34560
+ }
34561
+
34562
+ var datasets = [{
34563
+ label: "Arrival - Checkin",
34564
+ data: arrivalCheckin,
34565
+ fill: false,
34566
+ borderColor: "rgb(75, 192, 192)",
34567
+ time: getAverage(arrivalCheckin),
34568
+ period: "Mins"
34569
+ }, {
34570
+ label: "Checkin - Traige",
34571
+ data: checkinTriage,
34572
+ fill: false,
34573
+ borderColor: "rgb(242, 146, 51)",
34574
+ time: getAverage(checkinTriage),
34575
+ period: "Mins"
34576
+ }, {
34577
+ label: "Traige - Consultation",
34578
+ data: triageConsultation,
34579
+ fill: false,
34580
+ borderColor: "rgb(54, 162, 235)",
34581
+ time: getAverage(triageConsultation),
34582
+ period: "Mins"
34583
+ }, {
34584
+ label: "Overall Waiting",
34585
+ data: overall,
34586
+ fill: false,
34587
+ borderColor: "rgb(255, 99, 132)",
34588
+ time: getAverage(overall),
34589
+ period: "Mins"
34590
+ }];
34591
+ return {
34592
+ labels: ["10 AM", "11 AM", "01 PM", "03 PM", "05 PM", "07 PM"],
34593
+ datasets: datasets
34594
+ };
34595
+ }
34596
+ }];
34597
+
34598
+ var getAverage = function getAverage() {
34599
+ var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
34600
+
34601
+ if (arr.length === 0) {
34602
+ return 0;
34603
+ }
34604
+
34605
+ var sum = arr.reduce(function (a, b) {
34606
+ return a + b;
34607
+ }, 0);
34608
+ var avg = sum / arr.length;
34609
+ return avg.toFixed(2);
34610
+ };
34611
+
34612
+ var actionInfo$2 = {};
34613
+ var initalState$2 = {};
34614
+ var extraReducers$2 = {};
34615
+ config$2.forEach(function (c) {
34616
+ initalState$2[c.sliceName] = _objectSpread2({}, defaultState[c.type]);
34617
+ actionInfo$2[c.name] = createAsyncThunk("orderMasterSlice/".concat(c.sliceName), /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
34618
+ var payload,
34619
+ _ref2,
34620
+ rejectWithValue,
34621
+ getState,
34622
+ body,
34623
+ data,
34624
+ returnData,
34625
+ _args = arguments;
34626
+
34627
+ return regeneratorRuntime.wrap(function _callee$(_context) {
34628
+ while (1) {
34629
+ switch (_context.prev = _context.next) {
34630
+ case 0:
34631
+ payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
34632
+ _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue, getState = _ref2.getState;
34633
+
34634
+ if (!c.customFn) {
34635
+ _context.next = 4;
34636
+ break;
34637
+ }
34638
+
34639
+ return _context.abrupt("return", c.customFn(payload, {
34640
+ rejectWithValue: rejectWithValue,
34641
+ getState: getState
34642
+ }));
34643
+
34644
+ case 4:
34645
+ _context.prev = 4;
34646
+ body = queries$9[c.queryName || c.sliceName](c.makePayload ? c.makePayload(payload) : payload);
34647
+ _context.next = 8;
34648
+ return fetchData$1({
34649
+ body: JSON.stringify(body)
34650
+ }, c.url);
34651
+
34652
+ case 8:
34653
+ data = _context.sent;
34654
+ returnData = c.makeReturnData ? c.makeReturnData(data) : data;
34655
+ return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState[c.type]), {}, {
34656
+ data: returnData
34657
+ }));
34658
+
34659
+ case 13:
34660
+ _context.prev = 13;
34661
+ _context.t0 = _context["catch"](4);
34662
+ return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
34663
+ message: _context.t0.message
34664
+ })));
34665
+
34666
+ case 16:
34667
+ case "end":
34668
+ return _context.stop();
34669
+ }
34670
+ }
34671
+ }, _callee, null, [[4, 13]]);
34672
+ })));
34673
+
34674
+ extraReducers$2[actionInfo$2[c.name].fulfilled] = function (state, action) {
34675
+ state[c.sliceName] = (action === null || action === void 0 ? void 0 : action.payload) ? action === null || action === void 0 ? void 0 : action.payload : c.type === 'List' ? [] : {};
34676
+ };
34677
+
34678
+ extraReducers$2[actionInfo$2[c.name].pending] = function (state, action) {
34679
+ state[c.sliceName].loading = true;
34680
+ };
34681
+
34682
+ extraReducers$2[actionInfo$2[c.name].rejected] = function (state, action) {
34683
+ state[c.sliceName] = (action === null || action === void 0 ? void 0 : action.payload) ? action === null || action === void 0 ? void 0 : action.payload : c.type === 'List' ? [] : {};
34684
+ };
34685
+ });
34686
+ var avgTimeSlice = createSlice({
34687
+ name: "avgTimeSlice",
34688
+ initialState: _objectSpread2({}, initalState$2),
34689
+ extraReducers: _objectSpread2({}, extraReducers$2)
34690
+ });
34691
+
34692
+ var avgTimeActions = _objectSpread2({}, actionInfo$2);
34693
+ var avgTimeSlice$1 = avgTimeSlice.reducer;
34694
+
34695
+ var highPriorityQueveQueries = {
34696
+ priorityDropDown: function priorityDropDown() {
34697
+ return {
34698
+ db_name: dbName,
34699
+ entity: "CodeableConceptMaster",
34700
+ filter: "CodeableConceptMaster.Type=='ENCOUNTERPRIORITY' AND CodeableConceptMaster.activestatus==true",
34701
+ return_fields: "MERGE(CodeableConceptMaster,{coding:(FOR cod IN TO_ARRAY(CodeableConceptMaster.coding) RETURN DOCUMENT(cod))})"
34702
+ };
34703
+ },
34704
+ reasonDropDown: function reasonDropDown() {
34705
+ return {
34706
+ db_name: dbName,
34707
+ entity: "ReasonMaster",
34708
+ filter: "ReasonMaster.activestatus==true",
34709
+ return_fields: "{_id:ReasonMaster._id,key:ReasonMaster._key,id:ReasonMaster.id,ReasonCode:ReasonMaster.ReasonCode,ReasonDesc:ReasonMaster.ReasonDesc}"
34710
+ };
34711
+ }
34712
+ };
34713
+ var updateHighPriority = function updateHighPriority(data, _key) {
34714
+ var _data$priority, _data$priorityreason;
34715
+
34716
+ return [{
34717
+ db_name: dbName,
34718
+ filter: {
34719
+ _key: "".concat(_key)
34720
+ },
34721
+ entity: "Encounter",
34722
+ is_metadata: true,
34723
+ metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd",
34724
+ doc: {
34725
+ "priority": (_data$priority = data === null || data === void 0 ? void 0 : data.priority) !== null && _data$priority !== void 0 ? _data$priority : "",
34726
+ "priorityreason": (_data$priorityreason = data === null || data === void 0 ? void 0 : data.priorityreason) !== null && _data$priorityreason !== void 0 ? _data$priorityreason : ""
34727
+ }
34728
+ }];
34729
+ };
34730
+
34731
+ var _extraReducers$x;
34732
+ var PRIORITY_DROPDOWN = createAsyncThunk("highPriorityApiSlice/priorityDropDown", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
34733
+ var payload,
34734
+ _ref2,
34735
+ rejectWithValue,
34736
+ data,
34737
+ obj,
34738
+ _args = arguments;
34739
+
34740
+ return regeneratorRuntime.wrap(function _callee$(_context) {
34741
+ while (1) {
34742
+ switch (_context.prev = _context.next) {
34743
+ case 0:
34744
+ payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
34745
+ _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
34746
+ _context.prev = 2;
34747
+ _context.next = 5;
34748
+ return fetchData$1({
34749
+ body: JSON.stringify(highPriorityQueveQueries.priorityDropDown())
34750
+ }, __readDocumentUrl__);
34751
+
34752
+ case 5:
34753
+ data = _context.sent;
34754
+ obj = [];
34755
+ data.result.map(function (val) {
34756
+ var _val$coding$, _val$coding$2;
34757
+
34758
+ obj.push({
34759
+ value: val === null || val === void 0 ? void 0 : (_val$coding$ = val.coding[0]) === null || _val$coding$ === void 0 ? void 0 : _val$coding$.display,
34760
+ label: val === null || val === void 0 ? void 0 : (_val$coding$2 = val.coding[0]) === null || _val$coding$2 === void 0 ? void 0 : _val$coding$2._id
34761
+ });
34762
+ });
34763
+ return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
34764
+ data: obj
34765
+ }));
34766
+
34767
+ case 11:
34768
+ _context.prev = 11;
34769
+ _context.t0 = _context["catch"](2);
34770
+ return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
34771
+ message: _context.t0.message
34772
+ })));
34773
+
34774
+ case 14:
34775
+ case "end":
34776
+ return _context.stop();
34777
+ }
34778
+ }
34779
+ }, _callee, null, [[2, 11]]);
34780
+ })));
34781
+ var PRIORITY_REASON_DROPDOWN = createAsyncThunk("highPriorityApiSlice/priorityReasonDropDown", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
34782
+ var payload,
34783
+ _ref4,
34784
+ rejectWithValue,
34785
+ data,
34786
+ obj,
34787
+ _args2 = arguments;
34788
+
34789
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
34790
+ while (1) {
34791
+ switch (_context2.prev = _context2.next) {
34792
+ case 0:
34793
+ payload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
34794
+ _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
34795
+ _context2.prev = 2;
34796
+ _context2.next = 5;
34797
+ return fetchData$1({
34798
+ body: JSON.stringify(highPriorityQueveQueries.reasonDropDown())
34799
+ }, __readDocumentUrl__);
34800
+
34801
+ case 5:
34802
+ data = _context2.sent;
34803
+ obj = [];
34804
+ data.result.map(function (val) {
34805
+ obj.push({
34806
+ value: val === null || val === void 0 ? void 0 : val.ReasonDesc,
34807
+ label: val === null || val === void 0 ? void 0 : val._id
34808
+ });
34809
+ });
34810
+ return _context2.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
34811
+ data: obj
34812
+ }));
34813
+
34814
+ case 11:
34815
+ _context2.prev = 11;
34816
+ _context2.t0 = _context2["catch"](2);
34817
+ return _context2.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
34818
+ message: _context2.t0.message
34819
+ })));
34820
+
34821
+ case 14:
34822
+ case "end":
34823
+ return _context2.stop();
34824
+ }
34825
+ }
34826
+ }, _callee2, null, [[2, 11]]);
34827
+ })));
34828
+ var UPSERT_PRIORITIES = createAsyncThunk("highPriorityApiSlice/upsert_priorities", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
34829
+ var payload,
34830
+ _ref6,
34831
+ rejectWithValue,
34832
+ list,
34833
+ _key,
34834
+ queriesjson,
34835
+ data,
34836
+ _args3 = arguments;
34837
+
34838
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
34839
+ while (1) {
34840
+ switch (_context3.prev = _context3.next) {
34841
+ case 0:
34842
+ payload = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
34843
+ _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue;
34844
+ _context3.prev = 2;
34845
+ list = payload.list, _key = payload._key;
34846
+ queriesjson = updateHighPriority(list, _key); // return
34847
+
34848
+ console.log("recieved", list);
34849
+ _context3.next = 8;
34850
+ return fetchData$1({
34851
+ body: JSON.stringify(queriesjson)
34852
+ }, __uspsertUrl__);
34853
+
34854
+ case 8:
34855
+ data = _context3.sent;
34856
+ return _context3.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
34857
+ data: data
34858
+ }));
34859
+
34860
+ case 12:
34861
+ _context3.prev = 12;
34862
+ _context3.t0 = _context3["catch"](2);
34863
+ return _context3.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
34864
+ message: _context3.t0.message
34865
+ })));
34866
+
34867
+ case 15:
34868
+ case "end":
34869
+ return _context3.stop();
34870
+ }
34871
+ }
34872
+ }, _callee3, null, [[2, 12]]);
34873
+ })));
34874
+ var highPriorityApiSlice = createSlice({
34875
+ name: "highPriorityApiSlice",
34876
+ initialState: {
34877
+ priority_dropdown: _objectSpread2({}, defaultState.Info),
34878
+ reason_dropdown: _objectSpread2({}, defaultState.Info),
34879
+ upsert_priorities: _objectSpread2({}, defaultState.Info)
34880
+ },
34881
+ extraReducers: (_extraReducers$x = {}, _defineProperty(_extraReducers$x, PRIORITY_DROPDOWN.fulfilled, function (state, action) {
34882
+ var _action$payload;
34883
+
34884
+ state.priority_dropdown = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
34885
+ }), _defineProperty(_extraReducers$x, PRIORITY_DROPDOWN.pending, function (state, action) {
34886
+ state.priority_dropdown.loading = true;
34887
+ }), _defineProperty(_extraReducers$x, PRIORITY_DROPDOWN.rejected, function (state, action) {
34888
+ var _action$payload2;
34889
+
34890
+ state.priority_dropdown = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
34891
+ }), _defineProperty(_extraReducers$x, PRIORITY_REASON_DROPDOWN.fulfilled, function (state, action) {
34892
+ var _action$payload3;
34893
+
34894
+ state.reason_dropdown = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
34895
+ }), _defineProperty(_extraReducers$x, PRIORITY_REASON_DROPDOWN.pending, function (state, action) {
34896
+ state.reason_dropdown.loading = true;
34897
+ }), _defineProperty(_extraReducers$x, PRIORITY_REASON_DROPDOWN.rejected, function (state, action) {
34898
+ var _action$payload4;
34899
+
34900
+ state.reason_dropdown = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
34901
+ }), _defineProperty(_extraReducers$x, UPSERT_PRIORITIES.fulfilled, function (state, action) {
34902
+ var _action$payload5;
34903
+
34904
+ state.upsert_priorities = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
34905
+ }), _defineProperty(_extraReducers$x, UPSERT_PRIORITIES.pending, function (state, action) {
34906
+ state.upsert_priorities.loading = true;
34907
+ }), _defineProperty(_extraReducers$x, UPSERT_PRIORITIES.rejected, function (state, action) {
34908
+ var _action$payload6;
34909
+
34910
+ state.upsert_priorities = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
34911
+ }), _extraReducers$x)
34912
+ }); // PRIORITY_DROPDOWN ACTION LISTS
34913
+
34914
+ var highPriorityActions = {
34915
+ PRIORITY_DROPDOWN: PRIORITY_DROPDOWN,
34916
+ PRIORITY_REASON_DROPDOWN: PRIORITY_REASON_DROPDOWN,
34917
+ UPSERT_PRIORITIES: UPSERT_PRIORITIES
34918
+ };
34919
+ var highPriorityApiSlice$1 = highPriorityApiSlice.reducer;
34920
+
34921
+ var query = {
34922
+ getAppointments: function getAppointments(data) {
34923
+ return "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"HealthcareService,Appointment\",\n \"filter\": {\n \"HealthcareService\": \"HealthcareService.OrgID == 2\",\n \"Appointment\": \"Appointment.HealthcareServiceID[*] ANY == HealthcareService.id && Appointment.start >= 1624725000 && Appointment.end <= 1624726800\"\n },\n \"return_fields\": \"merge(Appointment,{HealthcareServiceID:HealthcareService},{SpecialtyID: (for c in CodeableConceptMaster filter c.id IN Appointment.SpecialtyID return merge(c,{coding:(for cod in CodingMaster filter cod._id in c.coding return cod.display)}))},{PersonID:(for p in Person filter p.Id IN Appointment.PersonID return document(p.name))},{practitionerID: (for q in Practitioner filter q.id IN Appointment.practitionerID return document(q.name))})\"\n }");
34924
+ },
34925
+ getFirstVisits: function getFirstVisits(data) {
34926
+ return "\n {\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"HealthcareService,Appointment\",\n \"filter\": {\n \"HealthcareService\": \"HealthcareService.OrgID == 2\",\n \"Appointment\": \"Appointment.HealthcareServiceID[*] ANY == HealthcareService.id && Appointment.start >= 1624725000 && Appointment.end <= 1624726800 && Appointment.appointmentType == 'first visit'\"\n },\n \"return_fields\": \"merge(Appointment,{HealthcareServiceID:HealthcareService},{SpecialtyID: (for c in CodeableConceptMaster filter c.id IN Appointment.SpecialtyID return merge(c,{coding:(for cod in CodingMaster filter cod._id in c.coding return cod.display)}))},{PersonID:(for p in Person filter p.Id IN Appointment.PersonID return document(p.name))},{practitionerID: (for q in Practitioner filter q.id IN Appointment.practitionerID return document(q.name))})\"\n }\n ");
34927
+ },
34928
+ getOtherVisits: function getOtherVisits(data) {
34929
+ return "\n {\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"HealthcareService,Appointment\",\n \"filter\": {\n \"HealthcareService\": \"HealthcareService.OrgID == 2\",\n \"Appointment\": \"Appointment.HealthcareServiceID[*] ANY == HealthcareService.id && Appointment.start >= 1624725000 && Appointment.end <= 1624726800 && Appointment.appointmentType != 'walkin' && Appointment.appointmentType != 'first visit' && Appointment.appointmentType != 'new patient'\"\n },\n \"return_fields\": \"merge(Appointment,{HealthcareServiceID:HealthcareService},{SpecialtyID: (for c in CodeableConceptMaster filter c.id IN Appointment.SpecialtyID return merge(c,{coding:(for cod in CodingMaster filter cod._id in c.coding return cod.display)}))},{PersonID:(for p in Person filter p.Id IN Appointment.PersonID return document(p.name))},{practitionerID: (for q in Practitioner filter q.id IN Appointment.practitionerID return document(q.name))})\"\n }\n ");
34930
+ },
34931
+ getWalkIns: function getWalkIns(data) {
34932
+ return "\n {\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"HealthcareService,Appointment\",\n \"filter\": {\n \"HealthcareService\": \"HealthcareService.OrgID == 2\",\n \"Appointment\": \"Appointment.HealthcareServiceID[*] ANY == HealthcareService.id && Appointment.start >= 1624725000 && Appointment.end <= 1624726800 && Appointment.appointmentType == 'walkin'\"\n },\n \"return_fields\": \"merge(Appointment,{HealthcareServiceID:HealthcareService},{SpecialtyID: (for c in CodeableConceptMaster filter c.id IN Appointment.SpecialtyID return merge(c,{coding:(for cod in CodingMaster filter cod._id in c.coding return cod.display)}))},{PersonID:(for p in Person filter p.Id IN Appointment.PersonID return document(p.name))},{practitionerID: (for q in Practitioner filter q.id IN Appointment.practitionerID return document(q.name))})\"\n }\n ");
34933
+ },
34934
+ getNewPatients: function getNewPatients(data) {
34935
+ return "\n {\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"HealthcareService,Appointment\",\n \"filter\": {\n \"HealthcareService\": \"HealthcareService.OrgID == 2\",\n \"Appointment\": \"Appointment.HealthcareServiceID[*] ANY == HealthcareService.id && Appointment.start >= 1624725000 && Appointment.end <= 1624726800 && Appointment.appointmentType == 'new patient'\"\n },\n \"return_fields\": \"merge(Appointment,{HealthcareServiceID:HealthcareService},{SpecialtyID: (for c in CodeableConceptMaster filter c.id IN Appointment.SpecialtyID return merge(c,{coding:(for cod in CodingMaster filter cod._id in c.coding return cod.display)}))},{PersonID:(for p in Person filter p.Id IN Appointment.PersonID return document(p.name))},{practitionerID: (for q in Practitioner filter q.id IN Appointment.practitionerID return document(q.name))})\"\n }\n ");
34936
+ }
34937
+ };
34938
+
34939
+ var _extraReducers$y;
34940
+ var GET_APPOINTMENTS = createAsyncThunk("dashboardComponentApiSlice/getAppointments", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
34941
+ var payload,
34942
+ _ref2,
34943
+ rejectWithValue,
34944
+ _data$result,
34945
+ data,
34946
+ returnedData,
34947
+ _args = arguments;
34948
+
34949
+ return regeneratorRuntime.wrap(function _callee$(_context) {
34950
+ while (1) {
34951
+ switch (_context.prev = _context.next) {
34952
+ case 0:
34953
+ payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
34954
+ _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
34955
+ _context.prev = 2;
34956
+ _context.next = 5;
32893
34957
  return fetchData$1({
32894
- body: JSON.stringify(body)
32895
- }, __uspsertUrl__);
34958
+ body: query.getAppointments()
34959
+ }, __readDocumentUrl__);
32896
34960
 
32897
- case 13:
32898
- res = _context.sent;
34961
+ case 5:
34962
+ data = _context.sent;
34963
+ returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result = data.result) === null || _data$result === void 0 ? void 0 : _data$result.map(function (_) {
34964
+ var _$PersonID, _$PersonID$, _$PersonID$$, _$SpecialtyID$;
34965
+
34966
+ return {
34967
+ "img": 'https://www.fillmurray.com/640/360',
34968
+ "name": _ === null || _ === void 0 ? void 0 : (_$PersonID = _.PersonID) === null || _$PersonID === void 0 ? void 0 : (_$PersonID$ = _$PersonID[0]) === null || _$PersonID$ === void 0 ? void 0 : (_$PersonID$$ = _$PersonID$[0]) === null || _$PersonID$$ === void 0 ? void 0 : _$PersonID$$.text,
34969
+ "mrn": 'MRN',
34970
+ "date": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('DD MMM,YYYY') : '',
34971
+ "time": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('hh:mm A') : '',
34972
+ "speciality": _ === null || _ === void 0 ? void 0 : (_$SpecialtyID$ = _.SpecialtyID[0]) === null || _$SpecialtyID$ === void 0 ? void 0 : _$SpecialtyID$.text,
34973
+ "clinic": 'Clinic',
34974
+ "dob": 'Dob',
34975
+ "contact": 'Contact',
34976
+ "visitType": _ === null || _ === void 0 ? void 0 : _.appointmentType,
34977
+ "appointmentStatus": 'Status',
34978
+ "Register Visit": true,
34979
+ "Modify Appointment": true,
34980
+ "Cancel Appointment": true,
34981
+ "View Profile": true
34982
+ };
34983
+ }) : [];
32899
34984
  return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
32900
- data: res
34985
+ data: returnedData
32901
34986
  }));
32902
34987
 
32903
- case 17:
32904
- _context.prev = 17;
34988
+ case 10:
34989
+ _context.prev = 10;
32905
34990
  _context.t0 = _context["catch"](2);
32906
34991
  return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
32907
34992
  message: _context.t0.message
32908
34993
  })));
32909
34994
 
32910
- case 20:
34995
+ case 13:
32911
34996
  case "end":
32912
34997
  return _context.stop();
32913
34998
  }
32914
34999
  }
32915
- }, _callee, null, [[2, 17]]);
35000
+ }, _callee, null, [[2, 10]]);
32916
35001
  })));
32917
- var DOCC_CATE_READ = createAsyncThunk("DoccSlice/docc_cat_read", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
35002
+ var GET_FIRST_VISITS = createAsyncThunk("dashboardComponentApiSlice/getFirstVisits", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
32918
35003
  var payload,
32919
35004
  _ref4,
32920
35005
  rejectWithValue,
32921
- getState,
32922
- docc_read,
35006
+ _data$result2,
32923
35007
  data,
32924
- arr,
35008
+ returnedData,
32925
35009
  _args2 = arguments;
32926
35010
 
32927
35011
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -32929,59 +35013,61 @@ var DOCC_CATE_READ = createAsyncThunk("DoccSlice/docc_cat_read", /*#__PURE__*/_a
32929
35013
  switch (_context2.prev = _context2.next) {
32930
35014
  case 0:
32931
35015
  payload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
32932
- _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue, getState = _ref4.getState;
35016
+ _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
32933
35017
  _context2.prev = 2;
32934
- docc_read = {
32935
- "db_name": dbName,
32936
- "entity": "CodeableConceptMaster",
32937
- "filter": "CodeableConceptMaster.Type=='DOCCATEGORY' && CodeableConceptMaster.activestatus==true",
32938
- "return_fields": "MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})"
32939
- };
32940
- _context2.next = 6;
35018
+ _context2.next = 5;
32941
35019
  return fetchData$1({
32942
- body: JSON.stringify(docc_read)
35020
+ body: query.getFirstVisits()
32943
35021
  }, __readDocumentUrl__);
32944
35022
 
32945
- case 6:
35023
+ case 5:
32946
35024
  data = _context2.sent;
32947
- arr = [];
32948
- data.result.map(function (v) {
32949
- var _v$coding$0$display, _v$coding, _v$coding$, _v$coding$0$Type, _v$coding2, _v$coding2$, _v$coding$0$_id, _v$coding3, _v$coding3$, _v$_id;
35025
+ returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result2 = data.result) === null || _data$result2 === void 0 ? void 0 : _data$result2.map(function (_) {
35026
+ var _$PersonID2, _$PersonID2$, _$PersonID2$$, _$SpecialtyID$2;
32950
35027
 
32951
- arr.push({
32952
- label: (_v$coding$0$display = v === null || v === void 0 ? void 0 : (_v$coding = v.coding) === null || _v$coding === void 0 ? void 0 : (_v$coding$ = _v$coding[0]) === null || _v$coding$ === void 0 ? void 0 : _v$coding$.display) !== null && _v$coding$0$display !== void 0 ? _v$coding$0$display : '',
32953
- value: (_v$coding$0$Type = v === null || v === void 0 ? void 0 : (_v$coding2 = v.coding) === null || _v$coding2 === void 0 ? void 0 : (_v$coding2$ = _v$coding2[0]) === null || _v$coding2$ === void 0 ? void 0 : _v$coding2$.Type) !== null && _v$coding$0$Type !== void 0 ? _v$coding$0$Type : '',
32954
- _id: (_v$coding$0$_id = v === null || v === void 0 ? void 0 : (_v$coding3 = v.coding) === null || _v$coding3 === void 0 ? void 0 : (_v$coding3$ = _v$coding3[0]) === null || _v$coding3$ === void 0 ? void 0 : _v$coding3$._id) !== null && _v$coding$0$_id !== void 0 ? _v$coding$0$_id : '',
32955
- __id: (_v$_id = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id !== void 0 ? _v$_id : ''
32956
- });
32957
- });
35028
+ return {
35029
+ "img": 'https://www.fillmurray.com/640/360',
35030
+ "name": _ === null || _ === void 0 ? void 0 : (_$PersonID2 = _.PersonID) === null || _$PersonID2 === void 0 ? void 0 : (_$PersonID2$ = _$PersonID2[0]) === null || _$PersonID2$ === void 0 ? void 0 : (_$PersonID2$$ = _$PersonID2$[0]) === null || _$PersonID2$$ === void 0 ? void 0 : _$PersonID2$$.text,
35031
+ "mrn": 'MRN',
35032
+ "date": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('DD MMM,YYYY') : '',
35033
+ "time": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('hh:mm A') : '',
35034
+ "speciality": _ === null || _ === void 0 ? void 0 : (_$SpecialtyID$2 = _.SpecialtyID[0]) === null || _$SpecialtyID$2 === void 0 ? void 0 : _$SpecialtyID$2.text,
35035
+ "clinic": 'Clinic',
35036
+ "dob": 'Dob',
35037
+ "contact": 'Contact',
35038
+ "visitType": _ === null || _ === void 0 ? void 0 : _.appointmentType,
35039
+ "appointmentStatus": 'Status',
35040
+ "Register Visit": true,
35041
+ "Modify Appointment": true,
35042
+ "Cancel Appointment": true,
35043
+ "View Profile": true
35044
+ };
35045
+ }) : [];
32958
35046
  return _context2.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
32959
- data: arr
35047
+ data: returnedData
32960
35048
  }));
32961
35049
 
32962
- case 12:
32963
- _context2.prev = 12;
35050
+ case 10:
35051
+ _context2.prev = 10;
32964
35052
  _context2.t0 = _context2["catch"](2);
32965
35053
  return _context2.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
32966
35054
  message: _context2.t0.message
32967
35055
  })));
32968
35056
 
32969
- case 15:
35057
+ case 13:
32970
35058
  case "end":
32971
35059
  return _context2.stop();
32972
35060
  }
32973
35061
  }
32974
- }, _callee2, null, [[2, 12]]);
35062
+ }, _callee2, null, [[2, 10]]);
32975
35063
  })));
32976
- var DOCC_DOCC_READ = createAsyncThunk("DoccSlice/docc_docc_read", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
35064
+ var GET_OTHER_VISITS = createAsyncThunk("dashboardComponentApiSlice/getOtherVisits", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
32977
35065
  var payload,
32978
35066
  _ref6,
32979
35067
  rejectWithValue,
32980
- getState,
32981
- id,
32982
- docc_docc_read,
35068
+ _data$result3,
32983
35069
  data,
32984
- arr,
35070
+ returnedData,
32985
35071
  _args3 = arguments;
32986
35072
 
32987
35073
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -32989,60 +35075,61 @@ var DOCC_DOCC_READ = createAsyncThunk("DoccSlice/docc_docc_read", /*#__PURE__*/_
32989
35075
  switch (_context3.prev = _context3.next) {
32990
35076
  case 0:
32991
35077
  payload = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
32992
- _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue, getState = _ref6.getState;
35078
+ _ref6 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref6.rejectWithValue;
32993
35079
  _context3.prev = 2;
32994
- id = payload.id;
32995
- docc_docc_read = {
32996
- "db_name": "primarycare",
32997
- "entity": "CA_ClinicalDocumenttype",
32998
- "filter": "CA_ClinicalDocumenttype.doccategory=='".concat(id, "' && CA_ClinicalDocumenttype.activestatus==true"),
32999
- "return_fields": "{id:CA_ClinicalDocumenttype.id, _id:CA_ClinicalDocumenttype._id,docname:CA_ClinicalDocumenttype.docname,doccategory:CA_ClinicalDocumenttype.doccategory, formrefid:CA_ClinicalDocumenttype.formrefid}"
33000
- };
33001
- _context3.next = 7;
35080
+ _context3.next = 5;
33002
35081
  return fetchData$1({
33003
- body: JSON.stringify(docc_docc_read)
35082
+ body: query.getOtherVisits()
33004
35083
  }, __readDocumentUrl__);
33005
35084
 
33006
- case 7:
35085
+ case 5:
33007
35086
  data = _context3.sent;
33008
- arr = []; // console.log( data.result)
33009
-
33010
- data.result.map(function (v) {
33011
- var _v$docname, _v$doccategory, _v$formrefid, _v$_id2;
35087
+ returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result3 = data.result) === null || _data$result3 === void 0 ? void 0 : _data$result3.map(function (_) {
35088
+ var _$PersonID3, _$PersonID3$, _$PersonID3$$, _$SpecialtyID$3, _$appointmentType;
33012
35089
 
33013
- arr.push({
33014
- label: (_v$docname = v === null || v === void 0 ? void 0 : v.docname) !== null && _v$docname !== void 0 ? _v$docname : '',
33015
- value: (_v$doccategory = v === null || v === void 0 ? void 0 : v.doccategory) !== null && _v$doccategory !== void 0 ? _v$doccategory : '',
33016
- formrefid: (_v$formrefid = v === null || v === void 0 ? void 0 : v.formrefid) !== null && _v$formrefid !== void 0 ? _v$formrefid : '',
33017
- _id: (_v$_id2 = v === null || v === void 0 ? void 0 : v._id) !== null && _v$_id2 !== void 0 ? _v$_id2 : ''
33018
- });
33019
- });
35090
+ return {
35091
+ "img": 'https://www.fillmurray.com/640/360',
35092
+ "name": _ === null || _ === void 0 ? void 0 : (_$PersonID3 = _.PersonID) === null || _$PersonID3 === void 0 ? void 0 : (_$PersonID3$ = _$PersonID3[0]) === null || _$PersonID3$ === void 0 ? void 0 : (_$PersonID3$$ = _$PersonID3$[0]) === null || _$PersonID3$$ === void 0 ? void 0 : _$PersonID3$$.text,
35093
+ "mrn": 'MRN',
35094
+ "date": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('DD MMM,YYYY') : '',
35095
+ "time": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('hh:mm A') : '',
35096
+ "speciality": _ === null || _ === void 0 ? void 0 : (_$SpecialtyID$3 = _.SpecialtyID[0]) === null || _$SpecialtyID$3 === void 0 ? void 0 : _$SpecialtyID$3.text,
35097
+ "clinic": 'Clinic',
35098
+ "dob": 'Dob',
35099
+ "contact": 'Contact',
35100
+ "visitType": (_$appointmentType = _ === null || _ === void 0 ? void 0 : _.appointmentType) !== null && _$appointmentType !== void 0 ? _$appointmentType : '',
35101
+ "appointmentStatus": 'Status',
35102
+ "Register Visit": true,
35103
+ "Modify Appointment": true,
35104
+ "Cancel Appointment": true,
35105
+ "View Profile": true
35106
+ };
35107
+ }) : [];
33020
35108
  return _context3.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33021
- data: arr
35109
+ data: returnedData
33022
35110
  }));
33023
35111
 
33024
- case 13:
33025
- _context3.prev = 13;
35112
+ case 10:
35113
+ _context3.prev = 10;
33026
35114
  _context3.t0 = _context3["catch"](2);
33027
35115
  return _context3.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33028
35116
  message: _context3.t0.message
33029
35117
  })));
33030
35118
 
33031
- case 16:
35119
+ case 13:
33032
35120
  case "end":
33033
35121
  return _context3.stop();
33034
35122
  }
33035
35123
  }
33036
- }, _callee3, null, [[2, 13]]);
35124
+ }, _callee3, null, [[2, 10]]);
33037
35125
  })));
33038
- var DOCC_READ = createAsyncThunk("DoccSlice/docc_read", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
35126
+ var GET_WALK_INS = createAsyncThunk("dashboardComponentApiSlice/getWalkIns", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
33039
35127
  var payload,
33040
35128
  _ref8,
33041
35129
  rejectWithValue,
33042
- getState,
33043
- _docc_read,
33044
- docc_read,
35130
+ _data$result4,
33045
35131
  data,
35132
+ returnedData,
33046
35133
  _args4 = arguments;
33047
35134
 
33048
35135
  return regeneratorRuntime.wrap(function _callee4$(_context4) {
@@ -33050,20 +35137,38 @@ var DOCC_READ = createAsyncThunk("DoccSlice/docc_read", /*#__PURE__*/_asyncToGen
33050
35137
  switch (_context4.prev = _context4.next) {
33051
35138
  case 0:
33052
35139
  payload = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
33053
- _ref8 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref8.rejectWithValue, getState = _ref8.getState;
35140
+ _ref8 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref8.rejectWithValue;
33054
35141
  _context4.prev = 2;
33055
- docc_read = (_docc_read = {
33056
- "db_name": dbName
33057
- }, _defineProperty(_docc_read, "db_name", "primarycare"), _defineProperty(_docc_read, "entity", "CAPatientClinicalDocs"), _defineProperty(_docc_read, "filter", "CAPatientClinicalDocs.activestatus ==true"), _defineProperty(_docc_read, "return_fields", "MERGE(CAPatientClinicalDocs, {organizationid:document(CAPatientClinicalDocs.organizationid)},{doccategory:(document(CAPatientClinicalDocs.doccategory))}, {patientid:document(CAPatientClinicalDocs.patientid)},{practitionerid:document(CAPatientClinicalDocs.practitionerid)},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(document(CAPatientClinicalDocs.encountertype)),specialty:(document(CAPatientClinicalDocs.specialty))})"), _docc_read);
33058
- _context4.next = 6;
35142
+ _context4.next = 5;
33059
35143
  return fetchData$1({
33060
- body: JSON.stringify(docc_read)
35144
+ body: query.getWalkIns()
33061
35145
  }, __readDocumentUrl__);
33062
35146
 
33063
- case 6:
35147
+ case 5:
33064
35148
  data = _context4.sent;
35149
+ returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result4 = data.result) === null || _data$result4 === void 0 ? void 0 : _data$result4.map(function (_) {
35150
+ var _$PersonID4, _$PersonID4$, _$PersonID4$$, _$SpecialtyID$4, _$appointmentType2;
35151
+
35152
+ return {
35153
+ "img": 'https://www.fillmurray.com/640/360',
35154
+ "name": _ === null || _ === void 0 ? void 0 : (_$PersonID4 = _.PersonID) === null || _$PersonID4 === void 0 ? void 0 : (_$PersonID4$ = _$PersonID4[0]) === null || _$PersonID4$ === void 0 ? void 0 : (_$PersonID4$$ = _$PersonID4$[0]) === null || _$PersonID4$$ === void 0 ? void 0 : _$PersonID4$$.text,
35155
+ "mrn": 'MRN',
35156
+ "date": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('DD MMM,YYYY') : '',
35157
+ "time": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('hh:mm A') : '',
35158
+ "speciality": _ === null || _ === void 0 ? void 0 : (_$SpecialtyID$4 = _.SpecialtyID[0]) === null || _$SpecialtyID$4 === void 0 ? void 0 : _$SpecialtyID$4.text,
35159
+ "clinic": 'Clinic',
35160
+ "dob": 'Dob',
35161
+ "contact": 'Contact',
35162
+ "visitType": (_$appointmentType2 = _ === null || _ === void 0 ? void 0 : _.appointmentType) !== null && _$appointmentType2 !== void 0 ? _$appointmentType2 : '',
35163
+ "appointmentStatus": 'Status',
35164
+ "Register Visit": true,
35165
+ "Modify Appointment": true,
35166
+ "Cancel Appointment": true,
35167
+ "View Profile": true
35168
+ };
35169
+ }) : [];
33065
35170
  return _context4.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33066
- data: data.result
35171
+ data: returnedData
33067
35172
  }));
33068
35173
 
33069
35174
  case 10:
@@ -33080,14 +35185,13 @@ var DOCC_READ = createAsyncThunk("DoccSlice/docc_read", /*#__PURE__*/_asyncToGen
33080
35185
  }
33081
35186
  }, _callee4, null, [[2, 10]]);
33082
35187
  })));
33083
- var DOCC_SINGLE_READ = createAsyncThunk("DoccSlice/docc_single_read", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
35188
+ var GET_NEW_PATIENTS = createAsyncThunk("dashboardComponentApiSlice/getNewPatients", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
33084
35189
  var payload,
33085
35190
  _ref10,
33086
35191
  rejectWithValue,
33087
- getState,
33088
- id,
33089
- docc_read,
35192
+ _data$result5,
33090
35193
  data,
35194
+ returnedData,
33091
35195
  _args5 = arguments;
33092
35196
 
33093
35197
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
@@ -33095,184 +35199,123 @@ var DOCC_SINGLE_READ = createAsyncThunk("DoccSlice/docc_single_read", /*#__PURE_
33095
35199
  switch (_context5.prev = _context5.next) {
33096
35200
  case 0:
33097
35201
  payload = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
33098
- _ref10 = _args5.length > 1 ? _args5[1] : undefined, rejectWithValue = _ref10.rejectWithValue, getState = _ref10.getState;
35202
+ _ref10 = _args5.length > 1 ? _args5[1] : undefined, rejectWithValue = _ref10.rejectWithValue;
33099
35203
  _context5.prev = 2;
33100
- id = payload.id;
33101
- docc_read = {
33102
- "db_name": dbName,
33103
- "entity": "CAPatientClinicalDocs",
33104
- "filter": "CAPatientClinicalDocs.activestatus ==true",
33105
- "return_fields": "MERGE(CAPatientClinicalDocs, {organizationid:document(CAPatientClinicalDocs.organizationid)},{doccategory:(document(CAPatientClinicalDocs.doccategory))}, {patientid:document(CAPatientClinicalDocs.patientid)},{practitionerid:document(CAPatientClinicalDocs.practitionerid)},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(document(CAPatientClinicalDocs.encountertype)),specialty:(document(CAPatientClinicalDocs.specialty))})"
33106
- };
33107
- _context5.next = 7;
35204
+ _context5.next = 5;
33108
35205
  return fetchData$1({
33109
- body: JSON.stringify(docc_read)
35206
+ body: query.getNewPatients()
33110
35207
  }, __readDocumentUrl__);
33111
35208
 
33112
- case 7:
35209
+ case 5:
33113
35210
  data = _context5.sent;
35211
+ returnedData = (data === null || data === void 0 ? void 0 : data.result) ? data === null || data === void 0 ? void 0 : (_data$result5 = data.result) === null || _data$result5 === void 0 ? void 0 : _data$result5.map(function (_) {
35212
+ var _$PersonID5, _$PersonID5$, _$PersonID5$$, _$SpecialtyID$5, _$appointmentType3;
35213
+
35214
+ return {
35215
+ "img": 'https://www.fillmurray.com/640/360',
35216
+ "name": _ === null || _ === void 0 ? void 0 : (_$PersonID5 = _.PersonID) === null || _$PersonID5 === void 0 ? void 0 : (_$PersonID5$ = _$PersonID5[0]) === null || _$PersonID5$ === void 0 ? void 0 : (_$PersonID5$$ = _$PersonID5$[0]) === null || _$PersonID5$$ === void 0 ? void 0 : _$PersonID5$$.text,
35217
+ "mrn": 'MRN',
35218
+ "date": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('DD MMM,YYYY') : '',
35219
+ "time": (_ === null || _ === void 0 ? void 0 : _.start) ? moment.unix(_ === null || _ === void 0 ? void 0 : _.start).format('hh:mm A') : '',
35220
+ "speciality": _ === null || _ === void 0 ? void 0 : (_$SpecialtyID$5 = _.SpecialtyID[0]) === null || _$SpecialtyID$5 === void 0 ? void 0 : _$SpecialtyID$5.text,
35221
+ "clinic": 'Clinic',
35222
+ "dob": 'Dob',
35223
+ "contact": 'Contact',
35224
+ "visitType": (_$appointmentType3 = _ === null || _ === void 0 ? void 0 : _.appointmentType) !== null && _$appointmentType3 !== void 0 ? _$appointmentType3 : '',
35225
+ "appointmentStatus": 'Status',
35226
+ "Register Visit": true,
35227
+ "Modify Appointment": true,
35228
+ "Cancel Appointment": true,
35229
+ "View Profile": true
35230
+ };
35231
+ }) : [];
33114
35232
  return _context5.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33115
- data: data.result
35233
+ data: returnedData
33116
35234
  }));
33117
35235
 
33118
- case 11:
33119
- _context5.prev = 11;
35236
+ case 10:
35237
+ _context5.prev = 10;
33120
35238
  _context5.t0 = _context5["catch"](2);
33121
35239
  return _context5.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33122
35240
  message: _context5.t0.message
33123
35241
  })));
33124
35242
 
33125
- case 14:
35243
+ case 13:
33126
35244
  case "end":
33127
35245
  return _context5.stop();
33128
35246
  }
33129
35247
  }
33130
- }, _callee5, null, [[2, 11]]);
35248
+ }, _callee5, null, [[2, 10]]);
33131
35249
  })));
33132
- var DoccSlice = createSlice({
33133
- name: "DoccSlice",
35250
+ var dashboardComponentApiSlice = createSlice({
35251
+ name: "dashboardComponentApiSlice",
33134
35252
  initialState: {
33135
- docc_save: _objectSpread2({}, defaultState.Info),
33136
- docc_cat_read: _objectSpread2({}, defaultState.Info),
33137
- docc_docc_read: _objectSpread2({}, defaultState.Info),
33138
- docc_read: _objectSpread2({}, defaultState.Info),
33139
- docc_single_read: _objectSpread2({}, defaultState.Info)
35253
+ appointments: _objectSpread2({}, defaultState.Info),
35254
+ firstVisits: _objectSpread2({}, defaultState.Info),
35255
+ otherVisits: _objectSpread2({}, defaultState.Info),
35256
+ walkIns: _objectSpread2({}, defaultState.Info),
35257
+ newPatients: _objectSpread2({}, defaultState.Info)
33140
35258
  },
33141
- extraReducers: (_extraReducers$v = {}, _defineProperty(_extraReducers$v, DOCC_SAVE_SERVICE.fulfilled, function (state, action) {
33142
- var _action$payload;
35259
+ extraReducers: (_extraReducers$y = {}, _defineProperty(_extraReducers$y, GET_APPOINTMENTS.fulfilled, function (state, action) {
35260
+ var _state$appointments;
33143
35261
 
33144
- state.docc_save = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
33145
- }), _defineProperty(_extraReducers$v, DOCC_SAVE_SERVICE.pending, function (state, action) {
33146
- state.docc_save.loading = true;
33147
- }), _defineProperty(_extraReducers$v, DOCC_SAVE_SERVICE.rejected, function (state, action) {
33148
- var _action$payload2;
35262
+ state.appointments.loading = false, state.appointments.error = false, (_state$appointments = state.appointments = action.payload) !== null && _state$appointments !== void 0 ? _state$appointments : {};
35263
+ }), _defineProperty(_extraReducers$y, GET_APPOINTMENTS.pending, function (state, action) {
35264
+ state.appointments.loading = true, state.appointments.error = false, state.appointments.loading = true;
35265
+ }), _defineProperty(_extraReducers$y, GET_APPOINTMENTS.rejected, function (state, action) {
35266
+ var _action$payload;
33149
35267
 
33150
- state.docc_save = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
33151
- }), _defineProperty(_extraReducers$v, DOCC_CATE_READ.fulfilled, function (state, action) {
33152
- var _action$payload3;
35268
+ state.appointments.loading = false, state.appointments.error = true, state.appointments = (_action$payload = action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
35269
+ }), _defineProperty(_extraReducers$y, GET_FIRST_VISITS.fulfilled, function (state, action) {
35270
+ var _state$firstVisits;
33153
35271
 
33154
- state.docc_cat_read = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
33155
- }), _defineProperty(_extraReducers$v, DOCC_CATE_READ.pending, function (state, action) {
33156
- state.docc_cat_read.loading = true;
33157
- }), _defineProperty(_extraReducers$v, DOCC_CATE_READ.rejected, function (state, action) {
33158
- var _action$payload4;
35272
+ state.firstVisits.loading = false, state.firstVisits.error = false, (_state$firstVisits = state.firstVisits = action.payload) !== null && _state$firstVisits !== void 0 ? _state$firstVisits : {};
35273
+ }), _defineProperty(_extraReducers$y, GET_FIRST_VISITS.pending, function (state, action) {
35274
+ state.firstVisits.loading = true, state.firstVisits.error = false, state.firstVisits.loading = true;
35275
+ }), _defineProperty(_extraReducers$y, GET_FIRST_VISITS.rejected, function (state, action) {
35276
+ var _action$payload2;
33159
35277
 
33160
- state.docc_cat_read = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
33161
- }), _defineProperty(_extraReducers$v, DOCC_DOCC_READ.fulfilled, function (state, action) {
33162
- var _action$payload5;
35278
+ state.firstVisits.loading = false, state.firstVisits.error = true, state.firstVisits = (_action$payload2 = action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
35279
+ }), _defineProperty(_extraReducers$y, GET_OTHER_VISITS.fulfilled, function (state, action) {
35280
+ var _state$otherVisits;
33163
35281
 
33164
- state.docc_docc_read = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
33165
- }), _defineProperty(_extraReducers$v, DOCC_DOCC_READ.pending, function (state, action) {
33166
- state.docc_docc_read.loading = true;
33167
- }), _defineProperty(_extraReducers$v, DOCC_DOCC_READ.rejected, function (state, action) {
33168
- var _action$payload6;
35282
+ state.otherVisits.loading = false, state.otherVisits.error = false, (_state$otherVisits = state.otherVisits = action.payload) !== null && _state$otherVisits !== void 0 ? _state$otherVisits : {};
35283
+ }), _defineProperty(_extraReducers$y, GET_OTHER_VISITS.pending, function (state, action) {
35284
+ state.otherVisits.loading = true, state.otherVisits.error = false, state.otherVisits.loading = true;
35285
+ }), _defineProperty(_extraReducers$y, GET_OTHER_VISITS.rejected, function (state, action) {
35286
+ var _action$payload3;
33169
35287
 
33170
- state.docc_docc_read = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
33171
- }), _defineProperty(_extraReducers$v, DOCC_READ.fulfilled, function (state, action) {
33172
- var _action$payload7;
35288
+ state.otherVisits.loading = false, state.otherVisits.error = true, state.otherVisits = (_action$payload3 = action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
35289
+ }), _defineProperty(_extraReducers$y, GET_WALK_INS.fulfilled, function (state, action) {
35290
+ var _state$walkIns;
33173
35291
 
33174
- state.docc_read = (_action$payload7 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload7 !== void 0 ? _action$payload7 : {};
33175
- }), _defineProperty(_extraReducers$v, DOCC_READ.pending, function (state, action) {
33176
- state.docc_read.loading = true;
33177
- }), _defineProperty(_extraReducers$v, DOCC_READ.rejected, function (state, action) {
33178
- var _action$payload8;
35292
+ state.walkIns.loading = false, state.walkIns.error = false, (_state$walkIns = state.walkIns = action.payload) !== null && _state$walkIns !== void 0 ? _state$walkIns : {};
35293
+ }), _defineProperty(_extraReducers$y, GET_WALK_INS.pending, function (state, action) {
35294
+ state.walkIns.loading = true, state.walkIns.error = false, state.walkIns.loading = true;
35295
+ }), _defineProperty(_extraReducers$y, GET_WALK_INS.rejected, function (state, action) {
35296
+ var _action$payload4;
33179
35297
 
33180
- state.docc_read = (_action$payload8 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload8 !== void 0 ? _action$payload8 : {};
33181
- }), _defineProperty(_extraReducers$v, DOCC_SINGLE_READ.fulfilled, function (state, action) {
33182
- var _action$payload9;
35298
+ state.walkIns.loading = false, state.walkIns.error = true, state.walkIns = (_action$payload4 = action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
35299
+ }), _defineProperty(_extraReducers$y, GET_NEW_PATIENTS.fulfilled, function (state, action) {
35300
+ var _state$newPatients;
33183
35301
 
33184
- state.docc_single_read = (_action$payload9 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload9 !== void 0 ? _action$payload9 : {};
33185
- }), _defineProperty(_extraReducers$v, DOCC_SINGLE_READ.pending, function (state, action) {
33186
- state.docc_single_read.loading = true;
33187
- }), _defineProperty(_extraReducers$v, DOCC_SINGLE_READ.rejected, function (state, action) {
33188
- var _action$payload10;
35302
+ state.newPatients.loading = false, state.newPatients.error = false, (_state$newPatients = state.newPatients = action.payload) !== null && _state$newPatients !== void 0 ? _state$newPatients : {};
35303
+ }), _defineProperty(_extraReducers$y, GET_NEW_PATIENTS.pending, function (state, action) {
35304
+ state.newPatients.loading = true, state.newPatients.error = false, state.newPatients.loading = true;
35305
+ }), _defineProperty(_extraReducers$y, GET_NEW_PATIENTS.rejected, function (state, action) {
35306
+ var _action$payload5;
33189
35307
 
33190
- state.docc_single_read = (_action$payload10 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload10 !== void 0 ? _action$payload10 : {};
33191
- }), _extraReducers$v)
35308
+ state.newPatients.loading = false, state.newPatients.error = true, state.newPatients = (_action$payload5 = action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
35309
+ }), _extraReducers$y)
33192
35310
  });
33193
- var DoccActions = {
33194
- DOCC_SAVE_SERVICE: DOCC_SAVE_SERVICE,
33195
- DOCC_CATE_READ: DOCC_CATE_READ,
33196
- DOCC_DOCC_READ: DOCC_DOCC_READ,
33197
- DOCC_READ: DOCC_READ,
33198
- DOCC_SINGLE_READ: DOCC_SINGLE_READ
33199
- };
33200
- var DoccSlice$1 = DoccSlice.reducer;
33201
-
33202
- var clinicQuery = {
33203
- readClinicData: function readClinicData() {
33204
- return {
33205
- db_name: dbName,
33206
- entity: "LocationMaster,LocationMaster_CodeableConceptMaster_E,CodeableConceptMaster_CodingMaster_E,LocationMaster_LocationRoleType_E,LocationMaster_Organization_E,Organization_CodeableConceptMaster_E,LocationMaster_ContactPointMaster_E,LocationMaster_AddressMaster_E,LocationMaster_AttachmentMaster_E",
33207
- filter: "LocationMaster.activestatus==true && LocationMaster._key=='10058'",
33208
- isTraversal: "true",
33209
- return_fields: "{vertices:v,orginatedata:LocationMaster}"
33210
- };
33211
- }
33212
- };
33213
-
33214
- var _extraReducers$w;
33215
- var READ_CLINICINFO = createAsyncThunk("clinicInfoSlice/clinicInfoRead", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
33216
- var payload,
33217
- _ref2,
33218
- rejectWithValue,
33219
- data,
33220
- _args = arguments;
33221
-
33222
- return regeneratorRuntime.wrap(function _callee$(_context) {
33223
- while (1) {
33224
- switch (_context.prev = _context.next) {
33225
- case 0:
33226
- payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
33227
- _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
33228
- _context.prev = 2;
33229
- _context.next = 5;
33230
- return fetchData$1({
33231
- body: JSON.stringify(clinicQuery.readClinicData())
33232
- }, __readDocumentUrl__);
33233
-
33234
- case 5:
33235
- data = _context.sent;
33236
- return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
33237
- data: data === null || data === void 0 ? void 0 : data.result[0]
33238
- }));
33239
-
33240
- case 9:
33241
- _context.prev = 9;
33242
- _context.t0 = _context["catch"](2);
33243
- return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
33244
- message: _context.t0.message
33245
- })));
33246
-
33247
- case 12:
33248
- case "end":
33249
- return _context.stop();
33250
- }
33251
- }
33252
- }, _callee, null, [[2, 9]]);
33253
- })));
33254
- var clinicInfoSlice = createSlice({
33255
- name: "ClinicInfoApiSlice",
33256
- initialState: {
33257
- read_clinic_info: _objectSpread2({}, defaultState.Info)
33258
- },
33259
- extraReducers: (_extraReducers$w = {}, _defineProperty(_extraReducers$w, READ_CLINICINFO.fulfilled, function (state, action) {
33260
- var _action$payload;
33261
-
33262
- state.read_clinic_info = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
33263
- }), _defineProperty(_extraReducers$w, READ_CLINICINFO.pending, function (state, action) {
33264
- state.read_clinic_info.loading = true;
33265
- }), _defineProperty(_extraReducers$w, READ_CLINICINFO.rejected, function (state, action) {
33266
- var _action$payload2;
33267
-
33268
- state.read_clinic_info = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
33269
- }), _extraReducers$w)
33270
- }); // READ_CLINICINFO ACTION LISTS
33271
-
33272
- var clinicInfoActions = {
33273
- READ_CLINICINFO: READ_CLINICINFO
35311
+ var dashboardComponentApiActions = {
35312
+ GET_APPOINTMENTS: GET_APPOINTMENTS,
35313
+ GET_FIRST_VISITS: GET_FIRST_VISITS,
35314
+ GET_OTHER_VISITS: GET_OTHER_VISITS,
35315
+ GET_WALK_INS: GET_WALK_INS,
35316
+ GET_NEW_PATIENTS: GET_NEW_PATIENTS
33274
35317
  };
33275
- var clinicInfoSlice$1 = clinicInfoSlice.reducer;
35318
+ var dashboardComponentApiSlice$1 = dashboardComponentApiSlice.reducer;
33276
35319
 
33277
35320
  var index = combineReducers({
33278
35321
  authSlice: authSlice$1,
@@ -33309,7 +35352,10 @@ var index = combineReducers({
33309
35352
  emailSendSlice: emailSendSlice$1,
33310
35353
  SigninFollowup: SigninFollowup$1,
33311
35354
  DoccSlice: DoccSlice$1,
33312
- clinicInfoSlice: clinicInfoSlice$1
35355
+ clinicInfoSlice: clinicInfoSlice$1,
35356
+ avgTimeSlice: avgTimeSlice$1,
35357
+ highPriorityApiSlice: highPriorityApiSlice$1,
35358
+ dashboardComponentApiSlice: dashboardComponentApiSlice$1
33313
35359
  });
33314
35360
 
33315
35361
  var CC_Actions = _objectSpread2({}, chiefCompilenceMastersActions);
@@ -33326,7 +35372,9 @@ var RadiologyActions = _objectSpread2({}, RadiologyMastersActions);
33326
35372
 
33327
35373
  var consultActions = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, CC_Actions), diagnosisActions), vitalsActions), A_Actions), LabOrderActions), MedicationActions), TreatmentActions), RadiologyActions);
33328
35374
 
33329
- var actions = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, authActions), fuzzySearchActions), patientActions), appointmentActions), appointmentResponseActions), relatedPersonActions), practitionerActions), docterListingActions), searchApiActions), serviceApiActions), slotApiActions), scheduleApiActions), personApiActions), getUserInfoActions), oraganizationRegistrationActions), organizAtionauthActions), oraganizationRegisterPatientActions), dashboardApiActions), visitStatsApiActions), consultActions), radOrderActions), signOffActions), VisitActions), emailsendActions), siginInActions), DoccActions), clinicInfoActions);
35375
+ var dashboardComponentMasterActions = _objectSpread2({}, dashboardComponentApiActions);
35376
+
35377
+ var actions = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, authActions), fuzzySearchActions), patientActions), appointmentActions), appointmentResponseActions), relatedPersonActions), practitionerActions), docterListingActions), searchApiActions), serviceApiActions), slotApiActions), scheduleApiActions), personApiActions), getUserInfoActions), oraganizationRegistrationActions), organizAtionauthActions), oraganizationRegisterPatientActions), dashboardApiActions), visitStatsApiActions), consultActions), radOrderActions), signOffActions), VisitActions), emailsendActions), siginInActions), DoccActions), clinicInfoActions), avgTimeActions), highPriorityActions), dashboardComponentMasterActions);
33330
35378
 
33331
35379
  exports.actions = actions;
33332
35380
  exports.rootReducer = index;