primarycare-binder 1.1.109 → 1.1.112

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 +231 -104
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -8180,7 +8180,8 @@ var queries$b = {
8180
8180
  thirdName = _ref2.thirdName;
8181
8181
  return "(LIKE(DOCUMENT(Person.name)[0].text,'%".concat(firstName, "%',true) || LIKE(DOCUMENT(Person.name)[0].given,'%").concat(secondName, "%',true) || LIKE(DOCUMENT(Person.name)[0].family,'%").concat(thirdName, "%',true)) && Person.activestatus == true");
8182
8182
  },
8183
- returnFields: "{prefix: DOCUMENT(Person.name)[*].prefix,gender: Person.gender,birthDate: Person.birthDay,suffix: DOCUMENT(Person.name)[*].suffix, nameObj: DOCUMENT(Person.name)[*], 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)}))},{photo:document(pat.photo)})),telecom: Document(Person.telecom),photo:document(Person.photo)}"
8183
+ returnFields: // "{prefix: DOCUMENT(Person.name)[*].prefix,gender: Person.gender,birthDate: Person.birthDay,suffix: DOCUMENT(Person.name)[*].suffix, nameObj: DOCUMENT(Person.name)[*], 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)}))},{photo:document(pat.photo)})),telecom: Document(Person.telecom),photo:document(Person.photo)}",
8184
+ "{prefix: document(DOCUMENT(Person.name)[*].prefix),gender: Person.gender,birthDate: Person.birthDay,suffix: document(DOCUMENT(Person.name)[*].suffix), nameObj:(for HumanNameMaster in HumanNameMaster filter HumanNameMaster._id in Person.name && HumanNameMaster.activestatus==true return merge(HumanNameMaster,{prefix:document(HumanNameMaster.prefix)},{suffix:document(HumanNameMaster.suffix)},{period:document(HumanNameMaster.period)},{use:document(HumanNameMaster.use)}) ) , 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)}))},{photo:document(pat.photo)})),telecom: Document(Person.telecom),photo:document(Person.photo)}"
8184
8185
  },
8185
8186
  specialityAgainstPractitioner: {
8186
8187
  query: function query() {
@@ -11854,10 +11855,25 @@ var ALL_APPOINTMENTS = createAsyncThunk("appointmentReducer/allAppointments", /*
11854
11855
  } else {
11855
11856
  console.log(utcTOLocal$1(v.start));
11856
11857
  var type_ = timeLine_(v.start);
11857
- console.log(type_); //debugger
11858
+ console.log("type_", type_); //debugger
11858
11859
 
11859
- if (type_ === "TODAY") {
11860
- returnData.currentVisist.push(v); // returnData.pastAppointment.push(v);
11860
+ if (type_ === "TODAY" && v.appstatus === "cancelled") {
11861
+ returnData.pastAppointmentThisWeek.push(v);
11862
+ returnData.pastAppointment.push(v);
11863
+ } else if (type_ === "THIS_WEEK" && v.appstatus === "cancelled") {
11864
+ returnData.pastAppointmentThisWeek.push(v);
11865
+ returnData.pastAppointment.push(v);
11866
+ } else if (type_ === "LAST_WEEK" && v.appstatus === "cancelled") {
11867
+ returnData.pastAppointmentLastWeek.push(v);
11868
+ returnData.pastAppointment.push(v);
11869
+ } else if (type_ === "THIS_MONTH" && v.appstatus === "cancelled") {
11870
+ returnData.pastAppointmentThisMonth.push(v);
11871
+ returnData.pastAppointment.push(v);
11872
+ } else if (type_ === "LAST_MONTH" && v.appstatus === "cancelled") {
11873
+ returnData.pastAppointmentLastMonth.push(v);
11874
+ returnData.pastAppointment.push(v);
11875
+ } else if (type_ === "TODAY") {
11876
+ returnData.currentVisist.push(v);
11861
11877
  } else if (type_ === "NEXT_WEEK") {
11862
11878
  returnData.currentVisist.push(v); // returnData.pastAppointment.push(v);
11863
11879
  } else if (type_ === "THIS_WEEK") {
@@ -12402,14 +12418,67 @@ var GET_SPECIALITY_ID_BY_PRCTITIONER_ID = createAsyncThunk("appointmentReducer/g
12402
12418
  }
12403
12419
  }
12404
12420
  }, _callee13, null, [[2, 12]]);
12405
- }))); // RECCURANCE_APPOINTMENT
12406
-
12407
- 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() {
12408
12423
  var payload,
12409
12424
  _ref29,
12410
12425
  rejectWithValue,
12426
+ _payload$patientId,
12427
+ patientId,
12411
12428
  _payload$start3,
12412
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,
12413
12482
  _payload$practionerid,
12414
12483
  practionerid,
12415
12484
  _payload$clinicid,
@@ -12419,16 +12488,16 @@ var RECCURANCE_APPOINTMENT = createAsyncThunk("appointmentReducer/reccuranceAppo
12419
12488
  queryId,
12420
12489
  body,
12421
12490
  data,
12422
- _args14 = arguments;
12491
+ _args15 = arguments;
12423
12492
 
12424
- return regeneratorRuntime.wrap(function _callee14$(_context14) {
12493
+ return regeneratorRuntime.wrap(function _callee15$(_context15) {
12425
12494
  while (1) {
12426
- switch (_context14.prev = _context14.next) {
12495
+ switch (_context15.prev = _context15.next) {
12427
12496
  case 0:
12428
- payload = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
12429
- _ref29 = _args14.length > 1 ? _args14[1] : undefined, rejectWithValue = _ref29.rejectWithValue;
12430
- _context14.prev = 2;
12431
- _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;
12432
12501
  date = start.map(function (d) {
12433
12502
  var startDate = new Date();
12434
12503
  var endDate = new Date();
@@ -12460,35 +12529,35 @@ var RECCURANCE_APPOINTMENT = createAsyncThunk("appointmentReducer/reccuranceAppo
12460
12529
  slotdate: getUtcTime(new Date())
12461
12530
  })
12462
12531
  };
12463
- _context14.next = 11;
12532
+ _context15.next = 11;
12464
12533
  return fetchData$3({
12465
12534
  body: JSON.stringify(body)
12466
12535
  });
12467
12536
 
12468
12537
  case 11:
12469
- data = _context14.sent;
12470
- return _context14.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12538
+ data = _context15.sent;
12539
+ return _context15.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12471
12540
  data: data
12472
12541
  }));
12473
12542
 
12474
12543
  case 15:
12475
- _context14.prev = 15;
12476
- _context14.t0 = _context14["catch"](2);
12477
- return _context14.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12478
- 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
12479
12548
  })));
12480
12549
 
12481
12550
  case 18:
12482
12551
  case "end":
12483
- return _context14.stop();
12552
+ return _context15.stop();
12484
12553
  }
12485
12554
  }
12486
- }, _callee14, null, [[2, 15]]);
12555
+ }, _callee15, null, [[2, 15]]);
12487
12556
  }))); // UPDATE_APPOINTMENT_STATUS
12488
12557
 
12489
- 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() {
12490
12559
  var payload,
12491
- _ref31,
12560
+ _ref33,
12492
12561
  rejectWithValue,
12493
12562
  _payload$appointmentI2,
12494
12563
  appointmentId,
@@ -12503,7 +12572,7 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12503
12572
  _encounterInfo$result,
12504
12573
  encounterCode,
12505
12574
  encounterInfo,
12506
- _ref32,
12575
+ _ref34,
12507
12576
  _id,
12508
12577
  _key,
12509
12578
  statushistory,
@@ -12511,15 +12580,15 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12511
12580
  appInfo,
12512
12581
  body,
12513
12582
  data,
12514
- _args15 = arguments;
12583
+ _args16 = arguments;
12515
12584
 
12516
- return regeneratorRuntime.wrap(function _callee15$(_context15) {
12585
+ return regeneratorRuntime.wrap(function _callee16$(_context16) {
12517
12586
  while (1) {
12518
- switch (_context15.prev = _context15.next) {
12587
+ switch (_context16.prev = _context16.next) {
12519
12588
  case 0:
12520
- payload = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
12521
- _ref31 = _args15.length > 1 ? _args15[1] : undefined, rejectWithValue = _ref31.rejectWithValue;
12522
- _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;
12523
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 = {
12524
12593
  // db_name: dbName,
12525
12594
  // queryid: query_ids["appointmentReducer/readAppointment"],
@@ -12546,11 +12615,11 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12546
12615
  }
12547
12616
 
12548
12617
  if (!encounterStatus) {
12549
- _context15.next = 20;
12618
+ _context16.next = 20;
12550
12619
  break;
12551
12620
  }
12552
12621
 
12553
- _context15.next = 8;
12622
+ _context16.next = 8;
12554
12623
  return fetchData$3({
12555
12624
  body: JSON.stringify({
12556
12625
  db_name: dbName,
@@ -12561,9 +12630,9 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12561
12630
  }, __readDocumentUrl__);
12562
12631
 
12563
12632
  case 8:
12564
- encounterCode = _context15.sent;
12633
+ encounterCode = _context16.sent;
12565
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 : "";
12566
- _context15.next = 12;
12635
+ _context16.next = 12;
12567
12636
  return fetchData$3({
12568
12637
  body: JSON.stringify({
12569
12638
  db_name: dbName,
@@ -12574,11 +12643,11 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12574
12643
  }, __readDocumentUrl__);
12575
12644
 
12576
12645
  case 12:
12577
- encounterInfo = _context15.sent;
12578
- _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;
12579
12648
 
12580
12649
  if (!(_id && _key && statushistory && Array.isArray(statushistory))) {
12581
- _context15.next = 20;
12650
+ _context16.next = 20;
12582
12651
  break;
12583
12652
  }
12584
12653
 
@@ -12615,7 +12684,7 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12615
12684
  status: encounterStatus
12616
12685
  }
12617
12686
  }];
12618
- _context15.next = 20;
12687
+ _context16.next = 20;
12619
12688
  return fetchData$3({
12620
12689
  body: JSON.stringify(updateData)
12621
12690
  }, __uspsertUrl__);
@@ -12641,34 +12710,34 @@ var UPDATE_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/updateAppoi
12641
12710
  id: appointmentId
12642
12711
  }
12643
12712
  }];
12644
- _context15.next = 26;
12713
+ _context16.next = 26;
12645
12714
  return fetchData$3({
12646
12715
  body: JSON.stringify(body)
12647
12716
  }, __uspsertUrl__);
12648
12717
 
12649
12718
  case 26:
12650
- data = _context15.sent;
12651
- return _context15.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12719
+ data = _context16.sent;
12720
+ return _context16.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12652
12721
  data: data
12653
12722
  }));
12654
12723
 
12655
12724
  case 30:
12656
- _context15.prev = 30;
12657
- _context15.t0 = _context15["catch"](2);
12658
- return _context15.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12659
- 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
12660
12729
  })));
12661
12730
 
12662
12731
  case 33:
12663
12732
  case "end":
12664
- return _context15.stop();
12733
+ return _context16.stop();
12665
12734
  }
12666
12735
  }
12667
- }, _callee15, null, [[2, 30]]);
12736
+ }, _callee16, null, [[2, 30]]);
12668
12737
  })));
12669
- 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() {
12670
12739
  var payload,
12671
- _ref34,
12740
+ _ref36,
12672
12741
  rejectWithValue,
12673
12742
  _appData$,
12674
12743
  _payload$appointmentI3,
@@ -12681,15 +12750,15 @@ var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApooi
12681
12750
  insertObject,
12682
12751
  body,
12683
12752
  data,
12684
- _args16 = arguments;
12753
+ _args17 = arguments;
12685
12754
 
12686
- return regeneratorRuntime.wrap(function _callee16$(_context16) {
12755
+ return regeneratorRuntime.wrap(function _callee17$(_context17) {
12687
12756
  while (1) {
12688
- switch (_context16.prev = _context16.next) {
12757
+ switch (_context17.prev = _context17.next) {
12689
12758
  case 0:
12690
- payload = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
12691
- _ref34 = _args16.length > 1 ? _args16[1] : undefined, rejectWithValue = _ref34.rejectWithValue;
12692
- _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;
12693
12762
  _payload$appointmentI3 = payload.appointmentId, appointmentId = _payload$appointmentI3 === void 0 ? 0 : _payload$appointmentI3, _payload$reason = payload.reason, reason = _payload$reason === void 0 ? "" : _payload$reason;
12694
12763
  appBody = {
12695
12764
  db_name: dbName,
@@ -12698,17 +12767,17 @@ var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApooi
12698
12767
  appointment_id: appointmentId
12699
12768
  }
12700
12769
  };
12701
- _context16.next = 7;
12770
+ _context17.next = 7;
12702
12771
  return fetchData$3({
12703
12772
  body: JSON.stringify(appBody)
12704
12773
  });
12705
12774
 
12706
12775
  case 7:
12707
- appData = _context16.sent;
12776
+ appData = _context17.sent;
12708
12777
  appInfo = (appData === null || appData === void 0 ? void 0 : (_appData$ = appData[0]) === null || _appData$ === void 0 ? void 0 : _appData$[0]) || {};
12709
12778
 
12710
12779
  if (!(Object.keys(appInfo).length > 0)) {
12711
- _context16.next = 19;
12780
+ _context17.next = 19;
12712
12781
  break;
12713
12782
  }
12714
12783
 
@@ -12729,53 +12798,53 @@ var CANCEL_APPOINTMENT_STATUS = createAsyncThunk("appointmentReducer/cancelApooi
12729
12798
  id: appointmentId
12730
12799
  }
12731
12800
  }];
12732
- _context16.next = 17;
12801
+ _context17.next = 17;
12733
12802
  return fetchData$3({
12734
12803
  body: JSON.stringify(body)
12735
12804
  }, __uspsertUrl__);
12736
12805
 
12737
12806
  case 17:
12738
- data = _context16.sent;
12739
- return _context16.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12807
+ data = _context17.sent;
12808
+ return _context17.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12740
12809
  data: data
12741
12810
  }));
12742
12811
 
12743
12812
  case 19:
12744
- _context16.next = 24;
12813
+ _context17.next = 24;
12745
12814
  break;
12746
12815
 
12747
12816
  case 21:
12748
- _context16.prev = 21;
12749
- _context16.t0 = _context16["catch"](2);
12750
- return _context16.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12751
- 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
12752
12821
  })));
12753
12822
 
12754
12823
  case 24:
12755
12824
  case "end":
12756
- return _context16.stop();
12825
+ return _context17.stop();
12757
12826
  }
12758
12827
  }
12759
- }, _callee16, null, [[2, 21]]);
12828
+ }, _callee17, null, [[2, 21]]);
12760
12829
  }))); // REASON_FOR_APPT_CANCEL_MODIFY
12761
12830
 
12762
- 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() {
12763
12832
  var payload,
12764
- _ref36,
12833
+ _ref38,
12765
12834
  rejectWithValue,
12766
12835
  body,
12767
12836
  data,
12768
12837
  returnData,
12769
12838
  _data$result3,
12770
- _args17 = arguments;
12839
+ _args18 = arguments;
12771
12840
 
12772
- return regeneratorRuntime.wrap(function _callee17$(_context17) {
12841
+ return regeneratorRuntime.wrap(function _callee18$(_context18) {
12773
12842
  while (1) {
12774
- switch (_context17.prev = _context17.next) {
12843
+ switch (_context18.prev = _context18.next) {
12775
12844
  case 0:
12776
- payload = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
12777
- _ref36 = _args17.length > 1 ? _args17[1] : undefined, rejectWithValue = _ref36.rejectWithValue;
12778
- _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;
12779
12848
  body = {
12780
12849
  db_name: dbName,
12781
12850
  entity: "CodingMaster",
@@ -12783,13 +12852,13 @@ var REASON_FOR_APPT_CANCEL_MODIFY = createAsyncThunk("appointmentReducer/reasonF
12783
12852
  sort: "CodingMaster.display ASC",
12784
12853
  return_fields: "KEEP(CodingMaster,'_id','id','_key','code','display','Type')"
12785
12854
  };
12786
- _context17.next = 6;
12855
+ _context18.next = 6;
12787
12856
  return fetchData$3({
12788
12857
  body: JSON.stringify(body)
12789
12858
  }, __readDocumentUrl__);
12790
12859
 
12791
12860
  case 6:
12792
- data = _context17.sent;
12861
+ data = _context18.sent;
12793
12862
  returnData = [];
12794
12863
 
12795
12864
  if (Array.isArray(data === null || data === void 0 ? void 0 : data.result)) {
@@ -12804,23 +12873,23 @@ var REASON_FOR_APPT_CANCEL_MODIFY = createAsyncThunk("appointmentReducer/reasonF
12804
12873
  });
12805
12874
  }
12806
12875
 
12807
- return _context17.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12876
+ return _context18.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
12808
12877
  data: returnData
12809
12878
  }));
12810
12879
 
12811
12880
  case 12:
12812
- _context17.prev = 12;
12813
- _context17.t0 = _context17["catch"](2);
12814
- return _context17.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
12815
- 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
12816
12885
  })));
12817
12886
 
12818
12887
  case 15:
12819
12888
  case "end":
12820
- return _context17.stop();
12889
+ return _context18.stop();
12821
12890
  }
12822
12891
  }
12823
- }, _callee17, null, [[2, 12]]);
12892
+ }, _callee18, null, [[2, 12]]);
12824
12893
  }))); // APPOINTMENT CREATE INITIALSTATE
12825
12894
 
12826
12895
  var appointmentReducer = createSlice({
@@ -12845,7 +12914,8 @@ var appointmentReducer = createSlice({
12845
12914
  follow_up_appintment: _objectSpread2({}, defaultState.Info),
12846
12915
  reasonForApptCancelModify: _objectSpread2({}, defaultState.Info),
12847
12916
  getReferralLocation: _objectSpread2({}, defaultState.List),
12848
- getSpecialityIdByPractitionerId: _objectSpread2({}, defaultState.Info)
12917
+ getSpecialityIdByPractitionerId: _objectSpread2({}, defaultState.Info),
12918
+ checkAppointmentAgainstPatient: _objectSpread2({}, defaultState.Info)
12849
12919
  },
12850
12920
  extraReducers: (_extraReducers$D = {}, _defineProperty(_extraReducers$D, APPOINTMENT_CREATE.fulfilled, function (state, action) {
12851
12921
  var _action$payload;
@@ -13017,6 +13087,16 @@ var appointmentReducer = createSlice({
13017
13087
  var _action$payload34;
13018
13088
 
13019
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 : [];
13020
13100
  }), _extraReducers$D)
13021
13101
  }); // end
13022
13102
  // APPOINTMENT ACTION LISTS
@@ -13038,7 +13118,8 @@ var appointmentActions = {
13038
13118
  GET__FOLLOW_UP_APPOINTMENT: GET__FOLLOW_UP_APPOINTMENT,
13039
13119
  REASON_FOR_APPT_CANCEL_MODIFY: REASON_FOR_APPT_CANCEL_MODIFY,
13040
13120
  GET_REFERRAL_LOCATION: GET_REFERRAL_LOCATION,
13041
- 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
13042
13123
  }; // end
13043
13124
  var appointmentReducer$1 = appointmentReducer.reducer;
13044
13125
 
@@ -18456,6 +18537,7 @@ var ORGANIZATION_VISIT_REGISTRATION = createAsyncThunk("OrganizationRegisterPati
18456
18537
  rejectWithValue,
18457
18538
  payloaddata,
18458
18539
  enId,
18540
+ encounterId,
18459
18541
  body,
18460
18542
  data,
18461
18543
  _args2 = arguments;
@@ -18468,7 +18550,7 @@ var ORGANIZATION_VISIT_REGISTRATION = createAsyncThunk("OrganizationRegisterPati
18468
18550
  _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
18469
18551
  debugger;
18470
18552
  _context2.prev = 3;
18471
- payloaddata = payload.payloaddata, enId = payload.enId;
18553
+ payloaddata = payload.payloaddata, enId = payload.enId, encounterId = payload.encounterId;
18472
18554
 
18473
18555
  if (enId) {
18474
18556
  body = [_objectSpread2({
@@ -18480,6 +18562,16 @@ var ORGANIZATION_VISIT_REGISTRATION = createAsyncThunk("OrganizationRegisterPati
18480
18562
  },
18481
18563
  metadataId: "04ecb73d-f048-44ce-8563-c9be015812dd"
18482
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)];
18483
18575
  } else {
18484
18576
  body = [_objectSpread2({
18485
18577
  db_name: dbName,
@@ -22720,7 +22812,7 @@ var queries$a = {
22720
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 }"),
22721
22813
  symptoms: "{\n \"db_name\": \"".concat(dbName, "\",\n \"entity\": \"SymptomsMapping\",\n \"return_fields\": \"SymptomsMapping\"\n }"),
22722
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 }"),
22723
- 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 }"),
22724
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 }"),
22725
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 }"),
22726
22818
  encounterBasedCC: function encounterBasedCC(encounter_id) {
@@ -28848,6 +28940,7 @@ var generateJSON$3 = function generateJSON(dataList) {
28848
28940
  };
28849
28941
 
28850
28942
  var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28943
+ debugger;
28851
28944
  var payload = dataList.map(function (data, i) {
28852
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;
28853
28946
 
@@ -28891,7 +28984,7 @@ var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28891
28984
  orderMode: data === null || data === void 0 ? void 0 : data.orderMode,
28892
28985
  priority: data === null || data === void 0 ? void 0 : data.priority,
28893
28986
  orderDateTime: data === null || data === void 0 ? void 0 : data.orderDateTime,
28894
- 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,
28895
28988
  occuranceEndDate: (_data$occuranceEndDat = data === null || data === void 0 ? void 0 : data.occuranceEndDate) !== null && _data$occuranceEndDat !== void 0 ? _data$occuranceEndDat : 0,
28896
28989
  orderQty: (_data$orderQty = data === null || data === void 0 ? void 0 : data.orderQty) !== null && _data$orderQty !== void 0 ? _data$orderQty : 0,
28897
28990
  orderUOM: "",
@@ -28900,7 +28993,7 @@ var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28900
28993
  workflowStatus: "",
28901
28994
  billQty: 0,
28902
28995
  orderPrivilegeLevel: 0,
28903
- apptDate: vId,
28996
+ apptDate: !edit ? getActualDate$2(vId, data === null || data === void 0 ? void 0 : data.starts_on) : vId,
28904
28997
  apptRefNum: "",
28905
28998
  Requestor: _toConsumableArray(data === null || data === void 0 ? void 0 : data.Requestor),
28906
28999
  reasonCode: (_data$reasonCode = data === null || data === void 0 ? void 0 : data.reasonCode) !== null && _data$reasonCode !== void 0 ? _data$reasonCode : "",
@@ -28913,7 +29006,7 @@ var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28913
29006
  freqRateUnit: "",
28914
29007
  duration: 0,
28915
29008
  durationType: "",
28916
- parentOrderId: edit ? data.editId : editIds ? editIds : "",
29009
+ parentOrderId: edit ? data === null || data === void 0 ? void 0 : data.parentOrderId : editIds ? editIds : "",
28917
29010
  orderGroupRefId: "",
28918
29011
  specimenRelated: [{
28919
29012
  reqd: data.specimenRelated[0].reqd,
@@ -28956,6 +29049,17 @@ var childJSON$2 = function childJSON(dataList, editIds, edit, vId) {
28956
29049
  return payload;
28957
29050
  };
28958
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
+
28959
29063
  var queries$6 = {
28960
29064
  laborder_read: function laborder_read(encounter_id, order_id) {
28961
29065
  return {
@@ -31758,7 +31862,7 @@ var DRUGMASTER_MASTER = createAsyncThunk("MedicationMastersSlice/drugMaster_mast
31758
31862
  data = _context2.sent;
31759
31863
  arr = [];
31760
31864
  data.result.map(function (val) {
31761
- 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;
31762
31866
 
31763
31867
  var json = {
31764
31868
  value: val === null || val === void 0 ? void 0 : val._id,
@@ -31771,12 +31875,15 @@ var DRUGMASTER_MASTER = createAsyncThunk("MedicationMastersSlice/drugMaster_mast
31771
31875
  drugTypeLong: val === null || val === void 0 ? void 0 : (_val$DrugType2 = val.DrugType) === null || _val$DrugType2 === void 0 ? void 0 : _val$DrugType2.longdesc,
31772
31876
  drugTypeShort: val === null || val === void 0 ? void 0 : (_val$DrugType3 = val.DrugType) === null || _val$DrugType3 === void 0 ? void 0 : _val$DrugType3.shortdesc,
31773
31877
  drugTypeId: val === null || val === void 0 ? void 0 : (_val$DrugType4 = val.DrugType) === null || _val$DrugType4 === void 0 ? void 0 : _val$DrugType4._id,
31774
- 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
31775
31881
 
31776
31882
  };
31777
31883
  arr.push(_objectSpread2(_objectSpread2({}, json), {}, {
31778
- name: val.ShortDesc,
31779
- 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}`,
31780
31887
 
31781
31888
  }));
31782
31889
  });
@@ -34726,7 +34833,7 @@ var childJSON$1 = function childJSON(dataList, editIds, edit, vId) {
34726
34833
  orderMode: data === null || data === void 0 ? void 0 : data.orderMode,
34727
34834
  priority: data === null || data === void 0 ? void 0 : data.priority,
34728
34835
  orderDateTime: data === null || data === void 0 ? void 0 : data.orderDateTime,
34729
- 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,
34730
34837
  occuranceEndDate: (_data$occuranceEndDat = data === null || data === void 0 ? void 0 : data.occuranceEndDate) !== null && _data$occuranceEndDat !== void 0 ? _data$occuranceEndDat : 0,
34731
34838
  orderQty: (_data$orderQty = data === null || data === void 0 ? void 0 : data.orderQty) !== null && _data$orderQty !== void 0 ? _data$orderQty : 0,
34732
34839
  orderUOM: "",
@@ -34735,7 +34842,7 @@ var childJSON$1 = function childJSON(dataList, editIds, edit, vId) {
34735
34842
  workflowStatus: "",
34736
34843
  billQty: 0,
34737
34844
  orderPrivilegeLevel: 0,
34738
- apptDate: vId,
34845
+ apptDate: !edit ? getActualDate$1(vId, data === null || data === void 0 ? void 0 : data.starts_on) : vId,
34739
34846
  apptRefNum: "",
34740
34847
  Requestor: _toConsumableArray(data === null || data === void 0 ? void 0 : data.Requestor),
34741
34848
  reasonCode: (_data$reasonCode = data === null || data === void 0 ? void 0 : data.reasonCode) !== null && _data$reasonCode !== void 0 ? _data$reasonCode : "",
@@ -34748,7 +34855,7 @@ var childJSON$1 = function childJSON(dataList, editIds, edit, vId) {
34748
34855
  freqRateUnit: "",
34749
34856
  duration: 0,
34750
34857
  durationType: "",
34751
- parentOrderId: edit ? data.editId : editIds ? editIds : "",
34858
+ parentOrderId: edit ? data === null || data === void 0 ? void 0 : data.parentOrderId : editIds ? editIds : "",
34752
34859
  orderGroupRefId: "",
34753
34860
  performer: _toConsumableArray(data === null || data === void 0 ? void 0 : data.performer),
34754
34861
  notes: (_data$notes = data === null || data === void 0 ? void 0 : data.notes) !== null && _data$notes !== void 0 ? _data$notes : "",
@@ -34780,6 +34887,16 @@ var childJSON$1 = function childJSON(dataList, editIds, edit, vId) {
34780
34887
  return payload;
34781
34888
  };
34782
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
+
34783
34900
  var _extraReducers$f;
34784
34901
  var TREATMENT_PROCEDURE_SAVE = createAsyncThunk("DiagnosisMasterSlice/savetreatment", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
34785
34902
  var payload,
@@ -36652,7 +36769,7 @@ var childJSON = function childJSON(dataList, editIds, edit, vId) {
36652
36769
  orderMode: data === null || data === void 0 ? void 0 : data.orderMode,
36653
36770
  priority: data === null || data === void 0 ? void 0 : data.priority,
36654
36771
  orderDateTime: data === null || data === void 0 ? void 0 : data.orderDateTime,
36655
- 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,
36656
36773
  occuranceEndDate: (_data$occuranceEndDat = data === null || data === void 0 ? void 0 : data.occuranceEndDate) !== null && _data$occuranceEndDat !== void 0 ? _data$occuranceEndDat : 0,
36657
36774
  orderQty: (_data$orderQty = data === null || data === void 0 ? void 0 : data.orderQty) !== null && _data$orderQty !== void 0 ? _data$orderQty : 0,
36658
36775
  orderUOM: "",
@@ -36661,7 +36778,7 @@ var childJSON = function childJSON(dataList, editIds, edit, vId) {
36661
36778
  workflowStatus: "",
36662
36779
  billQty: 0,
36663
36780
  orderPrivilegeLevel: 0,
36664
- apptDate: vId,
36781
+ apptDate: !edit ? getActualDate(vId, data === null || data === void 0 ? void 0 : data.starts_on) : vId,
36665
36782
  apptRefNum: "",
36666
36783
  Requestor: _toConsumableArray(data === null || data === void 0 ? void 0 : data.Requestor),
36667
36784
  reasonCode: (_data$reasonCode = data === null || data === void 0 ? void 0 : data.reasonCode) !== null && _data$reasonCode !== void 0 ? _data$reasonCode : "",
@@ -36674,7 +36791,7 @@ var childJSON = function childJSON(dataList, editIds, edit, vId) {
36674
36791
  freqRateUnit: "",
36675
36792
  duration: 0,
36676
36793
  durationType: "",
36677
- parentOrderId: edit ? data.editId : editIds ? editIds : "",
36794
+ parentOrderId: edit ? data === null || data === void 0 ? void 0 : data.parentOrderId : editIds ? editIds : "",
36678
36795
  orderGroupRefId: "",
36679
36796
  performer: _toConsumableArray(data === null || data === void 0 ? void 0 : data.performer),
36680
36797
  notes: (_data$notes = data === null || data === void 0 ? void 0 : data.notes) !== null && _data$notes !== void 0 ? _data$notes : "",
@@ -36706,6 +36823,16 @@ var childJSON = function childJSON(dataList, editIds, edit, vId) {
36706
36823
  return payload;
36707
36824
  };
36708
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
+
36709
36836
  var _extraReducers$e;
36710
36837
  var READ_RAD_CHILD = createAsyncThunk("RadiologySlice/rad_child", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
36711
36838
  var payload,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primarycare-binder",
3
- "version": "1.1.109",
3
+ "version": "1.1.112",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",