primary_care_admin_binder 0.1.69 → 0.1.70
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.
- package/dist/index.cjs.js +49 -16
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -30092,10 +30092,10 @@ var queries$6 = {
|
|
|
30092
30092
|
user_upsert: function user_upsert(data) {
|
|
30093
30093
|
var filter = {};
|
|
30094
30094
|
|
|
30095
|
-
if (data.
|
|
30095
|
+
if (data.check_key) {
|
|
30096
30096
|
filter = {
|
|
30097
30097
|
filter: {
|
|
30098
|
-
_key: data.
|
|
30098
|
+
_key: data.prect_key
|
|
30099
30099
|
}
|
|
30100
30100
|
};
|
|
30101
30101
|
}
|
|
@@ -30106,18 +30106,23 @@ var queries$6 = {
|
|
|
30106
30106
|
"is_metadata": true,
|
|
30107
30107
|
"metadataId": "04ecb73d-f048-44ce-8563-c9be015812dd"
|
|
30108
30108
|
}, filter), {}, {
|
|
30109
|
-
"doc": _objectSpread2({}, data)
|
|
30109
|
+
"doc": _objectSpread2({}, data.payload)
|
|
30110
30110
|
})];
|
|
30111
30111
|
},
|
|
30112
30112
|
practitioner_by_id: function practitioner_by_id(data) {
|
|
30113
30113
|
return {
|
|
30114
30114
|
"db_name": dbName$1,
|
|
30115
|
-
// "entity": "Practitioner",
|
|
30116
30115
|
"entity": "Person",
|
|
30117
|
-
// "filter": `Practitioner.PersonID==${data.id} && Practitioner.activestatus==true`,
|
|
30118
30116
|
"filter": "Person._id =='".concat(data.id, "' && Person.activestatus == true "),
|
|
30119
|
-
|
|
30120
|
-
|
|
30117
|
+
"return_fields": "merge(Person, {Practitioner: (for x in Practitioner filter x.PersonID == ".concat(data.PersonID, " return { PersonID: x.PersonID, userId: x.practitioner_id, practitioner_role: (for z in x.practitioner_role return document(document(document(z).role).coding)[0] ), SpecialtyID: document(x.practitioner_role)[0].SpecialtyID , role: (for z in x.practitioner_role return {coding: document(document(document(z).role).coding), \"_key\": document(document(z).role)._key,\"_id\": document(document(z).role)._id,\"_rev\": document(document(z).role)._rev,\"Type\": document(document(z).role).Type,\"activestatus\": document(document(z).role).activestatus,\"createdby\": \"\",\"createddate\": document(document(z).role).createddate,\"id\": document(document(z).role).id,\"status\": document(document(z).role).status,\"text\": document(document(z).role).text,\"updatedate\": document(document(z).role).updatedate, \"updatedby\": \"\"} ) })} ,{reporting_entity_type: document(Person.orgType)}, {reporting_entity_name: document(Person.OrgID[0])},{OrgID: document(Person.OrgID)},{address: document(Person.address)},{gender: document(Person.gender)},{orgType: document(Person.orgType)},{name: (for doc in document(Person.name) return merge(doc,{period: document(doc.period)},{ use: document(doc.use)},{prefix: document(doc.prefix)},{ suffix: document(doc.suffix)}))},{identifier: (for ide in document(Person.identifier)return merge(ide,{ period: document(ide.period)}))},{ telecom: (for doc in document(Person.telecom) return merge(doc, { system: document(doc.system)},{use: document(document(doc.use).coding)},{ period: document(Person.Person)},{ valueprefix: document(doc.valueprefix) }, {rank: document(document(doc.rank).coding)}))})")
|
|
30118
|
+
};
|
|
30119
|
+
},
|
|
30120
|
+
check_practioner: function check_practioner(data) {
|
|
30121
|
+
return {
|
|
30122
|
+
"db_name": dbName$1,
|
|
30123
|
+
"entity": "Practitioner",
|
|
30124
|
+
"filter": "Practitioner.PersonID == ".concat(data),
|
|
30125
|
+
"return_fields": "Practitioner "
|
|
30121
30126
|
};
|
|
30122
30127
|
}
|
|
30123
30128
|
};
|
|
@@ -30127,6 +30132,8 @@ var USER_UPSERT = createAsyncThunk("userSlice/user_upsert", /*#__PURE__*/_asyncT
|
|
|
30127
30132
|
var payload,
|
|
30128
30133
|
_ref2,
|
|
30129
30134
|
rejectWithValue,
|
|
30135
|
+
temp_data,
|
|
30136
|
+
qry,
|
|
30130
30137
|
params,
|
|
30131
30138
|
queriesjson,
|
|
30132
30139
|
data,
|
|
@@ -30139,35 +30146,61 @@ var USER_UPSERT = createAsyncThunk("userSlice/user_upsert", /*#__PURE__*/_asyncT
|
|
|
30139
30146
|
payload = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
30140
30147
|
_ref2 = _args.length > 1 ? _args[1] : undefined, rejectWithValue = _ref2.rejectWithValue;
|
|
30141
30148
|
_context.prev = 2;
|
|
30142
|
-
|
|
30143
|
-
|
|
30144
|
-
|
|
30149
|
+
console.clear();
|
|
30150
|
+
console.log(payload);
|
|
30151
|
+
|
|
30152
|
+
if (!payload.PersonID) {
|
|
30153
|
+
_context.next = 11;
|
|
30154
|
+
break;
|
|
30155
|
+
}
|
|
30156
|
+
|
|
30157
|
+
qry = queries$6.check_practioner(payload.PersonID);
|
|
30158
|
+
_context.next = 9;
|
|
30159
|
+
return fetchData({
|
|
30160
|
+
body: JSON.stringify(qry)
|
|
30161
|
+
}, __readDocumentUrl__);
|
|
30162
|
+
|
|
30163
|
+
case 9:
|
|
30164
|
+
temp_data = _context.sent;
|
|
30165
|
+
console.log(temp_data.result);
|
|
30166
|
+
|
|
30167
|
+
case 11:
|
|
30168
|
+
params = {
|
|
30169
|
+
payload: payload
|
|
30170
|
+
};
|
|
30171
|
+
|
|
30172
|
+
if (temp_data.result.length > 0) {
|
|
30173
|
+
params.check_key = payload._key;
|
|
30174
|
+
params.prect_key = temp_data.result[0]._key;
|
|
30175
|
+
}
|
|
30176
|
+
|
|
30145
30177
|
queriesjson = queries$6.user_upsert(params);
|
|
30146
|
-
_context.next =
|
|
30178
|
+
_context.next = 16;
|
|
30147
30179
|
return fetchData({
|
|
30148
30180
|
body: JSON.stringify(queriesjson)
|
|
30149
30181
|
}, __uspsertUrl__);
|
|
30150
30182
|
|
|
30151
|
-
case
|
|
30183
|
+
case 16:
|
|
30152
30184
|
data = _context.sent;
|
|
30153
30185
|
return _context.abrupt("return", _objectSpread2(_objectSpread2({}, defaultState.List), {}, {
|
|
30154
30186
|
_key: data._key,
|
|
30155
30187
|
data: data
|
|
30156
30188
|
}));
|
|
30157
30189
|
|
|
30158
|
-
case
|
|
30159
|
-
_context.prev =
|
|
30190
|
+
case 20:
|
|
30191
|
+
_context.prev = 20;
|
|
30160
30192
|
_context.t0 = _context["catch"](2);
|
|
30193
|
+
console.log(_context.t0);
|
|
30161
30194
|
return _context.abrupt("return", rejectWithValue(_objectSpread2(_objectSpread2({}, defaultReject), {}, {
|
|
30162
30195
|
message: _context.t0.message
|
|
30163
30196
|
})));
|
|
30164
30197
|
|
|
30165
|
-
case
|
|
30198
|
+
case 24:
|
|
30166
30199
|
case "end":
|
|
30167
30200
|
return _context.stop();
|
|
30168
30201
|
}
|
|
30169
30202
|
}
|
|
30170
|
-
}, _callee, null, [[2,
|
|
30203
|
+
}, _callee, null, [[2, 20]]);
|
|
30171
30204
|
})));
|
|
30172
30205
|
var USER_DELETE = createAsyncThunk("userSlice/user_delete", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
30173
30206
|
var payload,
|