gdc-common-utils-ts 2.0.11 → 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 (91) 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/models/consent-rule.d.ts +2 -2
  7. package/dist/models/consent-rule.js +1 -1
  8. package/dist/utils/actor.d.ts +3 -1
  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/medication-claim-helpers.d.ts +0 -88
  85. package/dist/utils/medication-claim-helpers.js +0 -259
  86. package/dist/utils/normalize-subject-uuid.d.ts +0 -1
  87. package/dist/utils/normalize-subject-uuid.js +0 -24
  88. package/dist/utils/related-person-claim-helpers.d.ts +0 -8
  89. package/dist/utils/related-person-claim-helpers.js +0 -20
  90. package/dist/utils/search-parameter-catalog.d.ts +0 -31
  91. package/dist/utils/search-parameter-catalog.js +0 -81
@@ -1,31 +0,0 @@
1
- /**
2
- * @fileoverview Helpers for shared search-parameter catalogs.
3
- *
4
- * @architecture 101
5
- * - Search catalogs define the public search surface by resource type.
6
- * - These helpers resolve canonical contextualized claim names plus aliases.
7
- * - GW managers can use the same catalog both for indexing and for future
8
- * `CapabilityStatement.searchParam` generation.
9
- */
10
- import type { ClaimsRecord } from '../models/resource-document';
11
- import type { ParameterData, SearchParameterCatalog, SearchParameterDefinition } from '../models/params';
12
- /**
13
- * Resolves the first populated value for a search parameter definition using its
14
- * canonical claim name followed by any configured aliases.
15
- *
16
- * @param claims - Flat claims object.
17
- * @param definition - Search parameter definition.
18
- * @returns First populated scalar value, if any.
19
- */
20
- export declare function resolveSearchParameterValueFromClaims(claims: ClaimsRecord, definition: SearchParameterDefinition): string | undefined;
21
- /**
22
- * Builds index/query-ready `ParameterData` entries from a shared search catalog.
23
- *
24
- * Only catalog entries marked as indexable, and with a populated value in the
25
- * claims object, are returned.
26
- *
27
- * @param claims - Flat claims object.
28
- * @param catalog - Shared search parameter catalog for a resource type.
29
- * @returns Concrete parameter entries with resolved values.
30
- */
31
- export declare function buildIndexParametersFromSearchCatalog<TSearchName extends string>(claims: ClaimsRecord, catalog: SearchParameterCatalog<TSearchName>): ParameterData[];
@@ -1,81 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- /**
3
- * @fileoverview Helpers for shared search-parameter catalogs.
4
- *
5
- * @architecture 101
6
- * - Search catalogs define the public search surface by resource type.
7
- * - These helpers resolve canonical contextualized claim names plus aliases.
8
- * - GW managers can use the same catalog both for indexing and for future
9
- * `CapabilityStatement.searchParam` generation.
10
- */
11
- /**
12
- * Trims a scalar value into a canonical optional string.
13
- *
14
- * @param value - Raw claim value.
15
- * @returns Trimmed text or `undefined` when empty.
16
- */
17
- function normalizeOptionalText(value) {
18
- const normalized = String(value ?? '').trim();
19
- return normalized || undefined;
20
- }
21
- /**
22
- * Resolves a flat claim using exact match first and `@context`-prefixed lookup
23
- * as compatibility fallback for contextualized storage mode.
24
- *
25
- * @param claims - Flat claims object.
26
- * @param claimName - Canonical or alias claim key.
27
- * @returns Scalar value when present.
28
- */
29
- function getContextualizedClaimValue(claims, claimName) {
30
- const directValue = normalizeOptionalText(claims[claimName]);
31
- if (directValue)
32
- return directValue;
33
- const context = normalizeOptionalText(claims['@context']);
34
- if (!context)
35
- return undefined;
36
- const prefixedName = context.endsWith('.') ? `${context}${claimName}` : `${context}.${claimName}`;
37
- return normalizeOptionalText(claims[prefixedName]);
38
- }
39
- /**
40
- * Resolves the first populated value for a search parameter definition using its
41
- * canonical claim name followed by any configured aliases.
42
- *
43
- * @param claims - Flat claims object.
44
- * @param definition - Search parameter definition.
45
- * @returns First populated scalar value, if any.
46
- */
47
- export function resolveSearchParameterValueFromClaims(claims, definition) {
48
- const claimNames = [definition.name, ...(definition.claimAliases || [])];
49
- for (const claimName of claimNames) {
50
- const normalized = getContextualizedClaimValue(claims, claimName);
51
- if (normalized)
52
- return normalized;
53
- }
54
- return undefined;
55
- }
56
- /**
57
- * Builds index/query-ready `ParameterData` entries from a shared search catalog.
58
- *
59
- * Only catalog entries marked as indexable, and with a populated value in the
60
- * claims object, are returned.
61
- *
62
- * @param claims - Flat claims object.
63
- * @param catalog - Shared search parameter catalog for a resource type.
64
- * @returns Concrete parameter entries with resolved values.
65
- */
66
- export function buildIndexParametersFromSearchCatalog(claims, catalog) {
67
- const parameters = [];
68
- for (const definition of Object.values(catalog)) {
69
- if (definition.indexed === false)
70
- continue;
71
- const value = resolveSearchParameterValueFromClaims(claims, definition);
72
- if (!value)
73
- continue;
74
- parameters.push({
75
- ...definition,
76
- name: definition.name,
77
- value,
78
- });
79
- }
80
- return parameters;
81
- }