primary_care_admin_binder 0.1.174 → 0.1.175

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 +191 -10
  2. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -8922,6 +8922,7 @@ var query_ids = {
8922
8922
  "vitalsApplicableList": "7d5ed06f-91a4-4822-b409-9b189e49f439",
8923
8923
  "vitalsApplicableEdit": "a27804ae-8f06-471a-9216-e846860e8b8a",
8924
8924
  "ageCategory": "313b0701-3354-4421-8951-488f8daec57b",
8925
+ "form_list": "fbcd603d-eaa3-471c-ae12-2572cdb49c0e",
8925
8926
  "geoMasterTypeRead": "b283129b-9841-419b-bdfc-de5105ebbad7",
8926
8927
  "geoHierarchicalRead": "ad647bcf-edcc-44ac-9ca9-67c3b277b8df",
8927
8928
  "geoCountryRead": "e2cb9d5c-3491-40da-8a5b-c8f90c39e286",
@@ -43969,7 +43970,7 @@ var queries$1 = {
43969
43970
  }
43970
43971
  })];
43971
43972
  },
43972
- guideline_upsert: function guideline_upsert(data) {
43973
+ form_upsert: function form_upsert(data) {
43973
43974
  var filter = {};
43974
43975
  if (data._key) {
43975
43976
  filter = {
@@ -43984,21 +43985,35 @@ var queries$1 = {
43984
43985
  }, filter), {}, {
43985
43986
  is_metadata: false,
43986
43987
  doc: {
43987
- _id: data._id,
43988
+ _id: data._id || "",
43988
43989
  form_id: data.form_id,
43989
43990
  form_name: data.form_name,
43990
43991
  form_type_id: data.form_type_id,
43992
+ is_active: data.is_active,
43993
+ attachment: data.attachment || null,
43991
43994
  assessment: data.assessment
43992
43995
  }
43993
43996
  })];
43994
43997
  },
43995
- guideline_read: function guideline_read(form_id) {
43998
+ form_list: function form_list(offset, count, search) {
43996
43999
  return {
43997
44000
  appcode: dbName,
44001
+ // TODO: Update requestid after creating the FORM_LIST query in QDM Query Tool
44002
+ requestid: query_ids.form_list,
44003
+ filter: {
44004
+ search: "".concat(search !== null && search !== void 0 ? search : ""),
44005
+ offset: offset !== null && offset !== void 0 ? offset : 0,
44006
+ count: count !== null && count !== void 0 ? count : 10
44007
+ }
44008
+ };
44009
+ },
44010
+ form_read: function form_read(form_id) {
44011
+ return {
44012
+ appcode: dbName,
44013
+ requestid: query_ids.getformsDetails,
43998
44014
  filter: {
43999
44015
  _id: form_id
44000
- },
44001
- requestid: query_ids.getformsDetails
44016
+ }
44002
44017
  };
44003
44018
  }
44004
44019
  };
@@ -44306,7 +44321,7 @@ var GUIDELINE_UPSERT = createAsyncThunk("symptomAndSpecialtySlice/guideline_upse
44306
44321
  payload = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
44307
44322
  _ref10 = _args6.length > 1 ? _args6[1] : undefined, rejectWithValue = _ref10.rejectWithValue;
44308
44323
  _context6.p = 1;
44309
- queriesjson = queries$1.guideline_upsert(payload);
44324
+ queriesjson = queries$1.form_upsert(payload);
44310
44325
  _context6.n = 2;
44311
44326
  return fetchData({
44312
44327
  body: JSON.stringify(queriesjson)
@@ -44340,7 +44355,7 @@ var GUIDELINE_READ = createAsyncThunk("symptomAndSpecialtySlice/guideline_read",
44340
44355
  payload = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
44341
44356
  _ref12 = _args7.length > 1 ? _args7[1] : undefined, rejectWithValue = _ref12.rejectWithValue;
44342
44357
  _context7.p = 1;
44343
- queriesjson = queries$1.guideline_read(payload.form_id);
44358
+ queriesjson = queries$1.form_read(payload.form_id);
44344
44359
  _context7.n = 2;
44345
44360
  return fetchData({
44346
44361
  body: JSON.stringify(queriesjson)
@@ -44361,6 +44376,133 @@ var GUIDELINE_READ = createAsyncThunk("symptomAndSpecialtySlice/guideline_read",
44361
44376
  }
44362
44377
  }, _callee7, null, [[1, 3]]);
44363
44378
  })));
44379
+
44380
+ /* ── FORM_UPSERT ── */
44381
+ var FORM_UPSERT = createAsyncThunk("symptomAndSpecialtySlice/form_upsert", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
44382
+ var payload,
44383
+ _ref14,
44384
+ rejectWithValue,
44385
+ queriesjson,
44386
+ data,
44387
+ _args8 = arguments,
44388
+ _t8;
44389
+ return _regenerator().w(function (_context8) {
44390
+ while (1) switch (_context8.p = _context8.n) {
44391
+ case 0:
44392
+ payload = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
44393
+ _ref14 = _args8.length > 1 ? _args8[1] : undefined, rejectWithValue = _ref14.rejectWithValue;
44394
+ _context8.p = 1;
44395
+ queriesjson = queries$1.form_upsert(payload);
44396
+ _context8.n = 2;
44397
+ return fetchData({
44398
+ body: JSON.stringify(queriesjson)
44399
+ }, __uspsertUrl__);
44400
+ case 2:
44401
+ data = _context8.v;
44402
+ return _context8.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
44403
+ data: data
44404
+ }));
44405
+ case 3:
44406
+ _context8.p = 3;
44407
+ _t8 = _context8.v;
44408
+ return _context8.a(2, rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
44409
+ message: _t8.message
44410
+ })));
44411
+ }
44412
+ }, _callee8, null, [[1, 3]]);
44413
+ })));
44414
+
44415
+ /* ── FORM_LIST ── */
44416
+ var FORM_LIST = createAsyncThunk("symptomAndSpecialtySlice/form_list", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
44417
+ var payload,
44418
+ _ref16,
44419
+ rejectWithValue,
44420
+ queriesjson,
44421
+ data,
44422
+ arry,
44423
+ _args9 = arguments,
44424
+ _t9;
44425
+ return _regenerator().w(function (_context9) {
44426
+ while (1) switch (_context9.p = _context9.n) {
44427
+ case 0:
44428
+ payload = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
44429
+ _ref16 = _args9.length > 1 ? _args9[1] : undefined, rejectWithValue = _ref16.rejectWithValue;
44430
+ _context9.p = 1;
44431
+ queriesjson = queries$1.form_list(payload.offset, payload.count, payload.search);
44432
+ _context9.n = 2;
44433
+ return fetchData({
44434
+ body: JSON.stringify(queriesjson)
44435
+ }, __baseUrl__$1);
44436
+ case 2:
44437
+ data = _context9.v;
44438
+ arry = [];
44439
+ if (Array.isArray(data)) {
44440
+ data.forEach(function (val) {
44441
+ if (val.form_id || val._key) {
44442
+ var _val$TotalCount, _val$_id3, _val$_key, _val$form_id, _val$form_name, _val$form_type_id, _val$attachment;
44443
+ arry.push({
44444
+ TotalCount: (_val$TotalCount = val.TotalCount) !== null && _val$TotalCount !== void 0 ? _val$TotalCount : 0,
44445
+ _id: (_val$_id3 = val._id) !== null && _val$_id3 !== void 0 ? _val$_id3 : "",
44446
+ _key: (_val$_key = val._key) !== null && _val$_key !== void 0 ? _val$_key : "",
44447
+ form_id: (_val$form_id = val.form_id) !== null && _val$form_id !== void 0 ? _val$form_id : "",
44448
+ form_name: (_val$form_name = val.form_name) !== null && _val$form_name !== void 0 ? _val$form_name : "",
44449
+ form_type_id: (_val$form_type_id = val.form_type_id) !== null && _val$form_type_id !== void 0 ? _val$form_type_id : "",
44450
+ is_active: val.is_active,
44451
+ assessment: val.assessment,
44452
+ attachment: (_val$attachment = val.attachment) !== null && _val$attachment !== void 0 ? _val$attachment : null
44453
+ });
44454
+ }
44455
+ });
44456
+ }
44457
+ return _context9.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
44458
+ data: arry
44459
+ }));
44460
+ case 3:
44461
+ _context9.p = 3;
44462
+ _t9 = _context9.v;
44463
+ return _context9.a(2, rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
44464
+ message: _t9.message
44465
+ })));
44466
+ }
44467
+ }, _callee9, null, [[1, 3]]);
44468
+ })));
44469
+
44470
+ /* ── FORM_READ ── */
44471
+ var FORM_READ = createAsyncThunk("symptomAndSpecialtySlice/form_read", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
44472
+ var payload,
44473
+ _ref18,
44474
+ rejectWithValue,
44475
+ queriesjson,
44476
+ data,
44477
+ record,
44478
+ _args0 = arguments,
44479
+ _t0;
44480
+ return _regenerator().w(function (_context0) {
44481
+ while (1) switch (_context0.p = _context0.n) {
44482
+ case 0:
44483
+ payload = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : {};
44484
+ _ref18 = _args0.length > 1 ? _args0[1] : undefined, rejectWithValue = _ref18.rejectWithValue;
44485
+ _context0.p = 1;
44486
+ queriesjson = queries$1.form_read(payload.form_id);
44487
+ _context0.n = 2;
44488
+ return fetchData({
44489
+ body: JSON.stringify(queriesjson)
44490
+ }, __baseUrl__$1);
44491
+ case 2:
44492
+ data = _context0.v;
44493
+ record = Array.isArray(data) ? data[0] : null;
44494
+ return _context0.a(2, _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
44495
+ data: record
44496
+ }));
44497
+ case 3:
44498
+ _context0.p = 3;
44499
+ _t0 = _context0.v;
44500
+ return _context0.a(2, rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
44501
+ message: _t0.message
44502
+ })));
44503
+ }
44504
+ }, _callee0, null, [[1, 3]]);
44505
+ })));
44364
44506
  var symptomAndSpecialtySlice = createSlice({
44365
44507
  name: "symptomAndSpecialtySlice",
44366
44508
  initialState: {
@@ -44370,7 +44512,10 @@ var symptomAndSpecialtySlice = createSlice({
44370
44512
  symptom_and_specialty_upsert: _objectSpread2({}, defaultState.List),
44371
44513
  symptom_and_specialty_master: _objectSpread2({}, defaultState.List),
44372
44514
  guideline_upsert: _objectSpread2({}, defaultState.List),
44373
- guideline_read: _objectSpread2({}, defaultState.List)
44515
+ guideline_read: _objectSpread2({}, defaultState.List),
44516
+ form_upsert: _objectSpread2({}, defaultState.List),
44517
+ form_list: _objectSpread2({}, defaultState.List),
44518
+ form_read: _objectSpread2({}, defaultState.List)
44374
44519
  },
44375
44520
  extraReducers: (_extraReducers$4 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extraReducers$4, SYMPTOM_AND_SPECIALTY_STATUS_CHANGE.fulfilled, function (state, action) {
44376
44521
  state.symptom_and_specialty_status_update.loading = false, state.symptom_and_specialty_status_update.error = false, state.symptom_and_specialty_status_update = action.payload;
@@ -44425,10 +44570,43 @@ var symptomAndSpecialtySlice = createSlice({
44425
44570
  }), GUIDELINE_READ.pending, function (state) {
44426
44571
  state.guideline_read.loading = true;
44427
44572
  state.guideline_read.error = false;
44428
- }), _defineProperty(_extraReducers$4, GUIDELINE_READ.rejected, function (state, action) {
44573
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_extraReducers$4, GUIDELINE_READ.rejected, function (state, action) {
44429
44574
  state.guideline_read.loading = false;
44430
44575
  state.guideline_read.error = true;
44431
44576
  state.guideline_read = action.payload;
44577
+ }), FORM_UPSERT.fulfilled, function (state, action) {
44578
+ state.form_upsert.loading = false;
44579
+ state.form_upsert.error = false;
44580
+ state.form_upsert = action.payload;
44581
+ }), FORM_UPSERT.pending, function (state) {
44582
+ state.form_upsert.loading = true;
44583
+ state.form_upsert.error = false;
44584
+ }), FORM_UPSERT.rejected, function (state, action) {
44585
+ state.form_upsert.loading = false;
44586
+ state.form_upsert.error = true;
44587
+ state.form_upsert = action.payload;
44588
+ }), FORM_LIST.fulfilled, function (state, action) {
44589
+ state.form_list.loading = false;
44590
+ state.form_list.error = false;
44591
+ state.form_list = action.payload;
44592
+ }), FORM_LIST.pending, function (state) {
44593
+ state.form_list.loading = true;
44594
+ state.form_list.error = false;
44595
+ }), FORM_LIST.rejected, function (state, action) {
44596
+ state.form_list.loading = false;
44597
+ state.form_list.error = true;
44598
+ state.form_list = action.payload;
44599
+ }), FORM_READ.fulfilled, function (state, action) {
44600
+ state.form_read.loading = false;
44601
+ state.form_read.error = false;
44602
+ state.form_read = action.payload;
44603
+ }), FORM_READ.pending, function (state) {
44604
+ state.form_read.loading = true;
44605
+ state.form_read.error = false;
44606
+ }), FORM_READ.rejected, function (state, action) {
44607
+ state.form_read.loading = false;
44608
+ state.form_read.error = true;
44609
+ state.form_read = action.payload;
44432
44610
  }))
44433
44611
  });
44434
44612
  var symptomAndSpecialtyActions = {
@@ -44438,7 +44616,10 @@ var symptomAndSpecialtyActions = {
44438
44616
  SYMPTOM_AND_SPECIALTY_UPSERT: SYMPTOM_AND_SPECIALTY_UPSERT,
44439
44617
  SYMPTOM_AND_SPECIALTY_SINGLE_READ: SYMPTOM_AND_SPECIALTY_SINGLE_READ,
44440
44618
  GUIDELINE_UPSERT: GUIDELINE_UPSERT,
44441
- GUIDELINE_READ: GUIDELINE_READ
44619
+ GUIDELINE_READ: GUIDELINE_READ,
44620
+ FORM_UPSERT: FORM_UPSERT,
44621
+ FORM_LIST: FORM_LIST,
44622
+ FORM_READ: FORM_READ
44442
44623
  };
44443
44624
  var symptomAndSpecialtySlice$1 = symptomAndSpecialtySlice.reducer;
44444
44625
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primary_care_admin_binder",
3
- "version": "0.1.174",
3
+ "version": "0.1.175",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",