oro-sdk 3.2.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- import { ConsultRequest, MetadataCategory, PopulatedWorkflowData, Uuid, WorkflowData } from 'oro-sdk-apis';
1
+ import { Consult, ConsultRequest, MetadataCategory, PopulatedWorkflowData, Uuid, WorkflowData } from 'oro-sdk-apis';
2
2
  import { OroClient, RegisterPatientOutput } from '..';
3
3
  /**
4
4
  * Completes a registration for a user retrying the complete flow a maximum of 15 times
@@ -44,9 +44,9 @@ export declare function extractPersonalInfoFromWorkflowData(workflow: WorkflowDa
44
44
  otherPersonalInfoPopulatedWfData: PopulatedWorkflowData;
45
45
  }>;
46
46
  /**
47
- * Creates the search index for the first and last name of the given consultation
48
- * @param consultUuid the uuid of the consult to be search indexed
47
+ * Creates the search index for the first name, last name, and the short id of the given consultation
48
+ * @param consult the consultation to be search indexed
49
49
  * @param workflow the workflow data
50
50
  * @param oroClient
51
51
  */
52
- export declare function buildConsultSearchIndex(consultUuid: string, workflow: WorkflowData, oroClient: OroClient): Promise<void>;
52
+ export declare function buildConsultSearchIndex(consult: Consult, workflow: WorkflowData, oroClient: OroClient): Promise<void>;
@@ -1808,33 +1808,23 @@ function _registerPatient() {
1808
1808
  return Promise.all([].concat(grantPromises, consultIndexPromises));
1809
1809
 
1810
1810
  case 43:
1811
- _context3.next = 45;
1812
- return buildConsultSearchIndex(consult.uuid, workflow, oroClient)["catch"](function (err) {
1813
- console.error('[SDK: registration] personal information not found or another error occured during search indexing', err);
1814
- 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
1815
-
1816
- // this statement is to avoid failing the registration due to the failure in search indexing the consult, this practically implements a soft retry
1817
- errorsThrown.push(err);
1818
- });
1819
-
1820
- case 45:
1821
1811
  if (!(errorsThrown.length > 0)) {
1822
- _context3.next = 47;
1812
+ _context3.next = 45;
1823
1813
  break;
1824
1814
  }
1825
1815
 
1826
1816
  throw errorsThrown;
1827
1817
 
1828
- case 47:
1829
- _context3.next = 49;
1818
+ case 45:
1819
+ _context3.next = 47;
1830
1820
  return oroClient.consultClient.updateConsultByUUID(consult.uuid, {
1831
1821
  statusMedical: initApis.MedicalStatus.New
1832
1822
  });
1833
1823
 
1834
- case 49:
1824
+ case 47:
1835
1825
  return _context3.abrupt("return", "break");
1836
1826
 
1837
- case 50:
1827
+ case 48:
1838
1828
  case "end":
1839
1829
  return _context3.stop();
1840
1830
  }
@@ -2152,8 +2142,8 @@ function extractPersonalInfoFromWorkflowData(_x24) {
2152
2142
  return _extractPersonalInfoFromWorkflowData.apply(this, arguments);
2153
2143
  }
2154
2144
  /**
2155
- * Creates the search index for the first and last name of the given consultation
2156
- * @param consultUuid the uuid of the consult to be search indexed
2145
+ * Creates the search index for the first name, last name, and the short id of the given consultation
2146
+ * @param consult the consultation to be search indexed
2157
2147
  * @param workflow the workflow data
2158
2148
  * @param oroClient
2159
2149
  */
@@ -2190,14 +2180,17 @@ function buildConsultSearchIndex(_x25, _x26, _x27) {
2190
2180
  }
2191
2181
 
2192
2182
  function _buildConsultSearchIndex() {
2193
- _buildConsultSearchIndex = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(consultUuid, workflow, oroClient) {
2183
+ _buildConsultSearchIndex = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(consult, workflow, oroClient) {
2194
2184
  var terms, _yield$extractPersona, personalInfoPopulatedWfData, childPersonalInfoPopulatedWfData, otherPersonalInfoPopulatedWfData, personalInfo, childPersonalInfo, otherPersonalInfo;
2195
2185
 
2196
2186
  return runtime_1.wrap(function _callee11$(_context11) {
2197
2187
  while (1) {
2198
2188
  switch (_context11.prev = _context11.next) {
2199
2189
  case 0:
2200
- terms = [];
2190
+ terms = [{
2191
+ kind: 'consult-shortid',
2192
+ value: consult.shortId
2193
+ }];
2201
2194
  _context11.next = 3;
2202
2195
  return extractPersonalInfoFromWorkflowData(workflow);
2203
2196
 
@@ -2238,7 +2231,7 @@ function _buildConsultSearchIndex() {
2238
2231
  }
2239
2232
 
2240
2233
  _context11.next = 15;
2241
- return oroClient.searchClient.index(consultUuid, terms);
2234
+ return oroClient.searchClient.index(consult.uuid, terms);
2242
2235
 
2243
2236
  case 15:
2244
2237
  case "end":