primarycare-binder 1.1.25 → 1.1.29

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 +124 -20
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -9553,7 +9553,26 @@ var utcTOLocal$1 = function utcTOLocal(date, format) {
9553
9553
 
9554
9554
  var fmt = format ? format : "DD-MM-YYYY";
9555
9555
  return moment.utc(Ndate).local().format(fmt);
9556
- };
9556
+ }; // const getUtcTime = (date) => {
9557
+ // let a = null
9558
+ // if (date) {
9559
+ // a = new Date(date)
9560
+ // } else {
9561
+ // a = new Date()
9562
+ // }
9563
+ // a = a.toUTCString()
9564
+ // return ((new Date(a).getTime())/1000)
9565
+ // };
9566
+ // const utcTOLocal = (date, format) => {
9567
+ // let Ndate = new Date(date * 1000);
9568
+ // let fmt = format ? format : "DD-MM-YYYY"
9569
+ // if (format) {
9570
+ // return moment(Ndate).format(fmt);
9571
+ // } else {
9572
+ // return moment(Ndate)
9573
+ // }
9574
+ // };
9575
+
9557
9576
 
9558
9577
  var deg2rad = function deg2rad(deg) {
9559
9578
  return deg * (Math.PI / 180);
@@ -10094,13 +10113,20 @@ var PATIENT_DETAILS_READ = createAsyncThunk("patientReducer/readPatientDetails",
10094
10113
  payload = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
10095
10114
  _ref10 = _args5.length > 1 ? _args5[1] : undefined, rejectWithValue = _ref10.rejectWithValue;
10096
10115
  _context5.prev = 2;
10097
- _payload$key = payload.key, key = _payload$key === void 0 ? "" : _payload$key;
10116
+ _payload$key = payload.key, key = _payload$key === void 0 ? "" : _payload$key; // const read_p = {
10117
+ // // "db_name": db_name,
10118
+ // db_name: "primarycare",
10119
+ // entity: "Patient",
10120
+ // filter: `Patient._key=='${key}' && Patient.activestatus==true`,
10121
+ // return_fields:
10122
+ // "merge(Patient,{telecom:(for doc in ContactPointMaster filter doc._id in Patient.telecom return merge(doc,{system:(document(doc.system)),use:(document(doc.use)),valueprefix:(document(doc.valueprefix)),rank:(document(doc.rank))}))},{name:(for doc in HumanNameMaster filter doc._id in Patient.name return merge(doc,{use:(document(doc.use)),prefix:(document(doc.prefix)),suffix:(document(doc.suffix))}))},{gender:document(Patient.gender)},{address:(for doc in AddressMaster filter doc._id in Patient.address return merge(doc,{use:(document(doc.use)),city:(document(doc.city)),country:(document(doc.city)),district:(document(doc.district)), Type:(document(doc.Type)),postalCode:(document(doc.postalCode)),state:(document(doc.state))}))},{maritalstatus:document(Patient.maritalstatus)},{photo:document(Patient.photo)},{OrgID:document(Patient.OrgID)},{nationality:document(Patient.nationality)},{activereason:document(Patient.activereason)},{isdeceased:document(Patient.isdeceased)},{deceasedreason:document(Patient.deceasedreason)},{identifier:(for doc in IdentifierMaster filter doc._id in Patient.identifier return merge(doc,{user:(document(doc.user)), assigner:(document(doc.assigner)), period: (document(doc.period))}))},{communicationLanguage:document(Patient.communicationLanguage)},{birthGendercode:document(Patient.birthGendercode)},{citizenshipCode:document(Patient.citizenshipCode)},{disabilityCode:document(Patient.disabilityCode)},{genderIdentitycode:document(Patient.genderIdentitycode)},{religionCode:document(Patient.religionCode)},{raceCode:document(Patient.raceCode)},{ethinicityCode:document(Patient.ethinicityCode)},{patientTypecode:document(Patient.patientTypecode)},{bloodGroup:document(Patient.bloodGroup)},{attachment:document(Patient.attachment)},{age_type:document(Patient.age_type)},{primarycare_Prac:document(Patient.primarycare_Prac)})",
10123
+ // };
10124
+
10098
10125
  read_p = {
10099
- // "db_name": db_name,
10100
- db_name: "primarycare",
10126
+ db_name: dbName,
10101
10127
  entity: "Patient",
10102
10128
  filter: "Patient._key=='".concat(key, "' && Patient.activestatus==true"),
10103
- return_fields: "merge(Patient,{telecom:(for doc in ContactPointMaster filter doc._id in Patient.telecom return merge(doc,{system:(document(doc.system)),use:(document(doc.use)),valueprefix:(document(doc.valueprefix)),rank:(document(doc.rank))}))},{name:(for doc in HumanNameMaster filter doc._id in Patient.name return merge(doc,{use:(document(doc.use)),prefix:(document(doc.prefix)),suffix:(document(doc.suffix))}))},{gender:document(Patient.gender)},{address:(for doc in AddressMaster filter doc._id in Patient.address return merge(doc,{use:(document(doc.use)),city:(document(doc.city)),country:(document(doc.city)),district:(document(doc.district)), Type:(document(doc.Type)),postalCode:(document(doc.postalCode)),state:(document(doc.state))}))},{maritalstatus:document(Patient.maritalstatus)},{photo:document(Patient.photo)},{OrgID:document(Patient.OrgID)},{nationality:document(Patient.nationality)},{activereason:document(Patient.activereason)},{isdeceased:document(Patient.isdeceased)},{deceasedreason:document(Patient.deceasedreason)},{identifier:(for doc in IdentifierMaster filter doc._id in Patient.identifier return merge(doc,{user:(document(doc.user)), assigner:(document(doc.assigner)), period: (document(doc.period))}))},{communicationLanguage:document(Patient.communicationLanguage)},{birthGendercode:document(Patient.birthGendercode)},{citizenshipCode:document(Patient.citizenshipCode)},{disabilityCode:document(Patient.disabilityCode)},{genderIdentitycode:document(Patient.genderIdentitycode)},{religionCode:document(Patient.religionCode)},{raceCode:document(Patient.raceCode)},{ethinicityCode:document(Patient.ethinicityCode)},{patientTypecode:document(Patient.patientTypecode)},{bloodGroup:document(Patient.bloodGroup)},{attachment:document(Patient.attachment)},{age_type:document(Patient.age_type)},{primarycare_Prac:document(Patient.primarycare_Prac)})"
10129
+ return_fields: "merge(Patient,{telecom:(for doc in ContactPointMaster filter doc._id in Patient.telecom return merge(doc,{system:(document(doc.system)),use:(document(doc.use)),valueprefix:(document(doc.valueprefix)),rank:(document(doc.rank))}))},{name:(for doc in HumanNameMaster filter doc._id in Patient.name return merge(doc,{use:(document(doc.use)),prefix:(document(doc.prefix)),suffix:(document(doc.suffix))}))},{gender:document(Patient.gender)},{address:(for doc in AddressMaster filter doc._id in Patient.address return merge(doc,{use:(document(doc.use)),city:(document(doc.city)),country:(document(doc.city)),district:(document(doc.district)), Type:(document(doc.Type)),postalCode:(document(doc.postalCode)),state:(document(doc.state))}))},{maritalstatus:document(Patient.maritalstatus)},{photo:document(Patient.photo)},{OrgID:document(Patient.OrgID)},{nationality:document(Patient.nationality)},{activereason:document(Patient.activereason)},{isdeceased:document(Patient.isdeceased)},{deceasedreason:document(Patient.deceasedreason)},{identifier:(for doc in IdentifierMaster filter doc._id in Patient.identifier return merge(doc,{user:(document(doc.user)), assigner:(document(doc.assigner)), period: (document(doc.period))}))},{communicationLanguage:document(Patient.communicationLanguage)},{birthGendercode:document(Patient.birthGendercode)},{citizenshipCode:document(Patient.citizenshipCode)},{disabilityCode:document(Patient.disabilityCode)},{genderIdentitycode:document(Patient.genderIdentitycode)},{religionCode:document(Patient.religionCode)},{raceCode:document(Patient.raceCode)},{ethinicityCode:document(Patient.ethinicityCode)},{patientTypecode:document(Patient.patientTypecode)},{bloodGroup:document(Patient.bloodGroup)},{attachment:document(Patient.attachment)},{age_type:document(Patient.age_type)},{primarycare_Prac:document(Patient.primarycare_Prac)},{specialArng_code:document(Patient.specialArng_code)},{specialCourtesy_code: document(Patient.specialCourtesy_code)})"
10104
10130
  };
10105
10131
  _context5.next = 7;
10106
10132
  return fetchData$3({
@@ -13766,6 +13792,12 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
13766
13792
  longtitude,
13767
13793
  _payload$doctorId,
13768
13794
  doctorId,
13795
+ _payload$consultmode,
13796
+ consultmode,
13797
+ _payload$gender,
13798
+ gender,
13799
+ _payload$lang,
13800
+ lang,
13769
13801
  body,
13770
13802
  data,
13771
13803
  returnData,
@@ -13799,20 +13831,18 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
13799
13831
  endDate = Edate;
13800
13832
  startDate.setHours(0, 0, 0, 0);
13801
13833
  endDate.setHours(23, 59, 59, 999);
13802
- hospital = payload.hospital, specialities = payload.specialities, latitude = payload.latitude, longtitude = payload.longtitude, _payload$doctorId = payload.doctorId, doctorId = _payload$doctorId === void 0 ? 0 : _payload$doctorId;
13834
+ hospital = payload.hospital, specialities = payload.specialities, latitude = payload.latitude, longtitude = payload.longtitude, _payload$doctorId = payload.doctorId, doctorId = _payload$doctorId === void 0 ? 0 : _payload$doctorId, _payload$consultmode = payload.consultmode, consultmode = _payload$consultmode === void 0 ? ["Direct", "Video", "Both"] : _payload$consultmode, _payload$gender = payload.gender, gender = _payload$gender === void 0 ? "" : _payload$gender, _payload$lang = payload.lang, lang = _payload$lang === void 0 ? "" : _payload$lang;
13803
13835
  body = {
13804
13836
  db_name: dbName,
13805
13837
  queryid: query_ids.doctorListing,
13806
13838
  filter: {
13807
13839
  org_id: hospital,
13808
- // "Organization": hospital + "/10000",
13809
13840
  speciality: specialities,
13810
13841
  startdate: getUtcTime(startDate),
13811
- enddate: getUtcTime(endDate) // "latitude": latitude,
13812
- // "longtitude": longtitude,
13813
- // "startdate": 1614836455,
13814
- // "enddate" : 1622785255
13815
-
13842
+ enddate: getUtcTime(endDate),
13843
+ consultmode: consultmode,
13844
+ gender: gender,
13845
+ lang: lang
13816
13846
  }
13817
13847
  };
13818
13848
 
@@ -13994,7 +14024,8 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
13994
14024
  } else {
13995
14025
  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$;
13996
14026
 
13997
- 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) || "";
14027
+ 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) || "";
14028
+
13998
14029
  var designation = "";
13999
14030
  restData === null || restData === void 0 ? void 0 : (_restData$Specialties = restData.Specialties) === null || _restData$Specialties === void 0 ? void 0 : _restData$Specialties.forEach(function (s) {
14000
14031
  var _s$coding2;
@@ -14030,8 +14061,8 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
14030
14061
  });
14031
14062
  }
14032
14063
  });
14033
- info["title"] = "".concat(gender).concat(gender && " | ").concat(designation);
14034
- info["gender"] = gender;
14064
+ info["title"] = "".concat(_gender).concat(_gender && " | ").concat(designation);
14065
+ info["gender"] = _gender;
14035
14066
  info["hospId"] = restData === null || restData === void 0 ? void 0 : (_restData$hospital6 = restData.hospital) === null || _restData$hospital6 === void 0 ? void 0 : _restData$hospital6.id;
14036
14067
  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) {
14037
14068
  return (q === null || q === void 0 ? void 0 : q.name) || "";
@@ -14103,29 +14134,102 @@ var DOCTER_LISTING = createAsyncThunk("docterListingReducer/docterListing", /*#_
14103
14134
  }
14104
14135
  }, _callee2, null, [[2, 34]]);
14105
14136
  }))); // end
14106
- // FUZZY SEARCH CREATE INITIALSTATE
14137
+
14138
+ var GET_ALL_LANGS = createAsyncThunk("docterListingReducer/allLanguages", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
14139
+ var payload,
14140
+ _ref5,
14141
+ rejectWithValue,
14142
+ body,
14143
+ data,
14144
+ returnData,
14145
+ _args3 = arguments;
14146
+
14147
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
14148
+ while (1) {
14149
+ switch (_context3.prev = _context3.next) {
14150
+ case 0:
14151
+ payload = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
14152
+ _ref5 = _args3.length > 1 ? _args3[1] : undefined, rejectWithValue = _ref5.rejectWithValue;
14153
+ _context3.prev = 2;
14154
+ body = {
14155
+ db_name: dbName,
14156
+ entity: "CodeableConceptMaster",
14157
+ filter: "CodeableConceptMaster.Type == 'LANGUAGE'",
14158
+ return_fields: "{coding_id: CodeableConceptMaster._id, codeable: (let codeable = DOCUMENT(CodeableConceptMaster.coding[0]) RETURN codeable)[0]}"
14159
+ };
14160
+ _context3.next = 6;
14161
+ return fetchData$3({
14162
+ body: JSON.stringify(body)
14163
+ }, __readDocumentUrl__);
14164
+
14165
+ case 6:
14166
+ data = _context3.sent;
14167
+ returnData = [];
14168
+
14169
+ if (data.result && Array.isArray(data.result)) {
14170
+ returnData = data.result.map(function (d) {
14171
+ var _d$codeable, _d$codeable2;
14172
+
14173
+ return {
14174
+ val: (_d$codeable = d.codeable) === null || _d$codeable === void 0 ? void 0 : _d$codeable.code,
14175
+ title: (_d$codeable2 = d.codeable) === null || _d$codeable2 === void 0 ? void 0 : _d$codeable2.display
14176
+ };
14177
+ });
14178
+ }
14179
+
14180
+ return _context3.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
14181
+ data: returnData
14182
+ }));
14183
+
14184
+ case 12:
14185
+ _context3.prev = 12;
14186
+ _context3.t0 = _context3["catch"](2);
14187
+ console.log(error);
14188
+ return _context3.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
14189
+ message: error.message
14190
+ })));
14191
+
14192
+ case 16:
14193
+ case "end":
14194
+ return _context3.stop();
14195
+ }
14196
+ }
14197
+ }, _callee3, null, [[2, 12]]);
14198
+ }))); // FUZZY SEARCH CREATE INITIALSTATE
14107
14199
 
14108
14200
  var docterListingReducer = createSlice({
14109
14201
  name: "docterListingReducer",
14110
14202
  initialState: {
14111
- docterListing: _objectSpread2({}, defaultState.Info)
14203
+ docterListing: _objectSpread2({}, defaultState.List),
14204
+ allLanguages: _objectSpread2({}, defaultState.List)
14112
14205
  },
14113
14206
  extraReducers: (_extraReducers$y = {}, _defineProperty(_extraReducers$y, DOCTER_LISTING.fulfilled, function (state, action) {
14114
14207
  var _action$payload;
14115
14208
 
14116
- state.docterListing = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : {};
14209
+ state.docterListing = (_action$payload = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload !== void 0 ? _action$payload : [];
14117
14210
  }), _defineProperty(_extraReducers$y, DOCTER_LISTING.pending, function (state, action) {
14118
14211
  state.docterListing.loading = true;
14119
14212
  }), _defineProperty(_extraReducers$y, DOCTER_LISTING.rejected, function (state, action) {
14120
14213
  var _action$payload2;
14121
14214
 
14122
- state.docterListing = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : {};
14215
+ state.docterListing = (_action$payload2 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload2 !== void 0 ? _action$payload2 : [];
14216
+ }), _defineProperty(_extraReducers$y, GET_ALL_LANGS.fulfilled, function (state, action) {
14217
+ var _action$payload3;
14218
+
14219
+ state.allLanguages = (_action$payload3 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload3 !== void 0 ? _action$payload3 : [];
14220
+ }), _defineProperty(_extraReducers$y, GET_ALL_LANGS.pending, function (state, action) {
14221
+ state.allLanguages.loading = true;
14222
+ }), _defineProperty(_extraReducers$y, GET_ALL_LANGS.rejected, function (state, action) {
14223
+ var _action$payload4;
14224
+
14225
+ state.allLanguages = (_action$payload4 = action === null || action === void 0 ? void 0 : action.payload) !== null && _action$payload4 !== void 0 ? _action$payload4 : [];
14123
14226
  }), _extraReducers$y)
14124
14227
  }); // end
14125
14228
  // DOCTER_LISTING ACTION LISTS
14126
14229
 
14127
14230
  var docterListingActions = {
14128
- DOCTER_LISTING: DOCTER_LISTING
14231
+ DOCTER_LISTING: DOCTER_LISTING,
14232
+ GET_ALL_LANGS: GET_ALL_LANGS
14129
14233
  }; // end
14130
14234
  var docterListingReducer$1 = docterListingReducer.reducer;
14131
14235
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primarycare-binder",
3
- "version": "1.1.25",
3
+ "version": "1.1.29",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",