oro-sdk 2.1.4 → 2.3.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.
Files changed (64) hide show
  1. package/README.md +26 -34
  2. package/dist/client.d.ts +4 -4
  3. package/dist/helpers/client.d.ts +1 -1
  4. package/dist/helpers/patient-registration.d.ts +1 -1
  5. package/dist/helpers/vault-grants.d.ts +1 -1
  6. package/dist/helpers/workflow.d.ts +1 -1
  7. package/dist/index.d.ts +15 -1
  8. package/dist/models/client.d.ts +1 -1
  9. package/dist/models/error.d.ts +0 -14
  10. package/dist/models/index.d.ts +0 -7
  11. package/dist/oro-sdk.cjs.development.js +313 -2357
  12. package/dist/oro-sdk.cjs.development.js.map +1 -1
  13. package/dist/oro-sdk.cjs.production.min.js +1 -1
  14. package/dist/oro-sdk.cjs.production.min.js.map +1 -1
  15. package/dist/oro-sdk.esm.js +246 -2334
  16. package/dist/oro-sdk.esm.js.map +1 -1
  17. package/dist/sdk-revision/client.d.ts +2 -2
  18. package/dist/services/index.d.ts +0 -9
  19. package/package.json +4 -1
  20. package/src/client.ts +161 -435
  21. package/src/helpers/client.ts +1 -1
  22. package/src/helpers/patient-registration.ts +85 -166
  23. package/src/helpers/vault-grants.ts +1 -1
  24. package/src/helpers/workflow.ts +21 -59
  25. package/src/index.ts +42 -28
  26. package/src/models/client.ts +1 -1
  27. package/src/models/error.ts +6 -13
  28. package/src/models/index.ts +0 -7
  29. package/src/sdk-revision/client.ts +25 -20
  30. package/src/services/external/clinia.ts +1 -1
  31. package/src/services/index.ts +0 -9
  32. package/LICENSE +0 -21
  33. package/dist/models/consult.d.ts +0 -102
  34. package/dist/models/diagnosis.d.ts +0 -122
  35. package/dist/models/guard.d.ts +0 -119
  36. package/dist/models/practice.d.ts +0 -353
  37. package/dist/models/shared.d.ts +0 -8
  38. package/dist/models/vault.d.ts +0 -124
  39. package/dist/models/workflow.d.ts +0 -106
  40. package/dist/services/api.d.ts +0 -11
  41. package/dist/services/axios.d.ts +0 -14
  42. package/dist/services/consult.d.ts +0 -54
  43. package/dist/services/diagnosis.d.ts +0 -38
  44. package/dist/services/guard.d.ts +0 -92
  45. package/dist/services/practice.d.ts +0 -100
  46. package/dist/services/teller.d.ts +0 -9
  47. package/dist/services/vault.d.ts +0 -54
  48. package/dist/services/workflow.d.ts +0 -21
  49. package/src/models/consult.ts +0 -110
  50. package/src/models/diagnosis.ts +0 -141
  51. package/src/models/guard.ts +0 -136
  52. package/src/models/practice.ts +0 -411
  53. package/src/models/shared.ts +0 -6
  54. package/src/models/vault.ts +0 -158
  55. package/src/models/workflow.ts +0 -142
  56. package/src/services/api.ts +0 -77
  57. package/src/services/axios.ts +0 -91
  58. package/src/services/consult.ts +0 -265
  59. package/src/services/diagnosis.ts +0 -132
  60. package/src/services/guard.ts +0 -228
  61. package/src/services/practice.ts +0 -537
  62. package/src/services/teller.ts +0 -39
  63. package/src/services/vault.ts +0 -178
  64. package/src/services/workflow.ts +0 -36
@@ -1,5 +1,5 @@
1
- import axios from 'axios';
2
- import createAuthRefreshInterceptor from 'axios-auth-refresh';
1
+ import initApis__default, { MetadataCategory, MedicalStatus, IndexKey, DocumentType, AxiosService } from 'oro-sdk-apis';
2
+ export * from 'oro-sdk-apis';
3
3
  import { uuidParse, CryptoRSA } from 'oro-toolbox';
4
4
  import * as oroToolbox from 'oro-toolbox';
5
5
  export { oroToolbox as OroToolboxNamespace };
@@ -231,14 +231,6 @@ function _objectWithoutPropertiesLoose(source, excluded) {
231
231
  return target;
232
232
  }
233
233
 
234
- function _assertThisInitialized(self) {
235
- if (self === void 0) {
236
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
237
- }
238
-
239
- return self;
240
- }
241
-
242
234
  function _unsupportedIterableToArray(o, minLen) {
243
235
  if (!o) return;
244
236
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -912,2337 +904,130 @@ var runtime = (function (exports) {
912
904
  var finallyEntry = entry;
913
905
  break;
914
906
  }
915
- }
916
-
917
- if (finallyEntry &&
918
- (type === "break" ||
919
- type === "continue") &&
920
- finallyEntry.tryLoc <= arg &&
921
- arg <= finallyEntry.finallyLoc) {
922
- // Ignore the finally entry if control is not jumping to a
923
- // location outside the try/catch block.
924
- finallyEntry = null;
925
- }
926
-
927
- var record = finallyEntry ? finallyEntry.completion : {};
928
- record.type = type;
929
- record.arg = arg;
930
-
931
- if (finallyEntry) {
932
- this.method = "next";
933
- this.next = finallyEntry.finallyLoc;
934
- return ContinueSentinel;
935
- }
936
-
937
- return this.complete(record);
938
- },
939
-
940
- complete: function(record, afterLoc) {
941
- if (record.type === "throw") {
942
- throw record.arg;
943
- }
944
-
945
- if (record.type === "break" ||
946
- record.type === "continue") {
947
- this.next = record.arg;
948
- } else if (record.type === "return") {
949
- this.rval = this.arg = record.arg;
950
- this.method = "return";
951
- this.next = "end";
952
- } else if (record.type === "normal" && afterLoc) {
953
- this.next = afterLoc;
954
- }
955
-
956
- return ContinueSentinel;
957
- },
958
-
959
- finish: function(finallyLoc) {
960
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
961
- var entry = this.tryEntries[i];
962
- if (entry.finallyLoc === finallyLoc) {
963
- this.complete(entry.completion, entry.afterLoc);
964
- resetTryEntry(entry);
965
- return ContinueSentinel;
966
- }
967
- }
968
- },
969
-
970
- "catch": function(tryLoc) {
971
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
972
- var entry = this.tryEntries[i];
973
- if (entry.tryLoc === tryLoc) {
974
- var record = entry.completion;
975
- if (record.type === "throw") {
976
- var thrown = record.arg;
977
- resetTryEntry(entry);
978
- }
979
- return thrown;
980
- }
981
- }
982
-
983
- // The context.catch method must only be called with a location
984
- // argument that corresponds to a known catch block.
985
- throw new Error("illegal catch attempt");
986
- },
987
-
988
- delegateYield: function(iterable, resultName, nextLoc) {
989
- this.delegate = {
990
- iterator: values(iterable),
991
- resultName: resultName,
992
- nextLoc: nextLoc
993
- };
994
-
995
- if (this.method === "next") {
996
- // Deliberately forget the last sent value so that we don't
997
- // accidentally pass it on to the delegate.
998
- this.arg = undefined$1;
999
- }
1000
-
1001
- return ContinueSentinel;
1002
- }
1003
- };
1004
-
1005
- // Regardless of whether this script is executing as a CommonJS module
1006
- // or not, return the runtime object so that we can declare the variable
1007
- // regeneratorRuntime in the outer scope, which allows this module to be
1008
- // injected easily by `bin/regenerator --include-runtime script.js`.
1009
- return exports;
1010
-
1011
- }(
1012
- // If this script is executing as a CommonJS module, use module.exports
1013
- // as the regeneratorRuntime namespace. Otherwise create a new empty
1014
- // object. Either way, the resulting object will be used to initialize
1015
- // the regeneratorRuntime variable at the top of this file.
1016
- module.exports
1017
- ));
1018
-
1019
- try {
1020
- regeneratorRuntime = runtime;
1021
- } catch (accidentalStrictMode) {
1022
- // This module should not be running in strict mode, so the above
1023
- // assignment should always work unless something is misconfigured. Just
1024
- // in case runtime.js accidentally runs in strict mode, in modern engines
1025
- // we can explicitly access globalThis. In older engines we can escape
1026
- // strict mode using a global Function call. This could conceivably fail
1027
- // if a Content Security Policy forbids using Function, but in that case
1028
- // the proper solution is to fix the accidental strict mode problem. If
1029
- // you've misconfigured your bundler to force strict mode and applied a
1030
- // CSP to forbid Function, and you're not willing to fix either of those
1031
- // problems, please detail your unique predicament in a GitHub issue.
1032
- if (typeof globalThis === "object") {
1033
- globalThis.regeneratorRuntime = runtime;
1034
- } else {
1035
- Function("r", "regeneratorRuntime = r")(runtime);
1036
- }
1037
- }
1038
- });
1039
-
1040
- var AxiosService = /*#__PURE__*/function () {
1041
- function AxiosService(config) {
1042
- if (!config) config = {};
1043
- this.axios = axios.create(config);
1044
- }
1045
-
1046
- var _proto = AxiosService.prototype;
1047
-
1048
- _proto.apiRequest = /*#__PURE__*/function () {
1049
- var _apiRequest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(config, url, data) {
1050
- return runtime_1.wrap(function _callee$(_context) {
1051
- while (1) {
1052
- switch (_context.prev = _context.next) {
1053
- case 0:
1054
- if (!config.headers) config.headers = {};
1055
- config.headers['Content-Type'] = 'application/json';
1056
- return _context.abrupt("return", this.axios(_extends({}, config, {
1057
- url: url,
1058
- data: data
1059
- })).then(function (res) {
1060
- return res.data;
1061
- }));
1062
-
1063
- case 3:
1064
- case "end":
1065
- return _context.stop();
1066
- }
1067
- }
1068
- }, _callee, this);
1069
- }));
1070
-
1071
- function apiRequest(_x, _x2, _x3) {
1072
- return _apiRequest.apply(this, arguments);
1073
- }
1074
-
1075
- return apiRequest;
1076
- }();
1077
-
1078
- _proto.apiRequestHeader = /*#__PURE__*/function () {
1079
- var _apiRequestHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(config, url, headerToRetrieve, data) {
1080
- return runtime_1.wrap(function _callee2$(_context2) {
1081
- while (1) {
1082
- switch (_context2.prev = _context2.next) {
1083
- case 0:
1084
- if (!config.headers) config.headers = {};
1085
- config.headers['Content-Type'] = 'application/json';
1086
- return _context2.abrupt("return", this.axios(_extends({}, config, {
1087
- url: url,
1088
- data: data
1089
- })).then(function (res) {
1090
- if (headerToRetrieve) {
1091
- var _res$headers$headerTo;
1092
-
1093
- return (_res$headers$headerTo = res.headers[headerToRetrieve]) != null ? _res$headers$headerTo : res.headers[headerToRetrieve.toLowerCase()];
1094
- }
1095
-
1096
- return res.headers;
1097
- }));
1098
-
1099
- case 3:
1100
- case "end":
1101
- return _context2.stop();
1102
- }
1103
- }
1104
- }, _callee2, this);
1105
- }));
1106
-
1107
- function apiRequestHeader(_x4, _x5, _x6, _x7) {
1108
- return _apiRequestHeader.apply(this, arguments);
1109
- }
1110
-
1111
- return apiRequestHeader;
1112
- }();
1113
-
1114
- _proto.get = function get(url, config) {
1115
- return this.apiRequest(_extends({}, config, {
1116
- method: 'get'
1117
- }), url);
1118
- };
1119
-
1120
- _proto.deleteRequest = function deleteRequest(url, config) {
1121
- return this.apiRequest(_extends({}, config, {
1122
- method: 'delete'
1123
- }), url);
1124
- };
1125
-
1126
- _proto.post = function post(url, data, config) {
1127
- return this.apiRequest(_extends({}, config, {
1128
- method: 'post'
1129
- }), url, data);
1130
- };
1131
-
1132
- _proto.put = function put(url, data, config) {
1133
- return this.apiRequest(_extends({}, config, {
1134
- method: 'put'
1135
- }), url, data);
1136
- };
1137
-
1138
- _proto.patch = function patch(url, data, config) {
1139
- return this.apiRequest(_extends({}, config, {
1140
- method: 'patch'
1141
- }), url, data);
1142
- };
1143
-
1144
- _proto.head = function head(url, config, headerToRetrieve, data) {
1145
- return this.apiRequestHeader(_extends({}, config, {
1146
- method: 'head'
1147
- }), url, headerToRetrieve, data);
1148
- };
1149
-
1150
- return AxiosService;
1151
- }();
1152
-
1153
- var APIService = /*#__PURE__*/function (_AxiosService) {
1154
- _inheritsLoose(APIService, _AxiosService);
1155
-
1156
- function APIService(config, tokenRefreshFailureCallback) {
1157
- var _this;
1158
-
1159
- _this = _AxiosService.call(this, config) || this;
1160
- _this.tokenRefreshFailureCallback = tokenRefreshFailureCallback;
1161
-
1162
- var self = _assertThisInitialized(_this);
1163
-
1164
- _this.axios.interceptors.request.use(function (config) {
1165
- var token = config.useRefreshToken ? self.getTokens().refreshToken : self.getTokens().accessToken;
1166
- config.headers = _extends({}, config.headers, {
1167
- Authorization: "Bearer " + token
1168
- });
1169
- return config;
1170
- }, function (error) {
1171
- Promise.reject(error);
1172
- });
1173
-
1174
- createAuthRefreshInterceptor(_this.axios, /*#__PURE__*/function () {
1175
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(failedRequest) {
1176
- var tokenResp;
1177
- return runtime_1.wrap(function _callee$(_context) {
1178
- while (1) {
1179
- switch (_context.prev = _context.next) {
1180
- case 0:
1181
- if (!self.authRefreshFn) {
1182
- _context.next = 15;
1183
- break;
1184
- }
1185
-
1186
- _context.prev = 1;
1187
- _context.next = 4;
1188
- return self.authRefreshFn(self.getTokens().refreshToken);
1189
-
1190
- case 4:
1191
- tokenResp = _context.sent;
1192
- self.setTokens({
1193
- accessToken: tokenResp.accessToken,
1194
- refreshToken: tokenResp.refreshToken
1195
- });
1196
- failedRequest.response.config.headers['Authorization'] = "Bearer " + self.getTokens().accessToken;
1197
- return _context.abrupt("return", Promise.resolve());
1198
-
1199
- case 10:
1200
- _context.prev = 10;
1201
- _context.t0 = _context["catch"](1);
1202
- console.error('an error occured while refreshing tokens (notifying callback)', _context.t0);
1203
- if (self.tokenRefreshFailureCallback) self.tokenRefreshFailureCallback(failedRequest);
1204
- return _context.abrupt("return", Promise.resolve());
1205
-
1206
- case 15:
1207
- console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest);
1208
- return _context.abrupt("return", Promise.resolve());
1209
-
1210
- case 17:
1211
- case "end":
1212
- return _context.stop();
1213
- }
1214
- }
1215
- }, _callee, null, [[1, 10]]);
1216
- }));
1217
-
1218
- return function (_x) {
1219
- return _ref.apply(this, arguments);
1220
- };
1221
- }(), {
1222
- statusCodes: [401, 403]
1223
- });
1224
- return _this;
1225
- }
1226
-
1227
- var _proto = APIService.prototype;
1228
-
1229
- _proto.setAuthRefreshFn = function setAuthRefreshFn(fn) {
1230
- this.authRefreshFn = fn;
1231
- };
1232
-
1233
- _proto.setTokens = function setTokens(tokens) {
1234
- localStorage.setItem('tokens', JSON.stringify(tokens));
1235
- };
1236
-
1237
- _proto.getTokens = function getTokens() {
1238
- var tokens = {};
1239
- var item = localStorage.getItem('tokens');
1240
-
1241
- if (item) {
1242
- tokens = JSON.parse(item);
1243
- }
1244
-
1245
- return tokens;
1246
- };
1247
-
1248
- return APIService;
1249
- }(AxiosService);
1250
-
1251
- var AssistantType;
1252
-
1253
- (function (AssistantType) {
1254
- AssistantType["MedicalSecretary"] = "MedicalSecretary";
1255
- AssistantType["Nurse"] = "Nurse";
1256
- AssistantType["Specialist"] = "Specialist";
1257
- AssistantType["Administrative"] = "Administrative";
1258
- AssistantType["Other"] = "Other";
1259
- })(AssistantType || (AssistantType = {}));
1260
-
1261
- var TransmissionKind;
1262
-
1263
- (function (TransmissionKind) {
1264
- TransmissionKind["Fax"] = "Fax";
1265
- TransmissionKind["Email"] = "Email";
1266
- TransmissionKind["SMS"] = "SMS";
1267
- TransmissionKind["EncryptedEmail"] = "EncryptedEmail";
1268
- TransmissionKind["Logs"] = "Logs";
1269
- TransmissionKind["API"] = "API";
1270
- TransmissionKind["Other"] = "Other";
1271
- })(TransmissionKind || (TransmissionKind = {}));
1272
-
1273
- var TransmissionStatus;
1274
-
1275
- (function (TransmissionStatus) {
1276
- TransmissionStatus["Preparing"] = "Preparing";
1277
- TransmissionStatus["Sending"] = "Sending";
1278
- TransmissionStatus["Sent"] = "Sent";
1279
- TransmissionStatus["Retrying"] = "Retrying";
1280
- TransmissionStatus["Failed"] = "Failed";
1281
- TransmissionStatus["DriverError"] = "DriverError";
1282
- TransmissionStatus["TimedOut"] = "TimedOut";
1283
- TransmissionStatus["ReceiverNotExist"] = "ReceiverNotExist";
1284
- TransmissionStatus["ReceiverNotAnswering"] = "ReceiverNotAnswering";
1285
- TransmissionStatus["ReceiverIncompatible"] = "ReceiverIncompatible";
1286
- })(TransmissionStatus || (TransmissionStatus = {}));
1287
-
1288
- var FeeStatus;
1289
-
1290
- (function (FeeStatus) {
1291
- FeeStatus["NoFee"] = "NoFee";
1292
- FeeStatus["Pending"] = "Pending";
1293
- FeeStatus["Paid"] = "Paid";
1294
- FeeStatus["Reimbursed"] = "Reimbursed";
1295
- FeeStatus["Cancelled"] = "Cancelled";
1296
- FeeStatus["Contested"] = "Contested";
1297
- })(FeeStatus || (FeeStatus = {}));
1298
-
1299
- var MedicalStatus;
1300
-
1301
- (function (MedicalStatus) {
1302
- MedicalStatus["Creating"] = "Creating";
1303
- MedicalStatus["New"] = "New";
1304
- MedicalStatus["ToAnswer"] = "ToAnswer";
1305
- MedicalStatus["Answered"] = "Answered";
1306
- MedicalStatus["Closed"] = "Closed";
1307
- MedicalStatus["Reopened"] = "Reopened";
1308
- MedicalStatus["Archived"] = "Archived";
1309
- })(MedicalStatus || (MedicalStatus = {}));
1310
-
1311
- var TaskStatus;
1312
-
1313
- (function (TaskStatus) {
1314
- TaskStatus["None"] = "None";
1315
- TaskStatus["ToDo"] = "ToDo";
1316
- TaskStatus["InProgress"] = "InProgress";
1317
- TaskStatus["Blocked"] = "Blocked";
1318
- TaskStatus["Done"] = "Done";
1319
- })(TaskStatus || (TaskStatus = {}));
1320
-
1321
- var DiagnosisType;
1322
-
1323
- (function (DiagnosisType) {
1324
- DiagnosisType["Generic"] = "Generic";
1325
- DiagnosisType["Private"] = "Private";
1326
- DiagnosisType["Instance"] = "Instance";
1327
- })(DiagnosisType || (DiagnosisType = {}));
1328
-
1329
- var DrugType;
1330
-
1331
- (function (DrugType) {
1332
- DrugType["Generic"] = "Generic";
1333
- DrugType["Instance"] = "Instance";
1334
- })(DrugType || (DrugType = {}));
1335
-
1336
- var PlanStatus;
1337
-
1338
- (function (PlanStatus) {
1339
- PlanStatus["Pending"] = "Pending";
1340
- PlanStatus["Accepted"] = "Accepted";
1341
- PlanStatus["Rejected"] = "Rejected";
1342
- })(PlanStatus || (PlanStatus = {}));
1343
-
1344
- var IncompleteAuthentication = /*#__PURE__*/function (_Error) {
1345
- _inheritsLoose(IncompleteAuthentication, _Error);
1346
-
1347
- function IncompleteAuthentication() {
1348
- return _Error.apply(this, arguments) || this;
1349
- }
1350
-
1351
- return IncompleteAuthentication;
1352
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1353
- var MissingGrant = /*#__PURE__*/function (_Error2) {
1354
- _inheritsLoose(MissingGrant, _Error2);
1355
-
1356
- function MissingGrant() {
1357
- return _Error2.apply(this, arguments) || this;
1358
- }
1359
-
1360
- return MissingGrant;
1361
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1362
- var MissingLockbox = /*#__PURE__*/function (_Error3) {
1363
- _inheritsLoose(MissingLockbox, _Error3);
1364
-
1365
- function MissingLockbox() {
1366
- return _Error3.apply(this, arguments) || this;
1367
- }
1368
-
1369
- return MissingLockbox;
1370
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1371
- var MissingLockboxOwner = /*#__PURE__*/function (_Error4) {
1372
- _inheritsLoose(MissingLockboxOwner, _Error4);
1373
-
1374
- function MissingLockboxOwner() {
1375
- return _Error4.apply(this, arguments) || this;
1376
- }
1377
-
1378
- return MissingLockboxOwner;
1379
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1380
- var IndexBuildError = /*#__PURE__*/function (_Error5) {
1381
- _inheritsLoose(IndexBuildError, _Error5);
1382
-
1383
- function IndexBuildError() {
1384
- return _Error5.apply(this, arguments) || this;
1385
- }
1386
-
1387
- return IndexBuildError;
1388
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1389
- var AssociatedLockboxNotFound = /*#__PURE__*/function (_Error6) {
1390
- _inheritsLoose(AssociatedLockboxNotFound, _Error6);
1391
-
1392
- function AssociatedLockboxNotFound() {
1393
- return _Error6.apply(this, arguments) || this;
1394
- }
1395
-
1396
- return AssociatedLockboxNotFound;
1397
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1398
- var WorkflowAnswersMissingError = /*#__PURE__*/function (_Error7) {
1399
- _inheritsLoose(WorkflowAnswersMissingError, _Error7);
1400
-
1401
- function WorkflowAnswersMissingError() {
1402
- return _Error7.apply(this, arguments) || this;
1403
- }
1404
-
1405
- return WorkflowAnswersMissingError;
1406
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1407
- var AuthenticationFailed = /*#__PURE__*/function (_Error8) {
1408
- _inheritsLoose(AuthenticationFailed, _Error8);
1409
-
1410
- function AuthenticationFailed() {
1411
- return _Error8.apply(this, arguments) || this;
1412
- }
1413
-
1414
- return AuthenticationFailed;
1415
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1416
- var AuthenticationBadRequest = /*#__PURE__*/function (_Error9) {
1417
- _inheritsLoose(AuthenticationBadRequest, _Error9);
1418
-
1419
- function AuthenticationBadRequest() {
1420
- return _Error9.apply(this, arguments) || this;
1421
- }
1422
-
1423
- return AuthenticationBadRequest;
1424
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1425
- var AuthenticationServerError = /*#__PURE__*/function (_Error10) {
1426
- _inheritsLoose(AuthenticationServerError, _Error10);
1427
-
1428
- function AuthenticationServerError() {
1429
- return _Error10.apply(this, arguments) || this;
1430
- }
1431
-
1432
- return AuthenticationServerError;
1433
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1434
- var IdentityCreationFailed = /*#__PURE__*/function (_Error11) {
1435
- _inheritsLoose(IdentityCreationFailed, _Error11);
1436
-
1437
- function IdentityCreationFailed() {
1438
- return _Error11.apply(this, arguments) || this;
1439
- }
1440
-
1441
- return IdentityCreationFailed;
1442
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1443
- var IdentityCreationBadRequest = /*#__PURE__*/function (_Error12) {
1444
- _inheritsLoose(IdentityCreationBadRequest, _Error12);
1445
-
1446
- function IdentityCreationBadRequest() {
1447
- return _Error12.apply(this, arguments) || this;
1448
- }
1449
-
1450
- return IdentityCreationBadRequest;
1451
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1452
- var IdentityCreationConflict = /*#__PURE__*/function (_Error13) {
1453
- _inheritsLoose(IdentityCreationConflict, _Error13);
1454
-
1455
- function IdentityCreationConflict() {
1456
- return _Error13.apply(this, arguments) || this;
1457
- }
1458
-
1459
- return IdentityCreationConflict;
1460
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1461
-
1462
- var WorkflowType;
1463
-
1464
- (function (WorkflowType) {
1465
- WorkflowType["Onboard"] = "Onboard";
1466
- WorkflowType["Followup"] = "Followup";
1467
- WorkflowType["Renew"] = "Renew";
1468
- WorkflowType["DataRetrieve"] = "DataRetrieve";
1469
- })(WorkflowType || (WorkflowType = {}));
1470
-
1471
- var RateDimension;
1472
-
1473
- (function (RateDimension) {
1474
- RateDimension["RatioOnTotal"] = "RatioOnTotal";
1475
- RateDimension["FixedOnTotal"] = "FixedOnTotal";
1476
- RateDimension["RatioPlatformFee"] = "RatioPlatformFee";
1477
- RateDimension["FixedPlatformFee"] = "FixedPlatformFee";
1478
- RateDimension["RatioOnPlatformFeeTotal"] = "RatioOnPlatformFeeTotal";
1479
- RateDimension["FixedOnPlatformFeeTotal"] = "FixedOnPlatformFeeTotal";
1480
- RateDimension["RatioOnItem"] = "RatioOnItem";
1481
- RateDimension["FixedOnItem"] = "FixedOnItem";
1482
- })(RateDimension || (RateDimension = {}));
1483
-
1484
- var PlanType;
1485
-
1486
- (function (PlanType) {
1487
- PlanType["Onboard"] = "Onboard";
1488
- PlanType["Followup"] = "Followup";
1489
- PlanType["Renew"] = "Renew";
1490
- PlanType["DataRetrieve"] = "DataRetrieve";
1491
- })(PlanType || (PlanType = {}));
1492
-
1493
- var PaymentStatus;
1494
-
1495
- (function (PaymentStatus) {
1496
- PaymentStatus["Pending"] = "Pending";
1497
- PaymentStatus["Success"] = "Success";
1498
- PaymentStatus["Failure"] = "Failure";
1499
- PaymentStatus["Canceled"] = "Canceled";
1500
- })(PaymentStatus || (PaymentStatus = {}));
1501
-
1502
- var PractitionerStatus;
1503
-
1504
- (function (PractitionerStatus) {
1505
- PractitionerStatus["Practicing"] = "Practicing";
1506
- PractitionerStatus["Retired"] = "Retired";
1507
- PractitionerStatus["NotInvolvedAnymore"] = "NotInvolvedAnymore";
1508
- PractitionerStatus["Deactivated"] = "Deactivated";
1509
- PractitionerStatus["Flagged"] = "Flagged";
1510
- PractitionerStatus["InConflict"] = "InConflict";
1511
- PractitionerStatus["Delicensed"] = "Delicensed";
1512
- })(PractitionerStatus || (PractitionerStatus = {}));
1513
-
1514
- var AssignmentStatus;
1515
-
1516
- (function (AssignmentStatus) {
1517
- AssignmentStatus["Assigned"] = "Assigned";
1518
- AssignmentStatus["Reassigned"] = "Reassigned";
1519
- AssignmentStatus["Cancelled"] = "Cancelled";
1520
- })(AssignmentStatus || (AssignmentStatus = {}));
1521
-
1522
- var PractitionnerRoleType;
1523
-
1524
- (function (PractitionnerRoleType) {
1525
- PractitionnerRoleType["Doctor"] = "Doctor";
1526
- PractitionnerRoleType["MedicalAssistant"] = "MedicalAssistant";
1527
- PractitionnerRoleType["MedicalSecretary"] = "MedicalSecretary";
1528
- PractitionnerRoleType["Nurse"] = "Nurse";
1529
- PractitionnerRoleType["Specialist"] = "Specialist";
1530
- PractitionnerRoleType["LabAssistant"] = "LabAssistant";
1531
- PractitionnerRoleType["Administrative"] = "Administrative";
1532
- PractitionnerRoleType["ManualDispatcher"] = "ManualDispatcher";
1533
- PractitionnerRoleType["Other"] = "Other";
1534
- })(PractitionnerRoleType || (PractitionnerRoleType = {}));
1535
-
1536
- var OtherRoleType;
1537
-
1538
- (function (OtherRoleType) {
1539
- OtherRoleType["Patient"] = "Patient";
1540
- OtherRoleType["User"] = "User";
1541
- OtherRoleType["System"] = "System";
1542
- })(OtherRoleType || (OtherRoleType = {}));
1543
-
1544
- var LicenseStatus;
1545
-
1546
- (function (LicenseStatus) {
1547
- LicenseStatus["Valid"] = "Valid";
1548
- LicenseStatus["Invalid"] = "Invalid";
1549
- LicenseStatus["Expired"] = "Expired";
1550
- LicenseStatus["NA"] = "NA";
1551
- LicenseStatus["Removed"] = "Removed";
1552
- })(LicenseStatus || (LicenseStatus = {}));
1553
-
1554
- var PeriodType;
1555
-
1556
- (function (PeriodType) {
1557
- PeriodType["PerYear"] = "PerYear";
1558
- PeriodType["PerQuarter"] = "PerQuarter";
1559
- PeriodType["PerMonth"] = "PerMonth";
1560
- PeriodType["PerWeek"] = "PerWeek";
1561
- PeriodType["PerBusinessDay"] = "PerBusinessDay";
1562
- PeriodType["PerDay"] = "PerDay";
1563
- PeriodType["PerHour"] = "PerHour";
1564
- })(PeriodType || (PeriodType = {}));
1565
-
1566
- var SyncStatus;
1567
-
1568
- (function (SyncStatus) {
1569
- SyncStatus["Requested"] = "Requested";
1570
- SyncStatus["Started"] = "Started";
1571
- SyncStatus["Succeeded"] = "Succeeded";
1572
- SyncStatus["Failed"] = "Failed";
1573
- SyncStatus["Cancelled"] = "Cancelled";
1574
- })(SyncStatus || (SyncStatus = {}));
1575
-
1576
- var PracticeEmailKind;
1577
-
1578
- (function (PracticeEmailKind) {
1579
- PracticeEmailKind["SignedUp"] = "SignedUp";
1580
- PracticeEmailKind["Onboarded"] = "Onboarded";
1581
- PracticeEmailKind["OnboardedPractitioner"] = "OnboardedPractitioner";
1582
- PracticeEmailKind["OnboardedPatient"] = "OnboardedPatient";
1583
- PracticeEmailKind["Answered"] = "Answered";
1584
- PracticeEmailKind["ToAnswer"] = "ToAnswer";
1585
- PracticeEmailKind["FollowedUp"] = "FollowedUp";
1586
- PracticeEmailKind["Renewed"] = "Renewed";
1587
- PracticeEmailKind["DataRetrieved"] = "DataRetrieved";
1588
- })(PracticeEmailKind || (PracticeEmailKind = {}));
1589
-
1590
- var PracticeConfigKind;
1591
-
1592
- (function (PracticeConfigKind) {
1593
- PracticeConfigKind["PractitionerConsultList"] = "PractitionerConsultList";
1594
- PracticeConfigKind["PractitionerChatbox"] = "PractitionerChatbox";
1595
- PracticeConfigKind["PracticeTheme"] = "PracticeTheme";
1596
- PracticeConfigKind["PracticeLocaleSwitcher"] = "PracticeLocaleSwitcher";
1597
- PracticeConfigKind["PracticeCookieBanner"] = "PracticeCookieBanner";
1598
- })(PracticeConfigKind || (PracticeConfigKind = {}));
1599
-
1600
- var StripePriceType;
1601
-
1602
- (function (StripePriceType) {
1603
- StripePriceType["Default"] = "Default";
1604
- StripePriceType["Discount"] = "Discount";
1605
- })(StripePriceType || (StripePriceType = {}));
1606
-
1607
- var IndexKey;
1608
-
1609
- (function (IndexKey) {
1610
- IndexKey["Consultation"] = "Consultation";
1611
- IndexKey["IndexSnapshot"] = "IndexSnapshot";
1612
- IndexKey["ConsultationLockbox"] = "ConsultationLockbox";
1613
- })(IndexKey || (IndexKey = {}));
1614
-
1615
- var DocumentType;
1616
-
1617
- (function (DocumentType) {
1618
- DocumentType["Message"] = "Message";
1619
- DocumentType["Note"] = "Note";
1620
- DocumentType["DoctorsNote"] = "DoctorsNote";
1621
- DocumentType["Prescription"] = "Prescription";
1622
- DocumentType["ExamRequest"] = "ExamRequest";
1623
- DocumentType["Result"] = "Result";
1624
- DocumentType["Attachment"] = "Attachment";
1625
- DocumentType["BigFile"] = "BigFile";
1626
- DocumentType["MeetingRequest"] = "MeetingRequest";
1627
- DocumentType["AudioNote"] = "AudioNote";
1628
- DocumentType["VideoNote"] = "VideoNote";
1629
- DocumentType["PopulatedWorkflowData"] = "PopulatedWorkflowData";
1630
- DocumentType["TreatmentPlan"] = "TreatmentPlan";
1631
- DocumentType["ImageAlias"] = "ImageAlias";
1632
- })(DocumentType || (DocumentType = {}));
1633
-
1634
- var MetadataCategory;
1635
-
1636
- (function (MetadataCategory) {
1637
- MetadataCategory["ChildPersonal"] = "ChildPersonal";
1638
- MetadataCategory["Consultation"] = "Consultation";
1639
- MetadataCategory["DataRetrieval"] = "DataRetrieval";
1640
- MetadataCategory["Followup"] = "Followup";
1641
- MetadataCategory["Recovery"] = "Recovery";
1642
- MetadataCategory["Medical"] = "Medical";
1643
- MetadataCategory["OtherPersonal"] = "OtherPersonal";
1644
- MetadataCategory["Personal"] = "Personal";
1645
- MetadataCategory["Preference"] = "Preference";
1646
- MetadataCategory["Prescription"] = "Prescription";
1647
- MetadataCategory["Raw"] = "Raw";
1648
- })(MetadataCategory || (MetadataCategory = {}));
1649
-
1650
- var ConsultService = /*#__PURE__*/function () {
1651
- function ConsultService(api, baseURL) {
1652
- this.api = api;
1653
- this.baseURL = baseURL;
1654
- }
1655
-
1656
- var _proto = ConsultService.prototype;
1657
-
1658
- _proto.consultCreate = function consultCreate(c) {
1659
- return this.api.post(this.baseURL + "/v1/consults", c);
1660
- }
1661
- /**
1662
- * This function returns the number of consults using parameters
1663
- * @param uuidPractice the practice uuid
1664
- * @param uuidRequester the requester uuid
1665
- * @param statusesMedical an array containing MedicalStatus to include
1666
- * @param statusesExclude an array containing MedicalStatus to exclude
1667
- * @param shortId a shortId matcher (will match all consult with a shortId starting with this `shortId`)
1668
- * @param columnToSortTo the list of columns separated by commas, to sort to (in order of sorting)
1669
- * @param orderToSortTo the type of sorting to do ('asc' for ascending or 'desc' for descending)
1670
- * @param perPage the number of item to retrieve per "page"
1671
- * @param indexPage the actual index of the page to retrieve (0 based: 0 is the first items)
1672
- * @param filterAssignedDoctor the uuid of the doctor for which to filter with
1673
- * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with
1674
- * @param filterIsoLocality the of isoLocality to filter with
1675
- * @returns a number of consult
1676
- */
1677
- ;
1678
-
1679
- _proto.countConsults = function countConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality) {
1680
- return this.api.head(this.baseURL + "/v1/consults", {
1681
- params: {
1682
- uuidPractice: uuidPractice,
1683
- uuidRequester: uuidRequester,
1684
- statusesMedical: statusesMedical,
1685
- statusesExclude: statusesExclude,
1686
- shortId: shortId,
1687
- perPage: perPage,
1688
- page: indexPage,
1689
- sortColumns: columnToSortTo,
1690
- orderColumns: orderToSortTo,
1691
- filterAssignedDoctor: filterAssignedDoctor,
1692
- filterCurrentPractitioner: filterCurrentPractitioner,
1693
- filterIsoLocality: filterIsoLocality
1694
- }
1695
- }, 'Content-Range').then(function (resContentRange) {
1696
- if (!resContentRange || typeof resContentRange !== 'string' && typeof resContentRange !== 'number') {
1697
- return 0;
1698
- }
1699
-
1700
- if (typeof resContentRange === 'number') {
1701
- return resContentRange;
1702
- }
1703
-
1704
- return parseInt(resContentRange);
1705
- });
1706
- }
1707
- /**
1708
- * This function get consults using parameters
1709
- * @param uuidPractice the practice uuid
1710
- * @param uuidRequester the requester uuid
1711
- * @param statusesMedical an array containing MedicalStatus to include
1712
- * @param statusesExclude an array containing MedicalStatus to exclude
1713
- * @param shortId a shortId matcher (will match all consult with a shortId starting with this `shortId`)
1714
- * @param columnToSortTo the list of columns separated by commas, to sort to (in order of sorting)
1715
- * @param orderToSortTo the type of sorting to do ('asc' for ascending or 'desc' for descending)
1716
- * @param perPage the number of item to retrieve per "page"
1717
- * @param indexPage the actual index of the page to retrieve (0 based: 0 is the first items)
1718
- * @param filterAssignedDoctor the uuid of the doctor for which to filter with
1719
- * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with
1720
- * @param filterIsoLocality the of isoLocality to filter with
1721
- * @returns a list of consult
1722
- */
1723
- ;
1724
-
1725
- _proto.getConsults = function getConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality) {
1726
- return this.api.get(this.baseURL + "/v1/consults", {
1727
- params: {
1728
- uuidPractice: uuidPractice,
1729
- uuidRequester: uuidRequester,
1730
- statusesMedical: statusesMedical,
1731
- statusesExclude: statusesExclude,
1732
- shortId: shortId,
1733
- perPage: perPage,
1734
- page: indexPage,
1735
- sortColumns: columnToSortTo,
1736
- orderColumns: orderToSortTo,
1737
- filterAssignedDoctor: filterAssignedDoctor,
1738
- filterCurrentPractitioner: filterCurrentPractitioner,
1739
- filterIsoLocality: filterIsoLocality
1740
- }
1741
- });
1742
- };
1743
-
1744
- _proto.getConsultByUUID = function getConsultByUUID(uuidConsult, uuidPractice) {
1745
- return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult, {
1746
- params: {
1747
- uuidPractice: uuidPractice
1748
- }
1749
- });
1750
- };
1751
-
1752
- _proto.updateConsultByUUID = function updateConsultByUUID(uuidConsult, consult, uuidPractice, uuidRequester) {
1753
- return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, consult, {
1754
- params: {
1755
- uuidPractice: uuidPractice,
1756
- uuidRequester: uuidRequester
1757
- }
1758
- });
1759
- };
1760
-
1761
- _proto.getConsultFaxStatuses = function getConsultFaxStatuses(uuidConsult) {
1762
- return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", {
1763
- params: {
1764
- kind: TransmissionKind.Fax
1765
- }
1766
- });
1767
- };
1768
-
1769
- _proto.postConsultTransmission = function postConsultTransmission(uuidConsult, nameDriver, addressOrPhoneToSendTo, file, nameReceiver, txtTransmissionTitle, txtTransmissionNotes // numTry ?: number,
1770
- // delay ?: number,
1771
- ) {
1772
- if (nameDriver === void 0) {
1773
- nameDriver = 'Documo';
1774
- }
1775
-
1776
- var data = new FormData();
1777
- data.append('nameDriverReceiver', nameDriver);
1778
-
1779
- if (addressOrPhoneToSendTo) {
1780
- data.append('addressReceiver', addressOrPhoneToSendTo);
1781
- }
1782
-
1783
- if (file) {
1784
- data.append('file', file);
1785
- }
1786
-
1787
- if (nameReceiver) {
1788
- data.append('nameReceiver', nameReceiver);
1789
- }
1790
-
1791
- if (txtTransmissionTitle) {
1792
- data.append('txtTransmissionTitle', txtTransmissionTitle);
1793
- }
1794
-
1795
- if (txtTransmissionNotes) {
1796
- data.append('txtTransmissionNotes', txtTransmissionNotes);
1797
- }
1798
-
1799
- return this.api.post(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", data, {
1800
- headers: {
1801
- 'Content-Type': 'multipart/form-data;'
1802
- }
1803
- });
1804
- };
1805
-
1806
- _proto.postConsultFax = function postConsultFax(uuidConsult, addressReceiver, file) {
1807
- return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file);
1808
- };
1809
-
1810
- _proto.postConsultEmail = function postConsultEmail(uuidConsult, file) {
1811
- return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file);
1812
- };
1813
-
1814
- _proto.retryConsultFax = function retryConsultFax(uuidConsult, transmissionId) {
1815
- return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1816
- status: TransmissionStatus.Retrying
1817
- });
1818
- };
1819
-
1820
- _proto.updateConsultTransmissionStatus = function updateConsultTransmissionStatus(transmissionId, uuidConsult, newStatus) {
1821
- return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1822
- status: newStatus
1823
- });
1824
- };
1825
-
1826
- return ConsultService;
1827
- }();
1828
-
1829
- var DiagnosisService = /*#__PURE__*/function () {
1830
- function DiagnosisService(api, baseURL) {
1831
- this.api = api;
1832
- this.baseURL = baseURL;
1833
- }
1834
-
1835
- var _proto = DiagnosisService.prototype;
1836
-
1837
- _proto.getDiagnoses = function getDiagnoses() {
1838
- return this.api.get(this.baseURL + "/v1/diagnoses");
1839
- }
1840
- /**
1841
- * Get a diagnosis by uuid that belongs to your practice
1842
- * @param uuidDiagnosis the uuid of the diagnosis
1843
- * @returns a diagnosis
1844
- */
1845
- ;
1846
-
1847
- _proto.getDiagnosisByUuid = function getDiagnosisByUuid(uuidDiagnosis) {
1848
- return this.api.get(this.baseURL + "/v1/diagnoses/" + uuidDiagnosis);
1849
- };
1850
-
1851
- _proto.createDiagnosis = function createDiagnosis(diagnosis) {
1852
- return this.api.post(this.baseURL + "/v1/diagnoses", diagnosis);
1853
- };
1854
-
1855
- _proto.updateDiagnosis = function updateDiagnosis(uuid, diagnosis) {
1856
- return this.api.put(this.baseURL + "/v1/diagnoses/" + uuid, diagnosis);
1857
- };
1858
-
1859
- _proto.getTreatmentsFromDiagnosisUuid = function getTreatmentsFromDiagnosisUuid(diagnosisUuid) {
1860
- return this.api.get(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments");
1861
- }
1862
- /**
1863
- * This function returns treatment plans associated to a consult
1864
- * @param uuidConsult the consult uuid to fetch
1865
- * @returns an array of TreatmentPlan
1866
- */
1867
- ;
1868
-
1869
- _proto.getTreatmentPlansFromConsultUuid = function getTreatmentPlansFromConsultUuid(uuidConsult) {
1870
- return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1871
- params: {
1872
- uuidConsult: uuidConsult
1873
- }
1874
- });
1875
- }
1876
- /**
1877
- * This function returns populated treatment plans associated to a consult
1878
- * @param uuidConsult the consult uuid to fetch
1879
- * @returns a TreatmentPlans object
1880
- */
1881
- ;
1882
-
1883
- _proto.getTreatmentPlansPopulatedFromConsultUuid = function getTreatmentPlansPopulatedFromConsultUuid(uuidConsult) {
1884
- return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1885
- params: {
1886
- uuidConsult: uuidConsult,
1887
- populated: true
1888
- }
1889
- });
1890
- };
1891
-
1892
- _proto.postPlans = function postPlans(plans) {
1893
- return this.api.post(this.baseURL + "/v1/treatment-plans", plans);
1894
- };
1895
-
1896
- _proto.updateTreatmentPlan = function updateTreatmentPlan(uuidPlan, uuidConsult, diagnosisRequest, plan) {
1897
- return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan, {
1898
- uuidConsult: uuidConsult,
1899
- diagnosis: diagnosisRequest,
1900
- plan: plan
1901
- });
1902
- };
1903
-
1904
- _proto.acceptTreatmentPlan = function acceptTreatmentPlan(uuidPlan, uuidConsult) {
1905
- return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan + "/accept", {
1906
- uuidConsult: uuidConsult
1907
- });
1908
- }
1909
- /**
1910
- * retrieves all the drugs of the specified practice
1911
- * @param uuidPractice
1912
- */
1913
- ;
1914
-
1915
- _proto.getAllDrugs =
1916
- /*#__PURE__*/
1917
- function () {
1918
- var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(uuidPractice) {
1919
- var res;
1920
- return runtime_1.wrap(function _callee$(_context) {
1921
- while (1) {
1922
- switch (_context.prev = _context.next) {
1923
- case 0:
1924
- _context.next = 2;
1925
- return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1926
-
1927
- case 2:
1928
- res = _context.sent;
1929
-
1930
- if (!(res && res.foundDrugs)) {
1931
- _context.next = 5;
1932
- break;
1933
- }
1934
-
1935
- return _context.abrupt("return", res.foundDrugs);
1936
-
1937
- case 5:
1938
- return _context.abrupt("return", undefined);
1939
-
1940
- case 6:
1941
- case "end":
1942
- return _context.stop();
1943
- }
1944
- }
1945
- }, _callee, this);
1946
- }));
1947
-
1948
- function getAllDrugs(_x) {
1949
- return _getAllDrugs.apply(this, arguments);
1950
- }
1951
-
1952
- return getAllDrugs;
1953
- }();
1954
-
1955
- return DiagnosisService;
1956
- }();
1957
-
1958
- var GuardService = /*#__PURE__*/function () {
1959
- function GuardService(api, baseURL) {
1960
- this.api = api;
1961
- this.baseURL = baseURL;
1962
- this.api.setAuthRefreshFn(this.authRefresh.bind(this));
1963
- this.identityCache = {};
1964
- this.whoAmICache = {};
1965
- }
1966
- /**
1967
- * Will replace access and refresh tokens with `tokens`
1968
- *
1969
- * Note:
1970
- * ```typescript
1971
- * setTokens({accessToken: undefined, refreshToken: 'aTokenValue'}) // will erase accessToken and set refreshToken with 'aTokenValue'
1972
- * setTokens({refreshToken: 'aTokenValue'}) // will keep actual value of accessToken and set refreshToken with 'aTokenValue'
1973
- *
1974
- * ```
1975
- * @param tokens
1976
- */
1977
-
1978
-
1979
- var _proto = GuardService.prototype;
1980
-
1981
- _proto.setTokens = function setTokens(tokens) {
1982
- this.api.setTokens(_extends({}, this.api.getTokens(), tokens));
1983
- }
1984
- /**
1985
- * Allow to retrieve an access token and a refresh token in order
1986
- * to do authenticated request afterward
1987
- *
1988
- * @param req The credentials required to get an access token
1989
- * @returns AuthTokenResponse
1990
- */
1991
- ;
1992
-
1993
- _proto.authToken =
1994
- /*#__PURE__*/
1995
- function () {
1996
- var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(req) {
1997
- var resp, config, _e$response, code;
1998
-
1999
- return runtime_1.wrap(function _callee$(_context) {
2000
- while (1) {
2001
- switch (_context.prev = _context.next) {
2002
- case 0:
2003
- _context.prev = 0;
2004
- config = {
2005
- skipAuthRefresh: true
2006
- };
2007
- _context.next = 4;
2008
- return this.api.post(this.baseURL + "/v1/auth/token", req, config);
2009
-
2010
- case 4:
2011
- resp = _context.sent;
2012
- this.api.setTokens({
2013
- accessToken: resp.accessToken,
2014
- refreshToken: resp.refreshToken
2015
- });
2016
- _context.next = 19;
2017
- break;
2018
-
2019
- case 8:
2020
- _context.prev = 8;
2021
- _context.t0 = _context["catch"](0);
2022
-
2023
- if (!_context.t0.isAxiosError) {
2024
- _context.next = 18;
2025
- break;
2026
- }
2027
-
2028
- code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
2029
- _context.t1 = code;
2030
- _context.next = _context.t1 === 400 ? 15 : _context.t1 === 500 ? 16 : _context.t1 === 401 ? 17 : 17;
2031
- break;
2032
-
2033
- case 15:
2034
- throw new AuthenticationBadRequest();
2035
-
2036
- case 16:
2037
- throw new AuthenticationServerError();
2038
-
2039
- case 17:
2040
- throw new AuthenticationFailed();
2041
-
2042
- case 18:
2043
- throw new AuthenticationFailed();
2044
-
2045
- case 19:
2046
- return _context.abrupt("return", resp);
2047
-
2048
- case 20:
2049
- case "end":
2050
- return _context.stop();
2051
- }
2052
- }
2053
- }, _callee, this, [[0, 8]]);
2054
- }));
2055
-
2056
- function authToken(_x) {
2057
- return _authToken.apply(this, arguments);
2058
- }
2059
-
2060
- return authToken;
2061
- }()
2062
- /**
2063
- * Get new access and refresh token
2064
- *
2065
- * @returns AuthTokenResponse
2066
- */
2067
- ;
2068
-
2069
- _proto.authRefresh =
2070
- /*#__PURE__*/
2071
- function () {
2072
- var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(refreshToken) {
2073
- var config;
2074
- return runtime_1.wrap(function _callee2$(_context2) {
2075
- while (1) {
2076
- switch (_context2.prev = _context2.next) {
2077
- case 0:
2078
- config = {
2079
- skipAuthRefresh: true,
2080
- useRefreshToken: true
2081
- };
2082
- return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
2083
-
2084
- case 2:
2085
- case "end":
2086
- return _context2.stop();
2087
- }
2088
- }
2089
- }, _callee2, this);
2090
- }));
2091
-
2092
- function authRefresh(_x2) {
2093
- return _authRefresh.apply(this, arguments);
2094
- }
2095
-
2096
- return authRefresh;
2097
- }()
2098
- /**
2099
- * Call guard to overwrite existing refresh token cookie
2100
- *
2101
- * @returns void
2102
- */
2103
- ;
2104
-
2105
- _proto.authLogout =
2106
- /*#__PURE__*/
2107
- function () {
2108
- var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
2109
- return runtime_1.wrap(function _callee3$(_context3) {
2110
- while (1) {
2111
- switch (_context3.prev = _context3.next) {
2112
- case 0:
2113
- return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
2114
-
2115
- case 1:
2116
- case "end":
2117
- return _context3.stop();
2118
- }
2119
- }
2120
- }, _callee3, this);
2121
- }));
2122
-
2123
- function authLogout() {
2124
- return _authLogout.apply(this, arguments);
2125
- }
2126
-
2127
- return authLogout;
2128
- }()
2129
- /**
2130
- * Call guard to attempt account recovery
2131
- *
2132
- * @param req The email address / practice of the account to recover
2133
- * @returns void
2134
- */
2135
- ;
2136
-
2137
- _proto.authRecover =
2138
- /*#__PURE__*/
2139
- function () {
2140
- var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(req) {
2141
- return runtime_1.wrap(function _callee4$(_context4) {
2142
- while (1) {
2143
- switch (_context4.prev = _context4.next) {
2144
- case 0:
2145
- return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
2146
-
2147
- case 1:
2148
- case "end":
2149
- return _context4.stop();
2150
- }
2151
- }
2152
- }, _callee4, this);
2153
- }));
2154
-
2155
- function authRecover(_x3) {
2156
- return _authRecover.apply(this, arguments);
2157
- }
2158
-
2159
- return authRecover;
2160
- }()
2161
- /**
2162
- * Allow to create a new identity. The identity will then need to be confirmed
2163
- * via an email link
2164
- *
2165
- * @param req the information about the new identity to create
2166
- * @returns IdentityResponse
2167
- */
2168
- ;
2169
-
2170
- _proto.identityCreate =
2171
- /*#__PURE__*/
2172
- function () {
2173
- var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(req) {
2174
- var resp, _e$response2, code;
2175
-
2176
- return runtime_1.wrap(function _callee5$(_context5) {
2177
- while (1) {
2178
- switch (_context5.prev = _context5.next) {
2179
- case 0:
2180
- _context5.prev = 0;
2181
- _context5.next = 3;
2182
- return this.api.post(this.baseURL + "/v1/identities", req);
2183
-
2184
- case 3:
2185
- resp = _context5.sent;
2186
- this.api.setTokens({
2187
- refreshToken: resp.refreshToken
2188
- });
2189
- _context5.next = 18;
2190
- break;
2191
-
2192
- case 7:
2193
- _context5.prev = 7;
2194
- _context5.t0 = _context5["catch"](0);
2195
-
2196
- if (!_context5.t0.isAxiosError) {
2197
- _context5.next = 17;
2198
- break;
2199
- }
2200
-
2201
- code = (_e$response2 = _context5.t0.response) == null ? void 0 : _e$response2.status;
2202
- _context5.t1 = code;
2203
- _context5.next = _context5.t1 === 400 ? 14 : _context5.t1 === 409 ? 15 : _context5.t1 === 500 ? 16 : 16;
2204
- break;
2205
-
2206
- case 14:
2207
- throw new IdentityCreationBadRequest();
2208
-
2209
- case 15:
2210
- throw new IdentityCreationConflict();
2211
-
2212
- case 16:
2213
- throw new IdentityCreationFailed();
2214
-
2215
- case 17:
2216
- throw new IdentityCreationFailed();
2217
-
2218
- case 18:
2219
- return _context5.abrupt("return", resp);
2220
-
2221
- case 19:
2222
- case "end":
2223
- return _context5.stop();
2224
- }
2225
- }
2226
- }, _callee5, this, [[0, 7]]);
2227
- }));
2228
-
2229
- function identityCreate(_x4) {
2230
- return _identityCreate.apply(this, arguments);
2231
- }
2232
-
2233
- return identityCreate;
2234
- }()
2235
- /**
2236
- * Retrieve an identity. Will return public fields only when requested
2237
- * without authentication
2238
- *
2239
- * @param identityID Unique id of the identity to retrieve
2240
- * @returns IdentityResponse
2241
- */
2242
- ;
2243
-
2244
- _proto.identityGet =
2245
- /*#__PURE__*/
2246
- function () {
2247
- var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(identityID) {
2248
- var _tokens$accessToken, _tokens$refreshToken;
2249
-
2250
- var tokens, cacheKey;
2251
- return runtime_1.wrap(function _callee6$(_context6) {
2252
- while (1) {
2253
- switch (_context6.prev = _context6.next) {
2254
- case 0:
2255
- tokens = this.api.getTokens();
2256
- cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
2257
-
2258
- if (!(!tokens.accessToken || !this.identityCache[cacheKey])) {
2259
- _context6.next = 6;
2260
- break;
2261
- }
2262
-
2263
- _context6.next = 5;
2264
- return this.api.get(this.baseURL + "/v1/identities/" + identityID);
2265
-
2266
- case 5:
2267
- this.identityCache[cacheKey] = _context6.sent;
2268
-
2269
- case 6:
2270
- return _context6.abrupt("return", this.identityCache[cacheKey]);
2271
-
2272
- case 7:
2273
- case "end":
2274
- return _context6.stop();
2275
- }
2276
- }
2277
- }, _callee6, this);
2278
- }));
2279
-
2280
- function identityGet(_x5) {
2281
- return _identityGet.apply(this, arguments);
2282
- }
2283
-
2284
- return identityGet;
2285
- }()
2286
- /**
2287
- * Get information about the current authenticated user
2288
- *
2289
- * @param refreshCache if true it will refresh the whoAmI cache (default: false)
2290
- * @returns WhoAmIResponse
2291
- */
2292
- ;
2293
-
2294
- _proto.whoAmI =
2295
- /*#__PURE__*/
2296
- function () {
2297
- var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(refreshCache) {
2298
- var _this$api$getTokens$a;
2299
-
2300
- var cacheKey;
2301
- return runtime_1.wrap(function _callee7$(_context7) {
2302
- while (1) {
2303
- switch (_context7.prev = _context7.next) {
2304
- case 0:
2305
- if (refreshCache === void 0) {
2306
- refreshCache = false;
2307
- }
2308
-
2309
- cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
2310
-
2311
- if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
2312
- _context7.next = 6;
2313
- break;
2314
- }
2315
-
2316
- _context7.next = 5;
2317
- return this.api.get(this.baseURL + "/v1/auth/whoami");
2318
-
2319
- case 5:
2320
- this.whoAmICache[cacheKey] = _context7.sent;
2321
-
2322
- case 6:
2323
- return _context7.abrupt("return", this.whoAmICache[cacheKey]);
2324
-
2325
- case 7:
2326
- case "end":
2327
- return _context7.stop();
2328
- }
2329
- }
2330
- }, _callee7, this);
2331
- }));
2332
-
2333
- function whoAmI(_x6) {
2334
- return _whoAmI.apply(this, arguments);
2335
- }
2336
-
2337
- return whoAmI;
2338
- }()
2339
- /**
2340
- * Update an existing identity
2341
- *
2342
- * @param identityID unique id of identity to update
2343
- * @param req update request
2344
- * @returns IdentityResponse
2345
- */
2346
- ;
2347
-
2348
- _proto.identityUpdate =
2349
- /*#__PURE__*/
2350
- function () {
2351
- var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(identityID, req) {
2352
- return runtime_1.wrap(function _callee8$(_context8) {
2353
- while (1) {
2354
- switch (_context8.prev = _context8.next) {
2355
- case 0:
2356
- return _context8.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
2357
-
2358
- case 1:
2359
- case "end":
2360
- return _context8.stop();
2361
- }
2362
- }
2363
- }, _callee8, this);
2364
- }));
2365
-
2366
- function identityUpdate(_x7, _x8) {
2367
- return _identityUpdate.apply(this, arguments);
2368
- }
2369
-
2370
- return identityUpdate;
2371
- }()
2372
- /**
2373
- * Return base64 data representing a QR code that the
2374
- * current identity need in order to use MFA
2375
- *
2376
- * @param identityID unique id of the identity
2377
- * @param password the identity password (already hashed and in base64)
2378
- * @returns QRCodeResponse
2379
- */
2380
- ;
2381
-
2382
- _proto.identityMFAQRCode =
2383
- /*#__PURE__*/
2384
- function () {
2385
- var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(identityID, password) {
2386
- var req;
2387
- return runtime_1.wrap(function _callee9$(_context9) {
2388
- while (1) {
2389
- switch (_context9.prev = _context9.next) {
2390
- case 0:
2391
- req = {
2392
- password: password
2393
- };
2394
- return _context9.abrupt("return", this.api.post(this.baseURL + "/v1/identities/" + identityID + "/mfa", req, {
2395
- headers: {
2396
- 'Accept': 'application/json'
2397
- }
2398
- }));
2399
-
2400
- case 2:
2401
- case "end":
2402
- return _context9.stop();
2403
- }
2404
- }
2405
- }, _callee9, this);
2406
- }));
2407
-
2408
- function identityMFAQRCode(_x9, _x10) {
2409
- return _identityMFAQRCode.apply(this, arguments);
2410
- }
2411
-
2412
- return identityMFAQRCode;
2413
- }();
2414
-
2415
- return GuardService;
2416
- }();
2417
-
2418
- var PracticeService = /*#__PURE__*/function () {
2419
- function PracticeService(toolbox, api, baseURL) {
2420
- this.toolbox = toolbox;
2421
- this.api = api;
2422
- this.baseURL = baseURL;
2423
- }
2424
- /**
2425
- * This function get the practice from the URL of a practice
2426
- * It is the entry point of our web apps
2427
- * @param practiceURL URL of the practice to search
2428
- * @param hydratePracticeConfigs (optional) if set true it the Practice field configs will be set
2429
- * @param accounts (optional) if set true it the Practice field accounts will be set
2430
- * @returns the found practice or undefined
2431
- */
2432
-
2433
-
2434
- var _proto = PracticeService.prototype;
2435
-
2436
- _proto.practiceGetFromURL = function practiceGetFromURL(practiceURL, params) {
2437
- return this.api.get(this.baseURL + "/v1/practices", {
2438
- params: _extends({
2439
- url_practice: practiceURL
2440
- }, params)
2441
- });
2442
- };
2443
-
2444
- _proto.practiceGetFromUuid = function practiceGetFromUuid(practiceUuid, locale, withAccounts) {
2445
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid, {
2446
- params: {
2447
- locale: locale,
2448
- accounts: withAccounts
2449
- }
2450
- });
2451
- } /// Practice Configs
2452
-
2453
- /**
2454
- * This function retrieves all configs of a specific practice
2455
- * @param practiceUuid uuid of the practice
2456
- * @returns the practice configs
2457
- */
2458
- ;
2459
-
2460
- _proto.practiceConfigGetFromPracticeUuid = function practiceConfigGetFromPracticeUuid(practiceUuid) {
2461
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs");
2462
- }
2463
- /**
2464
- * This function retrieves a specific config of a practice
2465
- * @param practiceUuid uuid of the practice
2466
- * @param kind of the config
2467
- * @returns the practice config
2468
- */
2469
- ;
2470
-
2471
- _proto.practiceConfigGetByKindForPracticeUuid = function practiceConfigGetByKindForPracticeUuid(practiceUuid, kind) {
2472
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs/" + kind);
2473
- }
2474
- /**
2475
- * This function creates a config for a specific practice
2476
- * @param practiceUuid uuid of the practice
2477
- * @param config the config to add to the practice
2478
- * @returns the created practice config
2479
- */
2480
- ;
2481
-
2482
- _proto.practiceConfigCreateForPracticeUuid = function practiceConfigCreateForPracticeUuid(practiceUuid, config) {
2483
- return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/configs", config);
2484
- }
2485
- /**
2486
- * This function updates a specific config of a practice
2487
- * @param practiceUuid uuid of the practice
2488
- * @param config the config to update
2489
- * @returns the practice config
2490
- */
2491
- ;
2492
-
2493
- _proto.practiceConfigUpdate = function practiceConfigUpdate(config) {
2494
- return this.api.put(this.baseURL + "/v1/practices/" + config.uuidPractice + "/configs/" + config.kind, config);
2495
- } /// Accounts
2496
- ;
2497
-
2498
- _proto.practiceGetAccounts = function practiceGetAccounts(practiceUuid) {
2499
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts");
2500
- };
2501
-
2502
- _proto.practiceGetAccount = function practiceGetAccount(practiceUuid, accountUuid) {
2503
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts/" + accountUuid);
2504
- } /// Workflows
2505
- ;
2506
-
2507
- _proto.practiceGetWorkflows = function practiceGetWorkflows(practiceUuid) {
2508
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows");
2509
- };
2510
-
2511
- _proto.practiceGetWorkflow = function practiceGetWorkflow(practiceUuid, workflowType) {
2512
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows/" + workflowType);
2513
- } /// Plans
2514
- ;
2515
-
2516
- _proto.practiceGetPlans = function practiceGetPlans(practiceUuid, planType) {
2517
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans", {
2518
- params: {
2519
- kind: planType
2520
- }
2521
- });
2522
- };
2523
-
2524
- _proto.practiceGetPlan = function practiceGetPlan(practiceUuid, planId) {
2525
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId);
2526
- };
2527
-
2528
- _proto.practiceGetPlanPrices = function practiceGetPlanPrices(practiceUuid, planId) {
2529
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId + "/prices");
2530
- } // Payments
2531
- ;
2532
-
2533
- _proto.practiceGetPayments = function practiceGetPayments(practiceUuid, planType) {
2534
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments", {
2535
- params: {
2536
- kind: planType
2537
- }
2538
- });
2539
- };
2540
-
2541
- _proto.practiceGetPayment = function practiceGetPayment(practiceUuid, idStripeInvoiceOrPaymentIntent) {
2542
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + idStripeInvoiceOrPaymentIntent);
2543
- };
2544
-
2545
- _proto.practiceGetPaymentForStripePaymentIntentWithID = function practiceGetPaymentForStripePaymentIntentWithID(practiceUuid, stripePaymentIntentId) {
2546
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + stripePaymentIntentId);
2547
- } // Payments Intent
2548
- ;
2549
-
2550
- _proto.practiceGetPaymentsIntents = function practiceGetPaymentsIntents(practiceUuid, planType) {
2551
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents", {
2552
- params: {
2553
- kind: planType
2554
- }
2555
- });
2556
- }
2557
- /**
2558
- * This function return the user hased email to be use for creating payment intent
2559
- * @param email the email to hash
2560
- * @returns a hashed email
2561
- */
2562
- ;
2563
-
2564
- _proto.getPaymentIntentHashedEmail = function getPaymentIntentHashedEmail(email) {
2565
- return this.toolbox.hashStringToBase64(email.toLowerCase());
2566
- };
2567
-
2568
- _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, promotionCode) {
2569
- return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/", {
2570
- idPlan: planId,
2571
- hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,
2572
- isoLocality: isoLocality
2573
- }, {
2574
- params: {
2575
- url_subdomain: url_subdomain,
2576
- promotionCode: promotionCode
2577
- }
2578
- });
2579
- };
2580
-
2581
- _proto.practiceGetPaymentsIntent = function practiceGetPaymentsIntent(practiceUuid, paymentIntentId) {
2582
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + paymentIntentId);
2583
- };
2584
-
2585
- _proto.practiceUpdatePaymentsIntent = function practiceUpdatePaymentsIntent(practiceUuid, idPraticePaymentIntent, practicePaymentIntent, userEmail, promotionCode) {
2586
- return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + idPraticePaymentIntent, _extends({}, practicePaymentIntent, {
2587
- hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined
2588
- }), {
2589
- params: {
2590
- promotionCode: promotionCode
2591
- }
2592
- });
2593
- } // Practitioner
2594
- ;
2595
-
2596
- _proto.practiceGetPractitioners = function practiceGetPractitioners(practiceUuid) {
2597
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners");
2598
- };
2599
-
2600
- _proto.practiceUpdatePractitioner = function practiceUpdatePractitioner(practiceUuid, practitionerUuid, requestBody) {
2601
- return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid, requestBody);
2602
- };
2603
-
2604
- _proto.practiceGetPractitioner = function practiceGetPractitioner(practiceUuid, practitionerUuid) {
2605
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid);
2606
- } // Practitioner Licenses
2607
- ;
2608
-
2609
- _proto.practiceGetPractitionerLicenses = function practiceGetPractitionerLicenses(practiceUuid, practitionerUuid) {
2610
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses");
2611
- };
2612
-
2613
- _proto.practiceCreatePractitionerLicense = function practiceCreatePractitionerLicense(practiceUuid, practitionerUuid, requestBody) {
2614
- return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses", requestBody);
2615
- };
2616
-
2617
- _proto.practiceUpdatePractitionerLicense = function practiceUpdatePractitionerLicense(practiceUuid, practitionerUuid, licenseId, requestBody) {
2618
- return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId, requestBody);
2619
- };
2620
-
2621
- _proto.practiceGetPractitionerLicense = function practiceGetPractitionerLicense(practiceUuid, practitionerUuid, licenseId) {
2622
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId);
2623
- } // Practitioner Preferences
2624
- ;
2625
-
2626
- _proto.practiceGetPractitionerPreferences = function practiceGetPractitionerPreferences(practiceUuid, practitionerUuid) {
2627
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences");
2628
- };
2629
-
2630
- _proto.practiceCreatePractitionerPreference = function practiceCreatePractitionerPreference(practiceUuid, practitionerUuid, requestBody) {
2631
- return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences", requestBody);
2632
- };
2633
-
2634
- _proto.practiceUpdatePractitionerPreference = function practiceUpdatePractitionerPreference(practiceUuid, practitionerUuid, preferenceId, requestBody) {
2635
- return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId, requestBody);
2636
- };
2637
-
2638
- _proto.practiceGetPractitionerPreference = function practiceGetPractitionerPreference(practiceUuid, practitionerUuid, preferenceId) {
2639
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId);
2640
- } // Practitioner Roles
2641
- ;
2642
-
2643
- _proto.practiceGetPractitionerRoles = function practiceGetPractitionerRoles(practiceUuid, practitionerUuid) {
2644
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2645
- };
2646
-
2647
- _proto.practiceCreatePractitionerRole = function practiceCreatePractitionerRole(practiceUuid, practitionerUuid, requestBody) {
2648
- return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles", requestBody);
2649
- };
2650
-
2651
- _proto.practiceDeletePractitionerRoles = function practiceDeletePractitionerRoles(practiceUuid, practitionerUuid) {
2652
- return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2653
- };
2654
-
2655
- _proto.practiceUpdatePractitionerRole = function practiceUpdatePractitionerRole(practiceUuid, practitionerUuid, roleId, requestBody) {
2656
- return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId, requestBody);
2657
- };
2658
-
2659
- _proto.practiceGetPractitionerRole = function practiceGetPractitionerRole(practiceUuid, practitionerUuid, roleId) {
2660
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2661
- };
2662
-
2663
- _proto.practiceDeletePractitionerRole = function practiceDeletePractitionerRole(practiceUuid, practitionerUuid, roleId) {
2664
- return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2665
- } // Practitioner signature
2666
-
2667
- /**
2668
- * This function returns the practitioner's signature as a Blob
2669
- * @param practiceUuid the practice uuid of the practitioner
2670
- * @param practitionerUuid the practitioner uuid
2671
- * @returns a blob representing the signature
2672
- */
2673
- ;
2674
-
2675
- _proto.practiceGetPractitionerSignature = function practiceGetPractitionerSignature(practiceUuid, practitionerUuid) {
2676
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/signature", {
2677
- responseType: 'blob'
2678
- });
2679
- } // Assignments
2680
- ;
2681
-
2682
- _proto.practiceGetAssignments = function practiceGetAssignments(practiceUuid) {
2683
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments");
2684
- };
2685
-
2686
- _proto.practiceCreateAssignment = function practiceCreateAssignment(practiceUuid, requestBody) {
2687
- return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments", requestBody);
2688
- };
2689
-
2690
- _proto.practiceUpdateAssignment = function practiceUpdateAssignment(practiceUuid, assignmentId, requestBody) {
2691
- return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId, requestBody);
2692
- };
2693
-
2694
- _proto.practiceGetAssignment = function practiceGetAssignment(practiceUuid, assignmentId) {
2695
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId);
2696
- } // Quotas
2697
- ;
2698
-
2699
- _proto.practiceGetQuotas = function practiceGetQuotas(practiceUuid) {
2700
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas");
2701
- };
2702
-
2703
- _proto.practiceGetQuota = function practiceGetQuota(practiceUuid, quotaId) {
2704
- return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas/" + quotaId);
2705
- };
2706
-
2707
- return PracticeService;
2708
- }();
2709
-
2710
- var TellerService = /*#__PURE__*/function () {
2711
- function TellerService(api, baseURL) {
2712
- this.api = api;
2713
- this.baseURL = baseURL;
2714
- }
2715
-
2716
- var _proto = TellerService.prototype;
2717
-
2718
- _proto.lockboxDataStore = /*#__PURE__*/function () {
2719
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
2720
- return runtime_1.wrap(function _callee$(_context) {
2721
- while (1) {
2722
- switch (_context.prev = _context.next) {
2723
- case 0:
2724
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2725
- params: {
2726
- lockbox_owner_uuid: lockboxOwnerUuid,
2727
- data_uuid: previousDataUuid
2728
- }
2729
- }));
2730
-
2731
- case 1:
2732
- case "end":
2733
- return _context.stop();
2734
- }
2735
- }
2736
- }, _callee, this);
2737
- }));
2738
-
2739
- function lockboxDataStore(_x, _x2, _x3, _x4) {
2740
- return _lockboxDataStore.apply(this, arguments);
2741
- }
2742
-
2743
- return lockboxDataStore;
2744
- }();
2745
-
2746
- _proto.updateConsultByUUID = function updateConsultByUUID(patientUuid, uuidConsult, statusMedical, neverExpires) {
2747
- return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, {
2748
- patientUuid: patientUuid,
2749
- statusMedical: statusMedical,
2750
- neverExpires: neverExpires
2751
- });
2752
- };
2753
-
2754
- return TellerService;
2755
- }();
2756
-
2757
- var VaultService = /*#__PURE__*/function () {
2758
- function VaultService(api, baseURL) {
2759
- this.api = api;
2760
- this.baseURL = baseURL;
2761
- }
2762
-
2763
- var _proto = VaultService.prototype;
2764
-
2765
- _proto.lockboxCreate = /*#__PURE__*/function () {
2766
- var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxMetadata) {
2767
- return runtime_1.wrap(function _callee$(_context) {
2768
- while (1) {
2769
- switch (_context.prev = _context.next) {
2770
- case 0:
2771
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
2772
-
2773
- case 1:
2774
- case "end":
2775
- return _context.stop();
2776
- }
2777
- }
2778
- }, _callee, this);
2779
- }));
2780
-
2781
- function lockboxCreate(_x) {
2782
- return _lockboxCreate.apply(this, arguments);
2783
- }
2784
-
2785
- return lockboxCreate;
2786
- }();
2787
-
2788
- _proto.lockboxMetadataAdd = /*#__PURE__*/function () {
2789
- var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
2790
- return runtime_1.wrap(function _callee2$(_context2) {
2791
- while (1) {
2792
- switch (_context2.prev = _context2.next) {
2793
- case 0:
2794
- return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/lockbox/" + lockboxUuid, lockboxMetadata, {
2795
- params: {
2796
- lockbox_owner_uuid: lockboxOwnerUuid
2797
- }
2798
- }));
2799
-
2800
- case 1:
2801
- case "end":
2802
- return _context2.stop();
2803
- }
2804
- }
2805
- }, _callee2, this);
2806
- }));
2807
-
2808
- function lockboxMetadataAdd(_x2, _x3, _x4) {
2809
- return _lockboxMetadataAdd.apply(this, arguments);
2810
- }
2811
-
2812
- return lockboxMetadataAdd;
2813
- }();
2814
-
2815
- _proto.lockboxSecretGet = /*#__PURE__*/function () {
2816
- var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
2817
- return runtime_1.wrap(function _callee3$(_context3) {
2818
- while (1) {
2819
- switch (_context3.prev = _context3.next) {
2820
- case 0:
2821
- return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/secret", {
2822
- params: {
2823
- lockbox_owner_uuid: lockboxOwnerUuid
2824
- }
2825
- }));
2826
-
2827
- case 1:
2828
- case "end":
2829
- return _context3.stop();
2830
- }
2831
- }
2832
- }, _callee3, this);
2833
- }));
2834
-
2835
- function lockboxSecretGet(_x5, _x6) {
2836
- return _lockboxSecretGet.apply(this, arguments);
2837
- }
2838
-
2839
- return lockboxSecretGet;
2840
- }();
2841
-
2842
- _proto.lockboxGrant = /*#__PURE__*/function () {
2843
- var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
2844
- return runtime_1.wrap(function _callee4$(_context4) {
2845
- while (1) {
2846
- switch (_context4.prev = _context4.next) {
2847
- case 0:
2848
- return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/grant", req, {
2849
- params: {
2850
- lockbox_owner_uuid: lockboxOwnerUuid
2851
- }
2852
- }));
2853
-
2854
- case 1:
2855
- case "end":
2856
- return _context4.stop();
2857
- }
2858
- }
2859
- }, _callee4, this);
2860
- }));
2861
-
2862
- function lockboxGrant(_x7, _x8, _x9) {
2863
- return _lockboxGrant.apply(this, arguments);
2864
- }
2865
-
2866
- return lockboxGrant;
2867
- }()
2868
- /**
2869
- * Get all lockboxes granted to user
2870
- * @param filter filter of lockbox metadata
2871
- * @returns decrypted lockboxes granted to user
2872
- */
2873
- ;
2874
-
2875
- _proto.grantsGet =
2876
- /*#__PURE__*/
2877
- function () {
2878
- var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
2879
- return runtime_1.wrap(function _callee5$(_context5) {
2880
- while (1) {
2881
- switch (_context5.prev = _context5.next) {
2882
- case 0:
2883
- return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
2884
-
2885
- case 1:
2886
- case "end":
2887
- return _context5.stop();
2888
- }
2889
- }
2890
- }, _callee5, this);
2891
- }));
2892
-
2893
- function grantsGet() {
2894
- return _grantsGet.apply(this, arguments);
2895
- }
2896
-
2897
- return grantsGet;
2898
- }()
2899
- /**
2900
- * This function create or update a data into the vault.
2901
- * @note At creation it is necessary to have all `req` filled
2902
- * @note When setting `previousDataUuid` you are updating the data. `req` metadata fields are optional.
2903
- * @param lockboxUuid The lockbox uuid the data will be stored in
2904
- * @param req The request (please see notes)
2905
- * @param lockboxOwnerUuid The uuid of the owner of the lockbox (@deprecated)
2906
- * @param previousDataUuid The data uuid of the data you want to update
2907
- * @returns
2908
- */
2909
- ;
2910
-
2911
- _proto.lockboxDataStore =
2912
- /*#__PURE__*/
2913
- function () {
2914
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
2915
- return runtime_1.wrap(function _callee6$(_context6) {
2916
- while (1) {
2917
- switch (_context6.prev = _context6.next) {
2918
- case 0:
2919
- return _context6.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2920
- params: {
2921
- lockbox_owner_uuid: lockboxOwnerUuid,
2922
- data_uuid: previousDataUuid
2923
- }
2924
- }));
2925
-
2926
- case 1:
2927
- case "end":
2928
- return _context6.stop();
2929
- }
2930
- }
2931
- }, _callee6, this);
2932
- }));
2933
-
2934
- function lockboxDataStore(_x10, _x11, _x12, _x13) {
2935
- return _lockboxDataStore.apply(this, arguments);
2936
- }
2937
-
2938
- return lockboxDataStore;
2939
- }();
2940
-
2941
- _proto.lockboxDataGet = /*#__PURE__*/function () {
2942
- var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
2943
- var data;
2944
- return runtime_1.wrap(function _callee7$(_context7) {
2945
- while (1) {
2946
- switch (_context7.prev = _context7.next) {
2947
- case 0:
2948
- if (stream === void 0) {
2949
- stream = true;
2950
- }
2951
-
2952
- _context7.next = 3;
2953
- return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
2954
- params: {
2955
- lockbox_owner_uuid: lockboxOwnerUuid,
2956
- stream: stream
2957
- }
2958
- });
2959
-
2960
- case 3:
2961
- data = _context7.sent;
2962
-
2963
- if (!stream) {
2964
- _context7.next = 6;
2965
- break;
2966
- }
2967
-
2968
- return _context7.abrupt("return", {
2969
- data: data
2970
- });
2971
-
2972
- case 6:
2973
- return _context7.abrupt("return", data);
2974
-
2975
- case 7:
2976
- case "end":
2977
- return _context7.stop();
2978
- }
2979
- }
2980
- }, _callee7, this);
2981
- }));
2982
-
2983
- function lockboxDataGet(_x14, _x15, _x16, _x17) {
2984
- return _lockboxDataGet.apply(this, arguments);
2985
- }
2986
-
2987
- return lockboxDataGet;
2988
- }();
2989
-
2990
- _proto.lockboxManifestGet = /*#__PURE__*/function () {
2991
- var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
2992
- return runtime_1.wrap(function _callee8$(_context8) {
2993
- while (1) {
2994
- switch (_context8.prev = _context8.next) {
2995
- case 0:
2996
- return _context8.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid, {
2997
- params: {
2998
- lockbox_owner_uuid: lockboxOwnerUuid,
2999
- filter: filter
3000
- }
3001
- }));
3002
-
3003
- case 1:
3004
- case "end":
3005
- return _context8.stop();
3006
- }
3007
- }
3008
- }, _callee8, this);
3009
- }));
3010
-
3011
- function lockboxManifestGet(_x18, _x19, _x20) {
3012
- return _lockboxManifestGet.apply(this, arguments);
3013
- }
3014
-
3015
- return lockboxManifestGet;
3016
- }();
3017
-
3018
- _proto.lockboxMetadataGet = /*#__PURE__*/function () {
3019
- var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
3020
- return runtime_1.wrap(function _callee9$(_context9) {
3021
- while (1) {
3022
- switch (_context9.prev = _context9.next) {
3023
- case 0:
3024
- return _context9.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/metadata", {
3025
- params: {
3026
- lockbox_owner_uuid: lockboxOwnerUuid,
3027
- fields: fields,
3028
- groupby: groupby,
3029
- filter: filter
3030
- }
3031
- }));
3032
-
3033
- case 1:
3034
- case "end":
3035
- return _context9.stop();
3036
- }
3037
- }
3038
- }, _callee9, this);
3039
- }));
3040
-
3041
- function lockboxMetadataGet(_x21, _x22, _x23, _x24, _x25) {
3042
- return _lockboxMetadataGet.apply(this, arguments);
3043
- }
3044
-
3045
- return lockboxMetadataGet;
3046
- }()
3047
- /**
3048
- * inserts or updates encrypted index entries
3049
- * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
3050
- * @note if a uuid for an entry is provided, the service will perform an update
3051
- * @param entries the encrypted index data
3052
- * @param indexOwnerUuid
3053
- */
3054
- ;
3055
-
3056
- _proto.vaultIndexPut =
3057
- /*#__PURE__*/
3058
- function () {
3059
- var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(entries, indexOwnerUuid) {
3060
- return runtime_1.wrap(function _callee10$(_context10) {
3061
- while (1) {
3062
- switch (_context10.prev = _context10.next) {
3063
- case 0:
3064
- return _context10.abrupt("return", this.api.put(this.baseURL + "/v1/index", entries, {
3065
- params: {
3066
- index_owner_uuid: indexOwnerUuid
3067
- }
3068
- }));
3069
-
3070
- case 1:
3071
- case "end":
3072
- return _context10.stop();
3073
- }
3074
- }
3075
- }, _callee10, this);
3076
- }));
3077
-
3078
- function vaultIndexPut(_x26, _x27) {
3079
- return _vaultIndexPut.apply(this, arguments);
3080
- }
3081
-
3082
- return vaultIndexPut;
3083
- }()
3084
- /**
3085
- * inserts or updates index snapshot for the provided index owner
3086
- * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
3087
- * @param entry the encrypted index snapshot
3088
- */
3089
- ;
3090
-
3091
- _proto.vaultIndexSnapshotPut =
3092
- /*#__PURE__*/
3093
- function () {
3094
- var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(entry) {
3095
- return runtime_1.wrap(function _callee11$(_context11) {
3096
- while (1) {
3097
- switch (_context11.prev = _context11.next) {
3098
- case 0:
3099
- return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
3100
-
3101
- case 1:
3102
- case "end":
3103
- return _context11.stop();
3104
- }
3105
- }
3106
- }, _callee11, this);
3107
- }));
3108
-
3109
- function vaultIndexSnapshotPut(_x28) {
3110
- return _vaultIndexSnapshotPut.apply(this, arguments);
3111
- }
3112
-
3113
- return vaultIndexSnapshotPut;
3114
- }()
3115
- /**
3116
- * Retrieves the encrypted index from the vault for the requesting user
3117
- * @note index keys can be specified to narrow the scope of index being requested
3118
- * @param indexKeys accepted index fields determined by vault
3119
- * @param identifiers: an array of unique_hashes or consultation uuids used to identify an index entry
3120
- * @param timestamp the minimum timestamp that index entries were created
3121
- * @returns the encrypted index
3122
- */
3123
- ;
3124
-
3125
- _proto.vaultIndexGet =
3126
- /*#__PURE__*/
3127
- function () {
3128
- var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(indexKeys, identifiers, timestamp) {
3129
- return runtime_1.wrap(function _callee12$(_context12) {
3130
- while (1) {
3131
- switch (_context12.prev = _context12.next) {
3132
- case 0:
3133
- return _context12.abrupt("return", this.api.get(this.baseURL + "/v1/index", {
3134
- params: {
3135
- index_keys: indexKeys,
3136
- identifiers: identifiers,
3137
- timestamp: timestamp
3138
- }
3139
- }));
3140
-
3141
- case 1:
3142
- case "end":
3143
- return _context12.stop();
3144
- }
3145
- }
3146
- }, _callee12, this);
3147
- }));
3148
-
3149
- function vaultIndexGet(_x29, _x30, _x31) {
3150
- return _vaultIndexGet.apply(this, arguments);
3151
- }
3152
-
3153
- return vaultIndexGet;
3154
- }();
3155
-
3156
- return VaultService;
3157
- }();
3158
-
3159
- var WorkflowService = /*#__PURE__*/function () {
3160
- function WorkflowService(api, url) {
3161
- this.api = api;
3162
- this.v1Url = url + "/v1";
3163
- }
3164
- /**
3165
- * This function returns all workflows
3166
- * @returns desired workflow
3167
- */
3168
-
907
+ }
3169
908
 
3170
- var _proto = WorkflowService.prototype;
909
+ if (finallyEntry &&
910
+ (type === "break" ||
911
+ type === "continue") &&
912
+ finallyEntry.tryLoc <= arg &&
913
+ arg <= finallyEntry.finallyLoc) {
914
+ // Ignore the finally entry if control is not jumping to a
915
+ // location outside the try/catch block.
916
+ finallyEntry = null;
917
+ }
3171
918
 
3172
- _proto.getWorkflows = function getWorkflows() {
3173
- return this.api.get(this.v1Url + "/workflows");
3174
- }
3175
- /**
3176
- * This function retrieves a workflow. If `locale` is not found, it will try to find 'en' version of it.
3177
- * By default, will return most recent workflow of a specific `id`. `createdAt` can be used to select older version.
3178
- * @param id The uuid of the workflow
3179
- * @param locale (optional) The desired locale of the workflow (default: 'en')
3180
- * @param createdAt (optional) The creation date of the workflow (also used for versionning)
3181
- * @returns desired workflow
3182
- */
3183
- ;
919
+ var record = finallyEntry ? finallyEntry.completion : {};
920
+ record.type = type;
921
+ record.arg = arg;
3184
922
 
3185
- _proto.getWorkflow = function getWorkflow(id, locale, createdAt) {
3186
- return this.api.get(this.v1Url + "/workflows/" + id, {
3187
- params: {
3188
- locale: locale,
3189
- createdAt: createdAt
923
+ if (finallyEntry) {
924
+ this.method = "next";
925
+ this.next = finallyEntry.finallyLoc;
926
+ return ContinueSentinel;
3190
927
  }
3191
- });
3192
- };
3193
928
 
3194
- return WorkflowService;
3195
- }();
929
+ return this.complete(record);
930
+ },
3196
931
 
3197
- var _excluded = ["locale"],
3198
- _excluded2 = ["locale"];
3199
- var CliniaService = /*#__PURE__*/function () {
3200
- function CliniaService(url, apiKey, locale) {
3201
- this.url = url;
3202
- this.locale = locale;
3203
- this.api = new AxiosService({
3204
- headers: {
3205
- 'X-Clinia-API-Key': apiKey
932
+ complete: function(record, afterLoc) {
933
+ if (record.type === "throw") {
934
+ throw record.arg;
3206
935
  }
3207
- });
3208
- }
3209
936
 
3210
- var _proto = CliniaService.prototype;
937
+ if (record.type === "break" ||
938
+ record.type === "continue") {
939
+ this.next = record.arg;
940
+ } else if (record.type === "return") {
941
+ this.rval = this.arg = record.arg;
942
+ this.method = "return";
943
+ this.next = "end";
944
+ } else if (record.type === "normal" && afterLoc) {
945
+ this.next = afterLoc;
946
+ }
3211
947
 
3212
- _proto.placeSearch = function placeSearch(searchOptions) {
3213
- var locale = searchOptions.locale,
3214
- data = _objectWithoutPropertiesLoose(searchOptions, _excluded);
948
+ return ContinueSentinel;
949
+ },
3215
950
 
3216
- return this.api.post(this.url + "/search/v1/indexes/health_facility/query", data, {
3217
- params: {
3218
- locale: locale != null ? locale : this.locale
951
+ finish: function(finallyLoc) {
952
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
953
+ var entry = this.tryEntries[i];
954
+ if (entry.finallyLoc === finallyLoc) {
955
+ this.complete(entry.completion, entry.afterLoc);
956
+ resetTryEntry(entry);
957
+ return ContinueSentinel;
958
+ }
3219
959
  }
3220
- });
3221
- };
960
+ },
3222
961
 
3223
- _proto.placeMatch = function placeMatch(searchOptions, type) {
3224
- var locale = searchOptions.locale,
3225
- data = _objectWithoutPropertiesLoose(searchOptions, _excluded2);
962
+ "catch": function(tryLoc) {
963
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
964
+ var entry = this.tryEntries[i];
965
+ if (entry.tryLoc === tryLoc) {
966
+ var record = entry.completion;
967
+ if (record.type === "throw") {
968
+ var thrown = record.arg;
969
+ resetTryEntry(entry);
970
+ }
971
+ return thrown;
972
+ }
973
+ }
3226
974
 
3227
- var request = this.api.post(this.url + "/search/v1/matches", data, {
3228
- params: {
3229
- locale: locale != null ? locale : this.locale
975
+ // The context.catch method must only be called with a location
976
+ // argument that corresponds to a known catch block.
977
+ throw new Error("illegal catch attempt");
978
+ },
979
+
980
+ delegateYield: function(iterable, resultName, nextLoc) {
981
+ this.delegate = {
982
+ iterator: values(iterable),
983
+ resultName: resultName,
984
+ nextLoc: nextLoc
985
+ };
986
+
987
+ if (this.method === "next") {
988
+ // Deliberately forget the last sent value so that we don't
989
+ // accidentally pass it on to the delegate.
990
+ this.arg = undefined$1;
3230
991
  }
3231
- });
3232
992
 
3233
- if (type) {
3234
- request = request.then(function (places) {
3235
- return places.filter(function (place) {
3236
- return place.type === type;
3237
- });
3238
- });
993
+ return ContinueSentinel;
3239
994
  }
3240
-
3241
- return request;
3242
995
  };
3243
996
 
3244
- return CliniaService;
3245
- }();
997
+ // Regardless of whether this script is executing as a CommonJS module
998
+ // or not, return the runtime object so that we can declare the variable
999
+ // regeneratorRuntime in the outer scope, which allows this module to be
1000
+ // injected easily by `bin/regenerator --include-runtime script.js`.
1001
+ return exports;
1002
+
1003
+ }(
1004
+ // If this script is executing as a CommonJS module, use module.exports
1005
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
1006
+ // object. Either way, the resulting object will be used to initialize
1007
+ // the regeneratorRuntime variable at the top of this file.
1008
+ module.exports
1009
+ ));
1010
+
1011
+ try {
1012
+ regeneratorRuntime = runtime;
1013
+ } catch (accidentalStrictMode) {
1014
+ // This module should not be running in strict mode, so the above
1015
+ // assignment should always work unless something is misconfigured. Just
1016
+ // in case runtime.js accidentally runs in strict mode, in modern engines
1017
+ // we can explicitly access globalThis. In older engines we can escape
1018
+ // strict mode using a global Function call. This could conceivably fail
1019
+ // if a Content Security Policy forbids using Function, but in that case
1020
+ // the proper solution is to fix the accidental strict mode problem. If
1021
+ // you've misconfigured your bundler to force strict mode and applied a
1022
+ // CSP to forbid Function, and you're not willing to fix either of those
1023
+ // problems, please detail your unique predicament in a GitHub issue.
1024
+ if (typeof globalThis === "object") {
1025
+ globalThis.regeneratorRuntime = runtime;
1026
+ } else {
1027
+ Function("r", "regeneratorRuntime = r")(runtime);
1028
+ }
1029
+ }
1030
+ });
3246
1031
 
3247
1032
  var _personalMetaToPrefix;
3248
1033
  var personalMetaToPrefix = (_personalMetaToPrefix = {}, _personalMetaToPrefix[MetadataCategory.Personal] = 'you', _personalMetaToPrefix[MetadataCategory.ChildPersonal] = 'child', _personalMetaToPrefix[MetadataCategory.OtherPersonal] = 'other', _personalMetaToPrefix);
@@ -3394,6 +1179,61 @@ function sessionStorePrivateKeyName(id) {
3394
1179
  return sessionPrivateKeyPrefix + id;
3395
1180
  }
3396
1181
 
1182
+ var IncompleteAuthentication = /*#__PURE__*/function (_Error) {
1183
+ _inheritsLoose(IncompleteAuthentication, _Error);
1184
+
1185
+ function IncompleteAuthentication() {
1186
+ return _Error.apply(this, arguments) || this;
1187
+ }
1188
+
1189
+ return IncompleteAuthentication;
1190
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
1191
+ var MissingGrant = /*#__PURE__*/function (_Error2) {
1192
+ _inheritsLoose(MissingGrant, _Error2);
1193
+
1194
+ function MissingGrant() {
1195
+ return _Error2.apply(this, arguments) || this;
1196
+ }
1197
+
1198
+ return MissingGrant;
1199
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
1200
+ var MissingLockbox = /*#__PURE__*/function (_Error3) {
1201
+ _inheritsLoose(MissingLockbox, _Error3);
1202
+
1203
+ function MissingLockbox() {
1204
+ return _Error3.apply(this, arguments) || this;
1205
+ }
1206
+
1207
+ return MissingLockbox;
1208
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
1209
+ var MissingLockboxOwner = /*#__PURE__*/function (_Error4) {
1210
+ _inheritsLoose(MissingLockboxOwner, _Error4);
1211
+
1212
+ function MissingLockboxOwner() {
1213
+ return _Error4.apply(this, arguments) || this;
1214
+ }
1215
+
1216
+ return MissingLockboxOwner;
1217
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
1218
+ var AssociatedLockboxNotFound = /*#__PURE__*/function (_Error5) {
1219
+ _inheritsLoose(AssociatedLockboxNotFound, _Error5);
1220
+
1221
+ function AssociatedLockboxNotFound() {
1222
+ return _Error5.apply(this, arguments) || this;
1223
+ }
1224
+
1225
+ return AssociatedLockboxNotFound;
1226
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
1227
+ var WorkflowAnswersMissingError = /*#__PURE__*/function (_Error6) {
1228
+ _inheritsLoose(WorkflowAnswersMissingError, _Error6);
1229
+
1230
+ function WorkflowAnswersMissingError() {
1231
+ return _Error6.apply(this, arguments) || this;
1232
+ }
1233
+
1234
+ return WorkflowAnswersMissingError;
1235
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
1236
+
3397
1237
  function filterTriggeredAnsweredWithKind(_x, _x2) {
3398
1238
  return _filterTriggeredAnsweredWithKind.apply(this, arguments);
3399
1239
  }
@@ -4516,7 +2356,7 @@ var OroClient = /*#__PURE__*/function () {
4516
2356
  }
4517
2357
  /**
4518
2358
  * clears the vaultIndex and cached metadata grants
4519
- */
2359
+ */
4520
2360
 
4521
2361
 
4522
2362
  var _proto = OroClient.prototype;
@@ -7662,21 +5502,93 @@ var OroClient = /*#__PURE__*/function () {
7662
5502
  return OroClient;
7663
5503
  }();
7664
5504
 
5505
+ var _excluded = ["locale"],
5506
+ _excluded2 = ["locale"];
5507
+ var CliniaService = /*#__PURE__*/function () {
5508
+ function CliniaService(url, apiKey, locale) {
5509
+ this.url = url;
5510
+ this.locale = locale;
5511
+ this.api = new AxiosService({
5512
+ headers: {
5513
+ 'X-Clinia-API-Key': apiKey
5514
+ }
5515
+ });
5516
+ }
5517
+
5518
+ var _proto = CliniaService.prototype;
5519
+
5520
+ _proto.placeSearch = function placeSearch(searchOptions) {
5521
+ var locale = searchOptions.locale,
5522
+ data = _objectWithoutPropertiesLoose(searchOptions, _excluded);
5523
+
5524
+ return this.api.post(this.url + "/search/v1/indexes/health_facility/query", data, {
5525
+ params: {
5526
+ locale: locale != null ? locale : this.locale
5527
+ }
5528
+ });
5529
+ };
5530
+
5531
+ _proto.placeMatch = function placeMatch(searchOptions, type) {
5532
+ var locale = searchOptions.locale,
5533
+ data = _objectWithoutPropertiesLoose(searchOptions, _excluded2);
5534
+
5535
+ var request = this.api.post(this.url + "/search/v1/matches", data, {
5536
+ params: {
5537
+ locale: locale != null ? locale : this.locale
5538
+ }
5539
+ });
5540
+
5541
+ if (type) {
5542
+ request = request.then(function (places) {
5543
+ return places.filter(function (place) {
5544
+ return place.type === type;
5545
+ });
5546
+ });
5547
+ }
5548
+
5549
+ return request;
5550
+ };
5551
+
5552
+ return CliniaService;
5553
+ }();
5554
+
7665
5555
  var wasmPath = 'node_modules/oro-toolbox';
5556
+ /**
5557
+ * This function helps you to initialize and OroClient instance
5558
+ * @param toolbox the OroToolbox object
5559
+ * @param tellerBaseURL the teller service base URL
5560
+ * @param vaultBaseURL the vault service base URL
5561
+ * @param guardBaseURL the guard service base URL
5562
+ * @param practiceBaseURL the practice service base URL
5563
+ * @param consultBaseURL the consult service base URL
5564
+ * @param workflowBaseURL the workflow service base URL
5565
+ * @param diagnosisBaseURL the diagnosis service base URL
5566
+ * @param authenticationCallback (optional) authenticationCallback the authentification callback
5567
+ * @returns an instance of OroClient
5568
+ */
5569
+
5570
+ var init = function init(toolbox, tellerBaseURL, vaultBaseURL, guardBaseURL, practiceBaseURL, consultBaseURL, workflowBaseURL, diagnosisBaseURL, authenticationCallback) {
5571
+ var _initApis = initApis__default({
5572
+ tellerBaseURL: tellerBaseURL,
5573
+ vaultBaseURL: vaultBaseURL,
5574
+ guardBaseURL: guardBaseURL,
5575
+ practiceBaseURL: practiceBaseURL,
5576
+ consultBaseURL: consultBaseURL,
5577
+ workflowBaseURL: workflowBaseURL,
5578
+ diagnosisBaseURL: diagnosisBaseURL
5579
+ }, authenticationCallback),
5580
+ tellerService = _initApis.tellerService,
5581
+ practiceService = _initApis.practiceService,
5582
+ consultService = _initApis.consultService,
5583
+ vaultService = _initApis.vaultService,
5584
+ guardService = _initApis.guardService,
5585
+ workflowService = _initApis.workflowService,
5586
+ diagnosisService = _initApis.diagnosisService;
7666
5587
 
7667
- var init = function init(toolbox, tellerBaseURL, vaultBaseURL, guardBaseURL, practiceBaseURL, consultBaseURL, workflowBaseURL, diagnosisBaseUrl, authenticationCallback) {
7668
- var apiService = new APIService(undefined, authenticationCallback);
7669
- var tellerService = new TellerService(apiService, tellerBaseURL);
7670
- var practiceService = new PracticeService(toolbox, apiService, practiceBaseURL);
7671
- var consultService = new ConsultService(apiService, consultBaseURL);
7672
- var vaultService = new VaultService(apiService, vaultBaseURL);
7673
- var guardService = new GuardService(apiService, guardBaseURL);
7674
- var workflowService = new WorkflowService(apiService, workflowBaseURL);
7675
- var diagnosisService = new DiagnosisService(apiService, diagnosisBaseUrl);
7676
5588
  var client = new OroClient(toolbox, tellerService, vaultService, guardService, practiceService, consultService, workflowService, diagnosisService, authenticationCallback);
7677
5589
  return client;
7678
5590
  };
7679
5591
 
7680
5592
  export default init;
7681
- export { APIService, AssignmentStatus, AssistantType, AssociatedLockboxNotFound, AuthenticationBadRequest, AuthenticationFailed, AuthenticationServerError, AxiosService, CliniaService, ConsultService, DiagnosisService, DiagnosisType, DocumentType, DrugType, FeeStatus, GuardService, IdentityCreationBadRequest, IdentityCreationConflict, IdentityCreationFailed, IncompleteAuthentication, IndexBuildError, IndexKey, LicenseStatus, MedicalStatus, MetadataCategory, MissingGrant, MissingLockbox, MissingLockboxOwner, OroClient, OtherRoleType, PaymentStatus, PeriodType, PlanStatus, PlanType, PracticeConfigKind, PracticeEmailKind, PracticeService, PractitionerStatus, PractitionnerRoleType, RateDimension, StripePriceType, SyncStatus, TaskStatus, TellerService, TransmissionKind, TransmissionStatus, VaultService, WorkflowAnswersMissingError, WorkflowService, WorkflowType, decryptConsultLockboxGrants, decryptGrants, extractAndStorePersonalWorkflowData, extractISOLocalityForConsult, fillWorkflowFromPopulatedWorkflow, filterTriggeredAnsweredWithKind, flattenSelectedAnswers, getImagesFromIndexDb, getInitialisedSelectedAnswers, getWorkflowDataByCategory, identificationToPersonalInformations, isTriggered, registerPatient, sessionStorePrivateKeyName, toActualObject, updatePersonalIntoPopulatedWorkflowData, wasmPath };
5593
+ export { AssociatedLockboxNotFound, CliniaService, IncompleteAuthentication, MissingGrant, MissingLockbox, MissingLockboxOwner, OroClient, WorkflowAnswersMissingError, decryptConsultLockboxGrants, decryptGrants, extractAndStorePersonalWorkflowData, extractISOLocalityForConsult, fillWorkflowFromPopulatedWorkflow, filterTriggeredAnsweredWithKind, flattenSelectedAnswers, getImagesFromIndexDb, getInitialisedSelectedAnswers, getWorkflowDataByCategory, identificationToPersonalInformations, isTriggered, registerPatient, sessionStorePrivateKeyName, toActualObject, updatePersonalIntoPopulatedWorkflowData, wasmPath };
7682
5594
  //# sourceMappingURL=oro-sdk.esm.js.map