@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.
Files changed (609) hide show
  1. package/lib/esm/src/generators/fhir_summary_generator.d.ts +46 -0
  2. package/lib/esm/src/generators/fhir_summary_generator.js +224 -0
  3. package/lib/esm/src/generators/narrative_generator.d.ts +40 -0
  4. package/lib/esm/src/generators/narrative_generator.js +76 -0
  5. package/lib/esm/src/narratives/templates/typescript/AdvanceDirectivesTemplate.d.ts +22 -0
  6. package/lib/esm/src/narratives/templates/typescript/AdvanceDirectivesTemplate.js +66 -0
  7. package/lib/esm/src/narratives/templates/typescript/AllergyIntoleranceTemplate.d.ts +31 -0
  8. package/lib/esm/src/narratives/templates/typescript/AllergyIntoleranceTemplate.js +151 -0
  9. package/lib/esm/src/narratives/templates/typescript/ClinicalImpressionTemplate.d.ts +15 -0
  10. package/lib/esm/src/narratives/templates/typescript/ClinicalImpressionTemplate.js +107 -0
  11. package/lib/esm/src/narratives/templates/typescript/DiagnosticResultsTemplate.d.ts +50 -0
  12. package/lib/esm/src/narratives/templates/typescript/DiagnosticResultsTemplate.js +149 -0
  13. package/lib/esm/src/narratives/templates/typescript/FamilyHistoryTemplate.d.ts +15 -0
  14. package/lib/esm/src/narratives/templates/typescript/FamilyHistoryTemplate.js +99 -0
  15. package/lib/esm/src/narratives/templates/typescript/FunctionalStatusTemplate.d.ts +22 -0
  16. package/lib/esm/src/narratives/templates/typescript/FunctionalStatusTemplate.js +66 -0
  17. package/lib/esm/src/narratives/templates/typescript/HistoryOfProceduresTemplate.d.ts +22 -0
  18. package/lib/esm/src/narratives/templates/typescript/HistoryOfProceduresTemplate.js +62 -0
  19. package/lib/esm/src/narratives/templates/typescript/ImmunizationsTemplate.d.ts +22 -0
  20. package/lib/esm/src/narratives/templates/typescript/ImmunizationsTemplate.js +69 -0
  21. package/lib/esm/src/narratives/templates/typescript/MedicalDevicesTemplate.d.ts +22 -0
  22. package/lib/esm/src/narratives/templates/typescript/MedicalDevicesTemplate.js +63 -0
  23. package/lib/esm/src/narratives/templates/typescript/MedicationSummaryTemplate.d.ts +50 -0
  24. package/lib/esm/src/narratives/templates/typescript/MedicationSummaryTemplate.js +202 -0
  25. package/lib/esm/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.d.ts +15 -0
  26. package/lib/esm/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.js +55 -0
  27. package/lib/esm/src/narratives/templates/typescript/PatientTemplate.d.ts +65 -0
  28. package/lib/esm/src/narratives/templates/typescript/PatientTemplate.js +154 -0
  29. package/lib/esm/src/narratives/templates/typescript/PlanOfCareTemplate.d.ts +15 -0
  30. package/lib/esm/src/narratives/templates/typescript/PlanOfCareTemplate.js +59 -0
  31. package/lib/esm/src/narratives/templates/typescript/PregnancyTemplate.d.ts +22 -0
  32. package/lib/esm/src/narratives/templates/typescript/PregnancyTemplate.js +64 -0
  33. package/lib/esm/src/narratives/templates/typescript/ProblemListTemplate.d.ts +22 -0
  34. package/lib/esm/src/narratives/templates/typescript/ProblemListTemplate.js +115 -0
  35. package/lib/esm/src/narratives/templates/typescript/SocialHistoryTemplate.d.ts +22 -0
  36. package/lib/esm/src/narratives/templates/typescript/SocialHistoryTemplate.js +66 -0
  37. package/lib/esm/src/narratives/templates/typescript/TemplateUtilities.d.ts +251 -0
  38. package/lib/esm/src/narratives/templates/typescript/TemplateUtilities.js +692 -0
  39. package/lib/esm/src/narratives/templates/typescript/TypeScriptTemplateMapper.d.ts +17 -0
  40. package/lib/esm/src/narratives/templates/typescript/TypeScriptTemplateMapper.js +60 -0
  41. package/lib/esm/src/narratives/templates/typescript/VitalSignsTemplate.d.ts +22 -0
  42. package/lib/esm/src/narratives/templates/typescript/VitalSignsTemplate.js +70 -0
  43. package/lib/esm/src/narratives/templates/typescript/interfaces/ITemplate.d.ts +13 -0
  44. package/lib/esm/src/narratives/templates/typescript/interfaces/ITemplate.js +1 -0
  45. package/lib/esm/src/profiles/ips_resource_profile_registry.d.ts +7 -0
  46. package/lib/esm/src/profiles/ips_resource_profile_registry.js +139 -0
  47. package/lib/esm/src/structures/ips_mandatory_sections.d.ts +7 -0
  48. package/lib/esm/src/structures/ips_mandatory_sections.js +8 -0
  49. package/lib/esm/src/structures/ips_recommended_sections.d.ts +8 -0
  50. package/lib/esm/src/structures/ips_recommended_sections.js +9 -0
  51. package/lib/esm/src/structures/ips_resource_profile.d.ts +7 -0
  52. package/lib/esm/src/structures/ips_resource_profile.js +1 -0
  53. package/lib/esm/src/structures/ips_section_loinc_codes.d.ts +4 -0
  54. package/lib/esm/src/structures/ips_section_loinc_codes.js +44 -0
  55. package/lib/esm/src/structures/ips_section_resource_map.d.ts +8 -0
  56. package/lib/esm/src/structures/ips_section_resource_map.js +65 -0
  57. package/lib/esm/src/structures/ips_sections.d.ts +19 -0
  58. package/lib/esm/src/structures/ips_sections.js +24 -0
  59. package/lib/esm/src/types/partials/Address.d.ts +16 -0
  60. package/lib/esm/src/types/partials/Address.js +2 -0
  61. package/lib/esm/src/types/partials/AllergyIntoleranceReaction.d.ts +16 -0
  62. package/lib/esm/src/types/partials/AllergyIntoleranceReaction.js +2 -0
  63. package/lib/esm/src/types/partials/Annotation.d.ts +12 -0
  64. package/lib/esm/src/types/partials/Annotation.js +2 -0
  65. package/lib/esm/src/types/partials/Attachment.d.ts +17 -0
  66. package/lib/esm/src/types/partials/Attachment.js +2 -0
  67. package/lib/esm/src/types/partials/BundleEntry.d.ts +18 -0
  68. package/lib/esm/src/types/partials/BundleEntry.js +2 -0
  69. package/lib/esm/src/types/partials/BundleLink.d.ts +9 -0
  70. package/lib/esm/src/types/partials/BundleLink.js +2 -0
  71. package/lib/esm/src/types/partials/BundleRequest.d.ts +14 -0
  72. package/lib/esm/src/types/partials/BundleRequest.js +2 -0
  73. package/lib/esm/src/types/partials/BundleResponse.d.ts +14 -0
  74. package/lib/esm/src/types/partials/BundleResponse.js +2 -0
  75. package/lib/esm/src/types/partials/BundleSearch.d.ts +9 -0
  76. package/lib/esm/src/types/partials/BundleSearch.js +2 -0
  77. package/lib/esm/src/types/partials/CarePlanActivity.d.ts +15 -0
  78. package/lib/esm/src/types/partials/CarePlanActivity.js +2 -0
  79. package/lib/esm/src/types/partials/CarePlanDetail.d.ts +33 -0
  80. package/lib/esm/src/types/partials/CarePlanDetail.js +2 -0
  81. package/lib/esm/src/types/partials/ClinicalImpressionFinding.d.ts +11 -0
  82. package/lib/esm/src/types/partials/ClinicalImpressionFinding.js +2 -0
  83. package/lib/esm/src/types/partials/ClinicalImpressionInvestigation.d.ts +10 -0
  84. package/lib/esm/src/types/partials/ClinicalImpressionInvestigation.js +2 -0
  85. package/lib/esm/src/types/partials/CodeableConcept.d.ts +8 -0
  86. package/lib/esm/src/types/partials/CodeableConcept.js +2 -0
  87. package/lib/esm/src/types/partials/CodeableReference.d.ts +9 -0
  88. package/lib/esm/src/types/partials/CodeableReference.js +2 -0
  89. package/lib/esm/src/types/partials/Coding.d.ts +11 -0
  90. package/lib/esm/src/types/partials/Coding.js +2 -0
  91. package/lib/esm/src/types/partials/CompositionAttester.d.ts +11 -0
  92. package/lib/esm/src/types/partials/CompositionAttester.js +2 -0
  93. package/lib/esm/src/types/partials/CompositionEvent.d.ts +12 -0
  94. package/lib/esm/src/types/partials/CompositionEvent.js +2 -0
  95. package/lib/esm/src/types/partials/CompositionRelatesTo.d.ts +11 -0
  96. package/lib/esm/src/types/partials/CompositionRelatesTo.js +2 -0
  97. package/lib/esm/src/types/partials/CompositionSection.d.ts +19 -0
  98. package/lib/esm/src/types/partials/CompositionSection.js +2 -0
  99. package/lib/esm/src/types/partials/ConditionEvidence.d.ts +10 -0
  100. package/lib/esm/src/types/partials/ConditionEvidence.js +2 -0
  101. package/lib/esm/src/types/partials/ConditionStage.d.ts +11 -0
  102. package/lib/esm/src/types/partials/ConditionStage.js +2 -0
  103. package/lib/esm/src/types/partials/ConsentActor.d.ts +10 -0
  104. package/lib/esm/src/types/partials/ConsentActor.js +2 -0
  105. package/lib/esm/src/types/partials/ConsentData.d.ts +9 -0
  106. package/lib/esm/src/types/partials/ConsentData.js +2 -0
  107. package/lib/esm/src/types/partials/ConsentPolicy.d.ts +9 -0
  108. package/lib/esm/src/types/partials/ConsentPolicy.js +2 -0
  109. package/lib/esm/src/types/partials/ConsentProvision.d.ts +22 -0
  110. package/lib/esm/src/types/partials/ConsentProvision.js +2 -0
  111. package/lib/esm/src/types/partials/ConsentVerification.d.ts +11 -0
  112. package/lib/esm/src/types/partials/ConsentVerification.js +2 -0
  113. package/lib/esm/src/types/partials/ContactDetail.d.ts +8 -0
  114. package/lib/esm/src/types/partials/ContactDetail.js +2 -0
  115. package/lib/esm/src/types/partials/ContactPoint.d.ts +12 -0
  116. package/lib/esm/src/types/partials/ContactPoint.js +2 -0
  117. package/lib/esm/src/types/partials/Contributor.d.ts +9 -0
  118. package/lib/esm/src/types/partials/Contributor.js +2 -0
  119. package/lib/esm/src/types/partials/DataRequirement.d.ts +21 -0
  120. package/lib/esm/src/types/partials/DataRequirement.js +2 -0
  121. package/lib/esm/src/types/partials/DataRequirementCodeFilter.d.ts +11 -0
  122. package/lib/esm/src/types/partials/DataRequirementCodeFilter.js +2 -0
  123. package/lib/esm/src/types/partials/DataRequirementDateFilter.d.ts +13 -0
  124. package/lib/esm/src/types/partials/DataRequirementDateFilter.js +2 -0
  125. package/lib/esm/src/types/partials/DataRequirementSort.d.ts +7 -0
  126. package/lib/esm/src/types/partials/DataRequirementSort.js +2 -0
  127. package/lib/esm/src/types/partials/DeviceDeviceName.d.ts +8 -0
  128. package/lib/esm/src/types/partials/DeviceDeviceName.js +2 -0
  129. package/lib/esm/src/types/partials/DeviceProperty.d.ts +11 -0
  130. package/lib/esm/src/types/partials/DeviceProperty.js +2 -0
  131. package/lib/esm/src/types/partials/DeviceSpecialization.d.ts +9 -0
  132. package/lib/esm/src/types/partials/DeviceSpecialization.js +2 -0
  133. package/lib/esm/src/types/partials/DeviceUdiCarrier.d.ts +14 -0
  134. package/lib/esm/src/types/partials/DeviceUdiCarrier.js +2 -0
  135. package/lib/esm/src/types/partials/DeviceVersion.d.ts +11 -0
  136. package/lib/esm/src/types/partials/DeviceVersion.js +2 -0
  137. package/lib/esm/src/types/partials/DiagnosticReportMedia.d.ts +9 -0
  138. package/lib/esm/src/types/partials/DiagnosticReportMedia.js +2 -0
  139. package/lib/esm/src/types/partials/Dosage.d.ts +26 -0
  140. package/lib/esm/src/types/partials/Dosage.js +2 -0
  141. package/lib/esm/src/types/partials/DosageDoseAndRate.d.ts +16 -0
  142. package/lib/esm/src/types/partials/DosageDoseAndRate.js +2 -0
  143. package/lib/esm/src/types/partials/Expression.d.ts +12 -0
  144. package/lib/esm/src/types/partials/Expression.js +2 -0
  145. package/lib/esm/src/types/partials/Extension.d.ts +99 -0
  146. package/lib/esm/src/types/partials/Extension.js +2 -0
  147. package/lib/esm/src/types/partials/FamilyMemberHistoryCondition.d.ts +19 -0
  148. package/lib/esm/src/types/partials/FamilyMemberHistoryCondition.js +2 -0
  149. package/lib/esm/src/types/partials/HumanName.d.ts +13 -0
  150. package/lib/esm/src/types/partials/HumanName.js +2 -0
  151. package/lib/esm/src/types/partials/Identifier.d.ts +15 -0
  152. package/lib/esm/src/types/partials/Identifier.js +2 -0
  153. package/lib/esm/src/types/partials/ImmunizationEducation.d.ts +12 -0
  154. package/lib/esm/src/types/partials/ImmunizationEducation.js +2 -0
  155. package/lib/esm/src/types/partials/ImmunizationPerformer.d.ts +10 -0
  156. package/lib/esm/src/types/partials/ImmunizationPerformer.js +2 -0
  157. package/lib/esm/src/types/partials/ImmunizationProtocolApplied.d.ts +16 -0
  158. package/lib/esm/src/types/partials/ImmunizationProtocolApplied.js +2 -0
  159. package/lib/esm/src/types/partials/ImmunizationReaction.d.ts +11 -0
  160. package/lib/esm/src/types/partials/ImmunizationReaction.js +2 -0
  161. package/lib/esm/src/types/partials/MedicationBatch.d.ts +9 -0
  162. package/lib/esm/src/types/partials/MedicationBatch.js +2 -0
  163. package/lib/esm/src/types/partials/MedicationIngredient.d.ts +13 -0
  164. package/lib/esm/src/types/partials/MedicationIngredient.js +2 -0
  165. package/lib/esm/src/types/partials/MedicationRequestDispenseRequest.d.ts +18 -0
  166. package/lib/esm/src/types/partials/MedicationRequestDispenseRequest.js +2 -0
  167. package/lib/esm/src/types/partials/MedicationRequestInitialFill.d.ts +9 -0
  168. package/lib/esm/src/types/partials/MedicationRequestInitialFill.js +2 -0
  169. package/lib/esm/src/types/partials/MedicationRequestSubstitution.d.ts +10 -0
  170. package/lib/esm/src/types/partials/MedicationRequestSubstitution.js +2 -0
  171. package/lib/esm/src/types/partials/Meta.d.ts +16 -0
  172. package/lib/esm/src/types/partials/Meta.js +2 -0
  173. package/lib/esm/src/types/partials/Money.d.ts +8 -0
  174. package/lib/esm/src/types/partials/Money.js +2 -0
  175. package/lib/esm/src/types/partials/Narrative.d.ts +8 -0
  176. package/lib/esm/src/types/partials/Narrative.js +2 -0
  177. package/lib/esm/src/types/partials/ObservationComponent.d.ts +31 -0
  178. package/lib/esm/src/types/partials/ObservationComponent.js +2 -0
  179. package/lib/esm/src/types/partials/ObservationReferenceRange.d.ts +15 -0
  180. package/lib/esm/src/types/partials/ObservationReferenceRange.js +2 -0
  181. package/lib/esm/src/types/partials/OrganizationContact.d.ts +14 -0
  182. package/lib/esm/src/types/partials/OrganizationContact.js +2 -0
  183. package/lib/esm/src/types/partials/ParameterDefinition.d.ts +14 -0
  184. package/lib/esm/src/types/partials/ParameterDefinition.js +2 -0
  185. package/lib/esm/src/types/partials/PatientCommunication.d.ts +9 -0
  186. package/lib/esm/src/types/partials/PatientCommunication.js +2 -0
  187. package/lib/esm/src/types/partials/PatientContact.d.ts +19 -0
  188. package/lib/esm/src/types/partials/PatientContact.js +2 -0
  189. package/lib/esm/src/types/partials/PatientLink.d.ts +9 -0
  190. package/lib/esm/src/types/partials/PatientLink.js +2 -0
  191. package/lib/esm/src/types/partials/Period.d.ts +8 -0
  192. package/lib/esm/src/types/partials/Period.js +2 -0
  193. package/lib/esm/src/types/partials/ProcedureFocalDevice.d.ts +10 -0
  194. package/lib/esm/src/types/partials/ProcedureFocalDevice.js +2 -0
  195. package/lib/esm/src/types/partials/ProcedurePerformer.d.ts +11 -0
  196. package/lib/esm/src/types/partials/ProcedurePerformer.js +2 -0
  197. package/lib/esm/src/types/partials/Quantity.d.ts +12 -0
  198. package/lib/esm/src/types/partials/Quantity.js +2 -0
  199. package/lib/esm/src/types/partials/Range.d.ts +8 -0
  200. package/lib/esm/src/types/partials/Range.js +2 -0
  201. package/lib/esm/src/types/partials/Ratio.d.ts +8 -0
  202. package/lib/esm/src/types/partials/Ratio.js +2 -0
  203. package/lib/esm/src/types/partials/RatioRange.d.ts +9 -0
  204. package/lib/esm/src/types/partials/RatioRange.js +2 -0
  205. package/lib/esm/src/types/partials/Reference.d.ts +14 -0
  206. package/lib/esm/src/types/partials/Reference.js +2 -0
  207. package/lib/esm/src/types/partials/RelatedArtifact.d.ts +16 -0
  208. package/lib/esm/src/types/partials/RelatedArtifact.js +2 -0
  209. package/lib/esm/src/types/partials/SampledData.d.ts +15 -0
  210. package/lib/esm/src/types/partials/SampledData.js +2 -0
  211. package/lib/esm/src/types/partials/Signature.d.ts +16 -0
  212. package/lib/esm/src/types/partials/Signature.js +2 -0
  213. package/lib/esm/src/types/partials/Timing.d.ts +12 -0
  214. package/lib/esm/src/types/partials/Timing.js +2 -0
  215. package/lib/esm/src/types/partials/TimingRepeat.d.ts +30 -0
  216. package/lib/esm/src/types/partials/TimingRepeat.js +2 -0
  217. package/lib/esm/src/types/partials/TriggerDefinition.d.ts +19 -0
  218. package/lib/esm/src/types/partials/TriggerDefinition.js +2 -0
  219. package/lib/esm/src/types/partials/UsageContext.d.ts +15 -0
  220. package/lib/esm/src/types/partials/UsageContext.js +2 -0
  221. package/lib/esm/src/types/resources/AllergyIntolerance.d.ts +45 -0
  222. package/lib/esm/src/types/resources/AllergyIntolerance.js +2 -0
  223. package/lib/esm/src/types/resources/Bundle.d.ts +22 -0
  224. package/lib/esm/src/types/resources/Bundle.js +2 -0
  225. package/lib/esm/src/types/resources/CarePlan.d.ts +47 -0
  226. package/lib/esm/src/types/resources/CarePlan.js +2 -0
  227. package/lib/esm/src/types/resources/ClinicalImpression.d.ts +45 -0
  228. package/lib/esm/src/types/resources/ClinicalImpression.js +2 -0
  229. package/lib/esm/src/types/resources/Composition.d.ts +39 -0
  230. package/lib/esm/src/types/resources/Composition.js +2 -0
  231. package/lib/esm/src/types/resources/Condition.d.ts +51 -0
  232. package/lib/esm/src/types/resources/Condition.js +2 -0
  233. package/lib/esm/src/types/resources/Consent.d.ts +38 -0
  234. package/lib/esm/src/types/resources/Consent.js +2 -0
  235. package/lib/esm/src/types/resources/Device.d.ts +53 -0
  236. package/lib/esm/src/types/resources/Device.js +2 -0
  237. package/lib/esm/src/types/resources/DeviceUseStatement.d.ts +38 -0
  238. package/lib/esm/src/types/resources/DeviceUseStatement.js +2 -0
  239. package/lib/esm/src/types/resources/DiagnosticReport.d.ts +43 -0
  240. package/lib/esm/src/types/resources/DiagnosticReport.js +2 -0
  241. package/lib/esm/src/types/resources/DomainResource.d.ts +16 -0
  242. package/lib/esm/src/types/resources/DomainResource.js +2 -0
  243. package/lib/esm/src/types/resources/FamilyMemberHistory.d.ts +53 -0
  244. package/lib/esm/src/types/resources/FamilyMemberHistory.js +2 -0
  245. package/lib/esm/src/types/resources/Immunization.d.ts +56 -0
  246. package/lib/esm/src/types/resources/Immunization.js +2 -0
  247. package/lib/esm/src/types/resources/Medication.d.ts +30 -0
  248. package/lib/esm/src/types/resources/Medication.js +2 -0
  249. package/lib/esm/src/types/resources/MedicationRequest.d.ts +59 -0
  250. package/lib/esm/src/types/resources/MedicationRequest.js +2 -0
  251. package/lib/esm/src/types/resources/MedicationStatement.d.ts +42 -0
  252. package/lib/esm/src/types/resources/MedicationStatement.js +2 -0
  253. package/lib/esm/src/types/resources/Observation.d.ts +69 -0
  254. package/lib/esm/src/types/resources/Observation.js +2 -0
  255. package/lib/esm/src/types/resources/Organization.d.ts +32 -0
  256. package/lib/esm/src/types/resources/Organization.js +2 -0
  257. package/lib/esm/src/types/resources/Patient.d.ts +47 -0
  258. package/lib/esm/src/types/resources/Patient.js +2 -0
  259. package/lib/esm/src/types/resources/Procedure.d.ts +59 -0
  260. package/lib/esm/src/types/resources/Procedure.js +2 -0
  261. package/lib/esm/src/types/simpleTypes/Base64Binary.d.ts +1 -0
  262. package/lib/esm/src/types/simpleTypes/Base64Binary.js +1 -0
  263. package/lib/esm/src/types/simpleTypes/Canonical.d.ts +1 -0
  264. package/lib/esm/src/types/simpleTypes/Canonical.js +1 -0
  265. package/lib/esm/src/types/simpleTypes/Date.d.ts +1 -0
  266. package/lib/esm/src/types/simpleTypes/Date.js +1 -0
  267. package/lib/esm/src/types/simpleTypes/DateTime.d.ts +1 -0
  268. package/lib/esm/src/types/simpleTypes/DateTime.js +1 -0
  269. package/lib/esm/src/types/simpleTypes/Decimal.d.ts +1 -0
  270. package/lib/esm/src/types/simpleTypes/Decimal.js +1 -0
  271. package/lib/esm/src/types/simpleTypes/Id.d.ts +1 -0
  272. package/lib/esm/src/types/simpleTypes/Id.js +1 -0
  273. package/lib/esm/src/types/simpleTypes/Instant.d.ts +1 -0
  274. package/lib/esm/src/types/simpleTypes/Instant.js +1 -0
  275. package/lib/esm/src/types/simpleTypes/Int.d.ts +1 -0
  276. package/lib/esm/src/types/simpleTypes/Int.js +1 -0
  277. package/lib/esm/src/types/simpleTypes/Markdown.d.ts +1 -0
  278. package/lib/esm/src/types/simpleTypes/Markdown.js +1 -0
  279. package/lib/esm/src/types/simpleTypes/Oid.d.ts +1 -0
  280. package/lib/esm/src/types/simpleTypes/Oid.js +1 -0
  281. package/lib/esm/src/types/simpleTypes/ResourceContainer.d.ts +1 -0
  282. package/lib/esm/src/types/simpleTypes/ResourceContainer.js +1 -0
  283. package/lib/esm/src/types/simpleTypes/Time.d.ts +1 -0
  284. package/lib/esm/src/types/simpleTypes/Time.js +1 -0
  285. package/lib/esm/src/types/simpleTypes/UnsignedInt.d.ts +1 -0
  286. package/lib/esm/src/types/simpleTypes/UnsignedInt.js +1 -0
  287. package/lib/esm/src/types/simpleTypes/Uri.d.ts +1 -0
  288. package/lib/esm/src/types/simpleTypes/Uri.js +1 -0
  289. package/lib/esm/src/types/simpleTypes/Url.d.ts +1 -0
  290. package/lib/esm/src/types/simpleTypes/Url.js +1 -0
  291. package/lib/esm/src/types/simpleTypes/Uuid.d.ts +1 -0
  292. package/lib/esm/src/types/simpleTypes/Uuid.js +1 -0
  293. package/lib/esm/src/types/simpleTypes/Xhtml.d.ts +1 -0
  294. package/lib/esm/src/types/simpleTypes/Xhtml.js +1 -0
  295. package/lib/esm/test/fhir-summary-bundle/fhir-summary-bundle.test.d.ts +1 -0
  296. package/lib/esm/test/fhir-summary-bundle/fhir-summary-bundle.test.js +67 -0
  297. package/lib/esm/test/ips-test/ips.test.d.ts +1 -0
  298. package/lib/esm/test/ips-test/ips.test.js +387 -0
  299. package/lib/esm/test/narrativeGenerator/narrativeGenerator.test.d.ts +1 -0
  300. package/lib/esm/test/narrativeGenerator/narrativeGenerator.test.js +641 -0
  301. package/lib/esm/test/summary.test.d.ts +1 -0
  302. package/lib/esm/test/summary.test.js +450 -0
  303. package/lib/esm/test/utilities/testHelpers.d.ts +21 -0
  304. package/lib/esm/test/utilities/testHelpers.js +129 -0
  305. package/package.json +11 -3
  306. /package/lib/{src → cjs/src}/generators/fhir_summary_generator.d.ts +0 -0
  307. /package/lib/{src → cjs/src}/generators/fhir_summary_generator.js +0 -0
  308. /package/lib/{src → cjs/src}/generators/narrative_generator.d.ts +0 -0
  309. /package/lib/{src → cjs/src}/generators/narrative_generator.js +0 -0
  310. /package/lib/{src → cjs/src}/narratives/templates/typescript/AdvanceDirectivesTemplate.d.ts +0 -0
  311. /package/lib/{src → cjs/src}/narratives/templates/typescript/AdvanceDirectivesTemplate.js +0 -0
  312. /package/lib/{src → cjs/src}/narratives/templates/typescript/AllergyIntoleranceTemplate.d.ts +0 -0
  313. /package/lib/{src → cjs/src}/narratives/templates/typescript/AllergyIntoleranceTemplate.js +0 -0
  314. /package/lib/{src → cjs/src}/narratives/templates/typescript/ClinicalImpressionTemplate.d.ts +0 -0
  315. /package/lib/{src → cjs/src}/narratives/templates/typescript/ClinicalImpressionTemplate.js +0 -0
  316. /package/lib/{src → cjs/src}/narratives/templates/typescript/DiagnosticResultsTemplate.d.ts +0 -0
  317. /package/lib/{src → cjs/src}/narratives/templates/typescript/DiagnosticResultsTemplate.js +0 -0
  318. /package/lib/{src → cjs/src}/narratives/templates/typescript/FamilyHistoryTemplate.d.ts +0 -0
  319. /package/lib/{src → cjs/src}/narratives/templates/typescript/FamilyHistoryTemplate.js +0 -0
  320. /package/lib/{src → cjs/src}/narratives/templates/typescript/FunctionalStatusTemplate.d.ts +0 -0
  321. /package/lib/{src → cjs/src}/narratives/templates/typescript/FunctionalStatusTemplate.js +0 -0
  322. /package/lib/{src → cjs/src}/narratives/templates/typescript/HistoryOfProceduresTemplate.d.ts +0 -0
  323. /package/lib/{src → cjs/src}/narratives/templates/typescript/HistoryOfProceduresTemplate.js +0 -0
  324. /package/lib/{src → cjs/src}/narratives/templates/typescript/ImmunizationsTemplate.d.ts +0 -0
  325. /package/lib/{src → cjs/src}/narratives/templates/typescript/ImmunizationsTemplate.js +0 -0
  326. /package/lib/{src → cjs/src}/narratives/templates/typescript/MedicalDevicesTemplate.d.ts +0 -0
  327. /package/lib/{src → cjs/src}/narratives/templates/typescript/MedicalDevicesTemplate.js +0 -0
  328. /package/lib/{src → cjs/src}/narratives/templates/typescript/MedicationSummaryTemplate.d.ts +0 -0
  329. /package/lib/{src → cjs/src}/narratives/templates/typescript/MedicationSummaryTemplate.js +0 -0
  330. /package/lib/{src → cjs/src}/narratives/templates/typescript/PastHistoryOfIllnessTemplate.d.ts +0 -0
  331. /package/lib/{src → cjs/src}/narratives/templates/typescript/PastHistoryOfIllnessTemplate.js +0 -0
  332. /package/lib/{src → cjs/src}/narratives/templates/typescript/PatientTemplate.d.ts +0 -0
  333. /package/lib/{src → cjs/src}/narratives/templates/typescript/PatientTemplate.js +0 -0
  334. /package/lib/{src → cjs/src}/narratives/templates/typescript/PlanOfCareTemplate.d.ts +0 -0
  335. /package/lib/{src → cjs/src}/narratives/templates/typescript/PlanOfCareTemplate.js +0 -0
  336. /package/lib/{src → cjs/src}/narratives/templates/typescript/PregnancyTemplate.d.ts +0 -0
  337. /package/lib/{src → cjs/src}/narratives/templates/typescript/PregnancyTemplate.js +0 -0
  338. /package/lib/{src → cjs/src}/narratives/templates/typescript/ProblemListTemplate.d.ts +0 -0
  339. /package/lib/{src → cjs/src}/narratives/templates/typescript/ProblemListTemplate.js +0 -0
  340. /package/lib/{src → cjs/src}/narratives/templates/typescript/SocialHistoryTemplate.d.ts +0 -0
  341. /package/lib/{src → cjs/src}/narratives/templates/typescript/SocialHistoryTemplate.js +0 -0
  342. /package/lib/{src → cjs/src}/narratives/templates/typescript/TemplateUtilities.d.ts +0 -0
  343. /package/lib/{src → cjs/src}/narratives/templates/typescript/TemplateUtilities.js +0 -0
  344. /package/lib/{src → cjs/src}/narratives/templates/typescript/TypeScriptTemplateMapper.d.ts +0 -0
  345. /package/lib/{src → cjs/src}/narratives/templates/typescript/TypeScriptTemplateMapper.js +0 -0
  346. /package/lib/{src → cjs/src}/narratives/templates/typescript/VitalSignsTemplate.d.ts +0 -0
  347. /package/lib/{src → cjs/src}/narratives/templates/typescript/VitalSignsTemplate.js +0 -0
  348. /package/lib/{src → cjs/src}/narratives/templates/typescript/interfaces/ITemplate.d.ts +0 -0
  349. /package/lib/{src → cjs/src}/narratives/templates/typescript/interfaces/ITemplate.js +0 -0
  350. /package/lib/{src → cjs/src}/profiles/ips_resource_profile_registry.d.ts +0 -0
  351. /package/lib/{src → cjs/src}/profiles/ips_resource_profile_registry.js +0 -0
  352. /package/lib/{src → cjs/src}/structures/ips_mandatory_sections.d.ts +0 -0
  353. /package/lib/{src → cjs/src}/structures/ips_mandatory_sections.js +0 -0
  354. /package/lib/{src → cjs/src}/structures/ips_recommended_sections.d.ts +0 -0
  355. /package/lib/{src → cjs/src}/structures/ips_recommended_sections.js +0 -0
  356. /package/lib/{src → cjs/src}/structures/ips_resource_profile.d.ts +0 -0
  357. /package/lib/{src → cjs/src}/structures/ips_resource_profile.js +0 -0
  358. /package/lib/{src → cjs/src}/structures/ips_section_loinc_codes.d.ts +0 -0
  359. /package/lib/{src → cjs/src}/structures/ips_section_loinc_codes.js +0 -0
  360. /package/lib/{src → cjs/src}/structures/ips_section_resource_map.d.ts +0 -0
  361. /package/lib/{src → cjs/src}/structures/ips_section_resource_map.js +0 -0
  362. /package/lib/{src → cjs/src}/structures/ips_sections.d.ts +0 -0
  363. /package/lib/{src → cjs/src}/structures/ips_sections.js +0 -0
  364. /package/lib/{src → cjs/src}/types/partials/Address.d.ts +0 -0
  365. /package/lib/{src → cjs/src}/types/partials/Address.js +0 -0
  366. /package/lib/{src → cjs/src}/types/partials/AllergyIntoleranceReaction.d.ts +0 -0
  367. /package/lib/{src → cjs/src}/types/partials/AllergyIntoleranceReaction.js +0 -0
  368. /package/lib/{src → cjs/src}/types/partials/Annotation.d.ts +0 -0
  369. /package/lib/{src → cjs/src}/types/partials/Annotation.js +0 -0
  370. /package/lib/{src → cjs/src}/types/partials/Attachment.d.ts +0 -0
  371. /package/lib/{src → cjs/src}/types/partials/Attachment.js +0 -0
  372. /package/lib/{src → cjs/src}/types/partials/BundleEntry.d.ts +0 -0
  373. /package/lib/{src → cjs/src}/types/partials/BundleEntry.js +0 -0
  374. /package/lib/{src → cjs/src}/types/partials/BundleLink.d.ts +0 -0
  375. /package/lib/{src → cjs/src}/types/partials/BundleLink.js +0 -0
  376. /package/lib/{src → cjs/src}/types/partials/BundleRequest.d.ts +0 -0
  377. /package/lib/{src → cjs/src}/types/partials/BundleRequest.js +0 -0
  378. /package/lib/{src → cjs/src}/types/partials/BundleResponse.d.ts +0 -0
  379. /package/lib/{src → cjs/src}/types/partials/BundleResponse.js +0 -0
  380. /package/lib/{src → cjs/src}/types/partials/BundleSearch.d.ts +0 -0
  381. /package/lib/{src → cjs/src}/types/partials/BundleSearch.js +0 -0
  382. /package/lib/{src → cjs/src}/types/partials/CarePlanActivity.d.ts +0 -0
  383. /package/lib/{src → cjs/src}/types/partials/CarePlanActivity.js +0 -0
  384. /package/lib/{src → cjs/src}/types/partials/CarePlanDetail.d.ts +0 -0
  385. /package/lib/{src → cjs/src}/types/partials/CarePlanDetail.js +0 -0
  386. /package/lib/{src → cjs/src}/types/partials/ClinicalImpressionFinding.d.ts +0 -0
  387. /package/lib/{src → cjs/src}/types/partials/ClinicalImpressionFinding.js +0 -0
  388. /package/lib/{src → cjs/src}/types/partials/ClinicalImpressionInvestigation.d.ts +0 -0
  389. /package/lib/{src → cjs/src}/types/partials/ClinicalImpressionInvestigation.js +0 -0
  390. /package/lib/{src → cjs/src}/types/partials/CodeableConcept.d.ts +0 -0
  391. /package/lib/{src → cjs/src}/types/partials/CodeableConcept.js +0 -0
  392. /package/lib/{src → cjs/src}/types/partials/CodeableReference.d.ts +0 -0
  393. /package/lib/{src → cjs/src}/types/partials/CodeableReference.js +0 -0
  394. /package/lib/{src → cjs/src}/types/partials/Coding.d.ts +0 -0
  395. /package/lib/{src → cjs/src}/types/partials/Coding.js +0 -0
  396. /package/lib/{src → cjs/src}/types/partials/CompositionAttester.d.ts +0 -0
  397. /package/lib/{src → cjs/src}/types/partials/CompositionAttester.js +0 -0
  398. /package/lib/{src → cjs/src}/types/partials/CompositionEvent.d.ts +0 -0
  399. /package/lib/{src → cjs/src}/types/partials/CompositionEvent.js +0 -0
  400. /package/lib/{src → cjs/src}/types/partials/CompositionRelatesTo.d.ts +0 -0
  401. /package/lib/{src → cjs/src}/types/partials/CompositionRelatesTo.js +0 -0
  402. /package/lib/{src → cjs/src}/types/partials/CompositionSection.d.ts +0 -0
  403. /package/lib/{src → cjs/src}/types/partials/CompositionSection.js +0 -0
  404. /package/lib/{src → cjs/src}/types/partials/ConditionEvidence.d.ts +0 -0
  405. /package/lib/{src → cjs/src}/types/partials/ConditionEvidence.js +0 -0
  406. /package/lib/{src → cjs/src}/types/partials/ConditionStage.d.ts +0 -0
  407. /package/lib/{src → cjs/src}/types/partials/ConditionStage.js +0 -0
  408. /package/lib/{src → cjs/src}/types/partials/ConsentActor.d.ts +0 -0
  409. /package/lib/{src → cjs/src}/types/partials/ConsentActor.js +0 -0
  410. /package/lib/{src → cjs/src}/types/partials/ConsentData.d.ts +0 -0
  411. /package/lib/{src → cjs/src}/types/partials/ConsentData.js +0 -0
  412. /package/lib/{src → cjs/src}/types/partials/ConsentPolicy.d.ts +0 -0
  413. /package/lib/{src → cjs/src}/types/partials/ConsentPolicy.js +0 -0
  414. /package/lib/{src → cjs/src}/types/partials/ConsentProvision.d.ts +0 -0
  415. /package/lib/{src → cjs/src}/types/partials/ConsentProvision.js +0 -0
  416. /package/lib/{src → cjs/src}/types/partials/ConsentVerification.d.ts +0 -0
  417. /package/lib/{src → cjs/src}/types/partials/ConsentVerification.js +0 -0
  418. /package/lib/{src → cjs/src}/types/partials/ContactDetail.d.ts +0 -0
  419. /package/lib/{src → cjs/src}/types/partials/ContactDetail.js +0 -0
  420. /package/lib/{src → cjs/src}/types/partials/ContactPoint.d.ts +0 -0
  421. /package/lib/{src → cjs/src}/types/partials/ContactPoint.js +0 -0
  422. /package/lib/{src → cjs/src}/types/partials/Contributor.d.ts +0 -0
  423. /package/lib/{src → cjs/src}/types/partials/Contributor.js +0 -0
  424. /package/lib/{src → cjs/src}/types/partials/DataRequirement.d.ts +0 -0
  425. /package/lib/{src → cjs/src}/types/partials/DataRequirement.js +0 -0
  426. /package/lib/{src → cjs/src}/types/partials/DataRequirementCodeFilter.d.ts +0 -0
  427. /package/lib/{src → cjs/src}/types/partials/DataRequirementCodeFilter.js +0 -0
  428. /package/lib/{src → cjs/src}/types/partials/DataRequirementDateFilter.d.ts +0 -0
  429. /package/lib/{src → cjs/src}/types/partials/DataRequirementDateFilter.js +0 -0
  430. /package/lib/{src → cjs/src}/types/partials/DataRequirementSort.d.ts +0 -0
  431. /package/lib/{src → cjs/src}/types/partials/DataRequirementSort.js +0 -0
  432. /package/lib/{src → cjs/src}/types/partials/DeviceDeviceName.d.ts +0 -0
  433. /package/lib/{src → cjs/src}/types/partials/DeviceDeviceName.js +0 -0
  434. /package/lib/{src → cjs/src}/types/partials/DeviceProperty.d.ts +0 -0
  435. /package/lib/{src → cjs/src}/types/partials/DeviceProperty.js +0 -0
  436. /package/lib/{src → cjs/src}/types/partials/DeviceSpecialization.d.ts +0 -0
  437. /package/lib/{src → cjs/src}/types/partials/DeviceSpecialization.js +0 -0
  438. /package/lib/{src → cjs/src}/types/partials/DeviceUdiCarrier.d.ts +0 -0
  439. /package/lib/{src → cjs/src}/types/partials/DeviceUdiCarrier.js +0 -0
  440. /package/lib/{src → cjs/src}/types/partials/DeviceVersion.d.ts +0 -0
  441. /package/lib/{src → cjs/src}/types/partials/DeviceVersion.js +0 -0
  442. /package/lib/{src → cjs/src}/types/partials/DiagnosticReportMedia.d.ts +0 -0
  443. /package/lib/{src → cjs/src}/types/partials/DiagnosticReportMedia.js +0 -0
  444. /package/lib/{src → cjs/src}/types/partials/Dosage.d.ts +0 -0
  445. /package/lib/{src → cjs/src}/types/partials/Dosage.js +0 -0
  446. /package/lib/{src → cjs/src}/types/partials/DosageDoseAndRate.d.ts +0 -0
  447. /package/lib/{src → cjs/src}/types/partials/DosageDoseAndRate.js +0 -0
  448. /package/lib/{src → cjs/src}/types/partials/Expression.d.ts +0 -0
  449. /package/lib/{src → cjs/src}/types/partials/Expression.js +0 -0
  450. /package/lib/{src → cjs/src}/types/partials/Extension.d.ts +0 -0
  451. /package/lib/{src → cjs/src}/types/partials/Extension.js +0 -0
  452. /package/lib/{src → cjs/src}/types/partials/FamilyMemberHistoryCondition.d.ts +0 -0
  453. /package/lib/{src → cjs/src}/types/partials/FamilyMemberHistoryCondition.js +0 -0
  454. /package/lib/{src → cjs/src}/types/partials/HumanName.d.ts +0 -0
  455. /package/lib/{src → cjs/src}/types/partials/HumanName.js +0 -0
  456. /package/lib/{src → cjs/src}/types/partials/Identifier.d.ts +0 -0
  457. /package/lib/{src → cjs/src}/types/partials/Identifier.js +0 -0
  458. /package/lib/{src → cjs/src}/types/partials/ImmunizationEducation.d.ts +0 -0
  459. /package/lib/{src → cjs/src}/types/partials/ImmunizationEducation.js +0 -0
  460. /package/lib/{src → cjs/src}/types/partials/ImmunizationPerformer.d.ts +0 -0
  461. /package/lib/{src → cjs/src}/types/partials/ImmunizationPerformer.js +0 -0
  462. /package/lib/{src → cjs/src}/types/partials/ImmunizationProtocolApplied.d.ts +0 -0
  463. /package/lib/{src → cjs/src}/types/partials/ImmunizationProtocolApplied.js +0 -0
  464. /package/lib/{src → cjs/src}/types/partials/ImmunizationReaction.d.ts +0 -0
  465. /package/lib/{src → cjs/src}/types/partials/ImmunizationReaction.js +0 -0
  466. /package/lib/{src → cjs/src}/types/partials/MedicationBatch.d.ts +0 -0
  467. /package/lib/{src → cjs/src}/types/partials/MedicationBatch.js +0 -0
  468. /package/lib/{src → cjs/src}/types/partials/MedicationIngredient.d.ts +0 -0
  469. /package/lib/{src → cjs/src}/types/partials/MedicationIngredient.js +0 -0
  470. /package/lib/{src → cjs/src}/types/partials/MedicationRequestDispenseRequest.d.ts +0 -0
  471. /package/lib/{src → cjs/src}/types/partials/MedicationRequestDispenseRequest.js +0 -0
  472. /package/lib/{src → cjs/src}/types/partials/MedicationRequestInitialFill.d.ts +0 -0
  473. /package/lib/{src → cjs/src}/types/partials/MedicationRequestInitialFill.js +0 -0
  474. /package/lib/{src → cjs/src}/types/partials/MedicationRequestSubstitution.d.ts +0 -0
  475. /package/lib/{src → cjs/src}/types/partials/MedicationRequestSubstitution.js +0 -0
  476. /package/lib/{src → cjs/src}/types/partials/Meta.d.ts +0 -0
  477. /package/lib/{src → cjs/src}/types/partials/Meta.js +0 -0
  478. /package/lib/{src → cjs/src}/types/partials/Money.d.ts +0 -0
  479. /package/lib/{src → cjs/src}/types/partials/Money.js +0 -0
  480. /package/lib/{src → cjs/src}/types/partials/Narrative.d.ts +0 -0
  481. /package/lib/{src → cjs/src}/types/partials/Narrative.js +0 -0
  482. /package/lib/{src → cjs/src}/types/partials/ObservationComponent.d.ts +0 -0
  483. /package/lib/{src → cjs/src}/types/partials/ObservationComponent.js +0 -0
  484. /package/lib/{src → cjs/src}/types/partials/ObservationReferenceRange.d.ts +0 -0
  485. /package/lib/{src → cjs/src}/types/partials/ObservationReferenceRange.js +0 -0
  486. /package/lib/{src → cjs/src}/types/partials/OrganizationContact.d.ts +0 -0
  487. /package/lib/{src → cjs/src}/types/partials/OrganizationContact.js +0 -0
  488. /package/lib/{src → cjs/src}/types/partials/ParameterDefinition.d.ts +0 -0
  489. /package/lib/{src → cjs/src}/types/partials/ParameterDefinition.js +0 -0
  490. /package/lib/{src → cjs/src}/types/partials/PatientCommunication.d.ts +0 -0
  491. /package/lib/{src → cjs/src}/types/partials/PatientCommunication.js +0 -0
  492. /package/lib/{src → cjs/src}/types/partials/PatientContact.d.ts +0 -0
  493. /package/lib/{src → cjs/src}/types/partials/PatientContact.js +0 -0
  494. /package/lib/{src → cjs/src}/types/partials/PatientLink.d.ts +0 -0
  495. /package/lib/{src → cjs/src}/types/partials/PatientLink.js +0 -0
  496. /package/lib/{src → cjs/src}/types/partials/Period.d.ts +0 -0
  497. /package/lib/{src → cjs/src}/types/partials/Period.js +0 -0
  498. /package/lib/{src → cjs/src}/types/partials/ProcedureFocalDevice.d.ts +0 -0
  499. /package/lib/{src → cjs/src}/types/partials/ProcedureFocalDevice.js +0 -0
  500. /package/lib/{src → cjs/src}/types/partials/ProcedurePerformer.d.ts +0 -0
  501. /package/lib/{src → cjs/src}/types/partials/ProcedurePerformer.js +0 -0
  502. /package/lib/{src → cjs/src}/types/partials/Quantity.d.ts +0 -0
  503. /package/lib/{src → cjs/src}/types/partials/Quantity.js +0 -0
  504. /package/lib/{src → cjs/src}/types/partials/Range.d.ts +0 -0
  505. /package/lib/{src → cjs/src}/types/partials/Range.js +0 -0
  506. /package/lib/{src → cjs/src}/types/partials/Ratio.d.ts +0 -0
  507. /package/lib/{src → cjs/src}/types/partials/Ratio.js +0 -0
  508. /package/lib/{src → cjs/src}/types/partials/RatioRange.d.ts +0 -0
  509. /package/lib/{src → cjs/src}/types/partials/RatioRange.js +0 -0
  510. /package/lib/{src → cjs/src}/types/partials/Reference.d.ts +0 -0
  511. /package/lib/{src → cjs/src}/types/partials/Reference.js +0 -0
  512. /package/lib/{src → cjs/src}/types/partials/RelatedArtifact.d.ts +0 -0
  513. /package/lib/{src → cjs/src}/types/partials/RelatedArtifact.js +0 -0
  514. /package/lib/{src → cjs/src}/types/partials/SampledData.d.ts +0 -0
  515. /package/lib/{src → cjs/src}/types/partials/SampledData.js +0 -0
  516. /package/lib/{src → cjs/src}/types/partials/Signature.d.ts +0 -0
  517. /package/lib/{src → cjs/src}/types/partials/Signature.js +0 -0
  518. /package/lib/{src → cjs/src}/types/partials/Timing.d.ts +0 -0
  519. /package/lib/{src → cjs/src}/types/partials/Timing.js +0 -0
  520. /package/lib/{src → cjs/src}/types/partials/TimingRepeat.d.ts +0 -0
  521. /package/lib/{src → cjs/src}/types/partials/TimingRepeat.js +0 -0
  522. /package/lib/{src → cjs/src}/types/partials/TriggerDefinition.d.ts +0 -0
  523. /package/lib/{src → cjs/src}/types/partials/TriggerDefinition.js +0 -0
  524. /package/lib/{src → cjs/src}/types/partials/UsageContext.d.ts +0 -0
  525. /package/lib/{src → cjs/src}/types/partials/UsageContext.js +0 -0
  526. /package/lib/{src → cjs/src}/types/resources/AllergyIntolerance.d.ts +0 -0
  527. /package/lib/{src → cjs/src}/types/resources/AllergyIntolerance.js +0 -0
  528. /package/lib/{src → cjs/src}/types/resources/Bundle.d.ts +0 -0
  529. /package/lib/{src → cjs/src}/types/resources/Bundle.js +0 -0
  530. /package/lib/{src → cjs/src}/types/resources/CarePlan.d.ts +0 -0
  531. /package/lib/{src → cjs/src}/types/resources/CarePlan.js +0 -0
  532. /package/lib/{src → cjs/src}/types/resources/ClinicalImpression.d.ts +0 -0
  533. /package/lib/{src → cjs/src}/types/resources/ClinicalImpression.js +0 -0
  534. /package/lib/{src → cjs/src}/types/resources/Composition.d.ts +0 -0
  535. /package/lib/{src → cjs/src}/types/resources/Composition.js +0 -0
  536. /package/lib/{src → cjs/src}/types/resources/Condition.d.ts +0 -0
  537. /package/lib/{src → cjs/src}/types/resources/Condition.js +0 -0
  538. /package/lib/{src → cjs/src}/types/resources/Consent.d.ts +0 -0
  539. /package/lib/{src → cjs/src}/types/resources/Consent.js +0 -0
  540. /package/lib/{src → cjs/src}/types/resources/Device.d.ts +0 -0
  541. /package/lib/{src → cjs/src}/types/resources/Device.js +0 -0
  542. /package/lib/{src → cjs/src}/types/resources/DeviceUseStatement.d.ts +0 -0
  543. /package/lib/{src → cjs/src}/types/resources/DeviceUseStatement.js +0 -0
  544. /package/lib/{src → cjs/src}/types/resources/DiagnosticReport.d.ts +0 -0
  545. /package/lib/{src → cjs/src}/types/resources/DiagnosticReport.js +0 -0
  546. /package/lib/{src → cjs/src}/types/resources/DomainResource.d.ts +0 -0
  547. /package/lib/{src → cjs/src}/types/resources/DomainResource.js +0 -0
  548. /package/lib/{src → cjs/src}/types/resources/FamilyMemberHistory.d.ts +0 -0
  549. /package/lib/{src → cjs/src}/types/resources/FamilyMemberHistory.js +0 -0
  550. /package/lib/{src → cjs/src}/types/resources/Immunization.d.ts +0 -0
  551. /package/lib/{src → cjs/src}/types/resources/Immunization.js +0 -0
  552. /package/lib/{src → cjs/src}/types/resources/Medication.d.ts +0 -0
  553. /package/lib/{src → cjs/src}/types/resources/Medication.js +0 -0
  554. /package/lib/{src → cjs/src}/types/resources/MedicationRequest.d.ts +0 -0
  555. /package/lib/{src → cjs/src}/types/resources/MedicationRequest.js +0 -0
  556. /package/lib/{src → cjs/src}/types/resources/MedicationStatement.d.ts +0 -0
  557. /package/lib/{src → cjs/src}/types/resources/MedicationStatement.js +0 -0
  558. /package/lib/{src → cjs/src}/types/resources/Observation.d.ts +0 -0
  559. /package/lib/{src → cjs/src}/types/resources/Observation.js +0 -0
  560. /package/lib/{src → cjs/src}/types/resources/Organization.d.ts +0 -0
  561. /package/lib/{src → cjs/src}/types/resources/Organization.js +0 -0
  562. /package/lib/{src → cjs/src}/types/resources/Patient.d.ts +0 -0
  563. /package/lib/{src → cjs/src}/types/resources/Patient.js +0 -0
  564. /package/lib/{src → cjs/src}/types/resources/Procedure.d.ts +0 -0
  565. /package/lib/{src → cjs/src}/types/resources/Procedure.js +0 -0
  566. /package/lib/{src → cjs/src}/types/simpleTypes/Base64Binary.d.ts +0 -0
  567. /package/lib/{src → cjs/src}/types/simpleTypes/Base64Binary.js +0 -0
  568. /package/lib/{src → cjs/src}/types/simpleTypes/Canonical.d.ts +0 -0
  569. /package/lib/{src → cjs/src}/types/simpleTypes/Canonical.js +0 -0
  570. /package/lib/{src → cjs/src}/types/simpleTypes/Date.d.ts +0 -0
  571. /package/lib/{src → cjs/src}/types/simpleTypes/Date.js +0 -0
  572. /package/lib/{src → cjs/src}/types/simpleTypes/DateTime.d.ts +0 -0
  573. /package/lib/{src → cjs/src}/types/simpleTypes/DateTime.js +0 -0
  574. /package/lib/{src → cjs/src}/types/simpleTypes/Decimal.d.ts +0 -0
  575. /package/lib/{src → cjs/src}/types/simpleTypes/Decimal.js +0 -0
  576. /package/lib/{src → cjs/src}/types/simpleTypes/Id.d.ts +0 -0
  577. /package/lib/{src → cjs/src}/types/simpleTypes/Id.js +0 -0
  578. /package/lib/{src → cjs/src}/types/simpleTypes/Instant.d.ts +0 -0
  579. /package/lib/{src → cjs/src}/types/simpleTypes/Instant.js +0 -0
  580. /package/lib/{src → cjs/src}/types/simpleTypes/Int.d.ts +0 -0
  581. /package/lib/{src → cjs/src}/types/simpleTypes/Int.js +0 -0
  582. /package/lib/{src → cjs/src}/types/simpleTypes/Markdown.d.ts +0 -0
  583. /package/lib/{src → cjs/src}/types/simpleTypes/Markdown.js +0 -0
  584. /package/lib/{src → cjs/src}/types/simpleTypes/Oid.d.ts +0 -0
  585. /package/lib/{src → cjs/src}/types/simpleTypes/Oid.js +0 -0
  586. /package/lib/{src → cjs/src}/types/simpleTypes/ResourceContainer.d.ts +0 -0
  587. /package/lib/{src → cjs/src}/types/simpleTypes/ResourceContainer.js +0 -0
  588. /package/lib/{src → cjs/src}/types/simpleTypes/Time.d.ts +0 -0
  589. /package/lib/{src → cjs/src}/types/simpleTypes/Time.js +0 -0
  590. /package/lib/{src → cjs/src}/types/simpleTypes/UnsignedInt.d.ts +0 -0
  591. /package/lib/{src → cjs/src}/types/simpleTypes/UnsignedInt.js +0 -0
  592. /package/lib/{src → cjs/src}/types/simpleTypes/Uri.d.ts +0 -0
  593. /package/lib/{src → cjs/src}/types/simpleTypes/Uri.js +0 -0
  594. /package/lib/{src → cjs/src}/types/simpleTypes/Url.d.ts +0 -0
  595. /package/lib/{src → cjs/src}/types/simpleTypes/Url.js +0 -0
  596. /package/lib/{src → cjs/src}/types/simpleTypes/Uuid.d.ts +0 -0
  597. /package/lib/{src → cjs/src}/types/simpleTypes/Uuid.js +0 -0
  598. /package/lib/{src → cjs/src}/types/simpleTypes/Xhtml.d.ts +0 -0
  599. /package/lib/{src → cjs/src}/types/simpleTypes/Xhtml.js +0 -0
  600. /package/lib/{test → cjs/test}/fhir-summary-bundle/fhir-summary-bundle.test.d.ts +0 -0
  601. /package/lib/{test → cjs/test}/fhir-summary-bundle/fhir-summary-bundle.test.js +0 -0
  602. /package/lib/{test → cjs/test}/ips-test/ips.test.d.ts +0 -0
  603. /package/lib/{test → cjs/test}/ips-test/ips.test.js +0 -0
  604. /package/lib/{test → cjs/test}/narrativeGenerator/narrativeGenerator.test.d.ts +0 -0
  605. /package/lib/{test → cjs/test}/narrativeGenerator/narrativeGenerator.test.js +0 -0
  606. /package/lib/{test → cjs/test}/summary.test.d.ts +0 -0
  607. /package/lib/{test → cjs/test}/summary.test.js +0 -0
  608. /package/lib/{test → cjs/test}/utilities/testHelpers.d.ts +0 -0
  609. /package/lib/{test → cjs/test}/utilities/testHelpers.js +0 -0
@@ -0,0 +1,15 @@
1
+ import { TBundle } from '../../../types/resources/Bundle';
2
+ import { ITemplate } from './interfaces/ITemplate';
3
+ /**
4
+ * Class to generate HTML narrative for Clinical Impression resources
5
+ * This generates narrative for the Clinical Impression section of the IPS
6
+ */
7
+ export declare class ClinicalImpressionTemplate implements ITemplate {
8
+ /**
9
+ * Generate HTML narrative for Clinical Impressions
10
+ * @param resource - FHIR Bundle containing ClinicalImpression resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource: TBundle, timezone: string | undefined): string;
15
+ }
@@ -0,0 +1,107 @@
1
+ // ClinicalImpressionTemplate.ts - TypeScript template for Clinical Impression section
2
+ import { TemplateUtilities } from './TemplateUtilities';
3
+ /**
4
+ * Class to generate HTML narrative for Clinical Impression resources
5
+ * This generates narrative for the Clinical Impression section of the IPS
6
+ */
7
+ export class ClinicalImpressionTemplate {
8
+ /**
9
+ * Generate HTML narrative for Clinical Impressions
10
+ * @param resource - FHIR Bundle containing ClinicalImpression resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource, timezone) {
15
+ const templateUtilities = new TemplateUtilities(resource);
16
+ // Start building the HTML table
17
+ let html = `
18
+ <h5>Clinical Impressions</h5>
19
+ <table class="hapiPropertyTable">
20
+ <thead>
21
+ <tr>
22
+ <th>Date</th>
23
+ <th>Status</th>
24
+ <th>Description</th>
25
+ <th>Summary</th>
26
+ <th>Findings</th>
27
+ <th>Notes</th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>`;
31
+ // Check if we have entries in the bundle
32
+ if (resource.entry && Array.isArray(resource.entry)) {
33
+ let hasClinicalImpressions = false;
34
+ // Loop through entries in the bundle
35
+ for (const entry of resource.entry) {
36
+ const res = entry.resource;
37
+ // Skip non-ClinicalImpression resources
38
+ if (!res || res.resourceType !== 'ClinicalImpression') {
39
+ continue;
40
+ }
41
+ hasClinicalImpressions = true;
42
+ const impression = res;
43
+ // Format date (could be effectiveDateTime, effectivePeriod, or date)
44
+ let formattedDate = '';
45
+ if (impression.effectiveDateTime) {
46
+ formattedDate = templateUtilities.renderTime(impression.effectiveDateTime, timezone);
47
+ }
48
+ else if (impression.effectivePeriod) {
49
+ formattedDate = templateUtilities.renderPeriod(impression.effectivePeriod, timezone);
50
+ }
51
+ else if (impression.date) {
52
+ formattedDate = templateUtilities.renderDate(impression.date);
53
+ }
54
+ // Format status
55
+ const status = impression.status || '';
56
+ // Description and summary
57
+ const description = impression.description || '';
58
+ const summary = impression.summary || '';
59
+ // Format findings
60
+ let findingsHtml = '';
61
+ if (impression.finding && impression.finding.length > 0) {
62
+ findingsHtml = '<ul>';
63
+ for (const finding of impression.finding) {
64
+ // Each finding has an itemCodeableConcept and/or itemReference
65
+ const findingText = finding.itemCodeableConcept
66
+ ? templateUtilities.codeableConcept(finding.itemCodeableConcept, 'display')
67
+ : (finding.itemReference
68
+ ? templateUtilities.renderReference(finding.itemReference)
69
+ : '');
70
+ // Add cause if present
71
+ const cause = finding.basis || '';
72
+ findingsHtml += `<li>${findingText}${cause ? ` - ${cause}` : ''}</li>`;
73
+ }
74
+ findingsHtml += '</ul>';
75
+ }
76
+ // Format notes
77
+ const notes = templateUtilities.renderNotes(impression.note, timezone);
78
+ html += `
79
+ <tr id="${templateUtilities.narrativeLinkId(impression)}">
80
+ <td>${formattedDate}</td>
81
+ <td>${status}</td>
82
+ <td>${description}</td>
83
+ <td>${summary}</td>
84
+ <td>${findingsHtml}</td>
85
+ <td>${notes}</td>
86
+ </tr>`;
87
+ }
88
+ // If no clinical impression entries were found
89
+ if (!hasClinicalImpressions) {
90
+ html += `
91
+ <tr>
92
+ <td colspan="6">No clinical impressions recorded</td>
93
+ </tr>`;
94
+ }
95
+ }
96
+ else {
97
+ html += `
98
+ <tr>
99
+ <td colspan="6">No clinical impressions recorded</td>
100
+ </tr>`;
101
+ }
102
+ html += `
103
+ </tbody>
104
+ </table>`;
105
+ return html;
106
+ }
107
+ }
@@ -0,0 +1,50 @@
1
+ import { TBundle } from '../../../types/resources/Bundle';
2
+ import { ITemplate } from './interfaces/ITemplate';
3
+ /**
4
+ * Class to generate HTML narrative for Diagnostic Results (Observation resources)
5
+ * This replaces the Jinja2 diagnosticresults.j2 template
6
+ */
7
+ export declare class DiagnosticResultsTemplate implements ITemplate {
8
+ /**
9
+ * Generate HTML narrative for Diagnostic Results
10
+ * @param resource - FHIR Bundle containing Observation and DiagnosticReport resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource: TBundle, timezone: string | undefined): string;
15
+ /**
16
+ * Internal static implementation that actually generates the narrative
17
+ * @param resource - FHIR Bundle containing Observation and DiagnosticReport resources
18
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
19
+ * @returns HTML string for rendering
20
+ */
21
+ private static generateStaticNarrative;
22
+ /**
23
+ * Extract Observation resources from the bundle
24
+ * @param resource - FHIR Bundle
25
+ * @returns Array of Observation resources
26
+ */
27
+ private static getObservations;
28
+ /**
29
+ * Extract DiagnosticReport resources from the bundle
30
+ * @param resource - FHIR Bundle
31
+ * @returns Array of DiagnosticReport resources
32
+ */
33
+ private static getDiagnosticReports;
34
+ /**
35
+ * Render HTML table for Observation resources
36
+ * @param templateUtilities - Instance of TemplateUtilities for utility functions
37
+ * @param observations - Array of Observation resources
38
+ * @param timezone - Optional timezone to use for date formatting
39
+ * @returns HTML string for rendering
40
+ */
41
+ private static renderObservations;
42
+ /**
43
+ * Render HTML table for DiagnosticReport resources
44
+ * @param templateUtilities - Instance of TemplateUtilities for utility functions
45
+ * @param reports - Array of DiagnosticReport resources
46
+ * @param timezone - Optional timezone to use for date formatting
47
+ * @returns HTML string for rendering
48
+ */
49
+ private static renderDiagnosticReports;
50
+ }
@@ -0,0 +1,149 @@
1
+ // DiagnosticResultsTemplate.ts - TypeScript replacement for Jinja2 diagnosticresults.j2
2
+ import { TemplateUtilities } from './TemplateUtilities';
3
+ /**
4
+ * Class to generate HTML narrative for Diagnostic Results (Observation resources)
5
+ * This replaces the Jinja2 diagnosticresults.j2 template
6
+ */
7
+ export class DiagnosticResultsTemplate {
8
+ /**
9
+ * Generate HTML narrative for Diagnostic Results
10
+ * @param resource - FHIR Bundle containing Observation and DiagnosticReport resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource, timezone) {
15
+ return DiagnosticResultsTemplate.generateStaticNarrative(resource, timezone);
16
+ }
17
+ /**
18
+ * Internal static implementation that actually generates the narrative
19
+ * @param resource - FHIR Bundle containing Observation and DiagnosticReport resources
20
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
21
+ * @returns HTML string for rendering
22
+ */
23
+ static generateStaticNarrative(resource, timezone) {
24
+ const templateUtilities = new TemplateUtilities(resource);
25
+ let html = '';
26
+ // Generate Observations section if we have any Observation resources
27
+ const observations = this.getObservations(resource);
28
+ if (observations.length > 0) {
29
+ html += this.renderObservations(templateUtilities, observations, timezone);
30
+ }
31
+ // Generate DiagnosticReports section if we have any DiagnosticReport resources
32
+ const diagnosticReports = this.getDiagnosticReports(resource);
33
+ if (diagnosticReports.length > 0) {
34
+ html += this.renderDiagnosticReports(templateUtilities, diagnosticReports, timezone);
35
+ }
36
+ return html;
37
+ }
38
+ /**
39
+ * Extract Observation resources from the bundle
40
+ * @param resource - FHIR Bundle
41
+ * @returns Array of Observation resources
42
+ */
43
+ static getObservations(resource) {
44
+ if (!resource.entry || !Array.isArray(resource.entry)) {
45
+ return [];
46
+ }
47
+ return resource.entry
48
+ .filter(entry => { var _a; return ((_a = entry.resource) === null || _a === void 0 ? void 0 : _a.resourceType) === 'Observation'; })
49
+ .map(entry => entry.resource);
50
+ }
51
+ /**
52
+ * Extract DiagnosticReport resources from the bundle
53
+ * @param resource - FHIR Bundle
54
+ * @returns Array of DiagnosticReport resources
55
+ */
56
+ static getDiagnosticReports(resource) {
57
+ if (!resource.entry || !Array.isArray(resource.entry)) {
58
+ return [];
59
+ }
60
+ return resource.entry
61
+ .filter(entry => { var _a; return ((_a = entry.resource) === null || _a === void 0 ? void 0 : _a.resourceType) === 'DiagnosticReport'; })
62
+ .map(entry => entry.resource);
63
+ }
64
+ /**
65
+ * Render HTML table for Observation resources
66
+ * @param templateUtilities - Instance of TemplateUtilities for utility functions
67
+ * @param observations - Array of Observation resources
68
+ * @param timezone - Optional timezone to use for date formatting
69
+ * @returns HTML string for rendering
70
+ */
71
+ static renderObservations(templateUtilities, observations, timezone) {
72
+ let html = `
73
+ <h5>Diagnostic Results: Observations</h5>
74
+ <table class="hapiPropertyTable">
75
+ <thead>
76
+ <tr>
77
+ <th>Code</th>
78
+ <th>Result</th>
79
+ <th>Unit</th>
80
+ <th>Interpretation</th>
81
+ <th>Reference Range</th>
82
+ <th>Comments</th>
83
+ <th>Date</th>
84
+ </tr>
85
+ </thead>
86
+ <tbody>`;
87
+ for (const obs of observations) {
88
+ // Use the enhanced narrativeLinkId utility function to extract the ID directly from the resource
89
+ // Add table row
90
+ html += `
91
+ <tr id="${(templateUtilities.narrativeLinkId(obs))}">
92
+ <td>${templateUtilities.codeableConcept(obs.code)}</td>
93
+ <td>${templateUtilities.extractObservationValue(obs)}</td>
94
+ <td>${templateUtilities.extractObservationValueUnit(obs)}</td>
95
+ <td>${templateUtilities.firstFromCodeableConceptList(obs.interpretation)}</td>
96
+ <td>${templateUtilities.concatReferenceRange(obs.referenceRange)}</td>
97
+ <td>${templateUtilities.renderNotes(obs.note, timezone)}</td>
98
+ <td>${templateUtilities.renderTime(obs.effectiveDateTime, timezone)}</td>
99
+ </tr>`;
100
+ }
101
+ html += `
102
+ </tbody>
103
+ </table>`;
104
+ return html;
105
+ }
106
+ /**
107
+ * Render HTML table for DiagnosticReport resources
108
+ * @param templateUtilities - Instance of TemplateUtilities for utility functions
109
+ * @param reports - Array of DiagnosticReport resources
110
+ * @param timezone - Optional timezone to use for date formatting
111
+ * @returns HTML string for rendering
112
+ */
113
+ static renderDiagnosticReports(templateUtilities, reports, timezone) {
114
+ let html = `
115
+ <h5>Diagnostic Results: Reports</h5>
116
+ <table class="hapiPropertyTable">
117
+ <thead>
118
+ <tr>
119
+ <th>Report</th>
120
+ <th>Status</th>
121
+ <th>Category</th>
122
+ <th>Result</th>
123
+ <th>Issued</th>
124
+ </tr>
125
+ </thead>
126
+ <tbody>`;
127
+ for (const report of reports) {
128
+ // Use the enhanced narrativeLinkId utility function to extract the ID directly from the resource
129
+ // Format result count
130
+ let resultCount = '';
131
+ if (report.result && Array.isArray(report.result)) {
132
+ resultCount = `${report.result.length} result${report.result.length !== 1 ? 's' : ''}`;
133
+ }
134
+ // Add table row
135
+ html += `
136
+ <tr id="${(templateUtilities.narrativeLinkId(report))}">
137
+ <td>${templateUtilities.codeableConcept(report.code)}</td>
138
+ <td>${report.status || ''}</td>
139
+ <td>${templateUtilities.firstFromCodeableConceptList(report.category)}</td>
140
+ <td>${resultCount}</td>
141
+ <td>${report.issued ? templateUtilities.renderTime(report.issued, timezone) : ''}</td>
142
+ </tr>`;
143
+ }
144
+ html += `
145
+ </tbody>
146
+ </table>`;
147
+ return html;
148
+ }
149
+ }
@@ -0,0 +1,15 @@
1
+ import { TBundle } from '../../../types/resources/Bundle';
2
+ import { ITemplate } from './interfaces/ITemplate';
3
+ /**
4
+ * Class to generate HTML narrative for Family History (FamilyMemberHistory resources)
5
+ * This generates narrative for the Family History section of the IPS
6
+ */
7
+ export declare class FamilyHistoryTemplate implements ITemplate {
8
+ /**
9
+ * Generate HTML narrative for Family History
10
+ * @param resource - FHIR Bundle containing FamilyMemberHistory resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource: TBundle, timezone: string | undefined): string;
15
+ }
@@ -0,0 +1,99 @@
1
+ // FamilyHistoryTemplate.ts - TypeScript template for Family History section
2
+ import { TemplateUtilities } from './TemplateUtilities';
3
+ /**
4
+ * Class to generate HTML narrative for Family History (FamilyMemberHistory resources)
5
+ * This generates narrative for the Family History section of the IPS
6
+ */
7
+ export class FamilyHistoryTemplate {
8
+ /**
9
+ * Generate HTML narrative for Family History
10
+ * @param resource - FHIR Bundle containing FamilyMemberHistory resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource, timezone) {
15
+ const templateUtilities = new TemplateUtilities(resource);
16
+ // Start building the HTML table
17
+ let html = `
18
+ <h5>Family History</h5>
19
+ <table class="hapiPropertyTable">
20
+ <thead>
21
+ <tr>
22
+ <th>Relationship</th>
23
+ <th>Condition</th>
24
+ <th>Status</th>
25
+ <th>Onset</th>
26
+ <th>Notes</th>
27
+ </tr>
28
+ </thead>
29
+ <tbody>`;
30
+ // Check if we have entries in the bundle
31
+ if (resource.entry && Array.isArray(resource.entry)) {
32
+ let hasFamilyHistory = false;
33
+ // Loop through entries in the bundle
34
+ for (const entry of resource.entry) {
35
+ const familyHistory = entry.resource;
36
+ // Skip non-FamilyMemberHistory resources
37
+ if (!familyHistory || familyHistory.resourceType !== 'FamilyMemberHistory') {
38
+ continue;
39
+ }
40
+ hasFamilyHistory = true;
41
+ const fmh = familyHistory;
42
+ // Extract relationship
43
+ const relationship = templateUtilities.codeableConcept(fmh.relationship, 'display');
44
+ // Process conditions if they exist
45
+ if (fmh.condition && Array.isArray(fmh.condition)) {
46
+ for (const condition of fmh.condition) {
47
+ const conditionCode = templateUtilities.codeableConcept(condition.code, 'display');
48
+ const status = fmh.status || '';
49
+ // Handle onset which could be various types (dateTime, Age, Range, string, Period)
50
+ let onset = '';
51
+ if (condition.onsetAge) {
52
+ onset = templateUtilities.renderOnset(condition.onsetAge, timezone);
53
+ }
54
+ // Notes can be at the condition level or the family history level
55
+ const notes = condition.note ?
56
+ templateUtilities.renderNotes(condition.note, timezone) :
57
+ templateUtilities.renderNotes(fmh.note, timezone);
58
+ html += `
59
+ <tr id="${templateUtilities.narrativeLinkId(fmh)}">
60
+ <td>${relationship}</td>
61
+ <td>${conditionCode}</td>
62
+ <td>${status}</td>
63
+ <td>${onset}</td>
64
+ <td>${notes}</td>
65
+ </tr>`;
66
+ }
67
+ }
68
+ else {
69
+ // If no specific conditions are listed, just show the relationship
70
+ html += `
71
+ <tr id="${templateUtilities.narrativeLinkId(fmh)}">
72
+ <td>${relationship}</td>
73
+ <td>Not specified</td>
74
+ <td>${fmh.status || ''}</td>
75
+ <td></td>
76
+ <td>${templateUtilities.renderNotes(fmh.note, timezone)}</td>
77
+ </tr>`;
78
+ }
79
+ }
80
+ // If no family history entries were found
81
+ if (!hasFamilyHistory) {
82
+ html += `
83
+ <tr>
84
+ <td colspan="5">No family history recorded</td>
85
+ </tr>`;
86
+ }
87
+ }
88
+ else {
89
+ html += `
90
+ <tr>
91
+ <td colspan="5">No family history recorded</td>
92
+ </tr>`;
93
+ }
94
+ html += `
95
+ </tbody>
96
+ </table>`;
97
+ return html;
98
+ }
99
+ }
@@ -0,0 +1,22 @@
1
+ import { TBundle } from '../../../types/resources/Bundle';
2
+ import { ITemplate } from './interfaces/ITemplate';
3
+ /**
4
+ * Class to generate HTML narrative for Functional Status (Observation resources)
5
+ * This replaces the Jinja2 functionalstatus.j2 template
6
+ */
7
+ export declare class FunctionalStatusTemplate implements ITemplate {
8
+ /**
9
+ * Generate HTML narrative for Functional Status
10
+ * @param resource - FHIR Bundle containing Observation resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource: TBundle, timezone: string | undefined): string;
15
+ /**
16
+ * Internal static implementation that actually generates the narrative
17
+ * @param resource - FHIR Bundle containing Observation resources
18
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
19
+ * @returns HTML string for rendering
20
+ */
21
+ private static generateStaticNarrative;
22
+ }
@@ -0,0 +1,66 @@
1
+ // FunctionalStatusTemplate.ts - TypeScript replacement for Jinja2 functionalstatus.j2
2
+ import { TemplateUtilities } from './TemplateUtilities';
3
+ /**
4
+ * Class to generate HTML narrative for Functional Status (Observation resources)
5
+ * This replaces the Jinja2 functionalstatus.j2 template
6
+ */
7
+ export class FunctionalStatusTemplate {
8
+ /**
9
+ * Generate HTML narrative for Functional Status
10
+ * @param resource - FHIR Bundle containing Observation resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource, timezone) {
15
+ return FunctionalStatusTemplate.generateStaticNarrative(resource, timezone);
16
+ }
17
+ /**
18
+ * Internal static implementation that actually generates the narrative
19
+ * @param resource - FHIR Bundle containing Observation resources
20
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
21
+ * @returns HTML string for rendering
22
+ */
23
+ static generateStaticNarrative(resource, timezone) {
24
+ const templateUtilities = new TemplateUtilities(resource);
25
+ // Start building the HTML table
26
+ let html = `
27
+ <h5>Functional Status</h5>
28
+ <table class="hapiPropertyTable">
29
+ <thead>
30
+ <tr>
31
+ <th>Assessment</th>
32
+ <th>Status</th>
33
+ <th>Finding</th>
34
+ <th>Comments</th>
35
+ <th>Date</th>
36
+ </tr>
37
+ </thead>
38
+ <tbody>`;
39
+ // Check if we have entries in the bundle
40
+ if (resource.entry && Array.isArray(resource.entry)) {
41
+ // Loop through entries in the bundle
42
+ for (const entry of resource.entry) {
43
+ const ci = entry.resource;
44
+ // Skip Composition resources
45
+ if (ci.resourceType === 'Composition') {
46
+ continue;
47
+ }
48
+ // Use the enhanced narrativeLinkId utility function to extract the ID directly from the resource
49
+ // Add a table row for this clinical impression
50
+ html += `
51
+ <tr id="${(templateUtilities.narrativeLinkId(ci))}">
52
+ <td>${templateUtilities.codeableConcept(ci.code, 'display')}</td>
53
+ <td>${ci.status || ''}</td>
54
+ <td>${ci.summary || ''}</td>
55
+ <td>${templateUtilities.renderNotes(ci.note, timezone)}</td>
56
+ <td>${templateUtilities.renderEffective(ci.effectiveDateTime, timezone)}</td>
57
+ </tr>`;
58
+ }
59
+ }
60
+ // Close the HTML table
61
+ html += `
62
+ </tbody>
63
+ </table>`;
64
+ return html;
65
+ }
66
+ }
@@ -0,0 +1,22 @@
1
+ import { TBundle } from '../../../types/resources/Bundle';
2
+ import { ITemplate } from './interfaces/ITemplate';
3
+ /**
4
+ * Class to generate HTML narrative for Procedure resources
5
+ * This replaces the Jinja2 historyofprocedures.j2 template
6
+ */
7
+ export declare class HistoryOfProceduresTemplate implements ITemplate {
8
+ /**
9
+ * Generate HTML narrative for Procedure resources
10
+ * @param resource - FHIR Bundle containing Procedure resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource: TBundle, timezone: string | undefined): string;
15
+ /**
16
+ * Internal static implementation that actually generates the narrative
17
+ * @param resource - FHIR Bundle containing Procedure resources
18
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
19
+ * @returns HTML string for rendering
20
+ */
21
+ private static generateStaticNarrative;
22
+ }
@@ -0,0 +1,62 @@
1
+ // HistoryOfProceduresTemplate.ts - TypeScript replacement for Jinja2 historyofprocedures.j2
2
+ import { TemplateUtilities } from './TemplateUtilities';
3
+ /**
4
+ * Class to generate HTML narrative for Procedure resources
5
+ * This replaces the Jinja2 historyofprocedures.j2 template
6
+ */
7
+ export class HistoryOfProceduresTemplate {
8
+ /**
9
+ * Generate HTML narrative for Procedure resources
10
+ * @param resource - FHIR Bundle containing Procedure resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource, timezone) {
15
+ return HistoryOfProceduresTemplate.generateStaticNarrative(resource, timezone);
16
+ }
17
+ /**
18
+ * Internal static implementation that actually generates the narrative
19
+ * @param resource - FHIR Bundle containing Procedure resources
20
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
21
+ * @returns HTML string for rendering
22
+ */
23
+ static generateStaticNarrative(resource, timezone) {
24
+ const templateUtilities = new TemplateUtilities(resource);
25
+ // Start building the HTML table
26
+ let html = `
27
+ <h5>History Of Procedures</h5>
28
+ <table class="hapiPropertyTable">
29
+ <thead>
30
+ <tr>
31
+ <th>Procedure</th>
32
+ <th>Comments</th>
33
+ <th>Date</th>
34
+ </tr>
35
+ </thead>
36
+ <tbody>`;
37
+ // Check if we have entries in the bundle
38
+ if (resource.entry && Array.isArray(resource.entry)) {
39
+ // Loop through entries in the bundle
40
+ for (const entry of resource.entry) {
41
+ const proc = entry.resource;
42
+ // Skip Composition resources
43
+ if (proc.resourceType === 'Composition') {
44
+ continue;
45
+ }
46
+ // Use the enhanced narrativeLinkId utility function to extract the ID directly from the resource
47
+ // Add a table row for this procedure
48
+ html += `
49
+ <tr id="${(templateUtilities.narrativeLinkId(proc))}">
50
+ <td>${templateUtilities.codeableConcept(proc.code, 'display')}</td>
51
+ <td>${templateUtilities.renderNotes(proc.note, timezone)}</td>
52
+ <td>${templateUtilities.renderTime(proc.performedDateTime, timezone)}</td>
53
+ </tr>`;
54
+ }
55
+ }
56
+ // Close the HTML table
57
+ html += `
58
+ </tbody>
59
+ </table>`;
60
+ return html;
61
+ }
62
+ }
@@ -0,0 +1,22 @@
1
+ import { TBundle } from '../../../types/resources/Bundle';
2
+ import { ITemplate } from './interfaces/ITemplate';
3
+ /**
4
+ * Class to generate HTML narrative for Immunization resources
5
+ * This replaces the Jinja2 immunizations.j2 template
6
+ */
7
+ export declare class ImmunizationsTemplate implements ITemplate {
8
+ /**
9
+ * Generate HTML narrative for Immunization resources
10
+ * @param resource - FHIR Bundle containing Immunization resources
11
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
12
+ * @returns HTML string for rendering
13
+ */
14
+ generateNarrative(resource: TBundle, timezone: string | undefined): string;
15
+ /**
16
+ * Internal static implementation that actually generates the narrative
17
+ * @param resource - FHIR Bundle containing Immunization resources
18
+ * @param timezone - Optional timezone to use for date formatting (e.g., 'America/New_York', 'Europe/London')
19
+ * @returns HTML string for rendering
20
+ */
21
+ private static generateStaticNarrative;
22
+ }