@icure/api 7.1.14 → 8.0.0-RC.1
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/IccAccesslogApi.d.ts +12 -1
- package/icc-api/api/IccAccesslogApi.js +142 -98
- package/icc-api/api/IccAccesslogApi.js.map +1 -1
- package/icc-api/api/IccBemikronoApi.d.ts +81 -0
- package/icc-api/api/IccBemikronoApi.js +163 -0
- package/icc-api/api/IccBemikronoApi.js.map +1 -0
- package/icc-api/api/IccCalendarItemApi.d.ts +21 -1
- package/icc-api/api/IccCalendarItemApi.js +183 -117
- package/icc-api/api/IccCalendarItemApi.js.map +1 -1
- package/icc-api/api/IccClassificationApi.d.ts +21 -1
- package/icc-api/api/IccClassificationApi.js +119 -63
- package/icc-api/api/IccClassificationApi.js.map +1 -1
- package/icc-api/api/IccContactApi.d.ts +21 -1
- package/icc-api/api/IccContactApi.js +385 -294
- package/icc-api/api/IccContactApi.js.map +1 -1
- package/icc-api/api/IccDocumentApi.d.ts +32 -25
- package/icc-api/api/IccDocumentApi.js +264 -212
- package/icc-api/api/IccDocumentApi.js.map +1 -1
- package/icc-api/api/IccExchangeDataApi.d.ts +19 -0
- package/icc-api/api/IccExchangeDataApi.js +85 -0
- package/icc-api/api/IccExchangeDataApi.js.map +1 -0
- package/icc-api/api/IccExchangeDataMapApi.d.ts +18 -0
- package/icc-api/api/IccExchangeDataMapApi.js +65 -0
- package/icc-api/api/IccExchangeDataMapApi.js.map +1 -0
- package/icc-api/api/IccFormApi.d.ts +21 -1
- package/icc-api/api/IccFormApi.js +321 -229
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-api/api/IccHelementApi.d.ts +21 -1
- package/icc-api/api/IccHelementApi.js +207 -137
- package/icc-api/api/IccHelementApi.js.map +1 -1
- package/icc-api/api/IccInvoiceApi.d.ts +21 -1
- package/icc-api/api/IccInvoiceApi.js +404 -298
- package/icc-api/api/IccInvoiceApi.js.map +1 -1
- package/icc-api/api/IccMaintenanceTaskApi.d.ts +12 -1
- package/icc-api/api/IccMaintenanceTaskApi.js +79 -43
- package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
- package/icc-api/api/IccMessageApi.d.ts +12 -1
- package/icc-api/api/IccMessageApi.js +257 -191
- package/icc-api/api/IccMessageApi.js.map +1 -1
- package/icc-api/api/IccPatientApi.d.ts +12 -1
- package/icc-api/api/IccPatientApi.js +447 -351
- package/icc-api/api/IccPatientApi.js.map +1 -1
- package/icc-api/api/IccReceiptApi.d.ts +22 -8
- package/icc-api/api/IccReceiptApi.js +121 -64
- package/icc-api/api/IccReceiptApi.js.map +1 -1
- package/icc-api/api/IccRestApiPath.js +1 -1
- package/icc-api/api/IccRestApiPath.js.map +1 -1
- package/icc-api/api/IccTimeTableApi.d.ts +12 -1
- package/icc-api/api/IccTimeTableApi.js +86 -48
- package/icc-api/api/IccTimeTableApi.js.map +1 -1
- package/icc-api/index.d.ts +1 -0
- package/icc-api/index.js +1 -0
- package/icc-api/index.js.map +1 -1
- package/icc-api/model/AccessLog.d.ts +4 -0
- package/icc-api/model/AccessLog.js +1 -0
- package/icc-api/model/AccessLog.js.map +1 -1
- package/icc-api/model/Article.d.ts +4 -0
- package/icc-api/model/Article.js +1 -0
- package/icc-api/model/Article.js.map +1 -1
- package/icc-api/model/CalendarItem.d.ts +4 -0
- package/icc-api/model/CalendarItem.js +1 -0
- package/icc-api/model/CalendarItem.js.map +1 -1
- package/icc-api/model/Classification.d.ts +4 -0
- package/icc-api/model/Classification.js +1 -0
- package/icc-api/model/Classification.js.map +1 -1
- package/icc-api/model/ClassificationTemplate.d.ts +2 -0
- package/icc-api/model/ClassificationTemplate.js.map +1 -1
- package/icc-api/model/Contact.d.ts +4 -0
- package/icc-api/model/Contact.js +1 -0
- package/icc-api/model/Contact.js.map +1 -1
- package/icc-api/model/Device.d.ts +4 -4
- package/icc-api/model/Device.js.map +1 -1
- package/icc-api/model/Document.d.ts +4 -0
- package/icc-api/model/Document.js +1 -0
- package/icc-api/model/Document.js.map +1 -1
- package/icc-api/model/ExchangeData.d.ts +61 -0
- package/icc-api/model/ExchangeData.js +12 -0
- package/icc-api/model/ExchangeData.js.map +1 -0
- package/icc-api/model/ExchangeDataMap.d.ts +21 -0
- package/icc-api/model/ExchangeDataMap.js +10 -0
- package/icc-api/model/ExchangeDataMap.js.map +1 -0
- package/icc-api/model/ExchangeDataMapCreationBatch.d.ts +13 -0
- package/icc-api/model/ExchangeDataMapCreationBatch.js +10 -0
- package/icc-api/model/ExchangeDataMapCreationBatch.js.map +1 -0
- package/icc-api/model/Form.d.ts +4 -0
- package/icc-api/model/Form.js +1 -0
- package/icc-api/model/Form.js.map +1 -1
- package/icc-api/model/HealthElement.d.ts +4 -0
- package/icc-api/model/HealthElement.js +1 -0
- package/icc-api/model/HealthElement.js.map +1 -1
- package/icc-api/model/HealthcareParty.d.ts +2 -2
- package/icc-api/model/HealthcareParty.js.map +1 -1
- package/icc-api/model/IcureStub.d.ts +2 -0
- package/icc-api/model/IcureStub.js.map +1 -1
- package/icc-api/model/Invoice.d.ts +4 -0
- package/icc-api/model/Invoice.js +1 -0
- package/icc-api/model/Invoice.js.map +1 -1
- package/icc-api/model/MaintenanceTask.d.ts +4 -0
- package/icc-api/model/MaintenanceTask.js +1 -0
- package/icc-api/model/MaintenanceTask.js.map +1 -1
- package/icc-api/model/Message.d.ts +4 -0
- package/icc-api/model/Message.js +1 -0
- package/icc-api/model/Message.js.map +1 -1
- package/icc-api/model/PaginatedListExchangeData.d.ts +9 -0
- package/icc-api/model/PaginatedListExchangeData.js +10 -0
- package/icc-api/model/PaginatedListExchangeData.js.map +1 -0
- package/icc-api/model/Patient.d.ts +6 -2
- package/icc-api/model/Patient.js +1 -0
- package/icc-api/model/Patient.js.map +1 -1
- package/icc-api/model/PatientByHcPartyGenderEducationProfession.d.ts +31 -0
- package/icc-api/model/PatientByHcPartyGenderEducationProfession.js +32 -0
- package/icc-api/model/PatientByHcPartyGenderEducationProfession.js.map +1 -0
- package/icc-api/model/Receipt.d.ts +4 -0
- package/icc-api/model/Receipt.js +1 -0
- package/icc-api/model/Receipt.js.map +1 -1
- package/icc-api/model/SecureDelegation.d.ts +52 -0
- package/icc-api/model/SecureDelegation.js +16 -0
- package/icc-api/model/SecureDelegation.js.map +1 -0
- package/icc-api/model/SecurityMetadata.d.ts +33 -0
- package/icc-api/model/SecurityMetadata.js +13 -0
- package/icc-api/model/SecurityMetadata.js.map +1 -0
- package/icc-api/model/Service.d.ts +2 -0
- package/icc-api/model/Service.js.map +1 -1
- package/icc-api/model/TimeTable.d.ts +4 -0
- package/icc-api/model/TimeTable.js +1 -0
- package/icc-api/model/TimeTable.js.map +1 -1
- package/icc-api/model/models.d.ts +20 -39
- package/icc-api/model/models.js +15 -37
- package/icc-api/model/models.js.map +1 -1
- package/icc-api/model/requests/EntityBulkShareResult.d.ts +28 -0
- package/icc-api/model/requests/EntityBulkShareResult.js +16 -0
- package/icc-api/model/requests/EntityBulkShareResult.js.map +1 -0
- package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.d.ts +10 -0
- package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.js +17 -0
- package/icc-api/model/requests/EntityShareOrMetadataUpdateRequest.js.map +1 -0
- package/icc-api/model/requests/EntityShareRequest.d.ts +110 -0
- package/icc-api/model/requests/EntityShareRequest.js +63 -0
- package/icc-api/model/requests/EntityShareRequest.js.map +1 -0
- package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.d.ts +54 -0
- package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js +24 -0
- package/icc-api/model/requests/EntitySharedMetadataUpdateRequest.js.map +1 -0
- package/icc-api/model/requests/MinimalEntityBulkShareResult.d.ts +23 -0
- package/icc-api/model/requests/MinimalEntityBulkShareResult.js +13 -0
- package/icc-api/model/requests/MinimalEntityBulkShareResult.js.map +1 -0
- package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.d.ts +21 -0
- package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.js +14 -0
- package/icc-api/model/requests/RejectedShareOrMetadataUpdateRequest.js.map +1 -0
- package/icc-x-api/basexapi/EncryptedEntityXApi.d.ts +3 -2
- package/icc-x-api/basexapi/EncryptedEntityXApi.js.map +1 -1
- package/icc-x-api/crypto/AES.js +1 -1
- package/icc-x-api/crypto/AES.js.map +1 -1
- package/icc-x-api/crypto/AccessControlKeysHeadersProvider.d.ts +16 -0
- package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js +41 -0
- package/icc-x-api/crypto/AccessControlKeysHeadersProvider.js.map +1 -0
- package/icc-x-api/crypto/AccessControlSecretUtils.d.ts +42 -0
- package/icc-x-api/crypto/AccessControlSecretUtils.js +86 -0
- package/icc-x-api/crypto/AccessControlSecretUtils.js.map +1 -0
- package/icc-x-api/crypto/BaseExchangeDataManager.d.ts +146 -0
- package/icc-x-api/crypto/BaseExchangeDataManager.js +342 -0
- package/icc-x-api/crypto/BaseExchangeDataManager.js.map +1 -0
- package/icc-x-api/crypto/BaseExchangeKeysManager.d.ts +0 -18
- package/icc-x-api/crypto/BaseExchangeKeysManager.js +11 -85
- package/icc-x-api/crypto/BaseExchangeKeysManager.js.map +1 -1
- package/icc-x-api/crypto/ConfidentialEntities.d.ts +26 -16
- package/icc-x-api/crypto/ConfidentialEntities.js +30 -17
- package/icc-x-api/crypto/ConfidentialEntities.js.map +1 -1
- package/icc-x-api/crypto/CryptoStrategies.d.ts +8 -1
- package/icc-x-api/crypto/CryptoStrategies.js.map +1 -1
- package/icc-x-api/crypto/ExchangeDataManager.d.ts +95 -0
- package/icc-x-api/crypto/ExchangeDataManager.js +493 -0
- package/icc-x-api/crypto/ExchangeDataManager.js.map +1 -0
- package/icc-x-api/crypto/ExchangeDataMapManager.d.ts +32 -0
- package/icc-x-api/crypto/ExchangeDataMapManager.js +70 -0
- package/icc-x-api/crypto/ExchangeDataMapManager.js.map +1 -0
- package/icc-x-api/crypto/ExchangeKeysManager.d.ts +4 -16
- package/icc-x-api/crypto/ExchangeKeysManager.js +4 -62
- package/icc-x-api/crypto/ExchangeKeysManager.js.map +1 -1
- package/icc-x-api/crypto/ExtendedApisUtils.d.ts +336 -0
- package/icc-x-api/crypto/ExtendedApisUtils.js +3 -0
- package/icc-x-api/crypto/ExtendedApisUtils.js.map +1 -0
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.d.ts +181 -0
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.js +562 -0
- package/icc-x-api/crypto/ExtendedApisUtilsImpl.js.map +1 -0
- package/icc-x-api/crypto/KeyRecovery.d.ts +5 -2
- package/icc-x-api/crypto/KeyRecovery.js +59 -29
- package/icc-x-api/crypto/KeyRecovery.js.map +1 -1
- package/icc-x-api/crypto/LegacyCryptoStrategies.d.ts +7 -2
- package/icc-x-api/crypto/LegacyCryptoStrategies.js +8 -1
- package/icc-x-api/crypto/LegacyCryptoStrategies.js.map +1 -1
- package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.d.ts +39 -0
- package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.js +150 -0
- package/icc-x-api/crypto/LegacyDelegationSecurityMetadataDecryptor.js.map +1 -0
- package/icc-x-api/crypto/RSA.d.ts +34 -8
- package/icc-x-api/crypto/RSA.js +80 -13
- package/icc-x-api/crypto/RSA.js.map +1 -1
- package/icc-x-api/crypto/SecureDelegationsEncryption.d.ts +54 -0
- package/icc-x-api/crypto/SecureDelegationsEncryption.js +178 -0
- package/icc-x-api/crypto/SecureDelegationsEncryption.js.map +1 -0
- package/icc-x-api/crypto/SecureDelegationsManager.d.ts +66 -0
- package/icc-x-api/crypto/SecureDelegationsManager.js +261 -0
- package/icc-x-api/crypto/SecureDelegationsManager.js.map +1 -0
- package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.d.ts +37 -0
- package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js +294 -0
- package/icc-x-api/crypto/SecureDelegationsSecurityMetadataDecryptor.js.map +1 -0
- package/icc-x-api/crypto/SecurityMetadataDecryptor.d.ts +114 -0
- package/icc-x-api/crypto/SecurityMetadataDecryptor.js +98 -0
- package/icc-x-api/crypto/SecurityMetadataDecryptor.js.map +1 -0
- package/icc-x-api/crypto/ShamirKeysManager.d.ts +5 -5
- package/icc-x-api/crypto/ShamirKeysManager.js +6 -9
- package/icc-x-api/crypto/ShamirKeysManager.js.map +1 -1
- package/icc-x-api/crypto/TransferKeysManager.d.ts +8 -6
- package/icc-x-api/crypto/TransferKeysManager.js +75 -52
- package/icc-x-api/crypto/TransferKeysManager.js.map +1 -1
- package/icc-x-api/crypto/{KeyManager.d.ts → UserEncryptionKeysManager.d.ts} +4 -6
- package/icc-x-api/crypto/{KeyManager.js → UserEncryptionKeysManager.js} +43 -23
- package/icc-x-api/crypto/UserEncryptionKeysManager.js.map +1 -0
- package/icc-x-api/crypto/UserSignatureKeysManager.d.ts +26 -0
- package/icc-x-api/crypto/UserSignatureKeysManager.js +74 -0
- package/icc-x-api/crypto/UserSignatureKeysManager.js.map +1 -0
- package/icc-x-api/crypto/utils.d.ts +61 -11
- package/icc-x-api/crypto/utils.js +113 -44
- package/icc-x-api/crypto/utils.js.map +1 -1
- package/icc-x-api/filters/filters.js.map +1 -1
- package/icc-x-api/icc-accesslog-x-api.d.ts +46 -11
- package/icc-x-api/icc-accesslog-x-api.js +75 -42
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +50 -14
- package/icc-x-api/icc-calendar-item-x-api.js +99 -49
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.d.ts +44 -9
- package/icc-x-api/icc-classification-x-api.js +56 -31
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +56 -32
- package/icc-x-api/icc-contact-x-api.js +95 -64
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-crypto-x-api.d.ts +28 -334
- package/icc-x-api/icc-crypto-x-api.js +41 -765
- package/icc-x-api/icc-crypto-x-api.js.map +1 -1
- package/icc-x-api/icc-data-owner-x-api.d.ts +20 -8
- package/icc-x-api/icc-data-owner-x-api.js +31 -10
- package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +48 -11
- package/icc-x-api/icc-document-x-api.js +111 -64
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.d.ts +45 -10
- package/icc-x-api/icc-form-x-api.js +65 -35
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-hcparty-x-api.d.ts +2 -2
- package/icc-x-api/icc-hcparty-x-api.js +3 -3
- package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +55 -18
- package/icc-x-api/icc-helement-x-api.js +76 -41
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-icure-maintenance-x-api.d.ts +7 -2
- package/icc-x-api/icc-icure-maintenance-x-api.js +38 -27
- package/icc-x-api/icc-icure-maintenance-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.d.ts +50 -15
- package/icc-x-api/icc-invoice-x-api.js +63 -33
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-maintenance-task-x-api.d.ts +53 -21
- package/icc-x-api/icc-maintenance-task-x-api.js +72 -35
- package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +53 -15
- package/icc-x-api/icc-message-x-api.js +65 -36
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +84 -29
- package/icc-x-api/icc-patient-x-api.js +313 -378
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-receipt-x-api.d.ts +44 -12
- package/icc-x-api/icc-receipt-x-api.js +67 -35
- package/icc-x-api/icc-receipt-x-api.js.map +1 -1
- package/icc-x-api/icc-time-table-x-api.d.ts +43 -12
- package/icc-x-api/icc-time-table-x-api.js +56 -26
- package/icc-x-api/icc-time-table-x-api.js.map +1 -1
- package/icc-x-api/icc-user-x-api.d.ts +2 -2
- package/icc-x-api/icc-user-x-api.js +3 -3
- package/icc-x-api/icc-user-x-api.js.map +1 -1
- package/icc-x-api/index.d.ts +4 -2
- package/icc-x-api/index.js +154 -135
- package/icc-x-api/index.js.map +1 -1
- package/icc-x-api/storage/DefaultStorageEntryKeysFactory.d.ts +2 -0
- package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js +9 -2
- package/icc-x-api/storage/DefaultStorageEntryKeysFactory.js.map +1 -1
- package/icc-x-api/storage/IcureStorageFacade.d.ts +23 -2
- package/icc-x-api/storage/IcureStorageFacade.js +36 -2
- package/icc-x-api/storage/IcureStorageFacade.js.map +1 -1
- package/icc-x-api/storage/KeyStorageFacade.d.ts +12 -0
- package/icc-x-api/storage/KeyStorageFacade.js.map +1 -1
- package/icc-x-api/storage/KeyStorageImpl.d.ts +2 -0
- package/icc-x-api/storage/KeyStorageImpl.js +10 -0
- package/icc-x-api/storage/KeyStorageImpl.js.map +1 -1
- package/icc-x-api/storage/StorageEntryKeysFactory.d.ts +14 -1
- package/icc-x-api/storage/StorageEntryKeysFactory.js.map +1 -1
- package/icc-x-api/utils/EntityWithDelegationTypeName.d.ts +32 -0
- package/icc-x-api/utils/EntityWithDelegationTypeName.js +75 -0
- package/icc-x-api/utils/EntityWithDelegationTypeName.js.map +1 -0
- package/icc-x-api/utils/ShareResult.d.ts +74 -0
- package/icc-x-api/utils/ShareResult.js +61 -0
- package/icc-x-api/utils/ShareResult.js.map +1 -0
- package/icc-x-api/utils/binary-utils.d.ts +1 -0
- package/icc-x-api/utils/binary-utils.js +8 -1
- package/icc-x-api/utils/binary-utils.js.map +1 -1
- package/icc-x-api/utils/collection-utils.d.ts +5 -0
- package/icc-x-api/utils/collection-utils.js +26 -1
- package/icc-x-api/utils/collection-utils.js.map +1 -1
- package/icc-x-api/utils/crypto-utils.d.ts +4 -3
- package/icc-x-api/utils/crypto-utils.js +5 -4
- package/icc-x-api/utils/crypto-utils.js.map +1 -1
- package/icc-x-api/utils/lru-temporised-async-cache.d.ts +26 -3
- package/icc-x-api/utils/lru-temporised-async-cache.js +75 -15
- package/icc-x-api/utils/lru-temporised-async-cache.js.map +1 -1
- package/icc-x-api/utils/websocket.d.ts +10 -10
- package/icc-x-api/utils/websocket.js +18 -9
- package/icc-x-api/utils/websocket.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +2 -3
- package/icc-x-api/crypto/EntitiesEncryption.d.ts +0 -275
- package/icc-x-api/crypto/EntitiesEncryption.js +0 -734
- package/icc-x-api/crypto/EntitiesEncryption.js.map +0 -1
- package/icc-x-api/crypto/KeyManager.js.map +0 -1
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.IccPatientApi = void 0;
|
|
4
13
|
/**
|
|
@@ -22,15 +31,19 @@ const PaginatedListString_1 = require("../model/PaginatedListString");
|
|
|
22
31
|
const Patient_1 = require("../model/Patient");
|
|
23
32
|
const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
|
|
24
33
|
const IccRestApiPath_1 = require("./IccRestApiPath");
|
|
34
|
+
const EntityBulkShareResult_1 = require("../model/requests/EntityBulkShareResult");
|
|
25
35
|
class IccPatientApi {
|
|
36
|
+
get headers() {
|
|
37
|
+
return Promise.resolve(this._headers);
|
|
38
|
+
}
|
|
26
39
|
constructor(host, headers, authenticationProvider, fetchImpl) {
|
|
27
40
|
this.host = (0, IccRestApiPath_1.iccRestApiPath)(host);
|
|
28
|
-
this.
|
|
41
|
+
this._headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
|
|
29
42
|
this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new AuthenticationProvider_1.NoAuthenticationProvider();
|
|
30
43
|
this.fetchImpl = fetchImpl;
|
|
31
44
|
}
|
|
32
45
|
setHeaders(h) {
|
|
33
|
-
this.
|
|
46
|
+
this._headers = h;
|
|
34
47
|
}
|
|
35
48
|
handleError(e) {
|
|
36
49
|
throw e;
|
|
@@ -41,14 +54,16 @@ class IccPatientApi {
|
|
|
41
54
|
* @param body
|
|
42
55
|
*/
|
|
43
56
|
bulkCreatePatients(body) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
let _body = null;
|
|
59
|
+
_body = body;
|
|
60
|
+
const _url = this.host + `/patient/batch` + '?ts=' + new Date().getTime();
|
|
61
|
+
let headers = yield this.headers;
|
|
62
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
63
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
64
|
+
.then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
|
|
65
|
+
.catch((err) => this.handleError(err));
|
|
66
|
+
});
|
|
52
67
|
}
|
|
53
68
|
/**
|
|
54
69
|
* Returns the id and _rev of created patients
|
|
@@ -56,14 +71,16 @@ class IccPatientApi {
|
|
|
56
71
|
* @param body
|
|
57
72
|
*/
|
|
58
73
|
bulkCreatePatients1(body) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
let _body = null;
|
|
76
|
+
_body = body;
|
|
77
|
+
const _url = this.host + `/patient/bulk` + '?ts=' + new Date().getTime();
|
|
78
|
+
let headers = yield this.headers;
|
|
79
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
80
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
81
|
+
.then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
|
|
82
|
+
.catch((err) => this.handleError(err));
|
|
83
|
+
});
|
|
67
84
|
}
|
|
68
85
|
/**
|
|
69
86
|
* Returns the id and _rev of modified patients
|
|
@@ -71,14 +88,16 @@ class IccPatientApi {
|
|
|
71
88
|
* @param body
|
|
72
89
|
*/
|
|
73
90
|
bulkUpdatePatients(body) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
let _body = null;
|
|
93
|
+
_body = body;
|
|
94
|
+
const _url = this.host + `/patient/batch` + '?ts=' + new Date().getTime();
|
|
95
|
+
let headers = yield this.headers;
|
|
96
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
97
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
98
|
+
.then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
|
|
99
|
+
.catch((err) => this.handleError(err));
|
|
100
|
+
});
|
|
82
101
|
}
|
|
83
102
|
/**
|
|
84
103
|
* Returns the id and _rev of modified patients
|
|
@@ -86,14 +105,16 @@ class IccPatientApi {
|
|
|
86
105
|
* @param body
|
|
87
106
|
*/
|
|
88
107
|
bulkUpdatePatients1(body) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
let _body = null;
|
|
110
|
+
_body = body;
|
|
111
|
+
const _url = this.host + `/patient/bulk` + '?ts=' + new Date().getTime();
|
|
112
|
+
let headers = yield this.headers;
|
|
113
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
114
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
115
|
+
.then((doc) => doc.body.map((it) => new IdWithRev_1.IdWithRev(it)))
|
|
116
|
+
.catch((err) => this.handleError(err));
|
|
117
|
+
});
|
|
97
118
|
}
|
|
98
119
|
/**
|
|
99
120
|
* Returns the count of patients
|
|
@@ -101,12 +122,14 @@ class IccPatientApi {
|
|
|
101
122
|
* @param hcPartyId Healthcare party id
|
|
102
123
|
*/
|
|
103
124
|
countOfPatients(hcPartyId) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.
|
|
109
|
-
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
let _body = null;
|
|
127
|
+
const _url = this.host + `/patient/hcParty/${encodeURIComponent(String(hcPartyId))}/count` + '?ts=' + new Date().getTime();
|
|
128
|
+
let headers = yield this.headers;
|
|
129
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
130
|
+
.then((doc) => new Content_1.Content(doc.body))
|
|
131
|
+
.catch((err) => this.handleError(err));
|
|
132
|
+
});
|
|
110
133
|
}
|
|
111
134
|
/**
|
|
112
135
|
* Name, last name, date of birth, and gender are required. After creation of the patient and obtaining the ID, you need to create an initial delegation.
|
|
@@ -114,14 +137,16 @@ class IccPatientApi {
|
|
|
114
137
|
* @param body
|
|
115
138
|
*/
|
|
116
139
|
createPatient(body) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
.
|
|
124
|
-
|
|
140
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
let _body = null;
|
|
142
|
+
_body = body;
|
|
143
|
+
const _url = this.host + `/patient` + '?ts=' + new Date().getTime();
|
|
144
|
+
let headers = yield this.headers;
|
|
145
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
146
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
147
|
+
.then((doc) => new Patient_1.Patient(doc.body))
|
|
148
|
+
.catch((err) => this.handleError(err));
|
|
149
|
+
});
|
|
125
150
|
}
|
|
126
151
|
/**
|
|
127
152
|
* Response is an array containing the ID of deleted patient..
|
|
@@ -129,12 +154,14 @@ class IccPatientApi {
|
|
|
129
154
|
* @param patientIds
|
|
130
155
|
*/
|
|
131
156
|
deletePatient(patientIds) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
let _body = null;
|
|
159
|
+
const _url = this.host + `/patient/${encodeURIComponent(String(patientIds))}` + '?ts=' + new Date().getTime();
|
|
160
|
+
let headers = yield this.headers;
|
|
161
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
162
|
+
.then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
|
|
163
|
+
.catch((err) => this.handleError(err));
|
|
164
|
+
});
|
|
138
165
|
}
|
|
139
166
|
/**
|
|
140
167
|
* Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
|
|
@@ -148,23 +175,25 @@ class IccPatientApi {
|
|
|
148
175
|
* @param desc Descending
|
|
149
176
|
*/
|
|
150
177
|
filterPatientsBy(startKey, startDocumentId, limit, skip, sort, desc, body) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
.
|
|
167
|
-
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
let _body = null;
|
|
180
|
+
_body = body;
|
|
181
|
+
const _url = this.host +
|
|
182
|
+
`/patient/filter` +
|
|
183
|
+
'?ts=' +
|
|
184
|
+
new Date().getTime() +
|
|
185
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
186
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
187
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
|
|
188
|
+
(skip ? '&skip=' + encodeURIComponent(String(skip)) : '') +
|
|
189
|
+
(sort ? '&sort=' + encodeURIComponent(String(sort)) : '') +
|
|
190
|
+
(desc ? '&desc=' + encodeURIComponent(String(desc)) : '');
|
|
191
|
+
let headers = yield this.headers;
|
|
192
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
193
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
194
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
195
|
+
.catch((err) => this.handleError(err));
|
|
196
|
+
});
|
|
168
197
|
}
|
|
169
198
|
/**
|
|
170
199
|
*
|
|
@@ -177,20 +206,22 @@ class IccPatientApi {
|
|
|
177
206
|
* @param limit Number of rows
|
|
178
207
|
*/
|
|
179
208
|
findByAccessLogUserAfterDate(userId, accessType, startDate, startKey, startDocumentId, limit) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
.
|
|
193
|
-
|
|
209
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
+
let _body = null;
|
|
211
|
+
const _url = this.host +
|
|
212
|
+
`/patient/byAccess/${encodeURIComponent(String(userId))}` +
|
|
213
|
+
'?ts=' +
|
|
214
|
+
new Date().getTime() +
|
|
215
|
+
(accessType ? '&accessType=' + encodeURIComponent(String(accessType)) : '') +
|
|
216
|
+
(startDate ? '&startDate=' + encodeURIComponent(String(startDate)) : '') +
|
|
217
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
218
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
219
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
|
|
220
|
+
let headers = yield this.headers;
|
|
221
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
222
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
223
|
+
.catch((err) => this.handleError(err));
|
|
224
|
+
});
|
|
194
225
|
}
|
|
195
226
|
/**
|
|
196
227
|
*
|
|
@@ -198,12 +229,14 @@ class IccPatientApi {
|
|
|
198
229
|
* @param externalId A external ID
|
|
199
230
|
*/
|
|
200
231
|
findByExternalId(externalId) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
.
|
|
206
|
-
|
|
232
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
233
|
+
let _body = null;
|
|
234
|
+
const _url = this.host + `/patient/byExternalId/${encodeURIComponent(String(externalId))}` + '?ts=' + new Date().getTime();
|
|
235
|
+
let headers = yield this.headers;
|
|
236
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
237
|
+
.then((doc) => new Patient_1.Patient(doc.body))
|
|
238
|
+
.catch((err) => this.handleError(err));
|
|
239
|
+
});
|
|
207
240
|
}
|
|
208
241
|
/**
|
|
209
242
|
* Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
|
|
@@ -216,21 +249,23 @@ class IccPatientApi {
|
|
|
216
249
|
* @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default.
|
|
217
250
|
*/
|
|
218
251
|
findByNameBirthSsinAuto(healthcarePartyId, filterValue, startKey, startDocumentId, limit, sortDirection) {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
.
|
|
233
|
-
|
|
252
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
253
|
+
let _body = null;
|
|
254
|
+
const _url = this.host +
|
|
255
|
+
`/patient/byNameBirthSsinAuto` +
|
|
256
|
+
'?ts=' +
|
|
257
|
+
new Date().getTime() +
|
|
258
|
+
(healthcarePartyId ? '&healthcarePartyId=' + encodeURIComponent(String(healthcarePartyId)) : '') +
|
|
259
|
+
(filterValue ? '&filterValue=' + encodeURIComponent(String(filterValue)) : '') +
|
|
260
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
261
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
262
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
|
|
263
|
+
(sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
|
|
264
|
+
let headers = yield this.headers;
|
|
265
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
266
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
267
|
+
.catch((err) => this.handleError(err));
|
|
268
|
+
});
|
|
234
269
|
}
|
|
235
270
|
/**
|
|
236
271
|
*
|
|
@@ -241,19 +276,21 @@ class IccPatientApi {
|
|
|
241
276
|
* @param limit Number of rows
|
|
242
277
|
*/
|
|
243
278
|
findDuplicatesByName(hcPartyId, startKey, startDocumentId, limit) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
.
|
|
256
|
-
|
|
279
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
280
|
+
let _body = null;
|
|
281
|
+
const _url = this.host +
|
|
282
|
+
`/patient/duplicates/name` +
|
|
283
|
+
'?ts=' +
|
|
284
|
+
new Date().getTime() +
|
|
285
|
+
(hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
|
|
286
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
287
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
288
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
|
|
289
|
+
let headers = yield this.headers;
|
|
290
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
291
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
292
|
+
.catch((err) => this.handleError(err));
|
|
293
|
+
});
|
|
257
294
|
}
|
|
258
295
|
/**
|
|
259
296
|
*
|
|
@@ -264,19 +301,21 @@ class IccPatientApi {
|
|
|
264
301
|
* @param limit Number of rows
|
|
265
302
|
*/
|
|
266
303
|
findDuplicatesBySsin(hcPartyId, startKey, startDocumentId, limit) {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
.
|
|
279
|
-
|
|
304
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
305
|
+
let _body = null;
|
|
306
|
+
const _url = this.host +
|
|
307
|
+
`/patient/duplicates/ssin` +
|
|
308
|
+
'?ts=' +
|
|
309
|
+
new Date().getTime() +
|
|
310
|
+
(hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
|
|
311
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
312
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
313
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
|
|
314
|
+
let headers = yield this.headers;
|
|
315
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
316
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
317
|
+
.catch((err) => this.handleError(err));
|
|
318
|
+
});
|
|
280
319
|
}
|
|
281
320
|
/**
|
|
282
321
|
* Returns a list of patients
|
|
@@ -286,18 +325,20 @@ class IccPatientApi {
|
|
|
286
325
|
* @param dateOfBirth The date of birth
|
|
287
326
|
*/
|
|
288
327
|
fuzzySearch(firstName, lastName, dateOfBirth) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
328
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
329
|
+
let _body = null;
|
|
330
|
+
const _url = this.host +
|
|
331
|
+
`/patient/fuzzy` +
|
|
332
|
+
'?ts=' +
|
|
333
|
+
new Date().getTime() +
|
|
334
|
+
(firstName ? '&firstName=' + encodeURIComponent(String(firstName)) : '') +
|
|
335
|
+
(lastName ? '&lastName=' + encodeURIComponent(String(lastName)) : '') +
|
|
336
|
+
(dateOfBirth ? '&dateOfBirth=' + encodeURIComponent(String(dateOfBirth)) : '');
|
|
337
|
+
let headers = yield this.headers;
|
|
338
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
339
|
+
.then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
|
|
340
|
+
.catch((err) => this.handleError(err));
|
|
341
|
+
});
|
|
301
342
|
}
|
|
302
343
|
/**
|
|
303
344
|
* It gets patient administrative data.
|
|
@@ -305,12 +346,14 @@ class IccPatientApi {
|
|
|
305
346
|
* @param patientId
|
|
306
347
|
*/
|
|
307
348
|
getPatient(patientId) {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
.
|
|
313
|
-
|
|
349
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
350
|
+
let _body = null;
|
|
351
|
+
const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}` + '?ts=' + new Date().getTime();
|
|
352
|
+
let headers = yield this.headers;
|
|
353
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
354
|
+
.then((doc) => new Patient_1.Patient(doc.body))
|
|
355
|
+
.catch((err) => this.handleError(err));
|
|
356
|
+
});
|
|
314
357
|
}
|
|
315
358
|
/**
|
|
316
359
|
* (key, value) of the map is as follows: (ID of the owner of the encrypted AES key, encrypted AES keys)
|
|
@@ -318,12 +361,14 @@ class IccPatientApi {
|
|
|
318
361
|
* @param patientId
|
|
319
362
|
*/
|
|
320
363
|
getPatientAesExchangeKeysForDelegate(patientId) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
.
|
|
326
|
-
|
|
364
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
365
|
+
let _body = null;
|
|
366
|
+
const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}/aesExchangeKeys` + '?ts=' + new Date().getTime();
|
|
367
|
+
let headers = yield this.headers;
|
|
368
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
369
|
+
.then((doc) => JSON.parse(JSON.stringify(doc.body)))
|
|
370
|
+
.catch((err) => this.handleError(err));
|
|
371
|
+
});
|
|
327
372
|
}
|
|
328
373
|
/**
|
|
329
374
|
* It gets patient administrative data based on the identifier (root & extension) parameters.
|
|
@@ -333,16 +378,18 @@ class IccPatientApi {
|
|
|
333
378
|
* @param system
|
|
334
379
|
*/
|
|
335
380
|
getPatientByHealthcarepartyAndIdentifier(hcPartyId, id, system) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
.
|
|
345
|
-
|
|
381
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
382
|
+
let _body = null;
|
|
383
|
+
const _url = this.host +
|
|
384
|
+
`/patient/${encodeURIComponent(String(hcPartyId))}/${encodeURIComponent(String(id))}` +
|
|
385
|
+
'?ts=' +
|
|
386
|
+
new Date().getTime() +
|
|
387
|
+
(system ? '&system=' + encodeURIComponent(String(system)) : '');
|
|
388
|
+
let headers = yield this.headers;
|
|
389
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
390
|
+
.then((doc) => new Patient_1.Patient(doc.body))
|
|
391
|
+
.catch((err) => this.handleError(err));
|
|
392
|
+
});
|
|
346
393
|
}
|
|
347
394
|
/**
|
|
348
395
|
* This endpoint is used to recover all keys that have already been created and that can be used to share information with this patient. It returns a map with the following structure: ID of the owner of the encrypted AES key -> encrypted AES key. The returned encrypted AES keys will have to be decrypted using the patient's private key. { \"hcparty 1 delegator ID\": \"AES hcparty key (encrypted using patient public RSA key)\" \"hcparty 2 delegator ID\": \"other AES hcparty key (encrypted using patient public RSA key)\" }
|
|
@@ -350,12 +397,14 @@ class IccPatientApi {
|
|
|
350
397
|
* @param patientId The patient Id for which information is shared
|
|
351
398
|
*/
|
|
352
399
|
getPatientHcPartyKeysForDelegate(patientId) {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
.
|
|
358
|
-
|
|
400
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
401
|
+
let _body = null;
|
|
402
|
+
const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}/keys` + '?ts=' + new Date().getTime();
|
|
403
|
+
let headers = yield this.headers;
|
|
404
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
405
|
+
.then((doc) => JSON.parse(JSON.stringify(doc.body)))
|
|
406
|
+
.catch((err) => this.handleError(err));
|
|
407
|
+
});
|
|
359
408
|
}
|
|
360
409
|
/**
|
|
361
410
|
* It gets patient administrative data.
|
|
@@ -363,14 +412,16 @@ class IccPatientApi {
|
|
|
363
412
|
* @param body
|
|
364
413
|
*/
|
|
365
414
|
getPatients(body) {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
415
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
416
|
+
let _body = null;
|
|
417
|
+
_body = body;
|
|
418
|
+
const _url = this.host + `/patient/byIds` + '?ts=' + new Date().getTime();
|
|
419
|
+
let headers = yield this.headers;
|
|
420
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
421
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
422
|
+
.then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
|
|
423
|
+
.catch((err) => this.handleError(err));
|
|
424
|
+
});
|
|
374
425
|
}
|
|
375
426
|
/**
|
|
376
427
|
* Returns a list of deleted patients, within the specified time period, if any.
|
|
@@ -382,20 +433,22 @@ class IccPatientApi {
|
|
|
382
433
|
* @param limit Number of rows
|
|
383
434
|
*/
|
|
384
435
|
listDeletedPatients(startDate, endDate, desc, startDocumentId, limit) {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
.
|
|
398
|
-
|
|
436
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
437
|
+
let _body = null;
|
|
438
|
+
const _url = this.host +
|
|
439
|
+
`/patient/deleted/by_date` +
|
|
440
|
+
'?ts=' +
|
|
441
|
+
new Date().getTime() +
|
|
442
|
+
(startDate ? '&startDate=' + encodeURIComponent(String(startDate)) : '') +
|
|
443
|
+
(endDate ? '&endDate=' + encodeURIComponent(String(endDate)) : '') +
|
|
444
|
+
(desc ? '&desc=' + encodeURIComponent(String(desc)) : '') +
|
|
445
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
446
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
|
|
447
|
+
let headers = yield this.headers;
|
|
448
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
449
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
450
|
+
.catch((err) => this.handleError(err));
|
|
451
|
+
});
|
|
399
452
|
}
|
|
400
453
|
/**
|
|
401
454
|
* Returns a list of deleted patients, by name and/or firstname prefix, if any.
|
|
@@ -404,17 +457,19 @@ class IccPatientApi {
|
|
|
404
457
|
* @param lastName Last name prefix
|
|
405
458
|
*/
|
|
406
459
|
listDeletedPatientsByName(firstName, lastName) {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
460
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
461
|
+
let _body = null;
|
|
462
|
+
const _url = this.host +
|
|
463
|
+
`/patient/deleted/by_name` +
|
|
464
|
+
'?ts=' +
|
|
465
|
+
new Date().getTime() +
|
|
466
|
+
(firstName ? '&firstName=' + encodeURIComponent(String(firstName)) : '') +
|
|
467
|
+
(lastName ? '&lastName=' + encodeURIComponent(String(lastName)) : '');
|
|
468
|
+
let headers = yield this.headers;
|
|
469
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
470
|
+
.then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
|
|
471
|
+
.catch((err) => this.handleError(err));
|
|
472
|
+
});
|
|
418
473
|
}
|
|
419
474
|
/**
|
|
420
475
|
* Returns a list of patients that have been merged after the provided date
|
|
@@ -422,12 +477,14 @@ class IccPatientApi {
|
|
|
422
477
|
* @param date
|
|
423
478
|
*/
|
|
424
479
|
listOfMergesAfter(date) {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
480
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
481
|
+
let _body = null;
|
|
482
|
+
const _url = this.host + `/patient/merges/${encodeURIComponent(String(date))}` + '?ts=' + new Date().getTime();
|
|
483
|
+
let headers = yield this.headers;
|
|
484
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
485
|
+
.then((doc) => doc.body.map((it) => new Patient_1.Patient(it)))
|
|
486
|
+
.catch((err) => this.handleError(err));
|
|
487
|
+
});
|
|
431
488
|
}
|
|
432
489
|
/**
|
|
433
490
|
* Returns a list of patients that have been modified after the provided date
|
|
@@ -438,18 +495,20 @@ class IccPatientApi {
|
|
|
438
495
|
* @param limit Number of rows
|
|
439
496
|
*/
|
|
440
497
|
listOfPatientsModifiedAfter(date, startKey, startDocumentId, limit) {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
.
|
|
452
|
-
|
|
498
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
499
|
+
let _body = null;
|
|
500
|
+
const _url = this.host +
|
|
501
|
+
`/patient/modifiedAfter/${encodeURIComponent(String(date))}` +
|
|
502
|
+
'?ts=' +
|
|
503
|
+
new Date().getTime() +
|
|
504
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
505
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
506
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
|
|
507
|
+
let headers = yield this.headers;
|
|
508
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
509
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
510
|
+
.catch((err) => this.handleError(err));
|
|
511
|
+
});
|
|
453
512
|
}
|
|
454
513
|
/**
|
|
455
514
|
* Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
|
|
@@ -462,21 +521,23 @@ class IccPatientApi {
|
|
|
462
521
|
* @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default.
|
|
463
522
|
*/
|
|
464
523
|
listPatients(hcPartyId, sortField, startKey, startDocumentId, limit, sortDirection) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
.
|
|
479
|
-
|
|
524
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
525
|
+
let _body = null;
|
|
526
|
+
const _url = this.host +
|
|
527
|
+
`/patient` +
|
|
528
|
+
'?ts=' +
|
|
529
|
+
new Date().getTime() +
|
|
530
|
+
(hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
|
|
531
|
+
(sortField ? '&sortField=' + encodeURIComponent(String(sortField)) : '') +
|
|
532
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
533
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
534
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
|
|
535
|
+
(sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
|
|
536
|
+
let headers = yield this.headers;
|
|
537
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
538
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
539
|
+
.catch((err) => this.handleError(err));
|
|
540
|
+
});
|
|
480
541
|
}
|
|
481
542
|
/**
|
|
482
543
|
* Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
|
|
@@ -489,20 +550,22 @@ class IccPatientApi {
|
|
|
489
550
|
* @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default.
|
|
490
551
|
*/
|
|
491
552
|
listPatientsByHcParty(hcPartyId, sortField, startKey, startDocumentId, limit, sortDirection) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
.
|
|
505
|
-
|
|
553
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
554
|
+
let _body = null;
|
|
555
|
+
const _url = this.host +
|
|
556
|
+
`/patient/hcParty/${encodeURIComponent(String(hcPartyId))}` +
|
|
557
|
+
'?ts=' +
|
|
558
|
+
new Date().getTime() +
|
|
559
|
+
(sortField ? '&sortField=' + encodeURIComponent(String(sortField)) : '') +
|
|
560
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
561
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
562
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
|
|
563
|
+
(sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
|
|
564
|
+
let headers = yield this.headers;
|
|
565
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
566
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
567
|
+
.catch((err) => this.handleError(err));
|
|
568
|
+
});
|
|
506
569
|
}
|
|
507
570
|
/**
|
|
508
571
|
* Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
|
|
@@ -513,19 +576,21 @@ class IccPatientApi {
|
|
|
513
576
|
* @param limit Page size
|
|
514
577
|
*/
|
|
515
578
|
listPatientsIds(hcPartyId, startKey, startDocumentId, limit) {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
.
|
|
528
|
-
|
|
579
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
580
|
+
let _body = null;
|
|
581
|
+
const _url = this.host +
|
|
582
|
+
`/patient/idsPages` +
|
|
583
|
+
'?ts=' +
|
|
584
|
+
new Date().getTime() +
|
|
585
|
+
(hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
|
|
586
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
587
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
588
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
|
|
589
|
+
let headers = yield this.headers;
|
|
590
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
591
|
+
.then((doc) => new PaginatedListString_1.PaginatedListString(doc.body))
|
|
592
|
+
.catch((err) => this.handleError(err));
|
|
593
|
+
});
|
|
529
594
|
}
|
|
530
595
|
/**
|
|
531
596
|
* Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
|
|
@@ -538,20 +603,22 @@ class IccPatientApi {
|
|
|
538
603
|
* @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default.
|
|
539
604
|
*/
|
|
540
605
|
listPatientsOfHcParty(hcPartyId, sortField, startKey, startDocumentId, limit, sortDirection) {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
.
|
|
554
|
-
|
|
606
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
607
|
+
let _body = null;
|
|
608
|
+
const _url = this.host +
|
|
609
|
+
`/patient/ofHcParty/${encodeURIComponent(String(hcPartyId))}` +
|
|
610
|
+
'?ts=' +
|
|
611
|
+
new Date().getTime() +
|
|
612
|
+
(sortField ? '&sortField=' + encodeURIComponent(String(sortField)) : '') +
|
|
613
|
+
(startKey ? '&startKey=' + encodeURIComponent(String(startKey)) : '') +
|
|
614
|
+
(startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +
|
|
615
|
+
(limit ? '&limit=' + encodeURIComponent(String(limit)) : '') +
|
|
616
|
+
(sortDirection ? '&sortDirection=' + encodeURIComponent(String(sortDirection)) : '');
|
|
617
|
+
let headers = yield this.headers;
|
|
618
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
619
|
+
.then((doc) => new PaginatedListPatient_1.PaginatedListPatient(doc.body))
|
|
620
|
+
.catch((err) => this.handleError(err));
|
|
621
|
+
});
|
|
555
622
|
}
|
|
556
623
|
/**
|
|
557
624
|
*
|
|
@@ -559,14 +626,16 @@ class IccPatientApi {
|
|
|
559
626
|
* @param body
|
|
560
627
|
*/
|
|
561
628
|
matchPatientsBy(body) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
.
|
|
569
|
-
|
|
629
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
630
|
+
let _body = null;
|
|
631
|
+
_body = body;
|
|
632
|
+
const _url = this.host + `/patient/match` + '?ts=' + new Date().getTime();
|
|
633
|
+
let headers = yield this.headers;
|
|
634
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
635
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
636
|
+
.then((doc) => doc.body.map((it) => JSON.parse(JSON.stringify(it))))
|
|
637
|
+
.catch((err) => this.handleError(err));
|
|
638
|
+
});
|
|
570
639
|
}
|
|
571
640
|
/**
|
|
572
641
|
*
|
|
@@ -575,12 +644,14 @@ class IccPatientApi {
|
|
|
575
644
|
* @param fromIds
|
|
576
645
|
*/
|
|
577
646
|
mergeInto(toId, fromIds) {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
.
|
|
583
|
-
|
|
647
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
648
|
+
let _body = null;
|
|
649
|
+
const _url = this.host + `/patient/mergeInto/${encodeURIComponent(String(toId))}/from/${encodeURIComponent(String(fromIds))}` + '?ts=' + new Date().getTime();
|
|
650
|
+
let headers = yield this.headers;
|
|
651
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
652
|
+
.then((doc) => new Patient_1.Patient(doc.body))
|
|
653
|
+
.catch((err) => this.handleError(err));
|
|
654
|
+
});
|
|
584
655
|
}
|
|
585
656
|
/**
|
|
586
657
|
* No particular return value. It's just a message.
|
|
@@ -588,14 +659,16 @@ class IccPatientApi {
|
|
|
588
659
|
* @param body
|
|
589
660
|
*/
|
|
590
661
|
modifyPatient(body) {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
.
|
|
598
|
-
|
|
662
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
663
|
+
let _body = null;
|
|
664
|
+
_body = body;
|
|
665
|
+
const _url = this.host + `/patient` + '?ts=' + new Date().getTime();
|
|
666
|
+
let headers = yield this.headers;
|
|
667
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
668
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
669
|
+
.then((doc) => new Patient_1.Patient(doc.body))
|
|
670
|
+
.catch((err) => this.handleError(err));
|
|
671
|
+
});
|
|
599
672
|
}
|
|
600
673
|
/**
|
|
601
674
|
*
|
|
@@ -606,17 +679,19 @@ class IccPatientApi {
|
|
|
606
679
|
* @param end Optional value for end of referral
|
|
607
680
|
*/
|
|
608
681
|
modifyPatientReferral(patientId, referralId, start, end) {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
.
|
|
619
|
-
|
|
682
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
683
|
+
let _body = null;
|
|
684
|
+
const _url = this.host +
|
|
685
|
+
`/patient/${encodeURIComponent(String(patientId))}/referral/${encodeURIComponent(String(referralId))}` +
|
|
686
|
+
'?ts=' +
|
|
687
|
+
new Date().getTime() +
|
|
688
|
+
(start ? '&start=' + encodeURIComponent(String(start)) : '') +
|
|
689
|
+
(end ? '&end=' + encodeURIComponent(String(end)) : '');
|
|
690
|
+
let headers = yield this.headers;
|
|
691
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
692
|
+
.then((doc) => new Patient_1.Patient(doc.body))
|
|
693
|
+
.catch((err) => this.handleError(err));
|
|
694
|
+
});
|
|
620
695
|
}
|
|
621
696
|
/**
|
|
622
697
|
* It delegates a patient to a healthcare party (By current healthcare party). A modified patient with new delegation gets returned.
|
|
@@ -625,14 +700,16 @@ class IccPatientApi {
|
|
|
625
700
|
* @param patientId
|
|
626
701
|
*/
|
|
627
702
|
newPatientDelegations(patientId, body) {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
.
|
|
635
|
-
|
|
703
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
704
|
+
let _body = null;
|
|
705
|
+
_body = body;
|
|
706
|
+
const _url = this.host + `/patient/${encodeURIComponent(String(patientId))}/delegate` + '?ts=' + new Date().getTime();
|
|
707
|
+
let headers = yield this.headers;
|
|
708
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
709
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
710
|
+
.then((doc) => new Patient_1.Patient(doc.body))
|
|
711
|
+
.catch((err) => this.handleError(err));
|
|
712
|
+
});
|
|
636
713
|
}
|
|
637
714
|
/**
|
|
638
715
|
* Register a new patient into the system
|
|
@@ -644,19 +721,21 @@ class IccPatientApi {
|
|
|
644
721
|
* @param useShortToken
|
|
645
722
|
*/
|
|
646
723
|
registerPatient(hcPartyId, groupId, token, useShortToken, body) {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
.
|
|
659
|
-
|
|
724
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
725
|
+
let _body = null;
|
|
726
|
+
_body = body;
|
|
727
|
+
const _url = this.host +
|
|
728
|
+
`/patient/register/forHcp/${encodeURIComponent(String(hcPartyId))}/inGroup/${encodeURIComponent(String(groupId))}` +
|
|
729
|
+
'?ts=' +
|
|
730
|
+
new Date().getTime() +
|
|
731
|
+
(token ? '&token=' + encodeURIComponent(String(token)) : '') +
|
|
732
|
+
(useShortToken ? '&useShortToken=' + encodeURIComponent(String(useShortToken)) : '');
|
|
733
|
+
let headers = yield this.headers;
|
|
734
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
735
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
736
|
+
.then((doc) => new DataOwnerRegistrationSuccess_1.DataOwnerRegistrationSuccess(doc.body))
|
|
737
|
+
.catch((err) => this.handleError(err));
|
|
738
|
+
});
|
|
660
739
|
}
|
|
661
740
|
/**
|
|
662
741
|
* Response is an array containing the ID of undeleted patient..
|
|
@@ -664,29 +743,46 @@ class IccPatientApi {
|
|
|
664
743
|
* @param patientIds
|
|
665
744
|
*/
|
|
666
745
|
undeletePatient(patientIds) {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
746
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
747
|
+
let _body = null;
|
|
748
|
+
const _url = this.host + `/patient/undelete/${encodeURIComponent(String(patientIds))}` + '?ts=' + new Date().getTime();
|
|
749
|
+
let headers = yield this.headers;
|
|
750
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
751
|
+
.then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
|
|
752
|
+
.catch((err) => this.handleError(err));
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* @internal this method is for internal use only and may be changed without notice
|
|
757
|
+
*/
|
|
758
|
+
bulkSharePatients(request) {
|
|
759
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
760
|
+
const _url = this.host + '/patient/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime();
|
|
761
|
+
let headers = yield this.headers;
|
|
762
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
763
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
764
|
+
.then((doc) => doc.body.map((x) => new EntityBulkShareResult_1.EntityBulkShareResult(x, Patient_1.Patient)))
|
|
765
|
+
.catch((err) => this.handleError(err));
|
|
766
|
+
});
|
|
673
767
|
}
|
|
674
768
|
/**
|
|
675
769
|
* @internal use mergePatients from the extended api instead
|
|
676
770
|
*/
|
|
677
771
|
baseMergePatients(fromId, expectedFromRev, updatedInto) {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
.
|
|
689
|
-
|
|
772
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
773
|
+
let _body = updatedInto;
|
|
774
|
+
const _url = this.host +
|
|
775
|
+
`/patient/mergeInto/${encodeURIComponent(String(updatedInto.id))}/from/${encodeURIComponent(String(fromId))}` +
|
|
776
|
+
'?ts=' +
|
|
777
|
+
new Date().getTime() +
|
|
778
|
+
'&expectedFromRev=' +
|
|
779
|
+
encodeURIComponent(String(expectedFromRev));
|
|
780
|
+
let headers = yield this.headers;
|
|
781
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
782
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
783
|
+
.then((doc) => new Patient_1.Patient(doc.body))
|
|
784
|
+
.catch((err) => this.handleError(err));
|
|
785
|
+
});
|
|
690
786
|
}
|
|
691
787
|
}
|
|
692
788
|
exports.IccPatientApi = IccPatientApi;
|