@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,450 @@
|
|
|
1
|
+
import { IPSResourceProfileRegistry } from "../src/profiles/ips_resource_profile_registry";
|
|
2
|
+
import { ComprehensiveIPSCompositionBuilder } from "../src/generators/fhir_summary_generator";
|
|
3
|
+
import { IPSSections } from "../src/structures/ips_sections";
|
|
4
|
+
import { IPS_SECTION_LOINC_CODES } from "../src/structures/ips_section_loinc_codes";
|
|
5
|
+
describe('ComprehensiveIPSCompositionBuilder', () => {
|
|
6
|
+
// Mock patient resource
|
|
7
|
+
const mockPatient = {
|
|
8
|
+
resourceType: 'Patient',
|
|
9
|
+
id: 'example-patient',
|
|
10
|
+
identifier: [{
|
|
11
|
+
system: 'http://icanbwell.com',
|
|
12
|
+
value: '12345'
|
|
13
|
+
}],
|
|
14
|
+
name: [{
|
|
15
|
+
family: 'Doe',
|
|
16
|
+
given: ['John']
|
|
17
|
+
}],
|
|
18
|
+
gender: 'male',
|
|
19
|
+
birthDate: '1980-01-01'
|
|
20
|
+
};
|
|
21
|
+
// Mock resources for different sections
|
|
22
|
+
const mockAllergies = [{
|
|
23
|
+
resourceType: 'AllergyIntolerance',
|
|
24
|
+
id: 'allergy1',
|
|
25
|
+
clinicalStatus: {
|
|
26
|
+
coding: [{
|
|
27
|
+
"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
|
|
28
|
+
code: 'active'
|
|
29
|
+
}]
|
|
30
|
+
},
|
|
31
|
+
code: {
|
|
32
|
+
coding: [{
|
|
33
|
+
"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
|
|
34
|
+
"code": "7980",
|
|
35
|
+
"display": "Penicillin G"
|
|
36
|
+
}]
|
|
37
|
+
},
|
|
38
|
+
patient: { reference: `Patient/${mockPatient.id}` },
|
|
39
|
+
}];
|
|
40
|
+
const mockMedications = [{
|
|
41
|
+
resourceType: 'MedicationRequest',
|
|
42
|
+
id: 'med1',
|
|
43
|
+
status: 'active',
|
|
44
|
+
medicationReference: { display: 'Test Medication' },
|
|
45
|
+
subject: { reference: `Patient/${mockPatient.id}` },
|
|
46
|
+
intent: 'order',
|
|
47
|
+
}];
|
|
48
|
+
const mockConditions = [
|
|
49
|
+
{
|
|
50
|
+
resourceType: 'Condition',
|
|
51
|
+
id: 'e6.ToRrlZE9pwFAPiLa6E2nRUitzucwMQODU8OsVpNGA3',
|
|
52
|
+
clinicalStatus: {
|
|
53
|
+
coding: [
|
|
54
|
+
{
|
|
55
|
+
system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
|
|
56
|
+
code: 'resolved',
|
|
57
|
+
display: 'Resolved'
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
text: 'Resolved'
|
|
61
|
+
},
|
|
62
|
+
verificationStatus: {
|
|
63
|
+
coding: [
|
|
64
|
+
{
|
|
65
|
+
system: 'http://terminology.hl7.org/CodeSystem/condition-ver-status',
|
|
66
|
+
code: 'confirmed',
|
|
67
|
+
display: 'Confirmed'
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
text: 'Confirmed'
|
|
71
|
+
},
|
|
72
|
+
category: [
|
|
73
|
+
{
|
|
74
|
+
coding: [
|
|
75
|
+
{
|
|
76
|
+
system: 'http://terminology.hl7.org/CodeSystem/condition-category',
|
|
77
|
+
code: 'problem-list-item',
|
|
78
|
+
display: 'Problem List Item'
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
text: 'Problem List Item'
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
code: {
|
|
85
|
+
coding: [
|
|
86
|
+
{
|
|
87
|
+
system: 'http://hl7.org/fhir/sid/icd-10-cm',
|
|
88
|
+
code: 'J18.9',
|
|
89
|
+
display: 'Pneumonia, unspecified organism'
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
text: 'Pneumonia'
|
|
93
|
+
},
|
|
94
|
+
subject: {
|
|
95
|
+
reference: 'Patient/example-patient',
|
|
96
|
+
display: 'FHIR, Automation'
|
|
97
|
+
},
|
|
98
|
+
onsetDateTime: '2016-12-05',
|
|
99
|
+
abatementDateTime: '2016-12-20',
|
|
100
|
+
recordedDate: '2020-03-04'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
resourceType: 'Condition',
|
|
104
|
+
id: 'eK.v1ndIFKTZm1ve0TRFa2byekZbTkS0xnsoQOqN-o5I3',
|
|
105
|
+
clinicalStatus: {
|
|
106
|
+
coding: [
|
|
107
|
+
{
|
|
108
|
+
system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
|
|
109
|
+
code: 'active',
|
|
110
|
+
display: 'Active'
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
text: 'Active'
|
|
114
|
+
},
|
|
115
|
+
verificationStatus: {
|
|
116
|
+
coding: [
|
|
117
|
+
{
|
|
118
|
+
system: 'http://terminology.hl7.org/CodeSystem/condition-ver-status',
|
|
119
|
+
code: 'confirmed',
|
|
120
|
+
display: 'Confirmed'
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
text: 'Confirmed'
|
|
124
|
+
},
|
|
125
|
+
category: [
|
|
126
|
+
{
|
|
127
|
+
coding: [
|
|
128
|
+
{
|
|
129
|
+
system: 'http://terminology.hl7.org/CodeSystem/condition-category',
|
|
130
|
+
code: 'problem-list-item',
|
|
131
|
+
display: 'Problem List Item'
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
text: 'Problem List Item'
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
code: {
|
|
138
|
+
coding: [
|
|
139
|
+
{
|
|
140
|
+
system: 'http://hl7.org/fhir/sid/icd-10-cm',
|
|
141
|
+
code: 'I10',
|
|
142
|
+
display: 'Essential (primary) hypertension'
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
text: 'Essential hypertension'
|
|
146
|
+
},
|
|
147
|
+
subject: {
|
|
148
|
+
reference: 'Patient/example-patient',
|
|
149
|
+
display: 'FHIR, Automation'
|
|
150
|
+
},
|
|
151
|
+
onsetDateTime: '2020-03-04',
|
|
152
|
+
recordedDate: '2020-03-04',
|
|
153
|
+
severity: {
|
|
154
|
+
text: 'Med'
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
];
|
|
158
|
+
const mockImmunizations = [
|
|
159
|
+
{
|
|
160
|
+
resourceType: 'Immunization',
|
|
161
|
+
id: 'emAKcOP2creGzeLlEt5R4MBF6oYm0wzxJ9aWwOTiOqHI3',
|
|
162
|
+
identifier: [
|
|
163
|
+
{
|
|
164
|
+
use: 'usual',
|
|
165
|
+
system: 'urn:oid:1.2.840.114350.1.13.1.1.7.2.768076',
|
|
166
|
+
value: '1000000246'
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
status: 'completed',
|
|
170
|
+
vaccineCode: {
|
|
171
|
+
coding: [
|
|
172
|
+
{
|
|
173
|
+
system: 'http://hl7.org/fhir/sid/cvx',
|
|
174
|
+
code: '03'
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
text: 'MMR'
|
|
178
|
+
},
|
|
179
|
+
patient: {
|
|
180
|
+
reference: 'Patient/example-patient',
|
|
181
|
+
display: 'FHIR, Automation'
|
|
182
|
+
},
|
|
183
|
+
occurrenceDateTime: '2000-03-04',
|
|
184
|
+
primarySource: false,
|
|
185
|
+
reportOrigin: {
|
|
186
|
+
coding: [
|
|
187
|
+
{
|
|
188
|
+
system: 'urn:oid:1.2.840.114350.1.13.1.1.7.10.768076.4082',
|
|
189
|
+
code: '1',
|
|
190
|
+
display: 'Patient reported'
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
text: 'Patient reported'
|
|
194
|
+
},
|
|
195
|
+
location: {
|
|
196
|
+
display: 'right arm'
|
|
197
|
+
},
|
|
198
|
+
performer: [
|
|
199
|
+
{
|
|
200
|
+
function_: {
|
|
201
|
+
coding: [
|
|
202
|
+
{
|
|
203
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0443',
|
|
204
|
+
code: 'AP',
|
|
205
|
+
display: 'Administering Provider'
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
text: 'Administering Provider'
|
|
209
|
+
},
|
|
210
|
+
actor: {
|
|
211
|
+
reference: 'Practitioner/example-practitioner',
|
|
212
|
+
type: 'Practitioner',
|
|
213
|
+
display: 'Starter Provider'
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
note: [
|
|
218
|
+
{
|
|
219
|
+
text: 'comment on MMR'
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
resourceType: 'Immunization',
|
|
225
|
+
id: 'emAKcOP2creGzeLlEt5R4MFyM.TLHisGiY2OL7vh-KKI3',
|
|
226
|
+
identifier: [
|
|
227
|
+
{
|
|
228
|
+
use: 'usual',
|
|
229
|
+
system: 'urn:oid:1.2.840.114350.1.13.1.1.7.2.768076',
|
|
230
|
+
value: '1000000244'
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
status: 'completed',
|
|
234
|
+
vaccineCode: {
|
|
235
|
+
coding: [
|
|
236
|
+
{
|
|
237
|
+
system: 'http://hl7.org/fhir/sid/cvx',
|
|
238
|
+
code: '107'
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
text: 'DTaP, Unspecified Formulation (IST) Imm-rx'
|
|
242
|
+
},
|
|
243
|
+
patient: {
|
|
244
|
+
reference: 'Patient/example-patient',
|
|
245
|
+
display: 'FHIR, Automation'
|
|
246
|
+
},
|
|
247
|
+
occurrenceDateTime: '2020-03-04T18:56:00Z',
|
|
248
|
+
primarySource: true,
|
|
249
|
+
location: {
|
|
250
|
+
display: 'connectathon-testing for EpicConnect and Pulsar testing only'
|
|
251
|
+
},
|
|
252
|
+
manufacturer: {
|
|
253
|
+
display: 'Merck, Sharp, Dohme'
|
|
254
|
+
},
|
|
255
|
+
lotNumber: '486745',
|
|
256
|
+
expirationDate: '2030-03-04',
|
|
257
|
+
site: {
|
|
258
|
+
coding: [
|
|
259
|
+
{
|
|
260
|
+
system: 'urn:oid:1.2.840.114350.1.13.1.1.7.10.768076.4040',
|
|
261
|
+
code: '14',
|
|
262
|
+
display: 'Left arm'
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
text: 'Left arm'
|
|
266
|
+
},
|
|
267
|
+
route: {
|
|
268
|
+
coding: [
|
|
269
|
+
{
|
|
270
|
+
system: 'urn:oid:1.2.840.114350.1.13.1.1.7.10.768076.4030',
|
|
271
|
+
code: '2',
|
|
272
|
+
display: 'Intramuscular'
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
text: 'Intramuscular'
|
|
276
|
+
},
|
|
277
|
+
doseQuantity: {
|
|
278
|
+
value: 0.5,
|
|
279
|
+
unit: 'mL',
|
|
280
|
+
system: 'urn:oid:1.2.840.114350.1.13.1.1.7.10.768076.4019',
|
|
281
|
+
code: '1'
|
|
282
|
+
},
|
|
283
|
+
performer: [
|
|
284
|
+
{
|
|
285
|
+
function_: {
|
|
286
|
+
coding: [
|
|
287
|
+
{
|
|
288
|
+
system: 'http://terminology.hl7.org/CodeSystem/v2-0443',
|
|
289
|
+
code: 'AP',
|
|
290
|
+
display: 'Administering Provider'
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
text: 'Administering Provider'
|
|
294
|
+
},
|
|
295
|
+
actor: {
|
|
296
|
+
reference: 'Practitioner/example-practitioner',
|
|
297
|
+
type: 'Practitioner',
|
|
298
|
+
display: 'Emily Williams, MD'
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
],
|
|
302
|
+
note: [
|
|
303
|
+
{
|
|
304
|
+
text: 'comment on DTAP'
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
];
|
|
309
|
+
// Mock validation method
|
|
310
|
+
const mockValidateResource = jest.spyOn(IPSResourceProfileRegistry, 'validateResource');
|
|
311
|
+
beforeEach(() => {
|
|
312
|
+
mockValidateResource.mockClear();
|
|
313
|
+
mockValidateResource.mockReturnValue(true);
|
|
314
|
+
});
|
|
315
|
+
describe('constructor', () => {
|
|
316
|
+
it('should create an instance with a valid patient', () => {
|
|
317
|
+
const builder = new ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
318
|
+
expect(builder).toBeTruthy();
|
|
319
|
+
});
|
|
320
|
+
it('should throw an error if patient resource is invalid', () => {
|
|
321
|
+
// mockValidateResource.mockReturnValueOnce(false);
|
|
322
|
+
// expect(() => {
|
|
323
|
+
// new ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
324
|
+
// }).toThrow('Patient resource does not meet IPS requirements');
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
describe('addSection', () => {
|
|
328
|
+
it('should add a section with valid resources', () => {
|
|
329
|
+
const builder = new ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
330
|
+
const result = builder.addSection(IPSSections.ALLERGIES, mockAllergies, 'America/New_York');
|
|
331
|
+
expect(result).toBe(builder);
|
|
332
|
+
});
|
|
333
|
+
it('should filter out invalid resources', () => {
|
|
334
|
+
const builder = new ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
335
|
+
// Should throw error when trying to build with no valid sections
|
|
336
|
+
expect(() => {
|
|
337
|
+
builder.build('America/New_York');
|
|
338
|
+
}).toThrow(/Missing mandatory IPS sections/);
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
describe('build', () => {
|
|
342
|
+
const timezone = 'America/New_York';
|
|
343
|
+
it('should build a composition with all mandatory sections', () => {
|
|
344
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
345
|
+
const builder = new ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
346
|
+
builder
|
|
347
|
+
.addSection(IPSSections.ALLERGIES, mockAllergies, timezone)
|
|
348
|
+
.addSection(IPSSections.MEDICATIONS, mockMedications, timezone)
|
|
349
|
+
.addSection(IPSSections.PROBLEMS, mockConditions, timezone)
|
|
350
|
+
.addSection(IPSSections.IMMUNIZATIONS, mockImmunizations, timezone);
|
|
351
|
+
const sections = builder.build(timezone);
|
|
352
|
+
for (const section of sections) {
|
|
353
|
+
console.info((_c = (_b = (_a = section.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.display);
|
|
354
|
+
}
|
|
355
|
+
expect(sections.length).toBe(4);
|
|
356
|
+
expect((_f = (_e = (_d = sections[0].code) === null || _d === void 0 ? void 0 : _d.coding) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.code).toBe(IPS_SECTION_LOINC_CODES.AllergyIntoleranceSection);
|
|
357
|
+
expect((_j = (_h = (_g = sections[1].code) === null || _g === void 0 ? void 0 : _g.coding) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.code).toBe(IPS_SECTION_LOINC_CODES.MedicationSection);
|
|
358
|
+
expect((_m = (_l = (_k = sections[2].code) === null || _k === void 0 ? void 0 : _k.coding) === null || _l === void 0 ? void 0 : _l[0]) === null || _m === void 0 ? void 0 : _m.code).toBe(IPS_SECTION_LOINC_CODES.ProblemSection);
|
|
359
|
+
expect((_q = (_p = (_o = sections[3].code) === null || _o === void 0 ? void 0 : _o.coding) === null || _p === void 0 ? void 0 : _p[0]) === null || _q === void 0 ? void 0 : _q.code).toBe(IPS_SECTION_LOINC_CODES.ImmunizationSection);
|
|
360
|
+
});
|
|
361
|
+
it('should throw an error if mandatory sections are missing', () => {
|
|
362
|
+
const builder = new ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
363
|
+
// Not adding all mandatory sections
|
|
364
|
+
builder.addSection(IPSSections.ALLERGIES, mockAllergies, timezone);
|
|
365
|
+
expect(() => {
|
|
366
|
+
builder.build('America/New_York');
|
|
367
|
+
}).toThrow(/Missing mandatory IPS sections/);
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
describe('integration', () => {
|
|
371
|
+
it('should create a complete IPS composition', () => {
|
|
372
|
+
const builder = new ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
373
|
+
const timezone = 'America/New_York';
|
|
374
|
+
builder
|
|
375
|
+
.addSection(IPSSections.ALLERGIES, mockAllergies, timezone)
|
|
376
|
+
.addSection(IPSSections.MEDICATIONS, mockMedications, timezone)
|
|
377
|
+
.addSection(IPSSections.PROBLEMS, [{
|
|
378
|
+
resourceType: 'Condition',
|
|
379
|
+
id: 'condition1',
|
|
380
|
+
clinicalStatus: { coding: [{ code: 'active' }] },
|
|
381
|
+
code: { coding: [{ code: 'hypertension' }] }
|
|
382
|
+
}], timezone)
|
|
383
|
+
.addSection(IPSSections.IMMUNIZATIONS, [{
|
|
384
|
+
resourceType: 'Immunization',
|
|
385
|
+
id: 'immunization1',
|
|
386
|
+
status: 'completed',
|
|
387
|
+
vaccineCode: { coding: [{ code: 'MMR' }] }
|
|
388
|
+
}], timezone);
|
|
389
|
+
const sections = builder.build(timezone);
|
|
390
|
+
expect(sections.length).toBe(4);
|
|
391
|
+
sections.forEach(section => {
|
|
392
|
+
var _a, _b, _c;
|
|
393
|
+
expect(section.entry).toBeTruthy();
|
|
394
|
+
expect((_c = (_b = (_a = section.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.system).toBe('http://loinc.org');
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
describe('integration_bundle', () => {
|
|
399
|
+
it('should create a complete IPS composition bundle', () => {
|
|
400
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
401
|
+
const builder = new ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
402
|
+
builder
|
|
403
|
+
.addSection(IPSSections.ALLERGIES, mockAllergies, 'America/New_York')
|
|
404
|
+
.addSection(IPSSections.MEDICATIONS, mockMedications, 'America/New_York')
|
|
405
|
+
.addSection(IPSSections.PROBLEMS, mockConditions, 'America/New_York')
|
|
406
|
+
.addSection(IPSSections.IMMUNIZATIONS, mockImmunizations, 'America/New_York');
|
|
407
|
+
const bundle = builder.build_bundle('example-organization', 'Example Organization', 'https://fhir.icanbwell.com/4_0_0/', 'America/New_York');
|
|
408
|
+
console.info('---- Bundle ----');
|
|
409
|
+
console.info(JSON.stringify(bundle, (key, value) => {
|
|
410
|
+
if (value === undefined) {
|
|
411
|
+
return undefined; // This will omit undefined properties
|
|
412
|
+
}
|
|
413
|
+
return value;
|
|
414
|
+
}));
|
|
415
|
+
console.info('-----------------');
|
|
416
|
+
expect(bundle.resourceType).toBe('Bundle');
|
|
417
|
+
expect(bundle.type).toBe('document');
|
|
418
|
+
expect(bundle.entry).toBeDefined();
|
|
419
|
+
if (bundle.entry) {
|
|
420
|
+
expect(bundle.entry.length).toBeGreaterThan(0);
|
|
421
|
+
// first entry should be the Composition resource
|
|
422
|
+
const composition = bundle.entry[0].resource;
|
|
423
|
+
expect(composition.resourceType).toBe('Composition');
|
|
424
|
+
expect((_c = (_b = (_a = composition.type) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.system).toBe('http://loinc.org');
|
|
425
|
+
expect((_f = (_e = (_d = composition.type) === null || _d === void 0 ? void 0 : _d.coding) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.code).toBe('60591-5'); // LOINC code for IPS
|
|
426
|
+
expect((_g = composition.subject) === null || _g === void 0 ? void 0 : _g.reference).toBe(`Patient/${mockPatient.id}`);
|
|
427
|
+
// check that the sections in the composition are present
|
|
428
|
+
expect(composition.section).toBeDefined();
|
|
429
|
+
console.assert(composition.section);
|
|
430
|
+
if (composition.section) {
|
|
431
|
+
expect(composition.section.length).toBeGreaterThan(0);
|
|
432
|
+
// check that there is NOT a patient section
|
|
433
|
+
const patientSection = composition.section.find(section => { var _a, _b, _c; return ((_c = (_b = (_a = section.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.code) === IPS_SECTION_LOINC_CODES.Patient; });
|
|
434
|
+
expect(patientSection).toBeUndefined();
|
|
435
|
+
const medicationSection = composition.section.find(section => { var _a, _b, _c; return ((_c = (_b = (_a = section.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.code) === IPS_SECTION_LOINC_CODES.MedicationSection; });
|
|
436
|
+
expect(medicationSection).toBeDefined();
|
|
437
|
+
const conditionSection = composition.section.find(section => { var _a, _b, _c; return ((_c = (_b = (_a = section.code) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.code) === IPS_SECTION_LOINC_CODES.ProblemSection; });
|
|
438
|
+
expect(conditionSection).toBeDefined();
|
|
439
|
+
}
|
|
440
|
+
// subsequent entries should be the sections
|
|
441
|
+
expect(bundle.entry.length).toEqual(9);
|
|
442
|
+
// check that each section has a valid LOINC code
|
|
443
|
+
bundle.entry.slice(1).forEach((entry) => {
|
|
444
|
+
const section = entry.resource;
|
|
445
|
+
expect(section.resourceType).toBeDefined();
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TBundle } from "../../src/types/resources/Bundle";
|
|
2
|
+
/**
|
|
3
|
+
* Reads a narrative file based on the provided folder, code value, and section title.
|
|
4
|
+
* @param folder - The folder where narrative files are stored
|
|
5
|
+
* @param codeValue - The LOINC code value to identify the narrative file
|
|
6
|
+
* @param sectionTitle - The title of the section to create a filename-friendly format
|
|
7
|
+
*/
|
|
8
|
+
export declare function readNarrativeFile(folder: string, codeValue: string, sectionTitle: string): string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Compares generated HTML narratives with expected narratives.
|
|
11
|
+
* @param generatedHtml - The generated HTML narrative string
|
|
12
|
+
* @param expectedHtml - The expected HTML narrative string
|
|
13
|
+
*/
|
|
14
|
+
export declare function compareNarratives(generatedHtml: string | undefined, expectedHtml: string | undefined): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Compares two FHIR bundles by checking their sections and narratives.
|
|
17
|
+
* @param folder - The folder where narrative files are stored
|
|
18
|
+
* @param bundle - The generated FHIR bundle to compare
|
|
19
|
+
* @param expectedBundle - The expected FHIR bundle to compare against
|
|
20
|
+
*/
|
|
21
|
+
export declare function compare_bundles(folder: string, bundle: TBundle, expectedBundle: TBundle): Promise<void>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import fs from 'fs';
|
|
11
|
+
import path from 'path';
|
|
12
|
+
import { html as beautify } from 'js-beautify';
|
|
13
|
+
/**
|
|
14
|
+
* Beautifies HTML using js-beautify
|
|
15
|
+
* @param html - The input HTML string to be formatted
|
|
16
|
+
* @returns Beautifully formatted HTML string
|
|
17
|
+
*/
|
|
18
|
+
function beautifyHtml(html) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
try {
|
|
21
|
+
// Preprocess HTML to fix specific cases
|
|
22
|
+
// Join empty <ul></ul> elements with their preceding text within table cells
|
|
23
|
+
const preprocessedHtml = html
|
|
24
|
+
.replace(/(<td>[^<]+?)[\s\r\n]+([ \t]*)<ul><\/ul>/g, '$1<ul></ul>')
|
|
25
|
+
.replace(/(<td>[^<]+?)<ul><\/ul>[\s\r\n]+([ \t]*)<\/td>/g, '$1<ul></ul></td>');
|
|
26
|
+
// Add configuration to prevent line breaks between text and adjacent elements
|
|
27
|
+
return beautify(preprocessedHtml, {
|
|
28
|
+
indent_size: 4,
|
|
29
|
+
wrap_line_length: 100,
|
|
30
|
+
preserve_newlines: true,
|
|
31
|
+
max_preserve_newlines: 1,
|
|
32
|
+
unformatted: ['ul', 'li', 'span', 'a'], // Keep these tags inline
|
|
33
|
+
inline: ['span', 'a', 'ul'], // Treat these tags as inline elements
|
|
34
|
+
content_unformatted: ['pre', 'textarea', 'td'], // Preserve content formatting in these tags
|
|
35
|
+
indent_inner_html: true,
|
|
36
|
+
extra_liners: ['body', 'html', 'head', 'table', 'tbody', 'thead', 'tr']
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.error('Formatting Error:', error);
|
|
41
|
+
return html;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Reads a narrative file based on the provided folder, code value, and section title.
|
|
47
|
+
* @param folder - The folder where narrative files are stored
|
|
48
|
+
* @param codeValue - The LOINC code value to identify the narrative file
|
|
49
|
+
* @param sectionTitle - The title of the section to create a filename-friendly format
|
|
50
|
+
*/
|
|
51
|
+
export function readNarrativeFile(folder, codeValue, sectionTitle) {
|
|
52
|
+
// Convert the section title to a filename-friendly format
|
|
53
|
+
const safeSectionTitle = sectionTitle.replace(/[^a-zA-Z0-9]/g, '_').replace(/_{2,}/g, '_');
|
|
54
|
+
const filename = `${codeValue}_${safeSectionTitle}.html`;
|
|
55
|
+
const filePath = path.join(folder, filename);
|
|
56
|
+
try {
|
|
57
|
+
return fs.readFileSync(filePath, 'utf-8');
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
throw new Error(`Narrative file not found: ${filePath}: ${error}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Compares generated HTML narratives with expected narratives.
|
|
65
|
+
* @param generatedHtml - The generated HTML narrative string
|
|
66
|
+
* @param expectedHtml - The expected HTML narrative string
|
|
67
|
+
*/
|
|
68
|
+
export function compareNarratives(generatedHtml, expectedHtml) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
if (!generatedHtml || !expectedHtml) {
|
|
71
|
+
throw new Error('Both generated and expected HTML narratives must be provided for comparison.');
|
|
72
|
+
}
|
|
73
|
+
// Beautify both HTML strings for comparison
|
|
74
|
+
const generatedFormattedHtml = yield beautifyHtml(generatedHtml);
|
|
75
|
+
const expectedFormattedHtml = yield beautifyHtml(expectedHtml);
|
|
76
|
+
// Compare the formatted HTML strings
|
|
77
|
+
if (generatedFormattedHtml === expectedFormattedHtml) {
|
|
78
|
+
console.info('Narrative matches expected output.');
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
console.info('Narrative does not match expected output.');
|
|
82
|
+
console.info(`Generated:\n${generatedFormattedHtml}`);
|
|
83
|
+
console.info(`Expected:\n${expectedFormattedHtml}`);
|
|
84
|
+
}
|
|
85
|
+
expect(generatedFormattedHtml).toStrictEqual(expectedFormattedHtml);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Compares two FHIR bundles by checking their sections and narratives.
|
|
90
|
+
* @param folder - The folder where narrative files are stored
|
|
91
|
+
* @param bundle - The generated FHIR bundle to compare
|
|
92
|
+
* @param expectedBundle - The expected FHIR bundle to compare against
|
|
93
|
+
*/
|
|
94
|
+
export function compare_bundles(folder, bundle, expectedBundle) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
97
|
+
// remove the date from the bundle for comparison
|
|
98
|
+
bundle.timestamp = expectedBundle.timestamp;
|
|
99
|
+
if (bundle.entry && ((_a = bundle.entry[0].resource) === null || _a === void 0 ? void 0 : _a.date)) {
|
|
100
|
+
bundle.entry[0].resource.date = (_c = (_b = expectedBundle.entry) === null || _b === void 0 ? void 0 : _b[0].resource) === null || _c === void 0 ? void 0 : _c.date;
|
|
101
|
+
}
|
|
102
|
+
// extract the div from each section and compare
|
|
103
|
+
const generatedSections = (_d = bundle.entry) === null || _d === void 0 ? void 0 : _d.filter((e) => { var _a; return ((_a = e.resource) === null || _a === void 0 ? void 0 : _a.resourceType) === 'Composition'; }).map((e) => { var _a; return (_a = e.resource) === null || _a === void 0 ? void 0 : _a.section; }).flat().filter((s) => s);
|
|
104
|
+
const expectedSections = (_e = expectedBundle.entry) === null || _e === void 0 ? void 0 : _e.filter((e) => { var _a; return ((_a = e.resource) === null || _a === void 0 ? void 0 : _a.resourceType) === 'Composition'; }).map((e) => { var _a; return (_a = e.resource) === null || _a === void 0 ? void 0 : _a.section; }).flat().filter((s) => s);
|
|
105
|
+
// compare the div of each section
|
|
106
|
+
expect(generatedSections).toBeDefined();
|
|
107
|
+
expect(expectedSections).toBeDefined();
|
|
108
|
+
// const turndownService = new TurndownService();
|
|
109
|
+
// expect(generatedSections?.length).toBe(expectedSections?.length);
|
|
110
|
+
if (generatedSections && expectedSections) {
|
|
111
|
+
for (let i = 0; i < generatedSections.length; i++) {
|
|
112
|
+
const generatedSection = generatedSections[i];
|
|
113
|
+
console.info(`======= Comparing section ${generatedSection.title} ${i + 1}/${generatedSections.length} ====`);
|
|
114
|
+
const generatedDiv = (_f = generatedSection.text) === null || _f === void 0 ? void 0 : _f.div;
|
|
115
|
+
// Get LOINC code for the section
|
|
116
|
+
const codeValue = (_h = (_g = generatedSection.code) === null || _g === void 0 ? void 0 : _g.coding) === null || _h === void 0 ? void 0 : _h[0].code;
|
|
117
|
+
if (!codeValue) {
|
|
118
|
+
expect(codeValue).toBeDefined();
|
|
119
|
+
}
|
|
120
|
+
// Read narrative from file
|
|
121
|
+
const expectedDiv = readNarrativeFile(folder, codeValue, generatedSection.title || '');
|
|
122
|
+
expect(expectedDiv === null || expectedDiv === void 0 ? void 0 : expectedDiv.length).toBeGreaterThan(0);
|
|
123
|
+
console.info(`Using narrative from file for ${generatedSection.title}`);
|
|
124
|
+
yield compareNarratives(generatedDiv || '', expectedDiv || '');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// expect(bundle).toEqual(expectedBundle);
|
|
128
|
+
});
|
|
129
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imranq2/fhirpatientsummary",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A template for creating npm packages using TypeScript and VSCode",
|
|
5
|
-
"main": "./lib/index.js",
|
|
5
|
+
"main": "./lib/cjs/src/index.js",
|
|
6
|
+
"module": "./lib/esm/src/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
"import": "./lib/esm/src/index.js",
|
|
9
|
+
"require": "./lib/cjs/src/index.js"
|
|
10
|
+
},
|
|
11
|
+
"types": "./lib/cjs/src/index.d.ts",
|
|
6
12
|
"files": [
|
|
7
13
|
"lib/**/*"
|
|
8
14
|
],
|
|
9
15
|
"type": "module",
|
|
10
16
|
"scripts": {
|
|
11
|
-
"build": "tsc --project tsconfig.
|
|
17
|
+
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
18
|
+
"build:esm": "tsc --project tsconfig.esm.json",
|
|
19
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
12
20
|
"clean": "rm -rf ./lib/",
|
|
13
21
|
"cm": "cz",
|
|
14
22
|
"lint": "eslint ./src/ --ext .ts --fix",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/{src → cjs/src}/narratives/templates/typescript/AllergyIntoleranceTemplate.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib/{src → cjs/src}/narratives/templates/typescript/ClinicalImpressionTemplate.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|