oro-sdk 3.2.0 → 3.3.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.2.0",
2
+ "version": "3.3.0",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
@@ -184,7 +184,7 @@ export async function registerPatient(
184
184
 
185
185
  await Promise.all([...grantPromises, ...consultIndexPromises])
186
186
 
187
- await buildConsultSearchIndex(consult.uuid, workflow, oroClient).catch((err) => {
187
+ await buildConsultSearchIndex(consult, workflow, oroClient).catch((err) => {
188
188
  console.error('[SDK: registration] personal information not found or another error occured during search indexing', err)
189
189
  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
190
190
  errorsThrown.push(err)
@@ -434,13 +434,18 @@ export async function extractPersonalInfoFromWorkflowData(workflow: WorkflowData
434
434
  }
435
435
 
436
436
  /**
437
- * Creates the search index for the first and last name of the given consultation
438
- * @param consultUuid the uuid of the consult to be search indexed
437
+ * Creates the search index for the first name, last name, and the short id of the given consultation
438
+ * @param consult the consultation to be search indexed
439
439
  * @param workflow the workflow data
440
440
  * @param oroClient
441
441
  */
442
- export async function buildConsultSearchIndex(consultUuid: string, workflow: WorkflowData, oroClient: OroClient) {
443
- let terms: Terms = []
442
+ export async function buildConsultSearchIndex(consult: Consult, workflow: WorkflowData, oroClient: OroClient) {
443
+ let terms: Terms = [
444
+ <Term> {
445
+ kind: 'consult-shortid',
446
+ value: consult.shortId
447
+ }
448
+ ]
444
449
 
445
450
  const {
446
451
  personalInfoPopulatedWfData,
@@ -489,5 +494,5 @@ export async function buildConsultSearchIndex(consultUuid: string, workflow: Wor
489
494
  })
490
495
  }
491
496
 
492
- await oroClient.searchClient.index(consultUuid, terms)
497
+ await oroClient.searchClient.index(consult.uuid, terms)
493
498
  }