@imranq2/fhirpatientsummary 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +81 -0
- package/lib/src/generators/fhir_summary_generator.d.ts +46 -0
- package/lib/src/generators/fhir_summary_generator.js +228 -0
- package/lib/src/generators/narrative_generator.d.ts +40 -0
- package/lib/src/generators/narrative_generator.js +80 -0
- package/lib/src/narratives/templates/typescript/AdvanceDirectivesTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/AdvanceDirectivesTemplate.js +70 -0
- package/lib/src/narratives/templates/typescript/AllergyIntoleranceTemplate.d.ts +31 -0
- package/lib/src/narratives/templates/typescript/AllergyIntoleranceTemplate.js +155 -0
- package/lib/src/narratives/templates/typescript/ClinicalImpressionTemplate.d.ts +15 -0
- package/lib/src/narratives/templates/typescript/ClinicalImpressionTemplate.js +111 -0
- package/lib/src/narratives/templates/typescript/DiagnosticResultsTemplate.d.ts +50 -0
- package/lib/src/narratives/templates/typescript/DiagnosticResultsTemplate.js +153 -0
- package/lib/src/narratives/templates/typescript/FamilyHistoryTemplate.d.ts +15 -0
- package/lib/src/narratives/templates/typescript/FamilyHistoryTemplate.js +103 -0
- package/lib/src/narratives/templates/typescript/FunctionalStatusTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/FunctionalStatusTemplate.js +70 -0
- package/lib/src/narratives/templates/typescript/HistoryOfProceduresTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/HistoryOfProceduresTemplate.js +66 -0
- package/lib/src/narratives/templates/typescript/ImmunizationsTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/ImmunizationsTemplate.js +73 -0
- package/lib/src/narratives/templates/typescript/MedicalDevicesTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/MedicalDevicesTemplate.js +67 -0
- package/lib/src/narratives/templates/typescript/MedicationSummaryTemplate.d.ts +50 -0
- package/lib/src/narratives/templates/typescript/MedicationSummaryTemplate.js +206 -0
- package/lib/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.d.ts +15 -0
- package/lib/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.js +59 -0
- package/lib/src/narratives/templates/typescript/PatientTemplate.d.ts +65 -0
- package/lib/src/narratives/templates/typescript/PatientTemplate.js +158 -0
- package/lib/src/narratives/templates/typescript/PlanOfCareTemplate.d.ts +15 -0
- package/lib/src/narratives/templates/typescript/PlanOfCareTemplate.js +63 -0
- package/lib/src/narratives/templates/typescript/PregnancyTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/PregnancyTemplate.js +68 -0
- package/lib/src/narratives/templates/typescript/ProblemListTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/ProblemListTemplate.js +119 -0
- package/lib/src/narratives/templates/typescript/SocialHistoryTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/SocialHistoryTemplate.js +70 -0
- package/lib/src/narratives/templates/typescript/TemplateUtilities.d.ts +251 -0
- package/lib/src/narratives/templates/typescript/TemplateUtilities.js +696 -0
- package/lib/src/narratives/templates/typescript/TypeScriptTemplateMapper.d.ts +17 -0
- package/lib/src/narratives/templates/typescript/TypeScriptTemplateMapper.js +64 -0
- package/lib/src/narratives/templates/typescript/VitalSignsTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/VitalSignsTemplate.js +74 -0
- package/lib/src/narratives/templates/typescript/interfaces/ITemplate.d.ts +13 -0
- package/lib/src/narratives/templates/typescript/interfaces/ITemplate.js +2 -0
- package/lib/src/profiles/ips_resource_profile_registry.d.ts +7 -0
- package/lib/src/profiles/ips_resource_profile_registry.js +143 -0
- package/lib/src/structures/ips_mandatory_sections.d.ts +7 -0
- package/lib/src/structures/ips_mandatory_sections.js +11 -0
- package/lib/src/structures/ips_recommended_sections.d.ts +8 -0
- package/lib/src/structures/ips_recommended_sections.js +12 -0
- package/lib/src/structures/ips_resource_profile.d.ts +7 -0
- package/lib/src/structures/ips_resource_profile.js +2 -0
- package/lib/src/structures/ips_section_loinc_codes.d.ts +4 -0
- package/lib/src/structures/ips_section_loinc_codes.js +48 -0
- package/lib/src/structures/ips_section_resource_map.d.ts +8 -0
- package/lib/src/structures/ips_section_resource_map.js +69 -0
- package/lib/src/structures/ips_sections.d.ts +19 -0
- package/lib/src/structures/ips_sections.js +27 -0
- package/lib/src/types/partials/Address.d.ts +16 -0
- package/lib/src/types/partials/Address.js +3 -0
- package/lib/src/types/partials/AllergyIntoleranceReaction.d.ts +16 -0
- package/lib/src/types/partials/AllergyIntoleranceReaction.js +3 -0
- package/lib/src/types/partials/Annotation.d.ts +12 -0
- package/lib/src/types/partials/Annotation.js +3 -0
- package/lib/src/types/partials/Attachment.d.ts +17 -0
- package/lib/src/types/partials/Attachment.js +3 -0
- package/lib/src/types/partials/BundleEntry.d.ts +18 -0
- package/lib/src/types/partials/BundleEntry.js +3 -0
- package/lib/src/types/partials/BundleLink.d.ts +9 -0
- package/lib/src/types/partials/BundleLink.js +3 -0
- package/lib/src/types/partials/BundleRequest.d.ts +14 -0
- package/lib/src/types/partials/BundleRequest.js +3 -0
- package/lib/src/types/partials/BundleResponse.d.ts +14 -0
- package/lib/src/types/partials/BundleResponse.js +3 -0
- package/lib/src/types/partials/BundleSearch.d.ts +9 -0
- package/lib/src/types/partials/BundleSearch.js +3 -0
- package/lib/src/types/partials/CarePlanActivity.d.ts +15 -0
- package/lib/src/types/partials/CarePlanActivity.js +3 -0
- package/lib/src/types/partials/CarePlanDetail.d.ts +33 -0
- package/lib/src/types/partials/CarePlanDetail.js +3 -0
- package/lib/src/types/partials/ClinicalImpressionFinding.d.ts +11 -0
- package/lib/src/types/partials/ClinicalImpressionFinding.js +3 -0
- package/lib/src/types/partials/ClinicalImpressionInvestigation.d.ts +10 -0
- package/lib/src/types/partials/ClinicalImpressionInvestigation.js +3 -0
- package/lib/src/types/partials/CodeableConcept.d.ts +8 -0
- package/lib/src/types/partials/CodeableConcept.js +3 -0
- package/lib/src/types/partials/CodeableReference.d.ts +9 -0
- package/lib/src/types/partials/CodeableReference.js +3 -0
- package/lib/src/types/partials/Coding.d.ts +11 -0
- package/lib/src/types/partials/Coding.js +3 -0
- package/lib/src/types/partials/CompositionAttester.d.ts +11 -0
- package/lib/src/types/partials/CompositionAttester.js +3 -0
- package/lib/src/types/partials/CompositionEvent.d.ts +12 -0
- package/lib/src/types/partials/CompositionEvent.js +3 -0
- package/lib/src/types/partials/CompositionRelatesTo.d.ts +11 -0
- package/lib/src/types/partials/CompositionRelatesTo.js +3 -0
- package/lib/src/types/partials/CompositionSection.d.ts +19 -0
- package/lib/src/types/partials/CompositionSection.js +3 -0
- package/lib/src/types/partials/ConditionEvidence.d.ts +10 -0
- package/lib/src/types/partials/ConditionEvidence.js +3 -0
- package/lib/src/types/partials/ConditionStage.d.ts +11 -0
- package/lib/src/types/partials/ConditionStage.js +3 -0
- package/lib/src/types/partials/ConsentActor.d.ts +10 -0
- package/lib/src/types/partials/ConsentActor.js +3 -0
- package/lib/src/types/partials/ConsentData.d.ts +9 -0
- package/lib/src/types/partials/ConsentData.js +3 -0
- package/lib/src/types/partials/ConsentPolicy.d.ts +9 -0
- package/lib/src/types/partials/ConsentPolicy.js +3 -0
- package/lib/src/types/partials/ConsentProvision.d.ts +22 -0
- package/lib/src/types/partials/ConsentProvision.js +3 -0
- package/lib/src/types/partials/ConsentVerification.d.ts +11 -0
- package/lib/src/types/partials/ConsentVerification.js +3 -0
- package/lib/src/types/partials/ContactDetail.d.ts +8 -0
- package/lib/src/types/partials/ContactDetail.js +3 -0
- package/lib/src/types/partials/ContactPoint.d.ts +12 -0
- package/lib/src/types/partials/ContactPoint.js +3 -0
- package/lib/src/types/partials/Contributor.d.ts +9 -0
- package/lib/src/types/partials/Contributor.js +3 -0
- package/lib/src/types/partials/DataRequirement.d.ts +21 -0
- package/lib/src/types/partials/DataRequirement.js +3 -0
- package/lib/src/types/partials/DataRequirementCodeFilter.d.ts +11 -0
- package/lib/src/types/partials/DataRequirementCodeFilter.js +3 -0
- package/lib/src/types/partials/DataRequirementDateFilter.d.ts +13 -0
- package/lib/src/types/partials/DataRequirementDateFilter.js +3 -0
- package/lib/src/types/partials/DataRequirementSort.d.ts +7 -0
- package/lib/src/types/partials/DataRequirementSort.js +3 -0
- package/lib/src/types/partials/DeviceDeviceName.d.ts +8 -0
- package/lib/src/types/partials/DeviceDeviceName.js +3 -0
- package/lib/src/types/partials/DeviceProperty.d.ts +11 -0
- package/lib/src/types/partials/DeviceProperty.js +3 -0
- package/lib/src/types/partials/DeviceSpecialization.d.ts +9 -0
- package/lib/src/types/partials/DeviceSpecialization.js +3 -0
- package/lib/src/types/partials/DeviceUdiCarrier.d.ts +14 -0
- package/lib/src/types/partials/DeviceUdiCarrier.js +3 -0
- package/lib/src/types/partials/DeviceVersion.d.ts +11 -0
- package/lib/src/types/partials/DeviceVersion.js +3 -0
- package/lib/src/types/partials/DiagnosticReportMedia.d.ts +9 -0
- package/lib/src/types/partials/DiagnosticReportMedia.js +3 -0
- package/lib/src/types/partials/Dosage.d.ts +26 -0
- package/lib/src/types/partials/Dosage.js +3 -0
- package/lib/src/types/partials/DosageDoseAndRate.d.ts +16 -0
- package/lib/src/types/partials/DosageDoseAndRate.js +3 -0
- package/lib/src/types/partials/Expression.d.ts +12 -0
- package/lib/src/types/partials/Expression.js +3 -0
- package/lib/src/types/partials/Extension.d.ts +99 -0
- package/lib/src/types/partials/Extension.js +3 -0
- package/lib/src/types/partials/FamilyMemberHistoryCondition.d.ts +19 -0
- package/lib/src/types/partials/FamilyMemberHistoryCondition.js +3 -0
- package/lib/src/types/partials/HumanName.d.ts +13 -0
- package/lib/src/types/partials/HumanName.js +3 -0
- package/lib/src/types/partials/Identifier.d.ts +15 -0
- package/lib/src/types/partials/Identifier.js +3 -0
- package/lib/src/types/partials/ImmunizationEducation.d.ts +12 -0
- package/lib/src/types/partials/ImmunizationEducation.js +3 -0
- package/lib/src/types/partials/ImmunizationPerformer.d.ts +10 -0
- package/lib/src/types/partials/ImmunizationPerformer.js +3 -0
- package/lib/src/types/partials/ImmunizationProtocolApplied.d.ts +16 -0
- package/lib/src/types/partials/ImmunizationProtocolApplied.js +3 -0
- package/lib/src/types/partials/ImmunizationReaction.d.ts +11 -0
- package/lib/src/types/partials/ImmunizationReaction.js +3 -0
- package/lib/src/types/partials/MedicationBatch.d.ts +9 -0
- package/lib/src/types/partials/MedicationBatch.js +3 -0
- package/lib/src/types/partials/MedicationIngredient.d.ts +13 -0
- package/lib/src/types/partials/MedicationIngredient.js +3 -0
- package/lib/src/types/partials/MedicationRequestDispenseRequest.d.ts +18 -0
- package/lib/src/types/partials/MedicationRequestDispenseRequest.js +3 -0
- package/lib/src/types/partials/MedicationRequestInitialFill.d.ts +9 -0
- package/lib/src/types/partials/MedicationRequestInitialFill.js +3 -0
- package/lib/src/types/partials/MedicationRequestSubstitution.d.ts +10 -0
- package/lib/src/types/partials/MedicationRequestSubstitution.js +3 -0
- package/lib/src/types/partials/Meta.d.ts +16 -0
- package/lib/src/types/partials/Meta.js +3 -0
- package/lib/src/types/partials/Money.d.ts +8 -0
- package/lib/src/types/partials/Money.js +3 -0
- package/lib/src/types/partials/Narrative.d.ts +8 -0
- package/lib/src/types/partials/Narrative.js +3 -0
- package/lib/src/types/partials/ObservationComponent.d.ts +31 -0
- package/lib/src/types/partials/ObservationComponent.js +3 -0
- package/lib/src/types/partials/ObservationReferenceRange.d.ts +15 -0
- package/lib/src/types/partials/ObservationReferenceRange.js +3 -0
- package/lib/src/types/partials/OrganizationContact.d.ts +14 -0
- package/lib/src/types/partials/OrganizationContact.js +3 -0
- package/lib/src/types/partials/ParameterDefinition.d.ts +14 -0
- package/lib/src/types/partials/ParameterDefinition.js +3 -0
- package/lib/src/types/partials/PatientCommunication.d.ts +9 -0
- package/lib/src/types/partials/PatientCommunication.js +3 -0
- package/lib/src/types/partials/PatientContact.d.ts +19 -0
- package/lib/src/types/partials/PatientContact.js +3 -0
- package/lib/src/types/partials/PatientLink.d.ts +9 -0
- package/lib/src/types/partials/PatientLink.js +3 -0
- package/lib/src/types/partials/Period.d.ts +8 -0
- package/lib/src/types/partials/Period.js +3 -0
- package/lib/src/types/partials/ProcedureFocalDevice.d.ts +10 -0
- package/lib/src/types/partials/ProcedureFocalDevice.js +3 -0
- package/lib/src/types/partials/ProcedurePerformer.d.ts +11 -0
- package/lib/src/types/partials/ProcedurePerformer.js +3 -0
- package/lib/src/types/partials/Quantity.d.ts +12 -0
- package/lib/src/types/partials/Quantity.js +3 -0
- package/lib/src/types/partials/Range.d.ts +8 -0
- package/lib/src/types/partials/Range.js +3 -0
- package/lib/src/types/partials/Ratio.d.ts +8 -0
- package/lib/src/types/partials/Ratio.js +3 -0
- package/lib/src/types/partials/RatioRange.d.ts +9 -0
- package/lib/src/types/partials/RatioRange.js +3 -0
- package/lib/src/types/partials/Reference.d.ts +14 -0
- package/lib/src/types/partials/Reference.js +3 -0
- package/lib/src/types/partials/RelatedArtifact.d.ts +16 -0
- package/lib/src/types/partials/RelatedArtifact.js +3 -0
- package/lib/src/types/partials/SampledData.d.ts +15 -0
- package/lib/src/types/partials/SampledData.js +3 -0
- package/lib/src/types/partials/Signature.d.ts +16 -0
- package/lib/src/types/partials/Signature.js +3 -0
- package/lib/src/types/partials/Timing.d.ts +12 -0
- package/lib/src/types/partials/Timing.js +3 -0
- package/lib/src/types/partials/TimingRepeat.d.ts +30 -0
- package/lib/src/types/partials/TimingRepeat.js +3 -0
- package/lib/src/types/partials/TriggerDefinition.d.ts +19 -0
- package/lib/src/types/partials/TriggerDefinition.js +3 -0
- package/lib/src/types/partials/UsageContext.d.ts +15 -0
- package/lib/src/types/partials/UsageContext.js +3 -0
- package/lib/src/types/resources/AllergyIntolerance.d.ts +45 -0
- package/lib/src/types/resources/AllergyIntolerance.js +3 -0
- package/lib/src/types/resources/Bundle.d.ts +22 -0
- package/lib/src/types/resources/Bundle.js +3 -0
- package/lib/src/types/resources/CarePlan.d.ts +47 -0
- package/lib/src/types/resources/CarePlan.js +3 -0
- package/lib/src/types/resources/ClinicalImpression.d.ts +45 -0
- package/lib/src/types/resources/ClinicalImpression.js +3 -0
- package/lib/src/types/resources/Composition.d.ts +39 -0
- package/lib/src/types/resources/Composition.js +3 -0
- package/lib/src/types/resources/Condition.d.ts +51 -0
- package/lib/src/types/resources/Condition.js +3 -0
- package/lib/src/types/resources/Consent.d.ts +38 -0
- package/lib/src/types/resources/Consent.js +3 -0
- package/lib/src/types/resources/Device.d.ts +53 -0
- package/lib/src/types/resources/Device.js +3 -0
- package/lib/src/types/resources/DeviceUseStatement.d.ts +38 -0
- package/lib/src/types/resources/DeviceUseStatement.js +3 -0
- package/lib/src/types/resources/DiagnosticReport.d.ts +43 -0
- package/lib/src/types/resources/DiagnosticReport.js +3 -0
- package/lib/src/types/resources/DomainResource.d.ts +16 -0
- package/lib/src/types/resources/DomainResource.js +3 -0
- package/lib/src/types/resources/FamilyMemberHistory.d.ts +53 -0
- package/lib/src/types/resources/FamilyMemberHistory.js +3 -0
- package/lib/src/types/resources/Immunization.d.ts +56 -0
- package/lib/src/types/resources/Immunization.js +3 -0
- package/lib/src/types/resources/Medication.d.ts +30 -0
- package/lib/src/types/resources/Medication.js +3 -0
- package/lib/src/types/resources/MedicationRequest.d.ts +59 -0
- package/lib/src/types/resources/MedicationRequest.js +3 -0
- package/lib/src/types/resources/MedicationStatement.d.ts +42 -0
- package/lib/src/types/resources/MedicationStatement.js +3 -0
- package/lib/src/types/resources/Observation.d.ts +69 -0
- package/lib/src/types/resources/Observation.js +3 -0
- package/lib/src/types/resources/Organization.d.ts +32 -0
- package/lib/src/types/resources/Organization.js +3 -0
- package/lib/src/types/resources/Patient.d.ts +47 -0
- package/lib/src/types/resources/Patient.js +3 -0
- package/lib/src/types/resources/Procedure.d.ts +59 -0
- package/lib/src/types/resources/Procedure.js +3 -0
- package/lib/src/types/simpleTypes/Base64Binary.d.ts +1 -0
- package/lib/src/types/simpleTypes/Base64Binary.js +2 -0
- package/lib/src/types/simpleTypes/Canonical.d.ts +1 -0
- package/lib/src/types/simpleTypes/Canonical.js +2 -0
- package/lib/src/types/simpleTypes/Date.d.ts +1 -0
- package/lib/src/types/simpleTypes/Date.js +2 -0
- package/lib/src/types/simpleTypes/DateTime.d.ts +1 -0
- package/lib/src/types/simpleTypes/DateTime.js +2 -0
- package/lib/src/types/simpleTypes/Decimal.d.ts +1 -0
- package/lib/src/types/simpleTypes/Decimal.js +2 -0
- package/lib/src/types/simpleTypes/Id.d.ts +1 -0
- package/lib/src/types/simpleTypes/Id.js +2 -0
- package/lib/src/types/simpleTypes/Instant.d.ts +1 -0
- package/lib/src/types/simpleTypes/Instant.js +2 -0
- package/lib/src/types/simpleTypes/Int.d.ts +1 -0
- package/lib/src/types/simpleTypes/Int.js +2 -0
- package/lib/src/types/simpleTypes/Markdown.d.ts +1 -0
- package/lib/src/types/simpleTypes/Markdown.js +2 -0
- package/lib/src/types/simpleTypes/Oid.d.ts +1 -0
- package/lib/src/types/simpleTypes/Oid.js +2 -0
- package/lib/src/types/simpleTypes/ResourceContainer.d.ts +1 -0
- package/lib/src/types/simpleTypes/ResourceContainer.js +2 -0
- package/lib/src/types/simpleTypes/Time.d.ts +1 -0
- package/lib/src/types/simpleTypes/Time.js +2 -0
- package/lib/src/types/simpleTypes/UnsignedInt.d.ts +1 -0
- package/lib/src/types/simpleTypes/UnsignedInt.js +2 -0
- package/lib/src/types/simpleTypes/Uri.d.ts +1 -0
- package/lib/src/types/simpleTypes/Uri.js +2 -0
- package/lib/src/types/simpleTypes/Url.d.ts +1 -0
- package/lib/src/types/simpleTypes/Url.js +2 -0
- package/lib/src/types/simpleTypes/Uuid.d.ts +1 -0
- package/lib/src/types/simpleTypes/Uuid.js +2 -0
- package/lib/src/types/simpleTypes/Xhtml.d.ts +1 -0
- package/lib/src/types/simpleTypes/Xhtml.js +2 -0
- package/lib/test/fhir-summary-bundle/fhir-summary-bundle.test.d.ts +1 -0
- package/lib/test/fhir-summary-bundle/fhir-summary-bundle.test.js +72 -0
- package/lib/test/ips-test/ips.test.d.ts +1 -0
- package/lib/test/ips-test/ips.test.js +389 -0
- package/lib/test/narrativeGenerator/narrativeGenerator.test.d.ts +1 -0
- package/lib/test/narrativeGenerator/narrativeGenerator.test.js +676 -0
- package/lib/test/summary.test.d.ts +1 -0
- package/lib/test/summary.test.js +452 -0
- package/lib/test/utilities/testHelpers.d.ts +21 -0
- package/lib/test/utilities/testHelpers.js +137 -0
- package/package.json +126 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IPSSections } from '../../../structures/ips_sections';
|
|
2
|
+
import { TBundle } from '../../../types/resources/Bundle';
|
|
3
|
+
/**
|
|
4
|
+
* Maps IPS sections to their corresponding TypeScript template classes
|
|
5
|
+
* Replaces the Jinja2 template mapping system
|
|
6
|
+
*/
|
|
7
|
+
export declare class TypeScriptTemplateMapper {
|
|
8
|
+
private static sectionToTemplate;
|
|
9
|
+
/**
|
|
10
|
+
* Generates HTML narrative for a specific IPS section
|
|
11
|
+
* @param section - The IPS section
|
|
12
|
+
* @param resource - FHIR Bundle containing resources
|
|
13
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
14
|
+
* @returns HTML string for rendering
|
|
15
|
+
*/
|
|
16
|
+
static generateNarrative(section: IPSSections, resource: TBundle, timezone: string | undefined): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeScriptTemplateMapper = void 0;
|
|
4
|
+
// TypeScriptTemplateMapper.ts - TypeScript replacement for IPSTemplateMapper.ts
|
|
5
|
+
const ips_sections_1 = require("../../../structures/ips_sections");
|
|
6
|
+
const PatientTemplate_1 = require("./PatientTemplate");
|
|
7
|
+
const AllergyIntoleranceTemplate_1 = require("./AllergyIntoleranceTemplate");
|
|
8
|
+
const MedicationSummaryTemplate_1 = require("./MedicationSummaryTemplate");
|
|
9
|
+
const ImmunizationsTemplate_1 = require("./ImmunizationsTemplate");
|
|
10
|
+
const ProblemListTemplate_1 = require("./ProblemListTemplate");
|
|
11
|
+
const VitalSignsTemplate_1 = require("./VitalSignsTemplate");
|
|
12
|
+
const MedicalDevicesTemplate_1 = require("./MedicalDevicesTemplate");
|
|
13
|
+
const DiagnosticResultsTemplate_1 = require("./DiagnosticResultsTemplate");
|
|
14
|
+
const HistoryOfProceduresTemplate_1 = require("./HistoryOfProceduresTemplate");
|
|
15
|
+
const SocialHistoryTemplate_1 = require("./SocialHistoryTemplate");
|
|
16
|
+
const PastHistoryOfIllnessTemplate_1 = require("./PastHistoryOfIllnessTemplate");
|
|
17
|
+
const PlanOfCareTemplate_1 = require("./PlanOfCareTemplate");
|
|
18
|
+
const FunctionalStatusTemplate_1 = require("./FunctionalStatusTemplate");
|
|
19
|
+
const PregnancyTemplate_1 = require("./PregnancyTemplate");
|
|
20
|
+
const AdvanceDirectivesTemplate_1 = require("./AdvanceDirectivesTemplate");
|
|
21
|
+
const FamilyHistoryTemplate_1 = require("./FamilyHistoryTemplate");
|
|
22
|
+
const ClinicalImpressionTemplate_1 = require("./ClinicalImpressionTemplate");
|
|
23
|
+
/**
|
|
24
|
+
* Maps IPS sections to their corresponding TypeScript template classes
|
|
25
|
+
* Replaces the Jinja2 template mapping system
|
|
26
|
+
*/
|
|
27
|
+
class TypeScriptTemplateMapper {
|
|
28
|
+
/**
|
|
29
|
+
* Generates HTML narrative for a specific IPS section
|
|
30
|
+
* @param section - The IPS section
|
|
31
|
+
* @param resource - FHIR Bundle containing resources
|
|
32
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
33
|
+
* @returns HTML string for rendering
|
|
34
|
+
*/
|
|
35
|
+
static generateNarrative(section, resource, timezone) {
|
|
36
|
+
const templateClass = this.sectionToTemplate[section];
|
|
37
|
+
if (!templateClass) {
|
|
38
|
+
throw new Error(`No template found for section: ${section}`);
|
|
39
|
+
}
|
|
40
|
+
return templateClass.generateNarrative(resource, timezone);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.TypeScriptTemplateMapper = TypeScriptTemplateMapper;
|
|
44
|
+
// Map of section types to their template classes
|
|
45
|
+
// Each template either needs to be instantiated or has a static generateNarrative method
|
|
46
|
+
TypeScriptTemplateMapper.sectionToTemplate = {
|
|
47
|
+
[ips_sections_1.IPSSections.PATIENT]: new PatientTemplate_1.PatientTemplate(),
|
|
48
|
+
[ips_sections_1.IPSSections.ALLERGIES]: new AllergyIntoleranceTemplate_1.AllergyIntoleranceTemplate(),
|
|
49
|
+
[ips_sections_1.IPSSections.MEDICATIONS]: new MedicationSummaryTemplate_1.MedicationSummaryTemplate(),
|
|
50
|
+
[ips_sections_1.IPSSections.IMMUNIZATIONS]: new ImmunizationsTemplate_1.ImmunizationsTemplate(),
|
|
51
|
+
[ips_sections_1.IPSSections.PROBLEMS]: new ProblemListTemplate_1.ProblemListTemplate(),
|
|
52
|
+
[ips_sections_1.IPSSections.VITAL_SIGNS]: new VitalSignsTemplate_1.VitalSignsTemplate(),
|
|
53
|
+
[ips_sections_1.IPSSections.MEDICAL_DEVICES]: new MedicalDevicesTemplate_1.MedicalDevicesTemplate(),
|
|
54
|
+
[ips_sections_1.IPSSections.DIAGNOSTIC_REPORTS]: new DiagnosticResultsTemplate_1.DiagnosticResultsTemplate(),
|
|
55
|
+
[ips_sections_1.IPSSections.PROCEDURES]: new HistoryOfProceduresTemplate_1.HistoryOfProceduresTemplate(),
|
|
56
|
+
[ips_sections_1.IPSSections.FAMILY_HISTORY]: new FamilyHistoryTemplate_1.FamilyHistoryTemplate(),
|
|
57
|
+
[ips_sections_1.IPSSections.SOCIAL_HISTORY]: new SocialHistoryTemplate_1.SocialHistoryTemplate(),
|
|
58
|
+
[ips_sections_1.IPSSections.PREGNANCY_HISTORY]: new PregnancyTemplate_1.PregnancyTemplate(),
|
|
59
|
+
[ips_sections_1.IPSSections.FUNCTIONAL_STATUS]: new FunctionalStatusTemplate_1.FunctionalStatusTemplate(),
|
|
60
|
+
[ips_sections_1.IPSSections.MEDICAL_HISTORY]: new PastHistoryOfIllnessTemplate_1.PastHistoryOfIllnessTemplate(),
|
|
61
|
+
[ips_sections_1.IPSSections.CARE_PLAN]: new PlanOfCareTemplate_1.PlanOfCareTemplate(),
|
|
62
|
+
[ips_sections_1.IPSSections.CLINICAL_IMPRESSION]: new ClinicalImpressionTemplate_1.ClinicalImpressionTemplate(),
|
|
63
|
+
[ips_sections_1.IPSSections.ADVANCE_DIRECTIVES]: new AdvanceDirectivesTemplate_1.AdvanceDirectivesTemplate()
|
|
64
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TBundle } from '../../../types/resources/Bundle';
|
|
2
|
+
import { ITemplate } from './interfaces/ITemplate';
|
|
3
|
+
/**
|
|
4
|
+
* Class to generate HTML narrative for Vital Signs (Observation resources)
|
|
5
|
+
* This replaces the Jinja2 vitalsigns.j2 template
|
|
6
|
+
*/
|
|
7
|
+
export declare class VitalSignsTemplate implements ITemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Generate HTML narrative for Vital Signs
|
|
10
|
+
* @param resource - FHIR Bundle containing Observation resources
|
|
11
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
12
|
+
* @returns HTML string for rendering
|
|
13
|
+
*/
|
|
14
|
+
generateNarrative(resource: TBundle, timezone: string | undefined): string;
|
|
15
|
+
/**
|
|
16
|
+
* Internal static implementation that actually generates the narrative
|
|
17
|
+
* @param resource - FHIR Bundle containing Observation resources
|
|
18
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
19
|
+
* @returns HTML string for rendering
|
|
20
|
+
*/
|
|
21
|
+
private static generateStaticNarrative;
|
|
22
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VitalSignsTemplate = void 0;
|
|
4
|
+
// VitalSignsTemplate.ts - TypeScript replacement for Jinja2 vitalsigns.j2
|
|
5
|
+
const TemplateUtilities_1 = require("./TemplateUtilities");
|
|
6
|
+
/**
|
|
7
|
+
* Class to generate HTML narrative for Vital Signs (Observation resources)
|
|
8
|
+
* This replaces the Jinja2 vitalsigns.j2 template
|
|
9
|
+
*/
|
|
10
|
+
class VitalSignsTemplate {
|
|
11
|
+
/**
|
|
12
|
+
* Generate HTML narrative for Vital Signs
|
|
13
|
+
* @param resource - FHIR Bundle containing Observation resources
|
|
14
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
15
|
+
* @returns HTML string for rendering
|
|
16
|
+
*/
|
|
17
|
+
generateNarrative(resource, timezone) {
|
|
18
|
+
return VitalSignsTemplate.generateStaticNarrative(resource, timezone);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Internal static implementation that actually generates the narrative
|
|
22
|
+
* @param resource - FHIR Bundle containing Observation resources
|
|
23
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
24
|
+
* @returns HTML string for rendering
|
|
25
|
+
*/
|
|
26
|
+
static generateStaticNarrative(resource, timezone) {
|
|
27
|
+
const templateUtilities = new TemplateUtilities_1.TemplateUtilities(resource);
|
|
28
|
+
// Start building the HTML table
|
|
29
|
+
let html = `
|
|
30
|
+
<h5>Vital Signs</h5>
|
|
31
|
+
<table class="hapiPropertyTable">
|
|
32
|
+
<thead>
|
|
33
|
+
<tr>
|
|
34
|
+
<th>Code</th>
|
|
35
|
+
<th>Result</th>
|
|
36
|
+
<th>Unit</th>
|
|
37
|
+
<th>Interpretation</th>
|
|
38
|
+
<th>Component(s)</th>
|
|
39
|
+
<th>Comments</th>
|
|
40
|
+
<th>Date</th>
|
|
41
|
+
</tr>
|
|
42
|
+
</thead>
|
|
43
|
+
<tbody>`;
|
|
44
|
+
// Check if we have entries in the bundle
|
|
45
|
+
if (resource.entry && Array.isArray(resource.entry)) {
|
|
46
|
+
// Loop through entries in the bundle
|
|
47
|
+
for (const entry of resource.entry) {
|
|
48
|
+
const obs = entry.resource;
|
|
49
|
+
// Skip composition resources
|
|
50
|
+
if (obs.resourceType === 'Composition') {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
// Use the enhanced narrativeLinkId utility function to extract the ID directly from the resource
|
|
54
|
+
// Add a table row for this observation
|
|
55
|
+
html += `
|
|
56
|
+
<tr id="${(templateUtilities.narrativeLinkId(obs))}">
|
|
57
|
+
<td>${templateUtilities.codeableConcept(obs.code, 'display')}</td>
|
|
58
|
+
<td>${templateUtilities.extractObservationValue(obs)}</td>
|
|
59
|
+
<td>${templateUtilities.extractObservationValueUnit(obs)}</td>
|
|
60
|
+
<td>${templateUtilities.firstFromCodeableConceptList(obs.interpretation)}</td>
|
|
61
|
+
<td>${templateUtilities.renderComponent(obs.component)}</td>
|
|
62
|
+
<td>${templateUtilities.renderNotes(obs.note, timezone)}</td>
|
|
63
|
+
<td>${templateUtilities.renderEffective(obs.effectiveDateTime, timezone)}</td>
|
|
64
|
+
</tr>`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Close the HTML table
|
|
68
|
+
html += `
|
|
69
|
+
</tbody>
|
|
70
|
+
</table>`;
|
|
71
|
+
return html;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.VitalSignsTemplate = VitalSignsTemplate;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TBundle } from '../../../../types/resources/Bundle';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for all template classes
|
|
4
|
+
*/
|
|
5
|
+
export interface ITemplate {
|
|
6
|
+
/**
|
|
7
|
+
* Generate HTML narrative for FHIR resources
|
|
8
|
+
* @param resource - FHIR Bundle containing resources
|
|
9
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
10
|
+
* @returns HTML string for rendering
|
|
11
|
+
*/
|
|
12
|
+
generateNarrative(resource: TBundle, timezone: string | undefined): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IPSResourceProfile } from "../structures/ips_resource_profile";
|
|
2
|
+
import { TDomainResource } from "../types/resources/DomainResource";
|
|
3
|
+
export declare class IPSResourceProfileRegistry {
|
|
4
|
+
static readonly PROFILES: Record<string, IPSResourceProfile>;
|
|
5
|
+
static readonly RECOMMENDED_PROFILES: Record<string, IPSResourceProfile>;
|
|
6
|
+
static validateResource(resource: TDomainResource, profileType: string): boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IPSResourceProfileRegistry = void 0;
|
|
4
|
+
const ips_mandatory_sections_1 = require("../structures/ips_mandatory_sections");
|
|
5
|
+
const ips_recommended_sections_1 = require("../structures/ips_recommended_sections");
|
|
6
|
+
class IPSResourceProfileRegistry {
|
|
7
|
+
// Validate resource against IPS profile
|
|
8
|
+
static validateResource(resource, profileType) {
|
|
9
|
+
const profile = this.PROFILES[profileType] ||
|
|
10
|
+
this.RECOMMENDED_PROFILES[profileType];
|
|
11
|
+
if (!profile) {
|
|
12
|
+
console.warn(`No profile found for resource type: ${resource.resourceType}`);
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
// Check mandatory fields
|
|
16
|
+
const missingMandatoryFields = profile.mandatoryFields.filter(field => !(field in resource));
|
|
17
|
+
if (missingMandatoryFields.length > 0) {
|
|
18
|
+
console.warn(`Missing mandatory fields for ${profileType}: `, missingMandatoryFields);
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.IPSResourceProfileRegistry = IPSResourceProfileRegistry;
|
|
25
|
+
// Comprehensive resource profiles aligned with IPS specification
|
|
26
|
+
IPSResourceProfileRegistry.PROFILES = {
|
|
27
|
+
[ips_mandatory_sections_1.IPSMandatorySections.PATIENT]: {
|
|
28
|
+
resourceType: 'Patient',
|
|
29
|
+
mandatoryFields: [
|
|
30
|
+
// FHIR R4B: No required fields except resourceType, but name and gender are often expected in practice
|
|
31
|
+
],
|
|
32
|
+
recommendedFields: [
|
|
33
|
+
'name',
|
|
34
|
+
'gender',
|
|
35
|
+
'birthDate',
|
|
36
|
+
'identifier',
|
|
37
|
+
'address',
|
|
38
|
+
'telecom',
|
|
39
|
+
'communication',
|
|
40
|
+
'maritalStatus'
|
|
41
|
+
],
|
|
42
|
+
loincCode: '60591-5',
|
|
43
|
+
profileUrl: 'http://hl7.org/fhir/uv/ips/StructureDefinition/Patient-uv-ips'
|
|
44
|
+
},
|
|
45
|
+
[ips_mandatory_sections_1.IPSMandatorySections.ALLERGIES]: {
|
|
46
|
+
resourceType: 'AllergyIntolerance',
|
|
47
|
+
mandatoryFields: [
|
|
48
|
+
'patient'
|
|
49
|
+
],
|
|
50
|
+
recommendedFields: [
|
|
51
|
+
'clinicalStatus',
|
|
52
|
+
'verificationStatus',
|
|
53
|
+
'code',
|
|
54
|
+
'reaction',
|
|
55
|
+
'criticality'
|
|
56
|
+
],
|
|
57
|
+
loincCode: '48765-2',
|
|
58
|
+
profileUrl: 'http://hl7.org/fhir/uv/ips/StructureDefinition/AllergyIntolerance-uv-ips'
|
|
59
|
+
},
|
|
60
|
+
[ips_mandatory_sections_1.IPSMandatorySections.MEDICATIONS]: {
|
|
61
|
+
resourceType: 'MedicationStatement',
|
|
62
|
+
mandatoryFields: [
|
|
63
|
+
'status',
|
|
64
|
+
'subject'
|
|
65
|
+
],
|
|
66
|
+
recommendedFields: [
|
|
67
|
+
'medicationCodeableConcept', // or 'medicationReference'
|
|
68
|
+
'effectiveDateTime', // or 'effectivePeriod'
|
|
69
|
+
'dosage',
|
|
70
|
+
'reasonCode'
|
|
71
|
+
],
|
|
72
|
+
loincCode: '10160-0',
|
|
73
|
+
profileUrl: 'http://hl7.org/fhir/uv/ips/StructureDefinition/MedicationStatement-uv-ips'
|
|
74
|
+
},
|
|
75
|
+
[ips_mandatory_sections_1.IPSMandatorySections.PROBLEMS]: {
|
|
76
|
+
resourceType: 'Condition',
|
|
77
|
+
mandatoryFields: [
|
|
78
|
+
'subject'
|
|
79
|
+
],
|
|
80
|
+
recommendedFields: [
|
|
81
|
+
'clinicalStatus',
|
|
82
|
+
'verificationStatus',
|
|
83
|
+
'code',
|
|
84
|
+
'onsetDateTime', // or 'onsetAge', 'onsetPeriod', 'onsetRange', 'onsetString'
|
|
85
|
+
'recordedDate',
|
|
86
|
+
'severity'
|
|
87
|
+
],
|
|
88
|
+
loincCode: '11450-4',
|
|
89
|
+
profileUrl: 'http://hl7.org/fhir/uv/ips/StructureDefinition/Condition-uv-ips'
|
|
90
|
+
},
|
|
91
|
+
[ips_mandatory_sections_1.IPSMandatorySections.IMMUNIZATIONS]: {
|
|
92
|
+
resourceType: 'Immunization',
|
|
93
|
+
mandatoryFields: [
|
|
94
|
+
'status',
|
|
95
|
+
'vaccineCode',
|
|
96
|
+
'patient',
|
|
97
|
+
'occurrenceDateTime' // or 'occurrenceString'
|
|
98
|
+
],
|
|
99
|
+
recommendedFields: [
|
|
100
|
+
'lotNumber',
|
|
101
|
+
'manufacturer',
|
|
102
|
+
'doseQuantity'
|
|
103
|
+
],
|
|
104
|
+
loincCode: '11369-6',
|
|
105
|
+
profileUrl: 'http://hl7.org/fhir/uv/ips/StructureDefinition/Immunization-uv-ips'
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
// Additional Recommended Sections
|
|
109
|
+
IPSResourceProfileRegistry.RECOMMENDED_PROFILES = {
|
|
110
|
+
[ips_recommended_sections_1.IPSRecommendedSections.DIAGNOSTIC_REPORTS]: {
|
|
111
|
+
resourceType: 'Observation',
|
|
112
|
+
mandatoryFields: [
|
|
113
|
+
'status',
|
|
114
|
+
'code',
|
|
115
|
+
'subject',
|
|
116
|
+
'effectiveDateTime' // or 'effectivePeriod'
|
|
117
|
+
],
|
|
118
|
+
recommendedFields: [
|
|
119
|
+
'category',
|
|
120
|
+
'valueQuantity', // or value[x]
|
|
121
|
+
'interpretation',
|
|
122
|
+
'referenceRange'
|
|
123
|
+
],
|
|
124
|
+
loincCode: '26436-6',
|
|
125
|
+
profileUrl: 'http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-results-uv-ips'
|
|
126
|
+
},
|
|
127
|
+
[ips_recommended_sections_1.IPSRecommendedSections.VITAL_SIGNS]: {
|
|
128
|
+
resourceType: 'Observation',
|
|
129
|
+
mandatoryFields: [
|
|
130
|
+
'status',
|
|
131
|
+
'code',
|
|
132
|
+
'subject',
|
|
133
|
+
'effectiveDateTime' // or 'effectivePeriod'
|
|
134
|
+
],
|
|
135
|
+
recommendedFields: [
|
|
136
|
+
'category',
|
|
137
|
+
'valueQuantity', // or value[x]
|
|
138
|
+
'component'
|
|
139
|
+
],
|
|
140
|
+
loincCode: '8716-3',
|
|
141
|
+
profileUrl: 'http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-vitalsigns-uv-ips'
|
|
142
|
+
}
|
|
143
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IPSMandatorySections = void 0;
|
|
4
|
+
var IPSMandatorySections;
|
|
5
|
+
(function (IPSMandatorySections) {
|
|
6
|
+
IPSMandatorySections["PATIENT"] = "Patient";
|
|
7
|
+
IPSMandatorySections["ALLERGIES"] = "AllergyIntoleranceSection";
|
|
8
|
+
IPSMandatorySections["MEDICATIONS"] = "MedicationSection";
|
|
9
|
+
IPSMandatorySections["PROBLEMS"] = "ProblemSection";
|
|
10
|
+
IPSMandatorySections["IMMUNIZATIONS"] = "ImmunizationSection";
|
|
11
|
+
})(IPSMandatorySections || (exports.IPSMandatorySections = IPSMandatorySections = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare enum IPSRecommendedSections {
|
|
2
|
+
MEDICAL_DEVICES = "Device",
|
|
3
|
+
PREGNANCY_STATUS = "PregnancyStatus",
|
|
4
|
+
FUNCTIONAL_STATUS = "FunctionalStatus",
|
|
5
|
+
ADVANCED_DIRECTIVES = "Consent",
|
|
6
|
+
DIAGNOSTIC_REPORTS = "DiagnosticReportSection",
|
|
7
|
+
VITAL_SIGNS = "VitalSignsSection"
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IPSRecommendedSections = void 0;
|
|
4
|
+
var IPSRecommendedSections;
|
|
5
|
+
(function (IPSRecommendedSections) {
|
|
6
|
+
IPSRecommendedSections["MEDICAL_DEVICES"] = "Device";
|
|
7
|
+
IPSRecommendedSections["PREGNANCY_STATUS"] = "PregnancyStatus";
|
|
8
|
+
IPSRecommendedSections["FUNCTIONAL_STATUS"] = "FunctionalStatus";
|
|
9
|
+
IPSRecommendedSections["ADVANCED_DIRECTIVES"] = "Consent";
|
|
10
|
+
IPSRecommendedSections["DIAGNOSTIC_REPORTS"] = "DiagnosticReportSection";
|
|
11
|
+
IPSRecommendedSections["VITAL_SIGNS"] = "VitalSignsSection";
|
|
12
|
+
})(IPSRecommendedSections || (exports.IPSRecommendedSections = IPSRecommendedSections = {}));
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IPS_SECTION_DISPLAY_NAMES = exports.IPS_SECTION_LOINC_CODES = void 0;
|
|
4
|
+
// LOINC Codes for IPS Sections
|
|
5
|
+
const ips_sections_1 = require("./ips_sections");
|
|
6
|
+
/*
|
|
7
|
+
* LOINC codes for each IPS section. https://hl7.org/fhir/R4/valueset-doc-section-codes.html
|
|
8
|
+
*/
|
|
9
|
+
const IPS_SECTION_LOINC_CODES = {
|
|
10
|
+
[ips_sections_1.IPSSections.PATIENT]: '54126-4',
|
|
11
|
+
[ips_sections_1.IPSSections.ALLERGIES]: '48765-2',
|
|
12
|
+
[ips_sections_1.IPSSections.MEDICATIONS]: '10160-0',
|
|
13
|
+
[ips_sections_1.IPSSections.PROBLEMS]: '11450-4',
|
|
14
|
+
[ips_sections_1.IPSSections.IMMUNIZATIONS]: '11369-6',
|
|
15
|
+
[ips_sections_1.IPSSections.VITAL_SIGNS]: '8716-3',
|
|
16
|
+
[ips_sections_1.IPSSections.MEDICAL_DEVICES]: '46264-8',
|
|
17
|
+
[ips_sections_1.IPSSections.DIAGNOSTIC_REPORTS]: '30954-2',
|
|
18
|
+
[ips_sections_1.IPSSections.PROCEDURES]: '47519-4',
|
|
19
|
+
[ips_sections_1.IPSSections.FAMILY_HISTORY]: '10157-6',
|
|
20
|
+
[ips_sections_1.IPSSections.SOCIAL_HISTORY]: '29762-2',
|
|
21
|
+
[ips_sections_1.IPSSections.PREGNANCY_HISTORY]: '10162-6',
|
|
22
|
+
[ips_sections_1.IPSSections.FUNCTIONAL_STATUS]: '47420-5',
|
|
23
|
+
[ips_sections_1.IPSSections.MEDICAL_HISTORY]: '11348-0',
|
|
24
|
+
[ips_sections_1.IPSSections.CARE_PLAN]: '18776-5',
|
|
25
|
+
[ips_sections_1.IPSSections.CLINICAL_IMPRESSION]: '51848-0',
|
|
26
|
+
[ips_sections_1.IPSSections.ADVANCE_DIRECTIVES]: '42348-3'
|
|
27
|
+
};
|
|
28
|
+
exports.IPS_SECTION_LOINC_CODES = IPS_SECTION_LOINC_CODES;
|
|
29
|
+
const IPS_SECTION_DISPLAY_NAMES = {
|
|
30
|
+
[ips_sections_1.IPSSections.PATIENT]: 'Patient summary Document',
|
|
31
|
+
[ips_sections_1.IPSSections.ALLERGIES]: 'Allergies and adverse reactions Document',
|
|
32
|
+
[ips_sections_1.IPSSections.MEDICATIONS]: 'History of Medication use Narrative',
|
|
33
|
+
[ips_sections_1.IPSSections.PROBLEMS]: 'Problem list - Reported',
|
|
34
|
+
[ips_sections_1.IPSSections.IMMUNIZATIONS]: 'History of Immunization Narrative',
|
|
35
|
+
[ips_sections_1.IPSSections.VITAL_SIGNS]: 'Vital signs',
|
|
36
|
+
[ips_sections_1.IPSSections.MEDICAL_DEVICES]: 'History of medical device use',
|
|
37
|
+
[ips_sections_1.IPSSections.DIAGNOSTIC_REPORTS]: 'Relevant diagnostic tests/laboratory data Narrative',
|
|
38
|
+
[ips_sections_1.IPSSections.PROCEDURES]: 'History of Procedures Document',
|
|
39
|
+
[ips_sections_1.IPSSections.FAMILY_HISTORY]: 'History of family member diseases Narrative',
|
|
40
|
+
[ips_sections_1.IPSSections.SOCIAL_HISTORY]: 'Social history Narrative',
|
|
41
|
+
[ips_sections_1.IPSSections.PREGNANCY_HISTORY]: 'History of pregnancies Narrative',
|
|
42
|
+
[ips_sections_1.IPSSections.FUNCTIONAL_STATUS]: 'Functional status assessment note',
|
|
43
|
+
[ips_sections_1.IPSSections.MEDICAL_HISTORY]: 'History of Past illness NarrativeHistory and physical note Document',
|
|
44
|
+
[ips_sections_1.IPSSections.CARE_PLAN]: 'Plan of care note',
|
|
45
|
+
[ips_sections_1.IPSSections.CLINICAL_IMPRESSION]: 'Evaluation note',
|
|
46
|
+
[ips_sections_1.IPSSections.ADVANCE_DIRECTIVES]: 'Advance directives Document'
|
|
47
|
+
};
|
|
48
|
+
exports.IPS_SECTION_DISPLAY_NAMES = IPS_SECTION_DISPLAY_NAMES;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IPSSections } from "./ips_sections";
|
|
2
|
+
export declare const IPSSectionResourceMap: Record<IPSSections, string[]>;
|
|
3
|
+
export type IPSSectionResourceFilter = (resource: any) => boolean;
|
|
4
|
+
export declare const IPSSectionResourceFilters: Partial<Record<IPSSections, IPSSectionResourceFilter>>;
|
|
5
|
+
export declare class IPSSectionResourceHelper {
|
|
6
|
+
static getResourceTypesForSection(section: IPSSections): string[];
|
|
7
|
+
static getResourceFilterForSection(section: IPSSections): IPSSectionResourceFilter | undefined;
|
|
8
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IPSSectionResourceHelper = exports.IPSSectionResourceFilters = exports.IPSSectionResourceMap = void 0;
|
|
4
|
+
const ips_sections_1 = require("./ips_sections");
|
|
5
|
+
// Mapping of IPSSections to FHIR resource types
|
|
6
|
+
exports.IPSSectionResourceMap = {
|
|
7
|
+
[ips_sections_1.IPSSections.PATIENT]: ['Patient'],
|
|
8
|
+
[ips_sections_1.IPSSections.ALLERGIES]: ['AllergyIntolerance'],
|
|
9
|
+
[ips_sections_1.IPSSections.MEDICATIONS]: ['MedicationRequest', 'MedicationStatement'],
|
|
10
|
+
[ips_sections_1.IPSSections.PROBLEMS]: ['Condition'],
|
|
11
|
+
[ips_sections_1.IPSSections.IMMUNIZATIONS]: ['Immunization'],
|
|
12
|
+
[ips_sections_1.IPSSections.VITAL_SIGNS]: ['Observation'],
|
|
13
|
+
[ips_sections_1.IPSSections.MEDICAL_DEVICES]: ['Device'],
|
|
14
|
+
[ips_sections_1.IPSSections.DIAGNOSTIC_REPORTS]: ['DiagnosticReport', 'Observation'], // Diagnostic reports can include Observations
|
|
15
|
+
[ips_sections_1.IPSSections.PROCEDURES]: ['Procedure'],
|
|
16
|
+
[ips_sections_1.IPSSections.FAMILY_HISTORY]: ['FamilyMemberHistory'],
|
|
17
|
+
[ips_sections_1.IPSSections.SOCIAL_HISTORY]: ['Observation'], // Social history is often Observation
|
|
18
|
+
[ips_sections_1.IPSSections.PREGNANCY_HISTORY]: ['Observation'], // Pregnancy history is often Observation
|
|
19
|
+
[ips_sections_1.IPSSections.FUNCTIONAL_STATUS]: ['Observation'], // Functional status is often Observation
|
|
20
|
+
[ips_sections_1.IPSSections.MEDICAL_HISTORY]: ['Condition'], // Medical history is often Condition
|
|
21
|
+
[ips_sections_1.IPSSections.CARE_PLAN]: ['CarePlan'],
|
|
22
|
+
[ips_sections_1.IPSSections.CLINICAL_IMPRESSION]: ['ClinicalImpression'],
|
|
23
|
+
[ips_sections_1.IPSSections.ADVANCE_DIRECTIVES]: ['DocumentReference'] // Advance directives are often stored as DocumentReference
|
|
24
|
+
};
|
|
25
|
+
exports.IPSSectionResourceFilters = {
|
|
26
|
+
// Only include active allergies
|
|
27
|
+
[ips_sections_1.IPSSections.ALLERGIES]: (resource) => { var _a, _b; return resource.resourceType === 'AllergyIntolerance' && ((_b = (_a = resource.clinicalStatus) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b.some((c) => c.code === 'active')); },
|
|
28
|
+
// Only include active medication requests/statements
|
|
29
|
+
[ips_sections_1.IPSSections.MEDICATIONS]: (resource) => (resource.resourceType === 'MedicationRequest' && resource.status === 'active') ||
|
|
30
|
+
(resource.resourceType === 'MedicationStatement' && resource.status === 'active'),
|
|
31
|
+
// Only include active problems/conditions
|
|
32
|
+
[ips_sections_1.IPSSections.PROBLEMS]: (resource) => { var _a, _b; return resource.resourceType === 'Condition' && ((_b = (_a = resource.clinicalStatus) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b.some((c) => c.code === 'active')); },
|
|
33
|
+
// Only include completed immunizations
|
|
34
|
+
[ips_sections_1.IPSSections.IMMUNIZATIONS]: (resource) => resource.resourceType === 'Immunization' && resource.status === 'completed',
|
|
35
|
+
// Only include vital sign Observations (category.coding contains 'vital-signs')
|
|
36
|
+
[ips_sections_1.IPSSections.VITAL_SIGNS]: (resource) => { var _a; return resource.resourceType === 'Observation' && ((_a = resource.category) === null || _a === void 0 ? void 0 : _a.some((cat) => { var _a; return (_a = cat.coding) === null || _a === void 0 ? void 0 : _a.some((c) => c.code === 'vital-signs'); })); },
|
|
37
|
+
// Only include active devices
|
|
38
|
+
[ips_sections_1.IPSSections.MEDICAL_DEVICES]: (resource) => resource.resourceType === 'Device' && resource.status === 'active',
|
|
39
|
+
// Only include finalized diagnostic reports
|
|
40
|
+
[ips_sections_1.IPSSections.DIAGNOSTIC_REPORTS]: (resource) => ["DiagnosticReport", "Observation"].includes(resource.resourceType) && resource.status === 'final',
|
|
41
|
+
// Only include completed procedures
|
|
42
|
+
[ips_sections_1.IPSSections.PROCEDURES]: (resource) => resource.resourceType === 'Procedure' && resource.status === 'completed',
|
|
43
|
+
// Only include family history resources
|
|
44
|
+
[ips_sections_1.IPSSections.FAMILY_HISTORY]: (resource) => resource.resourceType === 'FamilyMemberHistory',
|
|
45
|
+
// Only include social history Observations (category.coding contains 'social-history')
|
|
46
|
+
[ips_sections_1.IPSSections.SOCIAL_HISTORY]: (resource) => { var _a; return resource.resourceType === 'Observation' && ((_a = resource.category) === null || _a === void 0 ? void 0 : _a.some((cat) => { var _a; return (_a = cat.coding) === null || _a === void 0 ? void 0 : _a.some((c) => c.code === 'social-history'); })); },
|
|
47
|
+
// Only include pregnancy history Observations (category.coding contains 'pregnancy')
|
|
48
|
+
[ips_sections_1.IPSSections.PREGNANCY_HISTORY]: (resource) => { var _a; return resource.resourceType === 'Observation' && ((_a = resource.category) === null || _a === void 0 ? void 0 : _a.some((cat) => { var _a; return (_a = cat.coding) === null || _a === void 0 ? void 0 : _a.some((c) => c.code === 'pregnancy'); })); },
|
|
49
|
+
// Only include functional status Observations (category.coding contains 'functional-status')
|
|
50
|
+
[ips_sections_1.IPSSections.FUNCTIONAL_STATUS]: (resource) => { var _a; return resource.resourceType === 'Observation' && ((_a = resource.category) === null || _a === void 0 ? void 0 : _a.some((cat) => { var _a; return (_a = cat.coding) === null || _a === void 0 ? void 0 : _a.some((c) => c.code === 'functional-status'); })); },
|
|
51
|
+
// Only include active medical history Conditions
|
|
52
|
+
[ips_sections_1.IPSSections.MEDICAL_HISTORY]: (resource) => { var _a, _b; return resource.resourceType === 'Condition' && ((_b = (_a = resource.clinicalStatus) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b.some((c) => c.code === 'active')); },
|
|
53
|
+
// Only include active care plans
|
|
54
|
+
[ips_sections_1.IPSSections.CARE_PLAN]: (resource) => resource.resourceType === 'CarePlan' && resource.status === 'active',
|
|
55
|
+
// Only include ClinicalImpression resources
|
|
56
|
+
[ips_sections_1.IPSSections.CLINICAL_IMPRESSION]: (resource) => resource.resourceType === 'ClinicalImpression',
|
|
57
|
+
// Patient section: only Patient resource
|
|
58
|
+
[ips_sections_1.IPSSections.PATIENT]: (resource) => resource.resourceType === 'Patient',
|
|
59
|
+
};
|
|
60
|
+
// Helper class to get resource types for a section
|
|
61
|
+
class IPSSectionResourceHelper {
|
|
62
|
+
static getResourceTypesForSection(section) {
|
|
63
|
+
return exports.IPSSectionResourceMap[section] || [];
|
|
64
|
+
}
|
|
65
|
+
static getResourceFilterForSection(section) {
|
|
66
|
+
return exports.IPSSectionResourceFilters[section];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.IPSSectionResourceHelper = IPSSectionResourceHelper;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum IPSSections {
|
|
2
|
+
PATIENT = "Patient",
|
|
3
|
+
ALLERGIES = "AllergyIntoleranceSection",
|
|
4
|
+
MEDICATIONS = "MedicationSection",
|
|
5
|
+
PROBLEMS = "ProblemSection",
|
|
6
|
+
IMMUNIZATIONS = "ImmunizationSection",
|
|
7
|
+
VITAL_SIGNS = "VitalSignsSection",
|
|
8
|
+
MEDICAL_DEVICES = "MedicalDeviceSection",
|
|
9
|
+
DIAGNOSTIC_REPORTS = "DiagnosticReportSection",
|
|
10
|
+
PROCEDURES = "ProcedureSection",
|
|
11
|
+
FAMILY_HISTORY = "FamilyHistorySection",
|
|
12
|
+
SOCIAL_HISTORY = "SocialHistorySection",
|
|
13
|
+
PREGNANCY_HISTORY = "PregnancyHistorySection",
|
|
14
|
+
FUNCTIONAL_STATUS = "FunctionalStatusSection",
|
|
15
|
+
MEDICAL_HISTORY = "MedicalHistorySection",
|
|
16
|
+
CARE_PLAN = "CarePlanSection",
|
|
17
|
+
CLINICAL_IMPRESSION = "ClinicalImpressionSection",
|
|
18
|
+
ADVANCE_DIRECTIVES = "AdvanceDirectivesSection"
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IPSSections = void 0;
|
|
4
|
+
// Enum for all possible IPS sections
|
|
5
|
+
var IPSSections;
|
|
6
|
+
(function (IPSSections) {
|
|
7
|
+
// Mandatory Sections
|
|
8
|
+
IPSSections["PATIENT"] = "Patient";
|
|
9
|
+
IPSSections["ALLERGIES"] = "AllergyIntoleranceSection";
|
|
10
|
+
IPSSections["MEDICATIONS"] = "MedicationSection";
|
|
11
|
+
IPSSections["PROBLEMS"] = "ProblemSection";
|
|
12
|
+
IPSSections["IMMUNIZATIONS"] = "ImmunizationSection";
|
|
13
|
+
// Optional Sections
|
|
14
|
+
IPSSections["VITAL_SIGNS"] = "VitalSignsSection";
|
|
15
|
+
IPSSections["MEDICAL_DEVICES"] = "MedicalDeviceSection";
|
|
16
|
+
// Additional Recommended Sections
|
|
17
|
+
IPSSections["DIAGNOSTIC_REPORTS"] = "DiagnosticReportSection";
|
|
18
|
+
IPSSections["PROCEDURES"] = "ProcedureSection";
|
|
19
|
+
IPSSections["FAMILY_HISTORY"] = "FamilyHistorySection";
|
|
20
|
+
IPSSections["SOCIAL_HISTORY"] = "SocialHistorySection";
|
|
21
|
+
IPSSections["PREGNANCY_HISTORY"] = "PregnancyHistorySection";
|
|
22
|
+
IPSSections["FUNCTIONAL_STATUS"] = "FunctionalStatusSection";
|
|
23
|
+
IPSSections["MEDICAL_HISTORY"] = "MedicalHistorySection";
|
|
24
|
+
IPSSections["CARE_PLAN"] = "CarePlanSection";
|
|
25
|
+
IPSSections["CLINICAL_IMPRESSION"] = "ClinicalImpressionSection";
|
|
26
|
+
IPSSections["ADVANCE_DIRECTIVES"] = "AdvanceDirectivesSection";
|
|
27
|
+
})(IPSSections || (exports.IPSSections = IPSSections = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TExtension } from '../partials/Extension';
|
|
2
|
+
import { TPeriod } from '../partials/Period';
|
|
3
|
+
export type TAddress = {
|
|
4
|
+
id?: string;
|
|
5
|
+
extension?: TExtension[];
|
|
6
|
+
use?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
line?: string[];
|
|
10
|
+
city?: string;
|
|
11
|
+
district?: string;
|
|
12
|
+
state?: string;
|
|
13
|
+
postalCode?: string;
|
|
14
|
+
country?: string;
|
|
15
|
+
period?: TPeriod;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TExtension } from '../partials/Extension';
|
|
2
|
+
import { TCodeableConcept } from '../partials/CodeableConcept';
|
|
3
|
+
import { TDateTime } from '../simpleTypes/DateTime';
|
|
4
|
+
import { TAnnotation } from '../partials/Annotation';
|
|
5
|
+
export type TAllergyIntoleranceReaction = {
|
|
6
|
+
id?: string;
|
|
7
|
+
extension?: TExtension[];
|
|
8
|
+
modifierExtension?: TExtension[];
|
|
9
|
+
substance?: TCodeableConcept;
|
|
10
|
+
manifestation: TCodeableConcept[];
|
|
11
|
+
description?: string;
|
|
12
|
+
onset?: TDateTime;
|
|
13
|
+
severity?: string;
|
|
14
|
+
exposureRoute?: TCodeableConcept;
|
|
15
|
+
note?: TAnnotation[];
|
|
16
|
+
};
|