fhir-data-utils-ts 0.2.4 → 0.3.2
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/.codex/skills/govern-fhir-data-utilities/SKILL.md +58 -0
- package/.codex/skills/govern-fhir-data-utilities/agents/openai.yaml +4 -0
- package/.codex/skills/govern-fhir-observation-components/SKILL.md +18 -0
- package/CHANGELOG.md +39 -0
- package/README.md +47 -0
- package/dist/builders/immunization-graph.d.ts +36 -0
- package/dist/builders/immunization-graph.js +115 -0
- package/dist/builders/immunization-reminders.d.ts +35 -0
- package/dist/builders/immunization-reminders.js +104 -0
- package/dist/builders/index.d.ts +2 -0
- package/dist/builders/index.js +2 -0
- package/dist/claim-helpers/claim-list-helpers.d.ts +21 -0
- package/dist/claim-helpers/claim-list-helpers.js +54 -0
- package/dist/claim-helpers/claims-helpers-allergy-intolerance.d.ts +18 -0
- package/dist/claim-helpers/claims-helpers-allergy-intolerance.js +65 -0
- package/dist/claim-helpers/claims-helpers-appointment-response.d.ts +8 -0
- package/dist/claim-helpers/claims-helpers-appointment-response.js +20 -0
- package/dist/claim-helpers/claims-helpers-appointment.d.ts +10 -0
- package/dist/claim-helpers/claims-helpers-appointment.js +26 -0
- package/dist/claim-helpers/claims-helpers-care-plan.d.ts +8 -0
- package/dist/claim-helpers/claims-helpers-care-plan.js +20 -0
- package/dist/claim-helpers/claims-helpers-clinical-impression.d.ts +10 -0
- package/dist/claim-helpers/claims-helpers-clinical-impression.js +26 -0
- package/dist/claim-helpers/claims-helpers-communication.d.ts +19 -0
- package/dist/claim-helpers/claims-helpers-communication.js +63 -0
- package/dist/claim-helpers/claims-helpers-composition.d.ts +12 -0
- package/dist/claim-helpers/claims-helpers-composition.js +32 -0
- package/dist/claim-helpers/claims-helpers-condition.d.ts +18 -0
- package/dist/claim-helpers/claims-helpers-condition.js +65 -0
- package/dist/claim-helpers/claims-helpers-coverage.d.ts +10 -0
- package/dist/claim-helpers/claims-helpers-coverage.js +26 -0
- package/dist/claim-helpers/claims-helpers-device-use-statement.d.ts +8 -0
- package/dist/claim-helpers/claims-helpers-device-use-statement.js +20 -0
- package/dist/claim-helpers/claims-helpers-device.d.ts +8 -0
- package/dist/claim-helpers/claims-helpers-device.js +20 -0
- package/dist/claim-helpers/claims-helpers-diagnostic-report.d.ts +16 -0
- package/dist/claim-helpers/claims-helpers-diagnostic-report.js +47 -0
- package/dist/claim-helpers/claims-helpers-document-reference.d.ts +8 -0
- package/dist/claim-helpers/claims-helpers-document-reference.js +20 -0
- package/dist/claim-helpers/claims-helpers-encounter.d.ts +10 -0
- package/dist/claim-helpers/claims-helpers-encounter.js +26 -0
- package/dist/claim-helpers/claims-helpers-flag.d.ts +8 -0
- package/dist/claim-helpers/claims-helpers-flag.js +20 -0
- package/dist/claim-helpers/claims-helpers-immunization.d.ts +8 -0
- package/dist/claim-helpers/claims-helpers-immunization.js +20 -0
- package/dist/claim-helpers/claims-helpers-location.d.ts +10 -0
- package/dist/claim-helpers/claims-helpers-location.js +26 -0
- package/dist/claim-helpers/claims-helpers-medication-statement.d.ts +96 -0
- package/dist/claim-helpers/claims-helpers-medication-statement.js +278 -0
- package/dist/claim-helpers/claims-helpers-observation.d.ts +8 -0
- package/dist/claim-helpers/claims-helpers-observation.js +20 -0
- package/dist/claim-helpers/claims-helpers-organization.d.ts +12 -0
- package/dist/claim-helpers/claims-helpers-organization.js +32 -0
- package/dist/claim-helpers/claims-helpers-procedure.d.ts +8 -0
- package/dist/claim-helpers/claims-helpers-procedure.js +20 -0
- package/dist/claim-helpers/claims-helpers-related-person.d.ts +22 -0
- package/dist/claim-helpers/claims-helpers-related-person.js +53 -0
- package/dist/claim-helpers/index.d.ts +23 -0
- package/dist/claim-helpers/index.js +23 -0
- package/dist/claims/allergy-intolerance-claims.d.ts +153 -0
- package/dist/claims/allergy-intolerance-claims.js +194 -0
- package/dist/claims/appointment-claims.d.ts +226 -0
- package/dist/claims/appointment-claims.js +218 -0
- package/dist/claims/appointment-response-claims.d.ts +63 -0
- package/dist/claims/appointment-response-claims.js +58 -0
- package/dist/claims/care-plan-claims.d.ts +37 -0
- package/dist/claims/care-plan-claims.js +59 -0
- package/dist/claims/claim-types.d.ts +9 -0
- package/dist/claims/claim-types.js +3 -0
- package/dist/claims/clinical-impression-claims.d.ts +17 -0
- package/dist/claims/clinical-impression-claims.js +30 -0
- package/dist/claims/communication-claims.d.ts +55 -0
- package/dist/claims/communication-claims.js +57 -0
- package/dist/claims/composition-claims.d.ts +27 -0
- package/dist/claims/composition-claims.js +27 -0
- package/dist/claims/condition-claims.d.ts +79 -0
- package/dist/claims/condition-claims.js +104 -0
- package/dist/claims/consent-claims.d.ts +195 -0
- package/dist/claims/consent-claims.js +74 -0
- package/dist/claims/coverage-claims.d.ts +16 -0
- package/dist/claims/coverage-claims.js +28 -0
- package/dist/claims/device-claims.d.ts +20 -0
- package/dist/claims/device-claims.js +36 -0
- package/dist/claims/device-use-statement-claims.d.ts +17 -0
- package/dist/claims/device-use-statement-claims.js +28 -0
- package/dist/claims/diagnostic-report-claims.d.ts +109 -0
- package/dist/claims/diagnostic-report-claims.js +120 -0
- package/dist/claims/document-reference-claims.d.ts +39 -0
- package/dist/claims/document-reference-claims.js +96 -0
- package/dist/claims/encounter-claims.d.ts +18 -0
- package/dist/claims/encounter-claims.js +32 -0
- package/dist/claims/flag-claims.d.ts +19 -0
- package/dist/claims/flag-claims.js +33 -0
- package/dist/claims/immunization-claims.d.ts +31 -0
- package/dist/claims/immunization-claims.js +54 -0
- package/dist/claims/immunization-recommendation-claims.d.ts +19 -0
- package/dist/claims/immunization-recommendation-claims.js +26 -0
- package/dist/claims/index.d.ts +29 -0
- package/dist/claims/index.js +29 -0
- package/dist/claims/invoice-claims.d.ts +277 -0
- package/dist/claims/invoice-claims.js +357 -0
- package/dist/claims/location-claims.d.ts +22 -0
- package/dist/claims/location-claims.js +34 -0
- package/dist/claims/medication-claims.d.ts +15 -0
- package/dist/claims/medication-claims.js +23 -0
- package/dist/claims/medication-statement-claims.d.ts +539 -0
- package/dist/claims/medication-statement-claims.js +469 -0
- package/dist/claims/organization-claims.d.ts +18 -0
- package/dist/claims/organization-claims.js +27 -0
- package/dist/claims/practitioner-role-claims.d.ts +18 -0
- package/dist/claims/practitioner-role-claims.js +33 -0
- package/dist/claims/procedure-claims.d.ts +24 -0
- package/dist/claims/procedure-claims.js +44 -0
- package/dist/claims/related-person-claims.d.ts +30 -0
- package/dist/claims/related-person-claims.js +44 -0
- package/dist/claims/research-subject-claims.d.ts +4 -0
- package/dist/claims/research-subject-claims.js +4 -0
- package/dist/claims/task-claims.d.ts +61 -0
- package/dist/claims/task-claims.js +64 -0
- package/dist/clinical-terminology.d.ts +73 -0
- package/dist/clinical-terminology.js +77 -0
- package/dist/constants/clinical-statuses.d.ts +102 -0
- package/dist/constants/clinical-statuses.js +93 -0
- package/dist/constants/fhir-code-systems.d.ts +15 -0
- package/dist/constants/fhir-code-systems.js +15 -0
- package/dist/constants/fhir-resource-types.d.ts +162 -0
- package/dist/constants/fhir-resource-types.js +70 -0
- package/dist/constants/fhir-versions.d.ts +10 -0
- package/dist/constants/fhir-versions.js +10 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +4 -0
- package/dist/converters/convert-allergy-intolerance.d.ts +3 -0
- package/dist/converters/convert-allergy-intolerance.js +85 -0
- package/dist/converters/convert-appointment-response.d.ts +3 -0
- package/dist/converters/convert-appointment-response.js +32 -0
- package/dist/converters/convert-appointment.d.ts +3 -0
- package/dist/converters/convert-appointment.js +61 -0
- package/dist/converters/convert-care-plan.d.ts +3 -0
- package/dist/converters/convert-care-plan.js +93 -0
- package/dist/converters/convert-clinical-impression.d.ts +3 -0
- package/dist/converters/convert-clinical-impression.js +42 -0
- package/dist/converters/convert-composition.d.ts +3 -0
- package/dist/converters/convert-composition.js +70 -0
- package/dist/converters/convert-condition.d.ts +3 -0
- package/dist/converters/convert-condition.js +51 -0
- package/dist/converters/convert-consent.d.ts +9 -0
- package/dist/converters/convert-consent.js +174 -0
- package/dist/converters/convert-coverage.d.ts +3 -0
- package/dist/converters/convert-coverage.js +51 -0
- package/dist/converters/convert-device-use-statement.d.ts +3 -0
- package/dist/converters/convert-device-use-statement.js +36 -0
- package/dist/converters/convert-device.d.ts +3 -0
- package/dist/converters/convert-device.js +48 -0
- package/dist/converters/convert-diagnostic-report.d.ts +3 -0
- package/dist/converters/convert-diagnostic-report.js +63 -0
- package/dist/converters/convert-document-reference.d.ts +3 -0
- package/dist/converters/convert-document-reference.js +54 -0
- package/dist/converters/convert-encounter.d.ts +3 -0
- package/dist/converters/convert-encounter.js +68 -0
- package/dist/converters/convert-flag.d.ts +3 -0
- package/dist/converters/convert-flag.js +42 -0
- package/dist/converters/convert-immunization.d.ts +3 -0
- package/dist/converters/convert-immunization.js +80 -0
- package/dist/converters/convert-location.d.ts +3 -0
- package/dist/converters/convert-location.js +44 -0
- package/dist/converters/convert-medication-statement.d.ts +3 -0
- package/dist/converters/convert-medication-statement.js +142 -0
- package/dist/converters/convert-observation.d.ts +33 -0
- package/dist/converters/convert-observation.js +246 -0
- package/dist/converters/convert-organization.d.ts +3 -0
- package/dist/converters/convert-organization.js +39 -0
- package/dist/converters/convert-practitioner-role.d.ts +3 -0
- package/dist/converters/convert-practitioner-role.js +62 -0
- package/dist/converters/convert-procedure.d.ts +3 -0
- package/dist/converters/convert-procedure.js +64 -0
- package/dist/converters/convert-related-person.d.ts +3 -0
- package/dist/converters/convert-related-person.js +31 -0
- package/dist/converters/convert-shared.d.ts +38 -0
- package/dist/converters/convert-shared.js +190 -0
- package/dist/converters/index.d.ts +24 -0
- package/dist/converters/index.js +24 -0
- package/dist/fhir-bundle.d.ts +9 -0
- package/dist/fhir-bundle.js +43 -0
- package/dist/fhir-search-parameters.d.ts +18 -0
- package/dist/fhir-search-parameters.js +52 -0
- package/dist/fhir-tokens.d.ts +11 -0
- package/dist/fhir-tokens.js +26 -0
- package/dist/fhir-types.d.ts +77 -0
- package/dist/fhir-types.js +1 -0
- package/dist/fhir-values.d.ts +13 -0
- package/dist/fhir-values.js +53 -0
- package/dist/group-r5.d.ts +121 -0
- package/dist/group-r5.js +301 -0
- package/dist/imaging-types.d.ts +30 -0
- package/dist/imaging-types.js +1 -0
- package/dist/immunization-flat-claims.d.ts +2 -0
- package/dist/immunization-flat-claims.js +2 -0
- package/dist/immunization-reminder-plan.d.ts +2 -0
- package/dist/immunization-reminder-plan.js +2 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +19 -0
- package/dist/observation-claims.d.ts +170 -0
- package/dist/observation-claims.js +184 -0
- package/dist/related-person.d.ts +16 -0
- package/dist/related-person.js +14 -0
- package/dist/research-study-r5.d.ts +163 -0
- package/dist/research-study-r5.js +490 -0
- package/dist/search-models/index.d.ts +7 -0
- package/dist/search-models/index.js +7 -0
- package/dist/search-models/params/AdverseEvent.params.model.d.ts +14 -0
- package/dist/search-models/params/AdverseEvent.params.model.js +16 -0
- package/dist/search-models/params/AllergyIntolerance.params.model.d.ts +24 -0
- package/dist/search-models/params/AllergyIntolerance.params.model.js +27 -0
- package/dist/search-models/params/Appointment.params.model.d.ts +12 -0
- package/dist/search-models/params/Appointment.params.model.js +14 -0
- package/dist/search-models/params/ClinicalImpression.params.model.d.ts +14 -0
- package/dist/search-models/params/ClinicalImpression.params.model.js +15 -0
- package/dist/search-models/params/Condition.params.model.d.ts +16 -0
- package/dist/search-models/params/Condition.params.model.js +17 -0
- package/dist/search-models/params/DetectedIssue.params.model.d.ts +9 -0
- package/dist/search-models/params/DetectedIssue.params.model.js +11 -0
- package/dist/search-models/params/DiagnosticReport.params.model.d.ts +13 -0
- package/dist/search-models/params/DiagnosticReport.params.model.js +14 -0
- package/dist/search-models/params/Encounter.params.model.d.ts +15 -0
- package/dist/search-models/params/Encounter.params.model.js +17 -0
- package/dist/search-models/params/Immunization.params.model.d.ts +14 -0
- package/dist/search-models/params/Immunization.params.model.js +16 -0
- package/dist/search-models/params/Medication.params.model.d.ts +35 -0
- package/dist/search-models/params/Medication.params.model.js +45 -0
- package/dist/search-models/params/Observation.params.model.d.ts +326 -0
- package/dist/search-models/params/Observation.params.model.js +244 -0
- package/dist/search-models/params/Procedure.params.model.d.ts +15 -0
- package/dist/search-models/params/Procedure.params.model.js +17 -0
- package/dist/search-models/params/Search.params.model.d.ts +75 -0
- package/dist/search-models/params/Search.params.model.js +69 -0
- package/dist/search-models/params/ServiceRequest.params.model.d.ts +14 -0
- package/dist/search-models/params/ServiceRequest.params.model.js +16 -0
- package/dist/search-models/params/Specimen.params.model.d.ts +10 -0
- package/dist/search-models/params/Specimen.params.model.js +12 -0
- package/dist/search-models/params/index.d.ts +15 -0
- package/dist/search-models/params/index.js +15 -0
- package/dist/search-models/templates/AdverseEvent.template.model.d.ts +16 -0
- package/dist/search-models/templates/AdverseEvent.template.model.js +2 -0
- package/dist/search-models/templates/AllergyIntolerance.template.model.d.ts +24 -0
- package/dist/search-models/templates/AllergyIntolerance.template.model.js +1 -0
- package/dist/search-models/templates/Appointment.template.model.d.ts +13 -0
- package/dist/search-models/templates/Appointment.template.model.js +1 -0
- package/dist/search-models/templates/ClinicalImpression.template.model.d.ts +16 -0
- package/dist/search-models/templates/ClinicalImpression.template.model.js +1 -0
- package/dist/search-models/templates/Condition.template.model.d.ts +18 -0
- package/dist/search-models/templates/Condition.template.model.js +1 -0
- package/dist/search-models/templates/DetectedIssue.template.model.d.ts +11 -0
- package/dist/search-models/templates/DetectedIssue.template.model.js +1 -0
- package/dist/search-models/templates/DiagnosticReport.template.model.d.ts +15 -0
- package/dist/search-models/templates/DiagnosticReport.template.model.js +1 -0
- package/dist/search-models/templates/Encounter.template.model.d.ts +17 -0
- package/dist/search-models/templates/Encounter.template.model.js +1 -0
- package/dist/search-models/templates/Immunization.template.model.d.ts +18 -0
- package/dist/search-models/templates/Immunization.template.model.js +2 -0
- package/dist/search-models/templates/Medication.template.model.d.ts +37 -0
- package/dist/search-models/templates/Medication.template.model.js +1 -0
- package/dist/search-models/templates/Observation.template.model.d.ts +18 -0
- package/dist/search-models/templates/Observation.template.model.js +1 -0
- package/dist/search-models/templates/Procedure.template.model.d.ts +17 -0
- package/dist/search-models/templates/Procedure.template.model.js +1 -0
- package/dist/search-models/templates/ServiceRequest.template.model.d.ts +16 -0
- package/dist/search-models/templates/ServiceRequest.template.model.js +1 -0
- package/dist/search-models/templates/Specimen.template.model.d.ts +12 -0
- package/dist/search-models/templates/Specimen.template.model.js +1 -0
- package/dist/search-models/templates/index.d.ts +14 -0
- package/dist/search-models/templates/index.js +14 -0
- package/dist/terminology-models/AtcModel.d.ts +15 -0
- package/dist/terminology-models/AtcModel.js +2 -0
- package/dist/terminology-models/CommonModels.d.ts +70 -0
- package/dist/terminology-models/CommonModels.js +55 -0
- package/dist/terminology-models/FhirModels.d.ts +60 -0
- package/dist/terminology-models/FhirModels.js +34 -0
- package/dist/terminology-models/LoincModels.d.ts +24 -0
- package/dist/terminology-models/LoincModels.js +2 -0
- package/dist/terminology-models/SnomedModels.d.ts +13 -0
- package/dist/terminology-models/SnomedModels.js +2 -0
- package/dist/terminology-models/index.d.ts +6 -0
- package/dist/terminology-models/index.js +6 -0
- package/docs/UHC_FHIR_UTILS_MIGRATION.md +51 -8
- package/package.json +83 -2
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
export declare enum ClaimConsent {
|
|
2
|
+
'decision' = "Consent.decision",
|
|
3
|
+
'status' = "Consent.status",
|
|
4
|
+
'action' = "Consent.action",
|
|
5
|
+
'category' = "Consent.category",
|
|
6
|
+
'categoryText' = "Consent.category-text",
|
|
7
|
+
'categoryDisplay' = "Consent.category-display",
|
|
8
|
+
'resourceType' = "Consent.resource-type",
|
|
9
|
+
'subject' = "Consent.subject",
|
|
10
|
+
'patient' = "Consent.patient",
|
|
11
|
+
'actorIdentifier' = "Consent.actor-identifier",
|
|
12
|
+
'actorRole' = "Consent.actor-role",
|
|
13
|
+
'date' = "Consent.date",
|
|
14
|
+
'periodStart' = "Consent.period-start",
|
|
15
|
+
'periodEnd' = "Consent.period-end",
|
|
16
|
+
'dataPeriodStart' = "Consent.data-period-start",
|
|
17
|
+
'dataPeriodEnd' = "Consent.data-period-end",
|
|
18
|
+
'grantor' = "Consent.grantor",
|
|
19
|
+
'grantee' = "Consent.grantee",
|
|
20
|
+
'manager' = "Consent.manager",
|
|
21
|
+
'controller' = "Consent.controller",
|
|
22
|
+
'verifiedBy' = "Consent.verified-by",
|
|
23
|
+
'verifiedDate' = "Consent.verified-date",
|
|
24
|
+
'purpose' = "Consent.purpose",
|
|
25
|
+
'identifier' = "Consent.identifier",
|
|
26
|
+
'eventBasedOn' = "Consent.event-basedon",
|
|
27
|
+
'sourceReference' = "Consent.source-reference",
|
|
28
|
+
'scope' = "Consent.scope",
|
|
29
|
+
'scopeDisplay' = "Consent.scope-display",
|
|
30
|
+
'policyRule' = "Consent.policy-rule",
|
|
31
|
+
'provisionCode' = "Consent.provision-code",
|
|
32
|
+
'provisionCodeDisplay' = "Consent.provision-code-display",
|
|
33
|
+
'securityLabel' = "Consent.security-label",
|
|
34
|
+
'documentType' = "Consent.document-type",
|
|
35
|
+
'containedReferenceList' = "Consent.contained-reference-list",
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use `containedReferenceList`.
|
|
38
|
+
*/
|
|
39
|
+
'containedResourceList' = "Consent.contained-resource-list",
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Use `containedReferenceList`.
|
|
42
|
+
*/
|
|
43
|
+
'containedDocuments' = "Consent.contained-documents",
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use `containedReferenceList`.
|
|
46
|
+
*/
|
|
47
|
+
'attachmentContentIds' = "Consent.attachment-content-ids",
|
|
48
|
+
'attachmentContentType' = "Consent.attachment-contenttype",
|
|
49
|
+
'attachmentData' = "Consent.attachment-data",
|
|
50
|
+
'attachmentId' = "Consent.attachment-id"
|
|
51
|
+
}
|
|
52
|
+
/** Canonical resource-catalog name used consistently by the package. */
|
|
53
|
+
export declare const ConsentClaim: typeof ClaimConsent;
|
|
54
|
+
export declare const ConsentDecisions: Readonly<{
|
|
55
|
+
readonly Permit: "permit";
|
|
56
|
+
readonly Deny: "deny";
|
|
57
|
+
}>;
|
|
58
|
+
export type ConsentDecision = typeof ConsentDecisions[keyof typeof ConsentDecisions];
|
|
59
|
+
/**
|
|
60
|
+
* Canonical FHIR R5 Consent lifecycle states.
|
|
61
|
+
*
|
|
62
|
+
* `draft` is the only state used for a professional permission request. A
|
|
63
|
+
* draft is carried to the controller for review and must never participate in
|
|
64
|
+
* authorization evaluation. Only `active` consent rules can grant access.
|
|
65
|
+
*/
|
|
66
|
+
export declare const ConsentStatuses: Readonly<{
|
|
67
|
+
readonly Draft: "draft";
|
|
68
|
+
readonly Active: "active";
|
|
69
|
+
readonly Inactive: "inactive";
|
|
70
|
+
readonly NotDone: "not-done";
|
|
71
|
+
readonly EnteredInError: "entered-in-error";
|
|
72
|
+
readonly Unknown: "unknown";
|
|
73
|
+
}>;
|
|
74
|
+
export type ConsentStatus = typeof ConsentStatuses[keyof typeof ConsentStatuses];
|
|
75
|
+
/**
|
|
76
|
+
* Defines the structured, query-optimized format for storing a single, atomic consent rule
|
|
77
|
+
* in the vault (e.g., Firestore, CouchDB).
|
|
78
|
+
*
|
|
79
|
+
* This object is the "Query" model in a CQRS (Command Query Responsibility Segregation) pattern.
|
|
80
|
+
* It is generated by the `ConsentManager` from the "Command" - a set of interoperable claims
|
|
81
|
+
* provided in the `meta.claims` block of an incoming FHIR Consent resource.
|
|
82
|
+
*
|
|
83
|
+
* The backend's authorization engine queries against collections of these objects for high-speed
|
|
84
|
+
* access decisions. The original FHIR Consent resource may be stored separately for auditing.
|
|
85
|
+
*
|
|
86
|
+
* All fields are derived from claims using the reverse-DNS format, e.g., the `decision` field
|
|
87
|
+
* is populated from the `org.hl7.fhir.api.Consent.decision` claim.
|
|
88
|
+
*/
|
|
89
|
+
export interface ConsentRule {
|
|
90
|
+
/**
|
|
91
|
+
* JSON-LD context to define the vocabulary for the rule.
|
|
92
|
+
* Value MUST be "org.hl7.fhir.api".
|
|
93
|
+
*/
|
|
94
|
+
'@context': 'org.hl7.fhir.api';
|
|
95
|
+
/** FHIR Consent lifecycle state; authorization evaluators accept only `active`. */
|
|
96
|
+
'Consent.status'?: ConsentStatus;
|
|
97
|
+
/**
|
|
98
|
+
* The decision of the rule: permit or deny.
|
|
99
|
+
* Derived from the `org.hl7.fhir.api.Consent.decision` claim.
|
|
100
|
+
*/
|
|
101
|
+
'Consent.decision': ConsentDecision;
|
|
102
|
+
/**
|
|
103
|
+
* The data sections this rule applies to, as a comma-separated list of coded values.
|
|
104
|
+
* Derived from the `org.hl7.fhir.api.Consent.action` claim.
|
|
105
|
+
* Example claim: "LOINC|48765-2,SNOMED|12345"
|
|
106
|
+
*/
|
|
107
|
+
'Consent.action': string;
|
|
108
|
+
/**
|
|
109
|
+
* The type of consent document, as a comma-serpareted list of coded values.
|
|
110
|
+
* Used for classifying the consent itself (e.g., for release of information).
|
|
111
|
+
* Derived from the `org.hl7.fhir.api.Consent.category` claim.
|
|
112
|
+
* Example claim: "LOINC|59284-0,LOINC|57016-8"
|
|
113
|
+
*/
|
|
114
|
+
'Consent.category'?: string;
|
|
115
|
+
/**
|
|
116
|
+
* The subject of the consent.
|
|
117
|
+
* Derived from the `org.hl7.fhir.api.Consent.patient.identifier` claim.
|
|
118
|
+
*/
|
|
119
|
+
'Consent.subject': string;
|
|
120
|
+
/**
|
|
121
|
+
* The identifier of the actor (jurisdiction, organization, professional) this rule applies to.
|
|
122
|
+
* This is the party whose access is being controlled.
|
|
123
|
+
* Derived from a claim like `org.hl7.fhir.api.Consent.actor.reference.identifier`.
|
|
124
|
+
* e.g., "urn:iso:3166-2:ES-CT", "did:web:hospital.example.com", "urn:email:dr-smith@example.com"
|
|
125
|
+
*/
|
|
126
|
+
'Consent.actor-identifier': string;
|
|
127
|
+
/**
|
|
128
|
+
* The role of the actor this rule applies to.
|
|
129
|
+
* Derived from a claim like `org.hl7.fhir.api.Consent.actor.role`.
|
|
130
|
+
* e.g., "doctor", "nurse"
|
|
131
|
+
*/
|
|
132
|
+
'Consent.actor-role': string;
|
|
133
|
+
/**
|
|
134
|
+
* The date the consent was granted (ISO 8601 Date).
|
|
135
|
+
* Derived from the `org.hl7.fhir.api.Consent.date` claim.
|
|
136
|
+
*/
|
|
137
|
+
'Consent.date': string;
|
|
138
|
+
/**
|
|
139
|
+
* Start of the consent's validity period (ISO 8601 DateTime).
|
|
140
|
+
* Note: This is different from the date the consent was signed.
|
|
141
|
+
* Derived from the start of the `org.hl7.fhir.api.Consent.period` claim.
|
|
142
|
+
*/
|
|
143
|
+
'Consent.period-start'?: string;
|
|
144
|
+
/**
|
|
145
|
+
* End of the consent's validity period (ISO 8601 DateTime).
|
|
146
|
+
* Derived from the end of the `org.hl7.fhir.api.Consent.period` claim.
|
|
147
|
+
*/
|
|
148
|
+
'Consent.period-end'?: string;
|
|
149
|
+
/** Timeframe of the governed data; distinct from Consent validity. */
|
|
150
|
+
'Consent.data-period-start'?: string;
|
|
151
|
+
'Consent.data-period-end'?: string;
|
|
152
|
+
/** R5 grantor, grantee, workflow manager and enforcement controller references. */
|
|
153
|
+
'Consent.grantor'?: string;
|
|
154
|
+
'Consent.grantee'?: string;
|
|
155
|
+
'Consent.manager'?: string;
|
|
156
|
+
'Consent.controller'?: string;
|
|
157
|
+
/**
|
|
158
|
+
* The party to whom the consent is granted.
|
|
159
|
+
* Use both 'Consent.actor-identifier' and 'Consent.actor-role' instead.
|
|
160
|
+
* Derived from the `org.hl7.fhir.api.Consent.grantee` claim.
|
|
161
|
+
*/
|
|
162
|
+
/**
|
|
163
|
+
* The DID of the entity (person or system) that verified the consent.
|
|
164
|
+
* Derived from the `org.hl7.fhir.api.Consent.verified-by` claim.
|
|
165
|
+
*/
|
|
166
|
+
'Consent.verified-by'?: string;
|
|
167
|
+
/**
|
|
168
|
+
* The date the consent was verified (ISO 8601 DateTime).
|
|
169
|
+
* Derived from the `org.hl7.fhir.api.Consent.verified-date` claim.
|
|
170
|
+
*/
|
|
171
|
+
'Consent.verified-date'?: string;
|
|
172
|
+
/**
|
|
173
|
+
* The purpose of use for this rule.
|
|
174
|
+
* Derived from the `org.hl7.fhir.api.Consent.purpose` claim.
|
|
175
|
+
* e.g., "ETREAT", "CAREMGT"
|
|
176
|
+
*/
|
|
177
|
+
'Consent.purpose': string;
|
|
178
|
+
/**
|
|
179
|
+
* The original Consent resource ID for auditing.
|
|
180
|
+
* Derived from the `org.hl7.fhir.api.Consent.identifier` claim.
|
|
181
|
+
*/
|
|
182
|
+
'Consent.identifier': string;
|
|
183
|
+
/** Governed FHIR resource types and security/content classifications. */
|
|
184
|
+
'Consent.resource-type'?: string;
|
|
185
|
+
'Consent.security-label'?: string;
|
|
186
|
+
'Consent.document-type'?: string;
|
|
187
|
+
'Consent.provision-code'?: string;
|
|
188
|
+
'Consent.contained-reference-list'?: string;
|
|
189
|
+
'Consent.contained-resource-list'?: string;
|
|
190
|
+
'Consent.contained-documents'?: string;
|
|
191
|
+
'Consent.attachment-content-ids'?: string;
|
|
192
|
+
'Consent.attachment-contenttype'?: string;
|
|
193
|
+
'Consent.attachment-data'?: string;
|
|
194
|
+
'Consent.attachment-id'?: string;
|
|
195
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/models/consent-rule.ts
|
|
2
|
+
export var ClaimConsent;
|
|
3
|
+
(function (ClaimConsent) {
|
|
4
|
+
ClaimConsent["decision"] = "Consent.decision";
|
|
5
|
+
ClaimConsent["status"] = "Consent.status";
|
|
6
|
+
ClaimConsent["action"] = "Consent.action";
|
|
7
|
+
ClaimConsent["category"] = "Consent.category";
|
|
8
|
+
ClaimConsent["categoryText"] = "Consent.category-text";
|
|
9
|
+
ClaimConsent["categoryDisplay"] = "Consent.category-display";
|
|
10
|
+
ClaimConsent["resourceType"] = "Consent.resource-type";
|
|
11
|
+
ClaimConsent["subject"] = "Consent.subject";
|
|
12
|
+
ClaimConsent["patient"] = "Consent.patient";
|
|
13
|
+
ClaimConsent["actorIdentifier"] = "Consent.actor-identifier";
|
|
14
|
+
ClaimConsent["actorRole"] = "Consent.actor-role";
|
|
15
|
+
ClaimConsent["date"] = "Consent.date";
|
|
16
|
+
ClaimConsent["periodStart"] = "Consent.period-start";
|
|
17
|
+
ClaimConsent["periodEnd"] = "Consent.period-end";
|
|
18
|
+
ClaimConsent["dataPeriodStart"] = "Consent.data-period-start";
|
|
19
|
+
ClaimConsent["dataPeriodEnd"] = "Consent.data-period-end";
|
|
20
|
+
ClaimConsent["grantor"] = "Consent.grantor";
|
|
21
|
+
ClaimConsent["grantee"] = "Consent.grantee";
|
|
22
|
+
ClaimConsent["manager"] = "Consent.manager";
|
|
23
|
+
ClaimConsent["controller"] = "Consent.controller";
|
|
24
|
+
ClaimConsent["verifiedBy"] = "Consent.verified-by";
|
|
25
|
+
ClaimConsent["verifiedDate"] = "Consent.verified-date";
|
|
26
|
+
ClaimConsent["purpose"] = "Consent.purpose";
|
|
27
|
+
ClaimConsent["identifier"] = "Consent.identifier";
|
|
28
|
+
ClaimConsent["eventBasedOn"] = "Consent.event-basedon";
|
|
29
|
+
ClaimConsent["sourceReference"] = "Consent.source-reference";
|
|
30
|
+
ClaimConsent["scope"] = "Consent.scope";
|
|
31
|
+
ClaimConsent["scopeDisplay"] = "Consent.scope-display";
|
|
32
|
+
ClaimConsent["policyRule"] = "Consent.policy-rule";
|
|
33
|
+
ClaimConsent["provisionCode"] = "Consent.provision-code";
|
|
34
|
+
ClaimConsent["provisionCodeDisplay"] = "Consent.provision-code-display";
|
|
35
|
+
ClaimConsent["securityLabel"] = "Consent.security-label";
|
|
36
|
+
ClaimConsent["documentType"] = "Consent.document-type";
|
|
37
|
+
ClaimConsent["containedReferenceList"] = "Consent.contained-reference-list";
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `containedReferenceList`.
|
|
40
|
+
*/
|
|
41
|
+
ClaimConsent["containedResourceList"] = "Consent.contained-resource-list";
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Use `containedReferenceList`.
|
|
44
|
+
*/
|
|
45
|
+
ClaimConsent["containedDocuments"] = "Consent.contained-documents";
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Use `containedReferenceList`.
|
|
48
|
+
*/
|
|
49
|
+
ClaimConsent["attachmentContentIds"] = "Consent.attachment-content-ids";
|
|
50
|
+
ClaimConsent["attachmentContentType"] = "Consent.attachment-contenttype";
|
|
51
|
+
ClaimConsent["attachmentData"] = "Consent.attachment-data";
|
|
52
|
+
ClaimConsent["attachmentId"] = "Consent.attachment-id";
|
|
53
|
+
})(ClaimConsent || (ClaimConsent = {}));
|
|
54
|
+
/** Canonical resource-catalog name used consistently by the package. */
|
|
55
|
+
export const ConsentClaim = ClaimConsent;
|
|
56
|
+
export const ConsentDecisions = Object.freeze({
|
|
57
|
+
Permit: 'permit',
|
|
58
|
+
Deny: 'deny',
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Canonical FHIR R5 Consent lifecycle states.
|
|
62
|
+
*
|
|
63
|
+
* `draft` is the only state used for a professional permission request. A
|
|
64
|
+
* draft is carried to the controller for review and must never participate in
|
|
65
|
+
* authorization evaluation. Only `active` consent rules can grant access.
|
|
66
|
+
*/
|
|
67
|
+
export const ConsentStatuses = Object.freeze({
|
|
68
|
+
Draft: 'draft',
|
|
69
|
+
Active: 'active',
|
|
70
|
+
Inactive: 'inactive',
|
|
71
|
+
NotDone: 'not-done',
|
|
72
|
+
EnteredInError: 'entered-in-error',
|
|
73
|
+
Unknown: 'unknown',
|
|
74
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ClaimSpec } from './claim-types.js';
|
|
2
|
+
export declare const CoverageClaim: {
|
|
3
|
+
readonly Identifier: "Coverage.identifier";
|
|
4
|
+
readonly Status: "Coverage.status";
|
|
5
|
+
readonly Type: "Coverage.type";
|
|
6
|
+
readonly PolicyHolder: "Coverage.policy-holder";
|
|
7
|
+
readonly Subscriber: "Coverage.subscriber";
|
|
8
|
+
readonly Beneficiary: "Coverage.beneficiary";
|
|
9
|
+
readonly Relationship: "Coverage.relationship";
|
|
10
|
+
readonly PeriodStart: "Coverage.period-start";
|
|
11
|
+
readonly PeriodEnd: "Coverage.period-end";
|
|
12
|
+
readonly Payor: "Coverage.payor";
|
|
13
|
+
readonly Class: "Coverage.class";
|
|
14
|
+
};
|
|
15
|
+
export type CoverageClaimKey = typeof CoverageClaim[keyof typeof CoverageClaim];
|
|
16
|
+
export declare const CoverageClaimSpecs: ClaimSpec[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
+
// File: src/models/interoperable-claims/coverage-claims.ts
|
|
3
|
+
export const CoverageClaim = {
|
|
4
|
+
Identifier: 'Coverage.identifier',
|
|
5
|
+
Status: 'Coverage.status',
|
|
6
|
+
Type: 'Coverage.type',
|
|
7
|
+
PolicyHolder: 'Coverage.policy-holder',
|
|
8
|
+
Subscriber: 'Coverage.subscriber',
|
|
9
|
+
Beneficiary: 'Coverage.beneficiary',
|
|
10
|
+
Relationship: 'Coverage.relationship',
|
|
11
|
+
PeriodStart: 'Coverage.period-start',
|
|
12
|
+
PeriodEnd: 'Coverage.period-end',
|
|
13
|
+
Payor: 'Coverage.payor',
|
|
14
|
+
Class: 'Coverage.class',
|
|
15
|
+
};
|
|
16
|
+
export const CoverageClaimSpecs = [
|
|
17
|
+
{ key: CoverageClaim.Identifier, meaning: 'Business identifier.', example: 'cov-001' },
|
|
18
|
+
{ key: CoverageClaim.Status, meaning: 'Coverage status.', example: 'active' },
|
|
19
|
+
{ key: CoverageClaim.Type, meaning: 'Coverage type token.', example: 'http://terminology.hl7.org/CodeSystem/v3-ActCode|EHCPOL' },
|
|
20
|
+
{ key: CoverageClaim.PolicyHolder, meaning: 'Policy holder reference.', example: 'RelatedPerson/rel-1' },
|
|
21
|
+
{ key: CoverageClaim.Subscriber, meaning: 'Subscriber reference.', example: 'RelatedPerson/rel-1' },
|
|
22
|
+
{ key: CoverageClaim.Beneficiary, meaning: 'Beneficiary reference.', example: 'did:web:patient.example.org' },
|
|
23
|
+
{ key: CoverageClaim.Relationship, meaning: 'Relationship token.', example: 'http://terminology.hl7.org/CodeSystem/subscriber-relationship|self' },
|
|
24
|
+
{ key: CoverageClaim.PeriodStart, meaning: 'Coverage start.', example: '2026-01-01' },
|
|
25
|
+
{ key: CoverageClaim.PeriodEnd, meaning: 'Coverage end.', example: '2026-12-31' },
|
|
26
|
+
{ key: CoverageClaim.Payor, meaning: 'Payor references (CSV).', example: 'Organization/payer-1' },
|
|
27
|
+
{ key: CoverageClaim.Class, meaning: 'Coverage class values (CSV).', example: 'group|G-001,plan|P-001' },
|
|
28
|
+
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ClaimSpec } from './claim-types.js';
|
|
2
|
+
export declare const DeviceClaim: {
|
|
3
|
+
readonly DeviceName: "Device.device-name";
|
|
4
|
+
readonly Identifier: "Device.identifier";
|
|
5
|
+
readonly Location: "Device.location";
|
|
6
|
+
readonly Manufacturer: "Device.manufacturer";
|
|
7
|
+
readonly Model: "Device.model";
|
|
8
|
+
readonly Organization: "Device.organization";
|
|
9
|
+
readonly Patient: "Device.patient";
|
|
10
|
+
readonly SerialNumber: "Device.serial-number";
|
|
11
|
+
readonly Status: "Device.status";
|
|
12
|
+
readonly Type: "Device.type";
|
|
13
|
+
readonly TypeText: "Device.type-text";
|
|
14
|
+
readonly TypeDisplay: "Device.type-display";
|
|
15
|
+
readonly UdiCarrier: "Device.udi-carrier";
|
|
16
|
+
readonly Url: "Device.url";
|
|
17
|
+
readonly Note: "Device.note";
|
|
18
|
+
};
|
|
19
|
+
export type DeviceClaimKey = typeof DeviceClaim[keyof typeof DeviceClaim];
|
|
20
|
+
export declare const DeviceClaimSpecs: ClaimSpec[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
+
// File: src/models/interoperable-claims/device-claims.ts
|
|
3
|
+
export const DeviceClaim = {
|
|
4
|
+
DeviceName: 'Device.device-name',
|
|
5
|
+
Identifier: 'Device.identifier',
|
|
6
|
+
Location: 'Device.location',
|
|
7
|
+
Manufacturer: 'Device.manufacturer',
|
|
8
|
+
Model: 'Device.model',
|
|
9
|
+
Organization: 'Device.organization',
|
|
10
|
+
Patient: 'Device.patient',
|
|
11
|
+
SerialNumber: 'Device.serial-number',
|
|
12
|
+
Status: 'Device.status',
|
|
13
|
+
Type: 'Device.type',
|
|
14
|
+
TypeText: 'Device.type-text',
|
|
15
|
+
TypeDisplay: 'Device.type-display',
|
|
16
|
+
UdiCarrier: 'Device.udi-carrier',
|
|
17
|
+
Url: 'Device.url',
|
|
18
|
+
Note: 'Device.note',
|
|
19
|
+
};
|
|
20
|
+
export const DeviceClaimSpecs = [
|
|
21
|
+
{ key: DeviceClaim.DeviceName, meaning: 'Human-readable device name.', example: 'Insulin pump' },
|
|
22
|
+
{ key: DeviceClaim.Identifier, meaning: 'Business identifier.', example: 'device-001' },
|
|
23
|
+
{ key: DeviceClaim.Location, meaning: 'Location reference.', example: 'Location/loc-1' },
|
|
24
|
+
{ key: DeviceClaim.Manufacturer, meaning: 'Manufacturer name.', example: 'Medtronic' },
|
|
25
|
+
{ key: DeviceClaim.Model, meaning: 'Model number or name.', example: 'MiniMed 780G' },
|
|
26
|
+
{ key: DeviceClaim.Organization, meaning: 'Owning organization reference.', example: 'Organization/org-1' },
|
|
27
|
+
{ key: DeviceClaim.Patient, meaning: 'Patient reference.', example: 'did:web:patient.example.org' },
|
|
28
|
+
{ key: DeviceClaim.SerialNumber, meaning: 'Serial number.', example: 'SN-12345' },
|
|
29
|
+
{ key: DeviceClaim.Status, meaning: 'Device status.', example: 'active' },
|
|
30
|
+
{ key: DeviceClaim.Type, meaning: 'Device type token.', example: 'http://snomed.info/sct|706172005' },
|
|
31
|
+
{ key: DeviceClaim.TypeText, meaning: 'Local-language device type label.', example: 'Bomba de insulina' },
|
|
32
|
+
{ key: DeviceClaim.TypeDisplay, meaning: 'Canonical/international device type display.', example: 'Insulin pump' },
|
|
33
|
+
{ key: DeviceClaim.UdiCarrier, meaning: 'UDI carrier string.', example: '(01)09504000059118(17)220101(10)ABCD1234' },
|
|
34
|
+
{ key: DeviceClaim.Url, meaning: 'Canonical URL.', example: 'https://device.example.org/catalogue/123' },
|
|
35
|
+
{ key: DeviceClaim.Note, meaning: 'Clinical note text.', example: 'Patient-owned continuous glucose monitor.' },
|
|
36
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ClaimSpec } from './claim-types.js';
|
|
2
|
+
export declare const DeviceUseStatementClaim: {
|
|
3
|
+
readonly Identifier: "DeviceUseStatement.identifier";
|
|
4
|
+
readonly Subject: "DeviceUseStatement.subject";
|
|
5
|
+
readonly Status: "DeviceUseStatement.status";
|
|
6
|
+
readonly Device: "DeviceUseStatement.device";
|
|
7
|
+
readonly DeviceDisplay: "DeviceUseStatement.device-display";
|
|
8
|
+
readonly RecordedOn: "DeviceUseStatement.recorded-on";
|
|
9
|
+
/** @deprecated Read-only key from historical persisted rows. */
|
|
10
|
+
readonly RecordedOnLegacy: "DeviceUseStatement.recordedon";
|
|
11
|
+
readonly TimingDateTime: "DeviceUseStatement.timing-datetime";
|
|
12
|
+
readonly TimingAbsentReason: "DeviceUseStatement.timing-absent-reason";
|
|
13
|
+
readonly ReasonCode: "DeviceUseStatement.reason-code";
|
|
14
|
+
readonly Source: "DeviceUseStatement.source";
|
|
15
|
+
};
|
|
16
|
+
export type DeviceUseStatementClaimKey = typeof DeviceUseStatementClaim[keyof typeof DeviceUseStatementClaim];
|
|
17
|
+
export declare const DeviceUseStatementClaimSpecs: ClaimSpec[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
+
// File: src/models/interoperable-claims/device-use-statement-claims.ts
|
|
3
|
+
// Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
|
|
4
|
+
export const DeviceUseStatementClaim = {
|
|
5
|
+
Identifier: 'DeviceUseStatement.identifier',
|
|
6
|
+
Subject: 'DeviceUseStatement.subject',
|
|
7
|
+
Status: 'DeviceUseStatement.status',
|
|
8
|
+
Device: 'DeviceUseStatement.device',
|
|
9
|
+
DeviceDisplay: 'DeviceUseStatement.device-display',
|
|
10
|
+
RecordedOn: 'DeviceUseStatement.recorded-on',
|
|
11
|
+
/** @deprecated Read-only key from historical persisted rows. */
|
|
12
|
+
RecordedOnLegacy: 'DeviceUseStatement.recordedon',
|
|
13
|
+
TimingDateTime: 'DeviceUseStatement.timing-datetime',
|
|
14
|
+
TimingAbsentReason: 'DeviceUseStatement.timing-absent-reason',
|
|
15
|
+
ReasonCode: 'DeviceUseStatement.reason-code',
|
|
16
|
+
Source: 'DeviceUseStatement.source',
|
|
17
|
+
};
|
|
18
|
+
export const DeviceUseStatementClaimSpecs = [
|
|
19
|
+
{ key: DeviceUseStatementClaim.Identifier, meaning: 'Business identifier for device-use record.', example: 'DUS-0001' },
|
|
20
|
+
{ key: DeviceUseStatementClaim.Subject, meaning: 'Patient subject reference.', example: 'Patient/pat-123' },
|
|
21
|
+
{ key: DeviceUseStatementClaim.Status, meaning: 'Use statement status.', example: 'active' },
|
|
22
|
+
{ key: DeviceUseStatementClaim.Device, meaning: 'Device reference.', example: 'Device/dev-777' },
|
|
23
|
+
{ key: DeviceUseStatementClaim.DeviceDisplay, meaning: 'Human-readable device name accompanying the reference.', example: 'Hip prosthesis' },
|
|
24
|
+
{ key: DeviceUseStatementClaim.RecordedOn, meaning: 'Record creation date/time.', example: '2026-03-01T12:00:00Z' },
|
|
25
|
+
{ key: DeviceUseStatementClaim.TimingDateTime, meaning: 'When the use happened.', example: '2026-03-01T08:00:00Z' },
|
|
26
|
+
{ key: DeviceUseStatementClaim.ReasonCode, meaning: 'Reason code for use.', example: 'http://snomed.info/sct|182840001' },
|
|
27
|
+
{ key: DeviceUseStatementClaim.Source, meaning: 'Source actor reference.', example: 'Practitioner/prac-8' },
|
|
28
|
+
];
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { ClaimSpec } from './claim-types.js';
|
|
2
|
+
export declare const DiagnosticReportClaim: {
|
|
3
|
+
readonly BasedOn: "DiagnosticReport.based-on";
|
|
4
|
+
readonly Category: "DiagnosticReport.category";
|
|
5
|
+
readonly Code: "DiagnosticReport.code";
|
|
6
|
+
readonly CodeText: "DiagnosticReport.code-text";
|
|
7
|
+
readonly CodeTextLocal: "DiagnosticReport.code-text";
|
|
8
|
+
readonly CodeDisplay: "DiagnosticReport.code-display";
|
|
9
|
+
readonly Date: "DiagnosticReport.date";
|
|
10
|
+
readonly Encounter: "DiagnosticReport.encounter";
|
|
11
|
+
readonly Identifier: "DiagnosticReport.identifier";
|
|
12
|
+
readonly Media: "DiagnosticReport.media";
|
|
13
|
+
readonly Patient: "DiagnosticReport.patient";
|
|
14
|
+
readonly Performer: "DiagnosticReport.performer";
|
|
15
|
+
readonly Result: "DiagnosticReport.result";
|
|
16
|
+
readonly ResultsInterpreter: "DiagnosticReport.results-interpreter";
|
|
17
|
+
readonly Specimen: "DiagnosticReport.specimen";
|
|
18
|
+
readonly Status: "DiagnosticReport.status";
|
|
19
|
+
readonly Subject: "DiagnosticReport.subject";
|
|
20
|
+
readonly PresentedFormContentType: "DiagnosticReport.presented-form-contenttype";
|
|
21
|
+
readonly PresentedFormData: "DiagnosticReport.presented-form-data";
|
|
22
|
+
readonly PresentedFormUrl: "DiagnosticReport.presented-form-url";
|
|
23
|
+
/**
|
|
24
|
+
* Canonical CSV/list of related contained resource references or identifiers.
|
|
25
|
+
*/
|
|
26
|
+
readonly ContainedReferenceList: "DiagnosticReport.contained-reference-list";
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use `ContainedReferenceList`.
|
|
29
|
+
*/
|
|
30
|
+
readonly ContainedResourceList: "DiagnosticReport.contained-resource-list";
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `ContainedReferenceList`.
|
|
33
|
+
*/
|
|
34
|
+
readonly ContainedDocuments: "DiagnosticReport.contained-documents";
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* TODO(ips-next):
|
|
38
|
+
* Add resource-level claim helpers in `src/utils/claims-helpers-diagnostic-report.ts`
|
|
39
|
+
* following the same contract already used by Consent/Medication/Condition/Allergy:
|
|
40
|
+
* - `getDiagnosticReportClaimList(...)`
|
|
41
|
+
* - `setDiagnosticReportClaimList(...)`
|
|
42
|
+
* - `addDiagnosticReportClaimList(...)`
|
|
43
|
+
* - `removeDiagnosticReportClaimList(...)`
|
|
44
|
+
* - focused helpers for:
|
|
45
|
+
* - `get/set/add/removeDiagnosticReportResultList`
|
|
46
|
+
* - `get/set/add/removeDiagnosticReportPerformerList`
|
|
47
|
+
* - `get/set/add/removeDiagnosticReportSpecimenList`
|
|
48
|
+
* - `get/set/add/removeDiagnosticReportContainedResourceReferences`
|
|
49
|
+
* - `get/setDiagnosticReportPresentedFormContentType`
|
|
50
|
+
* - `get/setDiagnosticReportPresentedFormData`
|
|
51
|
+
* - `get/setDiagnosticReportPresentedFormUrl`
|
|
52
|
+
*
|
|
53
|
+
* Keep naming aligned with canonical FHIR search parameter names
|
|
54
|
+
* (lowercase with `-`) and reuse the existing `SearchParamNames` + contextualized
|
|
55
|
+
* claim-key mapping pattern.
|
|
56
|
+
*
|
|
57
|
+
* This file is intentionally type-first only for now so GW Core and
|
|
58
|
+
* `common-utils` can already exercise the rest of the bundle workflow without
|
|
59
|
+
* committing to the DiagnosticReport editing surface yet.
|
|
60
|
+
*/
|
|
61
|
+
export type DiagnosticReportClaimKey = typeof DiagnosticReportClaim[keyof typeof DiagnosticReportClaim];
|
|
62
|
+
export declare const DiagnosticReportClaimSpecs: ClaimSpec[];
|
|
63
|
+
export declare const DiagnosticReportSearchParamNames: {
|
|
64
|
+
readonly BasedOn: "based-on";
|
|
65
|
+
readonly Category: "category";
|
|
66
|
+
readonly Code: "code";
|
|
67
|
+
readonly Date: "date";
|
|
68
|
+
readonly Encounter: "encounter";
|
|
69
|
+
readonly Identifier: "identifier";
|
|
70
|
+
readonly Media: "media";
|
|
71
|
+
readonly Patient: "patient";
|
|
72
|
+
readonly Performer: "performer";
|
|
73
|
+
readonly Result: "result";
|
|
74
|
+
readonly ResultsInterpreter: "results-interpreter";
|
|
75
|
+
readonly Specimen: "specimen";
|
|
76
|
+
readonly Status: "status";
|
|
77
|
+
readonly Subject: "subject";
|
|
78
|
+
};
|
|
79
|
+
export type DiagnosticReportSearchParamName = typeof DiagnosticReportSearchParamNames[keyof typeof DiagnosticReportSearchParamNames];
|
|
80
|
+
export declare enum DiagnosticReportClaimsFhirApi {
|
|
81
|
+
BasedOn = "org.hl7.fhir.api.DiagnosticReport.based-on",
|
|
82
|
+
Category = "org.hl7.fhir.api.DiagnosticReport.category",
|
|
83
|
+
Code = "org.hl7.fhir.api.DiagnosticReport.code",
|
|
84
|
+
Date = "org.hl7.fhir.api.DiagnosticReport.date",
|
|
85
|
+
Encounter = "org.hl7.fhir.api.DiagnosticReport.encounter",
|
|
86
|
+
Identifier = "org.hl7.fhir.api.DiagnosticReport.identifier",
|
|
87
|
+
Media = "org.hl7.fhir.api.DiagnosticReport.media",
|
|
88
|
+
Patient = "org.hl7.fhir.api.DiagnosticReport.patient",
|
|
89
|
+
Performer = "org.hl7.fhir.api.DiagnosticReport.performer",
|
|
90
|
+
Result = "org.hl7.fhir.api.DiagnosticReport.result",
|
|
91
|
+
ResultsInterpreter = "org.hl7.fhir.api.DiagnosticReport.results-interpreter",
|
|
92
|
+
Specimen = "org.hl7.fhir.api.DiagnosticReport.specimen",
|
|
93
|
+
Status = "org.hl7.fhir.api.DiagnosticReport.status",
|
|
94
|
+
Subject = "org.hl7.fhir.api.DiagnosticReport.subject"
|
|
95
|
+
}
|
|
96
|
+
export declare const DiagnosticReportSearchParamToClaimKey: Record<DiagnosticReportSearchParamName, DiagnosticReportClaimsFhirApi>;
|
|
97
|
+
/**
|
|
98
|
+
* TODO(ips-next):
|
|
99
|
+
* Add `DiagnosticReportClaimsFhirApiExtended` only if/when the bundle editor
|
|
100
|
+
* needs operational flat fields beyond the official search parameter surface.
|
|
101
|
+
*
|
|
102
|
+
* Do not invent camelCase names. Prefer official FHIR search parameter names
|
|
103
|
+
* or explicit attachment aliases such as `presented-form-*` and
|
|
104
|
+
* `contained-reference-list`.
|
|
105
|
+
*
|
|
106
|
+
* Keep `DiagnosticReport` paused at the typing/mapping layer until:
|
|
107
|
+
* 1. `claims-helpers-diagnostic-report.ts` exists
|
|
108
|
+
* 2. GW Core readers/tests consume the same shared claim keys
|
|
109
|
+
*/
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
+
// File: src/models/interoperable-claims/diagnostic-report-claims.ts
|
|
3
|
+
export const DiagnosticReportClaim = {
|
|
4
|
+
BasedOn: 'DiagnosticReport.based-on',
|
|
5
|
+
Category: 'DiagnosticReport.category',
|
|
6
|
+
Code: 'DiagnosticReport.code',
|
|
7
|
+
CodeText: 'DiagnosticReport.code-text',
|
|
8
|
+
CodeTextLocal: 'DiagnosticReport.code-text',
|
|
9
|
+
CodeDisplay: 'DiagnosticReport.code-display',
|
|
10
|
+
Date: 'DiagnosticReport.date',
|
|
11
|
+
Encounter: 'DiagnosticReport.encounter',
|
|
12
|
+
Identifier: 'DiagnosticReport.identifier',
|
|
13
|
+
Media: 'DiagnosticReport.media',
|
|
14
|
+
Patient: 'DiagnosticReport.patient',
|
|
15
|
+
Performer: 'DiagnosticReport.performer',
|
|
16
|
+
Result: 'DiagnosticReport.result',
|
|
17
|
+
ResultsInterpreter: 'DiagnosticReport.results-interpreter',
|
|
18
|
+
Specimen: 'DiagnosticReport.specimen',
|
|
19
|
+
Status: 'DiagnosticReport.status',
|
|
20
|
+
Subject: 'DiagnosticReport.subject',
|
|
21
|
+
PresentedFormContentType: 'DiagnosticReport.presented-form-contenttype',
|
|
22
|
+
PresentedFormData: 'DiagnosticReport.presented-form-data',
|
|
23
|
+
PresentedFormUrl: 'DiagnosticReport.presented-form-url',
|
|
24
|
+
/**
|
|
25
|
+
* Canonical CSV/list of related contained resource references or identifiers.
|
|
26
|
+
*/
|
|
27
|
+
ContainedReferenceList: 'DiagnosticReport.contained-reference-list',
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use `ContainedReferenceList`.
|
|
30
|
+
*/
|
|
31
|
+
ContainedResourceList: 'DiagnosticReport.contained-resource-list',
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `ContainedReferenceList`.
|
|
34
|
+
*/
|
|
35
|
+
ContainedDocuments: 'DiagnosticReport.contained-documents',
|
|
36
|
+
};
|
|
37
|
+
export const DiagnosticReportClaimSpecs = [
|
|
38
|
+
{ key: DiagnosticReportClaim.BasedOn, meaning: 'Request or order that originated the report.', example: 'ServiceRequest/sr-1' },
|
|
39
|
+
{ key: DiagnosticReportClaim.Category, meaning: 'Diagnostic service section/category.', example: 'http://terminology.hl7.org/CodeSystem/v2-0074|LAB' },
|
|
40
|
+
{ key: DiagnosticReportClaim.Code, meaning: 'Main diagnostic report code.', example: 'http://loinc.org|58410-2' },
|
|
41
|
+
{ key: DiagnosticReportClaim.CodeText, meaning: 'Local-language report name matching resource language.', example: 'Hemograma completo' },
|
|
42
|
+
{ key: DiagnosticReportClaim.CodeDisplay, meaning: 'English/international terminology display.', example: 'Complete blood count panel' },
|
|
43
|
+
{ key: DiagnosticReportClaim.Date, meaning: 'Report issuance date/time.', example: '2026-06-12T10:00:00Z' },
|
|
44
|
+
{ key: DiagnosticReportClaim.Encounter, meaning: 'Encounter reference.', example: 'Encounter/enc-1' },
|
|
45
|
+
{ key: DiagnosticReportClaim.Identifier, meaning: 'Business identifier for the report.', example: 'diag-report-001' },
|
|
46
|
+
{ key: DiagnosticReportClaim.Media, meaning: 'Linked media reference list (comma-separeted).', example: 'Media/media-1' },
|
|
47
|
+
{ key: DiagnosticReportClaim.Patient, meaning: 'Patient reference.', example: 'did:web:patient.example.org' },
|
|
48
|
+
{ key: DiagnosticReportClaim.Performer, meaning: 'Performer reference.', example: 'did:web:lab.example.org:system:lisin' },
|
|
49
|
+
{ key: DiagnosticReportClaim.Result, meaning: 'Observation/result reference.', example: 'Observation/obs-1' },
|
|
50
|
+
{ key: DiagnosticReportClaim.ResultsInterpreter, meaning: 'Results interpreter reference.', example: 'Practitioner/prac-1' },
|
|
51
|
+
{ key: DiagnosticReportClaim.Specimen, meaning: 'Specimen reference list (comma-separared).', example: 'Specimen/spec-1' },
|
|
52
|
+
{ key: DiagnosticReportClaim.Status, meaning: 'Diagnostic report status.', example: 'final' },
|
|
53
|
+
{ key: DiagnosticReportClaim.Subject, meaning: 'Canonical subject reference.', example: 'did:web:patient.example.org' },
|
|
54
|
+
{ key: DiagnosticReportClaim.PresentedFormContentType, meaning: 'FHIR presentedForm attachment content type.', example: 'application/pdf' },
|
|
55
|
+
{ key: DiagnosticReportClaim.PresentedFormData, meaning: 'FHIR presentedForm inline base64 payload.', example: 'JVBERi0xLjc...' },
|
|
56
|
+
{ key: DiagnosticReportClaim.PresentedFormUrl, meaning: 'FHIR presentedForm external URL.', example: 'https://example.org/report.pdf' },
|
|
57
|
+
{ key: DiagnosticReportClaim.ContainedDocuments, meaning: 'CSV of linked DocumentReference identifiers stored in the same bundle.', example: 'docref-example-001,docref-example-002' },
|
|
58
|
+
];
|
|
59
|
+
export const DiagnosticReportSearchParamNames = {
|
|
60
|
+
BasedOn: 'based-on',
|
|
61
|
+
Category: 'category',
|
|
62
|
+
Code: 'code',
|
|
63
|
+
Date: 'date',
|
|
64
|
+
Encounter: 'encounter',
|
|
65
|
+
Identifier: 'identifier',
|
|
66
|
+
Media: 'media',
|
|
67
|
+
Patient: 'patient',
|
|
68
|
+
Performer: 'performer',
|
|
69
|
+
Result: 'result',
|
|
70
|
+
ResultsInterpreter: 'results-interpreter',
|
|
71
|
+
Specimen: 'specimen',
|
|
72
|
+
Status: 'status',
|
|
73
|
+
Subject: 'subject',
|
|
74
|
+
};
|
|
75
|
+
export var DiagnosticReportClaimsFhirApi;
|
|
76
|
+
(function (DiagnosticReportClaimsFhirApi) {
|
|
77
|
+
DiagnosticReportClaimsFhirApi["BasedOn"] = "org.hl7.fhir.api.DiagnosticReport.based-on";
|
|
78
|
+
DiagnosticReportClaimsFhirApi["Category"] = "org.hl7.fhir.api.DiagnosticReport.category";
|
|
79
|
+
DiagnosticReportClaimsFhirApi["Code"] = "org.hl7.fhir.api.DiagnosticReport.code";
|
|
80
|
+
DiagnosticReportClaimsFhirApi["Date"] = "org.hl7.fhir.api.DiagnosticReport.date";
|
|
81
|
+
DiagnosticReportClaimsFhirApi["Encounter"] = "org.hl7.fhir.api.DiagnosticReport.encounter";
|
|
82
|
+
DiagnosticReportClaimsFhirApi["Identifier"] = "org.hl7.fhir.api.DiagnosticReport.identifier";
|
|
83
|
+
DiagnosticReportClaimsFhirApi["Media"] = "org.hl7.fhir.api.DiagnosticReport.media";
|
|
84
|
+
DiagnosticReportClaimsFhirApi["Patient"] = "org.hl7.fhir.api.DiagnosticReport.patient";
|
|
85
|
+
DiagnosticReportClaimsFhirApi["Performer"] = "org.hl7.fhir.api.DiagnosticReport.performer";
|
|
86
|
+
DiagnosticReportClaimsFhirApi["Result"] = "org.hl7.fhir.api.DiagnosticReport.result";
|
|
87
|
+
DiagnosticReportClaimsFhirApi["ResultsInterpreter"] = "org.hl7.fhir.api.DiagnosticReport.results-interpreter";
|
|
88
|
+
DiagnosticReportClaimsFhirApi["Specimen"] = "org.hl7.fhir.api.DiagnosticReport.specimen";
|
|
89
|
+
DiagnosticReportClaimsFhirApi["Status"] = "org.hl7.fhir.api.DiagnosticReport.status";
|
|
90
|
+
DiagnosticReportClaimsFhirApi["Subject"] = "org.hl7.fhir.api.DiagnosticReport.subject";
|
|
91
|
+
})(DiagnosticReportClaimsFhirApi || (DiagnosticReportClaimsFhirApi = {}));
|
|
92
|
+
export const DiagnosticReportSearchParamToClaimKey = {
|
|
93
|
+
[DiagnosticReportSearchParamNames.BasedOn]: DiagnosticReportClaimsFhirApi.BasedOn,
|
|
94
|
+
[DiagnosticReportSearchParamNames.Category]: DiagnosticReportClaimsFhirApi.Category,
|
|
95
|
+
[DiagnosticReportSearchParamNames.Code]: DiagnosticReportClaimsFhirApi.Code,
|
|
96
|
+
[DiagnosticReportSearchParamNames.Date]: DiagnosticReportClaimsFhirApi.Date,
|
|
97
|
+
[DiagnosticReportSearchParamNames.Encounter]: DiagnosticReportClaimsFhirApi.Encounter,
|
|
98
|
+
[DiagnosticReportSearchParamNames.Identifier]: DiagnosticReportClaimsFhirApi.Identifier,
|
|
99
|
+
[DiagnosticReportSearchParamNames.Media]: DiagnosticReportClaimsFhirApi.Media,
|
|
100
|
+
[DiagnosticReportSearchParamNames.Patient]: DiagnosticReportClaimsFhirApi.Patient,
|
|
101
|
+
[DiagnosticReportSearchParamNames.Performer]: DiagnosticReportClaimsFhirApi.Performer,
|
|
102
|
+
[DiagnosticReportSearchParamNames.Result]: DiagnosticReportClaimsFhirApi.Result,
|
|
103
|
+
[DiagnosticReportSearchParamNames.ResultsInterpreter]: DiagnosticReportClaimsFhirApi.ResultsInterpreter,
|
|
104
|
+
[DiagnosticReportSearchParamNames.Specimen]: DiagnosticReportClaimsFhirApi.Specimen,
|
|
105
|
+
[DiagnosticReportSearchParamNames.Status]: DiagnosticReportClaimsFhirApi.Status,
|
|
106
|
+
[DiagnosticReportSearchParamNames.Subject]: DiagnosticReportClaimsFhirApi.Subject,
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* TODO(ips-next):
|
|
110
|
+
* Add `DiagnosticReportClaimsFhirApiExtended` only if/when the bundle editor
|
|
111
|
+
* needs operational flat fields beyond the official search parameter surface.
|
|
112
|
+
*
|
|
113
|
+
* Do not invent camelCase names. Prefer official FHIR search parameter names
|
|
114
|
+
* or explicit attachment aliases such as `presented-form-*` and
|
|
115
|
+
* `contained-reference-list`.
|
|
116
|
+
*
|
|
117
|
+
* Keep `DiagnosticReport` paused at the typing/mapping layer until:
|
|
118
|
+
* 1. `claims-helpers-diagnostic-report.ts` exists
|
|
119
|
+
* 2. GW Core readers/tests consume the same shared claim keys
|
|
120
|
+
*/
|