@icure/api 8.3.6 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icc-api/api/IccClassificationApi.d.ts +1 -0
- package/icc-api/api/IccClassificationApi.js +12 -0
- package/icc-api/api/IccClassificationApi.js.map +1 -1
- package/icc-api/api/IccMessageApi.d.ts +0 -6
- package/icc-api/api/IccMessageApi.js +0 -15
- package/icc-api/api/IccMessageApi.js.map +1 -1
- package/icc-x-api/icc-bekmehr-x-api.js +2 -1
- package/icc-x-api/icc-bekmehr-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +51 -6
- package/icc-x-api/icc-document-x-api.js +231 -69
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +45 -6
- package/icc-x-api/icc-message-x-api.js +202 -30
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +9 -1
- package/icc-x-api/icc-patient-x-api.js +92 -100
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/index.d.ts +6 -0
- package/icc-x-api/index.js +3 -2
- package/icc-x-api/index.js.map +1 -1
- package/package.json +1 -1
- package/test/icc-api/api/IccDocumentApi.js +27 -35
- package/test/icc-api/api/IccDocumentApi.js.map +1 -1
- package/test/icc-x-api/auth/group-switch-test.js.map +1 -1
- package/test/icc-x-api/icc-document-x-api.js +28 -4
- package/test/icc-x-api/icc-document-x-api.js.map +1 -1
- package/test/icc-x-api/icc-message-x-api.js +19 -293
- package/test/icc-x-api/icc-message-x-api.js.map +1 -1
- package/test/utils/test_utils.d.ts +4 -2
- package/test/utils/test_utils.js +3 -2
- package/test/utils/test_utils.js.map +1 -1
|
@@ -22,7 +22,7 @@ var AccessLevelEnum = SecureDelegation_1.SecureDelegation.AccessLevelEnum;
|
|
|
22
22
|
const SecretIdUseOption_1 = require("./crypto/SecretIdUseOption");
|
|
23
23
|
// noinspection JSUnusedGlobalSymbols
|
|
24
24
|
class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
25
|
-
constructor(host, headers, crypto, authApi, dataOwnerApi, autofillAuthor, authenticationProvider = new AuthenticationProvider_1.NoAuthenticationProvider(), fetchImpl = typeof window !== 'undefined'
|
|
25
|
+
constructor(host, headers, crypto, authApi, dataOwnerApi, autofillAuthor, authenticationProvider = new AuthenticationProvider_1.NoAuthenticationProvider(), encryptedKeys = [], fetchImpl = typeof window !== 'undefined'
|
|
26
26
|
? window.fetch
|
|
27
27
|
: typeof self !== 'undefined'
|
|
28
28
|
? self.fetch
|
|
@@ -423,6 +423,7 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
423
423
|
this.fetchImpl = fetchImpl;
|
|
424
424
|
this.authenticationProvider = authenticationProvider;
|
|
425
425
|
this.dataOwnerApi = dataOwnerApi;
|
|
426
|
+
this.encryptedFields = (0, utils_1.parseEncryptedFields)(encryptedKeys, 'Document.');
|
|
426
427
|
}
|
|
427
428
|
get headers() {
|
|
428
429
|
return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, utils_1.EntityWithDelegationTypeName.Document));
|
|
@@ -462,17 +463,6 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
462
463
|
});
|
|
463
464
|
}
|
|
464
465
|
// noinspection JSUnusedGlobalSymbols
|
|
465
|
-
/**
|
|
466
|
-
* @deprecated use {@link findIdsByMessage} instead.
|
|
467
|
-
*/
|
|
468
|
-
findByMessage(hcpartyId, message) {
|
|
469
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
470
|
-
const extractedKeys = yield this.crypto.xapi.secretIdsOf({ entity: message, type: utils_1.EntityWithDelegationTypeName.Message }, hcpartyId);
|
|
471
|
-
const topmostParentId = (yield this.dataOwnerApi.getCurrentDataOwnerHierarchyIds())[0];
|
|
472
|
-
let documents = yield this.findDocumentsByHCPartyPatientForeignKeys(topmostParentId, _.uniq(extractedKeys));
|
|
473
|
-
return yield this.decrypt(hcpartyId, documents);
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
466
|
/**
|
|
477
467
|
* Same as {@link findByMessage} but it will only return the ids of the contacts. It can also filter the documents where Document.created is between
|
|
478
468
|
* startDate and endDate in ascending or descending order by that field. (default: ascending).
|
|
@@ -484,55 +474,14 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
484
474
|
return this.findDocumentIdsByDataOwnerSecretForeignKey(topmostParentId, _.uniq(extractedKeys), startDate, endDate, descending);
|
|
485
475
|
});
|
|
486
476
|
}
|
|
487
|
-
|
|
488
|
-
decrypt(hcpartyId, documents) {
|
|
477
|
+
decrypt(documents) {
|
|
489
478
|
return __awaiter(this, void 0, void 0, function* () {
|
|
490
|
-
|
|
491
|
-
for (const document of documents) {
|
|
492
|
-
const keys = yield this.crypto.xapi.encryptionKeysOf({ entity: document, type: utils_1.EntityWithDelegationTypeName.Document }, undefined);
|
|
493
|
-
if (!keys.length) {
|
|
494
|
-
console.log('Cannot decrypt document', document.id);
|
|
495
|
-
res.push(document);
|
|
496
|
-
}
|
|
497
|
-
else if (keys.length && (document.encryptedSelf || document.encryptedAttachment)) {
|
|
498
|
-
const key = yield this.crypto.primitives.AES.importKey('raw', (0, binary_utils_1.hex2ua)(keys[0]));
|
|
499
|
-
res.push(yield Promise.all([
|
|
500
|
-
document.encryptedSelf
|
|
501
|
-
? new Promise((resolve) => {
|
|
502
|
-
this.crypto.primitives.AES.decrypt(key, (0, binary_utils_1.string2ua)((0, binary_utils_1.a2b)(document.encryptedSelf))).then(resolve, () => {
|
|
503
|
-
console.log('Cannot decrypt document', document.id);
|
|
504
|
-
resolve(null);
|
|
505
|
-
});
|
|
506
|
-
})
|
|
507
|
-
: Promise.resolve(null),
|
|
508
|
-
document.encryptedAttachment
|
|
509
|
-
? new Promise((resolve) => {
|
|
510
|
-
this.crypto.primitives.AES.decrypt(key, document.encryptedAttachment).then(resolve, () => {
|
|
511
|
-
console.log('Cannot decrypt document', document.id);
|
|
512
|
-
resolve(null);
|
|
513
|
-
});
|
|
514
|
-
})
|
|
515
|
-
: Promise.resolve(null),
|
|
516
|
-
]).then((decrypted) => {
|
|
517
|
-
let updatedDocument = Object.assign({}, document);
|
|
518
|
-
if (decrypted) {
|
|
519
|
-
if (decrypted[0]) {
|
|
520
|
-
updatedDocument = _.extend(document, JSON.parse((0, binary_utils_1.ua2string)(decrypted[0])));
|
|
521
|
-
}
|
|
522
|
-
if (decrypted[1]) {
|
|
523
|
-
updatedDocument.decryptedAttachment = decrypted[1];
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
return updatedDocument;
|
|
527
|
-
}));
|
|
528
|
-
}
|
|
529
|
-
else {
|
|
530
|
-
res.push(document);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
return res;
|
|
479
|
+
return yield this.crypto.xapi.tryDecryptEntities(documents, utils_1.EntityWithDelegationTypeName.Document, (x) => new models.Document(x));
|
|
534
480
|
});
|
|
535
481
|
}
|
|
482
|
+
encrypt(documents) {
|
|
483
|
+
return this.crypto.xapi.tryEncryptEntities(documents, utils_1.EntityWithDelegationTypeName.Document, this.encryptedFields, true, false, (x) => new models.Document(x));
|
|
484
|
+
}
|
|
536
485
|
/**
|
|
537
486
|
* @deprecated use getMainAttachmentAs instead
|
|
538
487
|
*/
|
|
@@ -610,12 +559,15 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
610
559
|
* @return the updated document.
|
|
611
560
|
*/
|
|
612
561
|
encryptAndSetDocumentAttachment(document, attachment, utis) {
|
|
562
|
+
const _super = Object.create(null, {
|
|
563
|
+
setMainDocumentAttachment: { get: () => super.setMainDocumentAttachment }
|
|
564
|
+
});
|
|
613
565
|
return __awaiter(this, void 0, void 0, function* () {
|
|
614
566
|
var _a;
|
|
615
567
|
if (!document.rev)
|
|
616
568
|
throw new Error('Cannot set attachment on document without rev');
|
|
617
|
-
const { encryptedData, updatedEntity } = yield this.crypto.xapi.encryptDataOf(document, utils_1.EntityWithDelegationTypeName.Document, attachment, (d) => this.
|
|
618
|
-
return yield this.setMainDocumentAttachment(document.id, (_a = updatedEntity === null || updatedEntity === void 0 ? void 0 : updatedEntity.rev) !== null && _a !== void 0 ? _a : document.rev, encryptedData, utis, true);
|
|
569
|
+
const { encryptedData, updatedEntity } = yield this.crypto.xapi.encryptDataOf(document, utils_1.EntityWithDelegationTypeName.Document, attachment, (d) => this.modifyDocumentWithUser(undefined, d));
|
|
570
|
+
return (yield this.decrypt([yield _super.setMainDocumentAttachment.call(this, document.id, (_a = updatedEntity === null || updatedEntity === void 0 ? void 0 : updatedEntity.rev) !== null && _a !== void 0 ? _a : document.rev, encryptedData, utis, true)]))[0].entity;
|
|
619
571
|
});
|
|
620
572
|
}
|
|
621
573
|
/**
|
|
@@ -627,10 +579,13 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
627
579
|
* @return the updated document.
|
|
628
580
|
*/
|
|
629
581
|
setClearDocumentAttachment(document, attachment, utis) {
|
|
582
|
+
const _super = Object.create(null, {
|
|
583
|
+
setMainDocumentAttachment: { get: () => super.setMainDocumentAttachment }
|
|
584
|
+
});
|
|
630
585
|
return __awaiter(this, void 0, void 0, function* () {
|
|
631
586
|
if (!document.rev)
|
|
632
587
|
throw new Error('Cannot set attachment on document without rev');
|
|
633
|
-
return yield this.setMainDocumentAttachment(document.id, document.rev, attachment, utis, false);
|
|
588
|
+
return (yield this.decrypt([yield _super.setMainDocumentAttachment.call(this, document.id, document.rev, attachment, utis, false)]))[0].entity;
|
|
634
589
|
});
|
|
635
590
|
}
|
|
636
591
|
/**
|
|
@@ -643,12 +598,17 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
643
598
|
* @return the updated document.
|
|
644
599
|
*/
|
|
645
600
|
encryptAndSetSecondaryDocumentAttachment(document, secondaryAttachmentKey, attachment, utis) {
|
|
601
|
+
const _super = Object.create(null, {
|
|
602
|
+
setSecondaryAttachment: { get: () => super.setSecondaryAttachment }
|
|
603
|
+
});
|
|
646
604
|
return __awaiter(this, void 0, void 0, function* () {
|
|
647
605
|
var _a;
|
|
648
606
|
if (!document.rev)
|
|
649
607
|
throw new Error('Cannot set attachment on document without rev');
|
|
650
|
-
const { encryptedData, updatedEntity } = yield this.crypto.xapi.encryptDataOf(document, utils_1.EntityWithDelegationTypeName.Document, attachment, (d) => this.
|
|
651
|
-
return yield this.
|
|
608
|
+
const { encryptedData, updatedEntity } = yield this.crypto.xapi.encryptDataOf(document, utils_1.EntityWithDelegationTypeName.Document, attachment, (d) => this.modifyDocumentWithUser(undefined, d));
|
|
609
|
+
return (yield this.decrypt([
|
|
610
|
+
yield _super.setSecondaryAttachment.call(this, document.id, secondaryAttachmentKey, (_a = updatedEntity === null || updatedEntity === void 0 ? void 0 : updatedEntity.rev) !== null && _a !== void 0 ? _a : document.rev, encryptedData, utis, true),
|
|
611
|
+
]))[0].entity;
|
|
652
612
|
});
|
|
653
613
|
}
|
|
654
614
|
/**
|
|
@@ -661,8 +621,12 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
661
621
|
* @return the updated document.
|
|
662
622
|
*/
|
|
663
623
|
setClearSecondaryDocumentAttachment(document, secondaryAttachmentKey, attachment, utis) {
|
|
624
|
+
const _super = Object.create(null, {
|
|
625
|
+
setSecondaryAttachment: { get: () => super.setSecondaryAttachment }
|
|
626
|
+
});
|
|
664
627
|
return __awaiter(this, void 0, void 0, function* () {
|
|
665
|
-
return yield this.setSecondaryAttachment(document.id, secondaryAttachmentKey, document.rev, attachment, utis, false)
|
|
628
|
+
return (yield this.decrypt([yield _super.setSecondaryAttachment.call(this, document.id, secondaryAttachmentKey, document.rev, attachment, utis, false)]))[0]
|
|
629
|
+
.entity;
|
|
666
630
|
});
|
|
667
631
|
}
|
|
668
632
|
/**
|
|
@@ -690,8 +654,11 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
690
654
|
* - wasDecrypted: if the data was successfully decrypted or not
|
|
691
655
|
*/
|
|
692
656
|
getAndTryDecryptDocumentAttachment(document_1) {
|
|
657
|
+
const _super = Object.create(null, {
|
|
658
|
+
getRawMainDocumentAttachment: { get: () => super.getRawMainDocumentAttachment }
|
|
659
|
+
});
|
|
693
660
|
return __awaiter(this, arguments, void 0, function* (document, validator = () => Promise.resolve(true)) {
|
|
694
|
-
return yield this.crypto.xapi.tryDecryptDataOf({ entity: document, type: utils_1.EntityWithDelegationTypeName.Document }, yield
|
|
661
|
+
return yield this.crypto.xapi.tryDecryptDataOf({ entity: document, type: utils_1.EntityWithDelegationTypeName.Document }, yield _super.getRawMainDocumentAttachment.call(this, document.id), (x) => validator(x));
|
|
695
662
|
});
|
|
696
663
|
}
|
|
697
664
|
/**
|
|
@@ -721,8 +688,11 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
721
688
|
* - wasDecrypted: if the data was successfully decrypted or not
|
|
722
689
|
*/
|
|
723
690
|
getAndTryDecryptSecondaryDocumentAttachment(document_1, secondaryAttachmentKey_1) {
|
|
691
|
+
const _super = Object.create(null, {
|
|
692
|
+
getSecondaryAttachment: { get: () => super.getSecondaryAttachment }
|
|
693
|
+
});
|
|
724
694
|
return __awaiter(this, arguments, void 0, function* (document, secondaryAttachmentKey, validator = () => Promise.resolve(true)) {
|
|
725
|
-
return yield this.crypto.xapi.tryDecryptDataOf({ entity: document, type: utils_1.EntityWithDelegationTypeName.Document }, yield
|
|
695
|
+
return yield this.crypto.xapi.tryDecryptDataOf({ entity: document, type: utils_1.EntityWithDelegationTypeName.Document }, yield _super.getSecondaryAttachment.call(this, document.id, secondaryAttachmentKey), (x) => validator(x));
|
|
726
696
|
});
|
|
727
697
|
}
|
|
728
698
|
/**
|
|
@@ -795,11 +765,14 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
795
765
|
* the operation failed.
|
|
796
766
|
*/
|
|
797
767
|
tryShareWithMany(document, delegates) {
|
|
768
|
+
const _super = Object.create(null, {
|
|
769
|
+
bulkShareDocument: { get: () => super.bulkShareDocument }
|
|
770
|
+
});
|
|
798
771
|
return __awaiter(this, void 0, void 0, function* () {
|
|
799
772
|
const self = yield this.dataOwnerApi.getCurrentDataOwnerId();
|
|
800
773
|
// All entities should have an encryption key.
|
|
801
774
|
const entityWithEncryptionKey = yield this.crypto.xapi.ensureEncryptionKeysInitialised(document, utils_1.EntityWithDelegationTypeName.Document);
|
|
802
|
-
const updatedEntity = entityWithEncryptionKey ? yield this.
|
|
775
|
+
const updatedEntity = entityWithEncryptionKey ? yield this.modifyDocumentWithUser(undefined, entityWithEncryptionKey) : document;
|
|
803
776
|
return this.crypto.xapi
|
|
804
777
|
.simpleShareOrUpdateEncryptedEntityMetadata({
|
|
805
778
|
entity: updatedEntity,
|
|
@@ -812,8 +785,8 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
812
785
|
shareOwningEntityIds: options.shareMessageId,
|
|
813
786
|
shareSecretIds: options.shareSecretIds,
|
|
814
787
|
},
|
|
815
|
-
])), (x) =>
|
|
816
|
-
.then((r) => r);
|
|
788
|
+
])), (x) => _super.bulkShareDocument.call(this, x))
|
|
789
|
+
.then((r) => r.mapSuccessAsync((m) => __awaiter(this, void 0, void 0, function* () { return (yield this.decrypt([m]))[0].entity; })));
|
|
817
790
|
});
|
|
818
791
|
}
|
|
819
792
|
getDataOwnersWithAccessTo(entity) {
|
|
@@ -825,6 +798,195 @@ class IccDocumentXApi extends icc_api_1.IccDocumentApi {
|
|
|
825
798
|
createDelegationDeAnonymizationMetadata(entity, delegates) {
|
|
826
799
|
return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: utils_1.EntityWithDelegationTypeName.Document }, delegates);
|
|
827
800
|
}
|
|
801
|
+
decryptPage(page) {
|
|
802
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
803
|
+
var _a;
|
|
804
|
+
return Object.assign(Object.assign({}, page), { rows: (yield this.decrypt((_a = page.rows) !== null && _a !== void 0 ? _a : [])).map((x) => x.entity) });
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
createDocumentWithUser(user, body) {
|
|
808
|
+
const _super = Object.create(null, {
|
|
809
|
+
createDocument: { get: () => super.createDocument }
|
|
810
|
+
});
|
|
811
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
812
|
+
return (yield this.decrypt([yield _super.createDocument.call(this, (yield this.encrypt([body]))[0])]))[0].entity;
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
deleteAttachmentWithUser(user, documentId) {
|
|
816
|
+
const _super = Object.create(null, {
|
|
817
|
+
deleteAttachment: { get: () => super.deleteAttachment }
|
|
818
|
+
});
|
|
819
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
820
|
+
return (yield this.decrypt([yield _super.deleteAttachment.call(this, documentId)]))[0].entity;
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* @deprecated
|
|
825
|
+
*/
|
|
826
|
+
findByTypeHCPartyMessageSecretFKeysWithUser(user, documentTypeCode, hcPartyId, secretFKeys) {
|
|
827
|
+
const _super = Object.create(null, {
|
|
828
|
+
findByTypeHCPartyMessageSecretFKeys: { get: () => super.findByTypeHCPartyMessageSecretFKeys }
|
|
829
|
+
});
|
|
830
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
831
|
+
return (yield this.decrypt(yield _super.findByTypeHCPartyMessageSecretFKeys.call(this, documentTypeCode, hcPartyId, secretFKeys))).map((x) => x.entity);
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* @deprecated
|
|
836
|
+
*/
|
|
837
|
+
findDocumentsByHCPartyPatientForeignKeysWithUser(user, hcPartyId, secretFKeys) {
|
|
838
|
+
const _super = Object.create(null, {
|
|
839
|
+
findDocumentsByHCPartyPatientForeignKeys: { get: () => super.findDocumentsByHCPartyPatientForeignKeys }
|
|
840
|
+
});
|
|
841
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
842
|
+
return (yield this.decrypt(yield _super.findDocumentsByHCPartyPatientForeignKeys.call(this, hcPartyId, secretFKeys))).map((x) => x.entity);
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* @deprecated
|
|
847
|
+
*/
|
|
848
|
+
findDocumentsByHCPartyPatientForeignKeyWithUser(user, hcPartyId, secretFKey, startKey, startDocumentId, limit) {
|
|
849
|
+
const _super = Object.create(null, {
|
|
850
|
+
findDocumentsByHCPartyPatientForeignKey: { get: () => super.findDocumentsByHCPartyPatientForeignKey }
|
|
851
|
+
});
|
|
852
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
853
|
+
return yield this.decryptPage(yield _super.findDocumentsByHCPartyPatientForeignKey.call(this, hcPartyId, secretFKey, startKey, startDocumentId, limit));
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
findWithoutDelegationWithUser(user, limit) {
|
|
857
|
+
const _super = Object.create(null, {
|
|
858
|
+
findWithoutDelegation: { get: () => super.findWithoutDelegation }
|
|
859
|
+
});
|
|
860
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
861
|
+
return (yield this.decrypt(yield _super.findWithoutDelegation.call(this, limit))).map((x) => x.entity);
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
getDocumentWithUser(user, documentId) {
|
|
865
|
+
const _super = Object.create(null, {
|
|
866
|
+
getDocument: { get: () => super.getDocument }
|
|
867
|
+
});
|
|
868
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
869
|
+
return (yield this.decrypt([yield _super.getDocument.call(this, documentId)]))[0].entity;
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
getDocumentByExternalUuidWithUser(user, externalUuid) {
|
|
873
|
+
const _super = Object.create(null, {
|
|
874
|
+
getDocumentByExternalUuid: { get: () => super.getDocumentByExternalUuid }
|
|
875
|
+
});
|
|
876
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
877
|
+
return (yield this.decrypt([yield _super.getDocumentByExternalUuid.call(this, externalUuid)]))[0].entity;
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
getDocumentsWithUser(user, body) {
|
|
881
|
+
const _super = Object.create(null, {
|
|
882
|
+
getDocuments: { get: () => super.getDocuments }
|
|
883
|
+
});
|
|
884
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
885
|
+
return (yield this.decrypt(yield _super.getDocuments.call(this, body))).map((x) => x.entity);
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
getDocumentsByExternalUuidWithUser(user, externalUuid) {
|
|
889
|
+
const _super = Object.create(null, {
|
|
890
|
+
getDocumentsByExternalUuid: { get: () => super.getDocumentsByExternalUuid }
|
|
891
|
+
});
|
|
892
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
893
|
+
return (yield this.decrypt(yield _super.getDocumentsByExternalUuid.call(this, externalUuid))).map((x) => x.entity);
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
modifyDocumentWithUser(user, body) {
|
|
897
|
+
const _super = Object.create(null, {
|
|
898
|
+
modifyDocument: { get: () => super.modifyDocument }
|
|
899
|
+
});
|
|
900
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
901
|
+
return (yield this.decrypt([yield _super.modifyDocument.call(this, (yield this.encrypt([body]))[0])]))[0].entity;
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
modifyDocumentsWithUser(user, body) {
|
|
905
|
+
const _super = Object.create(null, {
|
|
906
|
+
modifyDocuments: { get: () => super.modifyDocuments }
|
|
907
|
+
});
|
|
908
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
909
|
+
return (yield this.decrypt(yield _super.modifyDocuments.call(this, yield this.encrypt(body)))).map((x) => x.entity);
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
setMainDocumentAttachmentWithUser(user, documentId, documentRev, body, utis, dataIsEncrypted) {
|
|
913
|
+
const _super = Object.create(null, {
|
|
914
|
+
setMainDocumentAttachment: { get: () => super.setMainDocumentAttachment }
|
|
915
|
+
});
|
|
916
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
917
|
+
return (yield this.decrypt([yield _super.setMainDocumentAttachment.call(this, documentId, documentRev, body, utis, dataIsEncrypted)]))[0].entity;
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
setSecondaryAttachmentWithUser(user, documentId, key, rev, attachment, utis, dataIsEncrypted) {
|
|
921
|
+
const _super = Object.create(null, {
|
|
922
|
+
setSecondaryAttachment: { get: () => super.setSecondaryAttachment }
|
|
923
|
+
});
|
|
924
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
925
|
+
return (yield this.decrypt([yield _super.setSecondaryAttachment.call(this, documentId, key, rev, attachment, utis, dataIsEncrypted)]))[0].entity;
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
deleteSecondaryAttachmentWithUser(user, documentId, key, rev) {
|
|
929
|
+
const _super = Object.create(null, {
|
|
930
|
+
deleteSecondaryAttachment: { get: () => super.deleteSecondaryAttachment }
|
|
931
|
+
});
|
|
932
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
933
|
+
return (yield this.decrypt([yield _super.deleteSecondaryAttachment.call(this, documentId, key, rev)]))[0].entity;
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
createDocument(body) {
|
|
937
|
+
throw new Error('Use withUser method');
|
|
938
|
+
}
|
|
939
|
+
deleteAttachment(documentId) {
|
|
940
|
+
throw new Error('Use withUser method');
|
|
941
|
+
}
|
|
942
|
+
findByTypeHCPartyMessageSecretFKeys(documentTypeCode, hcPartyId, secretFKeys) {
|
|
943
|
+
throw new Error('Use withUser method');
|
|
944
|
+
}
|
|
945
|
+
findDocumentsByHCPartyPatientForeignKeys(hcPartyId, secretFKeys) {
|
|
946
|
+
throw new Error('Use withUser method');
|
|
947
|
+
}
|
|
948
|
+
findDocumentsByHCPartyPatientForeignKey(hcPartyId, secretFKey, startKey, startDocumentId, limit) {
|
|
949
|
+
throw new Error('Use withUser method');
|
|
950
|
+
}
|
|
951
|
+
findWithoutDelegation(limit) {
|
|
952
|
+
throw new Error('Use withUser method');
|
|
953
|
+
}
|
|
954
|
+
getDocument(documentId) {
|
|
955
|
+
throw new Error('Use withUser method');
|
|
956
|
+
}
|
|
957
|
+
getDocumentByExternalUuid(externalUuid) {
|
|
958
|
+
throw new Error('Use withUser method');
|
|
959
|
+
}
|
|
960
|
+
getDocuments(body) {
|
|
961
|
+
throw new Error('Use withUser method');
|
|
962
|
+
}
|
|
963
|
+
getDocumentsByExternalUuid(externalUuid) {
|
|
964
|
+
throw new Error('Use withUser method');
|
|
965
|
+
}
|
|
966
|
+
modifyDocument(body) {
|
|
967
|
+
throw new Error('Use withUser method');
|
|
968
|
+
}
|
|
969
|
+
modifyDocuments(body) {
|
|
970
|
+
throw new Error('Use withUser method');
|
|
971
|
+
}
|
|
972
|
+
setMainDocumentAttachment(documentId, documentRev, body, utis, dataIsEncrypted) {
|
|
973
|
+
throw new Error('Use withUser method');
|
|
974
|
+
}
|
|
975
|
+
setDocumentAttachmentBody(documentId, documentRev, enckeys, body, utis) {
|
|
976
|
+
throw new Error('Use withUser method');
|
|
977
|
+
}
|
|
978
|
+
setDocumentAttachment(documentId, documentRev, enckeys, body, utis) {
|
|
979
|
+
throw new Error('Use withUser method');
|
|
980
|
+
}
|
|
981
|
+
setDocumentAttachmentMulti(attachment, documentRev, documentId, enckeys) {
|
|
982
|
+
throw new Error('Use withUser method');
|
|
983
|
+
}
|
|
984
|
+
setSecondaryAttachment(documentId, key, rev, attachment, utis, dataIsEncrypted) {
|
|
985
|
+
throw new Error('Use withUser method');
|
|
986
|
+
}
|
|
987
|
+
deleteSecondaryAttachment(documentId, key, rev) {
|
|
988
|
+
throw new Error('Use withUser method');
|
|
989
|
+
}
|
|
828
990
|
}
|
|
829
991
|
exports.IccDocumentXApi = IccDocumentXApi;
|
|
830
992
|
//# sourceMappingURL=icc-document-x-api.js.map
|