primarycare-binder 1.1.38 → 1.1.42

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 +615 -490
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -8391,6 +8391,271 @@ var urls = (_urls = {
8391
8391
  get_hospitals_locality: "/api/v1/getHospitalBasedonLocality"
8392
8392
  }, _defineProperty(_urls, "get_cities", "/api/v1/getCityFromHospital"), _defineProperty(_urls, "get_symptoms", "/api/v1/getSymptoms"), _defineProperty(_urls, "get_speciality", "/api/v1/getSpeciality"), _defineProperty(_urls, "upsert_service", "/api/v1/upsertService"), _defineProperty(_urls, "read_service", "/api/v1/readService"), _defineProperty(_urls, "delete_service", "/api/v1/deleteService"), _defineProperty(_urls, "upsert_slot", "/api/v1/upsertSlot"), _defineProperty(_urls, "read_slot", "api/v1/readSlot"), _defineProperty(_urls, "delete_slot", "api/v1/deleteSlot"), _defineProperty(_urls, "slot_availability", "api/v1/readAvailibalityChecking"), _defineProperty(_urls, "upsert_task", "api/v1/upsertTask"), _defineProperty(_urls, "read_task", "api/v1/readTask"), _defineProperty(_urls, "delete_task", "api/v1/deleteTask"), _defineProperty(_urls, "upsert_schedule", "api/v1/upsertSchedule"), _defineProperty(_urls, "read_schedule", "api/v1/readSchedule"), _defineProperty(_urls, "delete_schedule", "api/v1/deleteSchedule"), _defineProperty(_urls, "upsert_person", "api/v1/upsertPerson"), _defineProperty(_urls, "read_person", "api/v1/readPerson"), _defineProperty(_urls, "delete_person", "api/v1/deletePerson"), _defineProperty(_urls, "upsert_practitioner_role", "api/v1/upsertPractitionerRole"), _defineProperty(_urls, "read_practitioner_role", "api/v1/readPractitionerRole"), _defineProperty(_urls, "delete_practitioner_role", "api/v1/deletePractitionerRole"), _defineProperty(_urls, "get_user_info", "api/v1/getUserInfo"), _defineProperty(_urls, "oraganization_registration", "api/v1/orgUserRegistration"), _defineProperty(_urls, "oraganization_siginIn", "".concat(__keyClockLogin__, "/api/v1/orgUserSignIn")), _defineProperty(_urls, "oraganization_registet_patient", "api/v1/upsert_document"), _urls);
8393
8393
 
8394
+ var makeName = function makeName() {
8395
+ var _prefix$coding, _prefix$coding$, _suffix$coding, _suffix$coding$;
8396
+
8397
+ var nameObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8398
+ var _nameObj$prefix = nameObj.prefix,
8399
+ prefix = _nameObj$prefix === void 0 ? "" : _nameObj$prefix,
8400
+ _nameObj$text = nameObj.text,
8401
+ text = _nameObj$text === void 0 ? "" : _nameObj$text,
8402
+ _nameObj$given = nameObj.given,
8403
+ given = _nameObj$given === void 0 ? "" : _nameObj$given,
8404
+ _nameObj$family = nameObj.family,
8405
+ family = _nameObj$family === void 0 ? "" : _nameObj$family,
8406
+ _nameObj$suffix = nameObj.suffix,
8407
+ suffix = _nameObj$suffix === void 0 ? "" : _nameObj$suffix;
8408
+ var prefixVal = (prefix === null || prefix === void 0 ? void 0 : (_prefix$coding = prefix.coding) === null || _prefix$coding === void 0 ? void 0 : (_prefix$coding$ = _prefix$coding[0]) === null || _prefix$coding$ === void 0 ? void 0 : _prefix$coding$.display) || "";
8409
+ var suffixVal = (suffix === null || suffix === void 0 ? void 0 : (_suffix$coding = suffix.coding) === null || _suffix$coding === void 0 ? void 0 : (_suffix$coding$ = _suffix$coding[0]) === null || _suffix$coding$ === void 0 ? void 0 : _suffix$coding$.display) || "";
8410
+ return "".concat(prefixVal && prefixVal + ".").concat(text && text + " ").concat(given && given + " ").concat(family && family + " ").concat(suffixVal && suffixVal);
8411
+ };
8412
+
8413
+ var fetchData$3 = /*#__PURE__*/function () {
8414
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(input) {
8415
+ var url,
8416
+ __options,
8417
+ res,
8418
+ data,
8419
+ _args = arguments;
8420
+
8421
+ return regeneratorRuntime.wrap(function _callee$(_context) {
8422
+ while (1) {
8423
+ switch (_context.prev = _context.next) {
8424
+ case 0:
8425
+ url = _args.length > 1 && _args[1] !== undefined ? _args[1] : __baseUrl__;
8426
+ __options = {
8427
+ method: "POST",
8428
+ headers: {
8429
+ "Content-Type": "application/json"
8430
+ },
8431
+ body: {}
8432
+ };
8433
+ _context.next = 4;
8434
+ return fetch(url, _objectSpread2(_objectSpread2({}, __options), input));
8435
+
8436
+ case 4:
8437
+ res = _context.sent;
8438
+ _context.next = 7;
8439
+ return res.json();
8440
+
8441
+ case 7:
8442
+ data = _context.sent;
8443
+ return _context.abrupt("return", data);
8444
+
8445
+ case 9:
8446
+ case "end":
8447
+ return _context.stop();
8448
+ }
8449
+ }
8450
+ }, _callee);
8451
+ }));
8452
+
8453
+ return function fetchData(_x) {
8454
+ return _ref3.apply(this, arguments);
8455
+ };
8456
+ }();
8457
+
8458
+ var getImgUrl = function getImgUrl(fileId) {
8459
+ return fileId ? "".concat(__imgdownloadBaseUrl__).concat(fileId) : "";
8460
+ };
8461
+
8462
+ var getUtcTime = function getUtcTime(date) {
8463
+ if (date) {
8464
+ return moment.utc(date).unix();
8465
+ } else {
8466
+ return moment.utc().unix();
8467
+ }
8468
+ };
8469
+
8470
+ var utcTOLocal$1 = function utcTOLocal(date, format) {
8471
+ var Ndate = new Date();
8472
+
8473
+ if (typeof date === "number") {
8474
+ Ndate = moment.unix(date);
8475
+ } else {
8476
+ Ndate = moment(date);
8477
+ }
8478
+
8479
+ var fmt = format ? format : "DD-MM-YYYY";
8480
+ return moment.utc(Ndate).local().format(fmt);
8481
+ }; // const getUtcTime = (date) => {
8482
+ // let a = null
8483
+ // if (date) {
8484
+ // a = new Date(date)
8485
+ // } else {
8486
+ // a = new Date()
8487
+ // }
8488
+ // a = a.toUTCString()
8489
+ // return ((new Date(a).getTime())/1000)
8490
+ // };
8491
+ // const utcTOLocal = (date, format) => {
8492
+ // let Ndate = new Date(date * 1000);
8493
+ // let fmt = format ? format : "DD-MM-YYYY"
8494
+ // if (format) {
8495
+ // return moment(Ndate).format(fmt);
8496
+ // } else {
8497
+ // return moment(Ndate)
8498
+ // }
8499
+ // };
8500
+
8501
+
8502
+ var deg2rad = function deg2rad(deg) {
8503
+ return deg * (Math.PI / 180);
8504
+ };
8505
+
8506
+ var getDisctanceFromLatLonInKm = function getDisctanceFromLatLonInKm(lat1, lon1, lat2, lon2) {
8507
+ var R = 6371; // Radius of the earth in km
8508
+
8509
+ var dLat = deg2rad(lat2 - lat1); // deg2rad below
8510
+
8511
+ var dLon = deg2rad(lon2 - lon1);
8512
+ var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
8513
+ var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
8514
+ var d = R * c; // Distance in km
8515
+
8516
+ return parseFloat(d).toFixed(2);
8517
+ };
8518
+
8519
+ var getLocation = function getLocation() {
8520
+ return new es6Promise.Promise(function (resolve, reject) {
8521
+ navigator.geolocation.getCurrentPosition(function (position) {
8522
+ var lat = position.coords.latitude;
8523
+ var _long = position.coords.longitude;
8524
+ resolve([false, {
8525
+ lat: lat,
8526
+ "long": _long
8527
+ }]);
8528
+ }, function (error) {
8529
+ resolve([true, error]);
8530
+ });
8531
+ });
8532
+ };
8533
+
8534
+ var getCurrentPosition = /*#__PURE__*/function () {
8535
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
8536
+ var permission, lat, _long2, _yield$getLocation, _yield$getLocation2, err, currLocation;
8537
+
8538
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
8539
+ while (1) {
8540
+ switch (_context2.prev = _context2.next) {
8541
+ case 0:
8542
+ _context2.next = 2;
8543
+ return navigator.permissions.query({
8544
+ name: 'geolocation'
8545
+ })["catch"](function (err) {
8546
+ return {
8547
+ state: 'denied'
8548
+ };
8549
+ });
8550
+
8551
+ case 2:
8552
+ permission = _context2.sent;
8553
+
8554
+ if (!(permission.state !== 'denied')) {
8555
+ _context2.next = 11;
8556
+ break;
8557
+ }
8558
+
8559
+ _context2.next = 6;
8560
+ return getLocation();
8561
+
8562
+ case 6:
8563
+ _yield$getLocation = _context2.sent;
8564
+ _yield$getLocation2 = _slicedToArray(_yield$getLocation, 2);
8565
+ err = _yield$getLocation2[0];
8566
+ currLocation = _yield$getLocation2[1];
8567
+
8568
+ if (!err) {
8569
+ lat = currLocation.lat;
8570
+ _long2 = currLocation["long"];
8571
+ }
8572
+
8573
+ case 11:
8574
+ return _context2.abrupt("return", {
8575
+ lat: lat,
8576
+ "long": _long2
8577
+ });
8578
+
8579
+ case 12:
8580
+ case "end":
8581
+ return _context2.stop();
8582
+ }
8583
+ }
8584
+ }, _callee2);
8585
+ }));
8586
+
8587
+ return function getCurrentPosition() {
8588
+ return _ref4.apply(this, arguments);
8589
+ };
8590
+ }();
8591
+
8592
+ var getLatLong = /*#__PURE__*/function () {
8593
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(city) {
8594
+ var _resp$results, _resp$results$, _resp$results$$geomet, _resp$results$$geomet2, _resp$results2, _resp$results2$, _resp$results2$$geome, _resp$results2$$geome2;
8595
+
8596
+ var url, data, resp, lat, _long3, _resp$results3, _resp$results3$, _resp$results3$$geome, _resp$results3$$geome2, _resp$results4, _resp$results4$, _resp$results4$$geome, _resp$results4$$geome2;
8597
+
8598
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
8599
+ while (1) {
8600
+ switch (_context3.prev = _context3.next) {
8601
+ case 0:
8602
+ url = "https://maps.googleapis.com/maps/api/geocode/json?address=".concat(city, "&key=AIzaSyBqeACJgp12OLU6EkHeUtFgya2naH1LhrU");
8603
+ _context3.next = 3;
8604
+ return fetch(url);
8605
+
8606
+ case 3:
8607
+ data = _context3.sent;
8608
+ _context3.next = 6;
8609
+ return data.json();
8610
+
8611
+ case 6:
8612
+ resp = _context3.sent;
8613
+
8614
+ if ((resp === null || resp === void 0 ? void 0 : (_resp$results = resp.results) === null || _resp$results === void 0 ? void 0 : (_resp$results$ = _resp$results[0]) === null || _resp$results$ === void 0 ? void 0 : (_resp$results$$geomet = _resp$results$.geometry) === null || _resp$results$$geomet === void 0 ? void 0 : (_resp$results$$geomet2 = _resp$results$$geomet.location) === null || _resp$results$$geomet2 === void 0 ? void 0 : _resp$results$$geomet2.lat) && (resp === null || resp === void 0 ? void 0 : (_resp$results2 = resp.results) === null || _resp$results2 === void 0 ? void 0 : (_resp$results2$ = _resp$results2[0]) === null || _resp$results2$ === void 0 ? void 0 : (_resp$results2$$geome = _resp$results2$.geometry) === null || _resp$results2$$geome === void 0 ? void 0 : (_resp$results2$$geome2 = _resp$results2$$geome.location) === null || _resp$results2$$geome2 === void 0 ? void 0 : _resp$results2$$geome2.lng)) {
8615
+ lat = resp === null || resp === void 0 ? void 0 : (_resp$results3 = resp.results) === null || _resp$results3 === void 0 ? void 0 : (_resp$results3$ = _resp$results3[0]) === null || _resp$results3$ === void 0 ? void 0 : (_resp$results3$$geome = _resp$results3$.geometry) === null || _resp$results3$$geome === void 0 ? void 0 : (_resp$results3$$geome2 = _resp$results3$$geome.location) === null || _resp$results3$$geome2 === void 0 ? void 0 : _resp$results3$$geome2.lat;
8616
+ _long3 = resp === null || resp === void 0 ? void 0 : (_resp$results4 = resp.results) === null || _resp$results4 === void 0 ? void 0 : (_resp$results4$ = _resp$results4[0]) === null || _resp$results4$ === void 0 ? void 0 : (_resp$results4$$geome = _resp$results4$.geometry) === null || _resp$results4$$geome === void 0 ? void 0 : (_resp$results4$$geome2 = _resp$results4$$geome.location) === null || _resp$results4$$geome2 === void 0 ? void 0 : _resp$results4$$geome2.lng;
8617
+ }
8618
+
8619
+ return _context3.abrupt("return", {
8620
+ lat: lat,
8621
+ "long": _long3
8622
+ });
8623
+
8624
+ case 9:
8625
+ case "end":
8626
+ return _context3.stop();
8627
+ }
8628
+ }
8629
+ }, _callee3);
8630
+ }));
8631
+
8632
+ return function getLatLong(_x2) {
8633
+ return _ref5.apply(this, arguments);
8634
+ };
8635
+ }(); // Get age using moment
8636
+
8637
+
8638
+ var getAge = function getAge(date) {
8639
+ if (date) {
8640
+ var yearDiff = moment().diff(moment(date, 'DD/MM/YYYY'), 'years', false);
8641
+
8642
+ if (yearDiff > 0) {
8643
+ return yearDiff + ' Y';
8644
+ }
8645
+
8646
+ var monthDiff = moment().diff(moment(date, 'DD/MM/YYYY'), 'months', false);
8647
+
8648
+ if (monthDiff > 0) {
8649
+ return monthDiff + ' M';
8650
+ }
8651
+
8652
+ var dayDiff = moment().diff(moment(date, 'DD/MM/YYYY'), 'days', false);
8653
+ return dayDiff + ' D';
8654
+ }
8655
+
8656
+ return "";
8657
+ };
8658
+
8394
8659
  var _extraReducers$F;
8395
8660
  var __options$a = {
8396
8661
  method: "POST",
@@ -9194,543 +9459,352 @@ var DELETE_USER = createAsyncThunk("authSlice/deleteUser", /*#__PURE__*/_asyncTo
9194
9459
  }
9195
9460
  }, _callee15, null, [[2, 15]]);
9196
9461
  })));
9197
- var authSlice = createSlice({
9198
- name: "authSlice",
9199
- initialState: {
9200
- registerUsers: _objectSpread2({}, defaultState.Info),
9201
- generateOTP: _objectSpread2({}, defaultState.Info),
9202
- resendOTP: _objectSpread2({}, defaultState.Info),
9203
- signIn: _objectSpread2({}, defaultState.Info),
9204
- logout: _objectSpread2({}, defaultState.Info),
9205
- guestInfo: _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
9206
- isGuest: false
9207
- }),
9208
- loggedUserInfo: _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
9209
- isSignedIn: false
9210
- }),
9211
- forgotPassword: _objectSpread2({}, defaultState.Info),
9212
- deleteUser: _objectSpread2({}, defaultState.Info),
9213
- changePassword: _objectSpread2({}, defaultState.Info),
9214
- tokenValidate: _objectSpread2({}, defaultState.Info),
9215
- refreshToken: _objectSpread2({}, defaultState.Info)
9216
- },
9217
- extraReducers: (_extraReducers$F = {}, _defineProperty(_extraReducers$F, REGISTER_USERS.fulfilled, function (state, action) {
9218
- var _action$payload;
9219
-
9220
- state.registerUsers = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
9221
- }), _defineProperty(_extraReducers$F, REGISTER_USERS.pending, function (state, action) {
9222
- state.registerUsers.loading = true;
9223
- }), _defineProperty(_extraReducers$F, REGISTER_USERS.rejected, function (state, action) {
9224
- var _action$payload2;
9225
-
9226
- state.registerUsers = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
9227
- }), _defineProperty(_extraReducers$F, DELETE_USER.fulfilled, function (state, action) {
9228
- var _action$payload3;
9229
-
9230
- state.deleteUser = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
9231
- }), _defineProperty(_extraReducers$F, DELETE_USER.pending, function (state, action) {
9232
- state.deleteUser.loading = true;
9233
- }), _defineProperty(_extraReducers$F, DELETE_USER.rejected, function (state, action) {
9234
- var _action$payload4;
9235
-
9236
- state.deleteUser = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
9237
- }), _defineProperty(_extraReducers$F, GENERATE_OTP.fulfilled, function (state, action) {
9238
- var _action$payload5;
9239
-
9240
- state.generateOTP = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
9241
- }), _defineProperty(_extraReducers$F, GENERATE_OTP.pending, function (state, action) {
9242
- state.generateOTP.loading = true;
9243
- }), _defineProperty(_extraReducers$F, GENERATE_OTP.rejected, function (state, action) {
9244
- var _action$payload6;
9245
-
9246
- state.generateOTP = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
9247
- }), _defineProperty(_extraReducers$F, RESEND_OTP.fulfilled, function (state, action) {
9248
- var _action$payload7;
9249
-
9250
- state.resendOTP = (_action$payload7 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload7 !== void 0 ? _action$payload7 : {};
9251
- }), _defineProperty(_extraReducers$F, RESEND_OTP.pending, function (state, action) {
9252
- state.resendOTP.loading = true;
9253
- }), _defineProperty(_extraReducers$F, RESEND_OTP.rejected, function (state, action) {
9254
- var _action$payload8;
9255
-
9256
- state.resendOTP = (_action$payload8 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload8 !== void 0 ? _action$payload8 : {};
9257
- }), _defineProperty(_extraReducers$F, SIGN_IN.fulfilled, function (state, action) {
9258
- var _action$payload9;
9259
-
9260
- state.signIn = (_action$payload9 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload9 !== void 0 ? _action$payload9 : {};
9261
- }), _defineProperty(_extraReducers$F, SIGN_IN.pending, function (state, action) {
9262
- state.signIn.loading = true;
9263
- }), _defineProperty(_extraReducers$F, SIGN_IN.rejected, function (state, action) {
9264
- var _action$payload10;
9265
-
9266
- state.signIn = (_action$payload10 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload10 !== void 0 ? _action$payload10 : {};
9267
- }), _defineProperty(_extraReducers$F, LOG_OUT.fulfilled, function (state, action) {
9268
- var _action$payload11;
9269
-
9270
- state.logout = (_action$payload11 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload11 !== void 0 ? _action$payload11 : {};
9271
- }), _defineProperty(_extraReducers$F, LOG_OUT.pending, function (state, action) {
9272
- state.logout.loading = true;
9273
- }), _defineProperty(_extraReducers$F, LOG_OUT.rejected, function (state, action) {
9274
- var _action$payload12;
9275
-
9276
- state.logout = (_action$payload12 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload12 !== void 0 ? _action$payload12 : {};
9277
- }), _defineProperty(_extraReducers$F, FORGOT_PASSWORD.fulfilled, function (state, action) {
9278
- var _action$payload13;
9279
-
9280
- state.forgotPassword = (_action$payload13 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload13 !== void 0 ? _action$payload13 : {};
9281
- }), _defineProperty(_extraReducers$F, FORGOT_PASSWORD.pending, function (state, action) {
9282
- state.forgotPassword.loading = true;
9283
- }), _defineProperty(_extraReducers$F, FORGOT_PASSWORD.rejected, function (state, action) {
9284
- var _action$payload14;
9285
-
9286
- state.forgotPassword = (_action$payload14 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload14 !== void 0 ? _action$payload14 : {};
9287
- }), _defineProperty(_extraReducers$F, GUEST_INFO.fulfilled, function (state, action) {
9288
- var _action$payload15;
9289
-
9290
- state.guestInfo = (_action$payload15 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload15 !== void 0 ? _action$payload15 : {};
9291
- }), _defineProperty(_extraReducers$F, GUEST_INFO.pending, function (state, action) {
9292
- state.guestInfo.loading = true;
9293
- }), _defineProperty(_extraReducers$F, GUEST_INFO.rejected, function (state, action) {
9294
- var _action$payload16;
9295
-
9296
- state.guestInfo = (_action$payload16 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload16 !== void 0 ? _action$payload16 : {};
9297
- }), _defineProperty(_extraReducers$F, LOGGED_USER_INFO.fulfilled, function (state, action) {
9298
- var _action$payload17;
9299
-
9300
- state.loggedUserInfo = (_action$payload17 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload17 !== void 0 ? _action$payload17 : {};
9301
- }), _defineProperty(_extraReducers$F, LOGGED_USER_INFO.pending, function (state, action) {
9302
- state.loggedUserInfo.loading = true;
9303
- }), _defineProperty(_extraReducers$F, LOGGED_USER_INFO.rejected, function (state, action) {
9304
- var _action$payload18;
9305
-
9306
- state.loggedUserInfo = (_action$payload18 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload18 !== void 0 ? _action$payload18 : {};
9307
- }), _defineProperty(_extraReducers$F, GET_USER_INFO.fulfilled, function (state, action) {
9308
- var _action$payload19;
9309
-
9310
- state.loggedUserInfo = (_action$payload19 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload19 !== void 0 ? _action$payload19 : {};
9311
- }), _defineProperty(_extraReducers$F, GET_USER_INFO.pending, function (state, action) {
9312
- state.loggedUserInfo.loading = true;
9313
- }), _defineProperty(_extraReducers$F, GET_USER_INFO.rejected, function (state, action) {
9314
- var _action$payload20;
9315
-
9316
- state.loggedUserInfo = (_action$payload20 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload20 !== void 0 ? _action$payload20 : {};
9317
- }), _defineProperty(_extraReducers$F, GET_ORG_USER_INFO.fulfilled, function (state, action) {
9318
- var _action$payload21;
9319
-
9320
- state.loggedUserInfo = (_action$payload21 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload21 !== void 0 ? _action$payload21 : {};
9321
- }), _defineProperty(_extraReducers$F, GET_ORG_USER_INFO.pending, function (state, action) {
9322
- state.loggedUserInfo.loading = true;
9323
- }), _defineProperty(_extraReducers$F, GET_ORG_USER_INFO.rejected, function (state, action) {
9324
- var _action$payload22;
9325
-
9326
- state.loggedUserInfo = (_action$payload22 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload22 !== void 0 ? _action$payload22 : {};
9327
- }), _defineProperty(_extraReducers$F, CHANGE_PASSWORD.fulfilled, function (state, action) {
9328
- var _action$payload23;
9329
-
9330
- state.changePassword = (_action$payload23 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload23 !== void 0 ? _action$payload23 : {};
9331
- }), _defineProperty(_extraReducers$F, CHANGE_PASSWORD.pending, function (state, action) {
9332
- state.changePassword.loading = true;
9333
- }), _defineProperty(_extraReducers$F, CHANGE_PASSWORD.rejected, function (state, action) {
9334
- var _action$payload24;
9335
-
9336
- state.changePassword = (_action$payload24 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload24 !== void 0 ? _action$payload24 : {};
9337
- }), _defineProperty(_extraReducers$F, TOKEN_VALIDATE.fulfilled, function (state, action) {
9338
- var _action$payload25;
9339
-
9340
- state.tokenValidate = (_action$payload25 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload25 !== void 0 ? _action$payload25 : {};
9341
- }), _defineProperty(_extraReducers$F, TOKEN_VALIDATE.pending, function (state, action) {
9342
- state.tokenValidate.loading = true;
9343
- }), _defineProperty(_extraReducers$F, TOKEN_VALIDATE.rejected, function (state, action) {
9344
- var _action$payload26;
9345
-
9346
- state.tokenValidate = (_action$payload26 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload26 !== void 0 ? _action$payload26 : {};
9347
- }), _defineProperty(_extraReducers$F, REFRESH_TOKEN.fulfilled, function (state, action) {
9348
- var _action$payload27;
9349
-
9350
- state.refreshToken = (_action$payload27 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload27 !== void 0 ? _action$payload27 : {};
9351
- }), _defineProperty(_extraReducers$F, REFRESH_TOKEN.pending, function (state, action) {
9352
- state.refreshToken.loading = true;
9353
- }), _defineProperty(_extraReducers$F, REFRESH_TOKEN.rejected, function (state, action) {
9354
- var _action$payload28;
9355
-
9356
- state.refreshToken = (_action$payload28 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload28 !== void 0 ? _action$payload28 : {};
9357
- }), _extraReducers$F)
9358
- });
9359
- var authActions = {
9360
- REGISTER_USERS: REGISTER_USERS,
9361
- GENERATE_OTP: GENERATE_OTP,
9362
- RESEND_OTP: RESEND_OTP,
9363
- SIGN_IN: SIGN_IN,
9364
- LOG_OUT: LOG_OUT,
9365
- GUEST_INFO: GUEST_INFO,
9366
- LOGGED_USER_INFO: LOGGED_USER_INFO,
9367
- FORGOT_PASSWORD: FORGOT_PASSWORD,
9368
- GET_USER_INFO: GET_USER_INFO,
9369
- GET_ORG_USER_INFO: GET_ORG_USER_INFO,
9370
- DELETE_USER: DELETE_USER,
9371
- CHANGE_PASSWORD: CHANGE_PASSWORD,
9372
- TOKEN_VALIDATE: TOKEN_VALIDATE,
9373
- REFRESH_TOKEN: REFRESH_TOKEN
9374
- };
9375
- var authSlice$1 = authSlice.reducer;
9376
-
9377
- var _extraReducers$E;
9378
- var __options$9 = {
9379
- method: "POST",
9380
- headers: {
9381
- "Content-Type": "text/plain"
9382
- },
9383
- body: {}
9384
- }; // FUZZY_SEARCH
9385
-
9386
- var FUZZY_SEARCH = createAsyncThunk("fuzzySearchReducer/fuzzySearch", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
9462
+ var GET_COUNTRY_CODE_LIST = createAsyncThunk("authSlice/country_code_list", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
9387
9463
  var payload,
9388
- _ref2,
9464
+ _ref27,
9389
9465
  rejectWithValue,
9390
- _payload$db_name,
9391
- db_name,
9392
- _payload$entity,
9393
- entity,
9394
- _payload$filter,
9395
- filter,
9396
- _payload$value,
9397
- value,
9398
- _,
9399
- _args = arguments;
9466
+ queries,
9467
+ data,
9468
+ arry,
9469
+ _args16 = arguments;
9400
9470
 
9401
- return regeneratorRuntime.wrap(function _callee$(_context) {
9471
+ return regeneratorRuntime.wrap(function _callee16$(_context16) {
9402
9472
  while (1) {
9403
- switch (_context.prev = _context.next) {
9473
+ switch (_context16.prev = _context16.next) {
9404
9474
  case 0:
9405
- payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
9406
- _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
9407
- _context.prev = 2;
9408
- _payload$db_name = payload.db_name, db_name = _payload$db_name === void 0 ? "primarycare" : _payload$db_name, _payload$entity = payload.entity, entity = _payload$entity === void 0 ? "Person" : _payload$entity, _payload$filter = payload.filter, filter = _payload$filter === void 0 ? "" : _payload$filter, _payload$value = payload.value, value = _payload$value === void 0 ? "" : _payload$value;
9409
- _context.next = 6;
9410
- return fetch(urls.fuzzy_search, _objectSpread2(_objectSpread2({}, __options$9), {}, {
9411
- body: btoa(JSON.stringify({
9412
- "db_name": db_name,
9413
- "entity": entity,
9414
- "filter": filter,
9415
- "value": value
9416
- }))
9417
- }));
9475
+ payload = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
9476
+ _ref27 = _args16.length > 1 ? _args16[1] : undefined, rejectWithValue = _ref27.rejectWithValue;
9477
+ _context16.prev = 2;
9478
+ queries = {
9479
+ "db_name": dbName,
9480
+ "entity": "SMGeographicMaster",
9481
+ "sort": "SMGeographicMaster.GeoLocationISDCode",
9482
+ "filter": "lower(document(SMGeographicMaster.geogLevelType).display)=='country' && SMGeographicMaster.activestatus == true && SMGeographicMaster.active == true",
9483
+ "return_fields": "{_id:SMGeographicMaster._id,id:SMGeographicMaster.id,geogLevelName:SMGeographicMaster.geogLevelName,parentGeogLevelType:SMGeographicMaster.parentGeogLevelType,parentGeogLevelCode:SMGeographicMaster.parentGeogLevelCode,GeoLocationISDCode:SMGeographicMaster.GeoLocationISDCode}"
9484
+ };
9485
+ _context16.next = 6;
9486
+ return fetchData$3({
9487
+ body: JSON.stringify(queries)
9488
+ }, __readDocumentUrl__);
9418
9489
 
9419
9490
  case 6:
9420
- _ = _context.sent;
9421
- _context.next = 9;
9422
- return _.json();
9491
+ data = _context16.sent;
9492
+ arry = [];
9493
+ data.result.map(function (value) {
9494
+ var _value$GeoLocationISD;
9423
9495
 
9424
- case 9:
9425
- _ = _context.sent;
9426
- return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
9427
- data: _
9496
+ arry.push({
9497
+ name: value.geogLevelName,
9498
+ flag: "https://upload.wikimedia.org/wikipedia/en/4/41/Flag_of_India.svg",
9499
+ altSpellings: value._id,
9500
+ callingCodes: value === null || value === void 0 ? void 0 : (_value$GeoLocationISD = value.GeoLocationISDCode) === null || _value$GeoLocationISD === void 0 ? void 0 : _value$GeoLocationISD.replaceAll("+", "") // label: value.GeoLocationISDCode,
9501
+ // value: value._id,
9502
+ // ...value
9503
+
9504
+ });
9505
+ });
9506
+ return _context16.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
9507
+ data: arry
9428
9508
  }));
9429
9509
 
9430
- case 13:
9431
- _context.prev = 13;
9432
- _context.t0 = _context["catch"](2);
9433
- return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
9434
- message: _context.t0.message
9510
+ case 12:
9511
+ _context16.prev = 12;
9512
+ _context16.t0 = _context16["catch"](2);
9513
+ return _context16.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
9514
+ message: _context16.t0.message
9435
9515
  })));
9436
9516
 
9437
- case 16:
9517
+ case 15:
9438
9518
  case "end":
9439
- return _context.stop();
9519
+ return _context16.stop();
9440
9520
  }
9441
9521
  }
9442
- }, _callee, null, [[2, 13]]);
9443
- }))); // end
9444
- // FUZZY SEARCH CREATE INITIALSTATE
9445
-
9446
- var fuzzySearchReducer = createSlice({
9447
- name: "fuzzySearchReducer",
9522
+ }, _callee16, null, [[2, 12]]);
9523
+ })));
9524
+ var authSlice = createSlice({
9525
+ name: "authSlice",
9448
9526
  initialState: {
9449
- fuzzySearch: _objectSpread2({}, defaultState.Info)
9527
+ registerUsers: _objectSpread2({}, defaultState.Info),
9528
+ generateOTP: _objectSpread2({}, defaultState.Info),
9529
+ resendOTP: _objectSpread2({}, defaultState.Info),
9530
+ signIn: _objectSpread2({}, defaultState.Info),
9531
+ logout: _objectSpread2({}, defaultState.Info),
9532
+ guestInfo: _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
9533
+ isGuest: false
9534
+ }),
9535
+ loggedUserInfo: _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
9536
+ isSignedIn: false
9537
+ }),
9538
+ forgotPassword: _objectSpread2({}, defaultState.Info),
9539
+ deleteUser: _objectSpread2({}, defaultState.Info),
9540
+ changePassword: _objectSpread2({}, defaultState.Info),
9541
+ tokenValidate: _objectSpread2({}, defaultState.Info),
9542
+ refreshToken: _objectSpread2({}, defaultState.Info),
9543
+ country_code_list: _objectSpread2({}, defaultState.Info)
9450
9544
  },
9451
- extraReducers: (_extraReducers$E = {}, _defineProperty(_extraReducers$E, FUZZY_SEARCH.fulfilled, function (state, action) {
9545
+ extraReducers: (_extraReducers$F = {}, _defineProperty(_extraReducers$F, REGISTER_USERS.fulfilled, function (state, action) {
9452
9546
  var _action$payload;
9453
9547
 
9454
- state.fuzzySearch = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
9455
- }), _defineProperty(_extraReducers$E, FUZZY_SEARCH.pending, function (state, action) {
9456
- state.fuzzySearch.loading = true;
9457
- }), _defineProperty(_extraReducers$E, FUZZY_SEARCH.rejected, function (state, action) {
9548
+ state.registerUsers = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
9549
+ }), _defineProperty(_extraReducers$F, REGISTER_USERS.pending, function (state, action) {
9550
+ state.registerUsers.loading = true;
9551
+ }), _defineProperty(_extraReducers$F, REGISTER_USERS.rejected, function (state, action) {
9458
9552
  var _action$payload2;
9459
9553
 
9460
- state.fuzzySearch = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
9461
- }), _extraReducers$E)
9462
- }); // end
9463
- // FUZZY SEARCH CREATE ACTION LISTS
9464
-
9465
- var fuzzySearchActions = {
9466
- FUZZY_SEARCH: FUZZY_SEARCH
9467
- }; // end
9468
- var fuzzySearchReducer$1 = fuzzySearchReducer.reducer;
9469
-
9470
- var makeName = function makeName() {
9471
- var _prefix$coding, _prefix$coding$, _suffix$coding, _suffix$coding$;
9472
-
9473
- var nameObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9474
- var _nameObj$prefix = nameObj.prefix,
9475
- prefix = _nameObj$prefix === void 0 ? "" : _nameObj$prefix,
9476
- _nameObj$text = nameObj.text,
9477
- text = _nameObj$text === void 0 ? "" : _nameObj$text,
9478
- _nameObj$given = nameObj.given,
9479
- given = _nameObj$given === void 0 ? "" : _nameObj$given,
9480
- _nameObj$family = nameObj.family,
9481
- family = _nameObj$family === void 0 ? "" : _nameObj$family,
9482
- _nameObj$suffix = nameObj.suffix,
9483
- suffix = _nameObj$suffix === void 0 ? "" : _nameObj$suffix;
9484
- var prefixVal = (prefix === null || prefix === void 0 ? void 0 : (_prefix$coding = prefix.coding) === null || _prefix$coding === void 0 ? void 0 : (_prefix$coding$ = _prefix$coding[0]) === null || _prefix$coding$ === void 0 ? void 0 : _prefix$coding$.display) || "";
9485
- var suffixVal = (suffix === null || suffix === void 0 ? void 0 : (_suffix$coding = suffix.coding) === null || _suffix$coding === void 0 ? void 0 : (_suffix$coding$ = _suffix$coding[0]) === null || _suffix$coding$ === void 0 ? void 0 : _suffix$coding$.display) || "";
9486
- return "".concat(prefixVal && prefixVal + ".").concat(text && text + " ").concat(given && given + " ").concat(family && family + " ").concat(suffixVal && suffixVal);
9487
- };
9488
-
9489
- var fetchData$3 = /*#__PURE__*/function () {
9490
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(input) {
9491
- var url,
9492
- __options,
9493
- res,
9494
- data,
9495
- _args = arguments;
9496
-
9497
- return regeneratorRuntime.wrap(function _callee$(_context) {
9498
- while (1) {
9499
- switch (_context.prev = _context.next) {
9500
- case 0:
9501
- url = _args.length > 1 && _args[1] !== undefined ? _args[1] : __baseUrl__;
9502
- __options = {
9503
- method: "POST",
9504
- headers: {
9505
- "Content-Type": "application/json"
9506
- },
9507
- body: {}
9508
- };
9509
- _context.next = 4;
9510
- return fetch(url, _objectSpread2(_objectSpread2({}, __options), input));
9511
-
9512
- case 4:
9513
- res = _context.sent;
9514
- _context.next = 7;
9515
- return res.json();
9516
-
9517
- case 7:
9518
- data = _context.sent;
9519
- return _context.abrupt("return", data);
9520
-
9521
- case 9:
9522
- case "end":
9523
- return _context.stop();
9524
- }
9525
- }
9526
- }, _callee);
9527
- }));
9528
-
9529
- return function fetchData(_x) {
9530
- return _ref3.apply(this, arguments);
9531
- };
9532
- }();
9533
-
9534
- var getImgUrl = function getImgUrl(fileId) {
9535
- return fileId ? "".concat(__imgdownloadBaseUrl__).concat(fileId) : "";
9536
- };
9554
+ state.registerUsers = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
9555
+ }), _defineProperty(_extraReducers$F, DELETE_USER.fulfilled, function (state, action) {
9556
+ var _action$payload3;
9537
9557
 
9538
- var getUtcTime = function getUtcTime(date) {
9539
- if (date) {
9540
- return moment.utc(date).unix();
9541
- } else {
9542
- return moment.utc().unix();
9543
- }
9544
- };
9558
+ state.deleteUser = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : {};
9559
+ }), _defineProperty(_extraReducers$F, DELETE_USER.pending, function (state, action) {
9560
+ state.deleteUser.loading = true;
9561
+ }), _defineProperty(_extraReducers$F, DELETE_USER.rejected, function (state, action) {
9562
+ var _action$payload4;
9545
9563
 
9546
- var utcTOLocal$1 = function utcTOLocal(date, format) {
9547
- var Ndate = new Date();
9564
+ state.deleteUser = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : {};
9565
+ }), _defineProperty(_extraReducers$F, GENERATE_OTP.fulfilled, function (state, action) {
9566
+ var _action$payload5;
9548
9567
 
9549
- if (typeof date === "number") {
9550
- Ndate = moment.unix(date);
9551
- } else {
9552
- Ndate = moment(date);
9553
- }
9568
+ state.generateOTP = (_action$payload5 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload5 !== void 0 ? _action$payload5 : {};
9569
+ }), _defineProperty(_extraReducers$F, GENERATE_OTP.pending, function (state, action) {
9570
+ state.generateOTP.loading = true;
9571
+ }), _defineProperty(_extraReducers$F, GENERATE_OTP.rejected, function (state, action) {
9572
+ var _action$payload6;
9554
9573
 
9555
- var fmt = format ? format : "DD-MM-YYYY";
9556
- return moment.utc(Ndate).local().format(fmt);
9557
- }; // const getUtcTime = (date) => {
9558
- // let a = null
9559
- // if (date) {
9560
- // a = new Date(date)
9561
- // } else {
9562
- // a = new Date()
9563
- // }
9564
- // a = a.toUTCString()
9565
- // return ((new Date(a).getTime())/1000)
9566
- // };
9567
- // const utcTOLocal = (date, format) => {
9568
- // let Ndate = new Date(date * 1000);
9569
- // let fmt = format ? format : "DD-MM-YYYY"
9570
- // if (format) {
9571
- // return moment(Ndate).format(fmt);
9572
- // } else {
9573
- // return moment(Ndate)
9574
- // }
9575
- // };
9574
+ state.generateOTP = (_action$payload6 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload6 !== void 0 ? _action$payload6 : {};
9575
+ }), _defineProperty(_extraReducers$F, RESEND_OTP.fulfilled, function (state, action) {
9576
+ var _action$payload7;
9576
9577
 
9578
+ state.resendOTP = (_action$payload7 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload7 !== void 0 ? _action$payload7 : {};
9579
+ }), _defineProperty(_extraReducers$F, RESEND_OTP.pending, function (state, action) {
9580
+ state.resendOTP.loading = true;
9581
+ }), _defineProperty(_extraReducers$F, RESEND_OTP.rejected, function (state, action) {
9582
+ var _action$payload8;
9577
9583
 
9578
- var deg2rad = function deg2rad(deg) {
9579
- return deg * (Math.PI / 180);
9580
- };
9584
+ state.resendOTP = (_action$payload8 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload8 !== void 0 ? _action$payload8 : {};
9585
+ }), _defineProperty(_extraReducers$F, SIGN_IN.fulfilled, function (state, action) {
9586
+ var _action$payload9;
9581
9587
 
9582
- var getDisctanceFromLatLonInKm = function getDisctanceFromLatLonInKm(lat1, lon1, lat2, lon2) {
9583
- var R = 6371; // Radius of the earth in km
9588
+ state.signIn = (_action$payload9 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload9 !== void 0 ? _action$payload9 : {};
9589
+ }), _defineProperty(_extraReducers$F, SIGN_IN.pending, function (state, action) {
9590
+ state.signIn.loading = true;
9591
+ }), _defineProperty(_extraReducers$F, SIGN_IN.rejected, function (state, action) {
9592
+ var _action$payload10;
9584
9593
 
9585
- var dLat = deg2rad(lat2 - lat1); // deg2rad below
9594
+ state.signIn = (_action$payload10 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload10 !== void 0 ? _action$payload10 : {};
9595
+ }), _defineProperty(_extraReducers$F, LOG_OUT.fulfilled, function (state, action) {
9596
+ var _action$payload11;
9586
9597
 
9587
- var dLon = deg2rad(lon2 - lon1);
9588
- var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
9589
- var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
9590
- var d = R * c; // Distance in km
9598
+ state.logout = (_action$payload11 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload11 !== void 0 ? _action$payload11 : {};
9599
+ }), _defineProperty(_extraReducers$F, LOG_OUT.pending, function (state, action) {
9600
+ state.logout.loading = true;
9601
+ }), _defineProperty(_extraReducers$F, LOG_OUT.rejected, function (state, action) {
9602
+ var _action$payload12;
9591
9603
 
9592
- return parseFloat(d).toFixed(2);
9593
- };
9604
+ state.logout = (_action$payload12 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload12 !== void 0 ? _action$payload12 : {};
9605
+ }), _defineProperty(_extraReducers$F, FORGOT_PASSWORD.fulfilled, function (state, action) {
9606
+ var _action$payload13;
9594
9607
 
9595
- var getLocation = function getLocation() {
9596
- return new es6Promise.Promise(function (resolve, reject) {
9597
- navigator.geolocation.getCurrentPosition(function (position) {
9598
- var lat = position.coords.latitude;
9599
- var _long = position.coords.longitude;
9600
- resolve([false, {
9601
- lat: lat,
9602
- "long": _long
9603
- }]);
9604
- }, function (error) {
9605
- resolve([true, error]);
9606
- });
9607
- });
9608
- };
9608
+ state.forgotPassword = (_action$payload13 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload13 !== void 0 ? _action$payload13 : {};
9609
+ }), _defineProperty(_extraReducers$F, FORGOT_PASSWORD.pending, function (state, action) {
9610
+ state.forgotPassword.loading = true;
9611
+ }), _defineProperty(_extraReducers$F, FORGOT_PASSWORD.rejected, function (state, action) {
9612
+ var _action$payload14;
9609
9613
 
9610
- var getCurrentPosition = /*#__PURE__*/function () {
9611
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
9612
- var permission, lat, _long2, _yield$getLocation, _yield$getLocation2, err, currLocation;
9614
+ state.forgotPassword = (_action$payload14 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload14 !== void 0 ? _action$payload14 : {};
9615
+ }), _defineProperty(_extraReducers$F, GUEST_INFO.fulfilled, function (state, action) {
9616
+ var _action$payload15;
9613
9617
 
9614
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
9615
- while (1) {
9616
- switch (_context2.prev = _context2.next) {
9617
- case 0:
9618
- _context2.next = 2;
9619
- return navigator.permissions.query({
9620
- name: 'geolocation'
9621
- })["catch"](function (err) {
9622
- return {
9623
- state: 'denied'
9624
- };
9625
- });
9618
+ state.guestInfo = (_action$payload15 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload15 !== void 0 ? _action$payload15 : {};
9619
+ }), _defineProperty(_extraReducers$F, GUEST_INFO.pending, function (state, action) {
9620
+ state.guestInfo.loading = true;
9621
+ }), _defineProperty(_extraReducers$F, GUEST_INFO.rejected, function (state, action) {
9622
+ var _action$payload16;
9626
9623
 
9627
- case 2:
9628
- permission = _context2.sent;
9624
+ state.guestInfo = (_action$payload16 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload16 !== void 0 ? _action$payload16 : {};
9625
+ }), _defineProperty(_extraReducers$F, LOGGED_USER_INFO.fulfilled, function (state, action) {
9626
+ var _action$payload17;
9629
9627
 
9630
- if (!(permission.state !== 'denied')) {
9631
- _context2.next = 11;
9632
- break;
9633
- }
9628
+ state.loggedUserInfo = (_action$payload17 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload17 !== void 0 ? _action$payload17 : {};
9629
+ }), _defineProperty(_extraReducers$F, LOGGED_USER_INFO.pending, function (state, action) {
9630
+ state.loggedUserInfo.loading = true;
9631
+ }), _defineProperty(_extraReducers$F, LOGGED_USER_INFO.rejected, function (state, action) {
9632
+ var _action$payload18;
9634
9633
 
9635
- _context2.next = 6;
9636
- return getLocation();
9634
+ state.loggedUserInfo = (_action$payload18 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload18 !== void 0 ? _action$payload18 : {};
9635
+ }), _defineProperty(_extraReducers$F, GET_USER_INFO.fulfilled, function (state, action) {
9636
+ var _action$payload19;
9637
9637
 
9638
- case 6:
9639
- _yield$getLocation = _context2.sent;
9640
- _yield$getLocation2 = _slicedToArray(_yield$getLocation, 2);
9641
- err = _yield$getLocation2[0];
9642
- currLocation = _yield$getLocation2[1];
9638
+ state.loggedUserInfo = (_action$payload19 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload19 !== void 0 ? _action$payload19 : {};
9639
+ }), _defineProperty(_extraReducers$F, GET_USER_INFO.pending, function (state, action) {
9640
+ state.loggedUserInfo.loading = true;
9641
+ }), _defineProperty(_extraReducers$F, GET_USER_INFO.rejected, function (state, action) {
9642
+ var _action$payload20;
9643
9643
 
9644
- if (!err) {
9645
- lat = currLocation.lat;
9646
- _long2 = currLocation["long"];
9647
- }
9644
+ state.loggedUserInfo = (_action$payload20 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload20 !== void 0 ? _action$payload20 : {};
9645
+ }), _defineProperty(_extraReducers$F, GET_ORG_USER_INFO.fulfilled, function (state, action) {
9646
+ var _action$payload21;
9648
9647
 
9649
- case 11:
9650
- return _context2.abrupt("return", {
9651
- lat: lat,
9652
- "long": _long2
9653
- });
9648
+ state.loggedUserInfo = (_action$payload21 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload21 !== void 0 ? _action$payload21 : {};
9649
+ }), _defineProperty(_extraReducers$F, GET_ORG_USER_INFO.pending, function (state, action) {
9650
+ state.loggedUserInfo.loading = true;
9651
+ }), _defineProperty(_extraReducers$F, GET_ORG_USER_INFO.rejected, function (state, action) {
9652
+ var _action$payload22;
9654
9653
 
9655
- case 12:
9656
- case "end":
9657
- return _context2.stop();
9658
- }
9659
- }
9660
- }, _callee2);
9661
- }));
9654
+ state.loggedUserInfo = (_action$payload22 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload22 !== void 0 ? _action$payload22 : {};
9655
+ }), _defineProperty(_extraReducers$F, CHANGE_PASSWORD.fulfilled, function (state, action) {
9656
+ var _action$payload23;
9662
9657
 
9663
- return function getCurrentPosition() {
9664
- return _ref4.apply(this, arguments);
9665
- };
9666
- }();
9658
+ state.changePassword = (_action$payload23 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload23 !== void 0 ? _action$payload23 : {};
9659
+ }), _defineProperty(_extraReducers$F, CHANGE_PASSWORD.pending, function (state, action) {
9660
+ state.changePassword.loading = true;
9661
+ }), _defineProperty(_extraReducers$F, CHANGE_PASSWORD.rejected, function (state, action) {
9662
+ var _action$payload24;
9667
9663
 
9668
- var getLatLong = /*#__PURE__*/function () {
9669
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(city) {
9670
- var _resp$results, _resp$results$, _resp$results$$geomet, _resp$results$$geomet2, _resp$results2, _resp$results2$, _resp$results2$$geome, _resp$results2$$geome2;
9664
+ state.changePassword = (_action$payload24 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload24 !== void 0 ? _action$payload24 : {};
9665
+ }), _defineProperty(_extraReducers$F, TOKEN_VALIDATE.fulfilled, function (state, action) {
9666
+ var _action$payload25;
9671
9667
 
9672
- var url, data, resp, lat, _long3, _resp$results3, _resp$results3$, _resp$results3$$geome, _resp$results3$$geome2, _resp$results4, _resp$results4$, _resp$results4$$geome, _resp$results4$$geome2;
9668
+ state.tokenValidate = (_action$payload25 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload25 !== void 0 ? _action$payload25 : {};
9669
+ }), _defineProperty(_extraReducers$F, TOKEN_VALIDATE.pending, function (state, action) {
9670
+ state.tokenValidate.loading = true;
9671
+ }), _defineProperty(_extraReducers$F, TOKEN_VALIDATE.rejected, function (state, action) {
9672
+ var _action$payload26;
9673
9673
 
9674
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
9675
- while (1) {
9676
- switch (_context3.prev = _context3.next) {
9677
- case 0:
9678
- url = "https://maps.googleapis.com/maps/api/geocode/json?address=".concat(city, "&key=AIzaSyBqeACJgp12OLU6EkHeUtFgya2naH1LhrU");
9679
- _context3.next = 3;
9680
- return fetch(url);
9674
+ state.tokenValidate = (_action$payload26 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload26 !== void 0 ? _action$payload26 : {};
9675
+ }), _defineProperty(_extraReducers$F, REFRESH_TOKEN.fulfilled, function (state, action) {
9676
+ var _action$payload27;
9681
9677
 
9682
- case 3:
9683
- data = _context3.sent;
9684
- _context3.next = 6;
9685
- return data.json();
9678
+ state.refreshToken = (_action$payload27 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload27 !== void 0 ? _action$payload27 : {};
9679
+ }), _defineProperty(_extraReducers$F, REFRESH_TOKEN.pending, function (state, action) {
9680
+ state.refreshToken.loading = true;
9681
+ }), _defineProperty(_extraReducers$F, REFRESH_TOKEN.rejected, function (state, action) {
9682
+ var _action$payload28;
9686
9683
 
9687
- case 6:
9688
- resp = _context3.sent;
9684
+ state.refreshToken = (_action$payload28 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload28 !== void 0 ? _action$payload28 : {};
9685
+ }), _defineProperty(_extraReducers$F, GET_COUNTRY_CODE_LIST.fulfilled, function (state, action) {
9686
+ var _action$payload29;
9689
9687
 
9690
- if ((resp === null || resp === void 0 ? void 0 : (_resp$results = resp.results) === null || _resp$results === void 0 ? void 0 : (_resp$results$ = _resp$results[0]) === null || _resp$results$ === void 0 ? void 0 : (_resp$results$$geomet = _resp$results$.geometry) === null || _resp$results$$geomet === void 0 ? void 0 : (_resp$results$$geomet2 = _resp$results$$geomet.location) === null || _resp$results$$geomet2 === void 0 ? void 0 : _resp$results$$geomet2.lat) && (resp === null || resp === void 0 ? void 0 : (_resp$results2 = resp.results) === null || _resp$results2 === void 0 ? void 0 : (_resp$results2$ = _resp$results2[0]) === null || _resp$results2$ === void 0 ? void 0 : (_resp$results2$$geome = _resp$results2$.geometry) === null || _resp$results2$$geome === void 0 ? void 0 : (_resp$results2$$geome2 = _resp$results2$$geome.location) === null || _resp$results2$$geome2 === void 0 ? void 0 : _resp$results2$$geome2.lng)) {
9691
- lat = resp === null || resp === void 0 ? void 0 : (_resp$results3 = resp.results) === null || _resp$results3 === void 0 ? void 0 : (_resp$results3$ = _resp$results3[0]) === null || _resp$results3$ === void 0 ? void 0 : (_resp$results3$$geome = _resp$results3$.geometry) === null || _resp$results3$$geome === void 0 ? void 0 : (_resp$results3$$geome2 = _resp$results3$$geome.location) === null || _resp$results3$$geome2 === void 0 ? void 0 : _resp$results3$$geome2.lat;
9692
- _long3 = resp === null || resp === void 0 ? void 0 : (_resp$results4 = resp.results) === null || _resp$results4 === void 0 ? void 0 : (_resp$results4$ = _resp$results4[0]) === null || _resp$results4$ === void 0 ? void 0 : (_resp$results4$$geome = _resp$results4$.geometry) === null || _resp$results4$$geome === void 0 ? void 0 : (_resp$results4$$geome2 = _resp$results4$$geome.location) === null || _resp$results4$$geome2 === void 0 ? void 0 : _resp$results4$$geome2.lng;
9693
- }
9688
+ state.country_code_list = (_action$payload29 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload29 !== void 0 ? _action$payload29 : {};
9689
+ }), _defineProperty(_extraReducers$F, GET_COUNTRY_CODE_LIST.pending, function (state, action) {
9690
+ state.country_code_list.loading = true;
9691
+ }), _defineProperty(_extraReducers$F, GET_COUNTRY_CODE_LIST.rejected, function (state, action) {
9692
+ var _action$payload30;
9694
9693
 
9695
- return _context3.abrupt("return", {
9696
- lat: lat,
9697
- "long": _long3
9698
- });
9694
+ state.country_code_list = (_action$payload30 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload30 !== void 0 ? _action$payload30 : {};
9695
+ }), _extraReducers$F)
9696
+ });
9697
+ var authActions = {
9698
+ REGISTER_USERS: REGISTER_USERS,
9699
+ GENERATE_OTP: GENERATE_OTP,
9700
+ RESEND_OTP: RESEND_OTP,
9701
+ SIGN_IN: SIGN_IN,
9702
+ LOG_OUT: LOG_OUT,
9703
+ GUEST_INFO: GUEST_INFO,
9704
+ LOGGED_USER_INFO: LOGGED_USER_INFO,
9705
+ FORGOT_PASSWORD: FORGOT_PASSWORD,
9706
+ GET_USER_INFO: GET_USER_INFO,
9707
+ GET_ORG_USER_INFO: GET_ORG_USER_INFO,
9708
+ DELETE_USER: DELETE_USER,
9709
+ CHANGE_PASSWORD: CHANGE_PASSWORD,
9710
+ TOKEN_VALIDATE: TOKEN_VALIDATE,
9711
+ REFRESH_TOKEN: REFRESH_TOKEN,
9712
+ GET_COUNTRY_CODE_LIST: GET_COUNTRY_CODE_LIST
9713
+ };
9714
+ var authSlice$1 = authSlice.reducer;
9699
9715
 
9700
- case 9:
9701
- case "end":
9702
- return _context3.stop();
9703
- }
9704
- }
9705
- }, _callee3);
9706
- }));
9716
+ var _extraReducers$E;
9717
+ var __options$9 = {
9718
+ method: "POST",
9719
+ headers: {
9720
+ "Content-Type": "text/plain"
9721
+ },
9722
+ body: {}
9723
+ }; // FUZZY_SEARCH
9707
9724
 
9708
- return function getLatLong(_x2) {
9709
- return _ref5.apply(this, arguments);
9710
- };
9711
- }(); // Get age using moment
9725
+ var FUZZY_SEARCH = createAsyncThunk("fuzzySearchReducer/fuzzySearch", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
9726
+ var payload,
9727
+ _ref2,
9728
+ rejectWithValue,
9729
+ _payload$db_name,
9730
+ db_name,
9731
+ _payload$entity,
9732
+ entity,
9733
+ _payload$filter,
9734
+ filter,
9735
+ _payload$value,
9736
+ value,
9737
+ _,
9738
+ _args = arguments;
9712
9739
 
9740
+ return regeneratorRuntime.wrap(function _callee$(_context) {
9741
+ while (1) {
9742
+ switch (_context.prev = _context.next) {
9743
+ case 0:
9744
+ payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
9745
+ _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
9746
+ _context.prev = 2;
9747
+ _payload$db_name = payload.db_name, db_name = _payload$db_name === void 0 ? "primarycare" : _payload$db_name, _payload$entity = payload.entity, entity = _payload$entity === void 0 ? "Person" : _payload$entity, _payload$filter = payload.filter, filter = _payload$filter === void 0 ? "" : _payload$filter, _payload$value = payload.value, value = _payload$value === void 0 ? "" : _payload$value;
9748
+ _context.next = 6;
9749
+ return fetch(urls.fuzzy_search, _objectSpread2(_objectSpread2({}, __options$9), {}, {
9750
+ body: btoa(JSON.stringify({
9751
+ "db_name": db_name,
9752
+ "entity": entity,
9753
+ "filter": filter,
9754
+ "value": value
9755
+ }))
9756
+ }));
9713
9757
 
9714
- var getAge = function getAge(date) {
9715
- if (date) {
9716
- var yearDiff = moment().diff(moment(date, 'DD/MM/YYYY'), 'years', false);
9758
+ case 6:
9759
+ _ = _context.sent;
9760
+ _context.next = 9;
9761
+ return _.json();
9717
9762
 
9718
- if (yearDiff > 0) {
9719
- return yearDiff + ' Y';
9720
- }
9763
+ case 9:
9764
+ _ = _context.sent;
9765
+ return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.Info), {}, {
9766
+ data: _
9767
+ }));
9721
9768
 
9722
- var monthDiff = moment().diff(moment(date, 'DD/MM/YYYY'), 'months', false);
9769
+ case 13:
9770
+ _context.prev = 13;
9771
+ _context.t0 = _context["catch"](2);
9772
+ return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
9773
+ message: _context.t0.message
9774
+ })));
9723
9775
 
9724
- if (monthDiff > 0) {
9725
- return monthDiff + ' M';
9776
+ case 16:
9777
+ case "end":
9778
+ return _context.stop();
9779
+ }
9726
9780
  }
9781
+ }, _callee, null, [[2, 13]]);
9782
+ }))); // end
9783
+ // FUZZY SEARCH CREATE INITIALSTATE
9727
9784
 
9728
- var dayDiff = moment().diff(moment(date, 'DD/MM/YYYY'), 'days', false);
9729
- return dayDiff + ' D';
9730
- }
9785
+ var fuzzySearchReducer = createSlice({
9786
+ name: "fuzzySearchReducer",
9787
+ initialState: {
9788
+ fuzzySearch: _objectSpread2({}, defaultState.Info)
9789
+ },
9790
+ extraReducers: (_extraReducers$E = {}, _defineProperty(_extraReducers$E, FUZZY_SEARCH.fulfilled, function (state, action) {
9791
+ var _action$payload;
9731
9792
 
9732
- return "";
9733
- };
9793
+ state.fuzzySearch = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
9794
+ }), _defineProperty(_extraReducers$E, FUZZY_SEARCH.pending, function (state, action) {
9795
+ state.fuzzySearch.loading = true;
9796
+ }), _defineProperty(_extraReducers$E, FUZZY_SEARCH.rejected, function (state, action) {
9797
+ var _action$payload2;
9798
+
9799
+ state.fuzzySearch = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
9800
+ }), _extraReducers$E)
9801
+ }); // end
9802
+ // FUZZY SEARCH CREATE ACTION LISTS
9803
+
9804
+ var fuzzySearchActions = {
9805
+ FUZZY_SEARCH: FUZZY_SEARCH
9806
+ }; // end
9807
+ var fuzzySearchReducer$1 = fuzzySearchReducer.reducer;
9734
9808
 
9735
9809
  var _extraReducers$D;
9736
9810
  var __options$8 = {
@@ -13780,7 +13854,48 @@ var getLocationInfo$1 = /*#__PURE__*/function () {
13780
13854
  return function getLocationInfo(_x, _x2) {
13781
13855
  return _ref.apply(this, arguments);
13782
13856
  };
13783
- }(); // DOCTER_LISTING
13857
+ }();
13858
+
13859
+ var calculationExp = function calculationExp(jexp) {
13860
+ var expInMs = 0;
13861
+ jexp.forEach(function () {
13862
+ var exp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13863
+ var start_date = exp.start_date,
13864
+ end_date = exp.end_date;
13865
+
13866
+ if (typeof start_date === "number") {
13867
+ if (typeof end_date === "number") {
13868
+ if (start_date < end_date) {
13869
+ expInMs += (end_date - start_date) * 1000;
13870
+ }
13871
+ } else {
13872
+ expInMs += (Date.now() - start_date) * 1000;
13873
+ }
13874
+ }
13875
+ });
13876
+ var expInDays = moment(expInMs).diff(moment(0), "days");
13877
+ var expInMonths = moment(expInMs).diff(moment(0), "months");
13878
+ var expInYears = moment(expInMs).diff(moment(0), "years");
13879
+
13880
+ if (expInYears >= 1) {
13881
+ var value = Math.floor(expInYears);
13882
+ return "".concat(value, " year") + (value > 1 ? "s" : "");
13883
+ }
13884
+
13885
+ if (expInMonths >= 1) {
13886
+ var _value = Math.floor(expInMonths);
13887
+
13888
+ return "".concat(_value, " month") + (_value > 1 ? "s" : "");
13889
+ }
13890
+
13891
+ if (expInDays >= 1) {
13892
+ var _value2 = Math.floor(expInDays);
13893
+
13894
+ return "".concat(_value2, " day") + (_value2 > 1 ? "s" : "");
13895
+ }
13896
+
13897
+ return "0 days";
13898
+ }; // DOCTER_LISTING
13784
13899
 
13785
13900
 
13786
13901
  var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
@@ -13962,6 +14077,9 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
13962
14077
  isDoctor: !isClinic,
13963
14078
  language: [],
13964
14079
  isClinic: isClinic,
14080
+ experience: 0,
14081
+ role: "",
14082
+ mobile: "",
13965
14083
  memberIncludes: "0",
13966
14084
  hospitalName: "",
13967
14085
  hospitalLocation: "",
@@ -14028,7 +14146,7 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
14028
14146
  info["key"] = restData === null || restData === void 0 ? void 0 : restData._key;
14029
14147
  info["img"] = getImgUrl(restData === null || restData === void 0 ? void 0 : (_restData$locationID4 = restData.locationID) === null || _restData$locationID4 === void 0 ? void 0 : (_restData$locationID5 = _restData$locationID4.photo) === null || _restData$locationID5 === void 0 ? void 0 : (_restData$locationID6 = _restData$locationID5[0]) === null || _restData$locationID6 === void 0 ? void 0 : _restData$locationID6.fileid);
14030
14148
  } else {
14031
- var _restData$gender, _restData$gender$codi, _restData$gender$codi2, _restData$Specialties, _restData$communicati, _restData$hospital6, _restData$qualificati, _restData$qualificati2, _restData$qualificati3, _restData$hospital7, _restData$address5, _restData$address5$, _restData$name, _restData$photo, _restData$photo$, _restData$address6, _restData$address6$, _restData$biography, _restData$biography$;
14149
+ var _restData$gender, _restData$gender$codi, _restData$gender$codi2, _restData$Specialties, _restData$communicati, _restData$practitione, _restData$practitione2, _restData$practitione3, _restData$practitione4, _restData$practitione5, _restData$hospital6, _restData$hospital6$t, _restData$hospital6$t2, _restData$hospital7, _restData$qualificati, _restData$qualificati2, _restData$qualificati3, _restData$hospital8, _restData$address5, _restData$address5$, _restData$name, _restData$photo, _restData$photo$, _restData$address6, _restData$address6$, _restData$biography, _restData$biography$;
14032
14150
 
14033
14151
  var _gender = (restData === null || restData === void 0 ? void 0 : (_restData$gender = restData.gender) === null || _restData$gender === void 0 ? void 0 : (_restData$gender$codi = _restData$gender.coding) === null || _restData$gender$codi === void 0 ? void 0 : (_restData$gender$codi2 = _restData$gender$codi[0]) === null || _restData$gender$codi2 === void 0 ? void 0 : _restData$gender$codi2.display) || "";
14034
14152
 
@@ -14067,14 +14185,17 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
14067
14185
  });
14068
14186
  }
14069
14187
  });
14188
+ info["role"] = restData === null || restData === void 0 ? void 0 : (_restData$practitione = restData.practitioner_role) === null || _restData$practitione === void 0 ? void 0 : (_restData$practitione2 = _restData$practitione[0]) === null || _restData$practitione2 === void 0 ? void 0 : (_restData$practitione3 = _restData$practitione2.role) === null || _restData$practitione3 === void 0 ? void 0 : (_restData$practitione4 = _restData$practitione3.coding) === null || _restData$practitione4 === void 0 ? void 0 : (_restData$practitione5 = _restData$practitione4[0]) === null || _restData$practitione5 === void 0 ? void 0 : _restData$practitione5.display;
14189
+ info["mobile"] = restData === null || restData === void 0 ? void 0 : (_restData$hospital6 = restData.hospital) === null || _restData$hospital6 === void 0 ? void 0 : (_restData$hospital6$t = _restData$hospital6.telecom) === null || _restData$hospital6$t === void 0 ? void 0 : (_restData$hospital6$t2 = _restData$hospital6$t[0]) === null || _restData$hospital6$t2 === void 0 ? void 0 : _restData$hospital6$t2.value;
14190
+ info["experience"] = calculationExp(restData === null || restData === void 0 ? void 0 : restData.job_experience);
14070
14191
  info["title"] = "".concat(_gender).concat(_gender && " | ").concat(designation);
14071
14192
  info["gender"] = _gender;
14072
- info["hospId"] = restData === null || restData === void 0 ? void 0 : (_restData$hospital6 = restData.hospital) === null || _restData$hospital6 === void 0 ? void 0 : _restData$hospital6.id;
14193
+ info["hospId"] = restData === null || restData === void 0 ? void 0 : (_restData$hospital7 = restData.hospital) === null || _restData$hospital7 === void 0 ? void 0 : _restData$hospital7.id;
14073
14194
  info["subtext"] = (restData === null || restData === void 0 ? void 0 : (_restData$qualificati = restData.qualification) === null || _restData$qualificati === void 0 ? void 0 : (_restData$qualificati2 = _restData$qualificati.map) === null || _restData$qualificati2 === void 0 ? void 0 : (_restData$qualificati3 = _restData$qualificati2.call(_restData$qualificati, function (q) {
14074
14195
  return (q === null || q === void 0 ? void 0 : q.name) || "";
14075
14196
  })) === null || _restData$qualificati3 === void 0 ? void 0 : _restData$qualificati3.join(", ")) || "----";
14076
14197
  info["language"] = languages.size > 0 ? _toConsumableArray(languages) : [];
14077
- info["hospitalName"] = (restData === null || restData === void 0 ? void 0 : (_restData$hospital7 = restData.hospital) === null || _restData$hospital7 === void 0 ? void 0 : _restData$hospital7.name) || "";
14198
+ info["hospitalName"] = (restData === null || restData === void 0 ? void 0 : (_restData$hospital8 = restData.hospital) === null || _restData$hospital8 === void 0 ? void 0 : _restData$hospital8.name) || "";
14078
14199
  info["hospitalLocation"] = (restData === null || restData === void 0 ? void 0 : (_restData$address5 = restData.address) === null || _restData$address5 === void 0 ? void 0 : (_restData$address5$ = _restData$address5[0]) === null || _restData$address5$ === void 0 ? void 0 : _restData$address5$.line) || "";
14079
14200
  var nameObj = (restData === null || restData === void 0 ? void 0 : (_restData$name = restData.name) === null || _restData$name === void 0 ? void 0 : _restData$name[0]) || {};
14080
14201
  info["name"] = makeName(nameObj);
@@ -16302,6 +16423,8 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
16302
16423
  firstName,
16303
16424
  _payload$lastName,
16304
16425
  lastName,
16426
+ _payload$middleName,
16427
+ middleName,
16305
16428
  _payload$gender,
16306
16429
  gender,
16307
16430
  _payload$email,
@@ -16319,7 +16442,7 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
16319
16442
  payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
16320
16443
  _ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
16321
16444
  _context.prev = 2;
16322
- _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$gender = payload.gender, gender = _payload$gender === void 0 ? "" : _payload$gender, _payload$email = payload.email, email = _payload$email === void 0 ? "" : _payload$email, photo = payload.photo;
16445
+ _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$gender = payload.gender, gender = _payload$gender === void 0 ? "" : _payload$gender, _payload$email = payload.email, email = _payload$email === void 0 ? "" : _payload$email, photo = payload.photo;
16323
16446
  imageInfo = [];
16324
16447
 
16325
16448
  if (photo) {
@@ -16358,7 +16481,7 @@ var UPSERT_PERSON = createAsyncThunk("personApiSlice/upsertPerson", /*#__PURE__*
16358
16481
  use: "",
16359
16482
  text: firstName,
16360
16483
  family: lastName,
16361
- given: "",
16484
+ given: middleName,
16362
16485
  prefix: "",
16363
16486
  suffix: "",
16364
16487
  period: [{
@@ -17954,9 +18077,9 @@ var GET_PRACTITIONERS = createAsyncThunk("OrganizationRegisterPatientApiSlice/ge
17954
18077
  _payload$OrgID2 = payload.OrgID, OrgID = _payload$OrgID2 === void 0 ? "" : _payload$OrgID2;
17955
18078
  body = {
17956
18079
  db_name: "primarycare",
17957
- entity: "Practitioner_PractitionerRole_E",
17958
- filter: "DOCUMENT(Practitioner_PractitionerRole_E._to).SpecialtyID=='" + OrgID + "'",
17959
- return_fields: "MERGE( DOCUMENT(Practitioner_PractitionerRole_E._from),{name:DOCUMENT(DOCUMENT(Practitioner_PractitionerRole_E._from).name)}, {practitioner_role:(FOR role IN TO_ARRAY(DOCUMENT(Practitioner_PractitionerRole_E._from).practitioner_role) RETURN MERGE(DOCUMENT(role),{SpecialtyID:(FOR spec IN TO_ARRAY(DOCUMENT(role).SpecialtyID) RETURN MERGE(DOCUMENT(spec),{coding:(FOR cod IN DOCUMENT(spec).coding RETURN DOCUMENT(cod))}) ),role:MERGE(DOCUMENT(DOCUMENT(role).role),{coding:(FOR cod IN TO_ARRAY(DOCUMENT(DOCUMENT(role).role).coding) RETURN DOCUMENT(cod) )}) }) )},{practitioner_type:DOCUMENT( DOCUMENT(DOCUMENT(Practitioner_PractitionerRole_E._from).practitioner_type).coding)})"
18080
+ entity: "Practitioner",
18081
+ filter: "document(Practitioner.practitioner_role)[*].SpecialtyID any == '" + OrgID + "'",
18082
+ return_fields: "merge(Practitioner,{name:document(Practitioner.name)},{practitioner_role:(for PractitionerRole in PractitionerRole filter Practitioner.practitioner_role any == PractitionerRole._id return merge(PractitionerRole,{role:(for CodeableConceptMaster in CodeableConceptMaster filter CodeableConceptMaster._id == PractitionerRole.role return merge(CodeableConceptMaster,{coding:document(CodeableConceptMaster.coding)}))}, {SpecialtyID:(for CodeableConceptMaster in CodeableConceptMaster filter PractitionerRole.SpecialtyID == CodeableConceptMaster._id return merge(CodeableConceptMaster,{coding:document(CodeableConceptMaster.coding)}) ) } ) )}, {practitioner_type:(for CodeableConceptMaster in CodeableConceptMaster filter CodeableConceptMaster._id == Practitioner.practitioner_type return merge(CodeableConceptMaster,{coding:document(CodeableConceptMaster.coding)}))})"
17960
18083
  };
17961
18084
  _context9.next = 7;
17962
18085
  return fetchData$3({
@@ -19047,7 +19170,7 @@ var dashboardQuery = {
19047
19170
  Encounter: "Encounter._key=='".concat(encounter_key, "' && Encounter.activestatus==true && lower(document(Encounter.status).display)=='consultation over'"),
19048
19171
  Appointment: "Appointment.id in Encounter.appointmentId && Appointment.start>=".concat(start, " && Appointment.end<=").concat(end)
19049
19172
  },
19050
- return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return merge(pat,{name:(for nam in HumanNameMaster filter nam._id in pat.name return merge(nam,{use:document(nam.use),suffix:document(nam.suffix),prefix:document(nam.prefix)})),telecom:document(pat.telecom),gender:document(pat.gender),age_type:document(pat.age_type)},{photo:document(pat.photo)}))},{appointmentId: merge(Appointment,{practitionerID:(for prac in Practitioner filter prac.id in Appointment.practitionerID return merge(prac,{name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding))}))},{photo:document(prac.photo)})),HealthcareServiceID:(for hs in HealthcareService filter hs.id in Appointment.HealthcareServiceID return hs)})},{followupUOM:document(Encounter.followupUOM),reasonCode:document(Encounter.reasonCode),dischargeDisposition:document(Encounter.dischargeDisposition)},{practitioner_details:(for pd in Encounter.practitioner_details return merge(pd,{speciality:(for spd in CodeableConceptMaster filter spd._id == pd.speciality return merge(spd,{coding:document(spd.coding)}))}))})"
19173
+ return_fields: "merge(Encounter,{patient_id:(for pat in Patient filter pat.id==Encounter.patient_id return merge(pat,{name:(for nam in HumanNameMaster filter nam._id in pat.name return merge(nam,{use:document(nam.use),suffix:document(nam.suffix),prefix:document(nam.prefix)})),telecom:document(pat.telecom),gender:document(pat.gender),age_type:document(pat.age_type)},{photo:document(pat.photo)}))},{appointmentId: merge(Appointment,{practitionerID:(for prac in Practitioner filter prac.id in Appointment.practitionerID return merge(prac,{name:(for nam in HumanNameMaster filter nam._id in prac.name return merge(nam,{use:(for cod in CodeableConceptMaster filter cod._id == nam.use return document(cod.coding)),prefix:(for cod in CodeableConceptMaster filter cod._id == nam.prefix return document(cod.coding)),suffix:(for cod in CodeableConceptMaster filter cod._id == nam.suffix return document(cod.coding))}))},{photo:document(prac.photo)})),HealthcareServiceID:(for hs in HealthcareService filter hs.id in Appointment.HealthcareServiceID return hs)},{appointmentReason:(for apr in CodingMaster filter apr.id in Appointment.appointmentReason return apr)})},{followupUOM:document(Encounter.followupUOM),reasonCode:document(Encounter.reasonCode),dischargeDisposition:document(Encounter.dischargeDisposition)},{practitioner_details:(for pd in Encounter.practitioner_details return merge(pd,{speciality:(for spd in CodeableConceptMaster filter spd._id == pd.speciality return merge(spd,{coding:document(spd.coding)}))}))})"
19051
19174
  };
19052
19175
  }
19053
19176
  };
@@ -20486,7 +20609,7 @@ var generateReadJSON_Reassign = function generateReadJSON_Reassign(data) {
20486
20609
  };
20487
20610
 
20488
20611
  var generateReadJSON_colseConsultation = function generateReadJSON_colseConsultation(data) {
20489
- var _data$visit_type, _data$reasonReference, _data$reasonReference2, _data$appointmentId, _data$appointmentId2, _data$appointmentId$c, _data$appointmentId3, _data$appointmentId4, _data$appointmentId5, _data$appointmentId6, _data$appointmentId6$, _data$patient_id$0$ph, _data$patient_id, _data$patient_id$, _data$patient_id$$pho, _ref47, _data$patient_id2, _data$patient_id2$0$n, _data$patient_id2$0$n2, _data$patient_id3, _data$patient_id3$0$n, _data$patient_id3$0$n2, _data$patient_id$0$ag, _data$patient_id4, _data$patient_id4$, _data$patient_id5, _data$patient_id5$, _data$patient_id5$$ge, _data$patient_id6, _data$patient_id6$, _data$patient_id6$$ge, _data$patient_id7, _data$patient_id7$, _data$patient_id7$$ge, _data$patient_id$0$al, _data$patient_id8, _data$patient_id8$, _data$patient_id$0$te, _data$patient_id9, _data$patient_id9$, _data$patient_id9$$te, _data$patient_id9$$te2, _data$practitioner_de, _data$practitioner_de2, _data$practitioner_de3, _data$practitioner_de4, _data$practitioner_de5, _data$practitioner_de6, _data$practitioner_de7, _data$practitioner_de8, _data$practitioner_de9, _data$practitioner_de10, _data$practitioner_de11;
20612
+ var _data$visit_type, _data$reasonReference, _data$reasonReference2, _data$appointmentId, _data$appointmentId2, _data$appointmentId$c, _data$appointmentId3, _data$appointmentId4, _data$appointmentId4$, _data$appointmentId5, _data$appointmentId6, _data$appointmentId6$, _data$patient_id$0$ph, _data$patient_id, _data$patient_id$, _data$patient_id$$pho, _ref47, _data$patient_id2, _data$patient_id2$0$n, _data$patient_id2$0$n2, _data$patient_id3, _data$patient_id3$0$n, _data$patient_id3$0$n2, _data$patient_id$0$ag, _data$patient_id4, _data$patient_id4$, _data$patient_id5, _data$patient_id5$, _data$patient_id5$$ge, _data$patient_id6, _data$patient_id6$, _data$patient_id6$$ge, _data$patient_id7, _data$patient_id7$, _data$patient_id7$$ge, _data$patient_id$0$al, _data$patient_id8, _data$patient_id8$, _data$patient_id$0$te, _data$patient_id9, _data$patient_id9$, _data$patient_id9$$te, _data$patient_id9$$te2, _data$practitioner_de, _data$practitioner_de2, _data$practitioner_de3, _data$practitioner_de4, _data$practitioner_de5, _data$practitioner_de6, _data$practitioner_de7, _data$practitioner_de8, _data$practitioner_de9, _data$practitioner_de10, _data$practitioner_de11;
20490
20613
 
20491
20614
  var json = {
20492
20615
  visitType: (_data$visit_type = data === null || data === void 0 ? void 0 : data.visit_type) !== null && _data$visit_type !== void 0 ? _data$visit_type : "",
@@ -20494,7 +20617,9 @@ var generateReadJSON_colseConsultation = function generateReadJSON_colseConsulta
20494
20617
  reasonCode: (_data$reasonReference = data === null || data === void 0 ? void 0 : (_data$reasonReference2 = data.reasonReference) === null || _data$reasonReference2 === void 0 ? void 0 : _data$reasonReference2.display) !== null && _data$reasonReference !== void 0 ? _data$reasonReference : "",
20495
20618
  appointmentDateTime: (data === null || data === void 0 ? void 0 : (_data$appointmentId = data.appointmentId) === null || _data$appointmentId === void 0 ? void 0 : _data$appointmentId.start) ? utcTOLocal$1(data === null || data === void 0 ? void 0 : (_data$appointmentId2 = data.appointmentId) === null || _data$appointmentId2 === void 0 ? void 0 : _data$appointmentId2.start, "DD MMM,YYYY hh:mm A") : "",
20496
20619
  consultationMode: (_data$appointmentId$c = data === null || data === void 0 ? void 0 : (_data$appointmentId3 = data.appointmentId) === null || _data$appointmentId3 === void 0 ? void 0 : _data$appointmentId3.consultationMode) !== null && _data$appointmentId$c !== void 0 ? _data$appointmentId$c : "",
20497
- appointmentReason: (data === null || data === void 0 ? void 0 : (_data$appointmentId4 = data.appointmentId) === null || _data$appointmentId4 === void 0 ? void 0 : _data$appointmentId4.appointmentReason) && Array.isArray(data === null || data === void 0 ? void 0 : (_data$appointmentId5 = data.appointmentId) === null || _data$appointmentId5 === void 0 ? void 0 : _data$appointmentId5.appointmentReason) ? data === null || data === void 0 ? void 0 : (_data$appointmentId6 = data.appointmentId) === null || _data$appointmentId6 === void 0 ? void 0 : (_data$appointmentId6$ = _data$appointmentId6.appointmentReason) === null || _data$appointmentId6$ === void 0 ? void 0 : _data$appointmentId6$.join(",") : "",
20620
+ appointmentReason: (data === null || data === void 0 ? void 0 : (_data$appointmentId4 = data.appointmentId) === null || _data$appointmentId4 === void 0 ? void 0 : (_data$appointmentId4$ = _data$appointmentId4.appointmentReason) === null || _data$appointmentId4$ === void 0 ? void 0 : _data$appointmentId4$.length) > 0 && Array.isArray(data === null || data === void 0 ? void 0 : (_data$appointmentId5 = data.appointmentId) === null || _data$appointmentId5 === void 0 ? void 0 : _data$appointmentId5.appointmentReason) ? data === null || data === void 0 ? void 0 : (_data$appointmentId6 = data.appointmentId) === null || _data$appointmentId6 === void 0 ? void 0 : (_data$appointmentId6$ = _data$appointmentId6.appointmentReason) === null || _data$appointmentId6$ === void 0 ? void 0 : _data$appointmentId6$.map(function (v) {
20621
+ return v === null || v === void 0 ? void 0 : v.display;
20622
+ }) : "",
20498
20623
  //PATIENT DEATAIL
20499
20624
  patientPhoto: (_data$patient_id$0$ph = data === null || data === void 0 ? void 0 : (_data$patient_id = data.patient_id) === null || _data$patient_id === void 0 ? void 0 : (_data$patient_id$ = _data$patient_id[0]) === null || _data$patient_id$ === void 0 ? void 0 : (_data$patient_id$$pho = _data$patient_id$.photo) === null || _data$patient_id$$pho === void 0 ? void 0 : _data$patient_id$$pho[0]) !== null && _data$patient_id$0$ph !== void 0 ? _data$patient_id$0$ph : "",
20500
20625
  // need to expand
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primarycare-binder",
3
- "version": "1.1.38",
3
+ "version": "1.1.42",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",