primary_care_admin_binder 0.1.179 → 0.1.180

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 +88 -15
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -12680,6 +12680,13 @@ var queries$n = {
12680
12680
  metadataId: metaDataId$1,
12681
12681
  metadata_dbname: metaDatadbName$1
12682
12682
  }, doc)];
12683
+ },
12684
+ locationtree: function locationtree() {
12685
+ return {
12686
+ appcode: dbName,
12687
+ requestid: "24f4da82-c4ae-40a4-b894-f7cf9dd398d1",
12688
+ filter: {}
12689
+ };
12683
12690
  }
12684
12691
  };
12685
12692
 
@@ -12701,12 +12708,27 @@ var dayslotlist = function dayslotlist(data) {
12701
12708
  var timeslotList = function timeslotList(data) {
12702
12709
  var timeslot_Lists = [];
12703
12710
  if (data && data.length > 0) {
12711
+ var hasValidTime = false;
12704
12712
  data.map(function (val) {
12705
- var timelot_obj = {
12706
- ovrOpeningtime: val.fromTime ? moment.utc(val.fromTime).valueOf() : null,
12707
- ovrClosingtime: val.toTime ? moment.utc(val.toTime).valueOf() : null
12708
- };
12709
- timeslot_Lists.push(timelot_obj);
12713
+ if (val.fromTime || val.toTime) {
12714
+ hasValidTime = true;
12715
+ var timelot_obj = {
12716
+ ovrOpeningtime: val.fromTime ? moment.utc(val.fromTime).valueOf() : null,
12717
+ ovrClosingtime: val.toTime ? moment.utc(val.toTime).valueOf() : null
12718
+ };
12719
+ timeslot_Lists.push(timelot_obj);
12720
+ }
12721
+ });
12722
+ if (!hasValidTime) {
12723
+ timeslot_Lists.push({
12724
+ ovrOpeningtime: moment().startOf("day").valueOf(),
12725
+ ovrClosingtime: moment().endOf("day").valueOf()
12726
+ });
12727
+ }
12728
+ } else {
12729
+ timeslot_Lists.push({
12730
+ ovrOpeningtime: moment().startOf("day").valueOf(),
12731
+ ovrClosingtime: moment().endOf("day").valueOf()
12710
12732
  });
12711
12733
  }
12712
12734
  return timeslot_Lists;
@@ -12796,6 +12818,7 @@ var generateJSON = function generateJSON(data, _key) {
12796
12818
  final_obj = {
12797
12819
  overridetype: "Single",
12798
12820
  ovrfromdate: val.selectDate ? getUtcTime(moment(val.selectDate)) : null,
12821
+ status: val.status || "Available",
12799
12822
  ovrtodate: 0,
12800
12823
  daysOfWeek: [{
12801
12824
  ovrDay: val.selectDate ? moment(val.selectDate).format("ddd") : "",
@@ -12807,6 +12830,7 @@ var generateJSON = function generateJSON(data, _key) {
12807
12830
  final_obj = {
12808
12831
  overridetype: "Multiple",
12809
12832
  ovrfromdate: val.fromDate ? getUtcTime(moment(val.fromDate)) : null,
12833
+ status: val.status || "Available",
12810
12834
  ovrtodate: val.toDate ? getUtcTime(moment(val.toDate)) : null,
12811
12835
  daysOfWeek: dayslotlist(val.daySlots)
12812
12836
  };
@@ -12852,7 +12876,7 @@ var generateJSON = function generateJSON(data, _key) {
12852
12876
  managingOrgEntityType: (_data$entityType$labe = data === null || data === void 0 || (_data$entityType = data.entityType) === null || _data$entityType === void 0 ? void 0 : _data$entityType.label) !== null && _data$entityType$labe !== void 0 ? _data$entityType$labe : null,
12853
12877
  formid: (_data$formid$label = (_data$formid = data.formid) === null || _data$formid === void 0 ? void 0 : _data$formid.label) !== null && _data$formid$label !== void 0 ? _data$formid$label : null,
12854
12878
  typeofcare: (_data$typeofcare$labe = (_data$typeofcare = data.typeofcare) === null || _data$typeofcare === void 0 ? void 0 : _data$typeofcare.label) !== null && _data$typeofcare$labe !== void 0 ? _data$typeofcare$labe : null,
12855
- clinicalInstruction: (_data$clinicalInstruc = data.clinicalInstruction) !== null && _data$clinicalInstruc !== void 0 ? _data$clinicalInstruc : "",
12879
+ clinicalInstruction: (_data$clinicalInstruc = data.clinicalInstruction) !== null && _data$clinicalInstruc !== void 0 ? _data$clinicalInstruc : [],
12856
12880
  workingdayyear: workingDayArr,
12857
12881
  workingdayyearoverride: overRideArr,
12858
12882
  clinicdetails: (_data$clinicDetails = data.clinicDetails) !== null && _data$clinicDetails !== void 0 ? _data$clinicDetails : "",
@@ -12901,14 +12925,14 @@ var LOCATION_READ = createAsyncThunk("locationApiSlice/locationlist", /*#__PURE_
12901
12925
  data = _context.v;
12902
12926
  arry = [];
12903
12927
  data.map(function (val) {
12904
- var _val$locationType$, _val$locationType$2, _val$locationType, _val$locationType2, _val$locationType3, _val$locationType4, _val$managingOrgID, _val$managingOrgID2;
12928
+ var _val$locationType, _val$locationType2, _val$locationType3, _val$locationType4, _val$locationType5, _val$locationType6, _val$managingOrgID, _val$managingOrgID2;
12905
12929
  arry.push({
12906
12930
  location_id: val.locationID,
12907
- location_type: val.locationType.length > 0 ? ((_val$locationType$ = val.locationType[0]) === null || _val$locationType$ === void 0 ? void 0 : _val$locationType$.display) !== null ? (_val$locationType$2 = val.locationType[0]) === null || _val$locationType$2 === void 0 ? void 0 : _val$locationType$2.display : "-" : "-",
12908
- location_type_code: (_val$locationType = val.locationType) === null || _val$locationType === void 0 || (_val$locationType = _val$locationType[0]) === null || _val$locationType === void 0 || (_val$locationType = _val$locationType.coding) === null || _val$locationType === void 0 || (_val$locationType = _val$locationType[0]) === null || _val$locationType === void 0 ? void 0 : _val$locationType.code,
12909
- location_type_name: (_val$locationType2 = val.locationType) === null || _val$locationType2 === void 0 || (_val$locationType2 = _val$locationType2[0]) === null || _val$locationType2 === void 0 || (_val$locationType2 = _val$locationType2.coding) === null || _val$locationType2 === void 0 || (_val$locationType2 = _val$locationType2[0]) === null || _val$locationType2 === void 0 ? void 0 : _val$locationType2.Type,
12910
- location_type_id: (_val$locationType3 = val.locationType) === null || _val$locationType3 === void 0 || (_val$locationType3 = _val$locationType3[0]) === null || _val$locationType3 === void 0 || (_val$locationType3 = _val$locationType3.coding) === null || _val$locationType3 === void 0 || (_val$locationType3 = _val$locationType3[0]) === null || _val$locationType3 === void 0 ? void 0 : _val$locationType3._id,
12911
- location_type_key: (_val$locationType4 = val.locationType) === null || _val$locationType4 === void 0 || (_val$locationType4 = _val$locationType4[0]) === null || _val$locationType4 === void 0 || (_val$locationType4 = _val$locationType4.coding) === null || _val$locationType4 === void 0 || (_val$locationType4 = _val$locationType4[0]) === null || _val$locationType4 === void 0 ? void 0 : _val$locationType4._key,
12931
+ location_type: val.locationType.length > 0 ? ((_val$locationType = val.locationType) === null || _val$locationType === void 0 || (_val$locationType = _val$locationType[0]) === null || _val$locationType === void 0 ? void 0 : _val$locationType.display) !== null ? (_val$locationType2 = val.locationType) === null || _val$locationType2 === void 0 || (_val$locationType2 = _val$locationType2[0]) === null || _val$locationType2 === void 0 ? void 0 : _val$locationType2.display : "-" : "-",
12932
+ location_type_code: (_val$locationType3 = val.locationType) === null || _val$locationType3 === void 0 || (_val$locationType3 = _val$locationType3[0]) === null || _val$locationType3 === void 0 ? void 0 : _val$locationType3.code,
12933
+ location_type_name: (_val$locationType4 = val.locationType) === null || _val$locationType4 === void 0 || (_val$locationType4 = _val$locationType4[0]) === null || _val$locationType4 === void 0 ? void 0 : _val$locationType4.Type,
12934
+ location_type_id: (_val$locationType5 = val.locationType) === null || _val$locationType5 === void 0 || (_val$locationType5 = _val$locationType5[0]) === null || _val$locationType5 === void 0 ? void 0 : _val$locationType5._id,
12935
+ location_type_key: (_val$locationType6 = val.locationType) === null || _val$locationType6 === void 0 || (_val$locationType6 = _val$locationType6[0]) === null || _val$locationType6 === void 0 ? void 0 : _val$locationType6._key,
12912
12936
  long_description: val.longdesc,
12913
12937
  short_description: val.shortdesc,
12914
12938
  organization_name: (_val$managingOrgID = val.managingOrgID) === null || _val$managingOrgID === void 0 ? void 0 : _val$managingOrgID.name,
@@ -12916,7 +12940,7 @@ var LOCATION_READ = createAsyncThunk("locationApiSlice/locationlist", /*#__PURE_
12916
12940
  _key: val._key,
12917
12941
  id: val.id,
12918
12942
  _id: val._id,
12919
- status: val.status === "Active" ? true : false,
12943
+ status: val.status.toLowerCase() === "active" ? true : false,
12920
12944
  active_status: val.activestatus,
12921
12945
  totalCount: val === null || val === void 0 ? void 0 : val.TotalCount
12922
12946
  });
@@ -13008,10 +13032,40 @@ var LOCATION_MASTER_INSERT = createAsyncThunk("locationApiSlice/locationinsert",
13008
13032
  }
13009
13033
  }, _callee3, null, [[1, 3]]);
13010
13034
  })));
13035
+ var LOCATION_TREE_READ = createAsyncThunk("locationApiSlice/locationtree", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
13036
+ var _ref8,
13037
+ rejectWithValue,
13038
+ data,
13039
+ _args4 = arguments,
13040
+ _t4;
13041
+ return _regenerator().w(function (_context4) {
13042
+ while (1) switch (_context4.p = _context4.n) {
13043
+ case 0:
13044
+ _ref8 = _args4.length > 1 ? _args4[1] : undefined, rejectWithValue = _ref8.rejectWithValue;
13045
+ _context4.p = 1;
13046
+ _context4.n = 2;
13047
+ return fetchData({
13048
+ body: JSON.stringify(queries$n.locationtree())
13049
+ }, __baseUrl__$1);
13050
+ case 2:
13051
+ data = _context4.v;
13052
+ return _context4.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
13053
+ data: data
13054
+ }));
13055
+ case 3:
13056
+ _context4.p = 3;
13057
+ _t4 = _context4.v;
13058
+ return _context4.a(2, rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
13059
+ message: _t4.message
13060
+ })));
13061
+ }
13062
+ }, _callee4, null, [[1, 3]]);
13063
+ })));
13011
13064
  var locationSlice = createSlice({
13012
13065
  name: "locationApiSlice",
13013
13066
  initialState: {
13014
13067
  location_list: _objectSpread2({}, defaultState.List),
13068
+ location_tree: _objectSpread2({}, defaultState.List),
13015
13069
  location_list_upsert: _objectSpread2({}, defaultState.List),
13016
13070
  location_insert: _objectSpread2({}, defaultState.List)
13017
13071
  },
@@ -13032,6 +13086,22 @@ var locationSlice = createSlice({
13032
13086
  state.location_list = action.payload;
13033
13087
  });
13034
13088
 
13089
+ // LOCATION MASTER TREE READ
13090
+ builder.addCase(LOCATION_TREE_READ.fulfilled, function (state, action) {
13091
+ state.location_tree.loading = false;
13092
+ state.location_tree.error = false;
13093
+ state.location_tree = action.payload;
13094
+ });
13095
+ builder.addCase(LOCATION_TREE_READ.pending, function (state) {
13096
+ state.location_tree.loading = true;
13097
+ state.location_tree.error = false;
13098
+ });
13099
+ builder.addCase(LOCATION_TREE_READ.rejected, function (state, action) {
13100
+ state.location_tree.loading = false;
13101
+ state.location_tree.error = true;
13102
+ state.location_tree = action.payload;
13103
+ });
13104
+
13035
13105
  // LOCATION MASTER STATUS CHANGE
13036
13106
  builder.addCase(LOCATION_LIST_UPSERT.fulfilled, function (state, action) {
13037
13107
  state.location_list_upsert.loading = false;
@@ -13067,6 +13137,7 @@ var locationSlice = createSlice({
13067
13137
  });
13068
13138
  var locationActions$1 = {
13069
13139
  LOCATION_READ: LOCATION_READ,
13140
+ LOCATION_TREE_READ: LOCATION_TREE_READ,
13070
13141
  LOCATION_LIST_UPSERT: LOCATION_LIST_UPSERT,
13071
13142
  LOCATION_MASTER_INSERT: LOCATION_MASTER_INSERT
13072
13143
  };
@@ -15949,7 +16020,8 @@ var overRideList = function overRideList(data) {
15949
16020
  over_ride_obj = {
15950
16021
  type: "singleDate",
15951
16022
  selectDate: val.ovrfromdate ? moment.unix(val.ovrfromdate) : "",
15952
- timeSlots: overRideTimeslot(val.daysOfWeek[0].operate_time)
16023
+ status: val.status || "Available",
16024
+ timeSlots: overRideTimeslot(val.daysOfWeek && val.daysOfWeek[0] ? val.daysOfWeek[0].operate_time : [])
15953
16025
  };
15954
16026
  overRideArr.push(over_ride_obj);
15955
16027
  } else if (val.overridetype === "Multiple") {
@@ -15957,6 +16029,7 @@ var overRideList = function overRideList(data) {
15957
16029
  type: "dateRange",
15958
16030
  fromDate: val.ovrfromdate ? moment.unix(val.ovrfromdate) : "",
15959
16031
  toDate: val.ovrtodate ? moment.unix(val.ovrtodate) : "",
16032
+ status: val.status || "Available",
15960
16033
  daySlots: overRideDayslot(val.daysOfWeek)
15961
16034
  }, overRideArr.push(over_ride_obj);
15962
16035
  }
@@ -16123,7 +16196,7 @@ var generateReadJSON$4 = function generateReadJSON(data, state) {
16123
16196
  label: "",
16124
16197
  value: ""
16125
16198
  },
16126
- clinicalInstruction: data.clinicalInstruction ? data.clinicalInstruction : "",
16199
+ clinicalInstruction: data.clinicalInstruction ? data.clinicalInstruction : [],
16127
16200
  clinicDetails: data.clinicdetails ? data.clinicdetails : "",
16128
16201
  locationAddress: (_data$address = data.address) !== null && _data$address !== void 0 && (_data$address = _data$address[0]) !== null && _data$address !== void 0 && _data$address.text ? (_data$address2 = data.address) === null || _data$address2 === void 0 || (_data$address2 = _data$address2[0]) === null || _data$address2 === void 0 ? void 0 : _data$address2.text : "",
16129
16202
  longitude: (_data$position = data.position) !== null && _data$position !== void 0 && (_data$position = _data$position[0]) !== null && _data$position !== void 0 && _data$position.longitude ? data.position[0].longitude : "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primary_care_admin_binder",
3
- "version": "0.1.179",
3
+ "version": "0.1.180",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",