primarycare-binder 1.1.38 → 1.1.39

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 +51 -4
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -13780,7 +13780,48 @@ var getLocationInfo$1 = /*#__PURE__*/function () {
13780
13780
  return function getLocationInfo(_x, _x2) {
13781
13781
  return _ref.apply(this, arguments);
13782
13782
  };
13783
- }(); // DOCTER_LISTING
13783
+ }();
13784
+
13785
+ var calculationExp = function calculationExp(jexp) {
13786
+ var expInMs = 0;
13787
+ jexp.forEach(function () {
13788
+ var exp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13789
+ var start_date = exp.start_date,
13790
+ end_date = exp.end_date;
13791
+
13792
+ if (typeof start_date === "number") {
13793
+ if (typeof end_date === "number") {
13794
+ if (start_date < end_date) {
13795
+ expInMs += (end_date - start_date) * 1000;
13796
+ }
13797
+ } else {
13798
+ expInMs += (Date.now() - start_date) * 1000;
13799
+ }
13800
+ }
13801
+ });
13802
+ var expInDays = moment(expInMs).diff(moment(0), "days");
13803
+ var expInMonths = moment(expInMs).diff(moment(0), "months");
13804
+ var expInYears = moment(expInMs).diff(moment(0), "years");
13805
+
13806
+ if (expInYears >= 1) {
13807
+ var value = Math.floor(expInYears);
13808
+ return "".concat(value, " year") + (value > 1 ? "s" : "");
13809
+ }
13810
+
13811
+ if (expInMonths >= 1) {
13812
+ var _value = Math.floor(expInMonths);
13813
+
13814
+ return "".concat(_value, " month") + (_value > 1 ? "s" : "");
13815
+ }
13816
+
13817
+ if (expInDays >= 1) {
13818
+ var _value2 = Math.floor(expInDays);
13819
+
13820
+ return "".concat(_value2, " day") + (_value2 > 1 ? "s" : "");
13821
+ }
13822
+
13823
+ return "0 days";
13824
+ }; // DOCTER_LISTING
13784
13825
 
13785
13826
 
13786
13827
  var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
@@ -13962,6 +14003,9 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
13962
14003
  isDoctor: !isClinic,
13963
14004
  language: [],
13964
14005
  isClinic: isClinic,
14006
+ experience: 0,
14007
+ role: "",
14008
+ mobile: "",
13965
14009
  memberIncludes: "0",
13966
14010
  hospitalName: "",
13967
14011
  hospitalLocation: "",
@@ -14028,7 +14072,7 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
14028
14072
  info["key"] = restData === null || restData === void 0 ? void 0 : restData._key;
14029
14073
  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
14074
  } 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$;
14075
+ 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
14076
 
14033
14077
  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
14078
 
@@ -14067,14 +14111,17 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
14067
14111
  });
14068
14112
  }
14069
14113
  });
14114
+ 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;
14115
+ 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;
14116
+ info["experience"] = calculationExp(restData === null || restData === void 0 ? void 0 : restData.job_experience);
14070
14117
  info["title"] = "".concat(_gender).concat(_gender && " | ").concat(designation);
14071
14118
  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;
14119
+ info["hospId"] = restData === null || restData === void 0 ? void 0 : (_restData$hospital7 = restData.hospital) === null || _restData$hospital7 === void 0 ? void 0 : _restData$hospital7.id;
14073
14120
  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
14121
  return (q === null || q === void 0 ? void 0 : q.name) || "";
14075
14122
  })) === null || _restData$qualificati3 === void 0 ? void 0 : _restData$qualificati3.join(", ")) || "----";
14076
14123
  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) || "";
14124
+ info["hospitalName"] = (restData === null || restData === void 0 ? void 0 : (_restData$hospital8 = restData.hospital) === null || _restData$hospital8 === void 0 ? void 0 : _restData$hospital8.name) || "";
14078
14125
  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
14126
  var nameObj = (restData === null || restData === void 0 ? void 0 : (_restData$name = restData.name) === null || _restData$name === void 0 ? void 0 : _restData$name[0]) || {};
14080
14127
  info["name"] = makeName(nameObj);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primarycare-binder",
3
- "version": "1.1.38",
3
+ "version": "1.1.39",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",