@imranq2/fhirpatientsummary 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +81 -0
- package/lib/src/generators/fhir_summary_generator.d.ts +46 -0
- package/lib/src/generators/fhir_summary_generator.js +228 -0
- package/lib/src/generators/narrative_generator.d.ts +40 -0
- package/lib/src/generators/narrative_generator.js +80 -0
- package/lib/src/narratives/templates/typescript/AdvanceDirectivesTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/AdvanceDirectivesTemplate.js +70 -0
- package/lib/src/narratives/templates/typescript/AllergyIntoleranceTemplate.d.ts +31 -0
- package/lib/src/narratives/templates/typescript/AllergyIntoleranceTemplate.js +155 -0
- package/lib/src/narratives/templates/typescript/ClinicalImpressionTemplate.d.ts +15 -0
- package/lib/src/narratives/templates/typescript/ClinicalImpressionTemplate.js +111 -0
- package/lib/src/narratives/templates/typescript/DiagnosticResultsTemplate.d.ts +50 -0
- package/lib/src/narratives/templates/typescript/DiagnosticResultsTemplate.js +153 -0
- package/lib/src/narratives/templates/typescript/FamilyHistoryTemplate.d.ts +15 -0
- package/lib/src/narratives/templates/typescript/FamilyHistoryTemplate.js +103 -0
- package/lib/src/narratives/templates/typescript/FunctionalStatusTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/FunctionalStatusTemplate.js +70 -0
- package/lib/src/narratives/templates/typescript/HistoryOfProceduresTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/HistoryOfProceduresTemplate.js +66 -0
- package/lib/src/narratives/templates/typescript/ImmunizationsTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/ImmunizationsTemplate.js +73 -0
- package/lib/src/narratives/templates/typescript/MedicalDevicesTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/MedicalDevicesTemplate.js +67 -0
- package/lib/src/narratives/templates/typescript/MedicationSummaryTemplate.d.ts +50 -0
- package/lib/src/narratives/templates/typescript/MedicationSummaryTemplate.js +206 -0
- package/lib/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.d.ts +15 -0
- package/lib/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.js +59 -0
- package/lib/src/narratives/templates/typescript/PatientTemplate.d.ts +65 -0
- package/lib/src/narratives/templates/typescript/PatientTemplate.js +158 -0
- package/lib/src/narratives/templates/typescript/PlanOfCareTemplate.d.ts +15 -0
- package/lib/src/narratives/templates/typescript/PlanOfCareTemplate.js +63 -0
- package/lib/src/narratives/templates/typescript/PregnancyTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/PregnancyTemplate.js +68 -0
- package/lib/src/narratives/templates/typescript/ProblemListTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/ProblemListTemplate.js +119 -0
- package/lib/src/narratives/templates/typescript/SocialHistoryTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/SocialHistoryTemplate.js +70 -0
- package/lib/src/narratives/templates/typescript/TemplateUtilities.d.ts +251 -0
- package/lib/src/narratives/templates/typescript/TemplateUtilities.js +696 -0
- package/lib/src/narratives/templates/typescript/TypeScriptTemplateMapper.d.ts +17 -0
- package/lib/src/narratives/templates/typescript/TypeScriptTemplateMapper.js +64 -0
- package/lib/src/narratives/templates/typescript/VitalSignsTemplate.d.ts +22 -0
- package/lib/src/narratives/templates/typescript/VitalSignsTemplate.js +74 -0
- package/lib/src/narratives/templates/typescript/interfaces/ITemplate.d.ts +13 -0
- package/lib/src/narratives/templates/typescript/interfaces/ITemplate.js +2 -0
- package/lib/src/profiles/ips_resource_profile_registry.d.ts +7 -0
- package/lib/src/profiles/ips_resource_profile_registry.js +143 -0
- package/lib/src/structures/ips_mandatory_sections.d.ts +7 -0
- package/lib/src/structures/ips_mandatory_sections.js +11 -0
- package/lib/src/structures/ips_recommended_sections.d.ts +8 -0
- package/lib/src/structures/ips_recommended_sections.js +12 -0
- package/lib/src/structures/ips_resource_profile.d.ts +7 -0
- package/lib/src/structures/ips_resource_profile.js +2 -0
- package/lib/src/structures/ips_section_loinc_codes.d.ts +4 -0
- package/lib/src/structures/ips_section_loinc_codes.js +48 -0
- package/lib/src/structures/ips_section_resource_map.d.ts +8 -0
- package/lib/src/structures/ips_section_resource_map.js +69 -0
- package/lib/src/structures/ips_sections.d.ts +19 -0
- package/lib/src/structures/ips_sections.js +27 -0
- package/lib/src/types/partials/Address.d.ts +16 -0
- package/lib/src/types/partials/Address.js +3 -0
- package/lib/src/types/partials/AllergyIntoleranceReaction.d.ts +16 -0
- package/lib/src/types/partials/AllergyIntoleranceReaction.js +3 -0
- package/lib/src/types/partials/Annotation.d.ts +12 -0
- package/lib/src/types/partials/Annotation.js +3 -0
- package/lib/src/types/partials/Attachment.d.ts +17 -0
- package/lib/src/types/partials/Attachment.js +3 -0
- package/lib/src/types/partials/BundleEntry.d.ts +18 -0
- package/lib/src/types/partials/BundleEntry.js +3 -0
- package/lib/src/types/partials/BundleLink.d.ts +9 -0
- package/lib/src/types/partials/BundleLink.js +3 -0
- package/lib/src/types/partials/BundleRequest.d.ts +14 -0
- package/lib/src/types/partials/BundleRequest.js +3 -0
- package/lib/src/types/partials/BundleResponse.d.ts +14 -0
- package/lib/src/types/partials/BundleResponse.js +3 -0
- package/lib/src/types/partials/BundleSearch.d.ts +9 -0
- package/lib/src/types/partials/BundleSearch.js +3 -0
- package/lib/src/types/partials/CarePlanActivity.d.ts +15 -0
- package/lib/src/types/partials/CarePlanActivity.js +3 -0
- package/lib/src/types/partials/CarePlanDetail.d.ts +33 -0
- package/lib/src/types/partials/CarePlanDetail.js +3 -0
- package/lib/src/types/partials/ClinicalImpressionFinding.d.ts +11 -0
- package/lib/src/types/partials/ClinicalImpressionFinding.js +3 -0
- package/lib/src/types/partials/ClinicalImpressionInvestigation.d.ts +10 -0
- package/lib/src/types/partials/ClinicalImpressionInvestigation.js +3 -0
- package/lib/src/types/partials/CodeableConcept.d.ts +8 -0
- package/lib/src/types/partials/CodeableConcept.js +3 -0
- package/lib/src/types/partials/CodeableReference.d.ts +9 -0
- package/lib/src/types/partials/CodeableReference.js +3 -0
- package/lib/src/types/partials/Coding.d.ts +11 -0
- package/lib/src/types/partials/Coding.js +3 -0
- package/lib/src/types/partials/CompositionAttester.d.ts +11 -0
- package/lib/src/types/partials/CompositionAttester.js +3 -0
- package/lib/src/types/partials/CompositionEvent.d.ts +12 -0
- package/lib/src/types/partials/CompositionEvent.js +3 -0
- package/lib/src/types/partials/CompositionRelatesTo.d.ts +11 -0
- package/lib/src/types/partials/CompositionRelatesTo.js +3 -0
- package/lib/src/types/partials/CompositionSection.d.ts +19 -0
- package/lib/src/types/partials/CompositionSection.js +3 -0
- package/lib/src/types/partials/ConditionEvidence.d.ts +10 -0
- package/lib/src/types/partials/ConditionEvidence.js +3 -0
- package/lib/src/types/partials/ConditionStage.d.ts +11 -0
- package/lib/src/types/partials/ConditionStage.js +3 -0
- package/lib/src/types/partials/ConsentActor.d.ts +10 -0
- package/lib/src/types/partials/ConsentActor.js +3 -0
- package/lib/src/types/partials/ConsentData.d.ts +9 -0
- package/lib/src/types/partials/ConsentData.js +3 -0
- package/lib/src/types/partials/ConsentPolicy.d.ts +9 -0
- package/lib/src/types/partials/ConsentPolicy.js +3 -0
- package/lib/src/types/partials/ConsentProvision.d.ts +22 -0
- package/lib/src/types/partials/ConsentProvision.js +3 -0
- package/lib/src/types/partials/ConsentVerification.d.ts +11 -0
- package/lib/src/types/partials/ConsentVerification.js +3 -0
- package/lib/src/types/partials/ContactDetail.d.ts +8 -0
- package/lib/src/types/partials/ContactDetail.js +3 -0
- package/lib/src/types/partials/ContactPoint.d.ts +12 -0
- package/lib/src/types/partials/ContactPoint.js +3 -0
- package/lib/src/types/partials/Contributor.d.ts +9 -0
- package/lib/src/types/partials/Contributor.js +3 -0
- package/lib/src/types/partials/DataRequirement.d.ts +21 -0
- package/lib/src/types/partials/DataRequirement.js +3 -0
- package/lib/src/types/partials/DataRequirementCodeFilter.d.ts +11 -0
- package/lib/src/types/partials/DataRequirementCodeFilter.js +3 -0
- package/lib/src/types/partials/DataRequirementDateFilter.d.ts +13 -0
- package/lib/src/types/partials/DataRequirementDateFilter.js +3 -0
- package/lib/src/types/partials/DataRequirementSort.d.ts +7 -0
- package/lib/src/types/partials/DataRequirementSort.js +3 -0
- package/lib/src/types/partials/DeviceDeviceName.d.ts +8 -0
- package/lib/src/types/partials/DeviceDeviceName.js +3 -0
- package/lib/src/types/partials/DeviceProperty.d.ts +11 -0
- package/lib/src/types/partials/DeviceProperty.js +3 -0
- package/lib/src/types/partials/DeviceSpecialization.d.ts +9 -0
- package/lib/src/types/partials/DeviceSpecialization.js +3 -0
- package/lib/src/types/partials/DeviceUdiCarrier.d.ts +14 -0
- package/lib/src/types/partials/DeviceUdiCarrier.js +3 -0
- package/lib/src/types/partials/DeviceVersion.d.ts +11 -0
- package/lib/src/types/partials/DeviceVersion.js +3 -0
- package/lib/src/types/partials/DiagnosticReportMedia.d.ts +9 -0
- package/lib/src/types/partials/DiagnosticReportMedia.js +3 -0
- package/lib/src/types/partials/Dosage.d.ts +26 -0
- package/lib/src/types/partials/Dosage.js +3 -0
- package/lib/src/types/partials/DosageDoseAndRate.d.ts +16 -0
- package/lib/src/types/partials/DosageDoseAndRate.js +3 -0
- package/lib/src/types/partials/Expression.d.ts +12 -0
- package/lib/src/types/partials/Expression.js +3 -0
- package/lib/src/types/partials/Extension.d.ts +99 -0
- package/lib/src/types/partials/Extension.js +3 -0
- package/lib/src/types/partials/FamilyMemberHistoryCondition.d.ts +19 -0
- package/lib/src/types/partials/FamilyMemberHistoryCondition.js +3 -0
- package/lib/src/types/partials/HumanName.d.ts +13 -0
- package/lib/src/types/partials/HumanName.js +3 -0
- package/lib/src/types/partials/Identifier.d.ts +15 -0
- package/lib/src/types/partials/Identifier.js +3 -0
- package/lib/src/types/partials/ImmunizationEducation.d.ts +12 -0
- package/lib/src/types/partials/ImmunizationEducation.js +3 -0
- package/lib/src/types/partials/ImmunizationPerformer.d.ts +10 -0
- package/lib/src/types/partials/ImmunizationPerformer.js +3 -0
- package/lib/src/types/partials/ImmunizationProtocolApplied.d.ts +16 -0
- package/lib/src/types/partials/ImmunizationProtocolApplied.js +3 -0
- package/lib/src/types/partials/ImmunizationReaction.d.ts +11 -0
- package/lib/src/types/partials/ImmunizationReaction.js +3 -0
- package/lib/src/types/partials/MedicationBatch.d.ts +9 -0
- package/lib/src/types/partials/MedicationBatch.js +3 -0
- package/lib/src/types/partials/MedicationIngredient.d.ts +13 -0
- package/lib/src/types/partials/MedicationIngredient.js +3 -0
- package/lib/src/types/partials/MedicationRequestDispenseRequest.d.ts +18 -0
- package/lib/src/types/partials/MedicationRequestDispenseRequest.js +3 -0
- package/lib/src/types/partials/MedicationRequestInitialFill.d.ts +9 -0
- package/lib/src/types/partials/MedicationRequestInitialFill.js +3 -0
- package/lib/src/types/partials/MedicationRequestSubstitution.d.ts +10 -0
- package/lib/src/types/partials/MedicationRequestSubstitution.js +3 -0
- package/lib/src/types/partials/Meta.d.ts +16 -0
- package/lib/src/types/partials/Meta.js +3 -0
- package/lib/src/types/partials/Money.d.ts +8 -0
- package/lib/src/types/partials/Money.js +3 -0
- package/lib/src/types/partials/Narrative.d.ts +8 -0
- package/lib/src/types/partials/Narrative.js +3 -0
- package/lib/src/types/partials/ObservationComponent.d.ts +31 -0
- package/lib/src/types/partials/ObservationComponent.js +3 -0
- package/lib/src/types/partials/ObservationReferenceRange.d.ts +15 -0
- package/lib/src/types/partials/ObservationReferenceRange.js +3 -0
- package/lib/src/types/partials/OrganizationContact.d.ts +14 -0
- package/lib/src/types/partials/OrganizationContact.js +3 -0
- package/lib/src/types/partials/ParameterDefinition.d.ts +14 -0
- package/lib/src/types/partials/ParameterDefinition.js +3 -0
- package/lib/src/types/partials/PatientCommunication.d.ts +9 -0
- package/lib/src/types/partials/PatientCommunication.js +3 -0
- package/lib/src/types/partials/PatientContact.d.ts +19 -0
- package/lib/src/types/partials/PatientContact.js +3 -0
- package/lib/src/types/partials/PatientLink.d.ts +9 -0
- package/lib/src/types/partials/PatientLink.js +3 -0
- package/lib/src/types/partials/Period.d.ts +8 -0
- package/lib/src/types/partials/Period.js +3 -0
- package/lib/src/types/partials/ProcedureFocalDevice.d.ts +10 -0
- package/lib/src/types/partials/ProcedureFocalDevice.js +3 -0
- package/lib/src/types/partials/ProcedurePerformer.d.ts +11 -0
- package/lib/src/types/partials/ProcedurePerformer.js +3 -0
- package/lib/src/types/partials/Quantity.d.ts +12 -0
- package/lib/src/types/partials/Quantity.js +3 -0
- package/lib/src/types/partials/Range.d.ts +8 -0
- package/lib/src/types/partials/Range.js +3 -0
- package/lib/src/types/partials/Ratio.d.ts +8 -0
- package/lib/src/types/partials/Ratio.js +3 -0
- package/lib/src/types/partials/RatioRange.d.ts +9 -0
- package/lib/src/types/partials/RatioRange.js +3 -0
- package/lib/src/types/partials/Reference.d.ts +14 -0
- package/lib/src/types/partials/Reference.js +3 -0
- package/lib/src/types/partials/RelatedArtifact.d.ts +16 -0
- package/lib/src/types/partials/RelatedArtifact.js +3 -0
- package/lib/src/types/partials/SampledData.d.ts +15 -0
- package/lib/src/types/partials/SampledData.js +3 -0
- package/lib/src/types/partials/Signature.d.ts +16 -0
- package/lib/src/types/partials/Signature.js +3 -0
- package/lib/src/types/partials/Timing.d.ts +12 -0
- package/lib/src/types/partials/Timing.js +3 -0
- package/lib/src/types/partials/TimingRepeat.d.ts +30 -0
- package/lib/src/types/partials/TimingRepeat.js +3 -0
- package/lib/src/types/partials/TriggerDefinition.d.ts +19 -0
- package/lib/src/types/partials/TriggerDefinition.js +3 -0
- package/lib/src/types/partials/UsageContext.d.ts +15 -0
- package/lib/src/types/partials/UsageContext.js +3 -0
- package/lib/src/types/resources/AllergyIntolerance.d.ts +45 -0
- package/lib/src/types/resources/AllergyIntolerance.js +3 -0
- package/lib/src/types/resources/Bundle.d.ts +22 -0
- package/lib/src/types/resources/Bundle.js +3 -0
- package/lib/src/types/resources/CarePlan.d.ts +47 -0
- package/lib/src/types/resources/CarePlan.js +3 -0
- package/lib/src/types/resources/ClinicalImpression.d.ts +45 -0
- package/lib/src/types/resources/ClinicalImpression.js +3 -0
- package/lib/src/types/resources/Composition.d.ts +39 -0
- package/lib/src/types/resources/Composition.js +3 -0
- package/lib/src/types/resources/Condition.d.ts +51 -0
- package/lib/src/types/resources/Condition.js +3 -0
- package/lib/src/types/resources/Consent.d.ts +38 -0
- package/lib/src/types/resources/Consent.js +3 -0
- package/lib/src/types/resources/Device.d.ts +53 -0
- package/lib/src/types/resources/Device.js +3 -0
- package/lib/src/types/resources/DeviceUseStatement.d.ts +38 -0
- package/lib/src/types/resources/DeviceUseStatement.js +3 -0
- package/lib/src/types/resources/DiagnosticReport.d.ts +43 -0
- package/lib/src/types/resources/DiagnosticReport.js +3 -0
- package/lib/src/types/resources/DomainResource.d.ts +16 -0
- package/lib/src/types/resources/DomainResource.js +3 -0
- package/lib/src/types/resources/FamilyMemberHistory.d.ts +53 -0
- package/lib/src/types/resources/FamilyMemberHistory.js +3 -0
- package/lib/src/types/resources/Immunization.d.ts +56 -0
- package/lib/src/types/resources/Immunization.js +3 -0
- package/lib/src/types/resources/Medication.d.ts +30 -0
- package/lib/src/types/resources/Medication.js +3 -0
- package/lib/src/types/resources/MedicationRequest.d.ts +59 -0
- package/lib/src/types/resources/MedicationRequest.js +3 -0
- package/lib/src/types/resources/MedicationStatement.d.ts +42 -0
- package/lib/src/types/resources/MedicationStatement.js +3 -0
- package/lib/src/types/resources/Observation.d.ts +69 -0
- package/lib/src/types/resources/Observation.js +3 -0
- package/lib/src/types/resources/Organization.d.ts +32 -0
- package/lib/src/types/resources/Organization.js +3 -0
- package/lib/src/types/resources/Patient.d.ts +47 -0
- package/lib/src/types/resources/Patient.js +3 -0
- package/lib/src/types/resources/Procedure.d.ts +59 -0
- package/lib/src/types/resources/Procedure.js +3 -0
- package/lib/src/types/simpleTypes/Base64Binary.d.ts +1 -0
- package/lib/src/types/simpleTypes/Base64Binary.js +2 -0
- package/lib/src/types/simpleTypes/Canonical.d.ts +1 -0
- package/lib/src/types/simpleTypes/Canonical.js +2 -0
- package/lib/src/types/simpleTypes/Date.d.ts +1 -0
- package/lib/src/types/simpleTypes/Date.js +2 -0
- package/lib/src/types/simpleTypes/DateTime.d.ts +1 -0
- package/lib/src/types/simpleTypes/DateTime.js +2 -0
- package/lib/src/types/simpleTypes/Decimal.d.ts +1 -0
- package/lib/src/types/simpleTypes/Decimal.js +2 -0
- package/lib/src/types/simpleTypes/Id.d.ts +1 -0
- package/lib/src/types/simpleTypes/Id.js +2 -0
- package/lib/src/types/simpleTypes/Instant.d.ts +1 -0
- package/lib/src/types/simpleTypes/Instant.js +2 -0
- package/lib/src/types/simpleTypes/Int.d.ts +1 -0
- package/lib/src/types/simpleTypes/Int.js +2 -0
- package/lib/src/types/simpleTypes/Markdown.d.ts +1 -0
- package/lib/src/types/simpleTypes/Markdown.js +2 -0
- package/lib/src/types/simpleTypes/Oid.d.ts +1 -0
- package/lib/src/types/simpleTypes/Oid.js +2 -0
- package/lib/src/types/simpleTypes/ResourceContainer.d.ts +1 -0
- package/lib/src/types/simpleTypes/ResourceContainer.js +2 -0
- package/lib/src/types/simpleTypes/Time.d.ts +1 -0
- package/lib/src/types/simpleTypes/Time.js +2 -0
- package/lib/src/types/simpleTypes/UnsignedInt.d.ts +1 -0
- package/lib/src/types/simpleTypes/UnsignedInt.js +2 -0
- package/lib/src/types/simpleTypes/Uri.d.ts +1 -0
- package/lib/src/types/simpleTypes/Uri.js +2 -0
- package/lib/src/types/simpleTypes/Url.d.ts +1 -0
- package/lib/src/types/simpleTypes/Url.js +2 -0
- package/lib/src/types/simpleTypes/Uuid.d.ts +1 -0
- package/lib/src/types/simpleTypes/Uuid.js +2 -0
- package/lib/src/types/simpleTypes/Xhtml.d.ts +1 -0
- package/lib/src/types/simpleTypes/Xhtml.js +2 -0
- package/lib/test/fhir-summary-bundle/fhir-summary-bundle.test.d.ts +1 -0
- package/lib/test/fhir-summary-bundle/fhir-summary-bundle.test.js +72 -0
- package/lib/test/ips-test/ips.test.d.ts +1 -0
- package/lib/test/ips-test/ips.test.js +389 -0
- package/lib/test/narrativeGenerator/narrativeGenerator.test.d.ts +1 -0
- package/lib/test/narrativeGenerator/narrativeGenerator.test.js +676 -0
- package/lib/test/summary.test.d.ts +1 -0
- package/lib/test/summary.test.js +452 -0
- package/lib/test/utilities/testHelpers.d.ts +21 -0
- package/lib/test/utilities/testHelpers.js +137 -0
- package/package.json +126 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { TMeta } from '../partials/Meta';
|
|
2
|
+
import { TUri } from '../simpleTypes/Uri';
|
|
3
|
+
import { TNarrative } from '../partials/Narrative';
|
|
4
|
+
import { TResourceContainer } from '../simpleTypes/ResourceContainer';
|
|
5
|
+
import { TExtension } from '../partials/Extension';
|
|
6
|
+
import { TIdentifier } from '../partials/Identifier';
|
|
7
|
+
import { THumanName } from '../partials/HumanName';
|
|
8
|
+
import { TContactPoint } from '../partials/ContactPoint';
|
|
9
|
+
import { TDate } from '../simpleTypes/Date';
|
|
10
|
+
import { TDateTime } from '../simpleTypes/DateTime';
|
|
11
|
+
import { TAddress } from '../partials/Address';
|
|
12
|
+
import { TCodeableConcept } from '../partials/CodeableConcept';
|
|
13
|
+
import { TInt } from '../simpleTypes/Int';
|
|
14
|
+
import { TAttachment } from '../partials/Attachment';
|
|
15
|
+
import { TPatientContact } from '../partials/PatientContact';
|
|
16
|
+
import { TPatientCommunication } from '../partials/PatientCommunication';
|
|
17
|
+
import { TReference } from '../partials/Reference';
|
|
18
|
+
import { TPatientLink } from '../partials/PatientLink';
|
|
19
|
+
export type TPatient = {
|
|
20
|
+
resourceType?: string;
|
|
21
|
+
id?: string;
|
|
22
|
+
meta?: TMeta;
|
|
23
|
+
implicitRules?: TUri;
|
|
24
|
+
language?: string;
|
|
25
|
+
text?: TNarrative;
|
|
26
|
+
contained?: TResourceContainer[];
|
|
27
|
+
extension?: TExtension[];
|
|
28
|
+
modifierExtension?: TExtension[];
|
|
29
|
+
identifier?: TIdentifier[];
|
|
30
|
+
active?: boolean;
|
|
31
|
+
name?: THumanName[];
|
|
32
|
+
telecom?: TContactPoint[];
|
|
33
|
+
gender?: string;
|
|
34
|
+
birthDate?: TDate;
|
|
35
|
+
deceasedBoolean?: boolean;
|
|
36
|
+
deceasedDateTime?: TDateTime;
|
|
37
|
+
address?: TAddress[];
|
|
38
|
+
maritalStatus?: TCodeableConcept;
|
|
39
|
+
multipleBirthBoolean?: boolean;
|
|
40
|
+
multipleBirthInteger?: TInt;
|
|
41
|
+
photo?: TAttachment[];
|
|
42
|
+
contact?: TPatientContact[];
|
|
43
|
+
communication?: TPatientCommunication[];
|
|
44
|
+
generalPractitioner?: TReference[];
|
|
45
|
+
managingOrganization?: TReference;
|
|
46
|
+
link?: TPatientLink[];
|
|
47
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { TMeta } from '../partials/Meta';
|
|
2
|
+
import { TUri } from '../simpleTypes/Uri';
|
|
3
|
+
import { TNarrative } from '../partials/Narrative';
|
|
4
|
+
import { TResourceContainer } from '../simpleTypes/ResourceContainer';
|
|
5
|
+
import { TExtension } from '../partials/Extension';
|
|
6
|
+
import { TIdentifier } from '../partials/Identifier';
|
|
7
|
+
import { TCanonical } from '../simpleTypes/Canonical';
|
|
8
|
+
import { TReference } from '../partials/Reference';
|
|
9
|
+
import { TCodeableConcept } from '../partials/CodeableConcept';
|
|
10
|
+
import { TDateTime } from '../simpleTypes/DateTime';
|
|
11
|
+
import { TPeriod } from '../partials/Period';
|
|
12
|
+
import { TQuantity } from '../partials/Quantity';
|
|
13
|
+
import { TRange } from '../partials/Range';
|
|
14
|
+
import { TProcedurePerformer } from '../partials/ProcedurePerformer';
|
|
15
|
+
import { TAnnotation } from '../partials/Annotation';
|
|
16
|
+
import { TProcedureFocalDevice } from '../partials/ProcedureFocalDevice';
|
|
17
|
+
export type TProcedure = {
|
|
18
|
+
resourceType?: string;
|
|
19
|
+
id?: string;
|
|
20
|
+
meta?: TMeta;
|
|
21
|
+
implicitRules?: TUri;
|
|
22
|
+
language?: string;
|
|
23
|
+
text?: TNarrative;
|
|
24
|
+
contained?: TResourceContainer[];
|
|
25
|
+
extension?: TExtension[];
|
|
26
|
+
modifierExtension?: TExtension[];
|
|
27
|
+
identifier?: TIdentifier[];
|
|
28
|
+
instantiatesCanonical?: TCanonical[];
|
|
29
|
+
instantiatesUri?: TUri[];
|
|
30
|
+
basedOn?: TReference[];
|
|
31
|
+
partOf?: TReference[];
|
|
32
|
+
status: string;
|
|
33
|
+
statusReason?: TCodeableConcept;
|
|
34
|
+
category?: TCodeableConcept;
|
|
35
|
+
code?: TCodeableConcept;
|
|
36
|
+
subject: TReference;
|
|
37
|
+
encounter?: TReference;
|
|
38
|
+
performedDateTime?: TDateTime;
|
|
39
|
+
performedPeriod?: TPeriod;
|
|
40
|
+
performedString?: string;
|
|
41
|
+
performedAge?: TQuantity;
|
|
42
|
+
performedRange?: TRange;
|
|
43
|
+
recorder?: TReference;
|
|
44
|
+
asserter?: TReference;
|
|
45
|
+
performer?: TProcedurePerformer[];
|
|
46
|
+
location?: TReference;
|
|
47
|
+
reasonCode?: TCodeableConcept[];
|
|
48
|
+
reasonReference?: TReference[];
|
|
49
|
+
bodySite?: TCodeableConcept[];
|
|
50
|
+
outcome?: TCodeableConcept;
|
|
51
|
+
report?: TReference[];
|
|
52
|
+
complication?: TCodeableConcept[];
|
|
53
|
+
complicationDetail?: TReference[];
|
|
54
|
+
followUp?: TCodeableConcept[];
|
|
55
|
+
note?: TAnnotation[];
|
|
56
|
+
focalDevice?: TProcedureFocalDevice[];
|
|
57
|
+
usedReference?: TReference[];
|
|
58
|
+
usedCode?: TCodeableConcept[];
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TBase64Binary = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TCanonical = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TDate = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TDateTime = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TDecimal = number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TId = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TInstant = string | Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TInt = number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TMarkdown = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TOid = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TResourceContainer = Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TTime = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TUnsignedInt = number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TUri = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TUrl = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TUuid = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TXhtml = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const fs_1 = __importDefault(require("fs"));
|
|
16
|
+
const path_1 = __importDefault(require("path"));
|
|
17
|
+
const fhir_summary_generator_1 = require("../../src/generators/fhir_summary_generator");
|
|
18
|
+
const testHelpers_1 = require("../utilities/testHelpers");
|
|
19
|
+
describe('FHIR Patient Summary Generation', () => {
|
|
20
|
+
it('should generate the correct summary for the Aidbox bundle', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
// Read the test bundle JSON
|
|
22
|
+
const inputBundle = JSON.parse(fs_1.default.readFileSync(path_1.default.join(__dirname, 'fixtures/test-bundle.json'), 'utf-8'));
|
|
23
|
+
const expectedBundle = JSON.parse(fs_1.default.readFileSync(path_1.default.join(__dirname, 'fixtures/expected-bundle.json'), 'utf-8'));
|
|
24
|
+
// Extract resources from the bundle
|
|
25
|
+
const resources = inputBundle.entry.map((e) => e.resource);
|
|
26
|
+
// extract the patient resource
|
|
27
|
+
const mockPatient = resources.find((r) => r.resourceType === 'Patient');
|
|
28
|
+
// Generate the summary
|
|
29
|
+
const builder = new fhir_summary_generator_1.ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
30
|
+
const timezone = 'America/New_York';
|
|
31
|
+
builder.read_bundle(inputBundle, timezone);
|
|
32
|
+
const bundle = builder.build_bundle('example-organization', 'Example Organization', 'https://fhir.icanbwell.com/4_0_0/', timezone);
|
|
33
|
+
console.info('---- Bundle ----');
|
|
34
|
+
console.info(JSON.stringify(bundle, (key, value) => {
|
|
35
|
+
if (value === undefined) {
|
|
36
|
+
return undefined; // This will omit undefined properties
|
|
37
|
+
}
|
|
38
|
+
return value;
|
|
39
|
+
}));
|
|
40
|
+
console.info('-----------------');
|
|
41
|
+
// Compare the generated summary to the expected output in the bundle
|
|
42
|
+
// (Assume the expected output is the Composition resource in the bundle)
|
|
43
|
+
expect(bundle.entry).toBeDefined();
|
|
44
|
+
yield (0, testHelpers_1.compare_bundles)(path_1.default.join(__dirname, 'fixtures/narratives/aidbox'), bundle, expectedBundle);
|
|
45
|
+
}));
|
|
46
|
+
it('should generate the correct summary for the Epic bundle', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
// Read the test bundle JSON
|
|
48
|
+
const inputBundle = JSON.parse(fs_1.default.readFileSync(path_1.default.join(__dirname, 'fixtures/test-epic-bundle.json'), 'utf-8'));
|
|
49
|
+
const expectedBundle = JSON.parse(fs_1.default.readFileSync(path_1.default.join(__dirname, 'fixtures/expected-epic-bundle.json'), 'utf-8'));
|
|
50
|
+
// Extract resources from the bundle
|
|
51
|
+
const resources = inputBundle.entry.map((e) => e.resource);
|
|
52
|
+
// extract the patient resource
|
|
53
|
+
const mockPatient = resources.find((r) => r.resourceType === 'Patient');
|
|
54
|
+
// Generate the summary
|
|
55
|
+
const builder = new fhir_summary_generator_1.ComprehensiveIPSCompositionBuilder().setPatient(mockPatient);
|
|
56
|
+
const timezone = 'America/New_York';
|
|
57
|
+
builder.read_bundle(inputBundle, timezone);
|
|
58
|
+
const bundle = builder.build_bundle('example-organization', 'Example Organization', 'https://fhir.icanbwell.com/4_0_0/', timezone);
|
|
59
|
+
console.info('---- Bundle ----');
|
|
60
|
+
console.info(JSON.stringify(bundle, (key, value) => {
|
|
61
|
+
if (value === undefined) {
|
|
62
|
+
return undefined; // This will omit undefined properties
|
|
63
|
+
}
|
|
64
|
+
return value;
|
|
65
|
+
}));
|
|
66
|
+
console.info('-----------------');
|
|
67
|
+
// Compare the generated summary to the expected output in the bundle
|
|
68
|
+
// (Assume the expected output is the Composition resource in the bundle)
|
|
69
|
+
expect(bundle.entry).toBeDefined();
|
|
70
|
+
yield (0, testHelpers_1.compare_bundles)(path_1.default.join(__dirname, 'fixtures/narratives/epic'), bundle, expectedBundle);
|
|
71
|
+
}));
|
|
72
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|