oro-sdk 3.5.0 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/helpers/patient-registration.d.ts +2 -1
- package/dist/oro-sdk.cjs.development.js +50 -40
- package/dist/oro-sdk.cjs.development.js.map +1 -1
- package/dist/oro-sdk.cjs.production.min.js +1 -1
- package/dist/oro-sdk.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk.esm.js +50 -40
- package/dist/oro-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/helpers/patient-registration.ts +15 -10
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "3.
|
2
|
+
"version": "3.6.0",
|
3
3
|
"main": "dist/index.js",
|
4
4
|
"typings": "dist/index.d.ts",
|
5
5
|
"files": [
|
@@ -54,7 +54,7 @@
|
|
54
54
|
"form-data": "^4.0.0",
|
55
55
|
"formdata-node": "^4.3.1",
|
56
56
|
"idb-keyval": "^5.0.6",
|
57
|
-
"oro-sdk-apis": "1.
|
57
|
+
"oro-sdk-apis": "1.41.0",
|
58
58
|
"oro-toolbox": "0.0.6",
|
59
59
|
"uuid": "^8.3.2"
|
60
60
|
}
|
@@ -50,6 +50,7 @@ const MAX_RETRIES = 15
|
|
50
50
|
* @param oroClient
|
51
51
|
* @param masterKey
|
52
52
|
* @param recoveryQA
|
53
|
+
* @param indexSearch create search index for the consultation if true
|
53
54
|
* @returns the successful registration
|
54
55
|
*/
|
55
56
|
export async function registerPatient(
|
@@ -61,7 +62,8 @@ export async function registerPatient(
|
|
61
62
|
recoveryQA?: {
|
62
63
|
recoverySecurityQuestions: string[]
|
63
64
|
recoverySecurityAnswers: string[]
|
64
|
-
}
|
65
|
+
},
|
66
|
+
indexSearch: boolean = true
|
65
67
|
): Promise<RegisterPatientOutput> {
|
66
68
|
let consult: Consult | undefined = undefined
|
67
69
|
let lockboxUuid: Uuid | undefined = undefined
|
@@ -191,14 +193,17 @@ export async function registerPatient(
|
|
191
193
|
|
192
194
|
await Promise.all([...grantPromises, ...consultIndexPromises])
|
193
195
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
196
|
+
|
197
|
+
if(indexSearch) {
|
198
|
+
await buildConsultSearchIndex(consult, workflow, oroClient).catch((err) => {
|
199
|
+
console.error(
|
200
|
+
'[SDK: registration] personal information not found or another error occured during search indexing',
|
201
|
+
err
|
202
|
+
)
|
203
|
+
if (retry <= 1) return // this statement is to avoid failing the registration due to the failure in search indexing the consult, this practically implements a soft retry
|
204
|
+
errorsThrown.push(err)
|
205
|
+
})
|
206
|
+
}
|
202
207
|
|
203
208
|
if (errorsThrown.length > 0) throw errorsThrown
|
204
209
|
|
@@ -510,4 +515,4 @@ export async function buildConsultSearchIndex(consult: Consult, workflow: Workfl
|
|
510
515
|
}
|
511
516
|
|
512
517
|
await oroClient.searchClient.index(consult.uuid, terms)
|
513
|
-
}
|
518
|
+
}
|