gdc-common-utils-ts 2.0.12 → 2.0.14

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/dist/utils/medication-claim-helpers.d.ts +5 -85
  8. package/dist/utils/medication-claim-helpers.js +5 -255
  9. package/package.json +1 -5
  10. package/dist/examples/communication-bundle-session.d.ts +0 -22
  11. package/dist/examples/communication-bundle-session.js +0 -79
  12. package/dist/interfaces/IWallet.d.ts +0 -55
  13. package/dist/interfaces/IWallet.js +0 -3
  14. package/dist/models/fhir-related-person.d.ts +0 -61
  15. package/dist/models/fhir-related-person.js +0 -108
  16. package/dist/models/related-profile.d.ts +0 -42
  17. package/dist/models/related-profile.js +0 -16
  18. package/dist/utils/allergy-intolerance-claim-helpers.d.ts +0 -10
  19. package/dist/utils/allergy-intolerance-claim-helpers.js +0 -47
  20. package/dist/utils/appointment-claim-helpers.d.ts +0 -10
  21. package/dist/utils/appointment-claim-helpers.js +0 -26
  22. package/dist/utils/appointment-response-claim-helpers.d.ts +0 -8
  23. package/dist/utils/appointment-response-claim-helpers.js +0 -20
  24. package/dist/utils/claim-list-helpers.d.ts +0 -21
  25. package/dist/utils/claim-list-helpers.js +0 -50
  26. package/dist/utils/clinical-impression-claim-helpers.d.ts +0 -10
  27. package/dist/utils/clinical-impression-claim-helpers.js +0 -26
  28. package/dist/utils/communication-bundle-session.d.ts +0 -175
  29. package/dist/utils/communication-bundle-session.js +0 -524
  30. package/dist/utils/composition-claim-helpers.d.ts +0 -12
  31. package/dist/utils/composition-claim-helpers.js +0 -32
  32. package/dist/utils/condition-claim-helpers.d.ts +0 -10
  33. package/dist/utils/condition-claim-helpers.js +0 -47
  34. package/dist/utils/convert-allergy-intolerance.d.ts +0 -3
  35. package/dist/utils/convert-allergy-intolerance.js +0 -34
  36. package/dist/utils/convert-appointment-response.d.ts +0 -3
  37. package/dist/utils/convert-appointment-response.js +0 -32
  38. package/dist/utils/convert-appointment.d.ts +0 -3
  39. package/dist/utils/convert-appointment.js +0 -61
  40. package/dist/utils/convert-care-plan.d.ts +0 -3
  41. package/dist/utils/convert-care-plan.js +0 -58
  42. package/dist/utils/convert-clinical-impression.d.ts +0 -3
  43. package/dist/utils/convert-clinical-impression.js +0 -42
  44. package/dist/utils/convert-composition.d.ts +0 -3
  45. package/dist/utils/convert-composition.js +0 -35
  46. package/dist/utils/convert-condition.d.ts +0 -3
  47. package/dist/utils/convert-condition.js +0 -24
  48. package/dist/utils/convert-coverage.d.ts +0 -3
  49. package/dist/utils/convert-coverage.js +0 -51
  50. package/dist/utils/convert-device-use-statement.d.ts +0 -3
  51. package/dist/utils/convert-device-use-statement.js +0 -28
  52. package/dist/utils/convert-device.d.ts +0 -3
  53. package/dist/utils/convert-device.js +0 -37
  54. package/dist/utils/convert-diagnostic-report.d.ts +0 -3
  55. package/dist/utils/convert-diagnostic-report.js +0 -55
  56. package/dist/utils/convert-document-reference.d.ts +0 -3
  57. package/dist/utils/convert-document-reference.js +0 -35
  58. package/dist/utils/convert-encounter.d.ts +0 -3
  59. package/dist/utils/convert-encounter.js +0 -68
  60. package/dist/utils/convert-flag.d.ts +0 -3
  61. package/dist/utils/convert-flag.js +0 -34
  62. package/dist/utils/convert-immunization.d.ts +0 -3
  63. package/dist/utils/convert-immunization.js +0 -56
  64. package/dist/utils/convert-medication-statement.d.ts +0 -3
  65. package/dist/utils/convert-medication-statement.js +0 -64
  66. package/dist/utils/convert-observation.d.ts +0 -3
  67. package/dist/utils/convert-observation.js +0 -57
  68. package/dist/utils/convert-procedure.d.ts +0 -3
  69. package/dist/utils/convert-procedure.js +0 -50
  70. package/dist/utils/convert-related-person.d.ts +0 -3
  71. package/dist/utils/convert-related-person.js +0 -31
  72. package/dist/utils/convert-shared.d.ts +0 -34
  73. package/dist/utils/convert-shared.js +0 -179
  74. package/dist/utils/coverage-claim-helpers.d.ts +0 -10
  75. package/dist/utils/coverage-claim-helpers.js +0 -26
  76. package/dist/utils/diagnostic-report-claim-helpers.d.ts +0 -12
  77. package/dist/utils/diagnostic-report-claim-helpers.js +0 -32
  78. package/dist/utils/employee-editor.d.ts +0 -24
  79. package/dist/utils/employee-editor.js +0 -41
  80. package/dist/utils/encounter-claim-helpers.d.ts +0 -10
  81. package/dist/utils/encounter-claim-helpers.js +0 -26
  82. package/dist/utils/gateway-index-params.d.ts +0 -44
  83. package/dist/utils/gateway-index-params.js +0 -80
  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
@@ -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;
@@ -1,26 +0,0 @@
1
- import { AppointmentClaim } from '../models/interoperable-claims/appointment-claims.js';
2
- import { addClaimValues, getClaimValues, normalizeClaimScalar, removeClaimValues, setClaimValues, } from './claim-list-helpers.js';
3
- export function getAppointmentClaimList(claims, claimKey) {
4
- return getClaimValues(claims, claimKey);
5
- }
6
- export function setAppointmentClaimList(claims, claimKey, values) {
7
- return setClaimValues(claims, claimKey, values);
8
- }
9
- export function addAppointmentClaimList(claims, claimKey, values) {
10
- return addClaimValues(claims, claimKey, values);
11
- }
12
- export function removeAppointmentClaimList(claims, claimKey, values) {
13
- return removeClaimValues(claims, claimKey, values);
14
- }
15
- export function getAppointmentIdentifier(claims) {
16
- return normalizeClaimScalar(claims[AppointmentClaim.Identifier]);
17
- }
18
- export function setAppointmentIdentifier(claims, value) {
19
- return { ...claims, [AppointmentClaim.Identifier]: normalizeClaimScalar(value) };
20
- }
21
- export function getAppointmentParticipantActorList(claims) {
22
- return getAppointmentClaimList(claims, AppointmentClaim.ParticipantActor);
23
- }
24
- export function setAppointmentParticipantActorList(claims, values) {
25
- return setAppointmentClaimList(claims, AppointmentClaim.ParticipantActor, values);
26
- }
@@ -1,8 +0,0 @@
1
- import { type GenericInteroperableClaims } from './claim-list-helpers.js';
2
- export type AppointmentResponseInteroperableClaims = GenericInteroperableClaims;
3
- export declare function getAppointmentResponseClaimList(claims: AppointmentResponseInteroperableClaims, claimKey: string): string[];
4
- export declare function setAppointmentResponseClaimList(claims: AppointmentResponseInteroperableClaims, claimKey: string, values: string | readonly string[]): AppointmentResponseInteroperableClaims;
5
- export declare function addAppointmentResponseClaimList(claims: AppointmentResponseInteroperableClaims, claimKey: string, values: string | readonly string[]): AppointmentResponseInteroperableClaims;
6
- export declare function removeAppointmentResponseClaimList(claims: AppointmentResponseInteroperableClaims, claimKey: string, values: string | readonly string[]): AppointmentResponseInteroperableClaims;
7
- export declare function getAppointmentResponseIdentifier(claims: AppointmentResponseInteroperableClaims): string;
8
- export declare function setAppointmentResponseIdentifier(claims: AppointmentResponseInteroperableClaims, value: string): AppointmentResponseInteroperableClaims;
@@ -1,20 +0,0 @@
1
- import { AppointmentResponseClaim } from '../models/interoperable-claims/appointment-response-claims.js';
2
- import { addClaimValues, getClaimValues, normalizeClaimScalar, removeClaimValues, setClaimValues, } from './claim-list-helpers.js';
3
- export function getAppointmentResponseClaimList(claims, claimKey) {
4
- return getClaimValues(claims, claimKey);
5
- }
6
- export function setAppointmentResponseClaimList(claims, claimKey, values) {
7
- return setClaimValues(claims, claimKey, values);
8
- }
9
- export function addAppointmentResponseClaimList(claims, claimKey, values) {
10
- return addClaimValues(claims, claimKey, values);
11
- }
12
- export function removeAppointmentResponseClaimList(claims, claimKey, values) {
13
- return removeClaimValues(claims, claimKey, values);
14
- }
15
- export function getAppointmentResponseIdentifier(claims) {
16
- return normalizeClaimScalar(claims[AppointmentResponseClaim.Identifier]);
17
- }
18
- export function setAppointmentResponseIdentifier(claims, value) {
19
- return { ...claims, [AppointmentResponseClaim.Identifier]: normalizeClaimScalar(value) };
20
- }
@@ -1,21 +0,0 @@
1
- export type GenericInteroperableClaims = Record<string, unknown>;
2
- export declare function splitClaimCsv(value: unknown): string[];
3
- export declare function normalizeClaimTokens(values: readonly string[]): string[];
4
- export declare function normalizeClaimInput(values: string | readonly string[]): string[];
5
- export declare function normalizeClaimScalar(value: unknown): string;
6
- /**
7
- * Returns the tokenized values for a claims field stored as CSV.
8
- */
9
- export declare function getClaimValues(claims: GenericInteroperableClaims, claimKey: string): string[];
10
- /**
11
- * Replaces a claims CSV field with the provided values.
12
- */
13
- export declare function setClaimValues(claims: GenericInteroperableClaims, claimKey: string, values: string | readonly string[]): GenericInteroperableClaims;
14
- /**
15
- * Adds one or many values into a claims CSV field while preserving uniqueness.
16
- */
17
- export declare function addClaimValues(claims: GenericInteroperableClaims, claimKey: string, values: string | readonly string[]): GenericInteroperableClaims;
18
- /**
19
- * Removes one or many values from a claims CSV field while preserving uniqueness.
20
- */
21
- export declare function removeClaimValues(claims: GenericInteroperableClaims, claimKey: string, values: string | readonly string[]): GenericInteroperableClaims;
@@ -1,50 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- export function splitClaimCsv(value) {
3
- return String(value || '')
4
- .split(',')
5
- .map((item) => item.trim())
6
- .filter(Boolean);
7
- }
8
- export function normalizeClaimTokens(values) {
9
- return [...new Set(values.map((value) => String(value || '').trim()).filter(Boolean))];
10
- }
11
- export function normalizeClaimInput(values) {
12
- return Array.isArray(values)
13
- ? normalizeClaimTokens(values)
14
- : normalizeClaimTokens(splitClaimCsv(values));
15
- }
16
- export function normalizeClaimScalar(value) {
17
- return String(value || '').trim();
18
- }
19
- /**
20
- * Returns the tokenized values for a claims field stored as CSV.
21
- */
22
- export function getClaimValues(claims, claimKey) {
23
- return normalizeClaimTokens(splitClaimCsv(claims[claimKey]));
24
- }
25
- /**
26
- * Replaces a claims CSV field with the provided values.
27
- */
28
- export function setClaimValues(claims, claimKey, values) {
29
- const nextValues = normalizeClaimInput(values);
30
- return {
31
- ...claims,
32
- [claimKey]: nextValues.join(','),
33
- };
34
- }
35
- /**
36
- * Adds one or many values into a claims CSV field while preserving uniqueness.
37
- */
38
- export function addClaimValues(claims, claimKey, values) {
39
- const current = getClaimValues(claims, claimKey);
40
- const additions = normalizeClaimInput(values);
41
- return setClaimValues(claims, claimKey, [...current, ...additions]);
42
- }
43
- /**
44
- * Removes one or many values from a claims CSV field while preserving uniqueness.
45
- */
46
- export function removeClaimValues(claims, claimKey, values) {
47
- const removals = new Set(normalizeClaimInput(values));
48
- const nextValues = getClaimValues(claims, claimKey).filter((value) => !removals.has(value));
49
- return setClaimValues(claims, claimKey, nextValues);
50
- }
@@ -1,10 +0,0 @@
1
- import { type GenericInteroperableClaims } from './claim-list-helpers.js';
2
- export type ClinicalImpressionInteroperableClaims = GenericInteroperableClaims;
3
- export declare function getClinicalImpressionClaimList(claims: ClinicalImpressionInteroperableClaims, claimKey: string): string[];
4
- export declare function setClinicalImpressionClaimList(claims: ClinicalImpressionInteroperableClaims, claimKey: string, values: string | readonly string[]): ClinicalImpressionInteroperableClaims;
5
- export declare function addClinicalImpressionClaimList(claims: ClinicalImpressionInteroperableClaims, claimKey: string, values: string | readonly string[]): ClinicalImpressionInteroperableClaims;
6
- export declare function removeClinicalImpressionClaimList(claims: ClinicalImpressionInteroperableClaims, claimKey: string, values: string | readonly string[]): ClinicalImpressionInteroperableClaims;
7
- export declare function getClinicalImpressionIdentifier(claims: ClinicalImpressionInteroperableClaims): string;
8
- export declare function setClinicalImpressionIdentifier(claims: ClinicalImpressionInteroperableClaims, value: string): ClinicalImpressionInteroperableClaims;
9
- export declare function getClinicalImpressionProblemList(claims: ClinicalImpressionInteroperableClaims): string[];
10
- export declare function setClinicalImpressionProblemList(claims: ClinicalImpressionInteroperableClaims, values: string | readonly string[]): ClinicalImpressionInteroperableClaims;
@@ -1,26 +0,0 @@
1
- import { ClinicalImpressionClaim } from '../models/interoperable-claims/clinical-impression-claims.js';
2
- import { addClaimValues, getClaimValues, normalizeClaimScalar, removeClaimValues, setClaimValues, } from './claim-list-helpers.js';
3
- export function getClinicalImpressionClaimList(claims, claimKey) {
4
- return getClaimValues(claims, claimKey);
5
- }
6
- export function setClinicalImpressionClaimList(claims, claimKey, values) {
7
- return setClaimValues(claims, claimKey, values);
8
- }
9
- export function addClinicalImpressionClaimList(claims, claimKey, values) {
10
- return addClaimValues(claims, claimKey, values);
11
- }
12
- export function removeClinicalImpressionClaimList(claims, claimKey, values) {
13
- return removeClaimValues(claims, claimKey, values);
14
- }
15
- export function getClinicalImpressionIdentifier(claims) {
16
- return normalizeClaimScalar(claims[ClinicalImpressionClaim.Identifier]);
17
- }
18
- export function setClinicalImpressionIdentifier(claims, value) {
19
- return { ...claims, [ClinicalImpressionClaim.Identifier]: normalizeClaimScalar(value) };
20
- }
21
- export function getClinicalImpressionProblemList(claims) {
22
- return getClinicalImpressionClaimList(claims, ClinicalImpressionClaim.Problem);
23
- }
24
- export function setClinicalImpressionProblemList(claims, values) {
25
- return setClinicalImpressionClaimList(claims, ClinicalImpressionClaim.Problem, values);
26
- }