oro-sdk 6.4.0 → 7.1.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.
@@ -1277,7 +1277,7 @@ function _registerPatient() {
1277
1277
  }
1278
1278
  }, _callee);
1279
1279
  }));
1280
- return function (_x29) {
1280
+ return function (_x30) {
1281
1281
  return _ref.apply(this, arguments);
1282
1282
  };
1283
1283
  }());
@@ -1304,7 +1304,7 @@ function _registerPatient() {
1304
1304
  }
1305
1305
  }, _callee2);
1306
1306
  }));
1307
- return function (_x30) {
1307
+ return function (_x31) {
1308
1308
  return _ref2.apply(this, arguments);
1309
1309
  };
1310
1310
  }());
@@ -1516,15 +1516,17 @@ function _getOrCreatePatientLockbox() {
1516
1516
  }));
1517
1517
  return _getOrCreatePatientLockbox.apply(this, arguments);
1518
1518
  }
1519
- function storePatientData(_x10, _x11, _x12, _x13, _x14) {
1519
+ function storePatientData(_x10, _x11, _x12, _x13, _x14, _x15) {
1520
1520
  return _storePatientData.apply(this, arguments);
1521
1521
  }
1522
1522
  function _storePatientData() {
1523
- _storePatientData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(consultationId, isoLanguage, lockboxUuid, workflow, oroClient) {
1523
+ _storePatientData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(consultationId, isoLanguage, lockboxUuid, workflow, oroClient, consultType) {
1524
+ var patientDataPromises;
1524
1525
  return _regeneratorRuntime().wrap(function _callee5$(_context6) {
1525
1526
  while (1) switch (_context6.prev = _context6.next) {
1526
1527
  case 0:
1527
- return _context6.abrupt("return", Promise.all([
1528
+ // Create and store registration data
1529
+ patientDataPromises = [
1528
1530
  // Storing Raw data first
1529
1531
  oroClient.getOrInsertJsonData(lockboxUuid, workflow, {
1530
1532
  category: initApis.MetadataCategory.Raw,
@@ -1555,10 +1557,34 @@ function _storePatientData() {
1555
1557
  }, {
1556
1558
  category: initApis.MetadataCategory.Preference,
1557
1559
  contentType: 'application/json'
1558
- }, {})]).then(function (dataUuids) {
1560
+ }, {})];
1561
+ _context6.t0 = consultType;
1562
+ _context6.next = _context6.t0 === initApis.ConsultType.FollowUp ? 4 : _context6.t0 === initApis.ConsultType.Onboard ? 6 : _context6.t0 === initApis.ConsultType.Refill ? 6 : 7;
1563
+ break;
1564
+ case 4:
1565
+ patientDataPromises.push(getWorkflowDataByCategory(workflow, initApis.MetadataCategory.Followup).then(function (data) {
1566
+ return oroClient.getOrInsertJsonData(lockboxUuid, data, {
1567
+ category: initApis.MetadataCategory.Followup,
1568
+ documentType: initApis.DocumentType.PopulatedWorkflowData,
1569
+ consultationId: consultationId
1570
+ }, {
1571
+ consultationId: consultationId
1572
+ }, {
1573
+ withNotification: false,
1574
+ forceReplace: false,
1575
+ updateMedicalStatus: false
1576
+ }
1577
+ // the only data that needs to include an email notification
1578
+ );
1579
+ }));
1580
+ return _context6.abrupt("break", 7);
1581
+ case 6:
1582
+ return _context6.abrupt("break", 7);
1583
+ case 7:
1584
+ return _context6.abrupt("return", Promise.all(patientDataPromises).then(function (dataUuids) {
1559
1585
  return dataUuids.flat();
1560
1586
  }));
1561
- case 1:
1587
+ case 8:
1562
1588
  case "end":
1563
1589
  return _context6.stop();
1564
1590
  }
@@ -1566,7 +1592,7 @@ function _storePatientData() {
1566
1592
  }));
1567
1593
  return _storePatientData.apply(this, arguments);
1568
1594
  }
1569
- function storeImageAliases(_x15, _x16, _x17, _x18, _x19) {
1595
+ function storeImageAliases(_x16, _x17, _x18, _x19, _x20) {
1570
1596
  return _storeImageAliases.apply(this, arguments);
1571
1597
  }
1572
1598
  /**
@@ -1631,7 +1657,7 @@ function _storeImageAliases() {
1631
1657
  }));
1632
1658
  return _storeImageAliases.apply(this, arguments);
1633
1659
  }
1634
- function extractAndStorePersonalWorkflowData(_x20, _x21, _x22, _x23, _x24) {
1660
+ function extractAndStorePersonalWorkflowData(_x21, _x22, _x23, _x24, _x25) {
1635
1661
  return _extractAndStorePersonalWorkflowData.apply(this, arguments);
1636
1662
  }
1637
1663
  /**
@@ -1659,7 +1685,7 @@ function _extractAndStorePersonalWorkflowData() {
1659
1685
  }));
1660
1686
  return _extractAndStorePersonalWorkflowData.apply(this, arguments);
1661
1687
  }
1662
- function extractPersonalInfoFromWorkflowData(_x25) {
1688
+ function extractPersonalInfoFromWorkflowData(_x26) {
1663
1689
  return _extractPersonalInfoFromWorkflowData.apply(this, arguments);
1664
1690
  }
1665
1691
  /**
@@ -1691,7 +1717,7 @@ function _extractPersonalInfoFromWorkflowData() {
1691
1717
  }));
1692
1718
  return _extractPersonalInfoFromWorkflowData.apply(this, arguments);
1693
1719
  }
1694
- function buildConsultSearchIndex(_x26, _x27, _x28) {
1720
+ function buildConsultSearchIndex(_x27, _x28, _x29) {
1695
1721
  return _buildConsultSearchIndex.apply(this, arguments);
1696
1722
  }
1697
1723
  function _buildConsultSearchIndex() {
@@ -1821,6 +1847,7 @@ function getRefillAnswersAsWorkflow(isTreatmentWorking, hasSideEffects, delivery
1821
1847
  createdAt: '2022-10-03T00:00:00.000Z',
1822
1848
  culDeSacs: [],
1823
1849
  hidePlanRules: [],
1850
+ startingPlanIds: [],
1824
1851
  pages: [{
1825
1852
  title: 'Prescription Refill',
1826
1853
  groups: [{
@@ -3426,111 +3453,144 @@ var OroClient = /*#__PURE__*/function () {
3426
3453
  return _getMedicalDataFromConsultId.apply(this, arguments);
3427
3454
  }
3428
3455
  return getMedicalDataFromConsultId;
3456
+ }()
3457
+ /**
3458
+ * Retrieves the patient follow up data associated to the `consultationId`
3459
+ * The `consultationId` only helps to retrieve the patient lockboxes
3460
+ * Note: it is possible to have several follow up data
3461
+ * @param consultationId The consultation Id
3462
+ * @param forceRefresh force data refresh (default to false)
3463
+ * @returns the medical data
3464
+ */
3465
+ ;
3466
+ _proto.getFollowupDataFromConsultId =
3467
+ /*#__PURE__*/
3468
+ function () {
3469
+ var _getFollowupDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(consultationId, options) {
3470
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
3471
+ while (1) switch (_context26.prev = _context26.next) {
3472
+ case 0:
3473
+ if (options === void 0) {
3474
+ options = {
3475
+ forceRefresh: false
3476
+ };
3477
+ }
3478
+ return _context26.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, initApis.MetadataCategory.Followup, options));
3479
+ case 2:
3480
+ case "end":
3481
+ return _context26.stop();
3482
+ }
3483
+ }, _callee26, this);
3484
+ }));
3485
+ function getFollowupDataFromConsultId(_x81, _x82) {
3486
+ return _getFollowupDataFromConsultId.apply(this, arguments);
3487
+ }
3488
+ return getFollowupDataFromConsultId;
3429
3489
  }();
3430
3490
  _proto.getMetaCategoryFromConsultId = /*#__PURE__*/function () {
3431
- var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(consultationId, category, options) {
3491
+ var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(consultationId, category, options) {
3432
3492
  var _this2 = this;
3433
3493
  var grants, workflowData, _loop, _iterator, _step;
3434
- return _regeneratorRuntime().wrap(function _callee27$(_context28) {
3435
- while (1) switch (_context28.prev = _context28.next) {
3494
+ return _regeneratorRuntime().wrap(function _callee28$(_context29) {
3495
+ while (1) switch (_context29.prev = _context29.next) {
3436
3496
  case 0:
3437
3497
  if (options === void 0) {
3438
3498
  options = {
3439
3499
  forceRefresh: false
3440
3500
  };
3441
3501
  }
3442
- _context28.next = 3;
3502
+ _context29.next = 3;
3443
3503
  return this.getGrants({
3444
3504
  consultationId: consultationId
3445
3505
  });
3446
3506
  case 3:
3447
- grants = _context28.sent;
3507
+ grants = _context29.sent;
3448
3508
  workflowData = [];
3449
3509
  _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
3450
3510
  var grant, manifest, data;
3451
- return _regeneratorRuntime().wrap(function _loop$(_context27) {
3452
- while (1) switch (_context27.prev = _context27.next) {
3511
+ return _regeneratorRuntime().wrap(function _loop$(_context28) {
3512
+ while (1) switch (_context28.prev = _context28.next) {
3453
3513
  case 0:
3454
3514
  grant = _step.value;
3455
- _context27.next = 3;
3515
+ _context28.next = 3;
3456
3516
  return _this2.getLockboxManifest(grant.lockboxUuid, {
3457
3517
  category: category,
3458
3518
  documentType: initApis.DocumentType.PopulatedWorkflowData,
3459
3519
  consultationIds: [consultationId]
3460
3520
  }, true, grant.lockboxOwnerUuid, options);
3461
3521
  case 3:
3462
- manifest = _context27.sent;
3522
+ manifest = _context28.sent;
3463
3523
  if (!(manifest.length === 0)) {
3464
- _context27.next = 8;
3524
+ _context28.next = 8;
3465
3525
  break;
3466
3526
  }
3467
- _context27.next = 7;
3527
+ _context28.next = 7;
3468
3528
  return _this2.getLockboxManifest(grant.lockboxUuid, {
3469
3529
  category: category,
3470
3530
  documentType: initApis.DocumentType.PopulatedWorkflowData
3471
3531
  }, true, grant.lockboxOwnerUuid, options);
3472
3532
  case 7:
3473
- manifest = _context27.sent.filter(function (entry) {
3533
+ manifest = _context28.sent.filter(function (entry) {
3474
3534
  return !entry.metadata.consultationIds;
3475
3535
  });
3476
3536
  case 8:
3477
- _context27.next = 10;
3537
+ _context28.next = 10;
3478
3538
  return Promise.all(manifest.map( /*#__PURE__*/function () {
3479
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(entry) {
3480
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
3481
- while (1) switch (_context26.prev = _context26.next) {
3539
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(entry) {
3540
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
3541
+ while (1) switch (_context27.prev = _context27.next) {
3482
3542
  case 0:
3483
- _context26.t0 = grant.lockboxOwnerUuid;
3484
- _context26.t1 = grant.lockboxUuid;
3485
- _context26.t2 = entry.dataUuid;
3486
- _context26.next = 5;
3543
+ _context27.t0 = grant.lockboxOwnerUuid;
3544
+ _context27.t1 = grant.lockboxUuid;
3545
+ _context27.t2 = entry.dataUuid;
3546
+ _context27.next = 5;
3487
3547
  return _this2.getJsonData(grant.lockboxUuid, entry.dataUuid);
3488
3548
  case 5:
3489
- _context26.t3 = _context26.sent;
3490
- return _context26.abrupt("return", {
3491
- lockboxOwnerUuid: _context26.t0,
3492
- lockboxUuid: _context26.t1,
3493
- dataUuid: _context26.t2,
3494
- data: _context26.t3
3549
+ _context27.t3 = _context27.sent;
3550
+ return _context27.abrupt("return", {
3551
+ lockboxOwnerUuid: _context27.t0,
3552
+ lockboxUuid: _context27.t1,
3553
+ dataUuid: _context27.t2,
3554
+ data: _context27.t3
3495
3555
  });
3496
3556
  case 7:
3497
3557
  case "end":
3498
- return _context26.stop();
3558
+ return _context27.stop();
3499
3559
  }
3500
- }, _callee26);
3560
+ }, _callee27);
3501
3561
  }));
3502
- return function (_x84) {
3562
+ return function (_x86) {
3503
3563
  return _ref3.apply(this, arguments);
3504
3564
  };
3505
3565
  }()));
3506
3566
  case 10:
3507
- data = _context27.sent;
3567
+ data = _context28.sent;
3508
3568
  workflowData = _extends({}, workflowData, data);
3509
3569
  case 12:
3510
3570
  case "end":
3511
- return _context27.stop();
3571
+ return _context28.stop();
3512
3572
  }
3513
3573
  }, _loop);
3514
3574
  });
3515
3575
  _iterator = _createForOfIteratorHelperLoose(grants);
3516
3576
  case 7:
3517
3577
  if ((_step = _iterator()).done) {
3518
- _context28.next = 11;
3578
+ _context29.next = 11;
3519
3579
  break;
3520
3580
  }
3521
- return _context28.delegateYield(_loop(), "t0", 9);
3581
+ return _context29.delegateYield(_loop(), "t0", 9);
3522
3582
  case 9:
3523
- _context28.next = 7;
3583
+ _context29.next = 7;
3524
3584
  break;
3525
3585
  case 11:
3526
- return _context28.abrupt("return", workflowData);
3586
+ return _context29.abrupt("return", workflowData);
3527
3587
  case 12:
3528
3588
  case "end":
3529
- return _context28.stop();
3589
+ return _context29.stop();
3530
3590
  }
3531
- }, _callee27, this);
3591
+ }, _callee28, this);
3532
3592
  }));
3533
- function getMetaCategoryFromConsultId(_x81, _x82, _x83) {
3593
+ function getMetaCategoryFromConsultId(_x83, _x84, _x85) {
3534
3594
  return _getMetaCategoryFromConsultId.apply(this, arguments);
3535
3595
  }
3536
3596
  return getMetaCategoryFromConsultId;
@@ -3544,63 +3604,63 @@ var OroClient = /*#__PURE__*/function () {
3544
3604
  _proto.getPersonalInformations =
3545
3605
  /*#__PURE__*/
3546
3606
  function () {
3547
- var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(userId) {
3607
+ var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(userId) {
3548
3608
  var grant, lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
3549
- return _regeneratorRuntime().wrap(function _callee28$(_context29) {
3550
- while (1) switch (_context29.prev = _context29.next) {
3609
+ return _regeneratorRuntime().wrap(function _callee29$(_context30) {
3610
+ while (1) switch (_context30.prev = _context30.next) {
3551
3611
  case 0:
3552
- _context29.next = 2;
3612
+ _context30.next = 2;
3553
3613
  return this.getGrants();
3554
3614
  case 2:
3555
- grant = _context29.sent.find(function (lockbox) {
3615
+ grant = _context30.sent.find(function (lockbox) {
3556
3616
  return lockbox.lockboxOwnerUuid === userId;
3557
3617
  });
3558
3618
  if (grant) {
3559
- _context29.next = 5;
3619
+ _context30.next = 5;
3560
3620
  break;
3561
3621
  }
3562
3622
  throw MissingGrant;
3563
3623
  case 5:
3564
3624
  lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
3565
3625
  if (lockboxUuid) {
3566
- _context29.next = 8;
3626
+ _context30.next = 8;
3567
3627
  break;
3568
3628
  }
3569
3629
  throw MissingLockbox;
3570
3630
  case 8:
3571
3631
  if (lockboxOwnerUuid) {
3572
- _context29.next = 10;
3632
+ _context30.next = 10;
3573
3633
  break;
3574
3634
  }
3575
3635
  throw MissingLockboxOwner;
3576
3636
  case 10:
3577
- _context29.next = 12;
3637
+ _context30.next = 12;
3578
3638
  return this.getLockboxManifest(lockboxUuid, {
3579
3639
  category: initApis.MetadataCategory.Personal,
3580
3640
  documentType: initApis.DocumentType.PopulatedWorkflowData
3581
3641
  }, false, userId);
3582
3642
  case 12:
3583
- identificationDataUuid = _context29.sent[0].dataUuid;
3584
- _context29.t0 = lockboxOwnerUuid;
3585
- _context29.t1 = lockboxUuid;
3586
- _context29.t2 = identificationDataUuid;
3587
- _context29.next = 18;
3643
+ identificationDataUuid = _context30.sent[0].dataUuid;
3644
+ _context30.t0 = lockboxOwnerUuid;
3645
+ _context30.t1 = lockboxUuid;
3646
+ _context30.t2 = identificationDataUuid;
3647
+ _context30.next = 18;
3588
3648
  return this.getJsonData(lockboxUuid, identificationDataUuid);
3589
3649
  case 18:
3590
- _context29.t3 = _context29.sent;
3591
- return _context29.abrupt("return", {
3592
- lockboxOwnerUuid: _context29.t0,
3593
- lockboxUuid: _context29.t1,
3594
- dataUuid: _context29.t2,
3595
- data: _context29.t3
3650
+ _context30.t3 = _context30.sent;
3651
+ return _context30.abrupt("return", {
3652
+ lockboxOwnerUuid: _context30.t0,
3653
+ lockboxUuid: _context30.t1,
3654
+ dataUuid: _context30.t2,
3655
+ data: _context30.t3
3596
3656
  });
3597
3657
  case 20:
3598
3658
  case "end":
3599
- return _context29.stop();
3659
+ return _context30.stop();
3600
3660
  }
3601
- }, _callee28, this);
3661
+ }, _callee29, this);
3602
3662
  }));
3603
- function getPersonalInformations(_x85) {
3663
+ function getPersonalInformations(_x87) {
3604
3664
  return _getPersonalInformations.apply(this, arguments);
3605
3665
  }
3606
3666
  return getPersonalInformations;
@@ -3615,31 +3675,31 @@ var OroClient = /*#__PURE__*/function () {
3615
3675
  _proto.getGrantFromConsultId =
3616
3676
  /*#__PURE__*/
3617
3677
  function () {
3618
- var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(consultationId) {
3678
+ var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(consultationId) {
3619
3679
  var grants;
3620
- return _regeneratorRuntime().wrap(function _callee29$(_context30) {
3621
- while (1) switch (_context30.prev = _context30.next) {
3680
+ return _regeneratorRuntime().wrap(function _callee30$(_context31) {
3681
+ while (1) switch (_context31.prev = _context31.next) {
3622
3682
  case 0:
3623
- _context30.next = 2;
3683
+ _context31.next = 2;
3624
3684
  return this.getGrants({
3625
3685
  consultationId: consultationId
3626
3686
  });
3627
3687
  case 2:
3628
- grants = _context30.sent;
3688
+ grants = _context31.sent;
3629
3689
  if (!(grants.length === 0)) {
3630
- _context30.next = 5;
3690
+ _context31.next = 5;
3631
3691
  break;
3632
3692
  }
3633
3693
  throw AssociatedLockboxNotFound;
3634
3694
  case 5:
3635
- return _context30.abrupt("return", grants[0]);
3695
+ return _context31.abrupt("return", grants[0]);
3636
3696
  case 6:
3637
3697
  case "end":
3638
- return _context30.stop();
3698
+ return _context31.stop();
3639
3699
  }
3640
- }, _callee29, this);
3700
+ }, _callee30, this);
3641
3701
  }));
3642
- function getGrantFromConsultId(_x86) {
3702
+ function getGrantFromConsultId(_x88) {
3643
3703
  return _getGrantFromConsultId.apply(this, arguments);
3644
3704
  }
3645
3705
  return getGrantFromConsultId;
@@ -3653,32 +3713,32 @@ var OroClient = /*#__PURE__*/function () {
3653
3713
  _proto.getIdentityFromConsultId =
3654
3714
  /*#__PURE__*/
3655
3715
  function () {
3656
- var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(consultationId) {
3716
+ var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(consultationId) {
3657
3717
  var grant;
3658
- return _regeneratorRuntime().wrap(function _callee30$(_context31) {
3659
- while (1) switch (_context31.prev = _context31.next) {
3718
+ return _regeneratorRuntime().wrap(function _callee31$(_context32) {
3719
+ while (1) switch (_context32.prev = _context32.next) {
3660
3720
  case 0:
3661
- _context31.next = 2;
3721
+ _context32.next = 2;
3662
3722
  return this.getGrantFromConsultId(consultationId);
3663
3723
  case 2:
3664
- grant = _context31.sent;
3724
+ grant = _context32.sent;
3665
3725
  if (!(grant && grant.lockboxOwnerUuid)) {
3666
- _context31.next = 9;
3726
+ _context32.next = 9;
3667
3727
  break;
3668
3728
  }
3669
- _context31.next = 6;
3729
+ _context32.next = 6;
3670
3730
  return this.guardClient.identityGet(grant.lockboxOwnerUuid);
3671
3731
  case 6:
3672
- return _context31.abrupt("return", _context31.sent);
3732
+ return _context32.abrupt("return", _context32.sent);
3673
3733
  case 9:
3674
- return _context31.abrupt("return", undefined);
3734
+ return _context32.abrupt("return", undefined);
3675
3735
  case 10:
3676
3736
  case "end":
3677
- return _context31.stop();
3737
+ return _context32.stop();
3678
3738
  }
3679
- }, _callee30, this);
3739
+ }, _callee31, this);
3680
3740
  }));
3681
- function getIdentityFromConsultId(_x87) {
3741
+ function getIdentityFromConsultId(_x89) {
3682
3742
  return _getIdentityFromConsultId.apply(this, arguments);
3683
3743
  }
3684
3744
  return getIdentityFromConsultId;
@@ -3697,11 +3757,11 @@ var OroClient = /*#__PURE__*/function () {
3697
3757
  _proto.getLockboxManifest =
3698
3758
  /*#__PURE__*/
3699
3759
  function () {
3700
- var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, options) {
3760
+ var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, options) {
3701
3761
  var _this3 = this;
3702
3762
  var manifestKey;
3703
- return _regeneratorRuntime().wrap(function _callee32$(_context33) {
3704
- while (1) switch (_context33.prev = _context33.next) {
3763
+ return _regeneratorRuntime().wrap(function _callee33$(_context34) {
3764
+ while (1) switch (_context34.prev = _context34.next) {
3705
3765
  case 0:
3706
3766
  if (options === void 0) {
3707
3767
  options = {
@@ -3715,36 +3775,36 @@ var OroClient = /*#__PURE__*/function () {
3715
3775
  lockboxOwnerUuid: lockboxOwnerUuid
3716
3776
  });
3717
3777
  if (!(!options.forceRefresh && this.cachedManifest[manifestKey])) {
3718
- _context33.next = 4;
3778
+ _context34.next = 4;
3719
3779
  break;
3720
3780
  }
3721
- return _context33.abrupt("return", this.cachedManifest[manifestKey]);
3781
+ return _context34.abrupt("return", this.cachedManifest[manifestKey]);
3722
3782
  case 4:
3723
- return _context33.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
3783
+ return _context34.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
3724
3784
  return Promise.all(manifest.map( /*#__PURE__*/function () {
3725
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(entry) {
3785
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(entry) {
3726
3786
  var privateMeta;
3727
- return _regeneratorRuntime().wrap(function _callee31$(_context32) {
3728
- while (1) switch (_context32.prev = _context32.next) {
3787
+ return _regeneratorRuntime().wrap(function _callee32$(_context33) {
3788
+ while (1) switch (_context33.prev = _context33.next) {
3729
3789
  case 0:
3730
3790
  if (!(expandPrivateMetadata && entry.metadata.privateMetadata)) {
3731
- _context32.next = 5;
3791
+ _context33.next = 5;
3732
3792
  break;
3733
3793
  }
3734
- _context32.next = 3;
3794
+ _context33.next = 3;
3735
3795
  return _this3.getJsonData(lockboxUuid, entry.metadata.privateMetadata, lockboxOwnerUuid);
3736
3796
  case 3:
3737
- privateMeta = _context32.sent;
3797
+ privateMeta = _context33.sent;
3738
3798
  entry.metadata = _extends({}, entry.metadata, privateMeta);
3739
3799
  case 5:
3740
- return _context32.abrupt("return", entry);
3800
+ return _context33.abrupt("return", entry);
3741
3801
  case 6:
3742
3802
  case "end":
3743
- return _context32.stop();
3803
+ return _context33.stop();
3744
3804
  }
3745
- }, _callee31);
3805
+ }, _callee32);
3746
3806
  }));
3747
- return function (_x93) {
3807
+ return function (_x95) {
3748
3808
  return _ref4.apply(this, arguments);
3749
3809
  };
3750
3810
  }())).then(function (manifest) {
@@ -3753,11 +3813,11 @@ var OroClient = /*#__PURE__*/function () {
3753
3813
  }));
3754
3814
  case 5:
3755
3815
  case "end":
3756
- return _context33.stop();
3816
+ return _context34.stop();
3757
3817
  }
3758
- }, _callee32, this);
3818
+ }, _callee33, this);
3759
3819
  }));
3760
- function getLockboxManifest(_x88, _x89, _x90, _x91, _x92) {
3820
+ function getLockboxManifest(_x90, _x91, _x92, _x93, _x94) {
3761
3821
  return _getLockboxManifest.apply(this, arguments);
3762
3822
  }
3763
3823
  return getLockboxManifest;
@@ -3773,34 +3833,34 @@ var OroClient = /*#__PURE__*/function () {
3773
3833
  _proto.createPersonalInformations =
3774
3834
  /*#__PURE__*/
3775
3835
  function () {
3776
- var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(identity, data, dataUuid) {
3836
+ var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(identity, data, dataUuid) {
3777
3837
  var _yield$this$getGrants;
3778
3838
  var lockboxUuid;
3779
- return _regeneratorRuntime().wrap(function _callee33$(_context34) {
3780
- while (1) switch (_context34.prev = _context34.next) {
3839
+ return _regeneratorRuntime().wrap(function _callee34$(_context35) {
3840
+ while (1) switch (_context35.prev = _context35.next) {
3781
3841
  case 0:
3782
- _context34.next = 2;
3842
+ _context35.next = 2;
3783
3843
  return this.getGrants();
3784
3844
  case 2:
3785
- _context34.t0 = _yield$this$getGrants = _context34.sent.find(function (lockbox) {
3845
+ _context35.t0 = _yield$this$getGrants = _context35.sent.find(function (lockbox) {
3786
3846
  return lockbox.lockboxOwnerUuid === identity.id;
3787
3847
  });
3788
- if (!(_context34.t0 == null)) {
3789
- _context34.next = 7;
3848
+ if (!(_context35.t0 == null)) {
3849
+ _context35.next = 7;
3790
3850
  break;
3791
3851
  }
3792
- _context34.t1 = void 0;
3793
- _context34.next = 8;
3852
+ _context35.t1 = void 0;
3853
+ _context35.next = 8;
3794
3854
  break;
3795
3855
  case 7:
3796
- _context34.t1 = _yield$this$getGrants.lockboxUuid;
3856
+ _context35.t1 = _yield$this$getGrants.lockboxUuid;
3797
3857
  case 8:
3798
- lockboxUuid = _context34.t1;
3858
+ lockboxUuid = _context35.t1;
3799
3859
  if (!lockboxUuid) {
3800
- _context34.next = 13;
3860
+ _context35.next = 13;
3801
3861
  break;
3802
3862
  }
3803
- return _context34.abrupt("return", this.createJsonData(lockboxUuid, data, {
3863
+ return _context35.abrupt("return", this.createJsonData(lockboxUuid, data, {
3804
3864
  category: initApis.MetadataCategory.Personal,
3805
3865
  documentType: initApis.DocumentType.PopulatedWorkflowData
3806
3866
  }, {}, undefined, dataUuid));
@@ -3808,11 +3868,11 @@ var OroClient = /*#__PURE__*/function () {
3808
3868
  throw MissingLockbox;
3809
3869
  case 14:
3810
3870
  case "end":
3811
- return _context34.stop();
3871
+ return _context35.stop();
3812
3872
  }
3813
- }, _callee33, this);
3873
+ }, _callee34, this);
3814
3874
  }));
3815
- function createPersonalInformations(_x94, _x95, _x96) {
3875
+ function createPersonalInformations(_x96, _x97, _x98) {
3816
3876
  return _createPersonalInformations.apply(this, arguments);
3817
3877
  }
3818
3878
  return createPersonalInformations;
@@ -3828,34 +3888,34 @@ var OroClient = /*#__PURE__*/function () {
3828
3888
  _proto.createUserPreference =
3829
3889
  /*#__PURE__*/
3830
3890
  function () {
3831
- var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(identity, preference, dataUuid) {
3891
+ var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(identity, preference, dataUuid) {
3832
3892
  var _yield$this$getGrants2;
3833
3893
  var lockboxUuid;
3834
- return _regeneratorRuntime().wrap(function _callee34$(_context35) {
3835
- while (1) switch (_context35.prev = _context35.next) {
3894
+ return _regeneratorRuntime().wrap(function _callee35$(_context36) {
3895
+ while (1) switch (_context36.prev = _context36.next) {
3836
3896
  case 0:
3837
- _context35.next = 2;
3897
+ _context36.next = 2;
3838
3898
  return this.getGrants();
3839
3899
  case 2:
3840
- _context35.t0 = _yield$this$getGrants2 = _context35.sent.find(function (lockbox) {
3900
+ _context36.t0 = _yield$this$getGrants2 = _context36.sent.find(function (lockbox) {
3841
3901
  return lockbox.lockboxOwnerUuid === identity.id;
3842
3902
  });
3843
- if (!(_context35.t0 == null)) {
3844
- _context35.next = 7;
3903
+ if (!(_context36.t0 == null)) {
3904
+ _context36.next = 7;
3845
3905
  break;
3846
3906
  }
3847
- _context35.t1 = void 0;
3848
- _context35.next = 8;
3907
+ _context36.t1 = void 0;
3908
+ _context36.next = 8;
3849
3909
  break;
3850
3910
  case 7:
3851
- _context35.t1 = _yield$this$getGrants2.lockboxUuid;
3911
+ _context36.t1 = _yield$this$getGrants2.lockboxUuid;
3852
3912
  case 8:
3853
- lockboxUuid = _context35.t1;
3913
+ lockboxUuid = _context36.t1;
3854
3914
  if (!lockboxUuid) {
3855
- _context35.next = 13;
3915
+ _context36.next = 13;
3856
3916
  break;
3857
3917
  }
3858
- return _context35.abrupt("return", this.createJsonData(lockboxUuid, preference, {
3918
+ return _context36.abrupt("return", this.createJsonData(lockboxUuid, preference, {
3859
3919
  category: initApis.MetadataCategory.Preference,
3860
3920
  contentType: 'application/json'
3861
3921
  }, {}, undefined, dataUuid));
@@ -3863,11 +3923,11 @@ var OroClient = /*#__PURE__*/function () {
3863
3923
  throw MissingLockbox;
3864
3924
  case 14:
3865
3925
  case "end":
3866
- return _context35.stop();
3926
+ return _context36.stop();
3867
3927
  }
3868
- }, _callee34, this);
3928
+ }, _callee35, this);
3869
3929
  }));
3870
- function createUserPreference(_x97, _x98, _x99) {
3930
+ function createUserPreference(_x99, _x100, _x101) {
3871
3931
  return _createUserPreference.apply(this, arguments);
3872
3932
  }
3873
3933
  return createUserPreference;
@@ -3881,50 +3941,50 @@ var OroClient = /*#__PURE__*/function () {
3881
3941
  _proto.getDataFromGrant =
3882
3942
  /*#__PURE__*/
3883
3943
  function () {
3884
- var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(grant, filter) {
3944
+ var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(grant, filter) {
3885
3945
  var lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
3886
- return _regeneratorRuntime().wrap(function _callee35$(_context36) {
3887
- while (1) switch (_context36.prev = _context36.next) {
3946
+ return _regeneratorRuntime().wrap(function _callee36$(_context37) {
3947
+ while (1) switch (_context37.prev = _context37.next) {
3888
3948
  case 0:
3889
3949
  lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
3890
3950
  if (lockboxUuid) {
3891
- _context36.next = 3;
3951
+ _context37.next = 3;
3892
3952
  break;
3893
3953
  }
3894
3954
  throw MissingLockbox;
3895
3955
  case 3:
3896
3956
  if (lockboxOwnerUuid) {
3897
- _context36.next = 5;
3957
+ _context37.next = 5;
3898
3958
  break;
3899
3959
  }
3900
3960
  throw MissingLockboxOwner;
3901
3961
  case 5:
3902
- _context36.next = 7;
3962
+ _context37.next = 7;
3903
3963
  return this.getLockboxManifest(lockboxUuid, filter, false, grant.lockboxOwnerUuid, {
3904
3964
  forceRefresh: true
3905
3965
  });
3906
3966
  case 7:
3907
- identificationDataUuid = _context36.sent[0].dataUuid;
3908
- _context36.t0 = lockboxOwnerUuid;
3909
- _context36.t1 = lockboxUuid;
3910
- _context36.t2 = identificationDataUuid;
3911
- _context36.next = 13;
3967
+ identificationDataUuid = _context37.sent[0].dataUuid;
3968
+ _context37.t0 = lockboxOwnerUuid;
3969
+ _context37.t1 = lockboxUuid;
3970
+ _context37.t2 = identificationDataUuid;
3971
+ _context37.next = 13;
3912
3972
  return this.getJsonData(lockboxUuid, identificationDataUuid);
3913
3973
  case 13:
3914
- _context36.t3 = _context36.sent;
3915
- return _context36.abrupt("return", {
3916
- lockboxOwnerUuid: _context36.t0,
3917
- lockboxUuid: _context36.t1,
3918
- dataUuid: _context36.t2,
3919
- data: _context36.t3
3974
+ _context37.t3 = _context37.sent;
3975
+ return _context37.abrupt("return", {
3976
+ lockboxOwnerUuid: _context37.t0,
3977
+ lockboxUuid: _context37.t1,
3978
+ dataUuid: _context37.t2,
3979
+ data: _context37.t3
3920
3980
  });
3921
3981
  case 15:
3922
3982
  case "end":
3923
- return _context36.stop();
3983
+ return _context37.stop();
3924
3984
  }
3925
- }, _callee35, this);
3985
+ }, _callee36, this);
3926
3986
  }));
3927
- function getDataFromGrant(_x100, _x101) {
3987
+ function getDataFromGrant(_x102, _x103) {
3928
3988
  return _getDataFromGrant.apply(this, arguments);
3929
3989
  }
3930
3990
  return getDataFromGrant;
@@ -3938,32 +3998,32 @@ var OroClient = /*#__PURE__*/function () {
3938
3998
  _proto.getUserPreferenceFromConsultId =
3939
3999
  /*#__PURE__*/
3940
4000
  function () {
3941
- var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(consultationId) {
4001
+ var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(consultationId) {
3942
4002
  var grant;
3943
- return _regeneratorRuntime().wrap(function _callee36$(_context37) {
3944
- while (1) switch (_context37.prev = _context37.next) {
4003
+ return _regeneratorRuntime().wrap(function _callee37$(_context38) {
4004
+ while (1) switch (_context38.prev = _context38.next) {
3945
4005
  case 0:
3946
- _context37.next = 2;
4006
+ _context38.next = 2;
3947
4007
  return this.getGrantFromConsultId(consultationId);
3948
4008
  case 2:
3949
- grant = _context37.sent;
4009
+ grant = _context38.sent;
3950
4010
  if (grant) {
3951
- _context37.next = 5;
4011
+ _context38.next = 5;
3952
4012
  break;
3953
4013
  }
3954
4014
  throw MissingGrant;
3955
4015
  case 5:
3956
- return _context37.abrupt("return", this.getDataFromGrant(grant, {
4016
+ return _context38.abrupt("return", this.getDataFromGrant(grant, {
3957
4017
  category: initApis.MetadataCategory.Preference,
3958
4018
  contentType: 'application/json'
3959
4019
  }));
3960
4020
  case 6:
3961
4021
  case "end":
3962
- return _context37.stop();
4022
+ return _context38.stop();
3963
4023
  }
3964
- }, _callee36, this);
4024
+ }, _callee37, this);
3965
4025
  }));
3966
- function getUserPreferenceFromConsultId(_x102) {
4026
+ function getUserPreferenceFromConsultId(_x104) {
3967
4027
  return _getUserPreferenceFromConsultId.apply(this, arguments);
3968
4028
  }
3969
4029
  return getUserPreferenceFromConsultId;
@@ -3977,34 +4037,34 @@ var OroClient = /*#__PURE__*/function () {
3977
4037
  _proto.getUserPreference =
3978
4038
  /*#__PURE__*/
3979
4039
  function () {
3980
- var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(identity) {
4040
+ var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(identity) {
3981
4041
  var grant;
3982
- return _regeneratorRuntime().wrap(function _callee37$(_context38) {
3983
- while (1) switch (_context38.prev = _context38.next) {
4042
+ return _regeneratorRuntime().wrap(function _callee38$(_context39) {
4043
+ while (1) switch (_context39.prev = _context39.next) {
3984
4044
  case 0:
3985
- _context38.next = 2;
4045
+ _context39.next = 2;
3986
4046
  return this.getGrants();
3987
4047
  case 2:
3988
- grant = _context38.sent.find(function (lockbox) {
4048
+ grant = _context39.sent.find(function (lockbox) {
3989
4049
  return lockbox.lockboxOwnerUuid === identity.id;
3990
4050
  });
3991
4051
  if (grant) {
3992
- _context38.next = 5;
4052
+ _context39.next = 5;
3993
4053
  break;
3994
4054
  }
3995
4055
  throw MissingGrant;
3996
4056
  case 5:
3997
- return _context38.abrupt("return", this.getDataFromGrant(grant, {
4057
+ return _context39.abrupt("return", this.getDataFromGrant(grant, {
3998
4058
  category: initApis.MetadataCategory.Preference,
3999
4059
  contentType: 'application/json'
4000
4060
  }));
4001
4061
  case 6:
4002
4062
  case "end":
4003
- return _context38.stop();
4063
+ return _context39.stop();
4004
4064
  }
4005
- }, _callee37, this);
4065
+ }, _callee38, this);
4006
4066
  }));
4007
- function getUserPreference(_x103) {
4067
+ function getUserPreference(_x105) {
4008
4068
  return _getUserPreference.apply(this, arguments);
4009
4069
  }
4010
4070
  return getUserPreference;
@@ -4018,32 +4078,32 @@ var OroClient = /*#__PURE__*/function () {
4018
4078
  _proto.getRecoveryDataFromConsultId =
4019
4079
  /*#__PURE__*/
4020
4080
  function () {
4021
- var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(consultationId) {
4081
+ var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(consultationId) {
4022
4082
  var grant;
4023
- return _regeneratorRuntime().wrap(function _callee38$(_context39) {
4024
- while (1) switch (_context39.prev = _context39.next) {
4083
+ return _regeneratorRuntime().wrap(function _callee39$(_context40) {
4084
+ while (1) switch (_context40.prev = _context40.next) {
4025
4085
  case 0:
4026
- _context39.next = 2;
4086
+ _context40.next = 2;
4027
4087
  return this.getGrantFromConsultId(consultationId);
4028
4088
  case 2:
4029
- grant = _context39.sent;
4089
+ grant = _context40.sent;
4030
4090
  if (grant) {
4031
- _context39.next = 5;
4091
+ _context40.next = 5;
4032
4092
  break;
4033
4093
  }
4034
4094
  throw MissingGrant;
4035
4095
  case 5:
4036
- return _context39.abrupt("return", this.getDataFromGrant(grant, {
4096
+ return _context40.abrupt("return", this.getDataFromGrant(grant, {
4037
4097
  category: initApis.MetadataCategory.Recovery,
4038
4098
  contentType: 'application/json'
4039
4099
  }));
4040
4100
  case 6:
4041
4101
  case "end":
4042
- return _context39.stop();
4102
+ return _context40.stop();
4043
4103
  }
4044
- }, _callee38, this);
4104
+ }, _callee39, this);
4045
4105
  }));
4046
- function getRecoveryDataFromConsultId(_x104) {
4106
+ function getRecoveryDataFromConsultId(_x106) {
4047
4107
  return _getRecoveryDataFromConsultId.apply(this, arguments);
4048
4108
  }
4049
4109
  return getRecoveryDataFromConsultId;
@@ -4057,34 +4117,34 @@ var OroClient = /*#__PURE__*/function () {
4057
4117
  _proto.getRecoveryData =
4058
4118
  /*#__PURE__*/
4059
4119
  function () {
4060
- var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(identity) {
4120
+ var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(identity) {
4061
4121
  var grant;
4062
- return _regeneratorRuntime().wrap(function _callee39$(_context40) {
4063
- while (1) switch (_context40.prev = _context40.next) {
4122
+ return _regeneratorRuntime().wrap(function _callee40$(_context41) {
4123
+ while (1) switch (_context41.prev = _context41.next) {
4064
4124
  case 0:
4065
- _context40.next = 2;
4125
+ _context41.next = 2;
4066
4126
  return this.getGrants();
4067
4127
  case 2:
4068
- grant = _context40.sent.find(function (lockbox) {
4128
+ grant = _context41.sent.find(function (lockbox) {
4069
4129
  return lockbox.lockboxOwnerUuid === identity.id;
4070
4130
  });
4071
4131
  if (grant) {
4072
- _context40.next = 5;
4132
+ _context41.next = 5;
4073
4133
  break;
4074
4134
  }
4075
4135
  throw MissingGrant;
4076
4136
  case 5:
4077
- return _context40.abrupt("return", this.getDataFromGrant(grant, {
4137
+ return _context41.abrupt("return", this.getDataFromGrant(grant, {
4078
4138
  category: initApis.MetadataCategory.Recovery,
4079
4139
  contentType: 'application/json'
4080
4140
  }));
4081
4141
  case 6:
4082
4142
  case "end":
4083
- return _context40.stop();
4143
+ return _context41.stop();
4084
4144
  }
4085
- }, _callee39, this);
4145
+ }, _callee40, this);
4086
4146
  }));
4087
- function getRecoveryData(_x105) {
4147
+ function getRecoveryData(_x107) {
4088
4148
  return _getRecoveryData.apply(this, arguments);
4089
4149
  }
4090
4150
  return getRecoveryData;
@@ -4103,36 +4163,36 @@ var OroClient = /*#__PURE__*/function () {
4103
4163
  _proto.getAssignedConsultations =
4104
4164
  /*#__PURE__*/
4105
4165
  function () {
4106
- var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(practiceUuid) {
4166
+ var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(practiceUuid) {
4107
4167
  var _this4 = this;
4108
- return _regeneratorRuntime().wrap(function _callee41$(_context42) {
4109
- while (1) switch (_context42.prev = _context42.next) {
4168
+ return _regeneratorRuntime().wrap(function _callee42$(_context43) {
4169
+ while (1) switch (_context43.prev = _context43.next) {
4110
4170
  case 0:
4111
- _context42.t0 = Promise;
4112
- _context42.next = 3;
4171
+ _context43.t0 = Promise;
4172
+ _context43.next = 3;
4113
4173
  return this.getGrants();
4114
4174
  case 3:
4115
- _context42.t1 = _context42.sent.map(function (grant) {
4175
+ _context43.t1 = _context43.sent.map(function (grant) {
4116
4176
  return _this4.getLockboxManifest(grant.lockboxUuid, {
4117
4177
  category: initApis.MetadataCategory.Consultation,
4118
4178
  documentType: initApis.DocumentType.PopulatedWorkflowData
4119
4179
  }, true, undefined).then(function (manifest) {
4120
4180
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4121
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(entry) {
4122
- return _regeneratorRuntime().wrap(function _callee40$(_context41) {
4123
- while (1) switch (_context41.prev = _context41.next) {
4181
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(entry) {
4182
+ return _regeneratorRuntime().wrap(function _callee41$(_context42) {
4183
+ while (1) switch (_context42.prev = _context42.next) {
4124
4184
  case 0:
4125
- _context41.next = 2;
4185
+ _context42.next = 2;
4126
4186
  return _this4.consultClient.getConsultByUUID(entry.metadata.consultationId, practiceUuid);
4127
4187
  case 2:
4128
- return _context41.abrupt("return", _context41.sent);
4188
+ return _context42.abrupt("return", _context42.sent);
4129
4189
  case 3:
4130
4190
  case "end":
4131
- return _context41.stop();
4191
+ return _context42.stop();
4132
4192
  }
4133
- }, _callee40);
4193
+ }, _callee41);
4134
4194
  }));
4135
- return function (_x107) {
4195
+ return function (_x109) {
4136
4196
  return _ref5.apply(this, arguments);
4137
4197
  };
4138
4198
  }())).then(function (promise) {
@@ -4140,16 +4200,16 @@ var OroClient = /*#__PURE__*/function () {
4140
4200
  });
4141
4201
  });
4142
4202
  });
4143
- return _context42.abrupt("return", _context42.t0.all.call(_context42.t0, _context42.t1).then(function (consults) {
4203
+ return _context43.abrupt("return", _context43.t0.all.call(_context43.t0, _context43.t1).then(function (consults) {
4144
4204
  return consults.flat();
4145
4205
  }));
4146
4206
  case 5:
4147
4207
  case "end":
4148
- return _context42.stop();
4208
+ return _context43.stop();
4149
4209
  }
4150
- }, _callee41, this);
4210
+ }, _callee42, this);
4151
4211
  }));
4152
- function getAssignedConsultations(_x106) {
4212
+ function getAssignedConsultations(_x108) {
4153
4213
  return _getAssignedConsultations.apply(this, arguments);
4154
4214
  }
4155
4215
  return getAssignedConsultations;
@@ -4163,66 +4223,66 @@ var OroClient = /*#__PURE__*/function () {
4163
4223
  _proto.getPastConsultationsFromConsultId =
4164
4224
  /*#__PURE__*/
4165
4225
  function () {
4166
- var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(consultationId, practiceUuid) {
4226
+ var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(consultationId, practiceUuid) {
4167
4227
  var _this5 = this;
4168
4228
  var grant, consultationsInLockbox;
4169
- return _regeneratorRuntime().wrap(function _callee43$(_context44) {
4170
- while (1) switch (_context44.prev = _context44.next) {
4229
+ return _regeneratorRuntime().wrap(function _callee44$(_context45) {
4230
+ while (1) switch (_context45.prev = _context45.next) {
4171
4231
  case 0:
4172
- _context44.next = 2;
4232
+ _context45.next = 2;
4173
4233
  return this.getGrantFromConsultId(consultationId);
4174
4234
  case 2:
4175
- grant = _context44.sent;
4235
+ grant = _context45.sent;
4176
4236
  if (grant) {
4177
- _context44.next = 5;
4237
+ _context45.next = 5;
4178
4238
  break;
4179
4239
  }
4180
- return _context44.abrupt("return", undefined);
4240
+ return _context45.abrupt("return", undefined);
4181
4241
  case 5:
4182
- _context44.next = 7;
4242
+ _context45.next = 7;
4183
4243
  return this.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], ['consultationId'], {
4184
4244
  category: initApis.MetadataCategory.Consultation,
4185
4245
  documentType: initApis.DocumentType.PopulatedWorkflowData
4186
4246
  }, grant.lockboxOwnerUuid);
4187
4247
  case 7:
4188
- consultationsInLockbox = _context44.sent.flat().map(function (metadata) {
4248
+ consultationsInLockbox = _context45.sent.flat().map(function (metadata) {
4189
4249
  return metadata.consultationId;
4190
4250
  });
4191
4251
  if (!(consultationsInLockbox.length == 0)) {
4192
- _context44.next = 10;
4252
+ _context45.next = 10;
4193
4253
  break;
4194
4254
  }
4195
- return _context44.abrupt("return", []);
4255
+ return _context45.abrupt("return", []);
4196
4256
  case 10:
4197
- _context44.next = 12;
4257
+ _context45.next = 12;
4198
4258
  return Promise.all(consultationsInLockbox.map( /*#__PURE__*/function () {
4199
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(consultId) {
4200
- return _regeneratorRuntime().wrap(function _callee42$(_context43) {
4201
- while (1) switch (_context43.prev = _context43.next) {
4259
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(consultId) {
4260
+ return _regeneratorRuntime().wrap(function _callee43$(_context44) {
4261
+ while (1) switch (_context44.prev = _context44.next) {
4202
4262
  case 0:
4203
- _context43.next = 2;
4263
+ _context44.next = 2;
4204
4264
  return _this5.consultClient.getConsultByUUID(consultId, practiceUuid);
4205
4265
  case 2:
4206
- return _context43.abrupt("return", _context43.sent);
4266
+ return _context44.abrupt("return", _context44.sent);
4207
4267
  case 3:
4208
4268
  case "end":
4209
- return _context43.stop();
4269
+ return _context44.stop();
4210
4270
  }
4211
- }, _callee42);
4271
+ }, _callee43);
4212
4272
  }));
4213
- return function (_x110) {
4273
+ return function (_x112) {
4214
4274
  return _ref6.apply(this, arguments);
4215
4275
  };
4216
4276
  }()));
4217
4277
  case 12:
4218
- return _context44.abrupt("return", _context44.sent);
4278
+ return _context45.abrupt("return", _context45.sent);
4219
4279
  case 13:
4220
4280
  case "end":
4221
- return _context44.stop();
4281
+ return _context45.stop();
4222
4282
  }
4223
- }, _callee43, this);
4283
+ }, _callee44, this);
4224
4284
  }));
4225
- function getPastConsultationsFromConsultId(_x108, _x109) {
4285
+ function getPastConsultationsFromConsultId(_x110, _x111) {
4226
4286
  return _getPastConsultationsFromConsultId.apply(this, arguments);
4227
4287
  }
4228
4288
  return getPastConsultationsFromConsultId;
@@ -4237,23 +4297,23 @@ var OroClient = /*#__PURE__*/function () {
4237
4297
  _proto.getPatientConsultationData =
4238
4298
  /*#__PURE__*/
4239
4299
  function () {
4240
- var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(consultationId, options) {
4300
+ var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(consultationId, options) {
4241
4301
  var _this6 = this;
4242
- return _regeneratorRuntime().wrap(function _callee44$(_context45) {
4243
- while (1) switch (_context45.prev = _context45.next) {
4302
+ return _regeneratorRuntime().wrap(function _callee45$(_context46) {
4303
+ while (1) switch (_context46.prev = _context46.next) {
4244
4304
  case 0:
4245
4305
  if (options === void 0) {
4246
4306
  options = {
4247
4307
  forceRefresh: false
4248
4308
  };
4249
4309
  }
4250
- _context45.t0 = Promise;
4251
- _context45.next = 4;
4310
+ _context46.t0 = Promise;
4311
+ _context46.next = 4;
4252
4312
  return this.getGrants({
4253
4313
  consultationId: consultationId
4254
4314
  });
4255
4315
  case 4:
4256
- _context45.t1 = _context45.sent.map(function (grant) {
4316
+ _context46.t1 = _context46.sent.map(function (grant) {
4257
4317
  return _this6.getLockboxManifest(grant.lockboxUuid, {
4258
4318
  category: initApis.MetadataCategory.Consultation,
4259
4319
  documentType: initApis.DocumentType.PopulatedWorkflowData,
@@ -4264,16 +4324,16 @@ var OroClient = /*#__PURE__*/function () {
4264
4324
  }));
4265
4325
  });
4266
4326
  }).flat();
4267
- return _context45.abrupt("return", _context45.t0.all.call(_context45.t0, _context45.t1).then(function (data) {
4327
+ return _context46.abrupt("return", _context46.t0.all.call(_context46.t0, _context46.t1).then(function (data) {
4268
4328
  return data.flat();
4269
4329
  }));
4270
4330
  case 6:
4271
4331
  case "end":
4272
- return _context45.stop();
4332
+ return _context46.stop();
4273
4333
  }
4274
- }, _callee44, this);
4334
+ }, _callee45, this);
4275
4335
  }));
4276
- function getPatientConsultationData(_x111, _x112) {
4336
+ function getPatientConsultationData(_x113, _x114) {
4277
4337
  return _getPatientConsultationData.apply(this, arguments);
4278
4338
  }
4279
4339
  return getPatientConsultationData;
@@ -4287,21 +4347,21 @@ var OroClient = /*#__PURE__*/function () {
4287
4347
  _proto.getPatientPrescriptionsList =
4288
4348
  /*#__PURE__*/
4289
4349
  function () {
4290
- var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(consultationId) {
4291
- return _regeneratorRuntime().wrap(function _callee45$(_context46) {
4292
- while (1) switch (_context46.prev = _context46.next) {
4350
+ var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(consultationId) {
4351
+ return _regeneratorRuntime().wrap(function _callee46$(_context47) {
4352
+ while (1) switch (_context47.prev = _context47.next) {
4293
4353
  case 0:
4294
- return _context46.abrupt("return", this.getPatientDocumentsList({
4354
+ return _context47.abrupt("return", this.getPatientDocumentsList({
4295
4355
  category: initApis.MetadataCategory.Consultation,
4296
4356
  documentType: initApis.DocumentType.Prescription
4297
4357
  }, true, consultationId));
4298
4358
  case 1:
4299
4359
  case "end":
4300
- return _context46.stop();
4360
+ return _context47.stop();
4301
4361
  }
4302
- }, _callee45, this);
4362
+ }, _callee46, this);
4303
4363
  }));
4304
- function getPatientPrescriptionsList(_x113) {
4364
+ function getPatientPrescriptionsList(_x115) {
4305
4365
  return _getPatientPrescriptionsList.apply(this, arguments);
4306
4366
  }
4307
4367
  return getPatientPrescriptionsList;
@@ -4315,21 +4375,21 @@ var OroClient = /*#__PURE__*/function () {
4315
4375
  _proto.getPatientResultsList =
4316
4376
  /*#__PURE__*/
4317
4377
  function () {
4318
- var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(consultationId) {
4319
- return _regeneratorRuntime().wrap(function _callee46$(_context47) {
4320
- while (1) switch (_context47.prev = _context47.next) {
4378
+ var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(consultationId) {
4379
+ return _regeneratorRuntime().wrap(function _callee47$(_context48) {
4380
+ while (1) switch (_context48.prev = _context48.next) {
4321
4381
  case 0:
4322
- return _context47.abrupt("return", this.getPatientDocumentsList({
4382
+ return _context48.abrupt("return", this.getPatientDocumentsList({
4323
4383
  category: initApis.MetadataCategory.Consultation,
4324
4384
  documentType: initApis.DocumentType.Result
4325
4385
  }, true, consultationId));
4326
4386
  case 1:
4327
4387
  case "end":
4328
- return _context47.stop();
4388
+ return _context48.stop();
4329
4389
  }
4330
- }, _callee46, this);
4390
+ }, _callee47, this);
4331
4391
  }));
4332
- function getPatientResultsList(_x114) {
4392
+ function getPatientResultsList(_x116) {
4333
4393
  return _getPatientResultsList.apply(this, arguments);
4334
4394
  }
4335
4395
  return getPatientResultsList;
@@ -4343,21 +4403,21 @@ var OroClient = /*#__PURE__*/function () {
4343
4403
  _proto.getPatientTreatmentPlans =
4344
4404
  /*#__PURE__*/
4345
4405
  function () {
4346
- var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(consultationId) {
4347
- return _regeneratorRuntime().wrap(function _callee47$(_context48) {
4348
- while (1) switch (_context48.prev = _context48.next) {
4406
+ var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(consultationId) {
4407
+ return _regeneratorRuntime().wrap(function _callee48$(_context49) {
4408
+ while (1) switch (_context49.prev = _context49.next) {
4349
4409
  case 0:
4350
- return _context48.abrupt("return", this.getPatientDocumentsList({
4410
+ return _context49.abrupt("return", this.getPatientDocumentsList({
4351
4411
  category: initApis.MetadataCategory.Consultation,
4352
4412
  documentType: initApis.DocumentType.TreatmentPlan
4353
4413
  }, true, consultationId));
4354
4414
  case 1:
4355
4415
  case "end":
4356
- return _context48.stop();
4416
+ return _context49.stop();
4357
4417
  }
4358
- }, _callee47, this);
4418
+ }, _callee48, this);
4359
4419
  }));
4360
- function getPatientTreatmentPlans(_x115) {
4420
+ function getPatientTreatmentPlans(_x117) {
4361
4421
  return _getPatientTreatmentPlans.apply(this, arguments);
4362
4422
  }
4363
4423
  return getPatientTreatmentPlans;
@@ -4372,22 +4432,22 @@ var OroClient = /*#__PURE__*/function () {
4372
4432
  _proto.getPatientTreatmentPlanByUuid =
4373
4433
  /*#__PURE__*/
4374
4434
  function () {
4375
- var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(consultationId, treatmentPlanId) {
4376
- return _regeneratorRuntime().wrap(function _callee48$(_context49) {
4377
- while (1) switch (_context49.prev = _context49.next) {
4435
+ var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(consultationId, treatmentPlanId) {
4436
+ return _regeneratorRuntime().wrap(function _callee49$(_context50) {
4437
+ while (1) switch (_context50.prev = _context50.next) {
4378
4438
  case 0:
4379
- return _context49.abrupt("return", this.getPatientDocumentsList({
4439
+ return _context50.abrupt("return", this.getPatientDocumentsList({
4380
4440
  category: initApis.MetadataCategory.Consultation,
4381
4441
  documentType: initApis.DocumentType.TreatmentPlan,
4382
4442
  treatmentPlanId: treatmentPlanId
4383
4443
  }, true, consultationId));
4384
4444
  case 1:
4385
4445
  case "end":
4386
- return _context49.stop();
4446
+ return _context50.stop();
4387
4447
  }
4388
- }, _callee48, this);
4448
+ }, _callee49, this);
4389
4449
  }));
4390
- function getPatientTreatmentPlanByUuid(_x116, _x117) {
4450
+ function getPatientTreatmentPlanByUuid(_x118, _x119) {
4391
4451
  return _getPatientTreatmentPlanByUuid.apply(this, arguments);
4392
4452
  }
4393
4453
  return getPatientTreatmentPlanByUuid;
@@ -4405,54 +4465,54 @@ var OroClient = /*#__PURE__*/function () {
4405
4465
  _proto.getPatientDocumentsList =
4406
4466
  /*#__PURE__*/
4407
4467
  function () {
4408
- var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(filters, expandPrivateMetadata, consultationId) {
4468
+ var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(filters, expandPrivateMetadata, consultationId) {
4409
4469
  var _this7 = this;
4410
- return _regeneratorRuntime().wrap(function _callee50$(_context51) {
4411
- while (1) switch (_context51.prev = _context51.next) {
4470
+ return _regeneratorRuntime().wrap(function _callee51$(_context52) {
4471
+ while (1) switch (_context52.prev = _context52.next) {
4412
4472
  case 0:
4413
- _context51.t0 = Promise;
4414
- _context51.next = 3;
4473
+ _context52.t0 = Promise;
4474
+ _context52.next = 3;
4415
4475
  return this.getGrants({
4416
4476
  consultationId: consultationId
4417
4477
  });
4418
4478
  case 3:
4419
- _context51.t1 = _context51.sent.map(function (grant) {
4479
+ _context52.t1 = _context52.sent.map(function (grant) {
4420
4480
  return _this7.getLockboxManifest(grant.lockboxUuid, _extends({}, filters, {
4421
4481
  consultationId: consultationId
4422
4482
  }), expandPrivateMetadata, grant.lockboxOwnerUuid, {
4423
4483
  forceRefresh: true
4424
4484
  }).then(function (manifest) {
4425
4485
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4426
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(entry) {
4427
- return _regeneratorRuntime().wrap(function _callee49$(_context50) {
4428
- while (1) switch (_context50.prev = _context50.next) {
4486
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(entry) {
4487
+ return _regeneratorRuntime().wrap(function _callee50$(_context51) {
4488
+ while (1) switch (_context51.prev = _context51.next) {
4429
4489
  case 0:
4430
- return _context50.abrupt("return", _extends({
4490
+ return _context51.abrupt("return", _extends({
4431
4491
  lockboxOwnerUuid: grant.lockboxOwnerUuid,
4432
4492
  lockboxUuid: grant.lockboxUuid
4433
4493
  }, entry));
4434
4494
  case 1:
4435
4495
  case "end":
4436
- return _context50.stop();
4496
+ return _context51.stop();
4437
4497
  }
4438
- }, _callee49);
4498
+ }, _callee50);
4439
4499
  }));
4440
- return function (_x121) {
4500
+ return function (_x123) {
4441
4501
  return _ref7.apply(this, arguments);
4442
4502
  };
4443
4503
  }()));
4444
4504
  });
4445
4505
  }).flat();
4446
- return _context51.abrupt("return", _context51.t0.all.call(_context51.t0, _context51.t1).then(function (data) {
4506
+ return _context52.abrupt("return", _context52.t0.all.call(_context52.t0, _context52.t1).then(function (data) {
4447
4507
  return data.flat();
4448
4508
  }));
4449
4509
  case 5:
4450
4510
  case "end":
4451
- return _context51.stop();
4511
+ return _context52.stop();
4452
4512
  }
4453
- }, _callee50, this);
4513
+ }, _callee51, this);
4454
4514
  }));
4455
- function getPatientDocumentsList(_x118, _x119, _x120) {
4515
+ function getPatientDocumentsList(_x120, _x121, _x122) {
4456
4516
  return _getPatientDocumentsList.apply(this, arguments);
4457
4517
  }
4458
4518
  return getPatientDocumentsList;
@@ -4472,15 +4532,15 @@ var OroClient = /*#__PURE__*/function () {
4472
4532
  _proto.recoverPrivateKeyFromSecurityQuestions =
4473
4533
  /*#__PURE__*/
4474
4534
  function () {
4475
- var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4535
+ var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4476
4536
  var shards, answeredShards, privateKey;
4477
- return _regeneratorRuntime().wrap(function _callee51$(_context52) {
4478
- while (1) switch (_context52.prev = _context52.next) {
4537
+ return _regeneratorRuntime().wrap(function _callee52$(_context53) {
4538
+ while (1) switch (_context53.prev = _context53.next) {
4479
4539
  case 0:
4480
- _context52.next = 2;
4540
+ _context53.next = 2;
4481
4541
  return this.guardClient.identityGet(id);
4482
4542
  case 2:
4483
- shards = _context52.sent.recoverySecurityQuestions;
4543
+ shards = _context53.sent.recoverySecurityQuestions;
4484
4544
  answeredShards = shards.filter(function (shard) {
4485
4545
  // filters all answered security questions
4486
4546
  var indexOfQuestion = recoverySecurityQuestions.indexOf(shard.securityQuestion);
@@ -4501,11 +4561,11 @@ var OroClient = /*#__PURE__*/function () {
4501
4561
  }
4502
4562
  case 5:
4503
4563
  case "end":
4504
- return _context52.stop();
4564
+ return _context53.stop();
4505
4565
  }
4506
- }, _callee51, this);
4566
+ }, _callee52, this);
4507
4567
  }));
4508
- function recoverPrivateKeyFromSecurityQuestions(_x122, _x123, _x124, _x125) {
4568
+ function recoverPrivateKeyFromSecurityQuestions(_x124, _x125, _x126, _x127) {
4509
4569
  return _recoverPrivateKeyFromSecurityQuestions.apply(this, arguments);
4510
4570
  }
4511
4571
  return recoverPrivateKeyFromSecurityQuestions;
@@ -4520,15 +4580,15 @@ var OroClient = /*#__PURE__*/function () {
4520
4580
  _proto.recoverPrivateKeyFromPassword =
4521
4581
  /*#__PURE__*/
4522
4582
  function () {
4523
- var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(id, password) {
4583
+ var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(id, password) {
4524
4584
  var identity, recoveryPayload, symmetricDecryptor, privateKey, symetricEncryptor;
4525
- return _regeneratorRuntime().wrap(function _callee52$(_context53) {
4526
- while (1) switch (_context53.prev = _context53.next) {
4585
+ return _regeneratorRuntime().wrap(function _callee53$(_context54) {
4586
+ while (1) switch (_context54.prev = _context54.next) {
4527
4587
  case 0:
4528
- _context53.next = 2;
4588
+ _context54.next = 2;
4529
4589
  return this.guardClient.identityGet(id);
4530
4590
  case 2:
4531
- identity = _context53.sent;
4591
+ identity = _context54.sent;
4532
4592
  recoveryPayload = identity.recoveryPassword;
4533
4593
  symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(password);
4534
4594
  privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
@@ -4540,11 +4600,11 @@ var OroClient = /*#__PURE__*/function () {
4540
4600
  this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
4541
4601
  case 8:
4542
4602
  case "end":
4543
- return _context53.stop();
4603
+ return _context54.stop();
4544
4604
  }
4545
- }, _callee52, this);
4605
+ }, _callee53, this);
4546
4606
  }));
4547
- function recoverPrivateKeyFromPassword(_x126, _x127) {
4607
+ function recoverPrivateKeyFromPassword(_x128, _x129) {
4548
4608
  return _recoverPrivateKeyFromPassword.apply(this, arguments);
4549
4609
  }
4550
4610
  return recoverPrivateKeyFromPassword;
@@ -4559,25 +4619,25 @@ var OroClient = /*#__PURE__*/function () {
4559
4619
  _proto.recoverPrivateKeyFromMasterKey =
4560
4620
  /*#__PURE__*/
4561
4621
  function () {
4562
- var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(id, masterKey) {
4622
+ var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(id, masterKey) {
4563
4623
  var recoveryPayload, symmetricDecryptor, privateKey;
4564
- return _regeneratorRuntime().wrap(function _callee53$(_context54) {
4565
- while (1) switch (_context54.prev = _context54.next) {
4624
+ return _regeneratorRuntime().wrap(function _callee54$(_context55) {
4625
+ while (1) switch (_context55.prev = _context55.next) {
4566
4626
  case 0:
4567
- _context54.next = 2;
4627
+ _context55.next = 2;
4568
4628
  return this.guardClient.identityGet(id);
4569
4629
  case 2:
4570
- recoveryPayload = _context54.sent.recoveryMasterKey;
4630
+ recoveryPayload = _context55.sent.recoveryMasterKey;
4571
4631
  symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(masterKey);
4572
4632
  privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
4573
4633
  this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
4574
4634
  case 6:
4575
4635
  case "end":
4576
- return _context54.stop();
4636
+ return _context55.stop();
4577
4637
  }
4578
- }, _callee53, this);
4638
+ }, _callee54, this);
4579
4639
  }));
4580
- function recoverPrivateKeyFromMasterKey(_x128, _x129) {
4640
+ function recoverPrivateKeyFromMasterKey(_x130, _x131) {
4581
4641
  return _recoverPrivateKeyFromMasterKey.apply(this, arguments);
4582
4642
  }
4583
4643
  return recoverPrivateKeyFromMasterKey;
@@ -4594,13 +4654,13 @@ var OroClient = /*#__PURE__*/function () {
4594
4654
  _proto.updateSecurityQuestions =
4595
4655
  /*#__PURE__*/
4596
4656
  function () {
4597
- var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4657
+ var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4598
4658
  var securityQuestionPayload, updateRequest;
4599
- return _regeneratorRuntime().wrap(function _callee54$(_context55) {
4600
- while (1) switch (_context55.prev = _context55.next) {
4659
+ return _regeneratorRuntime().wrap(function _callee55$(_context56) {
4660
+ while (1) switch (_context56.prev = _context56.next) {
4601
4661
  case 0:
4602
4662
  if (this.rsa) {
4603
- _context55.next = 2;
4663
+ _context56.next = 2;
4604
4664
  break;
4605
4665
  }
4606
4666
  throw IncompleteAuthentication;
@@ -4609,17 +4669,17 @@ var OroClient = /*#__PURE__*/function () {
4609
4669
  updateRequest = {
4610
4670
  recoverySecurityQuestions: securityQuestionPayload
4611
4671
  };
4612
- _context55.next = 6;
4672
+ _context56.next = 6;
4613
4673
  return this.guardClient.identityUpdate(id, updateRequest);
4614
4674
  case 6:
4615
- return _context55.abrupt("return", _context55.sent);
4675
+ return _context56.abrupt("return", _context56.sent);
4616
4676
  case 7:
4617
4677
  case "end":
4618
- return _context55.stop();
4678
+ return _context56.stop();
4619
4679
  }
4620
- }, _callee54, this);
4680
+ }, _callee55, this);
4621
4681
  }));
4622
- function updateSecurityQuestions(_x130, _x131, _x132, _x133) {
4682
+ function updateSecurityQuestions(_x132, _x133, _x134, _x135) {
4623
4683
  return _updateSecurityQuestions.apply(this, arguments);
4624
4684
  }
4625
4685
  return updateSecurityQuestions;
@@ -4639,13 +4699,13 @@ var OroClient = /*#__PURE__*/function () {
4639
4699
  _proto.updatePassword =
4640
4700
  /*#__PURE__*/
4641
4701
  function () {
4642
- var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(id, newPassword, oldPassword) {
4702
+ var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(id, newPassword, oldPassword) {
4643
4703
  var symmetricEncryptor, passwordPayload, updateRequest;
4644
- return _regeneratorRuntime().wrap(function _callee55$(_context56) {
4645
- while (1) switch (_context56.prev = _context56.next) {
4704
+ return _regeneratorRuntime().wrap(function _callee56$(_context57) {
4705
+ while (1) switch (_context57.prev = _context57.next) {
4646
4706
  case 0:
4647
4707
  if (this.rsa) {
4648
- _context56.next = 2;
4708
+ _context57.next = 2;
4649
4709
  break;
4650
4710
  }
4651
4711
  throw IncompleteAuthentication;
@@ -4663,17 +4723,17 @@ var OroClient = /*#__PURE__*/function () {
4663
4723
  },
4664
4724
  recoveryPassword: passwordPayload
4665
4725
  };
4666
- _context56.next = 9;
4726
+ _context57.next = 9;
4667
4727
  return this.guardClient.identityUpdate(id, updateRequest);
4668
4728
  case 9:
4669
- return _context56.abrupt("return", _context56.sent);
4729
+ return _context57.abrupt("return", _context57.sent);
4670
4730
  case 10:
4671
4731
  case "end":
4672
- return _context56.stop();
4732
+ return _context57.stop();
4673
4733
  }
4674
- }, _callee55, this);
4734
+ }, _callee56, this);
4675
4735
  }));
4676
- function updatePassword(_x134, _x135, _x136) {
4736
+ function updatePassword(_x136, _x137, _x138) {
4677
4737
  return _updatePassword.apply(this, arguments);
4678
4738
  }
4679
4739
  return updatePassword;
@@ -4690,13 +4750,13 @@ var OroClient = /*#__PURE__*/function () {
4690
4750
  _proto.updateMasterKey =
4691
4751
  /*#__PURE__*/
4692
4752
  function () {
4693
- var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(id, masterKey, lockboxUuid) {
4753
+ var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(id, masterKey, lockboxUuid) {
4694
4754
  var symmetricEncryptor, masterKeyPayload, updateRequest, updatedIdentity;
4695
- return _regeneratorRuntime().wrap(function _callee56$(_context57) {
4696
- while (1) switch (_context57.prev = _context57.next) {
4755
+ return _regeneratorRuntime().wrap(function _callee57$(_context58) {
4756
+ while (1) switch (_context58.prev = _context58.next) {
4697
4757
  case 0:
4698
4758
  if (this.rsa) {
4699
- _context57.next = 2;
4759
+ _context58.next = 2;
4700
4760
  break;
4701
4761
  }
4702
4762
  throw IncompleteAuthentication;
@@ -4706,11 +4766,11 @@ var OroClient = /*#__PURE__*/function () {
4706
4766
  updateRequest = {
4707
4767
  recoveryMasterKey: masterKeyPayload
4708
4768
  };
4709
- _context57.next = 7;
4769
+ _context58.next = 7;
4710
4770
  return this.guardClient.identityUpdate(id, updateRequest);
4711
4771
  case 7:
4712
- updatedIdentity = _context57.sent;
4713
- _context57.next = 10;
4772
+ updatedIdentity = _context58.sent;
4773
+ _context58.next = 10;
4714
4774
  return this.getOrInsertJsonData(lockboxUuid, {
4715
4775
  masterKey: masterKey
4716
4776
  }, {
@@ -4722,14 +4782,14 @@ var OroClient = /*#__PURE__*/function () {
4722
4782
  updateMedicalStatus: false
4723
4783
  });
4724
4784
  case 10:
4725
- return _context57.abrupt("return", updatedIdentity);
4785
+ return _context58.abrupt("return", updatedIdentity);
4726
4786
  case 11:
4727
4787
  case "end":
4728
- return _context57.stop();
4788
+ return _context58.stop();
4729
4789
  }
4730
- }, _callee56, this);
4790
+ }, _callee57, this);
4731
4791
  }));
4732
- function updateMasterKey(_x137, _x138, _x139) {
4792
+ function updateMasterKey(_x139, _x140, _x141) {
4733
4793
  return _updateMasterKey.apply(this, arguments);
4734
4794
  }
4735
4795
  return updateMasterKey;