primarycare-binder 1.1.89 → 1.1.92

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 +220 -28
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -9695,6 +9695,117 @@ var GET_COUNTRY_CODE_LIST = createAsyncThunk("authSlice/country_code_list", /*#_
9695
9695
  }
9696
9696
  }, _callee16, null, [[2, 12]]);
9697
9697
  })));
9698
+ var GET_FACILITY_BY_USERID = createAsyncThunk("authSlice/getFacilityByUserid", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
9699
+ var payload,
9700
+ _ref29,
9701
+ rejectWithValue,
9702
+ _data$result$0$OrgID$,
9703
+ _data$result,
9704
+ _data$result$,
9705
+ _data$result$$OrgID,
9706
+ _payload$username3,
9707
+ username,
9708
+ queries,
9709
+ data,
9710
+ dat,
9711
+ _args17 = arguments;
9712
+
9713
+ return regeneratorRuntime.wrap(function _callee17$(_context17) {
9714
+ while (1) {
9715
+ switch (_context17.prev = _context17.next) {
9716
+ case 0:
9717
+ payload = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
9718
+ _ref29 = _args17.length > 1 ? _args17[1] : undefined, rejectWithValue = _ref29.rejectWithValue;
9719
+ _context17.prev = 2;
9720
+ _payload$username3 = payload.username, username = _payload$username3 === void 0 ? "" : _payload$username3;
9721
+ queries = {
9722
+ "db_name": dbName,
9723
+ "entity": "Person",
9724
+ "filter": "document(document(Person.telecom)[*].system)[*].code == to_Array('email') && document(Person.telecom)[*].value==to_array('".concat(username, "') && Person.activestatus==true"),
9725
+ "return_fields": "keep(Person,'_id','_key','OrgID','Id')"
9726
+ };
9727
+ _context17.next = 7;
9728
+ return fetchData$3({
9729
+ body: JSON.stringify(queries)
9730
+ }, __readDocumentUrl__);
9731
+
9732
+ case 7:
9733
+ data = _context17.sent;
9734
+ dat = (_data$result$0$OrgID$ = data === null || data === void 0 ? void 0 : (_data$result = data.result) === null || _data$result === void 0 ? void 0 : (_data$result$ = _data$result[0]) === null || _data$result$ === void 0 ? void 0 : (_data$result$$OrgID = _data$result$.OrgID) === null || _data$result$$OrgID === void 0 ? void 0 : _data$result$$OrgID[0]) !== null && _data$result$0$OrgID$ !== void 0 ? _data$result$0$OrgID$ : "";
9735
+ debugger;
9736
+ return _context17.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
9737
+ data: dat
9738
+ }));
9739
+
9740
+ case 13:
9741
+ _context17.prev = 13;
9742
+ _context17.t0 = _context17["catch"](2);
9743
+ return _context17.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
9744
+ message: _context17.t0.message
9745
+ })));
9746
+
9747
+ case 16:
9748
+ case "end":
9749
+ return _context17.stop();
9750
+ }
9751
+ }
9752
+ }, _callee17, null, [[2, 13]]);
9753
+ })));
9754
+ var GET_IS_NURSE_TRIAGE_REQUIRED_BY_FACILITY = createAsyncThunk("authSlice/getIsNurseTriageRequiredByFacility", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() {
9755
+ var payload,
9756
+ _ref31,
9757
+ rejectWithValue,
9758
+ _data$result2,
9759
+ _data$result2$,
9760
+ _payload$facilityId,
9761
+ facilityId,
9762
+ queries,
9763
+ data,
9764
+ res,
9765
+ _args18 = arguments;
9766
+
9767
+ return regeneratorRuntime.wrap(function _callee18$(_context18) {
9768
+ while (1) {
9769
+ switch (_context18.prev = _context18.next) {
9770
+ case 0:
9771
+ payload = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
9772
+ _ref31 = _args18.length > 1 ? _args18[1] : undefined, rejectWithValue = _ref31.rejectWithValue;
9773
+ _context18.prev = 2;
9774
+ _payload$facilityId = payload.facilityId, facilityId = _payload$facilityId === void 0 ? "" : _payload$facilityId;
9775
+ debugger;
9776
+ queries = {
9777
+ "db_name": dbName,
9778
+ "entity": "EntityParametersSetup",
9779
+ "filter": "EntityParametersSetup.entityid=='".concat(facilityId, "' && document(EntityParametersSetup.parameterid).code=='ISNURSETRIAGEREQD'"),
9780
+ "return_fields": "EntityParametersSetup"
9781
+ };
9782
+ _context18.next = 8;
9783
+ return fetchData$3({
9784
+ body: JSON.stringify(queries)
9785
+ }, __readDocumentUrl__);
9786
+
9787
+ case 8:
9788
+ data = _context18.sent;
9789
+ res = (data === null || data === void 0 ? void 0 : (_data$result2 = data.result) === null || _data$result2 === void 0 ? void 0 : (_data$result2$ = _data$result2[0]) === null || _data$result2$ === void 0 ? void 0 : _data$result2$.parametervalue) === "N" ? false : true;
9790
+ debugger;
9791
+ return _context18.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
9792
+ data: res
9793
+ }));
9794
+
9795
+ case 14:
9796
+ _context18.prev = 14;
9797
+ _context18.t0 = _context18["catch"](2);
9798
+ return _context18.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
9799
+ message: _context18.t0.message
9800
+ })));
9801
+
9802
+ case 17:
9803
+ case "end":
9804
+ return _context18.stop();
9805
+ }
9806
+ }
9807
+ }, _callee18, null, [[2, 14]]);
9808
+ })));
9698
9809
  var authSlice = createSlice({
9699
9810
  name: "authSlice",
9700
9811
  initialState: {
@@ -9714,7 +9825,9 @@ var authSlice = createSlice({
9714
9825
  changePassword: _objectSpread2({}, defaultState.Info),
9715
9826
  tokenValidate: _objectSpread2({}, defaultState.Info),
9716
9827
  refreshToken: _objectSpread2({}, defaultState.Info),
9717
- country_code_list: _objectSpread2({}, defaultState.Info)
9828
+ country_code_list: _objectSpread2({}, defaultState.Info),
9829
+ getFacilityByUserid: _objectSpread2({}, defaultState.Info),
9830
+ getIsNurseTriageRequiredByFacility: _objectSpread2({}, defaultState.Info)
9718
9831
  },
9719
9832
  extraReducers: (_extraReducers$G = {}, _defineProperty(_extraReducers$G, REGISTER_USERS.fulfilled, function (state, action) {
9720
9833
  var _action$payload;
@@ -9866,6 +9979,26 @@ var authSlice = createSlice({
9866
9979
  var _action$payload30;
9867
9980
 
9868
9981
  state.country_code_list = (_action$payload30 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload30 !== void 0 ? _action$payload30 : {};
9982
+ }), _defineProperty(_extraReducers$G, GET_FACILITY_BY_USERID.fulfilled, function (state, action) {
9983
+ var _action$payload31;
9984
+
9985
+ state.getFacilityByUserid = (_action$payload31 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload31 !== void 0 ? _action$payload31 : {};
9986
+ }), _defineProperty(_extraReducers$G, GET_FACILITY_BY_USERID.pending, function (state, action) {
9987
+ state.getFacilityByUserid.loading = true;
9988
+ }), _defineProperty(_extraReducers$G, GET_FACILITY_BY_USERID.rejected, function (state, action) {
9989
+ var _action$payload32;
9990
+
9991
+ state.getFacilityByUserid = (_action$payload32 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload32 !== void 0 ? _action$payload32 : {};
9992
+ }), _defineProperty(_extraReducers$G, GET_IS_NURSE_TRIAGE_REQUIRED_BY_FACILITY.fulfilled, function (state, action) {
9993
+ var _action$payload33;
9994
+
9995
+ state.getIsNurseTriageRequiredByFacility = (_action$payload33 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload33 !== void 0 ? _action$payload33 : {};
9996
+ }), _defineProperty(_extraReducers$G, GET_IS_NURSE_TRIAGE_REQUIRED_BY_FACILITY.pending, function (state, action) {
9997
+ state.getIsNurseTriageRequiredByFacility.loading = true;
9998
+ }), _defineProperty(_extraReducers$G, GET_IS_NURSE_TRIAGE_REQUIRED_BY_FACILITY.rejected, function (state, action) {
9999
+ var _action$payload34;
10000
+
10001
+ state.getIsNurseTriageRequiredByFacility = (_action$payload34 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload34 !== void 0 ? _action$payload34 : {};
9869
10002
  }), _extraReducers$G)
9870
10003
  });
9871
10004
  var authActions = {
@@ -9883,7 +10016,9 @@ var authActions = {
9883
10016
  CHANGE_PASSWORD: CHANGE_PASSWORD,
9884
10017
  TOKEN_VALIDATE: TOKEN_VALIDATE,
9885
10018
  REFRESH_TOKEN: REFRESH_TOKEN,
9886
- GET_COUNTRY_CODE_LIST: GET_COUNTRY_CODE_LIST
10019
+ GET_COUNTRY_CODE_LIST: GET_COUNTRY_CODE_LIST,
10020
+ GET_FACILITY_BY_USERID: GET_FACILITY_BY_USERID,
10021
+ GET_IS_NURSE_TRIAGE_REQUIRED_BY_FACILITY: GET_IS_NURSE_TRIAGE_REQUIRED_BY_FACILITY
9887
10022
  };
9888
10023
  var authSlice$1 = authSlice.reducer;
9889
10024
 
@@ -11716,12 +11851,16 @@ var ALL_APPOINTMENTS = createAsyncThunk("appointmentReducer/allAppointments", /*
11716
11851
 
11717
11852
  if (type_ === "THIS_WEEK") {
11718
11853
  returnData.pastAppointmentThisWeek.push(v);
11854
+ returnData.pastAppointment.push(v);
11719
11855
  } else if (type_ === "LAST_WEEK") {
11720
11856
  returnData.pastAppointmentLastWeek.push(v);
11857
+ returnData.pastAppointment.push(v);
11721
11858
  } else if (type_ === "THIS_MONTH") {
11722
11859
  returnData.pastAppointmentThisMonth.push(v);
11860
+ returnData.pastAppointment.push(v);
11723
11861
  } else if (type_ === "LAST_MONTH") {
11724
11862
  returnData.pastAppointmentLastMonth.push(v);
11863
+ returnData.pastAppointment.push(v);
11725
11864
  } else {
11726
11865
  returnData.pastAppointment.push(v);
11727
11866
  }
@@ -11735,14 +11874,19 @@ var ALL_APPOINTMENTS = createAsyncThunk("appointmentReducer/allAppointments", /*
11735
11874
 
11736
11875
  if (type_ === "TODAY") {
11737
11876
  returnData.upcomingAppointmentToday.push(v);
11877
+ returnData.upcomingAppointment.push(v);
11738
11878
  } else if (type_ === "THIS_WEEK") {
11739
11879
  returnData.upcomingAppointmentThisWeek.push(v);
11880
+ returnData.upcomingAppointment.push(v);
11740
11881
  } else if (type_ === "NEXT_WEEK") {
11741
11882
  returnData.upcomingAppointmentNextWeek.push(v);
11883
+ returnData.upcomingAppointment.push(v);
11742
11884
  } else if (type_ === "THIS_MONTH") {
11743
11885
  returnData.upcomingAppointmentThisMonth.push(v);
11886
+ returnData.upcomingAppointment.push(v);
11744
11887
  } else if (type_ === "NEXT_MONTH") {
11745
11888
  returnData.upcomingAppointmentNextMonth.push(v);
11889
+ returnData.upcomingAppointment.push(v);
11746
11890
  } else {
11747
11891
  returnData.upcomingAppointment.push(v);
11748
11892
  }
@@ -16866,22 +17010,6 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
16866
17010
  var payload,
16867
17011
  _ref2,
16868
17012
  rejectWithValue,
16869
- _data$Result,
16870
- _data$Result$,
16871
- _data$Result$$propert,
16872
- _data$Result$$propert2,
16873
- _data$Result2,
16874
- _data$Result2$,
16875
- _data$Result2$$proper,
16876
- _data$Result2$$proper2,
16877
- _data$Result3,
16878
- _data$Result3$,
16879
- _data$Result3$$proper,
16880
- _data$Result3$$proper2,
16881
- _data$Result4,
16882
- _data$Result4$,
16883
- _data$Result4$$proper,
16884
- _data$Result4$$proper2,
16885
17013
  _payload$phone,
16886
17014
  phone,
16887
17015
  _payload$dob,
@@ -16905,6 +17033,29 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
16905
17033
  photo,
16906
17034
  _payload$updatedId,
16907
17035
  updatedId,
17036
+ _payload$identifier,
17037
+ identifier,
17038
+ _payload$compare_id,
17039
+ compare_id,
17040
+ id_number,
17041
+ id_type,
17042
+ id_data,
17043
+ _data$Result,
17044
+ _data$Result$,
17045
+ _data$Result$$propert,
17046
+ _data$Result$$propert2,
17047
+ _data$Result2,
17048
+ _data$Result2$,
17049
+ _data$Result2$$proper,
17050
+ _data$Result2$$proper2,
17051
+ _data$Result3,
17052
+ _data$Result3$,
17053
+ _data$Result3$$proper,
17054
+ _data$Result3$$proper2,
17055
+ _data$Result4,
17056
+ _data$Result4$,
17057
+ _data$Result4$$proper,
17058
+ _data$Result4$$proper2,
16908
17059
  imageInfo,
16909
17060
  body,
16910
17061
  data,
@@ -16917,7 +17068,42 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
16917
17068
  payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
16918
17069
  _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
16919
17070
  _context.prev = 2;
16920
- _payload$phone = payload.phone, phone = _payload$phone === void 0 ? "" : _payload$phone, _payload$dob = payload.dob, dob = _payload$dob === void 0 ? "" : _payload$dob, _payload$firstName = payload.firstName, firstName = _payload$firstName === void 0 ? "" : _payload$firstName, _payload$lastName = payload.lastName, lastName = _payload$lastName === void 0 ? "" : _payload$lastName, _payload$middleName = payload.middleName, middleName = _payload$middleName === void 0 ? "" : _payload$middleName, _payload$prefix = payload.prefix, prefix = _payload$prefix === void 0 ? "" : _payload$prefix, _payload$suffix = payload.suffix, suffix = _payload$suffix === void 0 ? "" : _payload$suffix, _payload$use = payload.use, use = _payload$use === void 0 ? "" : _payload$use, _payload$gender = payload.gender, gender = _payload$gender === void 0 ? "" : _payload$gender, _payload$email = payload.email, email = _payload$email === void 0 ? "" : _payload$email, photo = payload.photo, _payload$updatedId = payload.updatedId, updatedId = _payload$updatedId === void 0 ? "" : _payload$updatedId;
17071
+ _payload$phone = payload.phone, phone = _payload$phone === void 0 ? "" : _payload$phone, _payload$dob = payload.dob, dob = _payload$dob === void 0 ? "" : _payload$dob, _payload$firstName = payload.firstName, firstName = _payload$firstName === void 0 ? "" : _payload$firstName, _payload$lastName = payload.lastName, lastName = _payload$lastName === void 0 ? "" : _payload$lastName, _payload$middleName = payload.middleName, middleName = _payload$middleName === void 0 ? "" : _payload$middleName, _payload$prefix = payload.prefix, prefix = _payload$prefix === void 0 ? "" : _payload$prefix, _payload$suffix = payload.suffix, suffix = _payload$suffix === void 0 ? "" : _payload$suffix, _payload$use = payload.use, use = _payload$use === void 0 ? "" : _payload$use, _payload$gender = payload.gender, gender = _payload$gender === void 0 ? "" : _payload$gender, _payload$email = payload.email, email = _payload$email === void 0 ? "" : _payload$email, photo = payload.photo, _payload$updatedId = payload.updatedId, updatedId = _payload$updatedId === void 0 ? "" : _payload$updatedId, _payload$identifier = payload.identifier, identifier = _payload$identifier === void 0 ? [] : _payload$identifier, _payload$compare_id = payload.compare_id, compare_id = _payload$compare_id === void 0 ? [] : _payload$compare_id;
17072
+ console.clear();
17073
+ console.log(compare_id);
17074
+ id_number = compare_id.map(function (x) {
17075
+ return "'".concat(x.id, "'");
17076
+ });
17077
+ id_type = compare_id.map(function (x) {
17078
+ return "'".concat(x.display, "'");
17079
+ });
17080
+ console.log("Hello -".concat(id_number));
17081
+ console.log("Hai - ".concat(id_type));
17082
+ _context.next = 12;
17083
+ return fetchData$3({
17084
+ body: JSON.stringify({
17085
+ "db_name": "primarycare",
17086
+ "entity": "Person",
17087
+ "filter": "first(document(document(Person.identifier)[*].Type)[*].display) in [".concat(id_type, "] && first(document(Person.identifier)[*].value) in [").concat(id_number, "] && Person.activestatus==true"),
17088
+ "return_fields": "merge(Person,{identifier:document(Person.identifier)})"
17089
+ })
17090
+ }, __readDocumentUrl__);
17091
+
17092
+ case 12:
17093
+ id_data = _context.sent;
17094
+
17095
+ if (!((id_data === null || id_data === void 0 ? void 0 : id_data.result.length) > 0)) {
17096
+ _context.next = 17;
17097
+ break;
17098
+ }
17099
+
17100
+ return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
17101
+ data: {
17102
+ error: "Patient Id already exists."
17103
+ }
17104
+ })));
17105
+
17106
+ case 17:
16921
17107
  imageInfo = [];
16922
17108
 
16923
17109
  if (photo) {
@@ -16951,7 +17137,7 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
16951
17137
  is_metadata: true,
16952
17138
  metadataId: query_ids["personApiSlice/upsertPerson"],
16953
17139
  doc: {
16954
- identifier: [],
17140
+ identifier: identifier,
16955
17141
  name: [{
16956
17142
  use: use,
16957
17143
  text: firstName,
@@ -17000,6 +17186,8 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
17000
17186
  OrgID: []
17001
17187
  }
17002
17188
  }];
17189
+ console.log("_________________BODY______________________-");
17190
+ console.log(body);
17003
17191
 
17004
17192
  if (updatedId && updatedId.length > 0) {
17005
17193
  body[0]["filter"] = {
@@ -17008,22 +17196,22 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
17008
17196
  delete body[0]["doc"]["Id"]; //delete body[0]["doc"]["telecom"];
17009
17197
  }
17010
17198
 
17011
- _context.next = 10;
17199
+ _context.next = 25;
17012
17200
  return fetchData$3({
17013
17201
  body: JSON.stringify(body)
17014
17202
  }, __uspsertUrl__);
17015
17203
 
17016
- case 10:
17204
+ case 25:
17017
17205
  data = _context.sent;
17018
17206
 
17019
17207
  if (!data.error) {
17020
- _context.next = 13;
17208
+ _context.next = 28;
17021
17209
  break;
17022
17210
  }
17023
17211
 
17024
17212
  throw new Error(data.error && (typeof data.error === "string" ? data.error : data.message));
17025
17213
 
17026
- case 13:
17214
+ case 28:
17027
17215
  return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
17028
17216
  data: {
17029
17217
  id: (data === null || data === void 0 ? void 0 : (_data$Result = data["Result"]) === null || _data$Result === void 0 ? void 0 : (_data$Result$ = _data$Result[0]) === null || _data$Result$ === void 0 ? void 0 : (_data$Result$$propert = _data$Result$.properties) === null || _data$Result$$propert === void 0 ? void 0 : (_data$Result$$propert2 = _data$Result$$propert.doc) === null || _data$Result$$propert2 === void 0 ? void 0 : _data$Result$$propert2.Id) || 0,
@@ -17033,8 +17221,12 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
17033
17221
  }
17034
17222
  }));
17035
17223
 
17036
- case 16:
17037
- _context.prev = 16;
17224
+ case 29:
17225
+ _context.next = 34;
17226
+ break;
17227
+
17228
+ case 31:
17229
+ _context.prev = 31;
17038
17230
  _context.t0 = _context["catch"](2);
17039
17231
  return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
17040
17232
  data: {
@@ -17042,12 +17234,12 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
17042
17234
  }
17043
17235
  })));
17044
17236
 
17045
- case 19:
17237
+ case 34:
17046
17238
  case "end":
17047
17239
  return _context.stop();
17048
17240
  }
17049
17241
  }
17050
- }, _callee, null, [[2, 16]]);
17242
+ }, _callee, null, [[2, 31]]);
17051
17243
  })));
17052
17244
  var ADD_RELATED_PERSON = createAsyncThunk("personApiSlice/addRelatedPerson", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
17053
17245
  var payload,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primarycare-binder",
3
- "version": "1.1.89",
3
+ "version": "1.1.92",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",