gdc-common-utils-ts 2.0.12 → 2.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +6 -2
  2. package/dist/examples/employee.d.ts +9 -1
  3. package/dist/examples/employee.js +7 -4
  4. package/dist/examples/shared.d.ts +1 -1
  5. package/dist/examples/shared.js +6 -2
  6. package/dist/utils/actor.d.ts +3 -1
  7. package/package.json +1 -5
  8. package/dist/examples/communication-bundle-session.d.ts +0 -22
  9. package/dist/examples/communication-bundle-session.js +0 -79
  10. package/dist/interfaces/IWallet.d.ts +0 -55
  11. package/dist/interfaces/IWallet.js +0 -3
  12. package/dist/models/fhir-related-person.d.ts +0 -61
  13. package/dist/models/fhir-related-person.js +0 -108
  14. package/dist/models/related-profile.d.ts +0 -42
  15. package/dist/models/related-profile.js +0 -16
  16. package/dist/utils/allergy-intolerance-claim-helpers.d.ts +0 -10
  17. package/dist/utils/allergy-intolerance-claim-helpers.js +0 -47
  18. package/dist/utils/appointment-claim-helpers.d.ts +0 -10
  19. package/dist/utils/appointment-claim-helpers.js +0 -26
  20. package/dist/utils/appointment-response-claim-helpers.d.ts +0 -8
  21. package/dist/utils/appointment-response-claim-helpers.js +0 -20
  22. package/dist/utils/claim-list-helpers.d.ts +0 -21
  23. package/dist/utils/claim-list-helpers.js +0 -50
  24. package/dist/utils/clinical-impression-claim-helpers.d.ts +0 -10
  25. package/dist/utils/clinical-impression-claim-helpers.js +0 -26
  26. package/dist/utils/communication-bundle-session.d.ts +0 -175
  27. package/dist/utils/communication-bundle-session.js +0 -524
  28. package/dist/utils/composition-claim-helpers.d.ts +0 -12
  29. package/dist/utils/composition-claim-helpers.js +0 -32
  30. package/dist/utils/condition-claim-helpers.d.ts +0 -10
  31. package/dist/utils/condition-claim-helpers.js +0 -47
  32. package/dist/utils/convert-allergy-intolerance.d.ts +0 -3
  33. package/dist/utils/convert-allergy-intolerance.js +0 -34
  34. package/dist/utils/convert-appointment-response.d.ts +0 -3
  35. package/dist/utils/convert-appointment-response.js +0 -32
  36. package/dist/utils/convert-appointment.d.ts +0 -3
  37. package/dist/utils/convert-appointment.js +0 -61
  38. package/dist/utils/convert-care-plan.d.ts +0 -3
  39. package/dist/utils/convert-care-plan.js +0 -58
  40. package/dist/utils/convert-clinical-impression.d.ts +0 -3
  41. package/dist/utils/convert-clinical-impression.js +0 -42
  42. package/dist/utils/convert-composition.d.ts +0 -3
  43. package/dist/utils/convert-composition.js +0 -35
  44. package/dist/utils/convert-condition.d.ts +0 -3
  45. package/dist/utils/convert-condition.js +0 -24
  46. package/dist/utils/convert-coverage.d.ts +0 -3
  47. package/dist/utils/convert-coverage.js +0 -51
  48. package/dist/utils/convert-device-use-statement.d.ts +0 -3
  49. package/dist/utils/convert-device-use-statement.js +0 -28
  50. package/dist/utils/convert-device.d.ts +0 -3
  51. package/dist/utils/convert-device.js +0 -37
  52. package/dist/utils/convert-diagnostic-report.d.ts +0 -3
  53. package/dist/utils/convert-diagnostic-report.js +0 -55
  54. package/dist/utils/convert-document-reference.d.ts +0 -3
  55. package/dist/utils/convert-document-reference.js +0 -35
  56. package/dist/utils/convert-encounter.d.ts +0 -3
  57. package/dist/utils/convert-encounter.js +0 -68
  58. package/dist/utils/convert-flag.d.ts +0 -3
  59. package/dist/utils/convert-flag.js +0 -34
  60. package/dist/utils/convert-immunization.d.ts +0 -3
  61. package/dist/utils/convert-immunization.js +0 -56
  62. package/dist/utils/convert-medication-statement.d.ts +0 -3
  63. package/dist/utils/convert-medication-statement.js +0 -64
  64. package/dist/utils/convert-observation.d.ts +0 -3
  65. package/dist/utils/convert-observation.js +0 -57
  66. package/dist/utils/convert-procedure.d.ts +0 -3
  67. package/dist/utils/convert-procedure.js +0 -50
  68. package/dist/utils/convert-related-person.d.ts +0 -3
  69. package/dist/utils/convert-related-person.js +0 -31
  70. package/dist/utils/convert-shared.d.ts +0 -34
  71. package/dist/utils/convert-shared.js +0 -179
  72. package/dist/utils/coverage-claim-helpers.d.ts +0 -10
  73. package/dist/utils/coverage-claim-helpers.js +0 -26
  74. package/dist/utils/diagnostic-report-claim-helpers.d.ts +0 -12
  75. package/dist/utils/diagnostic-report-claim-helpers.js +0 -32
  76. package/dist/utils/employee-editor.d.ts +0 -24
  77. package/dist/utils/employee-editor.js +0 -41
  78. package/dist/utils/encounter-claim-helpers.d.ts +0 -10
  79. package/dist/utils/encounter-claim-helpers.js +0 -26
  80. package/dist/utils/gateway-index-params.d.ts +0 -44
  81. package/dist/utils/gateway-index-params.js +0 -80
  82. package/dist/utils/medication-claim-helpers.d.ts +0 -88
  83. package/dist/utils/medication-claim-helpers.js +0 -259
  84. package/dist/utils/normalize-subject-uuid.d.ts +0 -1
  85. package/dist/utils/normalize-subject-uuid.js +0 -24
  86. package/dist/utils/related-person-claim-helpers.d.ts +0 -8
  87. package/dist/utils/related-person-claim-helpers.js +0 -20
  88. package/dist/utils/search-parameter-catalog.d.ts +0 -31
  89. package/dist/utils/search-parameter-catalog.js +0 -81
package/README.md CHANGED
@@ -601,15 +601,19 @@ These helpers are the shared base for consent claim construction across GW and S
601
601
 
602
602
  ### Interfaces
603
603
 
604
- The `interfaces` export contains the shared type contracts and cryptography types, including:
604
+ The `interfaces` export contains the shared low-level type contracts and cryptography types, including:
605
605
 
606
606
  - `ICryptography`
607
607
  - `ICryptoHelper`
608
- - `IWallet`
609
608
  - `Cryptography.types`
610
609
  - `MlDsa`
611
610
  - `MlKem`
612
611
 
612
+ Wallet contracts and runtime adapters live in higher layers:
613
+
614
+ - `gdc-sdk-core-ts` owns the runtime-neutral `IWallet` contract
615
+ - `gdc-sdk-node-ts` owns concrete Node wallet/runtime adapters
616
+
613
617
  Example:
614
618
 
615
619
  ```ts
@@ -2,11 +2,16 @@
2
2
  * Canonical employee directory fixture shared by docs and tests.
3
3
  *
4
4
  * Semantics:
5
- * - `identifier` points to one technical employee profile
5
+ * - `resourceId` is the current internal GW profile id
6
+ * - `resourceId` is a transport/runtime locator and should remain one
7
+ * `urn:uuid:*` technical anchor
8
+ * - `identifier` is the exportable/interoperable employee identity and may be
9
+ * public, DID-based, or another stable external identifier
6
10
  * - `email` can map to multiple active roles
7
11
  * - a purged profile remains historically addressable by `identifier`
8
12
  */
9
13
  export type ExampleEmployeeRecord = Readonly<{
14
+ resourceId: string;
10
15
  identifier: string;
11
16
  email: string;
12
17
  role: string;
@@ -23,16 +28,19 @@ export declare const EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE: ExampleEmployeeRecord;
23
28
  export declare const EXAMPLE_EMPLOYEE_DOCTOR_ACTIVE: ExampleEmployeeRecord;
24
29
  export declare const EXAMPLE_EMPLOYEE_DOCTOR_PURGED_HISTORICAL: ExampleEmployeeRecord;
25
30
  export declare const EXAMPLE_EMPLOYEE_DIRECTORY_RECORDS: readonly [Readonly<{
31
+ resourceId: string;
26
32
  identifier: string;
27
33
  email: string;
28
34
  role: string;
29
35
  status: "active" | "inactive" | "purged";
30
36
  }>, Readonly<{
37
+ resourceId: string;
31
38
  identifier: string;
32
39
  email: string;
33
40
  role: string;
34
41
  status: "active" | "inactive" | "purged";
35
42
  }>, Readonly<{
43
+ resourceId: string;
36
44
  identifier: string;
37
45
  email: string;
38
46
  role: string;
@@ -7,19 +7,22 @@ export const ExampleEmployeeRoles = Object.freeze({
7
7
  Doctor: 'ISCO-08|2211',
8
8
  });
9
9
  export const EXAMPLE_EMPLOYEE_CONTROLLER_ACTIVE = Object.freeze({
10
- identifier: 'urn:uuid:employee-controller-active-001',
10
+ resourceId: 'urn:uuid:11111111-1111-4111-8111-111111111111',
11
+ identifier: 'did:web:api.example.org:employee:shared.professional@example.org:ISCO-08|1120',
11
12
  email: ExampleEmployeeEmails.SharedProfessional,
12
13
  role: ExampleEmployeeRoles.Controller,
13
14
  status: 'active',
14
15
  });
15
16
  export const EXAMPLE_EMPLOYEE_DOCTOR_ACTIVE = Object.freeze({
16
- identifier: 'urn:uuid:employee-doctor-active-001',
17
+ resourceId: 'urn:uuid:22222222-2222-4222-8222-222222222222',
18
+ identifier: 'did:web:api.example.org:employee:shared.professional@example.org:ISCO-08|2211',
17
19
  email: ExampleEmployeeEmails.SharedProfessional,
18
20
  role: ExampleEmployeeRoles.Doctor,
19
21
  status: 'active',
20
22
  });
21
23
  export const EXAMPLE_EMPLOYEE_DOCTOR_PURGED_HISTORICAL = Object.freeze({
22
- identifier: 'urn:uuid:employee-doctor-purged-000',
24
+ resourceId: 'urn:uuid:33333333-3333-4333-8333-333333333333',
25
+ identifier: 'did:web:api.example.org:employee:shared.professional@example.org:ISCO-08|2211:historical:000',
23
26
  email: ExampleEmployeeEmails.SharedProfessional,
24
27
  role: ExampleEmployeeRoles.Doctor,
25
28
  status: 'purged',
@@ -45,7 +48,7 @@ export function buildExampleEmployeeClaims(record) {
45
48
  */
46
49
  export const EXAMPLE_EMPLOYEE_SEARCH_RESPONSE_BODY = Object.freeze({
47
50
  data: EXAMPLE_EMPLOYEE_DIRECTORY_RECORDS.map((record) => ({
48
- id: record.identifier,
51
+ id: record.resourceId,
49
52
  meta: {
50
53
  status: record.status,
51
54
  claims: buildExampleEmployeeClaims(record),
@@ -105,7 +105,7 @@ export declare const EXAMPLE_CONTROLLER_EMAIL: "controller@acme.org";
105
105
  export declare const EXAMPLE_CONTROLLER_SAME_AS: "mailto:controller@acme.org";
106
106
  export declare const EXAMPLE_API_ORGANIZATION_DID: "did:web:api.acme.org";
107
107
  export declare const EXAMPLE_SERVICE_PUBLIC_DID: "did:web:public.acme.org";
108
- export declare const EXAMPLE_PROFESSIONAL_DID: "did:web:api.acme.org:professional:1";
108
+ export declare const EXAMPLE_PROFESSIONAL_DID: string;
109
109
  export declare const EXAMPLE_PROVIDER_ORGANIZATION_DID: "did:web:hospital.acme.org";
110
110
  export declare const EXAMPLE_PROVIDER_ORGANIZATION_URL: "https://hospital.acme.org";
111
111
  export declare const EXAMPLE_GATEWAY_PUBLIC_ORIGIN: "https://gateway.example.com";
@@ -11,7 +11,7 @@ import { HealthcareActorRoles, HealthcareBasicSections, HealthcareConsentPurpose
11
11
  import { CommunicationCategoryCodes } from '../constants/communication.js';
12
12
  import { LOINC_SYSTEM_URL } from '../models/clinical-sections.js';
13
13
  import { CommunicationClaim } from '../models/interoperable-claims/communication-claims.js';
14
- import { buildHostedProviderDidWeb, buildIndividualDidWeb, buildIndividualMemberDidWeb, buildProviderSectorDidWeb, } from '../utils/did.js';
14
+ import { buildHostedProviderDidWeb, buildIndividualDidWeb, buildIndividualMemberDidWeb, buildProfessionalDidWeb, buildProviderSectorDidWeb, } from '../utils/did.js';
15
15
  import { encodeHexToMultibase58btc } from '../utils/multibase58.js';
16
16
  import { MedicationStatementClaim, MedicationStatementClaimsFhirApiExtended, } from '../models/interoperable-claims/medication-statement-claims.js';
17
17
  import { medicationStatementFlatToFhirR4 } from '../utils/clinical-resource-converters.js';
@@ -120,7 +120,11 @@ export const EXAMPLE_CONTROLLER_EMAIL = EXAMPLE_EMAIL_CONTROLLER_ORG;
120
120
  export const EXAMPLE_CONTROLLER_SAME_AS = `mailto:${EXAMPLE_CONTROLLER_EMAIL}`;
121
121
  export const EXAMPLE_API_ORGANIZATION_DID = 'did:web:api.acme.org';
122
122
  export const EXAMPLE_SERVICE_PUBLIC_DID = 'did:web:public.acme.org';
123
- export const EXAMPLE_PROFESSIONAL_DID = 'did:web:api.acme.org:professional:1';
123
+ export const EXAMPLE_PROFESSIONAL_DID = buildProfessionalDidWeb({
124
+ organizationDidWeb: 'did:web:api.acme.org',
125
+ email: 'doctor.oncall@example.org',
126
+ role: HealthcareActorRoles.Physician,
127
+ });
124
128
  export const EXAMPLE_PROVIDER_ORGANIZATION_DID = 'did:web:hospital.acme.org';
125
129
  export const EXAMPLE_PROVIDER_ORGANIZATION_URL = 'https://hospital.acme.org';
126
130
  export const EXAMPLE_GATEWAY_PUBLIC_ORIGIN = 'https://gateway.example.com';
@@ -2,13 +2,15 @@ export type ParsedActor = {
2
2
  /**
3
3
  * The token subject / authenticated actor identifier (as provided in the token request).
4
4
  * Examples:
5
+ * - did:web:api.acme.org:employee:z6MksExampleHashedEmployeeId:ISCO-08|2211
6
+ * - did:web:api.acme.org:employee:z6MksExampleHashedEmployeeId:ISCO-08|2211:<device-uuid>
5
7
  * - did:web:api.acme.org:employee:doctor1@acme.org:ISCO-08|2211
6
8
  * - did:web:api.acme.org:employee:doctor1@acme.org:ISCO-08|2211:<device-uuid>
7
9
  * - did:web:api.acme.org:family:<id>:v3-RoleCode|ONESELF
8
10
  * - did:web:api.acme.org:family:<id>:v3-RoleCode|CHILD:<device-uuid>
9
11
  */
10
12
  sub: string;
11
- /** The actor identifier (employee email, familyId, or raw email). */
13
+ /** The actor identifier (employee hashed-id/email token, familyId, or raw email). */
12
14
  identifier?: string;
13
15
  /** The employee role code if present (e.g. "ISCO-08|2211"). */
14
16
  role?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -102,10 +102,6 @@
102
102
  "./storage/*": {
103
103
  "types": "./dist/storage/*.d.ts",
104
104
  "default": "./dist/storage/*.js"
105
- },
106
- "./adapters/node/crypto": {
107
- "types": "./dist/adapters/node/crypto.d.ts",
108
- "default": "./dist/adapters/node/crypto.js"
109
105
  }
110
106
  },
111
107
  "files": [
@@ -1,22 +0,0 @@
1
- import { BundleEntry, BundleJsonApi } from '../models/bundle';
2
- /**
3
- * First developer use case:
4
- * - edit a Consent entry inside a Communication-attached Bundle
5
- * - keep active entry in memory
6
- * - serialize full Bundle to Communication.content-attachment-data on save
7
- * - release active entry memory when finished
8
- */
9
- export declare function buildConsentEditingCommunicationSessionExample(): {
10
- communicationClaims: Record<string, unknown>;
11
- bundleInMemory: BundleJsonApi<BundleEntry>;
12
- };
13
- /**
14
- * Second developer use case:
15
- * - edit MedicationStatement claims to drive a health view
16
- * - keep bundle attached to Communication as base64 payload
17
- * - apply save/release lifecycle consistently
18
- */
19
- export declare function buildMedicationEditingCommunicationSessionExample(): {
20
- communicationClaims: Record<string, unknown>;
21
- bundleInMemory: BundleJsonApi<BundleEntry>;
22
- };
@@ -1,79 +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 { HealthcareBasicSections } from '../constants/healthcare.js';
4
- import { CommunicationCategoryCodes } from '../constants/communication.js';
5
- import { MedicationStatementClaim } from '../models/interoperable-claims/medication-statement-claims.js';
6
- import { EXAMPLE_COMMUNICATION_IDENTIFIER, EXAMPLE_CONSENT_DATE, EXAMPLE_CONSENT_IDENTIFIER, EXAMPLE_CONSENT_PERIOD_END, EXAMPLE_CONSENT_PERIOD_START, EXAMPLE_CONSENT_PURPOSE_TREATMENT, EXAMPLE_EMAIL_PROFESSIONAL, EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN, EXAMPLE_IPS_BUNDLE_NOTE_TEXT, EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER, EXAMPLE_MEDICATION_STATEMENT_STATUS, EXAMPLE_MEDICATION_STATEMENT_TEXT, EXAMPLE_SUBJECT_DID, } from './shared.js';
7
- import { CommunicationBundleSession } from '../utils/communication-bundle-session.js';
8
- import { setCommunicationCategory, setCommunicationIdentifier, setCommunicationSubject, setCommunicationText, } from '../claims/claims-helpers-communication.js';
9
- import { setActorIdentifierList, setActorRoleList, setConsentDate, setConsentDecision, setConsentIdentifier, setConsentPeriodEnd, setConsentPeriodStart, setConsentSubject, setPurposeList, setSectionList, } from '../claims/claims-helpers-consent.js';
10
- /**
11
- * First developer use case:
12
- * - edit a Consent entry inside a Communication-attached Bundle
13
- * - keep active entry in memory
14
- * - serialize full Bundle to Communication.content-attachment-data on save
15
- * - release active entry memory when finished
16
- */
17
- export function buildConsentEditingCommunicationSessionExample() {
18
- let communicationClaims = { '@context': 'org.hl7.fhir.r4' };
19
- communicationClaims = setCommunicationIdentifier(communicationClaims, EXAMPLE_COMMUNICATION_IDENTIFIER);
20
- communicationClaims = setCommunicationSubject(communicationClaims, EXAMPLE_SUBJECT_DID);
21
- communicationClaims = setCommunicationCategory(communicationClaims, CommunicationCategoryCodes.Notification.attributeValue);
22
- communicationClaims = setCommunicationText(communicationClaims, EXAMPLE_IPS_BUNDLE_NOTE_TEXT);
23
- const bundleEditor = new CommunicationBundleSession({
24
- communicationClaims,
25
- });
26
- let consentClaims = { '@context': 'org.hl7.fhir.api' };
27
- consentClaims = setConsentDecision(consentClaims, 'permit');
28
- consentClaims = setConsentSubject(consentClaims, EXAMPLE_SUBJECT_DID);
29
- consentClaims = setConsentIdentifier(consentClaims, EXAMPLE_CONSENT_IDENTIFIER);
30
- consentClaims = setConsentDate(consentClaims, EXAMPLE_CONSENT_DATE);
31
- consentClaims = setConsentPeriodStart(consentClaims, EXAMPLE_CONSENT_PERIOD_START);
32
- consentClaims = setConsentPeriodEnd(consentClaims, EXAMPLE_CONSENT_PERIOD_END);
33
- consentClaims = setPurposeList(consentClaims, [EXAMPLE_CONSENT_PURPOSE_TREATMENT]);
34
- consentClaims = setSectionList(consentClaims, [
35
- HealthcareBasicSections.AllergiesAndIntolerances.attributeValue,
36
- ]);
37
- consentClaims = setActorIdentifierList(consentClaims, [EXAMPLE_EMAIL_PROFESSIONAL]);
38
- consentClaims = setActorRoleList(consentClaims, [EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN]);
39
- bundleEditor.upsertActiveConsentEntry({
40
- claims: consentClaims,
41
- fullUrl: `urn:uuid:${EXAMPLE_CONSENT_IDENTIFIER}`,
42
- });
43
- bundleEditor.saveAndReleaseActiveEntry();
44
- return {
45
- communicationClaims: bundleEditor.getCommunicationClaims(),
46
- bundleInMemory: bundleEditor.getBundleInMemory(),
47
- };
48
- }
49
- /**
50
- * Second developer use case:
51
- * - edit MedicationStatement claims to drive a health view
52
- * - keep bundle attached to Communication as base64 payload
53
- * - apply save/release lifecycle consistently
54
- */
55
- export function buildMedicationEditingCommunicationSessionExample() {
56
- let communicationClaims = { '@context': 'org.hl7.fhir.r4' };
57
- communicationClaims = setCommunicationIdentifier(communicationClaims, EXAMPLE_COMMUNICATION_IDENTIFIER);
58
- communicationClaims = setCommunicationSubject(communicationClaims, EXAMPLE_SUBJECT_DID);
59
- communicationClaims = setCommunicationCategory(communicationClaims, CommunicationCategoryCodes.Reminder.attributeValue);
60
- communicationClaims = setCommunicationText(communicationClaims, EXAMPLE_IPS_BUNDLE_NOTE_TEXT);
61
- const bundleEditor = new CommunicationBundleSession({
62
- communicationClaims,
63
- });
64
- bundleEditor.upsertActiveMedicationStatementEntry({
65
- claims: {
66
- '@context': 'org.hl7.fhir.api',
67
- [MedicationStatementClaim.Identifier]: EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER,
68
- [MedicationStatementClaim.Subject]: EXAMPLE_SUBJECT_DID,
69
- [MedicationStatementClaim.Status]: EXAMPLE_MEDICATION_STATEMENT_STATUS,
70
- [MedicationStatementClaim.MedicationText]: EXAMPLE_MEDICATION_STATEMENT_TEXT,
71
- },
72
- fullUrl: `urn:uuid:${EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER}`,
73
- });
74
- bundleEditor.saveAndReleaseActiveEntry();
75
- return {
76
- communicationClaims: bundleEditor.getCommunicationClaims(),
77
- bundleInMemory: bundleEditor.getBundleInMemory(),
78
- };
79
- }
@@ -1,55 +0,0 @@
1
- import { JwkSet } from '../models/jwk';
2
- /**
3
- * @interface IWallet
4
- * Defines the contract for a client-side Wallet, acting as the "frontend KmsService".
5
- * It provides high-level cryptographic capabilities without exposing low-level primitives.
6
- * @sdk
7
- */
8
- export interface IWallet {
9
- /**
10
- * Provisions a new, full set of cryptographic keys for a given entity identifier.
11
- * This is the primary method for creating a new cryptographic identity.
12
- * @param entityId The unique identifier for the key set (e.g., a profile ID).
13
- * @returns A Promise that resolves to the public parts of the generated keys in a JWKSet format.
14
- */
15
- provisionKeys(entityId: string): Promise<JwkSet>;
16
- /**
17
- * Creates a cryptographic digest (hash) of a string.
18
- * @param data The string to hash.
19
- * @param algorithm The digest algorithm to use.
20
- * @returns A Promise that resolves to the hex-encoded hash string.
21
- */
22
- digest(data: string, algorithm: any): Promise<string>;
23
- /**
24
- * Encrypts a document for secure, local storage (at-rest).
25
- * @param doc The document to protect, which must have a `.content` property.
26
- * @param entityId The ID of the entity whose keys should be used for encryption.
27
- * @returns A Promise that resolves to the protected document, where `.content` is replaced by `.jwe`.
28
- */
29
- protectConfidentialData(doc: any, entityId: string): Promise<any>;
30
- /**
31
- * Decrypts a document from secure storage.
32
- * @param doc The protected document containing the `.jwe` property.
33
- * @param entityId The ID of the entity whose keys should be used for decryption.
34
- * @returns A Promise that resolves to the document with the decrypted `.content`.
35
- */
36
- unprotectConfidentialData(doc: any, entityId: string): Promise<any>;
37
- /**
38
- * (Optional) Packs a DIDComm message into a secure format (JWE/JARM) for a recipient.
39
- * This is required for FAPI-compliant flows.
40
- * @param content The DIDComm message content to pack.
41
- * @param recipientDid The DID of the recipient.
42
- * @returns A Promise that resolves to the packed, secure message string.
43
- */
44
- packForRecipient?(content: any, recipientDid: string): Promise<string>;
45
- /**
46
- * (Optional) Unpacks a secure message (JWE/JARM) received from a server.
47
- * This is the counterpart to `packForRecipient`.
48
- * @param packedMessage The secure message string (e.g., a compact JWE).
49
- * @returns A Promise that resolves to an object containing the plaintext `content` and any cryptographic `meta` data.
50
- */
51
- unpack?(packedMessage: string): Promise<{
52
- content: any;
53
- meta: any;
54
- }>;
55
- }
@@ -1,3 +0,0 @@
1
- // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- // File: crypto-ts/interfaces/IWallet.ts
3
- export {};
@@ -1,61 +0,0 @@
1
- /**
2
- * @fileoverview Canonical flat-claim constants for FHIR `RelatedPerson`.
3
- *
4
- * @architecture 101
5
- * - Use exported constants instead of inline claim-name literals.
6
- * - `ClaimsContextFhirRelatedPerson` models the stable business/search contract.
7
- * - `RelatedPerson.patient` is kept as a transport/storage compatibility alias for
8
- * existing R4 payloads, while `RelatedPerson.subject` remains the shared SDK name.
9
- */
10
- import type { SearchParameterCatalog } from './params';
11
- /**
12
- * Canonical interoperable claims for `RelatedPerson`.
13
- *
14
- * The enum follows the established `ResourceType.parameter` shape used by the
15
- * rest of the flat FHIR claims model.
16
- */
17
- export declare enum ClaimsContextFhirRelatedPerson {
18
- Identifier = "RelatedPerson.identifier",
19
- Subject = "RelatedPerson.subject",
20
- Relationship = "RelatedPerson.relationship",
21
- Name = "RelatedPerson.name",
22
- Email = "RelatedPerson.email",
23
- Phone = "RelatedPerson.phone"
24
- }
25
- /**
26
- * Legacy FHIR R4 field name still present in examples and existing stored data.
27
- *
28
- * New shared code should normalize from this alias into
29
- * `ClaimsContextFhirRelatedPerson.Subject` when projecting business DTOs.
30
- */
31
- export declare const FHIR_RELATED_PERSON_PATIENT_CLAIM: "RelatedPerson.patient";
32
- /**
33
- * Legacy telecom alias preserved for older ingestion payloads.
34
- */
35
- export declare const FHIR_RELATED_PERSON_TELECOM_CLAIM: "RelatedPerson.telecom";
36
- /**
37
- * Optional lifecycle/status claim used by projections when present.
38
- */
39
- export declare const FHIR_RELATED_PERSON_STATUS_CLAIM: "RelatedPerson.status";
40
- /**
41
- * Public search parameter names exposed for `RelatedPerson`.
42
- *
43
- * These names are independent from the underlying flat claim keys and are the
44
- * right source for client-side search UIs and future `CapabilityStatement`
45
- * generation.
46
- */
47
- export declare enum RelatedPersonSearchParameterName {
48
- Identifier = "identifier",
49
- Subject = "subject",
50
- Relationship = "relationship",
51
- Name = "name",
52
- Email = "email",
53
- Phone = "phone"
54
- }
55
- /**
56
- * Shared searchable/indexable parameter catalog for `RelatedPerson`.
57
- *
58
- * `name` is the canonical flat claim key to index/query. The record key is the
59
- * public search-attribute name.
60
- */
61
- export declare const relatedPersonSearchParameterCatalog: SearchParameterCatalog<RelatedPersonSearchParameterName>;
@@ -1,108 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- /**
3
- * @fileoverview Canonical flat-claim constants for FHIR `RelatedPerson`.
4
- *
5
- * @architecture 101
6
- * - Use exported constants instead of inline claim-name literals.
7
- * - `ClaimsContextFhirRelatedPerson` models the stable business/search contract.
8
- * - `RelatedPerson.patient` is kept as a transport/storage compatibility alias for
9
- * existing R4 payloads, while `RelatedPerson.subject` remains the shared SDK name.
10
- */
11
- /**
12
- * Canonical interoperable claims for `RelatedPerson`.
13
- *
14
- * The enum follows the established `ResourceType.parameter` shape used by the
15
- * rest of the flat FHIR claims model.
16
- */
17
- export var ClaimsContextFhirRelatedPerson;
18
- (function (ClaimsContextFhirRelatedPerson) {
19
- ClaimsContextFhirRelatedPerson["Identifier"] = "RelatedPerson.identifier";
20
- ClaimsContextFhirRelatedPerson["Subject"] = "RelatedPerson.subject";
21
- ClaimsContextFhirRelatedPerson["Relationship"] = "RelatedPerson.relationship";
22
- ClaimsContextFhirRelatedPerson["Name"] = "RelatedPerson.name";
23
- ClaimsContextFhirRelatedPerson["Email"] = "RelatedPerson.email";
24
- ClaimsContextFhirRelatedPerson["Phone"] = "RelatedPerson.phone";
25
- })(ClaimsContextFhirRelatedPerson || (ClaimsContextFhirRelatedPerson = {}));
26
- /**
27
- * Legacy FHIR R4 field name still present in examples and existing stored data.
28
- *
29
- * New shared code should normalize from this alias into
30
- * `ClaimsContextFhirRelatedPerson.Subject` when projecting business DTOs.
31
- */
32
- export const FHIR_RELATED_PERSON_PATIENT_CLAIM = 'RelatedPerson.patient';
33
- /**
34
- * Legacy telecom alias preserved for older ingestion payloads.
35
- */
36
- export const FHIR_RELATED_PERSON_TELECOM_CLAIM = 'RelatedPerson.telecom';
37
- /**
38
- * Optional lifecycle/status claim used by projections when present.
39
- */
40
- export const FHIR_RELATED_PERSON_STATUS_CLAIM = 'RelatedPerson.status';
41
- /**
42
- * Public search parameter names exposed for `RelatedPerson`.
43
- *
44
- * These names are independent from the underlying flat claim keys and are the
45
- * right source for client-side search UIs and future `CapabilityStatement`
46
- * generation.
47
- */
48
- export var RelatedPersonSearchParameterName;
49
- (function (RelatedPersonSearchParameterName) {
50
- RelatedPersonSearchParameterName["Identifier"] = "identifier";
51
- RelatedPersonSearchParameterName["Subject"] = "subject";
52
- RelatedPersonSearchParameterName["Relationship"] = "relationship";
53
- RelatedPersonSearchParameterName["Name"] = "name";
54
- RelatedPersonSearchParameterName["Email"] = "email";
55
- RelatedPersonSearchParameterName["Phone"] = "phone";
56
- })(RelatedPersonSearchParameterName || (RelatedPersonSearchParameterName = {}));
57
- /**
58
- * Shared searchable/indexable parameter catalog for `RelatedPerson`.
59
- *
60
- * `name` is the canonical flat claim key to index/query. The record key is the
61
- * public search-attribute name.
62
- */
63
- export const relatedPersonSearchParameterCatalog = {
64
- [RelatedPersonSearchParameterName.Identifier]: {
65
- name: ClaimsContextFhirRelatedPerson.Identifier,
66
- type: 'token',
67
- value: undefined,
68
- indexed: true,
69
- appliesTo: ['RelatedPerson'],
70
- },
71
- [RelatedPersonSearchParameterName.Subject]: {
72
- name: ClaimsContextFhirRelatedPerson.Subject,
73
- type: 'reference',
74
- value: undefined,
75
- indexed: true,
76
- claimAliases: [FHIR_RELATED_PERSON_PATIENT_CLAIM],
77
- appliesTo: ['RelatedPerson'],
78
- },
79
- [RelatedPersonSearchParameterName.Relationship]: {
80
- name: ClaimsContextFhirRelatedPerson.Relationship,
81
- type: 'token',
82
- value: undefined,
83
- indexed: true,
84
- appliesTo: ['RelatedPerson'],
85
- },
86
- [RelatedPersonSearchParameterName.Name]: {
87
- name: ClaimsContextFhirRelatedPerson.Name,
88
- type: 'string',
89
- value: undefined,
90
- indexed: true,
91
- appliesTo: ['RelatedPerson'],
92
- },
93
- [RelatedPersonSearchParameterName.Email]: {
94
- name: ClaimsContextFhirRelatedPerson.Email,
95
- type: 'token',
96
- value: undefined,
97
- indexed: true,
98
- appliesTo: ['RelatedPerson'],
99
- },
100
- [RelatedPersonSearchParameterName.Phone]: {
101
- name: ClaimsContextFhirRelatedPerson.Phone,
102
- type: 'token',
103
- value: undefined,
104
- indexed: true,
105
- claimAliases: [FHIR_RELATED_PERSON_TELECOM_CLAIM],
106
- appliesTo: ['RelatedPerson'],
107
- },
108
- };
@@ -1,42 +0,0 @@
1
- /**
2
- * @fileoverview Shared DTOs for portal/BFF `related profiles` projections.
3
- *
4
- * @architecture 101
5
- * - These DTOs are frontend-facing projections, not raw FHIR payloads.
6
- * - Raw search/index semantics stay in `ClaimsContextFhirRelatedPerson`.
7
- * - Use exported constants for repeated source and parameter names.
8
- */
9
- export type RelatedProfileStatus = 'active' | 'pending' | 'inactive' | 'revoked';
10
- export type RelatedProfileRole = 'controller' | 'caregiver' | 'related-person' | 'professional' | 'member' | 'unknown';
11
- export type RelatedProfileSource = 'relatedperson';
12
- export declare const RELATED_PROFILE_SOURCE_RELATED_PERSON: "relatedperson";
13
- export declare const RELATED_PROFILE_SEARCH_PARAM_ACTOR_IDENTIFIER: "actorIdentifier";
14
- export declare const RELATED_PROFILE_SEARCH_PARAM_SUBJECT_ID: "subjectId";
15
- export declare const RELATED_PROFILE_SEARCH_PARAM_RELATIONSHIP: "relationship";
16
- export declare const RELATED_PROFILE_SEARCH_PARAM_INCLUDE_INACTIVE: "includeInactive";
17
- export type RelatedProfileSearchInput = Readonly<{
18
- actorIdentifier: string;
19
- subjectId?: string;
20
- relationship?: string;
21
- includeInactive?: boolean;
22
- }>;
23
- export type RelatedProfileSummary = Readonly<{
24
- relationshipId: string;
25
- source: RelatedProfileSource;
26
- subjectId: string;
27
- actorIdentifier?: string;
28
- actorDisplayName?: string;
29
- actorTelecom?: string;
30
- relationship?: string;
31
- role: RelatedProfileRole;
32
- isController: boolean;
33
- status: RelatedProfileStatus;
34
- claims: Record<string, unknown>;
35
- }>;
36
- export type RelatedProfileSearchResult = Readonly<{
37
- actorIdentifier: string;
38
- total: number;
39
- data: RelatedProfileSummary[];
40
- }>;
41
- export declare const DEFAULT_INDIVIDUAL_MEMBER_BASELINE_SEATS = 2;
42
- export declare const DEFAULT_INDIVIDUAL_MEMBER_BASELINE_PRICE_EUR = "0.00";
@@ -1,16 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- /**
3
- * @fileoverview Shared DTOs for portal/BFF `related profiles` projections.
4
- *
5
- * @architecture 101
6
- * - These DTOs are frontend-facing projections, not raw FHIR payloads.
7
- * - Raw search/index semantics stay in `ClaimsContextFhirRelatedPerson`.
8
- * - Use exported constants for repeated source and parameter names.
9
- */
10
- export const RELATED_PROFILE_SOURCE_RELATED_PERSON = 'relatedperson';
11
- export const RELATED_PROFILE_SEARCH_PARAM_ACTOR_IDENTIFIER = 'actorIdentifier';
12
- export const RELATED_PROFILE_SEARCH_PARAM_SUBJECT_ID = 'subjectId';
13
- export const RELATED_PROFILE_SEARCH_PARAM_RELATIONSHIP = 'relationship';
14
- export const RELATED_PROFILE_SEARCH_PARAM_INCLUDE_INACTIVE = 'includeInactive';
15
- export const DEFAULT_INDIVIDUAL_MEMBER_BASELINE_SEATS = 2;
16
- export const DEFAULT_INDIVIDUAL_MEMBER_BASELINE_PRICE_EUR = '0.00';
@@ -1,10 +0,0 @@
1
- import { type GenericInteroperableClaims } from './claim-list-helpers.js';
2
- export type AllergyIntoleranceInteroperableClaims = GenericInteroperableClaims;
3
- export declare function getAllergyIntoleranceClaimList(claims: AllergyIntoleranceInteroperableClaims, claimKey: string): string[];
4
- export declare function setAllergyIntoleranceClaimList(claims: AllergyIntoleranceInteroperableClaims, claimKey: string, values: string | readonly string[]): AllergyIntoleranceInteroperableClaims;
5
- export declare function addAllergyIntoleranceClaimList(claims: AllergyIntoleranceInteroperableClaims, claimKey: string, values: string | readonly string[]): AllergyIntoleranceInteroperableClaims;
6
- export declare function removeAllergyIntoleranceClaimList(claims: AllergyIntoleranceInteroperableClaims, claimKey: string, values: string | readonly string[]): AllergyIntoleranceInteroperableClaims;
7
- export declare function getAllergyIntoleranceContainedDocumentIdentifierList(claims: AllergyIntoleranceInteroperableClaims): string[];
8
- export declare function setAllergyIntoleranceContainedDocumentIdentifierList(claims: AllergyIntoleranceInteroperableClaims, values: string | readonly string[]): AllergyIntoleranceInteroperableClaims;
9
- export declare function addAllergyIntoleranceContainedDocumentIdentifierList(claims: AllergyIntoleranceInteroperableClaims, values: string | readonly string[]): AllergyIntoleranceInteroperableClaims;
10
- export declare function removeAllergyIntoleranceContainedDocumentIdentifierList(claims: AllergyIntoleranceInteroperableClaims, values: string | readonly string[]): AllergyIntoleranceInteroperableClaims;
@@ -1,47 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- import { AllergyIntoleranceClaim } from '../models/interoperable-claims/allergy-intolerance-claims.js';
3
- import { addClaimValues, getClaimValues, removeClaimValues, setClaimValues, } from './claim-list-helpers.js';
4
- export function getAllergyIntoleranceClaimList(claims, claimKey) {
5
- return getClaimValues(claims, claimKey);
6
- }
7
- export function setAllergyIntoleranceClaimList(claims, claimKey, values) {
8
- return setClaimValues(claims, claimKey, values);
9
- }
10
- export function addAllergyIntoleranceClaimList(claims, claimKey, values) {
11
- return addClaimValues(claims, claimKey, values);
12
- }
13
- export function removeAllergyIntoleranceClaimList(claims, claimKey, values) {
14
- return removeClaimValues(claims, claimKey, values);
15
- }
16
- export function getAllergyIntoleranceContainedDocumentIdentifierList(claims) {
17
- return uniqueCsvLists([
18
- getAllergyIntoleranceClaimList(claims, AllergyIntoleranceClaim.ContainedDocuments),
19
- getAllergyIntoleranceClaimList(claims, AllergyIntoleranceClaim.AttachmentContentIds),
20
- ]);
21
- }
22
- export function setAllergyIntoleranceContainedDocumentIdentifierList(claims, values) {
23
- return setContainedDocuments(claims, values);
24
- }
25
- export function addAllergyIntoleranceContainedDocumentIdentifierList(claims, values) {
26
- return setContainedDocuments(claims, uniqueCsvLists([
27
- getAllergyIntoleranceContainedDocumentIdentifierList(claims),
28
- Array.isArray(values) ? [...values] : getAllergyIntoleranceClaimList({ [AllergyIntoleranceClaim.ContainedDocuments]: values }, AllergyIntoleranceClaim.ContainedDocuments),
29
- ]));
30
- }
31
- export function removeAllergyIntoleranceContainedDocumentIdentifierList(claims, values) {
32
- const toRemove = new Set((Array.isArray(values) ? values : getAllergyIntoleranceClaimList({ [AllergyIntoleranceClaim.ContainedDocuments]: values }, AllergyIntoleranceClaim.ContainedDocuments))
33
- .map((item) => String(item || '').trim())
34
- .filter(Boolean));
35
- return setContainedDocuments(claims, getAllergyIntoleranceContainedDocumentIdentifierList(claims).filter((item) => !toRemove.has(item)));
36
- }
37
- function setContainedDocuments(claims, values) {
38
- const next = setAllergyIntoleranceClaimList(claims, AllergyIntoleranceClaim.ContainedDocuments, values);
39
- const cleaned = {
40
- ...next,
41
- };
42
- delete cleaned[AllergyIntoleranceClaim.AttachmentContentIds];
43
- return cleaned;
44
- }
45
- function uniqueCsvLists(lists) {
46
- return [...new Set(lists.flatMap((list) => list.map((item) => String(item || '').trim()).filter(Boolean)))];
47
- }
@@ -1,10 +0,0 @@
1
- import { type GenericInteroperableClaims } from './claim-list-helpers.js';
2
- export type AppointmentInteroperableClaims = GenericInteroperableClaims;
3
- export declare function getAppointmentClaimList(claims: AppointmentInteroperableClaims, claimKey: string): string[];
4
- export declare function setAppointmentClaimList(claims: AppointmentInteroperableClaims, claimKey: string, values: string | readonly string[]): AppointmentInteroperableClaims;
5
- export declare function addAppointmentClaimList(claims: AppointmentInteroperableClaims, claimKey: string, values: string | readonly string[]): AppointmentInteroperableClaims;
6
- export declare function removeAppointmentClaimList(claims: AppointmentInteroperableClaims, claimKey: string, values: string | readonly string[]): AppointmentInteroperableClaims;
7
- export declare function getAppointmentIdentifier(claims: AppointmentInteroperableClaims): string;
8
- export declare function setAppointmentIdentifier(claims: AppointmentInteroperableClaims, value: string): AppointmentInteroperableClaims;
9
- export declare function getAppointmentParticipantActorList(claims: AppointmentInteroperableClaims): string[];
10
- export declare function setAppointmentParticipantActorList(claims: AppointmentInteroperableClaims, values: string | readonly string[]): AppointmentInteroperableClaims;