oro-sdk 5.14.0-dev1.0 → 5.14.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.
@@ -1054,13 +1054,13 @@ function _getOrCreatePatientConsultationUuid() {
1054
1054
  break;
1055
1055
  }
1056
1056
  return _context.abrupt("return", oroClient.consultClient.getConsultByUUID(payment.uuidConsult)["catch"](function (err) {
1057
- console.error('Error while retrieving consult', err);
1057
+ console.error('Error while retrieving consult from linked payment infos', err);
1058
1058
  throw err;
1059
1059
  }));
1060
1060
  case 7:
1061
1061
  _context.next = 9;
1062
1062
  return oroClient.consultClient.consultCreate(consult)["catch"](function (err) {
1063
- console.error('Error while creating consult', err);
1063
+ console.error('Error while creating consult after a payment found with no consult linked', err);
1064
1064
  throw err;
1065
1065
  });
1066
1066
  case 9:
@@ -1318,25 +1318,30 @@ function _registerPatient() {
1318
1318
  }
1319
1319
  throw errorsThrown;
1320
1320
  case 59:
1321
- _context3.next = 61;
1321
+ if (consult.statusMedical === MedicalStatus.Assigning) {
1322
+ //hopefully svelte query received all updates
1323
+ console.warn('Consult assignation took too much time, moving to new anyway');
1324
+ }
1325
+ // Deem the consultation as ready
1326
+ _context3.next = 62;
1322
1327
  return oroClient.consultClient.updateConsultByUUID(consult.uuid, {
1323
1328
  statusMedical: MedicalStatus.New
1324
1329
  });
1325
- case 61:
1330
+ case 62:
1326
1331
  // if we got through the complete flow, the registration succeeded
1327
1332
  if (onProgress) onProgress(currentStep++ / stepsTotalNum, 'success');
1328
1333
  return _context3.abrupt("return", "break");
1329
- case 65:
1330
- _context3.prev = 65;
1334
+ case 66:
1335
+ _context3.prev = 66;
1331
1336
  _context3.t0 = _context3["catch"](0);
1332
1337
  console.error("[SDK] Error occured during registration: " + _context3.t0 + ", retrying... Retries remaining: " + retry);
1333
1338
  errorsThrown = [];
1334
1339
  return _context3.abrupt("return", "continue");
1335
- case 70:
1340
+ case 71:
1336
1341
  case "end":
1337
1342
  return _context3.stop();
1338
1343
  }
1339
- }, _loop, null, [[0, 65]]);
1344
+ }, _loop, null, [[0, 66]]);
1340
1345
  });
1341
1346
  case 9:
1342
1347
  if (!(retry > 0)) {
@@ -1839,7 +1844,7 @@ function _createRefill() {
1839
1844
  stepsTotalNum = 6;
1840
1845
  case 5:
1841
1846
  if (!(retry > 0)) {
1842
- _context.next = 54;
1847
+ _context.next = 55;
1843
1848
  break;
1844
1849
  }
1845
1850
  _context.prev = 6;
@@ -1916,49 +1921,54 @@ function _createRefill() {
1916
1921
  }
1917
1922
  throw errorsThrown;
1918
1923
  case 38:
1919
- _context.next = 40;
1924
+ if (newConsult.statusMedical === MedicalStatus.Assigning) {
1925
+ //hopefully svelte query received all updates
1926
+ console.warn('Consult Refill assignation took too much time, moving to new anyway');
1927
+ }
1928
+ // Deem the consultation as ready
1929
+ _context.next = 41;
1920
1930
  return oroClient.consultClient.updateConsultByUUID(newConsult.uuid, {
1921
1931
  statusMedical: MedicalStatus.New
1922
1932
  });
1923
- case 40:
1933
+ case 41:
1924
1934
  // if we got through the complete flow, the registration succeeded
1925
1935
  if (onProgress) onProgress(currentStep++ / stepsTotalNum, 'success');
1926
- _context.next = 43;
1936
+ _context.next = 44;
1927
1937
  return oroClient.cleanIndex();
1928
- case 43:
1929
- return _context.abrupt("break", 54);
1930
- case 46:
1931
- _context.prev = 46;
1938
+ case 44:
1939
+ return _context.abrupt("break", 55);
1940
+ case 47:
1941
+ _context.prev = 47;
1932
1942
  _context.t0 = _context["catch"](6);
1933
1943
  console.error("[SDK] Error occured during prescription refill request: " + _context.t0 + ", retrying... Retries remaining: " + retry);
1934
1944
  errorsThrown = [];
1935
- return _context.abrupt("continue", 51);
1936
- case 51:
1945
+ return _context.abrupt("continue", 52);
1946
+ case 52:
1937
1947
  retry--;
1938
1948
  _context.next = 5;
1939
1949
  break;
1940
- case 54:
1950
+ case 55:
1941
1951
  if (!(retry <= 0)) {
1942
- _context.next = 57;
1952
+ _context.next = 58;
1943
1953
  break;
1944
1954
  }
1945
1955
  console.error('[SDK] prescription refill request failed: MAX_RETRIES reached');
1946
1956
  throw 'RegistrationFailed';
1947
- case 57:
1957
+ case 58:
1948
1958
  if (newConsult) {
1949
- _context.next = 60;
1959
+ _context.next = 61;
1950
1960
  break;
1951
1961
  }
1952
1962
  console.error('[SDK] prescription refill request failed: MAX_RETRIES reached');
1953
1963
  throw 'RegistrationFailed';
1954
- case 60:
1964
+ case 61:
1955
1965
  console.log('Successfully Created refill');
1956
1966
  return _context.abrupt("return", newConsult);
1957
- case 62:
1967
+ case 63:
1958
1968
  case "end":
1959
1969
  return _context.stop();
1960
1970
  }
1961
- }, _callee, null, [[6, 46]]);
1971
+ }, _callee, null, [[6, 47]]);
1962
1972
  }));
1963
1973
  return _createRefill.apply(this, arguments);
1964
1974
  }