@imranq2/fhirpatientsummary 1.0.0 → 1.0.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/lib/esm/src/generators/fhir_summary_generator.d.ts +46 -0
- package/lib/esm/src/generators/fhir_summary_generator.js +224 -0
- package/lib/esm/src/generators/narrative_generator.d.ts +40 -0
- package/lib/esm/src/generators/narrative_generator.js +76 -0
- package/lib/esm/src/narratives/templates/typescript/AdvanceDirectivesTemplate.d.ts +22 -0
- package/lib/esm/src/narratives/templates/typescript/AdvanceDirectivesTemplate.js +66 -0
- package/lib/esm/src/narratives/templates/typescript/AllergyIntoleranceTemplate.d.ts +31 -0
- package/lib/esm/src/narratives/templates/typescript/AllergyIntoleranceTemplate.js +151 -0
- package/lib/esm/src/narratives/templates/typescript/ClinicalImpressionTemplate.d.ts +15 -0
- package/lib/esm/src/narratives/templates/typescript/ClinicalImpressionTemplate.js +107 -0
- package/lib/esm/src/narratives/templates/typescript/DiagnosticResultsTemplate.d.ts +50 -0
- package/lib/esm/src/narratives/templates/typescript/DiagnosticResultsTemplate.js +149 -0
- package/lib/esm/src/narratives/templates/typescript/FamilyHistoryTemplate.d.ts +15 -0
- package/lib/esm/src/narratives/templates/typescript/FamilyHistoryTemplate.js +99 -0
- package/lib/esm/src/narratives/templates/typescript/FunctionalStatusTemplate.d.ts +22 -0
- package/lib/esm/src/narratives/templates/typescript/FunctionalStatusTemplate.js +66 -0
- package/lib/esm/src/narratives/templates/typescript/HistoryOfProceduresTemplate.d.ts +22 -0
- package/lib/esm/src/narratives/templates/typescript/HistoryOfProceduresTemplate.js +62 -0
- package/lib/esm/src/narratives/templates/typescript/ImmunizationsTemplate.d.ts +22 -0
- package/lib/esm/src/narratives/templates/typescript/ImmunizationsTemplate.js +69 -0
- package/lib/esm/src/narratives/templates/typescript/MedicalDevicesTemplate.d.ts +22 -0
- package/lib/esm/src/narratives/templates/typescript/MedicalDevicesTemplate.js +63 -0
- package/lib/esm/src/narratives/templates/typescript/MedicationSummaryTemplate.d.ts +50 -0
- package/lib/esm/src/narratives/templates/typescript/MedicationSummaryTemplate.js +202 -0
- package/lib/esm/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.d.ts +15 -0
- package/lib/esm/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.js +55 -0
- package/lib/esm/src/narratives/templates/typescript/PatientTemplate.d.ts +65 -0
- package/lib/esm/src/narratives/templates/typescript/PatientTemplate.js +154 -0
- package/lib/esm/src/narratives/templates/typescript/PlanOfCareTemplate.d.ts +15 -0
- package/lib/esm/src/narratives/templates/typescript/PlanOfCareTemplate.js +59 -0
- package/lib/esm/src/narratives/templates/typescript/PregnancyTemplate.d.ts +22 -0
- package/lib/esm/src/narratives/templates/typescript/PregnancyTemplate.js +64 -0
- package/lib/esm/src/narratives/templates/typescript/ProblemListTemplate.d.ts +22 -0
- package/lib/esm/src/narratives/templates/typescript/ProblemListTemplate.js +115 -0
- package/lib/esm/src/narratives/templates/typescript/SocialHistoryTemplate.d.ts +22 -0
- package/lib/esm/src/narratives/templates/typescript/SocialHistoryTemplate.js +66 -0
- package/lib/esm/src/narratives/templates/typescript/TemplateUtilities.d.ts +251 -0
- package/lib/esm/src/narratives/templates/typescript/TemplateUtilities.js +692 -0
- package/lib/esm/src/narratives/templates/typescript/TypeScriptTemplateMapper.d.ts +17 -0
- package/lib/esm/src/narratives/templates/typescript/TypeScriptTemplateMapper.js +60 -0
- package/lib/esm/src/narratives/templates/typescript/VitalSignsTemplate.d.ts +22 -0
- package/lib/esm/src/narratives/templates/typescript/VitalSignsTemplate.js +70 -0
- package/lib/esm/src/narratives/templates/typescript/interfaces/ITemplate.d.ts +13 -0
- package/lib/esm/src/narratives/templates/typescript/interfaces/ITemplate.js +1 -0
- package/lib/esm/src/profiles/ips_resource_profile_registry.d.ts +7 -0
- package/lib/esm/src/profiles/ips_resource_profile_registry.js +139 -0
- package/lib/esm/src/structures/ips_mandatory_sections.d.ts +7 -0
- package/lib/esm/src/structures/ips_mandatory_sections.js +8 -0
- package/lib/esm/src/structures/ips_recommended_sections.d.ts +8 -0
- package/lib/esm/src/structures/ips_recommended_sections.js +9 -0
- package/lib/esm/src/structures/ips_resource_profile.d.ts +7 -0
- package/lib/esm/src/structures/ips_resource_profile.js +1 -0
- package/lib/esm/src/structures/ips_section_loinc_codes.d.ts +4 -0
- package/lib/esm/src/structures/ips_section_loinc_codes.js +44 -0
- package/lib/esm/src/structures/ips_section_resource_map.d.ts +8 -0
- package/lib/esm/src/structures/ips_section_resource_map.js +65 -0
- package/lib/esm/src/structures/ips_sections.d.ts +19 -0
- package/lib/esm/src/structures/ips_sections.js +24 -0
- package/lib/esm/src/types/partials/Address.d.ts +16 -0
- package/lib/esm/src/types/partials/Address.js +2 -0
- package/lib/esm/src/types/partials/AllergyIntoleranceReaction.d.ts +16 -0
- package/lib/esm/src/types/partials/AllergyIntoleranceReaction.js +2 -0
- package/lib/esm/src/types/partials/Annotation.d.ts +12 -0
- package/lib/esm/src/types/partials/Annotation.js +2 -0
- package/lib/esm/src/types/partials/Attachment.d.ts +17 -0
- package/lib/esm/src/types/partials/Attachment.js +2 -0
- package/lib/esm/src/types/partials/BundleEntry.d.ts +18 -0
- package/lib/esm/src/types/partials/BundleEntry.js +2 -0
- package/lib/esm/src/types/partials/BundleLink.d.ts +9 -0
- package/lib/esm/src/types/partials/BundleLink.js +2 -0
- package/lib/esm/src/types/partials/BundleRequest.d.ts +14 -0
- package/lib/esm/src/types/partials/BundleRequest.js +2 -0
- package/lib/esm/src/types/partials/BundleResponse.d.ts +14 -0
- package/lib/esm/src/types/partials/BundleResponse.js +2 -0
- package/lib/esm/src/types/partials/BundleSearch.d.ts +9 -0
- package/lib/esm/src/types/partials/BundleSearch.js +2 -0
- package/lib/esm/src/types/partials/CarePlanActivity.d.ts +15 -0
- package/lib/esm/src/types/partials/CarePlanActivity.js +2 -0
- package/lib/esm/src/types/partials/CarePlanDetail.d.ts +33 -0
- package/lib/esm/src/types/partials/CarePlanDetail.js +2 -0
- package/lib/esm/src/types/partials/ClinicalImpressionFinding.d.ts +11 -0
- package/lib/esm/src/types/partials/ClinicalImpressionFinding.js +2 -0
- package/lib/esm/src/types/partials/ClinicalImpressionInvestigation.d.ts +10 -0
- package/lib/esm/src/types/partials/ClinicalImpressionInvestigation.js +2 -0
- package/lib/esm/src/types/partials/CodeableConcept.d.ts +8 -0
- package/lib/esm/src/types/partials/CodeableConcept.js +2 -0
- package/lib/esm/src/types/partials/CodeableReference.d.ts +9 -0
- package/lib/esm/src/types/partials/CodeableReference.js +2 -0
- package/lib/esm/src/types/partials/Coding.d.ts +11 -0
- package/lib/esm/src/types/partials/Coding.js +2 -0
- package/lib/esm/src/types/partials/CompositionAttester.d.ts +11 -0
- package/lib/esm/src/types/partials/CompositionAttester.js +2 -0
- package/lib/esm/src/types/partials/CompositionEvent.d.ts +12 -0
- package/lib/esm/src/types/partials/CompositionEvent.js +2 -0
- package/lib/esm/src/types/partials/CompositionRelatesTo.d.ts +11 -0
- package/lib/esm/src/types/partials/CompositionRelatesTo.js +2 -0
- package/lib/esm/src/types/partials/CompositionSection.d.ts +19 -0
- package/lib/esm/src/types/partials/CompositionSection.js +2 -0
- package/lib/esm/src/types/partials/ConditionEvidence.d.ts +10 -0
- package/lib/esm/src/types/partials/ConditionEvidence.js +2 -0
- package/lib/esm/src/types/partials/ConditionStage.d.ts +11 -0
- package/lib/esm/src/types/partials/ConditionStage.js +2 -0
- package/lib/esm/src/types/partials/ConsentActor.d.ts +10 -0
- package/lib/esm/src/types/partials/ConsentActor.js +2 -0
- package/lib/esm/src/types/partials/ConsentData.d.ts +9 -0
- package/lib/esm/src/types/partials/ConsentData.js +2 -0
- package/lib/esm/src/types/partials/ConsentPolicy.d.ts +9 -0
- package/lib/esm/src/types/partials/ConsentPolicy.js +2 -0
- package/lib/esm/src/types/partials/ConsentProvision.d.ts +22 -0
- package/lib/esm/src/types/partials/ConsentProvision.js +2 -0
- package/lib/esm/src/types/partials/ConsentVerification.d.ts +11 -0
- package/lib/esm/src/types/partials/ConsentVerification.js +2 -0
- package/lib/esm/src/types/partials/ContactDetail.d.ts +8 -0
- package/lib/esm/src/types/partials/ContactDetail.js +2 -0
- package/lib/esm/src/types/partials/ContactPoint.d.ts +12 -0
- package/lib/esm/src/types/partials/ContactPoint.js +2 -0
- package/lib/esm/src/types/partials/Contributor.d.ts +9 -0
- package/lib/esm/src/types/partials/Contributor.js +2 -0
- package/lib/esm/src/types/partials/DataRequirement.d.ts +21 -0
- package/lib/esm/src/types/partials/DataRequirement.js +2 -0
- package/lib/esm/src/types/partials/DataRequirementCodeFilter.d.ts +11 -0
- package/lib/esm/src/types/partials/DataRequirementCodeFilter.js +2 -0
- package/lib/esm/src/types/partials/DataRequirementDateFilter.d.ts +13 -0
- package/lib/esm/src/types/partials/DataRequirementDateFilter.js +2 -0
- package/lib/esm/src/types/partials/DataRequirementSort.d.ts +7 -0
- package/lib/esm/src/types/partials/DataRequirementSort.js +2 -0
- package/lib/esm/src/types/partials/DeviceDeviceName.d.ts +8 -0
- package/lib/esm/src/types/partials/DeviceDeviceName.js +2 -0
- package/lib/esm/src/types/partials/DeviceProperty.d.ts +11 -0
- package/lib/esm/src/types/partials/DeviceProperty.js +2 -0
- package/lib/esm/src/types/partials/DeviceSpecialization.d.ts +9 -0
- package/lib/esm/src/types/partials/DeviceSpecialization.js +2 -0
- package/lib/esm/src/types/partials/DeviceUdiCarrier.d.ts +14 -0
- package/lib/esm/src/types/partials/DeviceUdiCarrier.js +2 -0
- package/lib/esm/src/types/partials/DeviceVersion.d.ts +11 -0
- package/lib/esm/src/types/partials/DeviceVersion.js +2 -0
- package/lib/esm/src/types/partials/DiagnosticReportMedia.d.ts +9 -0
- package/lib/esm/src/types/partials/DiagnosticReportMedia.js +2 -0
- package/lib/esm/src/types/partials/Dosage.d.ts +26 -0
- package/lib/esm/src/types/partials/Dosage.js +2 -0
- package/lib/esm/src/types/partials/DosageDoseAndRate.d.ts +16 -0
- package/lib/esm/src/types/partials/DosageDoseAndRate.js +2 -0
- package/lib/esm/src/types/partials/Expression.d.ts +12 -0
- package/lib/esm/src/types/partials/Expression.js +2 -0
- package/lib/esm/src/types/partials/Extension.d.ts +99 -0
- package/lib/esm/src/types/partials/Extension.js +2 -0
- package/lib/esm/src/types/partials/FamilyMemberHistoryCondition.d.ts +19 -0
- package/lib/esm/src/types/partials/FamilyMemberHistoryCondition.js +2 -0
- package/lib/esm/src/types/partials/HumanName.d.ts +13 -0
- package/lib/esm/src/types/partials/HumanName.js +2 -0
- package/lib/esm/src/types/partials/Identifier.d.ts +15 -0
- package/lib/esm/src/types/partials/Identifier.js +2 -0
- package/lib/esm/src/types/partials/ImmunizationEducation.d.ts +12 -0
- package/lib/esm/src/types/partials/ImmunizationEducation.js +2 -0
- package/lib/esm/src/types/partials/ImmunizationPerformer.d.ts +10 -0
- package/lib/esm/src/types/partials/ImmunizationPerformer.js +2 -0
- package/lib/esm/src/types/partials/ImmunizationProtocolApplied.d.ts +16 -0
- package/lib/esm/src/types/partials/ImmunizationProtocolApplied.js +2 -0
- package/lib/esm/src/types/partials/ImmunizationReaction.d.ts +11 -0
- package/lib/esm/src/types/partials/ImmunizationReaction.js +2 -0
- package/lib/esm/src/types/partials/MedicationBatch.d.ts +9 -0
- package/lib/esm/src/types/partials/MedicationBatch.js +2 -0
- package/lib/esm/src/types/partials/MedicationIngredient.d.ts +13 -0
- package/lib/esm/src/types/partials/MedicationIngredient.js +2 -0
- package/lib/esm/src/types/partials/MedicationRequestDispenseRequest.d.ts +18 -0
- package/lib/esm/src/types/partials/MedicationRequestDispenseRequest.js +2 -0
- package/lib/esm/src/types/partials/MedicationRequestInitialFill.d.ts +9 -0
- package/lib/esm/src/types/partials/MedicationRequestInitialFill.js +2 -0
- package/lib/esm/src/types/partials/MedicationRequestSubstitution.d.ts +10 -0
- package/lib/esm/src/types/partials/MedicationRequestSubstitution.js +2 -0
- package/lib/esm/src/types/partials/Meta.d.ts +16 -0
- package/lib/esm/src/types/partials/Meta.js +2 -0
- package/lib/esm/src/types/partials/Money.d.ts +8 -0
- package/lib/esm/src/types/partials/Money.js +2 -0
- package/lib/esm/src/types/partials/Narrative.d.ts +8 -0
- package/lib/esm/src/types/partials/Narrative.js +2 -0
- package/lib/esm/src/types/partials/ObservationComponent.d.ts +31 -0
- package/lib/esm/src/types/partials/ObservationComponent.js +2 -0
- package/lib/esm/src/types/partials/ObservationReferenceRange.d.ts +15 -0
- package/lib/esm/src/types/partials/ObservationReferenceRange.js +2 -0
- package/lib/esm/src/types/partials/OrganizationContact.d.ts +14 -0
- package/lib/esm/src/types/partials/OrganizationContact.js +2 -0
- package/lib/esm/src/types/partials/ParameterDefinition.d.ts +14 -0
- package/lib/esm/src/types/partials/ParameterDefinition.js +2 -0
- package/lib/esm/src/types/partials/PatientCommunication.d.ts +9 -0
- package/lib/esm/src/types/partials/PatientCommunication.js +2 -0
- package/lib/esm/src/types/partials/PatientContact.d.ts +19 -0
- package/lib/esm/src/types/partials/PatientContact.js +2 -0
- package/lib/esm/src/types/partials/PatientLink.d.ts +9 -0
- package/lib/esm/src/types/partials/PatientLink.js +2 -0
- package/lib/esm/src/types/partials/Period.d.ts +8 -0
- package/lib/esm/src/types/partials/Period.js +2 -0
- package/lib/esm/src/types/partials/ProcedureFocalDevice.d.ts +10 -0
- package/lib/esm/src/types/partials/ProcedureFocalDevice.js +2 -0
- package/lib/esm/src/types/partials/ProcedurePerformer.d.ts +11 -0
- package/lib/esm/src/types/partials/ProcedurePerformer.js +2 -0
- package/lib/esm/src/types/partials/Quantity.d.ts +12 -0
- package/lib/esm/src/types/partials/Quantity.js +2 -0
- package/lib/esm/src/types/partials/Range.d.ts +8 -0
- package/lib/esm/src/types/partials/Range.js +2 -0
- package/lib/esm/src/types/partials/Ratio.d.ts +8 -0
- package/lib/esm/src/types/partials/Ratio.js +2 -0
- package/lib/esm/src/types/partials/RatioRange.d.ts +9 -0
- package/lib/esm/src/types/partials/RatioRange.js +2 -0
- package/lib/esm/src/types/partials/Reference.d.ts +14 -0
- package/lib/esm/src/types/partials/Reference.js +2 -0
- package/lib/esm/src/types/partials/RelatedArtifact.d.ts +16 -0
- package/lib/esm/src/types/partials/RelatedArtifact.js +2 -0
- package/lib/esm/src/types/partials/SampledData.d.ts +15 -0
- package/lib/esm/src/types/partials/SampledData.js +2 -0
- package/lib/esm/src/types/partials/Signature.d.ts +16 -0
- package/lib/esm/src/types/partials/Signature.js +2 -0
- package/lib/esm/src/types/partials/Timing.d.ts +12 -0
- package/lib/esm/src/types/partials/Timing.js +2 -0
- package/lib/esm/src/types/partials/TimingRepeat.d.ts +30 -0
- package/lib/esm/src/types/partials/TimingRepeat.js +2 -0
- package/lib/esm/src/types/partials/TriggerDefinition.d.ts +19 -0
- package/lib/esm/src/types/partials/TriggerDefinition.js +2 -0
- package/lib/esm/src/types/partials/UsageContext.d.ts +15 -0
- package/lib/esm/src/types/partials/UsageContext.js +2 -0
- package/lib/esm/src/types/resources/AllergyIntolerance.d.ts +45 -0
- package/lib/esm/src/types/resources/AllergyIntolerance.js +2 -0
- package/lib/esm/src/types/resources/Bundle.d.ts +22 -0
- package/lib/esm/src/types/resources/Bundle.js +2 -0
- package/lib/esm/src/types/resources/CarePlan.d.ts +47 -0
- package/lib/esm/src/types/resources/CarePlan.js +2 -0
- package/lib/esm/src/types/resources/ClinicalImpression.d.ts +45 -0
- package/lib/esm/src/types/resources/ClinicalImpression.js +2 -0
- package/lib/esm/src/types/resources/Composition.d.ts +39 -0
- package/lib/esm/src/types/resources/Composition.js +2 -0
- package/lib/esm/src/types/resources/Condition.d.ts +51 -0
- package/lib/esm/src/types/resources/Condition.js +2 -0
- package/lib/esm/src/types/resources/Consent.d.ts +38 -0
- package/lib/esm/src/types/resources/Consent.js +2 -0
- package/lib/esm/src/types/resources/Device.d.ts +53 -0
- package/lib/esm/src/types/resources/Device.js +2 -0
- package/lib/esm/src/types/resources/DeviceUseStatement.d.ts +38 -0
- package/lib/esm/src/types/resources/DeviceUseStatement.js +2 -0
- package/lib/esm/src/types/resources/DiagnosticReport.d.ts +43 -0
- package/lib/esm/src/types/resources/DiagnosticReport.js +2 -0
- package/lib/esm/src/types/resources/DomainResource.d.ts +16 -0
- package/lib/esm/src/types/resources/DomainResource.js +2 -0
- package/lib/esm/src/types/resources/FamilyMemberHistory.d.ts +53 -0
- package/lib/esm/src/types/resources/FamilyMemberHistory.js +2 -0
- package/lib/esm/src/types/resources/Immunization.d.ts +56 -0
- package/lib/esm/src/types/resources/Immunization.js +2 -0
- package/lib/esm/src/types/resources/Medication.d.ts +30 -0
- package/lib/esm/src/types/resources/Medication.js +2 -0
- package/lib/esm/src/types/resources/MedicationRequest.d.ts +59 -0
- package/lib/esm/src/types/resources/MedicationRequest.js +2 -0
- package/lib/esm/src/types/resources/MedicationStatement.d.ts +42 -0
- package/lib/esm/src/types/resources/MedicationStatement.js +2 -0
- package/lib/esm/src/types/resources/Observation.d.ts +69 -0
- package/lib/esm/src/types/resources/Observation.js +2 -0
- package/lib/esm/src/types/resources/Organization.d.ts +32 -0
- package/lib/esm/src/types/resources/Organization.js +2 -0
- package/lib/esm/src/types/resources/Patient.d.ts +47 -0
- package/lib/esm/src/types/resources/Patient.js +2 -0
- package/lib/esm/src/types/resources/Procedure.d.ts +59 -0
- package/lib/esm/src/types/resources/Procedure.js +2 -0
- package/lib/esm/src/types/simpleTypes/Base64Binary.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Base64Binary.js +1 -0
- package/lib/esm/src/types/simpleTypes/Canonical.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Canonical.js +1 -0
- package/lib/esm/src/types/simpleTypes/Date.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Date.js +1 -0
- package/lib/esm/src/types/simpleTypes/DateTime.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/DateTime.js +1 -0
- package/lib/esm/src/types/simpleTypes/Decimal.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Decimal.js +1 -0
- package/lib/esm/src/types/simpleTypes/Id.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Id.js +1 -0
- package/lib/esm/src/types/simpleTypes/Instant.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Instant.js +1 -0
- package/lib/esm/src/types/simpleTypes/Int.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Int.js +1 -0
- package/lib/esm/src/types/simpleTypes/Markdown.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Markdown.js +1 -0
- package/lib/esm/src/types/simpleTypes/Oid.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Oid.js +1 -0
- package/lib/esm/src/types/simpleTypes/ResourceContainer.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/ResourceContainer.js +1 -0
- package/lib/esm/src/types/simpleTypes/Time.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Time.js +1 -0
- package/lib/esm/src/types/simpleTypes/UnsignedInt.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/UnsignedInt.js +1 -0
- package/lib/esm/src/types/simpleTypes/Uri.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Uri.js +1 -0
- package/lib/esm/src/types/simpleTypes/Url.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Url.js +1 -0
- package/lib/esm/src/types/simpleTypes/Uuid.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Uuid.js +1 -0
- package/lib/esm/src/types/simpleTypes/Xhtml.d.ts +1 -0
- package/lib/esm/src/types/simpleTypes/Xhtml.js +1 -0
- package/lib/esm/test/fhir-summary-bundle/fhir-summary-bundle.test.d.ts +1 -0
- package/lib/esm/test/fhir-summary-bundle/fhir-summary-bundle.test.js +67 -0
- package/lib/esm/test/ips-test/ips.test.d.ts +1 -0
- package/lib/esm/test/ips-test/ips.test.js +387 -0
- package/lib/esm/test/narrativeGenerator/narrativeGenerator.test.d.ts +1 -0
- package/lib/esm/test/narrativeGenerator/narrativeGenerator.test.js +641 -0
- package/lib/esm/test/summary.test.d.ts +1 -0
- package/lib/esm/test/summary.test.js +450 -0
- package/lib/esm/test/utilities/testHelpers.d.ts +21 -0
- package/lib/esm/test/utilities/testHelpers.js +129 -0
- package/package.json +11 -3
- /package/lib/{src → cjs/src}/generators/fhir_summary_generator.d.ts +0 -0
- /package/lib/{src → cjs/src}/generators/fhir_summary_generator.js +0 -0
- /package/lib/{src → cjs/src}/generators/narrative_generator.d.ts +0 -0
- /package/lib/{src → cjs/src}/generators/narrative_generator.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/AdvanceDirectivesTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/AdvanceDirectivesTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/AllergyIntoleranceTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/AllergyIntoleranceTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/ClinicalImpressionTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/ClinicalImpressionTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/DiagnosticResultsTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/DiagnosticResultsTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/FamilyHistoryTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/FamilyHistoryTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/FunctionalStatusTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/FunctionalStatusTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/HistoryOfProceduresTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/HistoryOfProceduresTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/ImmunizationsTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/ImmunizationsTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/MedicalDevicesTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/MedicalDevicesTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/MedicationSummaryTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/MedicationSummaryTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/PastHistoryOfIllnessTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/PastHistoryOfIllnessTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/PatientTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/PatientTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/PlanOfCareTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/PlanOfCareTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/PregnancyTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/PregnancyTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/ProblemListTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/ProblemListTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/SocialHistoryTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/SocialHistoryTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/TemplateUtilities.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/TemplateUtilities.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/TypeScriptTemplateMapper.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/TypeScriptTemplateMapper.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/VitalSignsTemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/VitalSignsTemplate.js +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/interfaces/ITemplate.d.ts +0 -0
- /package/lib/{src → cjs/src}/narratives/templates/typescript/interfaces/ITemplate.js +0 -0
- /package/lib/{src → cjs/src}/profiles/ips_resource_profile_registry.d.ts +0 -0
- /package/lib/{src → cjs/src}/profiles/ips_resource_profile_registry.js +0 -0
- /package/lib/{src → cjs/src}/structures/ips_mandatory_sections.d.ts +0 -0
- /package/lib/{src → cjs/src}/structures/ips_mandatory_sections.js +0 -0
- /package/lib/{src → cjs/src}/structures/ips_recommended_sections.d.ts +0 -0
- /package/lib/{src → cjs/src}/structures/ips_recommended_sections.js +0 -0
- /package/lib/{src → cjs/src}/structures/ips_resource_profile.d.ts +0 -0
- /package/lib/{src → cjs/src}/structures/ips_resource_profile.js +0 -0
- /package/lib/{src → cjs/src}/structures/ips_section_loinc_codes.d.ts +0 -0
- /package/lib/{src → cjs/src}/structures/ips_section_loinc_codes.js +0 -0
- /package/lib/{src → cjs/src}/structures/ips_section_resource_map.d.ts +0 -0
- /package/lib/{src → cjs/src}/structures/ips_section_resource_map.js +0 -0
- /package/lib/{src → cjs/src}/structures/ips_sections.d.ts +0 -0
- /package/lib/{src → cjs/src}/structures/ips_sections.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Address.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Address.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/AllergyIntoleranceReaction.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/AllergyIntoleranceReaction.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Annotation.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Annotation.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Attachment.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Attachment.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleEntry.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleEntry.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleLink.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleLink.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleRequest.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleRequest.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleResponse.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleResponse.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleSearch.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/BundleSearch.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/CarePlanActivity.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/CarePlanActivity.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/CarePlanDetail.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/CarePlanDetail.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ClinicalImpressionFinding.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ClinicalImpressionFinding.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ClinicalImpressionInvestigation.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ClinicalImpressionInvestigation.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/CodeableConcept.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/CodeableConcept.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/CodeableReference.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/CodeableReference.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Coding.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Coding.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/CompositionAttester.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/CompositionAttester.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/CompositionEvent.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/CompositionEvent.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/CompositionRelatesTo.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/CompositionRelatesTo.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/CompositionSection.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/CompositionSection.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConditionEvidence.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConditionEvidence.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConditionStage.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConditionStage.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentActor.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentActor.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentData.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentData.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentPolicy.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentPolicy.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentProvision.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentProvision.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentVerification.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ConsentVerification.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ContactDetail.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ContactDetail.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ContactPoint.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ContactPoint.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Contributor.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Contributor.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DataRequirement.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DataRequirement.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DataRequirementCodeFilter.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DataRequirementCodeFilter.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DataRequirementDateFilter.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DataRequirementDateFilter.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DataRequirementSort.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DataRequirementSort.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceDeviceName.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceDeviceName.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceProperty.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceProperty.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceSpecialization.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceSpecialization.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceUdiCarrier.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceUdiCarrier.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceVersion.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DeviceVersion.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DiagnosticReportMedia.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DiagnosticReportMedia.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Dosage.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Dosage.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/DosageDoseAndRate.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/DosageDoseAndRate.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Expression.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Expression.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Extension.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Extension.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/FamilyMemberHistoryCondition.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/FamilyMemberHistoryCondition.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/HumanName.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/HumanName.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Identifier.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Identifier.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ImmunizationEducation.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ImmunizationEducation.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ImmunizationPerformer.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ImmunizationPerformer.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ImmunizationProtocolApplied.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ImmunizationProtocolApplied.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ImmunizationReaction.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ImmunizationReaction.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationBatch.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationBatch.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationIngredient.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationIngredient.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationRequestDispenseRequest.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationRequestDispenseRequest.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationRequestInitialFill.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationRequestInitialFill.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationRequestSubstitution.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/MedicationRequestSubstitution.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Meta.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Meta.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Money.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Money.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Narrative.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Narrative.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ObservationComponent.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ObservationComponent.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ObservationReferenceRange.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ObservationReferenceRange.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/OrganizationContact.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/OrganizationContact.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ParameterDefinition.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ParameterDefinition.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/PatientCommunication.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/PatientCommunication.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/PatientContact.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/PatientContact.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/PatientLink.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/PatientLink.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Period.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Period.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ProcedureFocalDevice.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ProcedureFocalDevice.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/ProcedurePerformer.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/ProcedurePerformer.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Quantity.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Quantity.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Range.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Range.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Ratio.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Ratio.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/RatioRange.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/RatioRange.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Reference.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Reference.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/RelatedArtifact.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/RelatedArtifact.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/SampledData.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/SampledData.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Signature.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Signature.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/Timing.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/Timing.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/TimingRepeat.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/TimingRepeat.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/TriggerDefinition.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/TriggerDefinition.js +0 -0
- /package/lib/{src → cjs/src}/types/partials/UsageContext.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/partials/UsageContext.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/AllergyIntolerance.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/AllergyIntolerance.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Bundle.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Bundle.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/CarePlan.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/CarePlan.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/ClinicalImpression.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/ClinicalImpression.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Composition.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Composition.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Condition.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Condition.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Consent.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Consent.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Device.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Device.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/DeviceUseStatement.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/DeviceUseStatement.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/DiagnosticReport.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/DiagnosticReport.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/DomainResource.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/DomainResource.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/FamilyMemberHistory.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/FamilyMemberHistory.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Immunization.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Immunization.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Medication.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Medication.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/MedicationRequest.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/MedicationRequest.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/MedicationStatement.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/MedicationStatement.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Observation.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Observation.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Organization.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Organization.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Patient.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Patient.js +0 -0
- /package/lib/{src → cjs/src}/types/resources/Procedure.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/resources/Procedure.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Base64Binary.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Base64Binary.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Canonical.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Canonical.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Date.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Date.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/DateTime.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/DateTime.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Decimal.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Decimal.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Id.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Id.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Instant.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Instant.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Int.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Int.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Markdown.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Markdown.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Oid.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Oid.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/ResourceContainer.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/ResourceContainer.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Time.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Time.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/UnsignedInt.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/UnsignedInt.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Uri.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Uri.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Url.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Url.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Uuid.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Uuid.js +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Xhtml.d.ts +0 -0
- /package/lib/{src → cjs/src}/types/simpleTypes/Xhtml.js +0 -0
- /package/lib/{test → cjs/test}/fhir-summary-bundle/fhir-summary-bundle.test.d.ts +0 -0
- /package/lib/{test → cjs/test}/fhir-summary-bundle/fhir-summary-bundle.test.js +0 -0
- /package/lib/{test → cjs/test}/ips-test/ips.test.d.ts +0 -0
- /package/lib/{test → cjs/test}/ips-test/ips.test.js +0 -0
- /package/lib/{test → cjs/test}/narrativeGenerator/narrativeGenerator.test.d.ts +0 -0
- /package/lib/{test → cjs/test}/narrativeGenerator/narrativeGenerator.test.js +0 -0
- /package/lib/{test → cjs/test}/summary.test.d.ts +0 -0
- /package/lib/{test → cjs/test}/summary.test.js +0 -0
- /package/lib/{test → cjs/test}/utilities/testHelpers.d.ts +0 -0
- /package/lib/{test → cjs/test}/utilities/testHelpers.js +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// ImmunizationsTemplate.ts - TypeScript replacement for Jinja2 immunizations.j2
|
|
2
|
+
import { TemplateUtilities } from './TemplateUtilities';
|
|
3
|
+
/**
|
|
4
|
+
* Class to generate HTML narrative for Immunization resources
|
|
5
|
+
* This replaces the Jinja2 immunizations.j2 template
|
|
6
|
+
*/
|
|
7
|
+
export class ImmunizationsTemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Generate HTML narrative for Immunization resources
|
|
10
|
+
* @param resource - FHIR Bundle containing Immunization 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, timezone) {
|
|
15
|
+
return ImmunizationsTemplate.generateStaticNarrative(resource, timezone);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Internal static implementation that actually generates the narrative
|
|
19
|
+
* @param resource - FHIR Bundle containing Immunization resources
|
|
20
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
21
|
+
* @returns HTML string for rendering
|
|
22
|
+
*/
|
|
23
|
+
static generateStaticNarrative(resource, timezone) {
|
|
24
|
+
var _a;
|
|
25
|
+
const templateUtilities = new TemplateUtilities(resource);
|
|
26
|
+
// Start building the HTML table
|
|
27
|
+
let html = `
|
|
28
|
+
<h5>Immunizations</h5>
|
|
29
|
+
<table class="hapiPropertyTable">
|
|
30
|
+
<thead>
|
|
31
|
+
<tr>
|
|
32
|
+
<th>Immunization</th>
|
|
33
|
+
<th>Status</th>
|
|
34
|
+
<th>Dose Number</th>
|
|
35
|
+
<th>Manufacturer</th>
|
|
36
|
+
<th>Lot Number</th>
|
|
37
|
+
<th>Comments</th>
|
|
38
|
+
<th>Date</th>
|
|
39
|
+
</tr>
|
|
40
|
+
</thead>
|
|
41
|
+
<tbody>`;
|
|
42
|
+
// Check if we have entries in the bundle
|
|
43
|
+
if (resource.entry && Array.isArray(resource.entry)) {
|
|
44
|
+
// Loop through entries to find Immunization resources
|
|
45
|
+
for (const entry of resource.entry) {
|
|
46
|
+
if (((_a = entry.resource) === null || _a === void 0 ? void 0 : _a.resourceType) === 'Immunization') {
|
|
47
|
+
const imm = entry.resource;
|
|
48
|
+
// Find the narrative link extension if it exists
|
|
49
|
+
// Add a table row for this immunization
|
|
50
|
+
html += `
|
|
51
|
+
<tr id="${(templateUtilities.narrativeLinkId(imm))}">
|
|
52
|
+
<td>${templateUtilities.codeableConcept(imm.vaccineCode)}</td>
|
|
53
|
+
<td>${imm.status || ''}</td>
|
|
54
|
+
<td>${templateUtilities.concatDoseNumber(imm.protocolApplied)}</td>
|
|
55
|
+
<td>${templateUtilities.renderVaccineManufacturer(imm)}</td>
|
|
56
|
+
<td>${imm.lotNumber || ''}</td>
|
|
57
|
+
<td>${templateUtilities.renderNotes(imm.note, timezone)}</td>
|
|
58
|
+
<td>${templateUtilities.renderTime(imm.occurrenceDateTime, timezone)}</td>
|
|
59
|
+
</tr>`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Close the HTML table
|
|
64
|
+
html += `
|
|
65
|
+
</tbody>
|
|
66
|
+
</table>`;
|
|
67
|
+
return html;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -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 Medical Device resources
|
|
5
|
+
* This replaces the Jinja2 medicaldevices.j2 template
|
|
6
|
+
*/
|
|
7
|
+
export declare class MedicalDevicesTemplate implements ITemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Generate HTML narrative for Medical Device resources
|
|
10
|
+
* @param resource - FHIR Bundle containing Device 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 Device 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,63 @@
|
|
|
1
|
+
// MedicalDevicesTemplate.ts - TypeScript replacement for Jinja2 medicaldevices.j2
|
|
2
|
+
import { TemplateUtilities } from './TemplateUtilities';
|
|
3
|
+
/**
|
|
4
|
+
* Class to generate HTML narrative for Medical Device resources
|
|
5
|
+
* This replaces the Jinja2 medicaldevices.j2 template
|
|
6
|
+
*/
|
|
7
|
+
export class MedicalDevicesTemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Generate HTML narrative for Medical Device resources
|
|
10
|
+
* @param resource - FHIR Bundle containing Device 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, timezone) {
|
|
15
|
+
return MedicalDevicesTemplate.generateStaticNarrative(resource, timezone);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Internal static implementation that actually generates the narrative
|
|
19
|
+
* @param resource - FHIR Bundle containing Device resources
|
|
20
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
21
|
+
* @returns HTML string for rendering
|
|
22
|
+
*/
|
|
23
|
+
static generateStaticNarrative(resource, timezone) {
|
|
24
|
+
var _a;
|
|
25
|
+
const templateUtilities = new TemplateUtilities(resource);
|
|
26
|
+
// Start building the HTML table
|
|
27
|
+
let html = `
|
|
28
|
+
<h5>Medical Devices</h5>
|
|
29
|
+
<table class="hapiPropertyTable">
|
|
30
|
+
<thead>
|
|
31
|
+
<tr>
|
|
32
|
+
<th>Device</th>
|
|
33
|
+
<th>Status</th>
|
|
34
|
+
<th>Comments</th>
|
|
35
|
+
<th>Date Recorded</th>
|
|
36
|
+
</tr>
|
|
37
|
+
</thead>
|
|
38
|
+
<tbody>`;
|
|
39
|
+
// Check if we have entries in the bundle
|
|
40
|
+
if (resource.entry && Array.isArray(resource.entry)) {
|
|
41
|
+
// Loop through entries in the bundle to find DeviceUseStatement resources
|
|
42
|
+
for (const entry of resource.entry) {
|
|
43
|
+
if (((_a = entry.resource) === null || _a === void 0 ? void 0 : _a.resourceType) === 'DeviceUseStatement') {
|
|
44
|
+
const dus = entry.resource;
|
|
45
|
+
// Use the enhanced narrativeLinkId utility function to extract the ID directly from the resource
|
|
46
|
+
// Add a table row for this device use statement
|
|
47
|
+
html += `
|
|
48
|
+
<tr id="${(templateUtilities.narrativeLinkId(dus))}">
|
|
49
|
+
<td>${templateUtilities.renderDevice(dus.device)}</td>
|
|
50
|
+
<td>${dus.status || ''}</td>
|
|
51
|
+
<td>${templateUtilities.renderNotes(dus.note, timezone)}</td>
|
|
52
|
+
<td>${templateUtilities.renderRecorded(dus.recordedOn, timezone)}</td>
|
|
53
|
+
</tr>`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Close the HTML table
|
|
58
|
+
html += `
|
|
59
|
+
</tbody>
|
|
60
|
+
</table>`;
|
|
61
|
+
return html;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TBundle } from '../../../types/resources/Bundle';
|
|
2
|
+
import { ITemplate } from './interfaces/ITemplate';
|
|
3
|
+
/**
|
|
4
|
+
* Class to generate HTML narrative for Medication resources
|
|
5
|
+
* This replaces the Jinja2 medicationsummary.j2 template
|
|
6
|
+
*/
|
|
7
|
+
export declare class MedicationSummaryTemplate implements ITemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Generate HTML narrative for Medication resources
|
|
10
|
+
* @param resource - FHIR Bundle containing Medication 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 Medication 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
|
+
/**
|
|
23
|
+
* Extract MedicationRequest resources from the bundle
|
|
24
|
+
* @param templateUtilities - Instance of TemplateUtilities for utility functions
|
|
25
|
+
* @param resource - FHIR Bundle
|
|
26
|
+
* @returns Array of MedicationRequest resources
|
|
27
|
+
*/
|
|
28
|
+
private static getMedicationRequests;
|
|
29
|
+
/**
|
|
30
|
+
* Extract MedicationStatement resources from the bundle
|
|
31
|
+
* @param templateUtilities - Instance of TemplateUtilities for utility functions
|
|
32
|
+
* @param resource - FHIR Bundle
|
|
33
|
+
* @returns Array of MedicationStatement resources
|
|
34
|
+
*/
|
|
35
|
+
private static getMedicationStatements;
|
|
36
|
+
/**
|
|
37
|
+
* Render HTML table for MedicationRequest resources
|
|
38
|
+
* @param templateUtilities - Instance of TemplateUtilities for utility functions
|
|
39
|
+
* @param medications - Array of MedicationRequest resources
|
|
40
|
+
* @returns HTML string for rendering
|
|
41
|
+
*/
|
|
42
|
+
private static renderMedicationRequests;
|
|
43
|
+
/**
|
|
44
|
+
* Render HTML table for MedicationStatement resources
|
|
45
|
+
* @param templateUtilities - Instance of TemplateUtilities for utility functions
|
|
46
|
+
* @param medications - Array of MedicationStatement resources
|
|
47
|
+
* @returns HTML string for rendering
|
|
48
|
+
*/
|
|
49
|
+
private static renderMedicationStatements;
|
|
50
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// MedicationSummaryTemplate.ts - TypeScript replacement for Jinja2 medicationsummary.j2
|
|
2
|
+
import { TemplateUtilities } from './TemplateUtilities';
|
|
3
|
+
/**
|
|
4
|
+
* Class to generate HTML narrative for Medication resources
|
|
5
|
+
* This replaces the Jinja2 medicationsummary.j2 template
|
|
6
|
+
*/
|
|
7
|
+
export class MedicationSummaryTemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Generate HTML narrative for Medication resources
|
|
10
|
+
* @param resource - FHIR Bundle containing Medication 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, timezone) {
|
|
15
|
+
return MedicationSummaryTemplate.generateStaticNarrative(resource, timezone);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Internal static implementation that actually generates the narrative
|
|
19
|
+
* @param resource - FHIR Bundle containing Medication resources
|
|
20
|
+
* @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
|
|
21
|
+
* @returns HTML string for rendering
|
|
22
|
+
*/
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
|
+
static generateStaticNarrative(resource, timezone) {
|
|
25
|
+
const templateUtilities = new TemplateUtilities(resource);
|
|
26
|
+
let html = '';
|
|
27
|
+
// Add Medication Requests section if we have any
|
|
28
|
+
const medicationRequests = this.getMedicationRequests(templateUtilities, resource);
|
|
29
|
+
if (medicationRequests.length > 0) {
|
|
30
|
+
html += this.renderMedicationRequests(templateUtilities, medicationRequests);
|
|
31
|
+
}
|
|
32
|
+
// Add Medication Statements section if we have any
|
|
33
|
+
const medicationStatements = this.getMedicationStatements(templateUtilities, resource);
|
|
34
|
+
if (medicationStatements.length > 0) {
|
|
35
|
+
html += this.renderMedicationStatements(templateUtilities, medicationStatements);
|
|
36
|
+
}
|
|
37
|
+
return html;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Extract MedicationRequest resources from the bundle
|
|
41
|
+
* @param templateUtilities - Instance of TemplateUtilities for utility functions
|
|
42
|
+
* @param resource - FHIR Bundle
|
|
43
|
+
* @returns Array of MedicationRequest resources
|
|
44
|
+
*/
|
|
45
|
+
static getMedicationRequests(templateUtilities, resource) {
|
|
46
|
+
if (!resource.entry || !Array.isArray(resource.entry)) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
return resource.entry
|
|
50
|
+
.filter(entry => { var _a; return ((_a = entry.resource) === null || _a === void 0 ? void 0 : _a.resourceType) === 'MedicationRequest'; })
|
|
51
|
+
.map(entry => ({
|
|
52
|
+
resource: entry.resource,
|
|
53
|
+
extension: templateUtilities.narrativeLinkExtension(entry.resource)
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Extract MedicationStatement resources from the bundle
|
|
58
|
+
* @param templateUtilities - Instance of TemplateUtilities for utility functions
|
|
59
|
+
* @param resource - FHIR Bundle
|
|
60
|
+
* @returns Array of MedicationStatement resources
|
|
61
|
+
*/
|
|
62
|
+
static getMedicationStatements(templateUtilities, resource) {
|
|
63
|
+
if (!resource.entry || !Array.isArray(resource.entry)) {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
return resource.entry
|
|
67
|
+
.filter(entry => { var _a; return ((_a = entry.resource) === null || _a === void 0 ? void 0 : _a.resourceType) === 'MedicationStatement'; })
|
|
68
|
+
.map(entry => ({
|
|
69
|
+
resource: entry.resource,
|
|
70
|
+
extension: templateUtilities.narrativeLinkExtension(entry.resource)
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Render HTML table for MedicationRequest resources
|
|
75
|
+
* @param templateUtilities - Instance of TemplateUtilities for utility functions
|
|
76
|
+
* @param medications - Array of MedicationRequest resources
|
|
77
|
+
* @returns HTML string for rendering
|
|
78
|
+
*/
|
|
79
|
+
static renderMedicationRequests(templateUtilities, medications) {
|
|
80
|
+
var _a, _b, _c, _d;
|
|
81
|
+
let html = `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
82
|
+
<table>
|
|
83
|
+
<thead>
|
|
84
|
+
<tr>
|
|
85
|
+
<th>Medication</th>
|
|
86
|
+
<th>Sig</th>
|
|
87
|
+
<th>Dispense Quantity</th>
|
|
88
|
+
<th>Refills</th>
|
|
89
|
+
<th>Start Date</th>
|
|
90
|
+
<th>End Date</th>
|
|
91
|
+
<th>Status</th>
|
|
92
|
+
</tr>
|
|
93
|
+
</thead>
|
|
94
|
+
<tbody>`;
|
|
95
|
+
for (const { resource: mr, extension } of medications) {
|
|
96
|
+
// Use the narrativeLinkId utility function to extract the ID
|
|
97
|
+
const narrativeLinkId = templateUtilities.narrativeLinkId(extension);
|
|
98
|
+
// Format status
|
|
99
|
+
const status = mr.status ? String(mr.status) : '-';
|
|
100
|
+
// Get medication name using the new shared function
|
|
101
|
+
const medication = templateUtilities.getMedicationName(mr.medicationReference || mr.medicationCodeableConcept);
|
|
102
|
+
// Get Sig/dosage instructions
|
|
103
|
+
const sig = templateUtilities.concat(mr.dosageInstruction, 'text') || '-';
|
|
104
|
+
// Get dispense quantity
|
|
105
|
+
let dispenseQuantity = '-';
|
|
106
|
+
if ((_a = mr.dispenseRequest) === null || _a === void 0 ? void 0 : _a.quantity) {
|
|
107
|
+
const quantity = mr.dispenseRequest.quantity;
|
|
108
|
+
if (quantity.value) {
|
|
109
|
+
dispenseQuantity = `${quantity.value} ${quantity.unit || quantity.code || ''}`.trim();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Get refills
|
|
113
|
+
const refills = ((_c = (_b = mr.dispenseRequest) === null || _b === void 0 ? void 0 : _b.numberOfRepeatsAllowed) === null || _c === void 0 ? void 0 : _c.toString()) || '-';
|
|
114
|
+
// Get dates
|
|
115
|
+
let startDate = '-';
|
|
116
|
+
let endDate = '-';
|
|
117
|
+
if ((_d = mr.dispenseRequest) === null || _d === void 0 ? void 0 : _d.validityPeriod) {
|
|
118
|
+
startDate = mr.dispenseRequest.validityPeriod.start || '-';
|
|
119
|
+
endDate = mr.dispenseRequest.validityPeriod.end || '-';
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
// Use authored date as fallback for start date
|
|
123
|
+
startDate = mr.authoredOn || '-';
|
|
124
|
+
}
|
|
125
|
+
// Add table row
|
|
126
|
+
html += `
|
|
127
|
+
<tr${narrativeLinkId ? ` id="${narrativeLinkId}"` : ''}>
|
|
128
|
+
<td>${medication}<ul></ul></td>
|
|
129
|
+
<td>${sig}</td>
|
|
130
|
+
<td>${dispenseQuantity}</td>
|
|
131
|
+
<td>${refills}</td>
|
|
132
|
+
<td>${startDate}</td>
|
|
133
|
+
<td>${endDate}</td>
|
|
134
|
+
<td>${status}</td>
|
|
135
|
+
</tr>`;
|
|
136
|
+
}
|
|
137
|
+
html += `
|
|
138
|
+
</tbody>
|
|
139
|
+
</table></div>`;
|
|
140
|
+
return html;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Render HTML table for MedicationStatement resources
|
|
144
|
+
* @param templateUtilities - Instance of TemplateUtilities for utility functions
|
|
145
|
+
* @param medications - Array of MedicationStatement resources
|
|
146
|
+
* @returns HTML string for rendering
|
|
147
|
+
*/
|
|
148
|
+
static renderMedicationStatements(templateUtilities, medications) {
|
|
149
|
+
let html = `<div xmlns="http://www.w3.org/1999/xhtml">
|
|
150
|
+
<table>
|
|
151
|
+
<thead>
|
|
152
|
+
<tr>
|
|
153
|
+
<th>Medication</th>
|
|
154
|
+
<th>Sig</th>
|
|
155
|
+
<th>Dispense Quantity</th>
|
|
156
|
+
<th>Refills</th>
|
|
157
|
+
<th>Start Date</th>
|
|
158
|
+
<th>End Date</th>
|
|
159
|
+
<th>Status</th>
|
|
160
|
+
</tr>
|
|
161
|
+
</thead>
|
|
162
|
+
<tbody>`;
|
|
163
|
+
for (const { resource: ms, extension } of medications) {
|
|
164
|
+
// Use the narrativeLinkId utility function to extract the ID
|
|
165
|
+
const narrativeLinkId = templateUtilities.narrativeLinkId(extension);
|
|
166
|
+
// Format status
|
|
167
|
+
const status = ms.status ? String(ms.status) : '-';
|
|
168
|
+
// Get medication name using the new shared function
|
|
169
|
+
const medication = templateUtilities.getMedicationName(ms.medicationReference || ms.medicationCodeableConcept);
|
|
170
|
+
// Get Sig/dosage instructions
|
|
171
|
+
const sig = templateUtilities.concat(ms.dosage, 'text') || '-';
|
|
172
|
+
// Dispense quantity and refills aren't typically in MedicationStatement
|
|
173
|
+
const dispenseQuantity = '-';
|
|
174
|
+
const refills = '-';
|
|
175
|
+
// Get dates
|
|
176
|
+
let startDate = '-';
|
|
177
|
+
let endDate = '-';
|
|
178
|
+
if (ms.effectiveDateTime) {
|
|
179
|
+
startDate = ms.effectiveDateTime;
|
|
180
|
+
}
|
|
181
|
+
else if (ms.effectivePeriod) {
|
|
182
|
+
startDate = ms.effectivePeriod.start || '-';
|
|
183
|
+
endDate = ms.effectivePeriod.end || '-';
|
|
184
|
+
}
|
|
185
|
+
// Add table row
|
|
186
|
+
html += `
|
|
187
|
+
<tr${narrativeLinkId ? ` id="${narrativeLinkId}"` : ''}>
|
|
188
|
+
<td>${medication}<ul></ul></td>
|
|
189
|
+
<td>${sig}</td>
|
|
190
|
+
<td>${dispenseQuantity}</td>
|
|
191
|
+
<td>${refills}</td>
|
|
192
|
+
<td>${startDate}</td>
|
|
193
|
+
<td>${endDate}</td>
|
|
194
|
+
<td>${status}</td>
|
|
195
|
+
</tr>`;
|
|
196
|
+
}
|
|
197
|
+
html += `
|
|
198
|
+
</tbody>
|
|
199
|
+
</table></div>`;
|
|
200
|
+
return html;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TBundle } from '../../../types/resources/Bundle';
|
|
2
|
+
import { ITemplate } from './interfaces/ITemplate';
|
|
3
|
+
/**
|
|
4
|
+
* Class to generate HTML narrative for Past History of Illness (Condition resources)
|
|
5
|
+
* This replaces the Jinja2 pasthistoryofillness.j2 template
|
|
6
|
+
*/
|
|
7
|
+
export declare class PastHistoryOfIllnessTemplate implements ITemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Generate HTML narrative for Past History of Illnesses
|
|
10
|
+
* @param resource - FHIR Bundle containing Condition 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
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// PastHistoryOfIllnessTemplate.ts - TypeScript replacement for Jinja2 pasthistoryofillness.j2
|
|
2
|
+
import { TemplateUtilities } from './TemplateUtilities';
|
|
3
|
+
/**
|
|
4
|
+
* Class to generate HTML narrative for Past History of Illness (Condition resources)
|
|
5
|
+
* This replaces the Jinja2 pasthistoryofillness.j2 template
|
|
6
|
+
*/
|
|
7
|
+
export class PastHistoryOfIllnessTemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Generate HTML narrative for Past History of Illnesses
|
|
10
|
+
* @param resource - FHIR Bundle containing Condition 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, timezone) {
|
|
15
|
+
const templateUtilities = new TemplateUtilities(resource);
|
|
16
|
+
// Start building the HTML table
|
|
17
|
+
let html = `
|
|
18
|
+
<h5>Past History of Illnesses</h5>
|
|
19
|
+
<table class="hapiPropertyTable">
|
|
20
|
+
<thead>
|
|
21
|
+
<tr>
|
|
22
|
+
<th>Medical Problems</th>
|
|
23
|
+
<th>Status</th>
|
|
24
|
+
<th>Comments</th>
|
|
25
|
+
<th>Date</th>
|
|
26
|
+
</tr>
|
|
27
|
+
</thead>
|
|
28
|
+
<tbody>`;
|
|
29
|
+
// Check if we have entries in the bundle
|
|
30
|
+
if (resource.entry && Array.isArray(resource.entry)) {
|
|
31
|
+
// Loop through entries in the bundle
|
|
32
|
+
for (const entry of resource.entry) {
|
|
33
|
+
const cond = entry.resource;
|
|
34
|
+
// Skip Composition resources
|
|
35
|
+
if (cond.resourceType === 'Composition') {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
// Use the enhanced narrativeLinkId utility function to extract the ID directly from the resource
|
|
39
|
+
// Add a table row for this condition
|
|
40
|
+
html += `
|
|
41
|
+
<tr id="${(templateUtilities.narrativeLinkId(cond))}">
|
|
42
|
+
<td>${templateUtilities.codeableConcept(cond.code, 'display')}</td>
|
|
43
|
+
<td>${templateUtilities.codeableConcept(cond.clinicalStatus, 'code')}</td>
|
|
44
|
+
<td>${templateUtilities.renderNotes(cond.note, timezone)}</td>
|
|
45
|
+
<td>${templateUtilities.renderTime(cond.onsetDateTime, timezone)}</td>
|
|
46
|
+
</tr>`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Close the HTML table
|
|
50
|
+
html += `
|
|
51
|
+
</tbody>
|
|
52
|
+
</table>`;
|
|
53
|
+
return html;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { TBundle } from '../../../types/resources/Bundle';
|
|
2
|
+
import { ITemplate } from './interfaces/ITemplate';
|
|
3
|
+
/**
|
|
4
|
+
* Class to generate HTML narrative for Patient resources
|
|
5
|
+
* This replaces the Jinja2 patient.j2 template
|
|
6
|
+
*/
|
|
7
|
+
export declare class PatientTemplate implements ITemplate {
|
|
8
|
+
/**
|
|
9
|
+
* Generate HTML narrative for Patient resource
|
|
10
|
+
* @param resource - FHIR Bundle containing Patient resource
|
|
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 Patient resource
|
|
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
|
+
/**
|
|
23
|
+
* Renders patient names as HTML list items
|
|
24
|
+
* @param patient - Patient resource
|
|
25
|
+
* @returns HTML string of list items
|
|
26
|
+
*/
|
|
27
|
+
private static renderNames;
|
|
28
|
+
/**
|
|
29
|
+
* Renders patient identifiers as HTML list items
|
|
30
|
+
* @param patient - Patient resource
|
|
31
|
+
* @returns HTML string of list items
|
|
32
|
+
*/
|
|
33
|
+
private static renderIdentifiers;
|
|
34
|
+
/**
|
|
35
|
+
* Renders patient telecom information as HTML list items
|
|
36
|
+
* @param patient - Patient resource
|
|
37
|
+
* @returns HTML string of list items
|
|
38
|
+
*/
|
|
39
|
+
private static renderTelecom;
|
|
40
|
+
/**
|
|
41
|
+
* Renders patient addresses as HTML list items
|
|
42
|
+
* @param patient - Patient resource
|
|
43
|
+
* @returns HTML string of list items
|
|
44
|
+
*/
|
|
45
|
+
private static renderAddresses;
|
|
46
|
+
/**
|
|
47
|
+
* Renders patient deceased status
|
|
48
|
+
* @param patient - Patient resource
|
|
49
|
+
* @returns HTML string for deceased status
|
|
50
|
+
*/
|
|
51
|
+
private static renderDeceased;
|
|
52
|
+
/**
|
|
53
|
+
* Renders patient communication preferences as HTML list items
|
|
54
|
+
* @param templateUtilities - Instance of TemplateUtilities for utility functions
|
|
55
|
+
* @param patient - Patient resource
|
|
56
|
+
* @returns HTML string of list items
|
|
57
|
+
*/
|
|
58
|
+
private static renderCommunication;
|
|
59
|
+
/**
|
|
60
|
+
* Capitalizes first letter of a string
|
|
61
|
+
* @param str - String to capitalize
|
|
62
|
+
* @returns Capitalized string
|
|
63
|
+
*/
|
|
64
|
+
private static capitalize;
|
|
65
|
+
}
|