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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.5.0",
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.40.0",
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
- await buildConsultSearchIndex(consult, workflow, oroClient).catch((err) => {
195
- console.error(
196
- '[SDK: registration] personal information not found or another error occured during search indexing',
197
- err
198
- )
199
- 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
200
- errorsThrown.push(err)
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
+ }