gdc-sdk-front-ts 2.2.1 → 2.3.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/dist/ProfileManager.js +6 -3
- package/dist/front-clinical-runtime-client.d.ts +69 -0
- package/dist/front-clinical-runtime-client.js +214 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/orchestration/client-port.d.ts +21 -3
- package/dist/orchestration/individual-member-sdk.d.ts +11 -1
- package/dist/orchestration/individual-member-sdk.js +12 -0
- package/dist/orchestration/professional-sdk.d.ts +7 -1
- package/dist/orchestration/professional-sdk.js +6 -0
- package/package.json +3 -3
- package/dist/discovery/HttpDataspaceDiscoveryClient.d.ts +0 -34
- package/dist/discovery/HttpDataspaceDiscoveryClient.js +0 -47
- package/dist/gdc-common-utils-ts/src/AesManager.d.ts +0 -27
- package/dist/gdc-common-utils-ts/src/AesManager.js +0 -64
- package/dist/gdc-common-utils-ts/src/CryptographyService.d.ts +0 -76
- package/dist/gdc-common-utils-ts/src/CryptographyService.js +0 -401
- package/dist/gdc-common-utils-ts/src/constants/actor-session.d.ts +0 -40
- package/dist/gdc-common-utils-ts/src/constants/actor-session.js +0 -40
- package/dist/gdc-common-utils-ts/src/constants/communication.d.ts +0 -28
- package/dist/gdc-common-utils-ts/src/constants/communication.js +0 -14
- package/dist/gdc-common-utils-ts/src/constants/cryptography.d.ts +0 -58
- package/dist/gdc-common-utils-ts/src/constants/cryptography.js +0 -49
- package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.d.ts +0 -11
- package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.js +0 -11
- package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.d.ts +0 -27
- package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.js +0 -27
- package/dist/gdc-common-utils-ts/src/constants/device.d.ts +0 -16
- package/dist/gdc-common-utils-ts/src/constants/device.js +0 -15
- package/dist/gdc-common-utils-ts/src/constants/did-services.d.ts +0 -42
- package/dist/gdc-common-utils-ts/src/constants/did-services.js +0 -40
- package/dist/gdc-common-utils-ts/src/constants/eu-countries.d.ts +0 -36
- package/dist/gdc-common-utils-ts/src/constants/eu-countries.js +0 -69
- package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.d.ts +0 -12
- package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.js +0 -12
- package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.d.ts +0 -52
- package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.js +0 -33
- package/dist/gdc-common-utils-ts/src/constants/fhir-versions.d.ts +0 -10
- package/dist/gdc-common-utils-ts/src/constants/fhir-versions.js +0 -10
- package/dist/gdc-common-utils-ts/src/constants/healthcare.d.ts +0 -496
- package/dist/gdc-common-utils-ts/src/constants/healthcare.js +0 -274
- package/dist/gdc-common-utils-ts/src/constants/hl7-roles.d.ts +0 -44
- package/dist/gdc-common-utils-ts/src/constants/hl7-roles.js +0 -208
- package/dist/gdc-common-utils-ts/src/constants/index.d.ts +0 -21
- package/dist/gdc-common-utils-ts/src/constants/index.js +0 -21
- package/dist/gdc-common-utils-ts/src/constants/network.d.ts +0 -25
- package/dist/gdc-common-utils-ts/src/constants/network.js +0 -17
- package/dist/gdc-common-utils-ts/src/constants/schemaorg.d.ts +0 -175
- package/dist/gdc-common-utils-ts/src/constants/schemaorg.js +0 -261
- package/dist/gdc-common-utils-ts/src/constants/sectors.d.ts +0 -24
- package/dist/gdc-common-utils-ts/src/constants/sectors.js +0 -24
- package/dist/gdc-common-utils-ts/src/constants/service-capabilities.d.ts +0 -82
- package/dist/gdc-common-utils-ts/src/constants/service-capabilities.js +0 -105
- package/dist/gdc-common-utils-ts/src/constants/smart.d.ts +0 -12
- package/dist/gdc-common-utils-ts/src/constants/smart.js +0 -12
- package/dist/gdc-common-utils-ts/src/constants/urn.d.ts +0 -11
- package/dist/gdc-common-utils-ts/src/constants/urn.js +0 -11
- package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.d.ts +0 -34
- package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.js +0 -42
- package/dist/gdc-common-utils-ts/src/constants/vital-signs.d.ts +0 -75
- package/dist/gdc-common-utils-ts/src/constants/vital-signs.js +0 -33
- package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.d.ts +0 -15
- package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.js +0 -16
- package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.d.ts +0 -22
- package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.js +0 -81
- package/dist/gdc-common-utils-ts/src/examples/consent-access.d.ts +0 -30
- package/dist/gdc-common-utils-ts/src/examples/consent-access.js +0 -121
- package/dist/gdc-common-utils-ts/src/examples/contract-examples.d.ts +0 -15
- package/dist/gdc-common-utils-ts/src/examples/contract-examples.js +0 -16
- package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.d.ts +0 -98
- package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.js +0 -141
- package/dist/gdc-common-utils-ts/src/examples/frontend-session.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/examples/frontend-session.js +0 -24
- package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.d.ts +0 -64
- package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.js +0 -77
- package/dist/gdc-common-utils-ts/src/examples/index.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/examples/index.js +0 -14
- package/dist/gdc-common-utils-ts/src/examples/individual-controller.d.ts +0 -100
- package/dist/gdc-common-utils-ts/src/examples/individual-controller.js +0 -71
- package/dist/gdc-common-utils-ts/src/examples/lifecycle.d.ts +0 -505
- package/dist/gdc-common-utils-ts/src/examples/lifecycle.js +0 -291
- package/dist/gdc-common-utils-ts/src/examples/organization-controller.d.ts +0 -163
- package/dist/gdc-common-utils-ts/src/examples/organization-controller.js +0 -93
- package/dist/gdc-common-utils-ts/src/examples/professional.d.ts +0 -228
- package/dist/gdc-common-utils-ts/src/examples/professional.js +0 -324
- package/dist/gdc-common-utils-ts/src/examples/related-person.d.ts +0 -10
- package/dist/gdc-common-utils-ts/src/examples/related-person.js +0 -13
- package/dist/gdc-common-utils-ts/src/examples/relationship-access.d.ts +0 -11
- package/dist/gdc-common-utils-ts/src/examples/relationship-access.js +0 -96
- package/dist/gdc-common-utils-ts/src/examples/shared.d.ts +0 -220
- package/dist/gdc-common-utils-ts/src/examples/shared.js +0 -191
- package/dist/gdc-common-utils-ts/src/hmac.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/hmac.js +0 -24
- package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.d.ts +0 -6
- package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.js +0 -15
- package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.d.ts +0 -4
- package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.js +0 -13
- package/dist/gdc-common-utils-ts/src/index.d.ts +0 -10
- package/dist/gdc-common-utils-ts/src/index.js +0 -10
- package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.d.ts +0 -139
- package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.js +0 -8
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.d.ts +0 -28
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.js +0 -3
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.d.ts +0 -154
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/actor-session.d.ts +0 -9
- package/dist/gdc-common-utils-ts/src/models/actor-session.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/aes.d.ts +0 -85
- package/dist/gdc-common-utils-ts/src/models/aes.js +0 -10
- package/dist/gdc-common-utils-ts/src/models/auth.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/models/auth.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/bundle.d.ts +0 -153
- package/dist/gdc-common-utils-ts/src/models/bundle.js +0 -25
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.d.ts +0 -36
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.d.ts +0 -150
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.js +0 -104
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.js +0 -32
- package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.d.ts +0 -126
- package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.js +0 -67
- package/dist/gdc-common-utils-ts/src/models/comm.d.ts +0 -56
- package/dist/gdc-common-utils-ts/src/models/comm.js +0 -4
- package/dist/gdc-common-utils-ts/src/models/confidential-job.d.ts +0 -78
- package/dist/gdc-common-utils-ts/src/models/confidential-job.js +0 -20
- package/dist/gdc-common-utils-ts/src/models/confidential-message.d.ts +0 -97
- package/dist/gdc-common-utils-ts/src/models/confidential-message.js +0 -4
- package/dist/gdc-common-utils-ts/src/models/confidential-storage.d.ts +0 -134
- package/dist/gdc-common-utils-ts/src/models/confidential-storage.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/consent-access.d.ts +0 -79
- package/dist/gdc-common-utils-ts/src/models/consent-access.js +0 -2
- package/dist/gdc-common-utils-ts/src/models/consent-rule.d.ts +0 -122
- package/dist/gdc-common-utils-ts/src/models/consent-rule.js +0 -22
- package/dist/gdc-common-utils-ts/src/models/crypto.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/models/crypto.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.d.ts +0 -79
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.js +0 -2
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.d.ts +0 -68
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.js +0 -9
- package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.js +0 -2
- package/dist/gdc-common-utils-ts/src/models/device-license.d.ts +0 -134
- package/dist/gdc-common-utils-ts/src/models/device-license.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/did.d.ts +0 -108
- package/dist/gdc-common-utils-ts/src/models/did.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/fhir-documents.d.ts +0 -101
- package/dist/gdc-common-utils-ts/src/models/fhir-documents.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.d.ts +0 -104
- package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.js +0 -2
- package/dist/gdc-common-utils-ts/src/models/index.d.ts +0 -42
- package/dist/gdc-common-utils-ts/src/models/index.js +0 -42
- package/dist/gdc-common-utils-ts/src/models/indexing.d.ts +0 -11
- package/dist/gdc-common-utils-ts/src/models/indexing.js +0 -18
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.d.ts +0 -24
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.js +0 -36
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.d.ts +0 -53
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.js +0 -55
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.js +0 -25
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.js +0 -23
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.d.ts +0 -36
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.js +0 -89
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.d.ts +0 -341
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.js +0 -204
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.d.ts +0 -9
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims.d.ts +0 -5
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims.js +0 -7
- package/dist/gdc-common-utils-ts/src/models/issue.d.ts +0 -57
- package/dist/gdc-common-utils-ts/src/models/issue.js +0 -75
- package/dist/gdc-common-utils-ts/src/models/jsonapi.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/models/jsonapi.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/jwe.d.ts +0 -120
- package/dist/gdc-common-utils-ts/src/models/jwe.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/jwk.d.ts +0 -39
- package/dist/gdc-common-utils-ts/src/models/jwk.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/jws.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/models/jws.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/jwt.d.ts +0 -9
- package/dist/gdc-common-utils-ts/src/models/jwt.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.d.ts +0 -55
- package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.js +0 -58
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.d.ts +0 -33
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.d.ts +0 -50
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.d.ts +0 -67
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.d.ts +0 -51
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.js +0 -5
- package/dist/gdc-common-utils-ts/src/models/openid-device.d.ts +0 -119
- package/dist/gdc-common-utils-ts/src/models/openid-device.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/operation-outcome.d.ts +0 -26
- package/dist/gdc-common-utils-ts/src/models/operation-outcome.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/params.d.ts +0 -133
- package/dist/gdc-common-utils-ts/src/models/params.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/relationship-access.d.ts +0 -160
- package/dist/gdc-common-utils-ts/src/models/relationship-access.js +0 -21
- package/dist/gdc-common-utils-ts/src/models/resource-document.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/models/resource-document.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/response.d.ts +0 -1
- package/dist/gdc-common-utils-ts/src/models/response.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/urlPath.d.ts +0 -58
- package/dist/gdc-common-utils-ts/src/models/urlPath.js +0 -76
- package/dist/gdc-common-utils-ts/src/models/verifiable-credential.d.ts +0 -45
- package/dist/gdc-common-utils-ts/src/models/verifiable-credential.js +0 -8
- package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.d.ts +0 -53
- package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.js +0 -25
- package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.d.ts +0 -30
- package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.js +0 -81
- package/dist/gdc-common-utils-ts/src/storage/index.d.ts +0 -3
- package/dist/gdc-common-utils-ts/src/storage/index.js +0 -4
- package/dist/gdc-common-utils-ts/src/utils/activation-policy.d.ts +0 -86
- package/dist/gdc-common-utils-ts/src/utils/activation-policy.js +0 -218
- package/dist/gdc-common-utils-ts/src/utils/activation-request.d.ts +0 -81
- package/dist/gdc-common-utils-ts/src/utils/activation-request.js +0 -99
- package/dist/gdc-common-utils-ts/src/utils/actor.d.ts +0 -18
- package/dist/gdc-common-utils-ts/src/utils/actor.js +0 -36
- package/dist/gdc-common-utils-ts/src/utils/base-convert.d.ts +0 -60
- package/dist/gdc-common-utils-ts/src/utils/base-convert.js +0 -104
- package/dist/gdc-common-utils-ts/src/utils/baseN.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/utils/baseN.js +0 -174
- package/dist/gdc-common-utils-ts/src/utils/bundle-query.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/utils/bundle-query.js +0 -177
- package/dist/gdc-common-utils-ts/src/utils/bundle.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/utils/bundle.js +0 -39
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.d.ts +0 -64
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.js +0 -279
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.d.ts +0 -55
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.js +0 -291
- package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.d.ts +0 -110
- package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.js +0 -326
- package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.d.ts +0 -41
- package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.js +0 -170
- package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.d.ts +0 -41
- package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.js +0 -215
- package/dist/gdc-common-utils-ts/src/utils/communication-identity.d.ts +0 -152
- package/dist/gdc-common-utils-ts/src/utils/communication-identity.js +0 -121
- package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.d.ts +0 -79
- package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.js +0 -213
- package/dist/gdc-common-utils-ts/src/utils/consent.d.ts +0 -218
- package/dist/gdc-common-utils-ts/src/utils/consent.js +0 -679
- package/dist/gdc-common-utils-ts/src/utils/content.d.ts +0 -55
- package/dist/gdc-common-utils-ts/src/utils/content.js +0 -60
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.d.ts +0 -130
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.js +0 -307
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.d.ts +0 -235
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.js +0 -482
- package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.d.ts +0 -66
- package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.js +0 -109
- package/dist/gdc-common-utils-ts/src/utils/did-resolution.d.ts +0 -60
- package/dist/gdc-common-utils-ts/src/utils/did-resolution.js +0 -173
- package/dist/gdc-common-utils-ts/src/utils/did.d.ts +0 -124
- package/dist/gdc-common-utils-ts/src/utils/did.js +0 -204
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.d.ts +0 -10
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.js +0 -15
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.d.ts +0 -48
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.js +0 -81
- package/dist/gdc-common-utils-ts/src/utils/didcomm.d.ts +0 -60
- package/dist/gdc-common-utils-ts/src/utils/didcomm.js +0 -78
- package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.d.ts +0 -28
- package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.js +0 -64
- package/dist/gdc-common-utils-ts/src/utils/fhir-cid.d.ts +0 -60
- package/dist/gdc-common-utils-ts/src/utils/fhir-cid.js +0 -152
- package/dist/gdc-common-utils-ts/src/utils/fhir-validator.d.ts +0 -61
- package/dist/gdc-common-utils-ts/src/utils/fhir-validator.js +0 -91
- package/dist/gdc-common-utils-ts/src/utils/format-converter.d.ts +0 -21
- package/dist/gdc-common-utils-ts/src/utils/format-converter.js +0 -109
- package/dist/gdc-common-utils-ts/src/utils/index.d.ts +0 -39
- package/dist/gdc-common-utils-ts/src/utils/index.js +0 -39
- package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.d.ts +0 -55
- package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.js +0 -191
- package/dist/gdc-common-utils-ts/src/utils/jwt.d.ts +0 -53
- package/dist/gdc-common-utils-ts/src/utils/jwt.js +0 -154
- package/dist/gdc-common-utils-ts/src/utils/manager-error.d.ts +0 -15
- package/dist/gdc-common-utils-ts/src/utils/manager-error.js +0 -21
- package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.d.ts +0 -56
- package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.js +0 -127
- package/dist/gdc-common-utils-ts/src/utils/multibase58.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/utils/multibase58.js +0 -40
- package/dist/gdc-common-utils-ts/src/utils/multibasehash.d.ts +0 -8
- package/dist/gdc-common-utils-ts/src/utils/multibasehash.js +0 -23
- package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.d.ts +0 -1
- package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.js +0 -35
- package/dist/gdc-common-utils-ts/src/utils/normalize.d.ts +0 -16
- package/dist/gdc-common-utils-ts/src/utils/normalize.js +0 -40
- package/dist/gdc-common-utils-ts/src/utils/object-convert.d.ts +0 -20
- package/dist/gdc-common-utils-ts/src/utils/object-convert.js +0 -51
- package/dist/gdc-common-utils-ts/src/utils/smart-scope.d.ts +0 -28
- package/dist/gdc-common-utils-ts/src/utils/smart-scope.js +0 -29
- package/dist/gdc-common-utils-ts/src/utils/string-convert.d.ts +0 -24
- package/dist/gdc-common-utils-ts/src/utils/string-convert.js +0 -62
- package/dist/gdc-common-utils-ts/src/utils/string-utils.d.ts +0 -25
- package/dist/gdc-common-utils-ts/src/utils/string-utils.js +0 -66
- package/dist/gdc-common-utils-ts/src/utils/url.d.ts +0 -26
- package/dist/gdc-common-utils-ts/src/utils/url.js +0 -44
- package/dist/gdc-common-utils-ts/src/utils/vp-token.d.ts +0 -139
- package/dist/gdc-common-utils-ts/src/utils/vp-token.js +0 -256
- package/dist/gdc-sdk-core-ts/src/actor-model.d.ts +0 -56
- package/dist/gdc-sdk-core-ts/src/actor-model.js +0 -112
- package/dist/gdc-sdk-core-ts/src/app-identity.d.ts +0 -80
- package/dist/gdc-sdk-core-ts/src/app-identity.js +0 -147
- package/dist/gdc-sdk-core-ts/src/bootstrap-facade.d.ts +0 -165
- package/dist/gdc-sdk-core-ts/src/bootstrap-facade.js +0 -191
- package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.d.ts +0 -112
- package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.js +0 -185
- package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.d.ts +0 -32
- package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.js +0 -215
- package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.d.ts +0 -55
- package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.js +0 -190
- package/dist/gdc-sdk-core-ts/src/communication-document-facade.d.ts +0 -55
- package/dist/gdc-sdk-core-ts/src/communication-document-facade.js +0 -194
- package/dist/gdc-sdk-core-ts/src/communication-draft.d.ts +0 -104
- package/dist/gdc-sdk-core-ts/src/communication-draft.js +0 -143
- package/dist/gdc-sdk-core-ts/src/communication-outbox.d.ts +0 -49
- package/dist/gdc-sdk-core-ts/src/communication-outbox.js +0 -62
- package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.d.ts +0 -180
- package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.js +0 -455
- package/dist/gdc-sdk-core-ts/src/consent-access.d.ts +0 -73
- package/dist/gdc-sdk-core-ts/src/consent-access.js +0 -109
- package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.d.ts +0 -5
- package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.js +0 -6
- package/dist/gdc-sdk-core-ts/src/consent-communication-operations.d.ts +0 -82
- package/dist/gdc-sdk-core-ts/src/consent-communication-operations.js +0 -135
- package/dist/gdc-sdk-core-ts/src/did-resolution-session.d.ts +0 -33
- package/dist/gdc-sdk-core-ts/src/did-resolution-session.js +0 -56
- package/dist/gdc-sdk-core-ts/src/discovery-facade.d.ts +0 -84
- package/dist/gdc-sdk-core-ts/src/discovery-facade.js +0 -24
- package/dist/gdc-sdk-core-ts/src/identity-model.d.ts +0 -46
- package/dist/gdc-sdk-core-ts/src/identity-model.js +0 -2
- package/dist/gdc-sdk-core-ts/src/identity-store.d.ts +0 -83
- package/dist/gdc-sdk-core-ts/src/identity-store.js +0 -51
- package/dist/gdc-sdk-core-ts/src/index.d.ts +0 -23
- package/dist/gdc-sdk-core-ts/src/index.js +0 -24
- package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.d.ts +0 -5
- package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.js +0 -6
- package/dist/gdc-sdk-core-ts/src/polling-model.d.ts +0 -35
- package/dist/gdc-sdk-core-ts/src/polling-model.js +0 -24
- package/dist/gdc-sdk-core-ts/src/relationship-access.d.ts +0 -40
- package/dist/gdc-sdk-core-ts/src/relationship-access.js +0 -150
- package/dist/gdc-sdk-core-ts/src/session-model.d.ts +0 -134
- package/dist/gdc-sdk-core-ts/src/session-model.js +0 -2
- package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.d.ts +0 -19
- package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.js +0 -19
- package/dist/gdc-sdk-core-ts/src/vital-signs.d.ts +0 -38
- package/dist/gdc-sdk-core-ts/src/vital-signs.js +0 -155
- package/dist/gdc-sdk-front-ts/src/ClientSDK.d.ts +0 -99
- package/dist/gdc-sdk-front-ts/src/ClientSDK.js +0 -177
- package/dist/gdc-sdk-front-ts/src/ProfileManager.d.ts +0 -140
- package/dist/gdc-sdk-front-ts/src/ProfileManager.js +0 -76
- package/dist/gdc-sdk-front-ts/src/ProfileRegistry.d.ts +0 -11
- package/dist/gdc-sdk-front-ts/src/ProfileRegistry.js +0 -26
- package/dist/gdc-sdk-front-ts/src/VerifierService.d.ts +0 -6
- package/dist/gdc-sdk-front-ts/src/VerifierService.js +0 -10
- package/dist/gdc-sdk-front-ts/src/actor-session.d.ts +0 -2
- package/dist/gdc-sdk-front-ts/src/actor-session.js +0 -2
- package/dist/gdc-sdk-front-ts/src/capabilityMapper.d.ts +0 -8
- package/dist/gdc-sdk-front-ts/src/capabilityMapper.js +0 -28
- package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.d.ts +0 -4
- package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.js +0 -5
- package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.d.ts +0 -54
- package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.js +0 -85
- package/dist/gdc-sdk-front-ts/src/discovery/index.d.ts +0 -3
- package/dist/gdc-sdk-front-ts/src/discovery/index.js +0 -4
- package/dist/gdc-sdk-front-ts/src/discovery/mappers.d.ts +0 -29
- package/dist/gdc-sdk-front-ts/src/discovery/mappers.js +0 -60
- package/dist/gdc-sdk-front-ts/src/discovery/types.d.ts +0 -83
- package/dist/gdc-sdk-front-ts/src/discovery/types.js +0 -2
- package/dist/gdc-sdk-front-ts/src/index.d.ts +0 -15
- package/dist/gdc-sdk-front-ts/src/index.js +0 -16
- package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.d.ts +0 -4
- package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.js +0 -5
- package/dist/gdc-sdk-front-ts/src/roleRegistry.d.ts +0 -19
- package/dist/gdc-sdk-front-ts/src/roleRegistry.js +0 -2
- package/dist/gdc-sdk-front-ts/src/runtime-contracts.d.ts +0 -22
- package/dist/gdc-sdk-front-ts/src/runtime-contracts.js +0 -7
- package/dist/gdc-sdk-front-ts/src/services.d.ts +0 -167
- package/dist/gdc-sdk-front-ts/src/services.js +0 -78
- package/dist/gdc-sdk-front-ts/src/session-descriptor.d.ts +0 -11
- package/dist/gdc-sdk-front-ts/src/session-descriptor.js +0 -8
- package/dist/gdc-sdk-front-ts/src/types.d.ts +0 -11
- package/dist/gdc-sdk-front-ts/src/types.js +0 -1
- package/dist/lifecycle-examples.d.ts +0 -6
- package/dist/lifecycle-examples.js +0 -7
- package/dist/medication-claim-helpers.d.ts +0 -4
- package/dist/medication-claim-helpers.js +0 -5
- package/dist/orchestration/facades.d.ts +0 -65
- package/dist/orchestration/facades.js +0 -142
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
-
// Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
|
|
3
|
-
import { ResourceTypesFhirR4 } from '../constants/fhir-resource-types';
|
|
4
|
-
import { ClaimConsent } from '../models/consent-rule';
|
|
5
|
-
import { CommunicationClaim } from '../models/interoperable-claims/communication-claims';
|
|
6
|
-
import { BundleQuery } from './bundle-query';
|
|
7
|
-
import { MedicationStatementClaim, } from '../models/interoperable-claims/medication-statement-claims';
|
|
8
|
-
/**
|
|
9
|
-
* Communication editing session with bundle-in-memory as source of truth.
|
|
10
|
-
*
|
|
11
|
-
* Design contract:
|
|
12
|
-
* - `activeEntry` is the real editing unit (not only `activeResource`), because
|
|
13
|
-
* it can include `fullUrl`, `request`, and entry-level context.
|
|
14
|
-
* - `Communication.content-attachment-data` is always derived from the
|
|
15
|
-
* in-memory bundle after each committed update.
|
|
16
|
-
* - saving can release active entry memory via `saveAndReleaseActiveEntry()`.
|
|
17
|
-
*/
|
|
18
|
-
export class CommunicationBundleSession {
|
|
19
|
-
constructor(options = {}) {
|
|
20
|
-
this.mode = options.mode || 'strict';
|
|
21
|
-
this.communicationClaims = {
|
|
22
|
-
...options.communicationClaims,
|
|
23
|
-
};
|
|
24
|
-
this.activeEntryIndex = null;
|
|
25
|
-
const providedBundle = options.initialBundle ? cloneBundle(options.initialBundle) : undefined;
|
|
26
|
-
this.bundleInMemory = providedBundle || this.decodeBundleFromClaims(this.communicationClaims);
|
|
27
|
-
this.syncAttachmentFromBundle();
|
|
28
|
-
}
|
|
29
|
-
/** Returns a deep copy of communication claims. */
|
|
30
|
-
getCommunicationClaims() {
|
|
31
|
-
return {
|
|
32
|
-
...this.communicationClaims,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/** Returns a deep copy of the current in-memory bundle. */
|
|
36
|
-
getBundleInMemory() {
|
|
37
|
-
return cloneBundle(this.bundleInMemory);
|
|
38
|
-
}
|
|
39
|
-
/** Returns the active entry index, or null when no entry is selected. */
|
|
40
|
-
getActiveEntryIndex() {
|
|
41
|
-
return this.activeEntryIndex;
|
|
42
|
-
}
|
|
43
|
-
/** Returns a deep copy of the active entry when selected. */
|
|
44
|
-
getActiveEntry() {
|
|
45
|
-
if (this.activeEntryIndex === null) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
return cloneEntry(this.bundleInMemory.data[this.activeEntryIndex]);
|
|
49
|
-
}
|
|
50
|
-
/** Selects an active entry by index or fullUrl. */
|
|
51
|
-
selectActiveEntry(selection) {
|
|
52
|
-
if (typeof selection.index === 'number') {
|
|
53
|
-
this.assertEntryIndex(selection.index);
|
|
54
|
-
this.activeEntryIndex = selection.index;
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
if (selection.fullUrl) {
|
|
58
|
-
const foundIndex = this.bundleInMemory.data.findIndex((entry) => String(entry?.fullUrl || '').trim() === selection.fullUrl);
|
|
59
|
-
if (foundIndex < 0) {
|
|
60
|
-
throw new Error(`Active entry not found for fullUrl: ${selection.fullUrl}`);
|
|
61
|
-
}
|
|
62
|
-
this.activeEntryIndex = foundIndex;
|
|
63
|
-
return this;
|
|
64
|
-
}
|
|
65
|
-
throw new Error('selectActiveEntry requires either index or fullUrl.');
|
|
66
|
-
}
|
|
67
|
-
/** Clears active entry selection from memory. */
|
|
68
|
-
clearActiveEntry() {
|
|
69
|
-
this.activeEntryIndex = null;
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Upserts an entry in bundle memory and marks it as active.
|
|
74
|
-
* Matching priority: `fullUrl` if present, then resource claim identifier.
|
|
75
|
-
*/
|
|
76
|
-
upsertActiveEntry(input) {
|
|
77
|
-
const entry = this.createBundleEntry(input);
|
|
78
|
-
const nextIndex = this.findUpsertIndex(entry, input.fullUrl);
|
|
79
|
-
if (nextIndex >= 0) {
|
|
80
|
-
this.bundleInMemory.data[nextIndex] = entry;
|
|
81
|
-
this.activeEntryIndex = nextIndex;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
this.bundleInMemory.data.push(entry);
|
|
85
|
-
this.activeEntryIndex = this.bundleInMemory.data.length - 1;
|
|
86
|
-
}
|
|
87
|
-
this.syncAttachmentFromBundle();
|
|
88
|
-
return this;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Consent-first helper for developer onboarding.
|
|
92
|
-
*
|
|
93
|
-
* Expected keys should come from `ClaimConsent` in caller code.
|
|
94
|
-
*/
|
|
95
|
-
upsertActiveConsentEntry(input) {
|
|
96
|
-
return this.upsertActiveEntry({
|
|
97
|
-
resourceType: ResourceTypesFhirR4.Consent,
|
|
98
|
-
claims: input.claims,
|
|
99
|
-
fullUrl: input.fullUrl,
|
|
100
|
-
type: input.type,
|
|
101
|
-
request: input.request,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* MedicationStatement helper for IPS-in-Communication use cases.
|
|
106
|
-
*
|
|
107
|
-
* Expected keys should come from MedicationStatement claims constants.
|
|
108
|
-
*/
|
|
109
|
-
upsertActiveMedicationStatementEntry(input) {
|
|
110
|
-
return this.upsertActiveEntry({
|
|
111
|
-
resourceType: ResourceTypesFhirR4.MedicationStatement,
|
|
112
|
-
claims: {
|
|
113
|
-
...input.claims,
|
|
114
|
-
},
|
|
115
|
-
fullUrl: input.fullUrl,
|
|
116
|
-
type: input.type,
|
|
117
|
-
request: input.request,
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Patches active entry `resource.meta.claims` and synchronizes attachment data.
|
|
122
|
-
*/
|
|
123
|
-
patchActiveEntryClaims(claimPatch) {
|
|
124
|
-
if (this.activeEntryIndex === null) {
|
|
125
|
-
throw new Error('No active entry selected.');
|
|
126
|
-
}
|
|
127
|
-
const current = cloneEntry(this.bundleInMemory.data[this.activeEntryIndex]);
|
|
128
|
-
const resource = ensureEntryResource(current, this.mode);
|
|
129
|
-
resource.meta = resource.meta || {};
|
|
130
|
-
resource.meta.claims = {
|
|
131
|
-
...(resource.meta.claims || {}),
|
|
132
|
-
...claimPatch,
|
|
133
|
-
};
|
|
134
|
-
current.resource = resource;
|
|
135
|
-
this.bundleInMemory.data[this.activeEntryIndex] = current;
|
|
136
|
-
this.syncAttachmentFromBundle();
|
|
137
|
-
return this;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Persists current memory state into communication claims attachment.
|
|
141
|
-
* No-op for active entry pointer.
|
|
142
|
-
*/
|
|
143
|
-
saveActiveEntry() {
|
|
144
|
-
this.syncAttachmentFromBundle();
|
|
145
|
-
return this;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Persists and releases active entry memory pointer.
|
|
149
|
-
* This is the recommended step after a successful save operation.
|
|
150
|
-
*/
|
|
151
|
-
saveAndReleaseActiveEntry() {
|
|
152
|
-
this.syncAttachmentFromBundle();
|
|
153
|
-
this.clearActiveEntry();
|
|
154
|
-
return this;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Returns stable resource IDs from bundle entries with optional filters.
|
|
158
|
-
*/
|
|
159
|
-
getResourceIds(filters = {}) {
|
|
160
|
-
const query = new BundleQuery(this.bundleInMemory);
|
|
161
|
-
return query.getResourceIds(filters);
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Returns bundle entries matching resource IDs produced by `getResourceIds`.
|
|
165
|
-
*/
|
|
166
|
-
getResourceEntriesByIds(resourceIds) {
|
|
167
|
-
const query = new BundleQuery(this.bundleInMemory);
|
|
168
|
-
return query.getResourceEntriesByIds(resourceIds);
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Resolves the entry URL (`fullUrl`) for a given entry/resource identifier.
|
|
172
|
-
*/
|
|
173
|
-
getEntryUrl(entryId) {
|
|
174
|
-
const query = new BundleQuery(this.bundleInMemory);
|
|
175
|
-
return query.getEntryUrl(entryId);
|
|
176
|
-
}
|
|
177
|
-
decodeBundleFromClaims(claims) {
|
|
178
|
-
const encoded = asTrimmedString(claims[CommunicationClaim.ContentAttachmentData]);
|
|
179
|
-
if (!encoded) {
|
|
180
|
-
return createEmptyBundle();
|
|
181
|
-
}
|
|
182
|
-
try {
|
|
183
|
-
const text = Buffer.from(encoded, 'base64').toString('utf8');
|
|
184
|
-
const parsed = JSON.parse(text);
|
|
185
|
-
validateBundleLike(parsed, this.mode);
|
|
186
|
-
return cloneBundle(parsed);
|
|
187
|
-
}
|
|
188
|
-
catch (error) {
|
|
189
|
-
if (this.mode === 'normalize') {
|
|
190
|
-
return createEmptyBundle();
|
|
191
|
-
}
|
|
192
|
-
throw new Error(`Invalid ${CommunicationClaim.ContentAttachmentData}: ${error.message}`);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
syncAttachmentFromBundle() {
|
|
196
|
-
this.communicationClaims[CommunicationClaim.ContentAttachmentType] = 'application/fhir+json';
|
|
197
|
-
this.communicationClaims[CommunicationClaim.ContentAttachmentData] = encodeBundleToBase64(this.bundleInMemory);
|
|
198
|
-
const activeSubject = this.resolveCurrentSubject();
|
|
199
|
-
if (activeSubject) {
|
|
200
|
-
this.communicationClaims[CommunicationClaim.Subject] = activeSubject;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
resolveCurrentSubject() {
|
|
204
|
-
if (this.activeEntryIndex !== null) {
|
|
205
|
-
const claims = this.bundleInMemory.data[this.activeEntryIndex]?.resource?.meta?.claims || {};
|
|
206
|
-
const consentSubject = asTrimmedString(claims[ClaimConsent.subject]);
|
|
207
|
-
if (consentSubject) {
|
|
208
|
-
return consentSubject;
|
|
209
|
-
}
|
|
210
|
-
const medicationSubject = asTrimmedString(claims[MedicationStatementClaim.Subject]);
|
|
211
|
-
if (medicationSubject) {
|
|
212
|
-
return medicationSubject;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
const fromClaims = asTrimmedString(this.communicationClaims[CommunicationClaim.Subject]);
|
|
216
|
-
return fromClaims || undefined;
|
|
217
|
-
}
|
|
218
|
-
findUpsertIndex(entry, fullUrl) {
|
|
219
|
-
if (fullUrl) {
|
|
220
|
-
const byFullUrl = this.bundleInMemory.data.findIndex((item) => String(item?.fullUrl || '').trim() === fullUrl);
|
|
221
|
-
if (byFullUrl >= 0) {
|
|
222
|
-
return byFullUrl;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
const incomingClaims = entry.resource?.meta?.claims || {};
|
|
226
|
-
const incomingIdentifier = this.resolveEntryIdentifier(incomingClaims);
|
|
227
|
-
if (!incomingIdentifier) {
|
|
228
|
-
return -1;
|
|
229
|
-
}
|
|
230
|
-
return this.bundleInMemory.data.findIndex((item) => {
|
|
231
|
-
const itemClaims = item?.resource?.meta?.claims || {};
|
|
232
|
-
return this.resolveEntryIdentifier(itemClaims) === incomingIdentifier;
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
resolveEntryIdentifier(claims) {
|
|
236
|
-
const consentIdentifier = asTrimmedString(claims[ClaimConsent.identifier]);
|
|
237
|
-
if (consentIdentifier) {
|
|
238
|
-
return `${ResourceTypesFhirR4.Consent}:${consentIdentifier}`;
|
|
239
|
-
}
|
|
240
|
-
const medicationIdentifier = asTrimmedString(claims[MedicationStatementClaim.Identifier]);
|
|
241
|
-
if (medicationIdentifier) {
|
|
242
|
-
return `${ResourceTypesFhirR4.MedicationStatement}:${medicationIdentifier}`;
|
|
243
|
-
}
|
|
244
|
-
return '';
|
|
245
|
-
}
|
|
246
|
-
createBundleEntry(input) {
|
|
247
|
-
const resourceClaims = {
|
|
248
|
-
...input.claims,
|
|
249
|
-
};
|
|
250
|
-
const canonicalEntryIdentifier = this.resolveEntryCanonicalIdValue(resourceClaims);
|
|
251
|
-
return {
|
|
252
|
-
id: canonicalEntryIdentifier || undefined,
|
|
253
|
-
type: input.type || `${input.resourceType}-edit-request-v1.0`,
|
|
254
|
-
fullUrl: input.fullUrl,
|
|
255
|
-
request: input.request,
|
|
256
|
-
resource: {
|
|
257
|
-
resourceType: input.resourceType,
|
|
258
|
-
meta: {
|
|
259
|
-
claims: resourceClaims,
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
resolveEntryCanonicalIdValue(claims) {
|
|
265
|
-
const consentIdentifier = asTrimmedString(claims[ClaimConsent.identifier]);
|
|
266
|
-
if (consentIdentifier) {
|
|
267
|
-
return consentIdentifier;
|
|
268
|
-
}
|
|
269
|
-
const medicationIdentifier = asTrimmedString(claims[MedicationStatementClaim.Identifier]);
|
|
270
|
-
if (medicationIdentifier) {
|
|
271
|
-
return medicationIdentifier;
|
|
272
|
-
}
|
|
273
|
-
const communicationIdentifier = asTrimmedString(claims[CommunicationClaim.Identifier]);
|
|
274
|
-
if (communicationIdentifier) {
|
|
275
|
-
return communicationIdentifier;
|
|
276
|
-
}
|
|
277
|
-
return '';
|
|
278
|
-
}
|
|
279
|
-
assertEntryIndex(index) {
|
|
280
|
-
if (!Number.isInteger(index) || index < 0 || index >= this.bundleInMemory.data.length) {
|
|
281
|
-
throw new Error(`Entry index out of range: ${index}`);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
function ensureEntryResource(entry, mode) {
|
|
286
|
-
const resource = entry.resource;
|
|
287
|
-
if (resource && typeof resource === 'object') {
|
|
288
|
-
return resource;
|
|
289
|
-
}
|
|
290
|
-
if (mode === 'normalize') {
|
|
291
|
-
return { meta: { claims: {} } };
|
|
292
|
-
}
|
|
293
|
-
throw new Error('Active entry does not contain a valid resource object.');
|
|
294
|
-
}
|
|
295
|
-
function validateBundleLike(bundle, mode) {
|
|
296
|
-
const looksLikeBundle = bundle && bundle.resourceType === ResourceTypesFhirR4.Bundle && Array.isArray(bundle.data);
|
|
297
|
-
if (looksLikeBundle) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
if (mode === 'normalize') {
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
throw new Error('Decoded attachment is not a valid BundleJsonApi payload.');
|
|
304
|
-
}
|
|
305
|
-
function createEmptyBundle() {
|
|
306
|
-
return {
|
|
307
|
-
resourceType: ResourceTypesFhirR4.Bundle,
|
|
308
|
-
type: 'batch',
|
|
309
|
-
data: [],
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
function encodeBundleToBase64(bundle) {
|
|
313
|
-
return Buffer.from(JSON.stringify(bundle), 'utf8').toString('base64');
|
|
314
|
-
}
|
|
315
|
-
function cloneBundle(bundle) {
|
|
316
|
-
return JSON.parse(JSON.stringify(bundle));
|
|
317
|
-
}
|
|
318
|
-
function cloneEntry(entry) {
|
|
319
|
-
return JSON.parse(JSON.stringify(entry));
|
|
320
|
-
}
|
|
321
|
-
function asTrimmedString(value) {
|
|
322
|
-
if (value === undefined || value === null) {
|
|
323
|
-
return '';
|
|
324
|
-
}
|
|
325
|
-
return String(value).trim();
|
|
326
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { EvidenceObjectDLT } from '../models/oidc4ida.evidence.model';
|
|
2
|
-
export type AttachmentKind = 'fhir' | 'pdf' | 'png' | 'jpg' | 'binary';
|
|
3
|
-
export type BuildMode = 'strict' | 'normalize';
|
|
4
|
-
export type BuildDocumentReferenceOptions = {
|
|
5
|
-
/**
|
|
6
|
-
* strict: validation errors throw.
|
|
7
|
-
* normalize: best-effort defaults + warnings.
|
|
8
|
-
*/
|
|
9
|
-
mode?: BuildMode;
|
|
10
|
-
};
|
|
11
|
-
export type BuildDocumentReferenceResult = {
|
|
12
|
-
/**
|
|
13
|
-
* Generated or normalized DocumentReference projection.
|
|
14
|
-
*
|
|
15
|
-
* Current simplified profile:
|
|
16
|
-
* - one Communication payload attachment -> one DocumentReference
|
|
17
|
-
* - one DocumentReference content[0].attachment
|
|
18
|
-
*/
|
|
19
|
-
documentReference: Record<string, any>;
|
|
20
|
-
/**
|
|
21
|
-
* CID for the attached artifact content.
|
|
22
|
-
* Used as version-like content fingerprint in this profile.
|
|
23
|
-
*/
|
|
24
|
-
contentCid: string;
|
|
25
|
-
evidence: EvidenceObjectDLT[];
|
|
26
|
-
warnings: string[];
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Detects the logical attachment kind from a MIME type.
|
|
30
|
-
*
|
|
31
|
-
* @param contentType Attachment content type.
|
|
32
|
-
*/
|
|
33
|
-
export declare function detectAttachmentKind(contentType?: string): AttachmentKind;
|
|
34
|
-
/**
|
|
35
|
-
* Builds a simplified `DocumentReference` projection from the first
|
|
36
|
-
* `Communication.payload[0].contentAttachment`.
|
|
37
|
-
*
|
|
38
|
-
* @param communication FHIR `Communication`-like resource carrying the attachment.
|
|
39
|
-
* @param options.mode `strict` throws on invalid input, `normalize` applies best-effort defaults.
|
|
40
|
-
*/
|
|
41
|
-
export declare function buildDocumentReferenceFromCommunicationPayload(communication: Record<string, any>, options?: BuildDocumentReferenceOptions): BuildDocumentReferenceResult;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
// Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
|
|
2
|
-
import { sha256 } from '@noble/hashes/sha2.js';
|
|
3
|
-
import { utf8ToBytes } from '@noble/hashes/utils.js';
|
|
4
|
-
import { CommunicationClaim } from '../models/interoperable-claims/communication-claims';
|
|
5
|
-
import { DocumentReferenceClaim } from '../models/interoperable-claims/document-reference-claims';
|
|
6
|
-
import { encodeMultibase58btc } from './multibase58.js';
|
|
7
|
-
import { canonicalizeFhirResource, fhirResourceToCid } from './fhir-cid.js';
|
|
8
|
-
const CID_V1 = 0x01;
|
|
9
|
-
const MULTICODEC_RAW = 0x55;
|
|
10
|
-
const MULTIHASH_SHA2_256_CODE = 0x12;
|
|
11
|
-
const MULTIHASH_SHA2_256_LEN = 32;
|
|
12
|
-
function encodeVarint(value) {
|
|
13
|
-
const out = [];
|
|
14
|
-
let n = value >>> 0;
|
|
15
|
-
while (n >= 0x80) {
|
|
16
|
-
out.push((n & 0x7f) | 0x80);
|
|
17
|
-
n >>>= 7;
|
|
18
|
-
}
|
|
19
|
-
out.push(n);
|
|
20
|
-
return Uint8Array.from(out);
|
|
21
|
-
}
|
|
22
|
-
function concatBytes(...parts) {
|
|
23
|
-
const total = parts.reduce((acc, part) => acc + part.length, 0);
|
|
24
|
-
const out = new Uint8Array(total);
|
|
25
|
-
let offset = 0;
|
|
26
|
-
for (const part of parts) {
|
|
27
|
-
out.set(part, offset);
|
|
28
|
-
offset += part.length;
|
|
29
|
-
}
|
|
30
|
-
return out;
|
|
31
|
-
}
|
|
32
|
-
function cidFromBytes(bytes) {
|
|
33
|
-
const digest = sha256(bytes);
|
|
34
|
-
const multihash = concatBytes(Uint8Array.from([MULTIHASH_SHA2_256_CODE, MULTIHASH_SHA2_256_LEN]), digest);
|
|
35
|
-
const cidBytes = concatBytes(encodeVarint(CID_V1), encodeVarint(MULTICODEC_RAW), multihash);
|
|
36
|
-
return encodeMultibase58btc(cidBytes);
|
|
37
|
-
}
|
|
38
|
-
function decodeBase64(data) {
|
|
39
|
-
return Uint8Array.from(Buffer.from(data, 'base64'));
|
|
40
|
-
}
|
|
41
|
-
function toStringOrUndefined(value) {
|
|
42
|
-
if (value === undefined || value === null)
|
|
43
|
-
return undefined;
|
|
44
|
-
const text = String(value).trim();
|
|
45
|
-
return text || undefined;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Detects the logical attachment kind from a MIME type.
|
|
49
|
-
*
|
|
50
|
-
* @param contentType Attachment content type.
|
|
51
|
-
*/
|
|
52
|
-
export function detectAttachmentKind(contentType) {
|
|
53
|
-
const ct = String(contentType || '').toLowerCase();
|
|
54
|
-
if (ct.includes('fhir') || ct.includes('application/json+fhir'))
|
|
55
|
-
return 'fhir';
|
|
56
|
-
if (ct === 'application/pdf')
|
|
57
|
-
return 'pdf';
|
|
58
|
-
if (ct === 'image/png')
|
|
59
|
-
return 'png';
|
|
60
|
-
if (ct === 'image/jpg' || ct === 'image/jpeg')
|
|
61
|
-
return 'jpg';
|
|
62
|
-
return 'binary';
|
|
63
|
-
}
|
|
64
|
-
function buildEvidenceForKind(kind, cid) {
|
|
65
|
-
if (kind === 'pdf') {
|
|
66
|
-
return {
|
|
67
|
-
type: 'electronic_signature',
|
|
68
|
-
signature_type: 'detached',
|
|
69
|
-
issuer: 'did:web:unknown',
|
|
70
|
-
serial_number: cid,
|
|
71
|
-
created_at: new Date().toISOString(),
|
|
72
|
-
attachments: [{ content_type: 'cid', content: cid }],
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
type: 'electronic_record',
|
|
77
|
-
record: { type: kind.toUpperCase(), source: 'Communication.payload.contentAttachment', digest: { alg: 'sha-256', value: cid } },
|
|
78
|
-
check_details: [],
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function isCidLike(value) {
|
|
82
|
-
return !!value && value.startsWith('z') && value.length > 10;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Builds a simplified `DocumentReference` projection from the first
|
|
86
|
-
* `Communication.payload[0].contentAttachment`.
|
|
87
|
-
*
|
|
88
|
-
* @param communication FHIR `Communication`-like resource carrying the attachment.
|
|
89
|
-
* @param options.mode `strict` throws on invalid input, `normalize` applies best-effort defaults.
|
|
90
|
-
*/
|
|
91
|
-
export function buildDocumentReferenceFromCommunicationPayload(communication, options = {}) {
|
|
92
|
-
/**
|
|
93
|
-
* Data model notes:
|
|
94
|
-
* - FHIR DocumentReference logical identifier and version are distinct concerns.
|
|
95
|
-
* - Current implementation uses content CID for claims identifier/version-like tracking.
|
|
96
|
-
* - Future target profile should keep stable DocumentReference.identifier (UUID/URN) and
|
|
97
|
-
* store evolving content CID in meta.versionId/content hash fields across versions.
|
|
98
|
-
* - Multi-attachment DocumentReference content[i] is intentionally out of scope for now;
|
|
99
|
-
* roadmap can introduce indexed flat claims such as DocumentReference.attachment[i]-*.
|
|
100
|
-
*/
|
|
101
|
-
const mode = options.mode ?? 'strict';
|
|
102
|
-
const warnings = [];
|
|
103
|
-
const payload = communication?.payload?.[0];
|
|
104
|
-
const attachment = payload?.contentAttachment;
|
|
105
|
-
if (!attachment) {
|
|
106
|
-
throw new Error('Communication payload with contentAttachment is required.');
|
|
107
|
-
}
|
|
108
|
-
const contentType = toStringOrUndefined(attachment.contentType) || 'application/octet-stream';
|
|
109
|
-
if (!attachment.contentType && mode === 'normalize') {
|
|
110
|
-
warnings.push('Missing contentAttachment.contentType. Defaulting to application/octet-stream.');
|
|
111
|
-
}
|
|
112
|
-
const dataBase64 = toStringOrUndefined(attachment.data);
|
|
113
|
-
const url = toStringOrUndefined(attachment.url);
|
|
114
|
-
if (!dataBase64 && !url && mode === 'strict') {
|
|
115
|
-
throw new Error('contentAttachment requires data or url.');
|
|
116
|
-
}
|
|
117
|
-
const kind = detectAttachmentKind(contentType);
|
|
118
|
-
let contentCid = toStringOrUndefined(attachment.id);
|
|
119
|
-
if (!isCidLike(contentCid)) {
|
|
120
|
-
if (kind === 'fhir' && dataBase64) {
|
|
121
|
-
const json = Buffer.from(dataBase64, 'base64').toString('utf8');
|
|
122
|
-
const parsed = JSON.parse(json);
|
|
123
|
-
const canonical = canonicalizeFhirResource(parsed);
|
|
124
|
-
contentCid = fhirResourceToCid(JSON.parse(canonical)).cid;
|
|
125
|
-
}
|
|
126
|
-
else if (dataBase64) {
|
|
127
|
-
contentCid = cidFromBytes(decodeBase64(dataBase64));
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
contentCid = cidFromBytes(utf8ToBytes(url || 'empty-content'));
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (!contentCid) {
|
|
134
|
-
throw new Error('Unable to generate content CID from attachment.');
|
|
135
|
-
}
|
|
136
|
-
// Good practice note:
|
|
137
|
-
// reusable Communication claim keys consumed here must come from
|
|
138
|
-
// `CommunicationClaim`, not re-hardcoded inline in readers/tests.
|
|
139
|
-
const subject = communication?.meta?.claims?.[CommunicationClaim.Subject];
|
|
140
|
-
const documentReference = {
|
|
141
|
-
resourceType: 'DocumentReference',
|
|
142
|
-
status: 'current',
|
|
143
|
-
meta: {
|
|
144
|
-
versionId: contentCid,
|
|
145
|
-
claims: {
|
|
146
|
-
[DocumentReferenceClaim.Subject]: subject,
|
|
147
|
-
[DocumentReferenceClaim.ContentType]: contentType,
|
|
148
|
-
[DocumentReferenceClaim.Identifier]: contentCid,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
subject: subject ? { reference: subject } : undefined,
|
|
152
|
-
content: [
|
|
153
|
-
{
|
|
154
|
-
attachment: {
|
|
155
|
-
id: contentCid,
|
|
156
|
-
contentType,
|
|
157
|
-
data: dataBase64,
|
|
158
|
-
url,
|
|
159
|
-
title: toStringOrUndefined(attachment.title),
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
};
|
|
164
|
-
return {
|
|
165
|
-
documentReference,
|
|
166
|
-
contentCid,
|
|
167
|
-
evidence: [buildEvidenceForKind(kind, contentCid)],
|
|
168
|
-
warnings,
|
|
169
|
-
};
|
|
170
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export type CommunicationClaims = Record<string, unknown>;
|
|
2
|
-
export type CommunicationTransformMode = 'strict' | 'normalize';
|
|
3
|
-
export type TransformCommunicationClaimsToResourceFhirR4Options = {
|
|
4
|
-
mode?: CommunicationTransformMode;
|
|
5
|
-
defaultStatus?: string;
|
|
6
|
-
};
|
|
7
|
-
export type TransformCommunicationClaimsToResourceFhirR4Result = {
|
|
8
|
-
resources: Array<Record<string, unknown>>;
|
|
9
|
-
warnings: string[];
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Validates a FHIR R4 `Communication` resource through the configured validator pipeline.
|
|
13
|
-
*
|
|
14
|
-
* @param resource Candidate FHIR R4 `Communication` resource.
|
|
15
|
-
*/
|
|
16
|
-
export declare function validateCommunicationResourceFhirR4(resource: Record<string, unknown>): Promise<{
|
|
17
|
-
ok: boolean;
|
|
18
|
-
issues: Array<{
|
|
19
|
-
severity: 'error' | 'warning';
|
|
20
|
-
code: string;
|
|
21
|
-
diagnostics: string;
|
|
22
|
-
expression?: string;
|
|
23
|
-
}>;
|
|
24
|
-
}>;
|
|
25
|
-
/**
|
|
26
|
-
* Transforms canonical communication claims into FHIR R4 `Communication` resources.
|
|
27
|
-
*
|
|
28
|
-
* @param communicationClaims Flat canonical claims rows to convert.
|
|
29
|
-
* @param options.mode `strict` throws on ambiguous/invalid shapes, `normalize` keeps best-effort output.
|
|
30
|
-
* @param options.defaultStatus Default FHIR status when none is provided.
|
|
31
|
-
*/
|
|
32
|
-
export declare function transformCommunicationClaimsToResourceFhirR4(communicationClaims: CommunicationClaims[], options?: TransformCommunicationClaimsToResourceFhirR4Options): TransformCommunicationClaimsToResourceFhirR4Result;
|
|
33
|
-
/**
|
|
34
|
-
* Extracts canonical communication claims from a FHIR R4 `Communication` resource.
|
|
35
|
-
*
|
|
36
|
-
* @param resource FHIR R4 `Communication` resource.
|
|
37
|
-
* @param options.preferMetaClaims When true, existing `resource.meta.claims` wins over structural extraction.
|
|
38
|
-
*/
|
|
39
|
-
export declare function extractCommunicationClaimsFromResourceFhirR4(resource: Record<string, unknown>, options?: {
|
|
40
|
-
preferMetaClaims?: boolean;
|
|
41
|
-
}): CommunicationClaims;
|