primary_care_admin_binder 0.1.151 → 0.1.154

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 +195 -84
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -2394,6 +2394,8 @@ function getBinderUrls() {
2394
2394
  var tokenApi = getBinderEnv("REACT_APP_TOKEN_URL");
2395
2395
  var registrationApi = getBinderEnv("REACT_APP_REGISTRATION_API");
2396
2396
  var appointmentApi = getBinderEnv("REACT_APP_APPOINTMENT_API");
2397
+ getBinderEnv("REACT_APP_VHC_INTEGRATION_URL");
2398
+ var getMohUserDetailUrl = getBinderEnv("REACT_APP_GET_MOH_USER_DETAIL_URL");
2397
2399
  return {
2398
2400
  // Database & Metadata
2399
2401
  dbtype: getBinderEnv("REACT_APP_BASE_URL_HOST").split(".")[0],
@@ -2473,6 +2475,11 @@ function getBinderUrls() {
2473
2475
  saveTarget: function saveTarget() {
2474
2476
  return "".concat(registrationApi, "/api/saveTarget");
2475
2477
  },
2478
+ // MOH API
2479
+ // getMohUserDetail: () => `${vhcIntegrationUrl}/getMohUserDetail`,
2480
+ getMohUserDetail: function getMohUserDetail() {
2481
+ return getMohUserDetailUrl;
2482
+ },
2476
2483
  // Appointment Holiday URLs
2477
2484
  holidayEditUrl: function holidayEditUrl() {
2478
2485
  return "".concat(appointmentApi, "/api/editHoliday");
@@ -2493,6 +2500,7 @@ var __deleteUrl__ = "";
2493
2500
  var __softDelete__ = "";
2494
2501
  var __savePract__ = "";
2495
2502
  var __saveTarget__ = "";
2503
+ var __getMohUserDetailUrl__ = "";
2496
2504
  var __nifiEditUrl__ = "";
2497
2505
  var __nifiAddUrl__ = "";
2498
2506
  var __holidayEditUrl__ = "";
@@ -2532,6 +2540,7 @@ function refreshBinderUrls() {
2532
2540
  __softDelete__ = urls.softDeleteUrl();
2533
2541
  __savePract__ = urls.savePractitioner();
2534
2542
  __saveTarget__ = urls.saveTarget();
2543
+ __getMohUserDetailUrl__ = urls.getMohUserDetail();
2535
2544
  __nifiEditUrl__ = urls.nifiEditUrl();
2536
2545
  __nifiAddUrl__ = urls.nifiAddUrl();
2537
2546
  __holidayEditUrl__ = urls.holidayEditUrl();
@@ -8770,6 +8779,38 @@ var GET_ENTITY_BY_ID = createAsyncThunk("practitionerSlice/get_entity_id", /*#__
8770
8779
  }
8771
8780
  }, _callee6, null, [[1, 3]]);
8772
8781
  })));
8782
+ var GET_MOH_USER_DETAIL = createAsyncThunk("practitionerSlice/get_moh_user_detail", /*#__PURE__*/function () {
8783
+ var _ref13 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref11, _ref12) {
8784
+ var payload, jwtToken, rejectWithValue, data, _t7;
8785
+ return _regenerator().w(function (_context7) {
8786
+ while (1) switch (_context7.p = _context7.n) {
8787
+ case 0:
8788
+ payload = _ref11.payload, jwtToken = _ref11.jwtToken;
8789
+ rejectWithValue = _ref12.rejectWithValue;
8790
+ _context7.p = 1;
8791
+ console.log(jwtToken, "jwtT");
8792
+ _context7.n = 2;
8793
+ return fetchData({
8794
+ body: JSON.stringify(payload)
8795
+ }, __getMohUserDetailUrl__, jwtToken);
8796
+ case 2:
8797
+ data = _context7.v;
8798
+ return _context7.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
8799
+ data: data
8800
+ }));
8801
+ case 3:
8802
+ _context7.p = 3;
8803
+ _t7 = _context7.v;
8804
+ return _context7.a(2, rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
8805
+ message: _t7.message
8806
+ })));
8807
+ }
8808
+ }, _callee7, null, [[1, 3]]);
8809
+ }));
8810
+ return function (_x, _x2) {
8811
+ return _ref13.apply(this, arguments);
8812
+ };
8813
+ }());
8773
8814
  var practitionerSlice = createSlice({
8774
8815
  name: "practitionerApiSlice",
8775
8816
  initialState: {
@@ -8778,7 +8819,8 @@ var practitionerSlice = createSlice({
8778
8819
  practitioner_list: _objectSpread2({}, defaultState.List),
8779
8820
  practitioner_upsert: _objectSpread2({}, defaultState.List),
8780
8821
  practitioner_status_update: _objectSpread2({}, defaultState.List),
8781
- get_entity_by_id: _objectSpread2({}, defaultState.List)
8822
+ get_entity_by_id: _objectSpread2({}, defaultState.List),
8823
+ get_moh_user_detail: _objectSpread2({}, defaultState.List)
8782
8824
  },
8783
8825
  extraReducers: (_extraReducers$C = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extraReducers$C, PRACTITIONER_ROLE_READ.fulfilled, function (state, action) {
8784
8826
  state.practitioner_role_list.loading = false, state.practitioner_role_list.error = false, state.practitioner_role_list = action.payload;
@@ -8800,7 +8842,7 @@ var practitionerSlice = createSlice({
8800
8842
  state.practitioner_list.loading = false, state.practitioner_list.error = true, state.practitioner_list = action.payload;
8801
8843
  }), PRACTITIONER_UPSERT.fulfilled, function (state, action) {
8802
8844
  state.practitioner_upsert.loading = false, state.practitioner_upsert.error = false, state.practitioner_upsert = action.payload;
8803
- }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extraReducers$C, PRACTITIONER_UPSERT.pending, function (state, action) {
8845
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extraReducers$C, PRACTITIONER_UPSERT.pending, function (state, action) {
8804
8846
  state.practitioner_upsert.loading = true, state.practitioner_upsert.error = false, state.practitioner_upsert.loading = true;
8805
8847
  }), PRACTITIONER_UPSERT.rejected, function (state, action) {
8806
8848
  state.practitioner_upsert.loading = false, state.practitioner_upsert.error = true, state.practitioner_upsert = action.payload;
@@ -8816,6 +8858,12 @@ var practitionerSlice = createSlice({
8816
8858
  state.get_entity_by_id.loading = true, state.get_entity_by_id.error = false, state.get_entity_by_id.loading = true;
8817
8859
  }), GET_ENTITY_BY_ID.rejected, function (state, action) {
8818
8860
  state.get_entity_by_id.loading = false, state.get_entity_by_id.error = true, state.get_entity_by_id = action.payload;
8861
+ }), GET_MOH_USER_DETAIL.fulfilled, function (state, action) {
8862
+ state.get_moh_user_detail.loading = false, state.get_moh_user_detail.error = false, state.get_moh_user_detail = action.payload;
8863
+ }), GET_MOH_USER_DETAIL.pending, function (state, action) {
8864
+ state.get_moh_user_detail.loading = true, state.get_moh_user_detail.error = false, state.get_moh_user_detail.loading = true;
8865
+ }), _defineProperty(_extraReducers$C, GET_MOH_USER_DETAIL.rejected, function (state, action) {
8866
+ state.get_moh_user_detail.loading = false, state.get_moh_user_detail.error = true, state.get_moh_user_detail = action.payload;
8819
8867
  }))
8820
8868
  });
8821
8869
  var practitionerActions$1 = {
@@ -8824,7 +8872,8 @@ var practitionerActions$1 = {
8824
8872
  PRACTITIONER_LIST_READ: PRACTITIONER_LIST_READ,
8825
8873
  PRACTITIONER_UPSERT: PRACTITIONER_UPSERT,
8826
8874
  PRACTITIONER_STATUS_CHANGE: PRACTITIONER_STATUS_CHANGE,
8827
- GET_ENTITY_BY_ID: GET_ENTITY_BY_ID
8875
+ GET_ENTITY_BY_ID: GET_ENTITY_BY_ID,
8876
+ GET_MOH_USER_DETAIL: GET_MOH_USER_DETAIL
8828
8877
  };
8829
8878
  var practitionerSlice$1 = practitionerSlice.reducer;
8830
8879
 
@@ -12300,10 +12349,10 @@ var generateJSON = function generateJSON(data, _key) {
12300
12349
  data.contactDetails.map(function (val) {
12301
12350
  var contactData_obj = {
12302
12351
  //_id: "",
12303
- system: val.contactMode.value.value ? val.contactMode.value.value : "",
12352
+ system: val.contactMode.value.label ? val.contactMode.value.label : "",
12304
12353
  value: val.contactModeType.value ? val.contactModeType.value : "",
12305
- use: val.use.value.value ? val.use.value.value : "",
12306
- rank: val.priority.value.value ? val.priority.value.value : "",
12354
+ use: val.use.value.label ? val.use.value.label : "",
12355
+ rank: val.priority.value.label ? val.priority.value.label : "",
12307
12356
  period: [{
12308
12357
  //_id: "",
12309
12358
  start: getUtcTime(),
@@ -15070,10 +15119,12 @@ var masterQuery$7 = {
15070
15119
  locationMasterEntityType: function locationMasterEntityType() {
15071
15120
  return {
15072
15121
  db_name: _dbName,
15073
- queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
15122
+ queryid: "b283129b-9841-419b-bdfc-de5105ebbad7",
15074
15123
  filter: {
15075
15124
  type: "ORGTYPE",
15076
- activestatus: true
15125
+ code: "",
15126
+ status: true,
15127
+ sortField: "display"
15077
15128
  }
15078
15129
  };
15079
15130
  },
@@ -15113,10 +15164,12 @@ var masterQuery$7 = {
15113
15164
  locationMasterLocationType: function locationMasterLocationType() {
15114
15165
  return {
15115
15166
  db_name: _dbName,
15116
- queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
15167
+ queryid: "b283129b-9841-419b-bdfc-de5105ebbad7",
15117
15168
  filter: {
15118
15169
  type: "LOCATIONTYPE",
15119
- activestatus: true
15170
+ code: "",
15171
+ status: true,
15172
+ sortField: "display"
15120
15173
  }
15121
15174
  };
15122
15175
  },
@@ -15135,10 +15188,12 @@ var masterQuery$7 = {
15135
15188
  locationMasterOperationalStatus: function locationMasterOperationalStatus() {
15136
15189
  return {
15137
15190
  db_name: _dbName,
15138
- queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
15191
+ queryid: "b283129b-9841-419b-bdfc-de5105ebbad7",
15139
15192
  filter: {
15140
15193
  type: "OPERATIONSTATUS",
15141
- activestatus: true
15194
+ code: "",
15195
+ status: true,
15196
+ sortField: "display"
15142
15197
  }
15143
15198
  };
15144
15199
  },
@@ -15229,10 +15284,12 @@ var masterQuery$7 = {
15229
15284
  locationMasterContactMode: function locationMasterContactMode() {
15230
15285
  return {
15231
15286
  db_name: _dbName,
15232
- queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
15287
+ queryid: "b283129b-9841-419b-bdfc-de5105ebbad7",
15233
15288
  filter: {
15234
15289
  type: "CONTACTSYSTEM",
15235
- activestatus: true
15290
+ code: "",
15291
+ status: true,
15292
+ sortField: "display"
15236
15293
  }
15237
15294
  };
15238
15295
  },
@@ -15275,10 +15332,12 @@ var masterQuery$7 = {
15275
15332
  locationMasterUse: function locationMasterUse() {
15276
15333
  return {
15277
15334
  db_name: _dbName,
15278
- queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
15335
+ queryid: "b283129b-9841-419b-bdfc-de5105ebbad7",
15279
15336
  filter: {
15280
15337
  type: "ADDRESSUSE",
15281
- activestatus: true
15338
+ code: "",
15339
+ status: true,
15340
+ sortField: "display"
15282
15341
  }
15283
15342
  };
15284
15343
  },
@@ -15297,10 +15356,12 @@ var masterQuery$7 = {
15297
15356
  locationMasterPriority: function locationMasterPriority() {
15298
15357
  return {
15299
15358
  db_name: _dbName,
15300
- queryid: "506a5dd7-e07d-4218-af28-10bd2e4c0016",
15359
+ queryid: "b283129b-9841-419b-bdfc-de5105ebbad7",
15301
15360
  filter: {
15302
15361
  type: "RANK",
15303
- activestatus: true
15362
+ code: "",
15363
+ status: true,
15364
+ sortField: "display"
15304
15365
  }
15305
15366
  };
15306
15367
  },
@@ -15311,7 +15372,7 @@ var masterQuery$7 = {
15311
15372
  filter: {
15312
15373
  type: "SPECIALTY",
15313
15374
  code: "",
15314
- status: "true",
15375
+ status: true,
15315
15376
  sortField: "display"
15316
15377
  }
15317
15378
  };
@@ -15361,37 +15422,43 @@ var contactDetailList = function contactDetailList(data, state) {
15361
15422
  }
15362
15423
  return contact_Lists;
15363
15424
  };
15364
- //CONTACT MODE OBJ
15425
+ //CONTACT MODE OBJ — data is an expanded document object { _id, display, ... }
15365
15426
  var contactModeList = function contactModeList(data, state) {
15366
- return data && data.length > 0 ? safeFind(state.location_masters_contactmode, function (sys) {
15367
- return data.indexOf(sys.value) > -1;
15427
+ var _data$_id;
15428
+ var id = (_data$_id = data === null || data === void 0 ? void 0 : data._id) !== null && _data$_id !== void 0 ? _data$_id : data;
15429
+ return id ? safeFind(state.location_masters_contactmode, function (sys) {
15430
+ return String(sys.label) === String(id);
15368
15431
  }) : {
15369
15432
  label: "",
15370
15433
  value: ""
15371
15434
  };
15372
15435
  };
15373
- //COUNTRY CODE OBJ
15436
+ //COUNTRY CODE OBJ — data is a plain string (ISD code prefix)
15374
15437
  var countryCodeList = function countryCodeList(data, state) {
15375
15438
  return data && data.length > 0 ? safeFind(state.location_masters_isd, function (sys) {
15376
- return data.indexOf(sys.value) > -1;
15439
+ return String(sys.value) === String(data);
15377
15440
  }) : {
15378
15441
  label: "",
15379
15442
  value: ""
15380
15443
  };
15381
15444
  };
15382
- //USE OBJ
15445
+ //USE OBJ — data is an expanded document object { _id, display, ... }
15383
15446
  var useList = function useList(data, state) {
15384
- return data && data.length > 0 ? safeFind(state.location_masters_use, function (sys) {
15385
- return data.indexOf(sys.value) > -1;
15447
+ var _data$_id2;
15448
+ var id = (_data$_id2 = data === null || data === void 0 ? void 0 : data._id) !== null && _data$_id2 !== void 0 ? _data$_id2 : data;
15449
+ return id ? safeFind(state.location_masters_use, function (sys) {
15450
+ return String(sys.label) === String(id);
15386
15451
  }) : {
15387
15452
  label: "",
15388
15453
  value: ""
15389
15454
  };
15390
15455
  };
15391
- //RANK OBJ
15456
+ //RANK OBJ — data is an expanded document object { _id, display, ... }
15392
15457
  var priorityList = function priorityList(data, state) {
15393
- return data && data.length > 0 ? safeFind(state.location_masters_priority, function (sys) {
15394
- return data.indexOf(sys.value) > -1;
15458
+ var _data$_id3;
15459
+ var id = (_data$_id3 = data === null || data === void 0 ? void 0 : data._id) !== null && _data$_id3 !== void 0 ? _data$_id3 : data;
15460
+ return id ? safeFind(state.location_masters_priority, function (sys) {
15461
+ return String(sys.label) === String(id);
15395
15462
  }) : {
15396
15463
  label: "",
15397
15464
  value: ""
@@ -15499,7 +15566,7 @@ var photoData$1 = function photoData(data) {
15499
15566
  return photo_Data;
15500
15567
  };
15501
15568
  var generateReadJSON$4 = function generateReadJSON(data, state) {
15502
- var _data$managingOrgEnti, _data$managingOrgEnti2, _data$managingOrgID, _data$locationType$, _data$locationType$2, _data$address, _data$address2, _data$position, _data$position2, _data$position3, _data$workingdayyear, _data$workingdayyear2, _data$workingdayyear$, _data$workingdayyear$2, _data$workingdayyear$3;
15569
+ var _data$managingOrgEnti, _data$managingOrgEnti2, _data$managingOrgID, _data$locationType, _data$locationType2, _data$specialty, _data$specialty2, _data$address, _data$address2, _data$position, _data$position2, _data$position3, _data$workingdayyear, _data$workingdayyear2, _data$workingdayyear$, _data$workingdayyear$2, _data$workingdayyear$3;
15503
15570
  var inital_workingday_slot_arr = [{
15504
15571
  day: "Mon",
15505
15572
  checked: true,
@@ -15551,46 +15618,52 @@ var generateReadJSON$4 = function generateReadJSON(data, state) {
15551
15618
  }]
15552
15619
  }];
15553
15620
  var json = {
15554
- entityType: data.managingOrgEntityType && Array.isArray(data.managingOrgEntityType) && data.managingOrgEntityType.length > 0 ? _objectSpread2({
15555
- label: (_data$managingOrgEnti = data.managingOrgEntityType[0]) === null || _data$managingOrgEnti === void 0 ? void 0 : _data$managingOrgEnti._id,
15556
- value: (_data$managingOrgEnti2 = data.managingOrgEntityType[0]) === null || _data$managingOrgEnti2 === void 0 || (_data$managingOrgEnti2 = _data$managingOrgEnti2.coding) === null || _data$managingOrgEnti2 === void 0 || (_data$managingOrgEnti2 = _data$managingOrgEnti2[0]) === null || _data$managingOrgEnti2 === void 0 ? void 0 : _data$managingOrgEnti2.display
15557
- }, data.managingOrgEntityType[0]) : {
15621
+ entityType: data.managingOrgEntityType ? _objectSpread2({
15622
+ label: (_data$managingOrgEnti = data.managingOrgEntityType) === null || _data$managingOrgEnti === void 0 ? void 0 : _data$managingOrgEnti._id,
15623
+ value: (_data$managingOrgEnti2 = data.managingOrgEntityType) === null || _data$managingOrgEnti2 === void 0 ? void 0 : _data$managingOrgEnti2.display
15624
+ }, data.managingOrgEntityType) : {
15558
15625
  label: "",
15559
15626
  value: ""
15560
15627
  },
15561
- entityNameId: data === null || data === void 0 || (_data$managingOrgID = data.managingOrgID) === null || _data$managingOrgID === void 0 || (_data$managingOrgID = _data$managingOrgID[0]) === null || _data$managingOrgID === void 0 ? void 0 : _data$managingOrgID._id,
15562
- locationType: data.locationType && Array.isArray(data.locationType) && data.locationType.length > 0 ? _objectSpread2({
15563
- label: (_data$locationType$ = data.locationType[0]) === null || _data$locationType$ === void 0 ? void 0 : _data$locationType$._id,
15564
- value: (_data$locationType$2 = data.locationType[0]) === null || _data$locationType$2 === void 0 || (_data$locationType$2 = _data$locationType$2.coding) === null || _data$locationType$2 === void 0 || (_data$locationType$2 = _data$locationType$2[0]) === null || _data$locationType$2 === void 0 ? void 0 : _data$locationType$2.display
15565
- }, data.locationType[0]) : {
15628
+ entityNameId: data === null || data === void 0 || (_data$managingOrgID = data.managingOrgID) === null || _data$managingOrgID === void 0 ? void 0 : _data$managingOrgID._id,
15629
+ locationType: data.locationType ? _objectSpread2({
15630
+ label: (_data$locationType = data.locationType) === null || _data$locationType === void 0 ? void 0 : _data$locationType._id,
15631
+ value: (_data$locationType2 = data.locationType) === null || _data$locationType2 === void 0 ? void 0 : _data$locationType2.display
15632
+ }, data.locationType) : {
15566
15633
  label: "",
15567
15634
  value: ""
15568
15635
  },
15569
15636
  locationId: data.locationID ? data.locationID : "",
15570
15637
  shortDescription: data.shortdesc ? data.shortdesc : "",
15571
15638
  longDescription: data.longdesc ? data.longdesc : "",
15572
- operationalStatus: data.operationalStatus && Array.isArray(data.operationalStatus) && data.operationalStatus.length > 0 ? safeFind(state.location_masters_operationalstatus, function (sys) {
15639
+ operationalStatus: data.operationalStatus ? safeFind(state.location_masters_operationalstatus, function (sys) {
15573
15640
  var _data$operationalStat;
15574
- return String((_data$operationalStat = data.operationalStatus[0]) === null || _data$operationalStat === void 0 ? void 0 : _data$operationalStat._id) === String(sys.label);
15641
+ return String((_data$operationalStat = data.operationalStatus) === null || _data$operationalStat === void 0 ? void 0 : _data$operationalStat._id) === String(sys.label);
15575
15642
  }) : {
15576
15643
  label: "",
15577
15644
  value: ""
15578
15645
  },
15579
- parentLocationIdandDescription: data.parentLocationID_desc && data.parentLocationID_desc.length > 0 ? safeFind(state.location_masters_parent_location_id, function (sys) {
15646
+ parentLocationIdandDescription: data.parentLocationID_desc ? safeFind(state.location_masters_parent_location_id, function (sys) {
15580
15647
  var _data$parentLocationI;
15581
- return String((_data$parentLocationI = data.parentLocationID_desc) === null || _data$parentLocationI === void 0 || (_data$parentLocationI = _data$parentLocationI[0]) === null || _data$parentLocationI === void 0 ? void 0 : _data$parentLocationI._id) === String(sys.label);
15648
+ return String((_data$parentLocationI = data.parentLocationID_desc) === null || _data$parentLocationI === void 0 ? void 0 : _data$parentLocationI._id) === String(sys.label);
15582
15649
  }) : {
15583
15650
  label: "",
15584
15651
  value: ""
15585
15652
  },
15586
- locationRoleType: data.locationRoletype && data.locationRoletype.length > 0 ? safeFind(state.location_masters_locationroletype, function (sys) {
15653
+ locationRoleType: data.locationRoletype ? safeFind(state.location_masters_locationroletype, function (sys) {
15587
15654
  var _data$locationRoletyp;
15588
- return String((_data$locationRoletyp = data.locationRoletype) === null || _data$locationRoletyp === void 0 || (_data$locationRoletyp = _data$locationRoletyp[0]) === null || _data$locationRoletyp === void 0 ? void 0 : _data$locationRoletyp._id) === String(sys.label);
15655
+ return String((_data$locationRoletyp = data.locationRoletype) === null || _data$locationRoletyp === void 0 ? void 0 : _data$locationRoletyp._id) === String(sys.label);
15589
15656
  }) : {
15590
15657
  label: "",
15591
15658
  value: ""
15592
15659
  },
15593
- speciality: data.specialty,
15660
+ speciality: data.specialty ? _objectSpread2({
15661
+ label: (_data$specialty = data.specialty) === null || _data$specialty === void 0 ? void 0 : _data$specialty._id,
15662
+ value: (_data$specialty2 = data.specialty) === null || _data$specialty2 === void 0 ? void 0 : _data$specialty2.display
15663
+ }, data.specialty) : {
15664
+ label: "",
15665
+ value: ""
15666
+ },
15594
15667
  clinicDetails: data.clinicdetails ? data.clinicdetails : "",
15595
15668
  locationAddress: (_data$address = data.address) !== null && _data$address !== void 0 && (_data$address = _data$address[0]) !== null && _data$address !== void 0 && _data$address.text ? (_data$address2 = data.address) === null || _data$address2 === void 0 || (_data$address2 = _data$address2[0]) === null || _data$address2 === void 0 ? void 0 : _data$address2.text : "",
15596
15669
  longitude: (_data$position = data.position) !== null && _data$position !== void 0 && (_data$position = _data$position[0]) !== null && _data$position !== void 0 && _data$position.longitude ? data.position[0].longitude : "",
@@ -15635,8 +15708,8 @@ var LOCATION_MASTERS_ENTITYTYPE = createAsyncThunk("locationMasterSlice/location
15635
15708
  _context.n = 3;
15636
15709
  return data_arr.map(function (val) {
15637
15710
  arry.push(_objectSpread2({
15638
- value: val.coding[0].display,
15639
- label: val._id,
15711
+ value: val === null || val === void 0 ? void 0 : val.display,
15712
+ label: val === null || val === void 0 ? void 0 : val._id,
15640
15713
  id: val.id
15641
15714
  }, val));
15642
15715
  });
@@ -15718,10 +15791,9 @@ var LOCATION_MASTERS_LOCATIONTYPE = createAsyncThunk("locationMasterSlice/locati
15718
15791
  arry = [];
15719
15792
  _context3.n = 3;
15720
15793
  return data_arr.map(function (val) {
15721
- var _val$coding;
15722
15794
  arry.push({
15723
- value: (_val$coding = val.coding) === null || _val$coding === void 0 || (_val$coding = _val$coding[0]) === null || _val$coding === void 0 ? void 0 : _val$coding.display,
15724
- label: val._id
15795
+ value: val === null || val === void 0 ? void 0 : val.display,
15796
+ label: val === null || val === void 0 ? void 0 : val._id
15725
15797
  });
15726
15798
  });
15727
15799
  case 3:
@@ -15759,8 +15831,8 @@ var LOCATION_MASTERS_OPERATIONALSTATUS = createAsyncThunk("locationMasterSlice/l
15759
15831
  _context4.n = 3;
15760
15832
  return data_arr.map(function (val) {
15761
15833
  arry.push({
15762
- value: val.coding[0].display,
15763
- label: val._id
15834
+ value: val === null || val === void 0 ? void 0 : val.display,
15835
+ label: val === null || val === void 0 ? void 0 : val._id
15764
15836
  });
15765
15837
  });
15766
15838
  case 3:
@@ -15921,8 +15993,8 @@ var LOCATION_MASTER_CONTACTMODE = createAsyncThunk("locationMasterSlice/location
15921
15993
  _context8.n = 3;
15922
15994
  return data_arr.map(function (val) {
15923
15995
  arry.push({
15924
- value: val.coding[0].display,
15925
- label: val._id
15996
+ value: val === null || val === void 0 ? void 0 : val.display,
15997
+ label: val === null || val === void 0 ? void 0 : val._id
15926
15998
  });
15927
15999
  });
15928
16000
  case 3:
@@ -15999,8 +16071,8 @@ var LOCATION_MASTER_USE = createAsyncThunk("locationMasterSlice/location_masters
15999
16071
  _context0.n = 3;
16000
16072
  return data_arr.map(function (val) {
16001
16073
  arry.push({
16002
- value: val.coding[0].display,
16003
- label: val._id
16074
+ value: val === null || val === void 0 ? void 0 : val.display,
16075
+ label: val === null || val === void 0 ? void 0 : val._id
16004
16076
  });
16005
16077
  });
16006
16078
  case 3:
@@ -16038,8 +16110,8 @@ var LOCATION_MASTER_PRIORITY = createAsyncThunk("locationMasterSlice/location_ma
16038
16110
  _context1.n = 3;
16039
16111
  return data_arr.map(function (val) {
16040
16112
  arry.push({
16041
- value: val.coding[0].display,
16042
- label: val._id
16113
+ value: val === null || val === void 0 ? void 0 : val.display,
16114
+ label: val === null || val === void 0 ? void 0 : val._id
16043
16115
  });
16044
16116
  });
16045
16117
  case 3:
@@ -16104,7 +16176,7 @@ var SPECIALITY_DATA = createAsyncThunk("locationMasterSlice/speciality_data", /*
16104
16176
  var _ref24,
16105
16177
  rejectWithValue,
16106
16178
  data_arr,
16107
- arry,
16179
+ array,
16108
16180
  _args11 = arguments,
16109
16181
  _t11;
16110
16182
  return _regenerator().w(function (_context11) {
@@ -16118,18 +16190,17 @@ var SPECIALITY_DATA = createAsyncThunk("locationMasterSlice/speciality_data", /*
16118
16190
  }, __baseUrl__$1);
16119
16191
  case 2:
16120
16192
  data_arr = _context11.v;
16121
- arry = [];
16193
+ array = [];
16122
16194
  _context11.n = 3;
16123
16195
  return data_arr === null || data_arr === void 0 ? void 0 : data_arr.map(function (val) {
16124
- var _val$display2;
16125
- arry.push(_objectSpread2({
16126
- value: (_val$display2 = val === null || val === void 0 ? void 0 : val.display) !== null && _val$display2 !== void 0 ? _val$display2 : "",
16127
- label: val._id
16196
+ array.push(_objectSpread2({
16197
+ value: val === null || val === void 0 ? void 0 : val.display,
16198
+ label: val === null || val === void 0 ? void 0 : val._id
16128
16199
  }, val));
16129
16200
  });
16130
16201
  case 3:
16131
16202
  return _context11.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
16132
- data: arry
16203
+ data: array
16133
16204
  }));
16134
16205
  case 4:
16135
16206
  _context11.p = 4;
@@ -25553,7 +25624,8 @@ var generateSaveJSON = function generateSaveJSON(data, rcchargeCode) {
25553
25624
  resourcedefinition: resourceresult !== null && resourceresult !== void 0 ? resourceresult : [],
25554
25625
  observationdetails: observationresult !== null && observationresult !== void 0 ? observationresult : [],
25555
25626
  instruction: getInstruction(data.instructions),
25556
- frequency: getFrequency(data.frequency, data.Frequency_applicability)
25627
+ frequency: getFrequency(data.frequency, data.Frequency_applicability),
25628
+ scheduleappl: data.characteristicJson[6].checked
25557
25629
  }
25558
25630
  })];
25559
25631
  };
@@ -25958,6 +26030,9 @@ var generateReadResJsonData = function generateReadResJsonData(val, state, resSt
25958
26030
  }, {
25959
26031
  label: "Result Authentication Required",
25960
26032
  checked: val === null || val === void 0 ? void 0 : val.resultauthreqd
26033
+ }, {
26034
+ label: "Schedule Applicable",
26035
+ checked: val === null || val === void 0 ? void 0 : val.scheduleappl
25961
26036
  }],
25962
26037
  checkSwitch: val === null || val === void 0 ? void 0 : val.checkforrepeatorders,
25963
26038
  no: val === null || val === void 0 ? void 0 : val.repeatcheckperiod,
@@ -42963,7 +43038,7 @@ var queries$1 = {
42963
43038
  }];
42964
43039
  },
42965
43040
  symptom_and_specialty_upsert: function symptom_and_specialty_upsert(data) {
42966
- var _data$symtom_descript, _data$id, _data$status, _data$symptom_code$tr, _data$symptom_code, _data$specialities;
43041
+ var _data$symptomsname, _data$symptomscode$tr, _data$symptomscode, _data$speciality, _data$id, _data$status, _data$designation, _data$property, _data$description, _data$imageurl;
42967
43042
  var filter = {};
42968
43043
  if (data._key) {
42969
43044
  filter = {
@@ -42972,6 +43047,16 @@ var queries$1 = {
42972
43047
  }
42973
43048
  };
42974
43049
  }
43050
+ // Parse JSON string fields safely
43051
+ var parseJson = function parseJson(val) {
43052
+ if (!val) return null;
43053
+ if (_typeof(val) === "object") return val;
43054
+ try {
43055
+ return JSON.parse(val);
43056
+ } catch (_unused) {
43057
+ return val;
43058
+ }
43059
+ };
42975
43060
  return [_objectSpread2(_objectSpread2({
42976
43061
  db_name: dbName,
42977
43062
  entity: "SymptomsMapping"
@@ -42980,11 +43065,17 @@ var queries$1 = {
42980
43065
  metadataId: metaDataId$1,
42981
43066
  metadata_dbname: metaDatadbName,
42982
43067
  doc: {
42983
- SymptomsName: (_data$symtom_descript = data === null || data === void 0 ? void 0 : data.symtom_description) !== null && _data$symtom_descript !== void 0 ? _data$symtom_descript : "",
43068
+ SymptomsName: (_data$symptomsname = data === null || data === void 0 ? void 0 : data.symptomsname) !== null && _data$symptomsname !== void 0 ? _data$symptomsname : "",
43069
+ symptomsCode: (_data$symptomscode$tr = data === null || data === void 0 || (_data$symptomscode = data.symptomscode) === null || _data$symptomscode === void 0 ? void 0 : _data$symptomscode.trim()) !== null && _data$symptomscode$tr !== void 0 ? _data$symptomscode$tr : "",
43070
+ specialty: (_data$speciality = data === null || data === void 0 ? void 0 : data.speciality) !== null && _data$speciality !== void 0 ? _data$speciality : [],
42984
43071
  id: (_data$id = data === null || data === void 0 ? void 0 : data.id) !== null && _data$id !== void 0 ? _data$id : 0,
42985
43072
  status: (_data$status = data === null || data === void 0 ? void 0 : data.status) !== null && _data$status !== void 0 ? _data$status : true,
42986
- symptomsCode: (_data$symptom_code$tr = data === null || data === void 0 || (_data$symptom_code = data.symptom_code) === null || _data$symptom_code === void 0 ? void 0 : _data$symptom_code.trim()) !== null && _data$symptom_code$tr !== void 0 ? _data$symptom_code$tr : "",
42987
- specialty: (_data$specialities = data === null || data === void 0 ? void 0 : data.specialities) !== null && _data$specialities !== void 0 ? _data$specialities : []
43073
+ designation: (_data$designation = data === null || data === void 0 ? void 0 : data.designation) !== null && _data$designation !== void 0 ? _data$designation : "",
43074
+ property: (_data$property = data === null || data === void 0 ? void 0 : data.property) !== null && _data$property !== void 0 ? _data$property : "",
43075
+ questionnaire: parseJson(data === null || data === void 0 ? void 0 : data.questionnaire),
43076
+ rule: parseJson(data === null || data === void 0 ? void 0 : data.rule),
43077
+ description: (_data$description = data === null || data === void 0 ? void 0 : data.description) !== null && _data$description !== void 0 ? _data$description : "",
43078
+ imageurl: (_data$imageurl = data === null || data === void 0 ? void 0 : data.imageurl) !== null && _data$imageurl !== void 0 ? _data$imageurl : ""
42988
43079
  }
42989
43080
  })];
42990
43081
  },
@@ -42992,12 +43083,12 @@ var queries$1 = {
42992
43083
  return {
42993
43084
  db_name: dbName,
42994
43085
  entity: "SymptomsMapping",
42995
- filter: "SymptomsMapping.activestatus==true ".concat(search ? "&& UPPER(SymptomsMapping.SymptomsName) LIKE '%".concat(search.toUpperCase(), "%' || UPPER(SymptomsMapping.symptomsCode) LIKE '%").concat(search.toUpperCase(), "%'") : ""),
43086
+ filter: "SymptomsMapping.activestatus==true ".concat(search ? "&& (UPPER(SymptomsMapping.SymptomsName) LIKE '%".concat(search.toUpperCase(), "%' || UPPER(SymptomsMapping.symptomsCode) LIKE '%").concat(search.toUpperCase(), "%')") : ""),
42996
43087
  limit: {
42997
43088
  offset: page,
42998
43089
  count: perPage
42999
43090
  },
43000
- return_fields: "merge(SymptomsMapping,{TotalCount:COUNT(".concat(search ? "FOR cnt IN SymptomsMapping filter UPPER(cnt.SymptomsName) LIKE '%".concat(search.toUpperCase(), "%' || UPPER(cnt.symptomsCode) LIKE '%").concat(search.toUpperCase(), "%' RETURN cnt._key") : "FOR cnt IN SymptomsMapping RETURN cnt._key", " ), specialty:(FOR cod IN CodeableConceptMaster filter cod._id in SymptomsMapping.specialty RETURN merge(cod,{coding:document(cod.coding)}))})"),
43091
+ return_fields: "merge(SymptomsMapping,{TotalCount:COUNT(".concat(search ? "FOR cnt IN SymptomsMapping filter UPPER(cnt.SymptomsName) LIKE '%".concat(search.toUpperCase(), "%' || UPPER(cnt.symptomsCode) LIKE '%").concat(search.toUpperCase(), "%' RETURN cnt._key") : "FOR cnt IN SymptomsMapping RETURN cnt._key", "), specialty:(FOR cod IN CodeableConceptMaster filter cod._id in SymptomsMapping.specialty RETURN merge(cod,{coding:document(cod.coding)}))})"),
43001
43092
  sort: "".concat(sort === "Symptom Code" ? "SymptomsMapping.symptomsCode ".concat(direction) : "SymptomsMapping.SymptomsName ".concat(direction))
43002
43093
  };
43003
43094
  },
@@ -43098,21 +43189,27 @@ var SYMPTOM_AND_SPECIALTY_STATUS_CHANGE = createAsyncThunk("symptomAndSpecialtyS
43098
43189
  }
43099
43190
  }, _callee, null, [[1, 3]]);
43100
43191
  })));
43192
+
43193
+ // Helper: convert specialty array to a display string for the list table
43101
43194
  var constructReadJSON = function constructReadJSON(data) {
43195
+ if (!Array.isArray(data)) return "";
43102
43196
  var arry = [];
43103
43197
  data.map(function (val) {
43104
43198
  var _val$coding$0$display, _val$coding;
43105
43199
  arry.push((_val$coding$0$display = (_val$coding = val.coding) === null || _val$coding === void 0 || (_val$coding = _val$coding[0]) === null || _val$coding === void 0 ? void 0 : _val$coding.display) !== null && _val$coding$0$display !== void 0 ? _val$coding$0$display : "");
43106
43200
  });
43107
- return arry.join();
43201
+ return arry.join(", ");
43108
43202
  };
43203
+
43204
+ // Helper: convert specialty array to {value, label} objects for the form select
43109
43205
  var constructSingleReadJSON = function constructSingleReadJSON(data) {
43206
+ if (!Array.isArray(data)) return [];
43110
43207
  var arry = [];
43111
43208
  data.map(function (val) {
43112
43209
  var _val$_id, _val$coding$0$display2, _val$coding2;
43113
43210
  arry.push({
43114
- "value": (_val$_id = val._id) !== null && _val$_id !== void 0 ? _val$_id : 0,
43115
- "label": (_val$coding$0$display2 = (_val$coding2 = val.coding) === null || _val$coding2 === void 0 || (_val$coding2 = _val$coding2[0]) === null || _val$coding2 === void 0 ? void 0 : _val$coding2.display) !== null && _val$coding$0$display2 !== void 0 ? _val$coding$0$display2 : ""
43211
+ value: (_val$_id = val._id) !== null && _val$_id !== void 0 ? _val$_id : 0,
43212
+ label: (_val$coding$0$display2 = (_val$coding2 = val.coding) === null || _val$coding2 === void 0 || (_val$coding2 = _val$coding2[0]) === null || _val$coding2 === void 0 ? void 0 : _val$coding2.display) !== null && _val$coding$0$display2 !== void 0 ? _val$coding$0$display2 : ""
43116
43213
  });
43117
43214
  });
43118
43215
  return arry;
@@ -43132,7 +43229,7 @@ var SYMPTOM_AND_SPECIALTY_READ = createAsyncThunk("symptomAndSpecialtySlice/symp
43132
43229
  payload = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
43133
43230
  _ref4 = _args2.length > 1 ? _args2[1] : undefined, rejectWithValue = _ref4.rejectWithValue;
43134
43231
  _context2.p = 1;
43135
- readqueries = queries$1.symptom_and_specialty_read(payload === null || payload === void 0 ? void 0 : payload.search, payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.sort ? payload === null || payload === void 0 ? void 0 : payload.sort : '', payload !== null && payload !== void 0 && payload.direction ? payload === null || payload === void 0 ? void 0 : payload.direction : '');
43232
+ readqueries = queries$1.symptom_and_specialty_read(payload === null || payload === void 0 ? void 0 : payload.search, payload === null || payload === void 0 ? void 0 : payload.page, payload === null || payload === void 0 ? void 0 : payload.perPage, payload !== null && payload !== void 0 && payload.sort ? payload === null || payload === void 0 ? void 0 : payload.sort : "", payload !== null && payload !== void 0 && payload.direction ? payload === null || payload === void 0 ? void 0 : payload.direction : "");
43136
43233
  _context2.n = 2;
43137
43234
  return fetchData({
43138
43235
  body: JSON.stringify(readqueries)
@@ -43142,14 +43239,20 @@ var SYMPTOM_AND_SPECIALTY_READ = createAsyncThunk("symptomAndSpecialtySlice/symp
43142
43239
  arry = [];
43143
43240
  data.result.map(function (val) {
43144
43241
  if (val._key) {
43242
+ var _val$designation, _val$property, _val$description, _val$imageurl;
43145
43243
  arry.push({
43146
43244
  total_count: val === null || val === void 0 ? void 0 : val.TotalCount,
43147
43245
  id: val.id ? val.id : 0,
43148
43246
  _key: val._key ? val._key : "",
43149
43247
  status: val.status ? val.status : false,
43150
- symtom_description: val.SymptomsName ? val.SymptomsName : "",
43151
- symptom_code: val.symptomsCode ? val.symptomsCode : "",
43152
- specialities: constructReadJSON(val.specialty)
43248
+ // Correct mapping: SymptomsName is the name, symptomsCode is the code
43249
+ symptomsname: val.SymptomsName ? val.SymptomsName : "",
43250
+ symptomscode: val.symptomsCode ? val.symptomsCode : "",
43251
+ speciality: constructReadJSON(val.specialty),
43252
+ designation: (_val$designation = val.designation) !== null && _val$designation !== void 0 ? _val$designation : "",
43253
+ property: (_val$property = val.property) !== null && _val$property !== void 0 ? _val$property : "",
43254
+ description: (_val$description = val.description) !== null && _val$description !== void 0 ? _val$description : "",
43255
+ imageurl: (_val$imageurl = val.imageurl) !== null && _val$imageurl !== void 0 ? _val$imageurl : ""
43153
43256
  });
43154
43257
  }
43155
43258
  });
@@ -43190,13 +43293,21 @@ var SYMPTOM_AND_SPECIALTY_SINGLE_READ = createAsyncThunk("symptomAndSpecialtySli
43190
43293
  arry = [];
43191
43294
  data.result.map(function (val) {
43192
43295
  if (val._key) {
43296
+ var _val$designation2, _val$property2, _val$questionnaire, _val$rule, _val$description2, _val$imageurl2;
43193
43297
  arry.push({
43194
43298
  id: val.id ? val.id : 0,
43195
43299
  _key: val._key ? val._key : "",
43196
43300
  status: val.status ? val.status : false,
43197
- symtom_description: val.SymptomsName ? val.SymptomsName : "",
43198
- symptom_code: val.symptomsCode ? val.symptomsCode : "",
43199
- specialities: constructSingleReadJSON(val.specialty)
43301
+ symptomsdescription: val.symptomsdescription ? val.symptomsdescription : "",
43302
+ symptomsname: val.SymptomsName ? val.SymptomsName : "",
43303
+ symptomscode: val.symptomsCode ? val.symptomsCode : "",
43304
+ speciality: constructSingleReadJSON(val.specialty),
43305
+ designation: (_val$designation2 = val.designation) !== null && _val$designation2 !== void 0 ? _val$designation2 : "",
43306
+ property: (_val$property2 = val.property) !== null && _val$property2 !== void 0 ? _val$property2 : "",
43307
+ questionnaire: _typeof(val.questionnaire) === "object" && val.questionnaire !== null ? JSON.stringify(val.questionnaire, null, 2) : (_val$questionnaire = val.questionnaire) !== null && _val$questionnaire !== void 0 ? _val$questionnaire : "",
43308
+ rule: _typeof(val.rule) === "object" && val.rule !== null ? JSON.stringify(val.rule, null, 2) : (_val$rule = val.rule) !== null && _val$rule !== void 0 ? _val$rule : "",
43309
+ description: (_val$description2 = val.description) !== null && _val$description2 !== void 0 ? _val$description2 : "",
43310
+ imageurl: (_val$imageurl2 = val.imageurl) !== null && _val$imageurl2 !== void 0 ? _val$imageurl2 : ""
43200
43311
  });
43201
43312
  }
43202
43313
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primary_care_admin_binder",
3
- "version": "0.1.151",
3
+ "version": "0.1.154",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",