oro-sdk 3.3.1 → 3.6.0
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/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 +58 -58
- package/src/helpers/patient-registration.ts +70 -50
package/dist/oro-sdk.esm.js
CHANGED
@@ -1563,10 +1563,11 @@ var MAX_RETRIES = 15;
|
|
1563
1563
|
* @param oroClient
|
1564
1564
|
* @param masterKey
|
1565
1565
|
* @param recoveryQA
|
1566
|
+
* @param indexSearch create search index for the consultation if true
|
1566
1567
|
* @returns the successful registration
|
1567
1568
|
*/
|
1568
1569
|
|
1569
|
-
function registerPatient(_x, _x2, _x3, _x4, _x5, _x6) {
|
1570
|
+
function registerPatient(_x, _x2, _x3, _x4, _x5, _x6, _x7) {
|
1570
1571
|
return _registerPatient.apply(this, arguments);
|
1571
1572
|
}
|
1572
1573
|
/**
|
@@ -1577,13 +1578,17 @@ function registerPatient(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
1577
1578
|
*/
|
1578
1579
|
|
1579
1580
|
function _registerPatient() {
|
1580
|
-
_registerPatient = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(patientUuid, consultRequest, workflow, oroClient, masterKey, recoveryQA) {
|
1581
|
+
_registerPatient = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(patientUuid, consultRequest, workflow, oroClient, masterKey, recoveryQA, indexSearch) {
|
1581
1582
|
var consult, lockboxUuid, practitionerAdmin, retry, identity, errorsThrown, _ret;
|
1582
1583
|
|
1583
1584
|
return runtime_1.wrap(function _callee4$(_context4) {
|
1584
1585
|
while (1) {
|
1585
1586
|
switch (_context4.prev = _context4.next) {
|
1586
1587
|
case 0:
|
1588
|
+
if (indexSearch === void 0) {
|
1589
|
+
indexSearch = true;
|
1590
|
+
}
|
1591
|
+
|
1587
1592
|
consult = undefined;
|
1588
1593
|
lockboxUuid = undefined;
|
1589
1594
|
practitionerAdmin = undefined;
|
@@ -1591,13 +1596,13 @@ function _registerPatient() {
|
|
1591
1596
|
identity = undefined;
|
1592
1597
|
errorsThrown = [];
|
1593
1598
|
|
1594
|
-
case
|
1599
|
+
case 7:
|
1595
1600
|
if (!(retry > 0)) {
|
1596
|
-
_context4.next =
|
1601
|
+
_context4.next = 23;
|
1597
1602
|
break;
|
1598
1603
|
}
|
1599
1604
|
|
1600
|
-
_context4.prev =
|
1605
|
+
_context4.prev = 8;
|
1601
1606
|
return _context4.delegateYield( /*#__PURE__*/runtime_1.mark(function _callee3() {
|
1602
1607
|
var _consultIndex, _identity, _identity2;
|
1603
1608
|
|
@@ -1703,7 +1708,7 @@ function _registerPatient() {
|
|
1703
1708
|
}, _callee);
|
1704
1709
|
}));
|
1705
1710
|
|
1706
|
-
return function (
|
1711
|
+
return function (_x29) {
|
1707
1712
|
return _ref.apply(this, arguments);
|
1708
1713
|
};
|
1709
1714
|
}());
|
@@ -1736,7 +1741,7 @@ function _registerPatient() {
|
|
1736
1741
|
}, _callee2);
|
1737
1742
|
}));
|
1738
1743
|
|
1739
|
-
return function (
|
1744
|
+
return function (_x30) {
|
1740
1745
|
return _ref2.apply(this, arguments);
|
1741
1746
|
};
|
1742
1747
|
}());
|
@@ -1804,7 +1809,12 @@ function _registerPatient() {
|
|
1804
1809
|
return Promise.all([].concat(grantPromises, consultIndexPromises));
|
1805
1810
|
|
1806
1811
|
case 43:
|
1807
|
-
|
1812
|
+
if (!indexSearch) {
|
1813
|
+
_context3.next = 46;
|
1814
|
+
break;
|
1815
|
+
}
|
1816
|
+
|
1817
|
+
_context3.next = 46;
|
1808
1818
|
return buildConsultSearchIndex(consult, workflow, oroClient)["catch"](function (err) {
|
1809
1819
|
console.error('[SDK: registration] personal information not found or another error occured during search indexing', err);
|
1810
1820
|
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
|
@@ -1813,89 +1823,89 @@ function _registerPatient() {
|
|
1813
1823
|
errorsThrown.push(err);
|
1814
1824
|
});
|
1815
1825
|
|
1816
|
-
case
|
1826
|
+
case 46:
|
1817
1827
|
if (!(errorsThrown.length > 0)) {
|
1818
|
-
_context3.next =
|
1828
|
+
_context3.next = 48;
|
1819
1829
|
break;
|
1820
1830
|
}
|
1821
1831
|
|
1822
1832
|
throw errorsThrown;
|
1823
1833
|
|
1824
|
-
case
|
1825
|
-
_context3.next =
|
1834
|
+
case 48:
|
1835
|
+
_context3.next = 50;
|
1826
1836
|
return oroClient.consultClient.updateConsultByUUID(consult.uuid, {
|
1827
1837
|
statusMedical: MedicalStatus.New
|
1828
1838
|
});
|
1829
1839
|
|
1830
|
-
case
|
1840
|
+
case 50:
|
1831
1841
|
return _context3.abrupt("return", "break");
|
1832
1842
|
|
1833
|
-
case
|
1843
|
+
case 51:
|
1834
1844
|
case "end":
|
1835
1845
|
return _context3.stop();
|
1836
1846
|
}
|
1837
1847
|
}
|
1838
1848
|
}, _callee3);
|
1839
|
-
})(), "t0",
|
1849
|
+
})(), "t0", 10);
|
1840
1850
|
|
1841
|
-
case
|
1851
|
+
case 10:
|
1842
1852
|
_ret = _context4.t0;
|
1843
1853
|
|
1844
1854
|
if (!(_ret === "break")) {
|
1845
|
-
_context4.next =
|
1855
|
+
_context4.next = 13;
|
1846
1856
|
break;
|
1847
1857
|
}
|
1848
1858
|
|
1849
|
-
return _context4.abrupt("break",
|
1859
|
+
return _context4.abrupt("break", 23);
|
1850
1860
|
|
1851
|
-
case
|
1852
|
-
_context4.next =
|
1861
|
+
case 13:
|
1862
|
+
_context4.next = 20;
|
1853
1863
|
break;
|
1854
1864
|
|
1855
|
-
case
|
1856
|
-
_context4.prev =
|
1857
|
-
_context4.t1 = _context4["catch"](
|
1865
|
+
case 15:
|
1866
|
+
_context4.prev = 15;
|
1867
|
+
_context4.t1 = _context4["catch"](8);
|
1858
1868
|
console.error("[SDK] Error occured during registration: " + _context4.t1 + ", retrying... Retries remaining: " + retry);
|
1859
1869
|
errorsThrown = [];
|
1860
|
-
return _context4.abrupt("continue",
|
1870
|
+
return _context4.abrupt("continue", 20);
|
1861
1871
|
|
1862
|
-
case
|
1872
|
+
case 20:
|
1863
1873
|
retry--;
|
1864
|
-
_context4.next =
|
1874
|
+
_context4.next = 7;
|
1865
1875
|
break;
|
1866
1876
|
|
1867
|
-
case
|
1877
|
+
case 23:
|
1868
1878
|
if (!(retry <= 0)) {
|
1869
|
-
_context4.next =
|
1879
|
+
_context4.next = 26;
|
1870
1880
|
break;
|
1871
1881
|
}
|
1872
1882
|
|
1873
1883
|
console.error('[SDK] registration failed: MAX_RETRIES reached');
|
1874
1884
|
throw 'RegistrationFailed';
|
1875
1885
|
|
1876
|
-
case
|
1886
|
+
case 26:
|
1877
1887
|
console.log('Successfully Registered');
|
1878
|
-
_context4.next =
|
1888
|
+
_context4.next = 29;
|
1879
1889
|
return oroClient.cleanIndex();
|
1880
1890
|
|
1881
|
-
case
|
1891
|
+
case 29:
|
1882
1892
|
return _context4.abrupt("return", {
|
1883
1893
|
masterKey: masterKey,
|
1884
1894
|
consultationId: consult.uuid,
|
1885
1895
|
lockboxUuid: lockboxUuid
|
1886
1896
|
});
|
1887
1897
|
|
1888
|
-
case
|
1898
|
+
case 30:
|
1889
1899
|
case "end":
|
1890
1900
|
return _context4.stop();
|
1891
1901
|
}
|
1892
1902
|
}
|
1893
|
-
}, _callee4, null, [[
|
1903
|
+
}, _callee4, null, [[8, 15]]);
|
1894
1904
|
}));
|
1895
1905
|
return _registerPatient.apply(this, arguments);
|
1896
1906
|
}
|
1897
1907
|
|
1898
|
-
function getOrCreatePatientConsultationUuid(
|
1908
|
+
function getOrCreatePatientConsultationUuid(_x8, _x9) {
|
1899
1909
|
return _getOrCreatePatientConsultationUuid.apply(this, arguments);
|
1900
1910
|
}
|
1901
1911
|
/**
|
@@ -1948,7 +1958,7 @@ function _getOrCreatePatientConsultationUuid() {
|
|
1948
1958
|
return _getOrCreatePatientConsultationUuid.apply(this, arguments);
|
1949
1959
|
}
|
1950
1960
|
|
1951
|
-
function getOrCreatePatientLockbox(
|
1961
|
+
function getOrCreatePatientLockbox(_x10) {
|
1952
1962
|
return _getOrCreatePatientLockbox.apply(this, arguments);
|
1953
1963
|
}
|
1954
1964
|
/**
|
@@ -2003,7 +2013,7 @@ function _getOrCreatePatientLockbox() {
|
|
2003
2013
|
return _getOrCreatePatientLockbox.apply(this, arguments);
|
2004
2014
|
}
|
2005
2015
|
|
2006
|
-
function storePatientData(
|
2016
|
+
function storePatientData(_x11, _x12, _x13, _x14, _x15) {
|
2007
2017
|
return _storePatientData.apply(this, arguments);
|
2008
2018
|
}
|
2009
2019
|
|
@@ -2051,7 +2061,7 @@ function _storePatientData() {
|
|
2051
2061
|
return _storePatientData.apply(this, arguments);
|
2052
2062
|
}
|
2053
2063
|
|
2054
|
-
function storeImageAliases(
|
2064
|
+
function storeImageAliases(_x16, _x17, _x18, _x19) {
|
2055
2065
|
return _storeImageAliases.apply(this, arguments);
|
2056
2066
|
}
|
2057
2067
|
/**
|
@@ -2111,7 +2121,7 @@ function _storeImageAliases() {
|
|
2111
2121
|
return _storeImageAliases.apply(this, arguments);
|
2112
2122
|
}
|
2113
2123
|
|
2114
|
-
function extractAndStorePersonalWorkflowData(
|
2124
|
+
function extractAndStorePersonalWorkflowData(_x20, _x21, _x22, _x23, _x24) {
|
2115
2125
|
return _extractAndStorePersonalWorkflowData.apply(this, arguments);
|
2116
2126
|
}
|
2117
2127
|
/**
|
@@ -2144,7 +2154,7 @@ function _extractAndStorePersonalWorkflowData() {
|
|
2144
2154
|
return _extractAndStorePersonalWorkflowData.apply(this, arguments);
|
2145
2155
|
}
|
2146
2156
|
|
2147
|
-
function extractPersonalInfoFromWorkflowData(
|
2157
|
+
function extractPersonalInfoFromWorkflowData(_x25) {
|
2148
2158
|
return _extractPersonalInfoFromWorkflowData.apply(this, arguments);
|
2149
2159
|
}
|
2150
2160
|
/**
|
@@ -2181,7 +2191,7 @@ function _extractPersonalInfoFromWorkflowData() {
|
|
2181
2191
|
return _extractPersonalInfoFromWorkflowData.apply(this, arguments);
|
2182
2192
|
}
|
2183
2193
|
|
2184
|
-
function buildConsultSearchIndex(
|
2194
|
+
function buildConsultSearchIndex(_x26, _x27, _x28) {
|
2185
2195
|
return _buildConsultSearchIndex.apply(this, arguments);
|
2186
2196
|
}
|
2187
2197
|
|