primarycare-binder 1.1.110 → 1.1.113

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 +243 -115
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -12418,14 +12418,67 @@ var GET_SPECIALITY_ID_BY_PRCTITIONER_ID = createAsyncThunk("appointmentReducer/g
12418
12418
  }
12419
12419
  }
12420
12420
  }, _callee13, null, [[2, 12]]);
12421
- }))); // RECCURANCE_APPOINTMENT
12422
-
12423
- var RECCURANCE_APPOINTMENT = createAsyncThunk("appointmentReducer/reccuranceAppointment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
12421
+ })));
12422
+ var CHECK_APPOINTMENT_AGAINST_PATIENT = createAsyncThunk("appointmentReducer/checkAppointmentAgainstPatient", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
12424
12423
  var payload,
12425
12424
  _ref29,
12426
12425
  rejectWithValue,
12426
+ _payload$patientId,
12427
+ patientId,
12427
12428
  _payload$start3,
12428
12429
  start,
12430
+ body,
12431
+ data,
12432
+ _args14 = arguments;
12433
+
12434
+ return regeneratorRuntime.wrap(function _callee14$(_context14) {
12435
+ while (1) {
12436
+ switch (_context14.prev = _context14.next) {
12437
+ case 0:
12438
+ payload = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
12439
+ _ref29 = _args14.length > 1 ? _args14[1] : undefined, rejectWithValue = _ref29.rejectWithValue;
12440
+ _context14.prev = 2;
12441
+ _payload$patientId = payload.patientId, patientId = _payload$patientId === void 0 ? 0 : _payload$patientId, _payload$start3 = payload.start, start = _payload$start3 === void 0 ? 0 : _payload$start3;
12442
+ debugger;
12443
+ body = {
12444
+ db_name: dbName,
12445
+ entity: "Appointment",
12446
+ filter: "Appointment.PersonID any ==".concat(patientId, " && Appointment.start ==").concat(start, " && Appointment.activestatus==true"),
12447
+ return_fields: "{_id:Appointment._id,PersonID:Appointment.PersonID,_key:Appointment._key,appno:Appointment.appno,id:Appointment.id,start:Appointment.start,slotID:Appointment.slotID,end:Appointment.end,doctorName:CONCAT(CONTAINS(document(document(Appointment.resourcecode).name)[*].prefix,'CodeableConceptMaster')?first(document(first(document(document(document(Appointment.resourcecode).name)[*].prefix)[*].coding))[*].display):first(document(document(document(Appointment.resourcecode).name)[*].prefix)[*].display),'. ',first(document(document(Appointment.resourcecode).name)[*].text),' ',first(document(document(Appointment.resourcecode).name)[*].given),' ',first(document(document(Appointment.resourcecode).name)[*].family),' ',CONTAINS(document(document(Appointment.resourcecode).name)[*].suffix,'CodeableConceptMaster')?first(document(first(document(document(document(Appointment.resourcecode).name)[*].suffix)[*].coding))[*].display):first(document(document(document(Appointment.resourcecode).name)[*].suffix)[*].display)),allowToBookAppointment:CONTAINS(document(Appointment.resourcecode).name,'HumanNameMaster')?false:true}"
12448
+ };
12449
+ _context14.next = 8;
12450
+ return fetchData$3({
12451
+ body: JSON.stringify(body)
12452
+ }, __readDocumentUrl__);
12453
+
12454
+ case 8:
12455
+ data = _context14.sent;
12456
+ debugger;
12457
+ return _context14.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12458
+ data: data
12459
+ }));
12460
+
12461
+ case 13:
12462
+ _context14.prev = 13;
12463
+ _context14.t0 = _context14["catch"](2);
12464
+ return _context14.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12465
+ message: _context14.t0.message
12466
+ })));
12467
+
12468
+ case 16:
12469
+ case "end":
12470
+ return _context14.stop();
12471
+ }
12472
+ }
12473
+ }, _callee14, null, [[2, 13]]);
12474
+ }))); // RECCURANCE_APPOINTMENT
12475
+
12476
+ var RECCURANCE_APPOINTMENT = createAsyncThunk("appointmentReducer/reccuranceAppointment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() {
12477
+ var payload,
12478
+ _ref31,
12479
+ rejectWithValue,
12480
+ _payload$start4,
12481
+ start,
12429
12482
  _payload$practionerid,
12430
12483
  practionerid,
12431
12484
  _payload$clinicid,
@@ -12435,16 +12488,16 @@ var RECCURANCE_APPOINTMENT = createAsyncThunk("appointmentReducer/reccuranceAppo
12435
12488
  queryId,
12436
12489
  body,
12437
12490
  data,
12438
- _args14 = arguments;
12491
+ _args15 = arguments;
12439
12492
 
12440
- return regeneratorRuntime.wrap(function _callee14$(_context14) {
12493
+ return regeneratorRuntime.wrap(function _callee15$(_context15) {
12441
12494
  while (1) {
12442
- switch (_context14.prev = _context14.next) {
12495
+ switch (_context15.prev = _context15.next) {
12443
12496
  case 0:
12444
- payload = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
12445
- _ref29 = _args14.length > 1 ? _args14[1] : undefined, rejectWithValue = _ref29.rejectWithValue;
12446
- _context14.prev = 2;
12447
- _payload$start3 = payload.start, start = _payload$start3 === void 0 ? [] : _payload$start3, _payload$practionerid = payload.practionerid, practionerid = _payload$practionerid === void 0 ? 0 : _payload$practionerid, _payload$clinicid = payload.clinicid, clinicid = _payload$clinicid === void 0 ? 0 : _payload$clinicid;
12497
+ payload = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
12498
+ _ref31 = _args15.length > 1 ? _args15[1] : undefined, rejectWithValue = _ref31.rejectWithValue;
12499
+ _context15.prev = 2;
12500
+ _payload$start4 = payload.start, start = _payload$start4 === void 0 ? [] : _payload$start4, _payload$practionerid = payload.practionerid, practionerid = _payload$practionerid === void 0 ? 0 : _payload$practionerid, _payload$clinicid = payload.clinicid, clinicid = _payload$clinicid === void 0 ? 0 : _payload$clinicid;
12448
12501
  date = start.map(function (d) {
12449
12502
  var startDate = new Date();
12450
12503
  var endDate = new Date();
@@ -12476,35 +12529,35 @@ var RECCURANCE_APPOINTMENT = createAsyncThunk("appointmentReducer/reccuranceAppo
12476
12529
  slotdate: getUtcTime(new Date())
12477
12530
  })
12478
12531
  };
12479
- _context14.next = 11;
12532
+ _context15.next = 11;
12480
12533
  return fetchData$3({
12481
12534
  body: JSON.stringify(body)
12482
12535
  });
12483
12536
 
12484
12537
  case 11:
12485
- data = _context14.sent;
12486
- return _context14.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12538
+ data = _context15.sent;
12539
+ return _context15.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12487
12540
  data: data
12488
12541
  }));
12489
12542
 
12490
12543
  case 15:
12491
- _context14.prev = 15;
12492
- _context14.t0 = _context14["catch"](2);
12493
- return _context14.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12494
- message: _context14.t0.message
12544
+ _context15.prev = 15;
12545
+ _context15.t0 = _context15["catch"](2);
12546
+ return _context15.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12547
+ message: _context15.t0.message
12495
12548
  })));
12496
12549
 
12497
12550
  case 18:
12498
12551
  case "end":
12499
- return _context14.stop();
12552
+ return _context15.stop();
12500
12553
  }
12501
12554
  }
12502
- }, _callee14, null, [[2, 15]]);
12555
+ }, _callee15, null, [[2, 15]]);
12503
12556
  }))); // UPDATE_APPOINTMENT_STATUS
12504
12557
 
12505
- var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppointmentStatus", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() {
12558
+ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppointmentStatus", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
12506
12559
  var payload,
12507
- _ref31,
12560
+ _ref33,
12508
12561
  rejectWithValue,
12509
12562
  _payload$appointmentI2,
12510
12563
  appointmentId,
@@ -12519,7 +12572,7 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12519
12572
  _encounterInfo$result,
12520
12573
  encounterCode,
12521
12574
  encounterInfo,
12522
- _ref32,
12575
+ _ref34,
12523
12576
  _id,
12524
12577
  _key,
12525
12578
  statushistory,
@@ -12527,15 +12580,15 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12527
12580
  appInfo,
12528
12581
  body,
12529
12582
  data,
12530
- _args15 = arguments;
12583
+ _args16 = arguments;
12531
12584
 
12532
- return regeneratorRuntime.wrap(function _callee15$(_context15) {
12585
+ return regeneratorRuntime.wrap(function _callee16$(_context16) {
12533
12586
  while (1) {
12534
- switch (_context15.prev = _context15.next) {
12587
+ switch (_context16.prev = _context16.next) {
12535
12588
  case 0:
12536
- payload = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
12537
- _ref31 = _args15.length > 1 ? _args15[1] : undefined, rejectWithValue = _ref31.rejectWithValue;
12538
- _context15.prev = 2;
12589
+ payload = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
12590
+ _ref33 = _args16.length > 1 ? _args16[1] : undefined, rejectWithValue = _ref33.rejectWithValue;
12591
+ _context16.prev = 2;
12539
12592
  _payload$appointmentI2 = payload.appointmentId, appointmentId = _payload$appointmentI2 === void 0 ? 0 : _payload$appointmentI2, _payload$status = payload.status, status = _payload$status === void 0 ? "" : _payload$status, _payload$isCompleted = payload.isCompleted, isCompleted = _payload$isCompleted === void 0 ? false : _payload$isCompleted; // const appBody = {
12540
12593
  // db_name: dbName,
12541
12594
  // queryid: query_ids["appointmentReducer/readAppointment"],
@@ -12562,11 +12615,11 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12562
12615
  }
12563
12616
 
12564
12617
  if (!encounterStatus) {
12565
- _context15.next = 20;
12618
+ _context16.next = 20;
12566
12619
  break;
12567
12620
  }
12568
12621
 
12569
- _context15.next = 8;
12622
+ _context16.next = 8;
12570
12623
  return fetchData$3({
12571
12624
  body: JSON.stringify({
12572
12625
  db_name: dbName,
@@ -12577,9 +12630,9 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12577
12630
  }, __readDocumentUrl__);
12578
12631
 
12579
12632
  case 8:
12580
- encounterCode = _context15.sent;
12633
+ encounterCode = _context16.sent;
12581
12634
  encounterStatus = (_encounterCode$result = encounterCode === null || encounterCode === void 0 ? void 0 : (_encounterCode$result2 = encounterCode.result) === null || _encounterCode$result2 === void 0 ? void 0 : (_encounterCode$result3 = _encounterCode$result2[0]) === null || _encounterCode$result3 === void 0 ? void 0 : _encounterCode$result3._id) !== null && _encounterCode$result !== void 0 ? _encounterCode$result : "";
12582
- _context15.next = 12;
12635
+ _context16.next = 12;
12583
12636
  return fetchData$3({
12584
12637
  body: JSON.stringify({
12585
12638
  db_name: dbName,
@@ -12590,11 +12643,11 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12590
12643
  }, __readDocumentUrl__);
12591
12644
 
12592
12645
  case 12:
12593
- encounterInfo = _context15.sent;
12594
- _ref32 = (encounterInfo === null || encounterInfo === void 0 ? void 0 : (_encounterInfo$result = encounterInfo.result) === null || _encounterInfo$result === void 0 ? void 0 : _encounterInfo$result[0]) || {}, _id = _ref32._id, _key = _ref32._key, statushistory = _ref32.statushistory;
12646
+ encounterInfo = _context16.sent;
12647
+ _ref34 = (encounterInfo === null || encounterInfo === void 0 ? void 0 : (_encounterInfo$result = encounterInfo.result) === null || _encounterInfo$result === void 0 ? void 0 : _encounterInfo$result[0]) || {}, _id = _ref34._id, _key = _ref34._key, statushistory = _ref34.statushistory;
12595
12648
 
12596
12649
  if (!(_id && _key && statushistory && Array.isArray(statushistory))) {
12597
- _context15.next = 20;
12650
+ _context16.next = 20;
12598
12651
  break;
12599
12652
  }
12600
12653
 
@@ -12631,7 +12684,7 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12631
12684
  status: encounterStatus
12632
12685
  }
12633
12686
  }];
12634
- _context15.next = 20;
12687
+ _context16.next = 20;
12635
12688
  return fetchData$3({
12636
12689
  body: JSON.stringify(updateData)
12637
12690
  }, __uspsertUrl__);
@@ -12657,34 +12710,34 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12657
12710
  id: appointmentId
12658
12711
  }
12659
12712
  }];
12660
- _context15.next = 26;
12713
+ _context16.next = 26;
12661
12714
  return fetchData$3({
12662
12715
  body: JSON.stringify(body)
12663
12716
  }, __uspsertUrl__);
12664
12717
 
12665
12718
  case 26:
12666
- data = _context15.sent;
12667
- return _context15.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12719
+ data = _context16.sent;
12720
+ return _context16.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12668
12721
  data: data
12669
12722
  }));
12670
12723
 
12671
12724
  case 30:
12672
- _context15.prev = 30;
12673
- _context15.t0 = _context15["catch"](2);
12674
- return _context15.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12675
- message: _context15.t0.message
12725
+ _context16.prev = 30;
12726
+ _context16.t0 = _context16["catch"](2);
12727
+ return _context16.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12728
+ message: _context16.t0.message
12676
12729
  })));
12677
12730
 
12678
12731
  case 33:
12679
12732
  case "end":
12680
- return _context15.stop();
12733
+ return _context16.stop();
12681
12734
  }
12682
12735
  }
12683
- }, _callee15, null, [[2, 30]]);
12736
+ }, _callee16, null, [[2, 30]]);
12684
12737
  })));
12685
- var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApoointmentStatus", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
12738
+ var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApoointmentStatus", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
12686
12739
  var payload,
12687
- _ref34,
12740
+ _ref36,
12688
12741
  rejectWithValue,
12689
12742
  _appData$,
12690
12743
  _payload$appointmentI3,
@@ -12697,15 +12750,15 @@ var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApooi
12697
12750
  insertObject,
12698
12751
  body,
12699
12752
  data,
12700
- _args16 = arguments;
12753
+ _args17 = arguments;
12701
12754
 
12702
- return regeneratorRuntime.wrap(function _callee16$(_context16) {
12755
+ return regeneratorRuntime.wrap(function _callee17$(_context17) {
12703
12756
  while (1) {
12704
- switch (_context16.prev = _context16.next) {
12757
+ switch (_context17.prev = _context17.next) {
12705
12758
  case 0:
12706
- payload = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
12707
- _ref34 = _args16.length > 1 ? _args16[1] : undefined, rejectWithValue = _ref34.rejectWithValue;
12708
- _context16.prev = 2;
12759
+ payload = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
12760
+ _ref36 = _args17.length > 1 ? _args17[1] : undefined, rejectWithValue = _ref36.rejectWithValue;
12761
+ _context17.prev = 2;
12709
12762
  _payload$appointmentI3 = payload.appointmentId, appointmentId = _payload$appointmentI3 === void 0 ? 0 : _payload$appointmentI3, _payload$reason = payload.reason, reason = _payload$reason === void 0 ? "" : _payload$reason;
12710
12763
  appBody = {
12711
12764
  db_name: dbName,
@@ -12714,17 +12767,17 @@ var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApooi
12714
12767
  appointment_id: appointmentId
12715
12768
  }
12716
12769
  };
12717
- _context16.next = 7;
12770
+ _context17.next = 7;
12718
12771
  return fetchData$3({
12719
12772
  body: JSON.stringify(appBody)
12720
12773
  });
12721
12774
 
12722
12775
  case 7:
12723
- appData = _context16.sent;
12776
+ appData = _context17.sent;
12724
12777
  appInfo = (appData === null || appData === void 0 ? void 0 : (_appData$ = appData[0]) === null || _appData$ === void 0 ? void 0 : _appData$[0]) || {};
12725
12778
 
12726
12779
  if (!(Object.keys(appInfo).length > 0)) {
12727
- _context16.next = 19;
12780
+ _context17.next = 19;
12728
12781
  break;
12729
12782
  }
12730
12783
 
@@ -12745,53 +12798,53 @@ var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApooi
12745
12798
  id: appointmentId
12746
12799
  }
12747
12800
  }];
12748
- _context16.next = 17;
12801
+ _context17.next = 17;
12749
12802
  return fetchData$3({
12750
12803
  body: JSON.stringify(body)
12751
12804
  }, __uspsertUrl__);
12752
12805
 
12753
12806
  case 17:
12754
- data = _context16.sent;
12755
- return _context16.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12807
+ data = _context17.sent;
12808
+ return _context17.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12756
12809
  data: data
12757
12810
  }));
12758
12811
 
12759
12812
  case 19:
12760
- _context16.next = 24;
12813
+ _context17.next = 24;
12761
12814
  break;
12762
12815
 
12763
12816
  case 21:
12764
- _context16.prev = 21;
12765
- _context16.t0 = _context16["catch"](2);
12766
- return _context16.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12767
- message: _context16.t0.message
12817
+ _context17.prev = 21;
12818
+ _context17.t0 = _context17["catch"](2);
12819
+ return _context17.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12820
+ message: _context17.t0.message
12768
12821
  })));
12769
12822
 
12770
12823
  case 24:
12771
12824
  case "end":
12772
- return _context16.stop();
12825
+ return _context17.stop();
12773
12826
  }
12774
12827
  }
12775
- }, _callee16, null, [[2, 21]]);
12828
+ }, _callee17, null, [[2, 21]]);
12776
12829
  }))); // REASON_FOR_APPT_CANCEL_MODIFY
12777
12830
 
12778
- var REASON_FOR_APPT_CANCEL_MODIFY = createAsyncThunk("appointmentReducer/reasonForApptCancelModify", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
12831
+ var REASON_FOR_APPT_CANCEL_MODIFY = createAsyncThunk("appointmentReducer/reasonForApptCancelModify", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() {
12779
12832
  var payload,
12780
- _ref36,
12833
+ _ref38,
12781
12834
  rejectWithValue,
12782
12835
  body,
12783
12836
  data,
12784
12837
  returnData,
12785
12838
  _data$result3,
12786
- _args17 = arguments;
12839
+ _args18 = arguments;
12787
12840
 
12788
- return regeneratorRuntime.wrap(function _callee17$(_context17) {
12841
+ return regeneratorRuntime.wrap(function _callee18$(_context18) {
12789
12842
  while (1) {
12790
- switch (_context17.prev = _context17.next) {
12843
+ switch (_context18.prev = _context18.next) {
12791
12844
  case 0:
12792
- payload = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
12793
- _ref36 = _args17.length > 1 ? _args17[1] : undefined, rejectWithValue = _ref36.rejectWithValue;
12794
- _context17.prev = 2;
12845
+ payload = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
12846
+ _ref38 = _args18.length > 1 ? _args18[1] : undefined, rejectWithValue = _ref38.rejectWithValue;
12847
+ _context18.prev = 2;
12795
12848
  body = {
12796
12849
  db_name: dbName,
12797
12850
  entity: "CodingMaster",
@@ -12799,13 +12852,13 @@ var REASON_FOR_APPT_CANCEL_MODIFY = createAsyncThunk("appointmentReducer/reasonF
12799
12852
  sort: "CodingMaster.display ASC",
12800
12853
  return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type')"
12801
12854
  };
12802
- _context17.next = 6;
12855
+ _context18.next = 6;
12803
12856
  return fetchData$3({
12804
12857
  body: JSON.stringify(body)
12805
12858
  }, __readDocumentUrl__);
12806
12859
 
12807
12860
  case 6:
12808
- data = _context17.sent;
12861
+ data = _context18.sent;
12809
12862
  returnData = [];
12810
12863
 
12811
12864
  if (Array.isArray(data === null || data === void 0 ? void 0 : data.result)) {
@@ -12820,23 +12873,23 @@ var REASON_FOR_APPT_CANCEL_MODIFY = createAsyncThunk("appointmentReducer/reasonF
12820
12873
  });
12821
12874
  }
12822
12875
 
12823
- return _context17.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12876
+ return _context18.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12824
12877
  data: returnData
12825
12878
  }));
12826
12879
 
12827
12880
  case 12:
12828
- _context17.prev = 12;
12829
- _context17.t0 = _context17["catch"](2);
12830
- return _context17.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12831
- message: _context17.t0.message
12881
+ _context18.prev = 12;
12882
+ _context18.t0 = _context18["catch"](2);
12883
+ return _context18.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12884
+ message: _context18.t0.message
12832
12885
  })));
12833
12886
 
12834
12887
  case 15:
12835
12888
  case "end":
12836
- return _context17.stop();
12889
+ return _context18.stop();
12837
12890
  }
12838
12891
  }
12839
- }, _callee17, null, [[2, 12]]);
12892
+ }, _callee18, null, [[2, 12]]);
12840
12893
  }))); // APPOINTMENT CREATE INITIALSTATE
12841
12894
 
12842
12895
  var appointmentReducer = createSlice({
@@ -12861,7 +12914,8 @@ var appointmentReducer = createSlice({
12861
12914
  follow_up_appintment: _objectSpread2({}, defaultState.Info),
12862
12915
  reasonForApptCancelModify: _objectSpread2({}, defaultState.Info),
12863
12916
  getReferralLocation: _objectSpread2({}, defaultState.List),
12864
- getSpecialityIdByPractitionerId: _objectSpread2({}, defaultState.Info)
12917
+ getSpecialityIdByPractitionerId: _objectSpread2({}, defaultState.Info),
12918
+ checkAppointmentAgainstPatient: _objectSpread2({}, defaultState.Info)
12865
12919
  },
12866
12920
  extraReducers: (_extraReducers$D = {}, _defineProperty(_extraReducers$D, APPOINTMENT_CREATE.fulfilled, function (state, action) {
12867
12921
  var _action$payload;
@@ -13033,6 +13087,16 @@ var appointmentReducer = createSlice({
13033
13087
  var _action$payload34;
13034
13088
 
13035
13089
  state.getSpecialityIdByPractitionerId = (_action$payload34 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload34 !== void 0 ? _action$payload34 : [];
13090
+ }), _defineProperty(_extraReducers$D, CHECK_APPOINTMENT_AGAINST_PATIENT.fulfilled, function (state, action) {
13091
+ var _action$payload35;
13092
+
13093
+ state.checkAppointmentAgainstPatient = (_action$payload35 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload35 !== void 0 ? _action$payload35 : [];
13094
+ }), _defineProperty(_extraReducers$D, CHECK_APPOINTMENT_AGAINST_PATIENT.pending, function (state, action) {
13095
+ state.checkAppointmentAgainstPatient.loading = true;
13096
+ }), _defineProperty(_extraReducers$D, CHECK_APPOINTMENT_AGAINST_PATIENT.rejected, function (state, action) {
13097
+ var _action$payload36;
13098
+
13099
+ state.checkAppointmentAgainstPatient = (_action$payload36 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload36 !== void 0 ? _action$payload36 : [];
13036
13100
  }), _extraReducers$D)
13037
13101
  }); // end
13038
13102
  // APPOINTMENT ACTION LISTS
@@ -13054,7 +13118,8 @@ var appointmentActions = {
13054
13118
  GET__FOLLOW_UP_APPOINTMENT: GET__FOLLOW_UP_APPOINTMENT,
13055
13119
  REASON_FOR_APPT_CANCEL_MODIFY: REASON_FOR_APPT_CANCEL_MODIFY,
13056
13120
  GET_REFERRAL_LOCATION: GET_REFERRAL_LOCATION,
13057
- GET_SPECIALITY_ID_BY_PRCTITIONER_ID: GET_SPECIALITY_ID_BY_PRCTITIONER_ID
13121
+ GET_SPECIALITY_ID_BY_PRCTITIONER_ID: GET_SPECIALITY_ID_BY_PRCTITIONER_ID,
13122
+ CHECK_APPOINTMENT_AGAINST_PATIENT: CHECK_APPOINTMENT_AGAINST_PATIENT
13058
13123
  }; // end
13059
13124
  var appointmentReducer$1 = appointmentReducer.reducer;
13060
13125
 
@@ -18472,6 +18537,7 @@ var ORGANIZATION_VISIT_REGISTRATION = createAsyncThunk("OrganizationRegisterPati
18472
18537
  rejectWithValue,
18473
18538
  payloaddata,
18474
18539
  enId,
18540
+ encounterId,
18475
18541
  body,
18476
18542
  data,
18477
18543
  _args2 = arguments;
@@ -18484,7 +18550,7 @@ var ORGANIZATION_VISIT_REGISTRATION = createAsyncThunk("OrganizationRegisterPati
18484
18550
  _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
18485
18551
  debugger;
18486
18552
  _context2.prev = 3;
18487
- payloaddata = payload.payloaddata, enId = payload.enId;
18553
+ payloaddata = payload.payloaddata, enId = payload.enId, encounterId = payload.encounterId;
18488
18554
 
18489
18555
  if (enId) {
18490
18556
  body = [_objectSpread2({
@@ -18496,6 +18562,16 @@ var ORGANIZATION_VISIT_REGISTRATION = createAsyncThunk("OrganizationRegisterPati
18496
18562
  },
18497
18563
  metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd"
18498
18564
  }, payloaddata)];
18565
+ } else if (encounterId) {
18566
+ body = [_objectSpread2({
18567
+ db_name: dbName,
18568
+ entity: "Encounter",
18569
+ is_metadata: true,
18570
+ filter: {
18571
+ _key: "".concat(encounterId)
18572
+ },
18573
+ metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd"
18574
+ }, payloaddata)];
18499
18575
  } else {
18500
18576
  body = [_objectSpread2({
18501
18577
  db_name: dbName,
@@ -22736,7 +22812,7 @@ var queries$a = {
22736
22812
  relationship: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"filter\": \"CodeableConceptMaster.Type=='RELATIONSHIP' && CodeableConceptMaster.status==true\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
22737
22813
  symptoms: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"SymptomsMapping\",\n \"return_fields\": \"SymptomsMapping\"\n }"),
22738
22814
  Severity: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"filter\": \"CodeableConceptMaster.Type=='CCSEVERITY'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
22739
- bodySite: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"filter\": \"CodeableConceptMaster.Type=='CCBODYSITE'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
22815
+ bodySite: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"filter\": \"CodeableConceptMaster.status == true && CodeableConceptMaster.Type=='CCBODYSITE'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
22740
22816
  Verification: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"filter\": \"CodeableConceptMaster.Type=='CCVERIFICTIONSTATUS'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
22741
22817
  clinicalStatus: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"CodeableConceptMaster\",\n \"filter\": \"CodeableConceptMaster.Type=='CCCLINICALSTATUS'\",\n \"return_fields\": \"MERGE(CodeableConceptMaster,{coding:(FOR cod IN CodeableConceptMaster.coding RETURN DOCUMENT(cod))})\"\n }"),
22742
22818
  encounterBasedCC: function encounterBasedCC(encounter_id) {
@@ -28864,6 +28940,7 @@ var generateJSON$3 = function generateJSON(dataList) {
28864
28940
  };
28865
28941
 
28866
28942
  var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28943
+ debugger;
28867
28944
  var payload = dataList.map(function (data, i) {
28868
28945
  var _data$orderCatalog, _data$occuranceEndDat, _data$orderQty, _data$status, _data$reasonCode, _data$indications, _data$notes, _data$attribute$view, _data$attribute, _data$attribute$bedSi, _data$attribute2, _data$attribute$contr, _data$attribute3, _data$statusreason, _data$accessionNum;
28869
28946
 
@@ -28907,7 +28984,7 @@ var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28907
28984
  orderMode: data === null || data === void 0 ? void 0 : data.orderMode,
28908
28985
  priority: data === null || data === void 0 ? void 0 : data.priority,
28909
28986
  orderDateTime: data === null || data === void 0 ? void 0 : data.orderDateTime,
28910
- occuranceStartDate: vId > 0 ? vId : data === null || data === void 0 ? void 0 : data.occuranceStartDate,
28987
+ occuranceStartDate: vId > 0 ? !edit ? getActualDate$2(vId, data === null || data === void 0 ? void 0 : data.starts_on) : vId : data === null || data === void 0 ? void 0 : data.occuranceStartDate,
28911
28988
  occuranceEndDate: (_data$occuranceEndDat = data === null || data === void 0 ? void 0 : data.occuranceEndDate) !== null && _data$occuranceEndDat !== void 0 ? _data$occuranceEndDat : 0,
28912
28989
  orderQty: (_data$orderQty = data === null || data === void 0 ? void 0 : data.orderQty) !== null && _data$orderQty !== void 0 ? _data$orderQty : 0,
28913
28990
  orderUOM: "",
@@ -28916,7 +28993,7 @@ var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28916
28993
  workflowStatus: "",
28917
28994
  billQty: 0,
28918
28995
  orderPrivilegeLevel: 0,
28919
- apptDate: vId,
28996
+ apptDate: !edit ? getActualDate$2(vId, data === null || data === void 0 ? void 0 : data.starts_on) : vId,
28920
28997
  apptRefNum: "",
28921
28998
  Requestor: _toConsumableArray(data === null || data === void 0 ? void 0 : data.Requestor),
28922
28999
  reasonCode: (_data$reasonCode = data === null || data === void 0 ? void 0 : data.reasonCode) !== null && _data$reasonCode !== void 0 ? _data$reasonCode : "",
@@ -28929,7 +29006,7 @@ var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28929
29006
  freqRateUnit: "",
28930
29007
  duration: 0,
28931
29008
  durationType: "",
28932
- parentOrderId: edit ? data.editId : editIds ? editIds : "",
29009
+ parentOrderId: edit ? data === null || data === void 0 ? void 0 : data.parentOrderId : editIds ? editIds : "",
28933
29010
  orderGroupRefId: "",
28934
29011
  specimenRelated: [{
28935
29012
  reqd: data.specimenRelated[0].reqd,
@@ -28972,6 +29049,17 @@ var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28972
29049
  return payload;
28973
29050
  };
28974
29051
 
29052
+ var getActualDate$2 = function getActualDate(incomingDate, actualDate) {
29053
+ debugger;
29054
+ var actualFormat = moment$1.unix(actualDate).format("YYYY-MM-DD,hh:mm A");
29055
+ var incomingFormat = moment$1.unix(incomingDate).format("YYYY-MM-DD,hh:mm A");
29056
+ var requiredTime = actualFormat.split(","); //Got the time
29057
+
29058
+ var requiredDate = incomingFormat.slice(0, 11);
29059
+ var requiredFormat = moment$1(requiredDate + requiredTime, 'YYYY-MM-DD,hh:mm A').unix();
29060
+ return requiredFormat;
29061
+ };
29062
+
28975
29063
  var queries$6 = {
28976
29064
  laborder_read: function laborder_read(encounter_id, order_id) {
28977
29065
  return {
@@ -31774,7 +31862,7 @@ var DRUGMASTER_MASTER = createAsyncThunk("MedicationMastersSlice/drugMaster_mast
31774
31862
  data = _context2.sent;
31775
31863
  arr = [];
31776
31864
  data.result.map(function (val) {
31777
- var _val$FormCode, _val$FormCode2, _val$StrengthValuesPo, _val$StrengthValuesPo2, _val$StrengthValuesPo3, _val$StrengthValuesPo4, _val$DrugType, _val$DrugType2, _val$DrugType3, _val$DrugType4, _val$drugroutegenid;
31865
+ var _val$FormCode, _val$FormCode2, _val$StrengthValuesPo, _val$StrengthValuesPo2, _val$StrengthValuesPo3, _val$StrengthValuesPo4, _val$DrugType, _val$DrugType2, _val$DrugType3, _val$DrugType4, _val$drugroutegenid, _val$LongDesc;
31778
31866
 
31779
31867
  var json = {
31780
31868
  value: val === null || val === void 0 ? void 0 : val._id,
@@ -31787,12 +31875,15 @@ var DRUGMASTER_MASTER = createAsyncThunk("MedicationMastersSlice/drugMaster_mast
31787
31875
  drugTypeLong: val === null || val === void 0 ? void 0 : (_val$DrugType2 = val.DrugType) === null || _val$DrugType2 === void 0 ? void 0 : _val$DrugType2.longdesc,
31788
31876
  drugTypeShort: val === null || val === void 0 ? void 0 : (_val$DrugType3 = val.DrugType) === null || _val$DrugType3 === void 0 ? void 0 : _val$DrugType3.shortdesc,
31789
31877
  drugTypeId: val === null || val === void 0 ? void 0 : (_val$DrugType4 = val.DrugType) === null || _val$DrugType4 === void 0 ? void 0 : _val$DrugType4._id,
31790
- drugroutegenid: (_val$drugroutegenid = val === null || val === void 0 ? void 0 : val.drugroutegenid) !== null && _val$drugroutegenid !== void 0 ? _val$drugroutegenid : "" // formValue
31878
+ drugroutegenid: (_val$drugroutegenid = val === null || val === void 0 ? void 0 : val.drugroutegenid) !== null && _val$drugroutegenid !== void 0 ? _val$drugroutegenid : "",
31879
+ LongDesc_: (_val$LongDesc = val === null || val === void 0 ? void 0 : val.LongDesc) !== null && _val$LongDesc !== void 0 ? _val$LongDesc : "",
31880
+ DrugCode_: val === null || val === void 0 ? void 0 : val.DrugCode // formValue
31791
31881
 
31792
31882
  };
31793
31883
  arr.push(_objectSpread2(_objectSpread2({}, json), {}, {
31794
- name: val.ShortDesc,
31795
- label: val.ShortDesc // label: `${val.ShortDesc ?? ""} - ${json.StrengthValues} ${json.StrengthUOM}`,
31884
+ name: val === null || val === void 0 ? void 0 : val.ShortDesc,
31885
+ label: (val === null || val === void 0 ? void 0 : val.DrugCode) + " - " + (val === null || val === void 0 ? void 0 : val.ShortDesc) + " - " + (val === null || val === void 0 ? void 0 : val.LongDesc) // label: val?.ShortDesc
31886
+ // label: `${val.ShortDesc ?? ""} - ${json.StrengthValues} ${json.StrengthUOM}`,
31796
31887
 
31797
31888
  }));
31798
31889
  });
@@ -34742,7 +34833,7 @@ var childJSON$1 = function childJSON(dataList, editIds, edit, vId) {
34742
34833
  orderMode: data === null || data === void 0 ? void 0 : data.orderMode,
34743
34834
  priority: data === null || data === void 0 ? void 0 : data.priority,
34744
34835
  orderDateTime: data === null || data === void 0 ? void 0 : data.orderDateTime,
34745
- occuranceStartDate: vId > 0 ? vId : data === null || data === void 0 ? void 0 : data.occuranceStartDate,
34836
+ occuranceStartDate: vId > 0 ? !edit ? getActualDate$1(vId, data === null || data === void 0 ? void 0 : data.starts_on) : vId : data === null || data === void 0 ? void 0 : data.occuranceStartDate,
34746
34837
  occuranceEndDate: (_data$occuranceEndDat = data === null || data === void 0 ? void 0 : data.occuranceEndDate) !== null && _data$occuranceEndDat !== void 0 ? _data$occuranceEndDat : 0,
34747
34838
  orderQty: (_data$orderQty = data === null || data === void 0 ? void 0 : data.orderQty) !== null && _data$orderQty !== void 0 ? _data$orderQty : 0,
34748
34839
  orderUOM: "",
@@ -34751,7 +34842,7 @@ var childJSON$1 = function childJSON(dataList, editIds, edit, vId) {
34751
34842
  workflowStatus: "",
34752
34843
  billQty: 0,
34753
34844
  orderPrivilegeLevel: 0,
34754
- apptDate: vId,
34845
+ apptDate: !edit ? getActualDate$1(vId, data === null || data === void 0 ? void 0 : data.starts_on) : vId,
34755
34846
  apptRefNum: "",
34756
34847
  Requestor: _toConsumableArray(data === null || data === void 0 ? void 0 : data.Requestor),
34757
34848
  reasonCode: (_data$reasonCode = data === null || data === void 0 ? void 0 : data.reasonCode) !== null && _data$reasonCode !== void 0 ? _data$reasonCode : "",
@@ -34764,7 +34855,7 @@ var childJSON$1 = function childJSON(dataList, editIds, edit, vId) {
34764
34855
  freqRateUnit: "",
34765
34856
  duration: 0,
34766
34857
  durationType: "",
34767
- parentOrderId: edit ? data.editId : editIds ? editIds : "",
34858
+ parentOrderId: edit ? data === null || data === void 0 ? void 0 : data.parentOrderId : editIds ? editIds : "",
34768
34859
  orderGroupRefId: "",
34769
34860
  performer: _toConsumableArray(data === null || data === void 0 ? void 0 : data.performer),
34770
34861
  notes: (_data$notes = data === null || data === void 0 ? void 0 : data.notes) !== null && _data$notes !== void 0 ? _data$notes : "",
@@ -34796,6 +34887,16 @@ var childJSON$1 = function childJSON(dataList, editIds, edit, vId) {
34796
34887
  return payload;
34797
34888
  };
34798
34889
 
34890
+ var getActualDate$1 = function getActualDate(incomingDate, actualDate) {
34891
+ var actualFormat = moment$1.unix(actualDate).format("YYYY-MM-DD,hh:mm A");
34892
+ var incomingFormat = moment$1.unix(incomingDate).format("YYYY-MM-DD,hh:mm A");
34893
+ var requiredTime = actualFormat.split(","); //Got the time
34894
+
34895
+ var requiredDate = incomingFormat.slice(0, 11);
34896
+ var requiredFormat = moment$1(requiredDate + requiredTime, 'YYYY-MM-DD,hh:mm A').unix();
34897
+ return requiredFormat;
34898
+ };
34899
+
34799
34900
  var _extraReducers$f;
34800
34901
  var TREATMENT_PROCEDURE_SAVE = createAsyncThunk("DiagnosisMasterSlice/savetreatment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
34801
34902
  var payload,
@@ -36668,7 +36769,7 @@ var childJSON = function childJSON(dataList, editIds, edit, vId) {
36668
36769
  orderMode: data === null || data === void 0 ? void 0 : data.orderMode,
36669
36770
  priority: data === null || data === void 0 ? void 0 : data.priority,
36670
36771
  orderDateTime: data === null || data === void 0 ? void 0 : data.orderDateTime,
36671
- occuranceStartDate: vId > 0 ? vId : data === null || data === void 0 ? void 0 : data.occuranceStartDate,
36772
+ occuranceStartDate: vId > 0 ? !edit ? getActualDate(vId, data === null || data === void 0 ? void 0 : data.starts_on) : vId : data === null || data === void 0 ? void 0 : data.occuranceStartDate,
36672
36773
  occuranceEndDate: (_data$occuranceEndDat = data === null || data === void 0 ? void 0 : data.occuranceEndDate) !== null && _data$occuranceEndDat !== void 0 ? _data$occuranceEndDat : 0,
36673
36774
  orderQty: (_data$orderQty = data === null || data === void 0 ? void 0 : data.orderQty) !== null && _data$orderQty !== void 0 ? _data$orderQty : 0,
36674
36775
  orderUOM: "",
@@ -36677,7 +36778,7 @@ var childJSON = function childJSON(dataList, editIds, edit, vId) {
36677
36778
  workflowStatus: "",
36678
36779
  billQty: 0,
36679
36780
  orderPrivilegeLevel: 0,
36680
- apptDate: vId,
36781
+ apptDate: !edit ? getActualDate(vId, data === null || data === void 0 ? void 0 : data.starts_on) : vId,
36681
36782
  apptRefNum: "",
36682
36783
  Requestor: _toConsumableArray(data === null || data === void 0 ? void 0 : data.Requestor),
36683
36784
  reasonCode: (_data$reasonCode = data === null || data === void 0 ? void 0 : data.reasonCode) !== null && _data$reasonCode !== void 0 ? _data$reasonCode : "",
@@ -36690,7 +36791,7 @@ var childJSON = function childJSON(dataList, editIds, edit, vId) {
36690
36791
  freqRateUnit: "",
36691
36792
  duration: 0,
36692
36793
  durationType: "",
36693
- parentOrderId: edit ? data.editId : editIds ? editIds : "",
36794
+ parentOrderId: edit ? data === null || data === void 0 ? void 0 : data.parentOrderId : editIds ? editIds : "",
36694
36795
  orderGroupRefId: "",
36695
36796
  performer: _toConsumableArray(data === null || data === void 0 ? void 0 : data.performer),
36696
36797
  notes: (_data$notes = data === null || data === void 0 ? void 0 : data.notes) !== null && _data$notes !== void 0 ? _data$notes : "",
@@ -36722,6 +36823,16 @@ var childJSON = function childJSON(dataList, editIds, edit, vId) {
36722
36823
  return payload;
36723
36824
  };
36724
36825
 
36826
+ var getActualDate = function getActualDate(incomingDate, actualDate) {
36827
+ var actualFormat = moment$1.unix(actualDate).format("YYYY-MM-DD,hh:mm A");
36828
+ var incomingFormat = moment$1.unix(incomingDate).format("YYYY-MM-DD,hh:mm A");
36829
+ var requiredTime = actualFormat.split(","); //Got the time
36830
+
36831
+ var requiredDate = incomingFormat.slice(0, 11);
36832
+ var requiredFormat = moment$1(requiredDate + requiredTime, 'YYYY-MM-DD,hh:mm A').unix();
36833
+ return requiredFormat;
36834
+ };
36835
+
36725
36836
  var _extraReducers$e;
36726
36837
  var READ_RAD_CHILD = createAsyncThunk("RadiologySlice/rad_child", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
36727
36838
  var payload,
@@ -38709,7 +38820,20 @@ var queries$2 = {
38709
38820
  return_fields: " {Practitioner_id:(for doc in Practitioner filter doc.id in Encounter.participant[*].Practitioner_id return {name:document(doc.name),_id:doc._id})}"
38710
38821
  };
38711
38822
  },
38712
- 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}"),
38823
+ doc_read: function doc_read(patient_id) {
38824
+ return {
38825
+ db_name: dbName,
38826
+ entity: "CAPatientClinicalDocs",
38827
+ filter: "CAPatientClinicalDocs.patientid =='".concat(patient_id, "' && CAPatientClinicalDocs.activestatus ==true"),
38828
+ 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))})"
38829
+ };
38830
+ } // `{
38831
+ // "db_name": "${dbName}",
38832
+ // "entity": "CAPatientClinicalDocs",
38833
+ // "filter": "CAPatientClinicalDocs.activestatus ==true",
38834
+ // "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))})"
38835
+ // }`,
38836
+ ,
38713
38837
  doc_single_read: function doc_single_read(key) {
38714
38838
  return {
38715
38839
  db_name: dbName,
@@ -38718,13 +38842,14 @@ var queries$2 = {
38718
38842
  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))})) ,practitioner_role:(FOR practrole IN TO_ARRAY(pract.practitioner_role) RETURN MERGE(DOCUMENT(practrole),{'role':MERGE(DOCUMENT(DOCUMENT(practrole).role),{coding:(FOR cod IN TO_ARRAY(DOCUMENT(DOCUMENT(practrole).role).coding) RETURN DOCUMENT(cod) )}) }) ) }))},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(document(CAPatientClinicalDocs.encountertype)),specialty:(document(CAPatientClinicalDocs.specialty))})"
38719
38843
  };
38720
38844
  },
38721
- doc_agnst_category: function doc_agnst_category(category, speciality, encoumter, practitioner) {
38722
- return {
38845
+ doc_agnst_category: function doc_agnst_category(category, speciality, encoumter, practitioner, patient_id) {
38846
+ var _ref;
38847
+
38848
+ return _ref = {
38723
38849
  db_name: dbName,
38724
38850
  entity: "CAPatientClinicalDocs",
38725
- filter: "CAPatientClinicalDocs.activestatus ==true && CAPatientClinicalDocs.doccategory=='".concat(category, "' || CAPatientClinicalDocs.specialty=='").concat(speciality, "' || CAPatientClinicalDocs.encounterid=='").concat(encoumter, "' || CAPatientClinicalDocs.practitionerid=='").concat(practitioner, "'"),
38726
- 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))})) ,practitioner_role:(FOR practrole IN TO_ARRAY(pract.practitioner_role) RETURN MERGE(DOCUMENT(practrole),{'role':MERGE(DOCUMENT(DOCUMENT(practrole).role),{coding:(FOR cod IN TO_ARRAY(DOCUMENT(DOCUMENT(practrole).role).coding) RETURN DOCUMENT(cod) )}) }) ) }))},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(document(CAPatientClinicalDocs.encountertype)),specialty:(document(CAPatientClinicalDocs.specialty))})"
38727
- };
38851
+ filter: "CAPatientClinicalDocs.activestatus ==true && CAPatientClinicalDocs.doccategory=='".concat(category, "' || CAPatientClinicalDocs.specialty=='").concat(speciality, "' || CAPatientClinicalDocs.encounterid=='").concat(encoumter, "' || CAPatientClinicalDocs.practitionerid=='").concat(practitioner, "'")
38852
+ }, _defineProperty(_ref, "filter", "CAPatientClinicalDocs.patientid =='".concat(patient_id, "' && CAPatientClinicalDocs.activestatus ==true && (CAPatientClinicalDocs.doccategory=='").concat(category, "' || CAPatientClinicalDocs.specialty=='").concat(speciality, "' || CAPatientClinicalDocs.encounterid=='").concat(encoumter, "' || CAPatientClinicalDocs.practitionerid=='").concat(practitioner, "')")), _defineProperty(_ref, "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))})) ,practitioner_role:(FOR practrole IN TO_ARRAY(pract.practitioner_role) RETURN MERGE(DOCUMENT(practrole),{'role':MERGE(DOCUMENT(DOCUMENT(practrole).role),{coding:(FOR cod IN TO_ARRAY(DOCUMENT(DOCUMENT(practrole).role).coding) RETURN DOCUMENT(cod) )}) }) ) }))},{encounterid:document(CAPatientClinicalDocs.encounterid),doctype:(document(CAPatientClinicalDocs.doctype)),reason:(document(CAPatientClinicalDocs.reason)),encountertype:(document(CAPatientClinicalDocs.encountertype)),specialty:(document(CAPatientClinicalDocs.specialty))})"), _ref;
38728
38853
  },
38729
38854
  //....not used....//
38730
38855
  doc_agnst_encounter: function doc_agnst_encounter(patient_id, encounter_id) {
@@ -39279,6 +39404,7 @@ var DOCC_READ = createAsyncThunk("DoccSlice/docc_read", /*#__PURE__*/_asyncToGen
39279
39404
  _ref14,
39280
39405
  rejectWithValue,
39281
39406
  getState,
39407
+ patient_id,
39282
39408
  data,
39283
39409
  res,
39284
39410
  _args7 = arguments;
@@ -39290,31 +39416,32 @@ var DOCC_READ = createAsyncThunk("DoccSlice/docc_read", /*#__PURE__*/_asyncToGen
39290
39416
  payload = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
39291
39417
  _ref14 = _args7.length > 1 ? _args7[1] : undefined, rejectWithValue = _ref14.rejectWithValue, getState = _ref14.getState;
39292
39418
  _context7.prev = 2;
39293
- _context7.next = 5;
39419
+ patient_id = payload.patient_id;
39420
+ _context7.next = 6;
39294
39421
  return fetchData$3({
39295
- body: queries$2.doc_read
39422
+ body: JSON.stringify(queries$2.doc_read(patient_id))
39296
39423
  }, __readDocumentUrl__);
39297
39424
 
39298
- case 5:
39425
+ case 6:
39299
39426
  data = _context7.sent;
39300
39427
  res = generateResJson(data.result);
39301
39428
  return _context7.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
39302
39429
  data: res
39303
39430
  }));
39304
39431
 
39305
- case 10:
39306
- _context7.prev = 10;
39432
+ case 11:
39433
+ _context7.prev = 11;
39307
39434
  _context7.t0 = _context7["catch"](2);
39308
39435
  return _context7.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
39309
39436
  message: _context7.t0.message
39310
39437
  })));
39311
39438
 
39312
- case 13:
39439
+ case 14:
39313
39440
  case "end":
39314
39441
  return _context7.stop();
39315
39442
  }
39316
39443
  }
39317
- }, _callee7, null, [[2, 10]]);
39444
+ }, _callee7, null, [[2, 11]]);
39318
39445
  })));
39319
39446
  var DOCC_SINGLE_READ = createAsyncThunk("DoccSlice/docc_single_read", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
39320
39447
  var payload,
@@ -39373,6 +39500,7 @@ var DOCC_AGAINST_CATEGORY = createAsyncThunk("DoccSlice/docc_agnst_category", /*
39373
39500
  speciality,
39374
39501
  encoumter,
39375
39502
  practitioner,
39503
+ patient_id,
39376
39504
  data,
39377
39505
  res,
39378
39506
  _args9 = arguments;
@@ -39384,10 +39512,10 @@ var DOCC_AGAINST_CATEGORY = createAsyncThunk("DoccSlice/docc_agnst_category", /*
39384
39512
  payload = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
39385
39513
  _ref18 = _args9.length > 1 ? _args9[1] : undefined, rejectWithValue = _ref18.rejectWithValue, getState = _ref18.getState;
39386
39514
  _context9.prev = 2;
39387
- category = payload.category, speciality = payload.speciality, encoumter = payload.encoumter, practitioner = payload.practitioner;
39515
+ category = payload.category, speciality = payload.speciality, encoumter = payload.encoumter, practitioner = payload.practitioner, patient_id = payload.patient_id;
39388
39516
  _context9.next = 6;
39389
39517
  return fetchData$3({
39390
- body: JSON.stringify(queries$2.doc_agnst_category(category, speciality, encoumter, practitioner))
39518
+ body: JSON.stringify(queries$2.doc_agnst_category(category, speciality, encoumter, practitioner, patient_id))
39391
39519
  }, __readDocumentUrl__);
39392
39520
 
39393
39521
  case 6:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primarycare-binder",
3
- "version": "1.1.110",
3
+ "version": "1.1.113",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",