primary_care_admin_binder 0.1.178 → 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 +98 -20
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -8487,14 +8487,18 @@ var queries$o = {
8487
8487
  var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
8488
8488
  var perPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
8489
8489
  var search = arguments.length > 2 ? arguments[2] : undefined;
8490
+ var grcid = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
8490
8491
  return {
8491
8492
  appcode: dbName,
8492
8493
  requestid: "b1b6a289-71c1-449a-be57-c6b7cddff699",
8493
- filter: {
8494
- search: "".concat(search),
8494
+ filter: _objectSpread2(_objectSpread2({
8495
+ search: "".concat(search)
8496
+ }, grcid ? {
8497
+ grcid: "".concat(grcid)
8498
+ } : {}), {}, {
8495
8499
  offset: page,
8496
8500
  count: perPage
8497
- }
8501
+ })
8498
8502
  };
8499
8503
  },
8500
8504
  status_update_practitioner: function status_update_practitioner(data) {
@@ -8637,7 +8641,7 @@ var PRACTITIONER_LIST_READ = createAsyncThunk("practitionerSlice/practitioner",
8637
8641
  _context3.p = 1;
8638
8642
  _context3.n = 2;
8639
8643
  return fetchData({
8640
- body: JSON.stringify(queries$o.practitioner_list(payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.search ? payload === null || payload === void 0 ? void 0 : payload.search : ''))
8644
+ body: JSON.stringify(queries$o.practitioner_list(payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.search ? payload === null || payload === void 0 ? void 0 : payload.search : '', payload !== null && payload !== void 0 && payload.grcid ? payload === null || payload === void 0 ? void 0 : payload.grcid : ''))
8641
8645
  }, __baseUrl__$1);
8642
8646
  case 2:
8643
8647
  data = _context3.v;
@@ -8651,7 +8655,8 @@ var PRACTITIONER_LIST_READ = createAsyncThunk("practitionerSlice/practitioner",
8651
8655
  "primaryspeciality": val.Practitionerrole[0] && val.Practitionerrole[0].specialtyid ? (_val$Practitionerrole = val.Practitionerrole[0].specialtyid) === null || _val$Practitionerrole === void 0 ? void 0 : _val$Practitionerrole.display : "-",
8652
8656
  "type": val !== null && val !== void 0 && val.type ? val.type : "-",
8653
8657
  "_key": val === null || val === void 0 ? void 0 : val._key,
8654
- 'status': val === null || val === void 0 ? void 0 : val.status
8658
+ 'status': val === null || val === void 0 ? void 0 : val.status,
8659
+ 'grcid': val === null || val === void 0 ? void 0 : val.grcid
8655
8660
  });
8656
8661
  // }
8657
8662
  });
@@ -12675,6 +12680,13 @@ var queries$n = {
12675
12680
  metadataId: metaDataId$1,
12676
12681
  metadata_dbname: metaDatadbName$1
12677
12682
  }, doc)];
12683
+ },
12684
+ locationtree: function locationtree() {
12685
+ return {
12686
+ appcode: dbName,
12687
+ requestid: "24f4da82-c4ae-40a4-b894-f7cf9dd398d1",
12688
+ filter: {}
12689
+ };
12678
12690
  }
12679
12691
  };
12680
12692
 
@@ -12696,12 +12708,27 @@ var dayslotlist = function dayslotlist(data) {
12696
12708
  var timeslotList = function timeslotList(data) {
12697
12709
  var timeslot_Lists = [];
12698
12710
  if (data && data.length > 0) {
12711
+ var hasValidTime = false;
12699
12712
  data.map(function (val) {
12700
- var timelot_obj = {
12701
- ovrOpeningtime: val.fromTime ? moment.utc(val.fromTime).valueOf() : null,
12702
- ovrClosingtime: val.toTime ? moment.utc(val.toTime).valueOf() : null
12703
- };
12704
- 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()
12705
12732
  });
12706
12733
  }
12707
12734
  return timeslot_Lists;
@@ -12791,6 +12818,7 @@ var generateJSON = function generateJSON(data, _key) {
12791
12818
  final_obj = {
12792
12819
  overridetype: "Single",
12793
12820
  ovrfromdate: val.selectDate ? getUtcTime(moment(val.selectDate)) : null,
12821
+ status: val.status || "Available",
12794
12822
  ovrtodate: 0,
12795
12823
  daysOfWeek: [{
12796
12824
  ovrDay: val.selectDate ? moment(val.selectDate).format("ddd") : "",
@@ -12802,6 +12830,7 @@ var generateJSON = function generateJSON(data, _key) {
12802
12830
  final_obj = {
12803
12831
  overridetype: "Multiple",
12804
12832
  ovrfromdate: val.fromDate ? getUtcTime(moment(val.fromDate)) : null,
12833
+ status: val.status || "Available",
12805
12834
  ovrtodate: val.toDate ? getUtcTime(moment(val.toDate)) : null,
12806
12835
  daysOfWeek: dayslotlist(val.daySlots)
12807
12836
  };
@@ -12847,7 +12876,7 @@ var generateJSON = function generateJSON(data, _key) {
12847
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,
12848
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,
12849
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,
12850
- 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 : [],
12851
12880
  workingdayyear: workingDayArr,
12852
12881
  workingdayyearoverride: overRideArr,
12853
12882
  clinicdetails: (_data$clinicDetails = data.clinicDetails) !== null && _data$clinicDetails !== void 0 ? _data$clinicDetails : "",
@@ -12896,14 +12925,14 @@ var LOCATION_READ = createAsyncThunk("locationApiSlice/locationlist", /*#__PURE_
12896
12925
  data = _context.v;
12897
12926
  arry = [];
12898
12927
  data.map(function (val) {
12899
- 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;
12900
12929
  arry.push({
12901
12930
  location_id: val.locationID,
12902
- 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 : "-" : "-",
12903
- 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,
12904
- 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,
12905
- 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,
12906
- 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,
12907
12936
  long_description: val.longdesc,
12908
12937
  short_description: val.shortdesc,
12909
12938
  organization_name: (_val$managingOrgID = val.managingOrgID) === null || _val$managingOrgID === void 0 ? void 0 : _val$managingOrgID.name,
@@ -12911,7 +12940,7 @@ var LOCATION_READ = createAsyncThunk("locationApiSlice/locationlist", /*#__PURE_
12911
12940
  _key: val._key,
12912
12941
  id: val.id,
12913
12942
  _id: val._id,
12914
- status: val.status === "Active" ? true : false,
12943
+ status: val.status.toLowerCase() === "active" ? true : false,
12915
12944
  active_status: val.activestatus,
12916
12945
  totalCount: val === null || val === void 0 ? void 0 : val.TotalCount
12917
12946
  });
@@ -13003,10 +13032,40 @@ var LOCATION_MASTER_INSERT = createAsyncThunk("locationApiSlice/locationinsert",
13003
13032
  }
13004
13033
  }, _callee3, null, [[1, 3]]);
13005
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
+ })));
13006
13064
  var locationSlice = createSlice({
13007
13065
  name: "locationApiSlice",
13008
13066
  initialState: {
13009
13067
  location_list: _objectSpread2({}, defaultState.List),
13068
+ location_tree: _objectSpread2({}, defaultState.List),
13010
13069
  location_list_upsert: _objectSpread2({}, defaultState.List),
13011
13070
  location_insert: _objectSpread2({}, defaultState.List)
13012
13071
  },
@@ -13027,6 +13086,22 @@ var locationSlice = createSlice({
13027
13086
  state.location_list = action.payload;
13028
13087
  });
13029
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
+
13030
13105
  // LOCATION MASTER STATUS CHANGE
13031
13106
  builder.addCase(LOCATION_LIST_UPSERT.fulfilled, function (state, action) {
13032
13107
  state.location_list_upsert.loading = false;
@@ -13062,6 +13137,7 @@ var locationSlice = createSlice({
13062
13137
  });
13063
13138
  var locationActions$1 = {
13064
13139
  LOCATION_READ: LOCATION_READ,
13140
+ LOCATION_TREE_READ: LOCATION_TREE_READ,
13065
13141
  LOCATION_LIST_UPSERT: LOCATION_LIST_UPSERT,
13066
13142
  LOCATION_MASTER_INSERT: LOCATION_MASTER_INSERT
13067
13143
  };
@@ -15944,7 +16020,8 @@ var overRideList = function overRideList(data) {
15944
16020
  over_ride_obj = {
15945
16021
  type: "singleDate",
15946
16022
  selectDate: val.ovrfromdate ? moment.unix(val.ovrfromdate) : "",
15947
- 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 : [])
15948
16025
  };
15949
16026
  overRideArr.push(over_ride_obj);
15950
16027
  } else if (val.overridetype === "Multiple") {
@@ -15952,6 +16029,7 @@ var overRideList = function overRideList(data) {
15952
16029
  type: "dateRange",
15953
16030
  fromDate: val.ovrfromdate ? moment.unix(val.ovrfromdate) : "",
15954
16031
  toDate: val.ovrtodate ? moment.unix(val.ovrtodate) : "",
16032
+ status: val.status || "Available",
15955
16033
  daySlots: overRideDayslot(val.daysOfWeek)
15956
16034
  }, overRideArr.push(over_ride_obj);
15957
16035
  }
@@ -16118,7 +16196,7 @@ var generateReadJSON$4 = function generateReadJSON(data, state) {
16118
16196
  label: "",
16119
16197
  value: ""
16120
16198
  },
16121
- clinicalInstruction: data.clinicalInstruction ? data.clinicalInstruction : "",
16199
+ clinicalInstruction: data.clinicalInstruction ? data.clinicalInstruction : [],
16122
16200
  clinicDetails: data.clinicdetails ? data.clinicdetails : "",
16123
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 : "",
16124
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.178",
3
+ "version": "0.1.180",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",