@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.
Files changed (307) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +81 -0
  3. package/lib/src/generators/fhir_summary_generator.d.ts +46 -0
  4. package/lib/src/generators/fhir_summary_generator.js +228 -0
  5. package/lib/src/generators/narrative_generator.d.ts +40 -0
  6. package/lib/src/generators/narrative_generator.js +80 -0
  7. package/lib/src/narratives/templates/typescript/AdvanceDirectivesTemplate.d.ts +22 -0
  8. package/lib/src/narratives/templates/typescript/AdvanceDirectivesTemplate.js +70 -0
  9. package/lib/src/narratives/templates/typescript/AllergyIntoleranceTemplate.d.ts +31 -0
  10. package/lib/src/narratives/templates/typescript/AllergyIntoleranceTemplate.js +155 -0
  11. package/lib/src/narratives/templates/typescript/ClinicalImpressionTemplate.d.ts +15 -0
  12. package/lib/src/narratives/templates/typescript/ClinicalImpressionTemplate.js +111 -0
  13. package/lib/src/narratives/templates/typescript/DiagnosticResultsTemplate.d.ts +50 -0
  14. package/lib/src/narratives/templates/typescript/DiagnosticResultsTemplate.js +153 -0
  15. package/lib/src/narratives/templates/typescript/FamilyHistoryTemplate.d.ts +15 -0
  16. package/lib/src/narratives/templates/typescript/FamilyHistoryTemplate.js +103 -0
  17. package/lib/src/narratives/templates/typescript/FunctionalStatusTemplate.d.ts +22 -0
  18. package/lib/src/narratives/templates/typescript/FunctionalStatusTemplate.js +70 -0
  19. package/lib/src/narratives/templates/typescript/HistoryOfProceduresTemplate.d.ts +22 -0
  20. package/lib/src/narratives/templates/typescript/HistoryOfProceduresTemplate.js +66 -0
  21. package/lib/src/narratives/templates/typescript/ImmunizationsTemplate.d.ts +22 -0
  22. package/lib/src/narratives/templates/typescript/ImmunizationsTemplate.js +73 -0
  23. package/lib/src/narratives/templates/typescript/MedicalDevicesTemplate.d.ts +22 -0
  24. package/lib/src/narratives/templates/typescript/MedicalDevicesTemplate.js +67 -0
  25. package/lib/src/narratives/templates/typescript/MedicationSummaryTemplate.d.ts +50 -0
  26. package/lib/src/narratives/templates/typescript/MedicationSummaryTemplate.js +206 -0
  27. package/lib/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.d.ts +15 -0
  28. package/lib/src/narratives/templates/typescript/PastHistoryOfIllnessTemplate.js +59 -0
  29. package/lib/src/narratives/templates/typescript/PatientTemplate.d.ts +65 -0
  30. package/lib/src/narratives/templates/typescript/PatientTemplate.js +158 -0
  31. package/lib/src/narratives/templates/typescript/PlanOfCareTemplate.d.ts +15 -0
  32. package/lib/src/narratives/templates/typescript/PlanOfCareTemplate.js +63 -0
  33. package/lib/src/narratives/templates/typescript/PregnancyTemplate.d.ts +22 -0
  34. package/lib/src/narratives/templates/typescript/PregnancyTemplate.js +68 -0
  35. package/lib/src/narratives/templates/typescript/ProblemListTemplate.d.ts +22 -0
  36. package/lib/src/narratives/templates/typescript/ProblemListTemplate.js +119 -0
  37. package/lib/src/narratives/templates/typescript/SocialHistoryTemplate.d.ts +22 -0
  38. package/lib/src/narratives/templates/typescript/SocialHistoryTemplate.js +70 -0
  39. package/lib/src/narratives/templates/typescript/TemplateUtilities.d.ts +251 -0
  40. package/lib/src/narratives/templates/typescript/TemplateUtilities.js +696 -0
  41. package/lib/src/narratives/templates/typescript/TypeScriptTemplateMapper.d.ts +17 -0
  42. package/lib/src/narratives/templates/typescript/TypeScriptTemplateMapper.js +64 -0
  43. package/lib/src/narratives/templates/typescript/VitalSignsTemplate.d.ts +22 -0
  44. package/lib/src/narratives/templates/typescript/VitalSignsTemplate.js +74 -0
  45. package/lib/src/narratives/templates/typescript/interfaces/ITemplate.d.ts +13 -0
  46. package/lib/src/narratives/templates/typescript/interfaces/ITemplate.js +2 -0
  47. package/lib/src/profiles/ips_resource_profile_registry.d.ts +7 -0
  48. package/lib/src/profiles/ips_resource_profile_registry.js +143 -0
  49. package/lib/src/structures/ips_mandatory_sections.d.ts +7 -0
  50. package/lib/src/structures/ips_mandatory_sections.js +11 -0
  51. package/lib/src/structures/ips_recommended_sections.d.ts +8 -0
  52. package/lib/src/structures/ips_recommended_sections.js +12 -0
  53. package/lib/src/structures/ips_resource_profile.d.ts +7 -0
  54. package/lib/src/structures/ips_resource_profile.js +2 -0
  55. package/lib/src/structures/ips_section_loinc_codes.d.ts +4 -0
  56. package/lib/src/structures/ips_section_loinc_codes.js +48 -0
  57. package/lib/src/structures/ips_section_resource_map.d.ts +8 -0
  58. package/lib/src/structures/ips_section_resource_map.js +69 -0
  59. package/lib/src/structures/ips_sections.d.ts +19 -0
  60. package/lib/src/structures/ips_sections.js +27 -0
  61. package/lib/src/types/partials/Address.d.ts +16 -0
  62. package/lib/src/types/partials/Address.js +3 -0
  63. package/lib/src/types/partials/AllergyIntoleranceReaction.d.ts +16 -0
  64. package/lib/src/types/partials/AllergyIntoleranceReaction.js +3 -0
  65. package/lib/src/types/partials/Annotation.d.ts +12 -0
  66. package/lib/src/types/partials/Annotation.js +3 -0
  67. package/lib/src/types/partials/Attachment.d.ts +17 -0
  68. package/lib/src/types/partials/Attachment.js +3 -0
  69. package/lib/src/types/partials/BundleEntry.d.ts +18 -0
  70. package/lib/src/types/partials/BundleEntry.js +3 -0
  71. package/lib/src/types/partials/BundleLink.d.ts +9 -0
  72. package/lib/src/types/partials/BundleLink.js +3 -0
  73. package/lib/src/types/partials/BundleRequest.d.ts +14 -0
  74. package/lib/src/types/partials/BundleRequest.js +3 -0
  75. package/lib/src/types/partials/BundleResponse.d.ts +14 -0
  76. package/lib/src/types/partials/BundleResponse.js +3 -0
  77. package/lib/src/types/partials/BundleSearch.d.ts +9 -0
  78. package/lib/src/types/partials/BundleSearch.js +3 -0
  79. package/lib/src/types/partials/CarePlanActivity.d.ts +15 -0
  80. package/lib/src/types/partials/CarePlanActivity.js +3 -0
  81. package/lib/src/types/partials/CarePlanDetail.d.ts +33 -0
  82. package/lib/src/types/partials/CarePlanDetail.js +3 -0
  83. package/lib/src/types/partials/ClinicalImpressionFinding.d.ts +11 -0
  84. package/lib/src/types/partials/ClinicalImpressionFinding.js +3 -0
  85. package/lib/src/types/partials/ClinicalImpressionInvestigation.d.ts +10 -0
  86. package/lib/src/types/partials/ClinicalImpressionInvestigation.js +3 -0
  87. package/lib/src/types/partials/CodeableConcept.d.ts +8 -0
  88. package/lib/src/types/partials/CodeableConcept.js +3 -0
  89. package/lib/src/types/partials/CodeableReference.d.ts +9 -0
  90. package/lib/src/types/partials/CodeableReference.js +3 -0
  91. package/lib/src/types/partials/Coding.d.ts +11 -0
  92. package/lib/src/types/partials/Coding.js +3 -0
  93. package/lib/src/types/partials/CompositionAttester.d.ts +11 -0
  94. package/lib/src/types/partials/CompositionAttester.js +3 -0
  95. package/lib/src/types/partials/CompositionEvent.d.ts +12 -0
  96. package/lib/src/types/partials/CompositionEvent.js +3 -0
  97. package/lib/src/types/partials/CompositionRelatesTo.d.ts +11 -0
  98. package/lib/src/types/partials/CompositionRelatesTo.js +3 -0
  99. package/lib/src/types/partials/CompositionSection.d.ts +19 -0
  100. package/lib/src/types/partials/CompositionSection.js +3 -0
  101. package/lib/src/types/partials/ConditionEvidence.d.ts +10 -0
  102. package/lib/src/types/partials/ConditionEvidence.js +3 -0
  103. package/lib/src/types/partials/ConditionStage.d.ts +11 -0
  104. package/lib/src/types/partials/ConditionStage.js +3 -0
  105. package/lib/src/types/partials/ConsentActor.d.ts +10 -0
  106. package/lib/src/types/partials/ConsentActor.js +3 -0
  107. package/lib/src/types/partials/ConsentData.d.ts +9 -0
  108. package/lib/src/types/partials/ConsentData.js +3 -0
  109. package/lib/src/types/partials/ConsentPolicy.d.ts +9 -0
  110. package/lib/src/types/partials/ConsentPolicy.js +3 -0
  111. package/lib/src/types/partials/ConsentProvision.d.ts +22 -0
  112. package/lib/src/types/partials/ConsentProvision.js +3 -0
  113. package/lib/src/types/partials/ConsentVerification.d.ts +11 -0
  114. package/lib/src/types/partials/ConsentVerification.js +3 -0
  115. package/lib/src/types/partials/ContactDetail.d.ts +8 -0
  116. package/lib/src/types/partials/ContactDetail.js +3 -0
  117. package/lib/src/types/partials/ContactPoint.d.ts +12 -0
  118. package/lib/src/types/partials/ContactPoint.js +3 -0
  119. package/lib/src/types/partials/Contributor.d.ts +9 -0
  120. package/lib/src/types/partials/Contributor.js +3 -0
  121. package/lib/src/types/partials/DataRequirement.d.ts +21 -0
  122. package/lib/src/types/partials/DataRequirement.js +3 -0
  123. package/lib/src/types/partials/DataRequirementCodeFilter.d.ts +11 -0
  124. package/lib/src/types/partials/DataRequirementCodeFilter.js +3 -0
  125. package/lib/src/types/partials/DataRequirementDateFilter.d.ts +13 -0
  126. package/lib/src/types/partials/DataRequirementDateFilter.js +3 -0
  127. package/lib/src/types/partials/DataRequirementSort.d.ts +7 -0
  128. package/lib/src/types/partials/DataRequirementSort.js +3 -0
  129. package/lib/src/types/partials/DeviceDeviceName.d.ts +8 -0
  130. package/lib/src/types/partials/DeviceDeviceName.js +3 -0
  131. package/lib/src/types/partials/DeviceProperty.d.ts +11 -0
  132. package/lib/src/types/partials/DeviceProperty.js +3 -0
  133. package/lib/src/types/partials/DeviceSpecialization.d.ts +9 -0
  134. package/lib/src/types/partials/DeviceSpecialization.js +3 -0
  135. package/lib/src/types/partials/DeviceUdiCarrier.d.ts +14 -0
  136. package/lib/src/types/partials/DeviceUdiCarrier.js +3 -0
  137. package/lib/src/types/partials/DeviceVersion.d.ts +11 -0
  138. package/lib/src/types/partials/DeviceVersion.js +3 -0
  139. package/lib/src/types/partials/DiagnosticReportMedia.d.ts +9 -0
  140. package/lib/src/types/partials/DiagnosticReportMedia.js +3 -0
  141. package/lib/src/types/partials/Dosage.d.ts +26 -0
  142. package/lib/src/types/partials/Dosage.js +3 -0
  143. package/lib/src/types/partials/DosageDoseAndRate.d.ts +16 -0
  144. package/lib/src/types/partials/DosageDoseAndRate.js +3 -0
  145. package/lib/src/types/partials/Expression.d.ts +12 -0
  146. package/lib/src/types/partials/Expression.js +3 -0
  147. package/lib/src/types/partials/Extension.d.ts +99 -0
  148. package/lib/src/types/partials/Extension.js +3 -0
  149. package/lib/src/types/partials/FamilyMemberHistoryCondition.d.ts +19 -0
  150. package/lib/src/types/partials/FamilyMemberHistoryCondition.js +3 -0
  151. package/lib/src/types/partials/HumanName.d.ts +13 -0
  152. package/lib/src/types/partials/HumanName.js +3 -0
  153. package/lib/src/types/partials/Identifier.d.ts +15 -0
  154. package/lib/src/types/partials/Identifier.js +3 -0
  155. package/lib/src/types/partials/ImmunizationEducation.d.ts +12 -0
  156. package/lib/src/types/partials/ImmunizationEducation.js +3 -0
  157. package/lib/src/types/partials/ImmunizationPerformer.d.ts +10 -0
  158. package/lib/src/types/partials/ImmunizationPerformer.js +3 -0
  159. package/lib/src/types/partials/ImmunizationProtocolApplied.d.ts +16 -0
  160. package/lib/src/types/partials/ImmunizationProtocolApplied.js +3 -0
  161. package/lib/src/types/partials/ImmunizationReaction.d.ts +11 -0
  162. package/lib/src/types/partials/ImmunizationReaction.js +3 -0
  163. package/lib/src/types/partials/MedicationBatch.d.ts +9 -0
  164. package/lib/src/types/partials/MedicationBatch.js +3 -0
  165. package/lib/src/types/partials/MedicationIngredient.d.ts +13 -0
  166. package/lib/src/types/partials/MedicationIngredient.js +3 -0
  167. package/lib/src/types/partials/MedicationRequestDispenseRequest.d.ts +18 -0
  168. package/lib/src/types/partials/MedicationRequestDispenseRequest.js +3 -0
  169. package/lib/src/types/partials/MedicationRequestInitialFill.d.ts +9 -0
  170. package/lib/src/types/partials/MedicationRequestInitialFill.js +3 -0
  171. package/lib/src/types/partials/MedicationRequestSubstitution.d.ts +10 -0
  172. package/lib/src/types/partials/MedicationRequestSubstitution.js +3 -0
  173. package/lib/src/types/partials/Meta.d.ts +16 -0
  174. package/lib/src/types/partials/Meta.js +3 -0
  175. package/lib/src/types/partials/Money.d.ts +8 -0
  176. package/lib/src/types/partials/Money.js +3 -0
  177. package/lib/src/types/partials/Narrative.d.ts +8 -0
  178. package/lib/src/types/partials/Narrative.js +3 -0
  179. package/lib/src/types/partials/ObservationComponent.d.ts +31 -0
  180. package/lib/src/types/partials/ObservationComponent.js +3 -0
  181. package/lib/src/types/partials/ObservationReferenceRange.d.ts +15 -0
  182. package/lib/src/types/partials/ObservationReferenceRange.js +3 -0
  183. package/lib/src/types/partials/OrganizationContact.d.ts +14 -0
  184. package/lib/src/types/partials/OrganizationContact.js +3 -0
  185. package/lib/src/types/partials/ParameterDefinition.d.ts +14 -0
  186. package/lib/src/types/partials/ParameterDefinition.js +3 -0
  187. package/lib/src/types/partials/PatientCommunication.d.ts +9 -0
  188. package/lib/src/types/partials/PatientCommunication.js +3 -0
  189. package/lib/src/types/partials/PatientContact.d.ts +19 -0
  190. package/lib/src/types/partials/PatientContact.js +3 -0
  191. package/lib/src/types/partials/PatientLink.d.ts +9 -0
  192. package/lib/src/types/partials/PatientLink.js +3 -0
  193. package/lib/src/types/partials/Period.d.ts +8 -0
  194. package/lib/src/types/partials/Period.js +3 -0
  195. package/lib/src/types/partials/ProcedureFocalDevice.d.ts +10 -0
  196. package/lib/src/types/partials/ProcedureFocalDevice.js +3 -0
  197. package/lib/src/types/partials/ProcedurePerformer.d.ts +11 -0
  198. package/lib/src/types/partials/ProcedurePerformer.js +3 -0
  199. package/lib/src/types/partials/Quantity.d.ts +12 -0
  200. package/lib/src/types/partials/Quantity.js +3 -0
  201. package/lib/src/types/partials/Range.d.ts +8 -0
  202. package/lib/src/types/partials/Range.js +3 -0
  203. package/lib/src/types/partials/Ratio.d.ts +8 -0
  204. package/lib/src/types/partials/Ratio.js +3 -0
  205. package/lib/src/types/partials/RatioRange.d.ts +9 -0
  206. package/lib/src/types/partials/RatioRange.js +3 -0
  207. package/lib/src/types/partials/Reference.d.ts +14 -0
  208. package/lib/src/types/partials/Reference.js +3 -0
  209. package/lib/src/types/partials/RelatedArtifact.d.ts +16 -0
  210. package/lib/src/types/partials/RelatedArtifact.js +3 -0
  211. package/lib/src/types/partials/SampledData.d.ts +15 -0
  212. package/lib/src/types/partials/SampledData.js +3 -0
  213. package/lib/src/types/partials/Signature.d.ts +16 -0
  214. package/lib/src/types/partials/Signature.js +3 -0
  215. package/lib/src/types/partials/Timing.d.ts +12 -0
  216. package/lib/src/types/partials/Timing.js +3 -0
  217. package/lib/src/types/partials/TimingRepeat.d.ts +30 -0
  218. package/lib/src/types/partials/TimingRepeat.js +3 -0
  219. package/lib/src/types/partials/TriggerDefinition.d.ts +19 -0
  220. package/lib/src/types/partials/TriggerDefinition.js +3 -0
  221. package/lib/src/types/partials/UsageContext.d.ts +15 -0
  222. package/lib/src/types/partials/UsageContext.js +3 -0
  223. package/lib/src/types/resources/AllergyIntolerance.d.ts +45 -0
  224. package/lib/src/types/resources/AllergyIntolerance.js +3 -0
  225. package/lib/src/types/resources/Bundle.d.ts +22 -0
  226. package/lib/src/types/resources/Bundle.js +3 -0
  227. package/lib/src/types/resources/CarePlan.d.ts +47 -0
  228. package/lib/src/types/resources/CarePlan.js +3 -0
  229. package/lib/src/types/resources/ClinicalImpression.d.ts +45 -0
  230. package/lib/src/types/resources/ClinicalImpression.js +3 -0
  231. package/lib/src/types/resources/Composition.d.ts +39 -0
  232. package/lib/src/types/resources/Composition.js +3 -0
  233. package/lib/src/types/resources/Condition.d.ts +51 -0
  234. package/lib/src/types/resources/Condition.js +3 -0
  235. package/lib/src/types/resources/Consent.d.ts +38 -0
  236. package/lib/src/types/resources/Consent.js +3 -0
  237. package/lib/src/types/resources/Device.d.ts +53 -0
  238. package/lib/src/types/resources/Device.js +3 -0
  239. package/lib/src/types/resources/DeviceUseStatement.d.ts +38 -0
  240. package/lib/src/types/resources/DeviceUseStatement.js +3 -0
  241. package/lib/src/types/resources/DiagnosticReport.d.ts +43 -0
  242. package/lib/src/types/resources/DiagnosticReport.js +3 -0
  243. package/lib/src/types/resources/DomainResource.d.ts +16 -0
  244. package/lib/src/types/resources/DomainResource.js +3 -0
  245. package/lib/src/types/resources/FamilyMemberHistory.d.ts +53 -0
  246. package/lib/src/types/resources/FamilyMemberHistory.js +3 -0
  247. package/lib/src/types/resources/Immunization.d.ts +56 -0
  248. package/lib/src/types/resources/Immunization.js +3 -0
  249. package/lib/src/types/resources/Medication.d.ts +30 -0
  250. package/lib/src/types/resources/Medication.js +3 -0
  251. package/lib/src/types/resources/MedicationRequest.d.ts +59 -0
  252. package/lib/src/types/resources/MedicationRequest.js +3 -0
  253. package/lib/src/types/resources/MedicationStatement.d.ts +42 -0
  254. package/lib/src/types/resources/MedicationStatement.js +3 -0
  255. package/lib/src/types/resources/Observation.d.ts +69 -0
  256. package/lib/src/types/resources/Observation.js +3 -0
  257. package/lib/src/types/resources/Organization.d.ts +32 -0
  258. package/lib/src/types/resources/Organization.js +3 -0
  259. package/lib/src/types/resources/Patient.d.ts +47 -0
  260. package/lib/src/types/resources/Patient.js +3 -0
  261. package/lib/src/types/resources/Procedure.d.ts +59 -0
  262. package/lib/src/types/resources/Procedure.js +3 -0
  263. package/lib/src/types/simpleTypes/Base64Binary.d.ts +1 -0
  264. package/lib/src/types/simpleTypes/Base64Binary.js +2 -0
  265. package/lib/src/types/simpleTypes/Canonical.d.ts +1 -0
  266. package/lib/src/types/simpleTypes/Canonical.js +2 -0
  267. package/lib/src/types/simpleTypes/Date.d.ts +1 -0
  268. package/lib/src/types/simpleTypes/Date.js +2 -0
  269. package/lib/src/types/simpleTypes/DateTime.d.ts +1 -0
  270. package/lib/src/types/simpleTypes/DateTime.js +2 -0
  271. package/lib/src/types/simpleTypes/Decimal.d.ts +1 -0
  272. package/lib/src/types/simpleTypes/Decimal.js +2 -0
  273. package/lib/src/types/simpleTypes/Id.d.ts +1 -0
  274. package/lib/src/types/simpleTypes/Id.js +2 -0
  275. package/lib/src/types/simpleTypes/Instant.d.ts +1 -0
  276. package/lib/src/types/simpleTypes/Instant.js +2 -0
  277. package/lib/src/types/simpleTypes/Int.d.ts +1 -0
  278. package/lib/src/types/simpleTypes/Int.js +2 -0
  279. package/lib/src/types/simpleTypes/Markdown.d.ts +1 -0
  280. package/lib/src/types/simpleTypes/Markdown.js +2 -0
  281. package/lib/src/types/simpleTypes/Oid.d.ts +1 -0
  282. package/lib/src/types/simpleTypes/Oid.js +2 -0
  283. package/lib/src/types/simpleTypes/ResourceContainer.d.ts +1 -0
  284. package/lib/src/types/simpleTypes/ResourceContainer.js +2 -0
  285. package/lib/src/types/simpleTypes/Time.d.ts +1 -0
  286. package/lib/src/types/simpleTypes/Time.js +2 -0
  287. package/lib/src/types/simpleTypes/UnsignedInt.d.ts +1 -0
  288. package/lib/src/types/simpleTypes/UnsignedInt.js +2 -0
  289. package/lib/src/types/simpleTypes/Uri.d.ts +1 -0
  290. package/lib/src/types/simpleTypes/Uri.js +2 -0
  291. package/lib/src/types/simpleTypes/Url.d.ts +1 -0
  292. package/lib/src/types/simpleTypes/Url.js +2 -0
  293. package/lib/src/types/simpleTypes/Uuid.d.ts +1 -0
  294. package/lib/src/types/simpleTypes/Uuid.js +2 -0
  295. package/lib/src/types/simpleTypes/Xhtml.d.ts +1 -0
  296. package/lib/src/types/simpleTypes/Xhtml.js +2 -0
  297. package/lib/test/fhir-summary-bundle/fhir-summary-bundle.test.d.ts +1 -0
  298. package/lib/test/fhir-summary-bundle/fhir-summary-bundle.test.js +72 -0
  299. package/lib/test/ips-test/ips.test.d.ts +1 -0
  300. package/lib/test/ips-test/ips.test.js +389 -0
  301. package/lib/test/narrativeGenerator/narrativeGenerator.test.d.ts +1 -0
  302. package/lib/test/narrativeGenerator/narrativeGenerator.test.js +676 -0
  303. package/lib/test/summary.test.d.ts +1 -0
  304. package/lib/test/summary.test.js +452 -0
  305. package/lib/test/utilities/testHelpers.d.ts +21 -0
  306. package/lib/test/utilities/testHelpers.js +137 -0
  307. package/package.json +126 -0
@@ -0,0 +1,676 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const path = __importStar(require("path"));
46
+ const narrative_generator_1 = require("../../src/generators/narrative_generator");
47
+ const ips_sections_1 = require("../../src/structures/ips_sections");
48
+ const ips_section_loinc_codes_1 = require("../../src/structures/ips_section_loinc_codes");
49
+ const testHelpers_1 = require("../utilities/testHelpers");
50
+ describe('Narrative Generator Tests', () => {
51
+ // Mock Resources for Testing
52
+ const mockPatient = {
53
+ resourceType: 'Patient',
54
+ id: 'test-patient-01',
55
+ identifier: [{ system: 'https://example.org', value: '12345' }],
56
+ name: [{ family: 'Doe', given: ['John'] }],
57
+ gender: 'male',
58
+ birthDate: '1980-01-01'
59
+ };
60
+ const mockAllergies = [
61
+ {
62
+ resourceType: 'AllergyIntolerance',
63
+ id: 'allergy-01',
64
+ clinicalStatus: { coding: [{ code: 'active' }] },
65
+ verificationStatus: { coding: [{ code: 'confirmed' }] },
66
+ code: { text: 'Penicillin' },
67
+ patient: { reference: 'Patient/test-patient-01' }
68
+ },
69
+ {
70
+ resourceType: 'AllergyIntolerance',
71
+ id: 'allergy-02',
72
+ clinicalStatus: { coding: [{ code: 'active' }] },
73
+ verificationStatus: { coding: [{ code: 'confirmed' }] },
74
+ code: { text: 'Peanuts' },
75
+ patient: { reference: 'Patient/test-patient-01' },
76
+ reaction: [
77
+ {
78
+ manifestation: [
79
+ { text: 'Anaphylaxis' }
80
+ ],
81
+ severity: 'severe'
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ resourceType: 'AllergyIntolerance',
87
+ id: 'allergy-03',
88
+ clinicalStatus: { coding: [{ code: 'inactive' }] },
89
+ verificationStatus: { coding: [{ code: 'confirmed' }] },
90
+ code: { text: 'Latex' },
91
+ patient: { reference: 'Patient/test-patient-01' },
92
+ reaction: [
93
+ {
94
+ manifestation: [
95
+ { text: 'Skin rash' }
96
+ ],
97
+ severity: 'moderate'
98
+ }
99
+ ]
100
+ }
101
+ ];
102
+ const mockMedications = [
103
+ {
104
+ resourceType: 'MedicationStatement',
105
+ id: 'med-01',
106
+ status: 'active',
107
+ medicationCodeableConcept: { text: 'Aspirin' },
108
+ subject: { reference: 'Patient/test-patient-01' }
109
+ },
110
+ {
111
+ resourceType: 'MedicationStatement',
112
+ id: 'med-02',
113
+ status: 'active',
114
+ medicationCodeableConcept: { text: 'Lisinopril' },
115
+ subject: { reference: 'Patient/test-patient-01' },
116
+ dosage: [
117
+ {
118
+ text: '10mg daily',
119
+ timing: {
120
+ repeat: {
121
+ frequency: 1,
122
+ period: 1,
123
+ periodUnit: 'd'
124
+ }
125
+ }
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ resourceType: 'MedicationStatement',
131
+ id: 'med-03',
132
+ status: 'completed',
133
+ medicationCodeableConcept: { text: 'Amoxicillin' },
134
+ subject: { reference: 'Patient/test-patient-01' },
135
+ dosage: [
136
+ {
137
+ text: '500mg three times daily',
138
+ timing: {
139
+ repeat: {
140
+ frequency: 3,
141
+ period: 1,
142
+ periodUnit: 'd'
143
+ }
144
+ }
145
+ }
146
+ ],
147
+ effectivePeriod: {
148
+ start: '2023-12-01',
149
+ end: '2023-12-10'
150
+ }
151
+ }
152
+ ];
153
+ const mockConditions = [
154
+ {
155
+ resourceType: 'Condition',
156
+ id: 'condition-01',
157
+ clinicalStatus: { coding: [{ code: 'active' }] },
158
+ verificationStatus: { coding: [{ code: 'confirmed' }] },
159
+ code: { text: 'Hypertension' },
160
+ subject: { reference: 'Patient/test-patient-01' }
161
+ },
162
+ {
163
+ resourceType: 'Condition',
164
+ id: 'condition-02',
165
+ clinicalStatus: { coding: [{ code: 'active' }] },
166
+ verificationStatus: { coding: [{ code: 'confirmed' }] },
167
+ code: { text: 'Type 2 Diabetes Mellitus' },
168
+ subject: { reference: 'Patient/test-patient-01' },
169
+ onsetDateTime: '2020-03-15'
170
+ },
171
+ {
172
+ resourceType: 'Condition',
173
+ id: 'condition-03',
174
+ clinicalStatus: { coding: [{ code: 'resolved' }] },
175
+ verificationStatus: { coding: [{ code: 'confirmed' }] },
176
+ code: { text: 'Pneumonia' },
177
+ subject: { reference: 'Patient/test-patient-01' },
178
+ onsetDateTime: '2022-11-01',
179
+ abatementDateTime: '2022-11-30'
180
+ }
181
+ ];
182
+ const mockImmunizations = [
183
+ {
184
+ resourceType: 'Immunization',
185
+ id: 'imm-01',
186
+ status: 'completed',
187
+ vaccineCode: { text: 'COVID-19 Vaccine' },
188
+ patient: { reference: 'Patient/test-patient-01' },
189
+ primarySource: true,
190
+ occurrenceDateTime: '2024-01-01'
191
+ },
192
+ {
193
+ resourceType: 'Immunization',
194
+ id: 'imm-02',
195
+ status: 'completed',
196
+ vaccineCode: { text: 'Influenza Vaccine' },
197
+ patient: { reference: 'Patient/test-patient-01' },
198
+ primarySource: true,
199
+ occurrenceDateTime: '2023-10-15',
200
+ lotNumber: 'FLUVAX20231015'
201
+ },
202
+ {
203
+ resourceType: 'Immunization',
204
+ id: 'imm-03',
205
+ status: 'completed',
206
+ vaccineCode: { text: 'Tetanus Vaccine' },
207
+ patient: { reference: 'Patient/test-patient-01' },
208
+ primarySource: true,
209
+ occurrenceDateTime: '2020-05-22',
210
+ doseQuantity: {
211
+ value: 0.5,
212
+ unit: 'mL'
213
+ }
214
+ }
215
+ ];
216
+ const mockLaboratoryResults = [
217
+ {
218
+ resourceType: 'Observation',
219
+ id: 'lab-01',
220
+ status: 'final',
221
+ category: [{ coding: [{ code: 'laboratory' }] }],
222
+ code: { text: 'Blood Glucose' },
223
+ subject: { reference: 'Patient/test-patient-01' },
224
+ effectiveDateTime: '2023-01-01',
225
+ valueQuantity: { value: 100, unit: 'mg/dL' }
226
+ },
227
+ {
228
+ resourceType: 'Observation',
229
+ id: 'lab-02',
230
+ status: 'final',
231
+ category: [{ coding: [{ code: 'laboratory' }] }],
232
+ code: { text: 'Hemoglobin A1c' },
233
+ subject: { reference: 'Patient/test-patient-01' },
234
+ effectiveDateTime: '2023-01-01',
235
+ valueQuantity: { value: 6.5, unit: '%' },
236
+ interpretation: [{
237
+ coding: [{
238
+ system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation',
239
+ code: 'H',
240
+ display: 'High'
241
+ }]
242
+ }]
243
+ },
244
+ {
245
+ resourceType: 'Observation',
246
+ id: 'lab-03',
247
+ status: 'final',
248
+ category: [{ coding: [{ code: 'laboratory' }] }],
249
+ code: { text: 'Cholesterol Panel' },
250
+ subject: { reference: 'Patient/test-patient-01' },
251
+ effectiveDateTime: '2023-01-01',
252
+ hasMember: [
253
+ { reference: 'Observation/ldl-01' },
254
+ { reference: 'Observation/hdl-01' },
255
+ { reference: 'Observation/triglycerides-01' }
256
+ ]
257
+ },
258
+ {
259
+ resourceType: 'Observation',
260
+ id: 'lab-04',
261
+ status: 'final',
262
+ category: [{ coding: [{ code: 'laboratory' }] }],
263
+ code: { text: 'CBC with Differential' },
264
+ subject: { reference: 'Patient/test-patient-01' },
265
+ effectiveDateTime: '2023-01-15',
266
+ component: [
267
+ {
268
+ code: { text: 'WBC' },
269
+ valueQuantity: { value: 7.5, unit: '10^9/L' }
270
+ },
271
+ {
272
+ code: { text: 'RBC' },
273
+ valueQuantity: { value: 4.9, unit: '10^12/L' }
274
+ }
275
+ ]
276
+ }
277
+ ];
278
+ // Additional mock resources for other sections
279
+ const mockVitalSigns = [
280
+ {
281
+ resourceType: 'Observation',
282
+ id: 'vital-01',
283
+ status: 'final',
284
+ category: [{ coding: [{ code: 'vital-signs' }] }],
285
+ code: { text: 'Blood Pressure' },
286
+ subject: { reference: 'Patient/test-patient-01' },
287
+ effectiveDateTime: '2023-01-01',
288
+ component: [
289
+ {
290
+ code: { text: 'Systolic' },
291
+ valueQuantity: { value: 120, unit: 'mmHg' }
292
+ },
293
+ {
294
+ code: { text: 'Diastolic' },
295
+ valueQuantity: { value: 80, unit: 'mmHg' }
296
+ }
297
+ ]
298
+ },
299
+ {
300
+ resourceType: 'Observation',
301
+ id: 'vital-02',
302
+ status: 'final',
303
+ category: [{ coding: [{ code: 'vital-signs' }] }],
304
+ code: { text: 'Heart Rate' },
305
+ subject: { reference: 'Patient/test-patient-01' },
306
+ effectiveDateTime: '2023-01-01',
307
+ valueQuantity: { value: 72, unit: 'bpm' }
308
+ },
309
+ {
310
+ resourceType: 'Observation',
311
+ id: 'vital-03',
312
+ status: 'final',
313
+ category: [{ coding: [{ code: 'vital-signs' }] }],
314
+ code: { text: 'Body Temperature' },
315
+ subject: { reference: 'Patient/test-patient-01' },
316
+ effectiveDateTime: '2023-01-01',
317
+ valueQuantity: { value: 37.0, unit: '°C' }
318
+ }
319
+ ];
320
+ const mockMedicalDevices = [
321
+ {
322
+ resourceType: 'Device',
323
+ id: 'device-01',
324
+ status: 'active',
325
+ deviceName: [{ name: 'Pacemaker', type: 'user-friendly-name' }],
326
+ patient: { reference: 'Patient/test-patient-01' }
327
+ },
328
+ {
329
+ resourceType: 'Device',
330
+ id: 'device-02',
331
+ status: 'active',
332
+ deviceName: [{ name: 'Insulin Pump', type: 'user-friendly-name' }],
333
+ patient: { reference: 'Patient/test-patient-01' },
334
+ manufacturer: 'MedTech Inc.',
335
+ modelNumber: 'IP-2023',
336
+ manufactureDate: '2023-01-01'
337
+ },
338
+ {
339
+ resourceType: 'Device',
340
+ id: 'device-03',
341
+ status: 'inactive',
342
+ deviceName: [{ name: 'Stent', type: 'user-friendly-name' }],
343
+ patient: { reference: 'Patient/test-patient-01' },
344
+ note: [{ text: 'Removed due to infection' }]
345
+ }
346
+ ];
347
+ const mockDiagnosticReports = [
348
+ {
349
+ resourceType: 'DiagnosticReport',
350
+ id: 'report-01',
351
+ status: 'final',
352
+ code: { text: 'Chest X-Ray' },
353
+ subject: { reference: 'Patient/test-patient-01' },
354
+ effectiveDateTime: '2023-01-15',
355
+ conclusion: 'No acute cardiopulmonary process'
356
+ },
357
+ {
358
+ resourceType: 'DiagnosticReport',
359
+ id: 'report-02',
360
+ status: 'final',
361
+ code: { text: 'MRI Brain' },
362
+ subject: { reference: 'Patient/test-patient-01' },
363
+ effectiveDateTime: '2023-02-01',
364
+ conclusion: 'Normal brain MRI',
365
+ presentedForm: [
366
+ {
367
+ contentType: 'application/pdf',
368
+ title: 'Brain MRI Report'
369
+ }
370
+ ]
371
+ }
372
+ ];
373
+ const mockProcedures = [
374
+ {
375
+ resourceType: 'Procedure',
376
+ id: 'proc-01',
377
+ status: 'completed',
378
+ code: { text: 'Appendectomy' },
379
+ subject: { reference: 'Patient/test-patient-01' },
380
+ performedDateTime: '2022-05-10'
381
+ },
382
+ {
383
+ resourceType: 'Procedure',
384
+ id: 'proc-02',
385
+ status: 'completed',
386
+ code: { text: 'Colonoscopy' },
387
+ subject: { reference: 'Patient/test-patient-01' },
388
+ performedDateTime: '2023-03-15',
389
+ note: [{ text: 'No polyps found' }]
390
+ }
391
+ ];
392
+ const mockFamilyHistory = [
393
+ {
394
+ resourceType: 'FamilyMemberHistory',
395
+ id: 'fam-01',
396
+ status: 'completed',
397
+ patient: { reference: 'Patient/test-patient-01' },
398
+ relationship: { text: 'Father' },
399
+ condition: [
400
+ {
401
+ code: { text: 'Heart Disease' },
402
+ onsetAge: { value: 60, unit: 'years' }
403
+ }
404
+ ]
405
+ },
406
+ {
407
+ resourceType: 'FamilyMemberHistory',
408
+ id: 'fam-02',
409
+ status: 'completed',
410
+ patient: { reference: 'Patient/test-patient-01' },
411
+ relationship: { text: 'Mother' },
412
+ condition: [
413
+ {
414
+ code: { text: 'Type 2 Diabetes' },
415
+ onsetAge: { value: 55, unit: 'years' }
416
+ }
417
+ ]
418
+ }
419
+ ];
420
+ const mockSocialHistory = [
421
+ {
422
+ resourceType: 'Observation',
423
+ id: 'social-01',
424
+ status: 'final',
425
+ category: [{ coding: [{ code: 'social-history' }] }],
426
+ code: { text: 'Tobacco Use' },
427
+ subject: { reference: 'Patient/test-patient-01' },
428
+ effectiveDateTime: '2023-01-01',
429
+ valueCodeableConcept: { text: 'Former smoker' }
430
+ },
431
+ {
432
+ resourceType: 'Observation',
433
+ id: 'social-02',
434
+ status: 'final',
435
+ category: [{ coding: [{ code: 'social-history' }] }],
436
+ code: { text: 'Alcohol Use' },
437
+ subject: { reference: 'Patient/test-patient-01' },
438
+ effectiveDateTime: '2023-01-01',
439
+ valueCodeableConcept: { text: 'Social drinker' }
440
+ }
441
+ ];
442
+ const mockAdvanceDirectives = [
443
+ {
444
+ resourceType: 'Consent',
445
+ id: 'adv-01',
446
+ status: 'active',
447
+ category: [{ text: 'Advance Directive' }],
448
+ patient: { reference: 'Patient/test-patient-01' },
449
+ dateTime: '2023-01-01',
450
+ provision: {
451
+ type: 'permit',
452
+ period: {
453
+ start: '2023-01-01'
454
+ }
455
+ },
456
+ scope: {
457
+ coding: [{
458
+ system: 'http://terminology.hl7.org/CodeSystem/consentscope',
459
+ code: 'advance-directive',
460
+ display: 'Advance Directive'
461
+ }]
462
+ }
463
+ }
464
+ ];
465
+ const mockCarePlans = [
466
+ {
467
+ resourceType: 'CarePlan',
468
+ id: 'care-01',
469
+ status: 'active',
470
+ intent: 'plan',
471
+ title: 'Diabetes Management Plan',
472
+ subject: { reference: 'Patient/test-patient-01' },
473
+ period: {
474
+ start: '2023-01-01'
475
+ },
476
+ activity: [
477
+ {
478
+ detail: {
479
+ status: 'in-progress',
480
+ description: 'Monitor blood glucose daily'
481
+ }
482
+ },
483
+ {
484
+ detail: {
485
+ status: 'in-progress',
486
+ description: 'Low-carbohydrate diet'
487
+ }
488
+ }
489
+ ]
490
+ }
491
+ ];
492
+ const mockClinicalImpressions = [
493
+ {
494
+ resourceType: 'ClinicalImpression',
495
+ id: 'imp-01',
496
+ status: 'completed',
497
+ subject: { reference: 'Patient/test-patient-01' },
498
+ date: '2023-01-15',
499
+ summary: 'Patient presents with symptoms consistent with Type 2 Diabetes',
500
+ finding: [
501
+ {
502
+ itemCodeableConcept: { text: 'Elevated blood glucose' }
503
+ },
504
+ {
505
+ itemCodeableConcept: { text: 'Polydipsia' }
506
+ }
507
+ ]
508
+ }
509
+ ];
510
+ it('should generate narrative content for patient using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
511
+ const section = ips_sections_1.IPSSections.PATIENT;
512
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, [mockPatient], 'America/New_York');
513
+ expect(result).toBeDefined();
514
+ console.info(result);
515
+ // Read narrative from file
516
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
517
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
518
+ }));
519
+ it('should generate narrative content for allergies using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
520
+ const section = ips_sections_1.IPSSections.ALLERGIES;
521
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockAllergies, 'America/New_York');
522
+ expect(result).toBeDefined();
523
+ expect(result).toContain('Allergies and Intolerances');
524
+ expect(result).toContain('Penicillin');
525
+ expect(result).toContain('Peanuts');
526
+ expect(result).toContain('Latex');
527
+ expect(result).toContain('Anaphylaxis');
528
+ console.info(result);
529
+ // Read narrative from file
530
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
531
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
532
+ }));
533
+ it('should generate narrative content for medications using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
534
+ const section = ips_sections_1.IPSSections.MEDICATIONS;
535
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockMedications, 'America/New_York');
536
+ expect(result).toBeDefined();
537
+ expect(result).toContain('Medication');
538
+ expect(result).toContain('Aspirin');
539
+ expect(result).toContain('Lisinopril');
540
+ expect(result).toContain('10mg daily');
541
+ expect(result).toContain('Amoxicillin');
542
+ console.info(result);
543
+ // Read narrative from file
544
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
545
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
546
+ }));
547
+ it('should generate narrative content for problem list using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
548
+ const section = ips_sections_1.IPSSections.PROBLEMS;
549
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockConditions, 'America/New_York');
550
+ expect(result).toBeDefined();
551
+ expect(result).toContain('Problems');
552
+ expect(result).toContain('Hypertension');
553
+ expect(result).toContain('Type 2 Diabetes Mellitus');
554
+ expect(result).toContain('Pneumonia');
555
+ console.info(result);
556
+ // Read narrative from file
557
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
558
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
559
+ }));
560
+ it('should generate narrative content for immunizations using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
561
+ const section = ips_sections_1.IPSSections.IMMUNIZATIONS;
562
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockImmunizations, 'America/New_York');
563
+ expect(result).toBeDefined();
564
+ expect(result).toContain('Immunizations');
565
+ expect(result).toContain('COVID-19 Vaccine');
566
+ expect(result).toContain('Influenza Vaccine');
567
+ expect(result).toContain('Tetanus Vaccine');
568
+ console.info(result);
569
+ // Read narrative from file
570
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
571
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
572
+ }));
573
+ it('should generate narrative content for vital signs using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
574
+ const section = ips_sections_1.IPSSections.VITAL_SIGNS;
575
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockVitalSigns, 'America/New_York');
576
+ expect(result).toBeDefined();
577
+ expect(result).toContain('Vital Signs');
578
+ expect(result).toContain('Blood Pressure');
579
+ expect(result).toContain('Heart Rate');
580
+ expect(result).toContain('Body Temperature');
581
+ console.info(result);
582
+ // Read narrative from file
583
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
584
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
585
+ }));
586
+ it('should generate narrative content for medical devices using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
587
+ const section = ips_sections_1.IPSSections.MEDICAL_DEVICES;
588
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockMedicalDevices, 'America/New_York');
589
+ expect(result).toBeDefined();
590
+ console.info(result);
591
+ // Read narrative from file
592
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
593
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
594
+ }));
595
+ it('should generate narrative content for diagnostic reports using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
596
+ const section = ips_sections_1.IPSSections.DIAGNOSTIC_REPORTS;
597
+ const mockDiagnosticReportsAndLaboratoryResults = [...mockDiagnosticReports, ...mockLaboratoryResults];
598
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockDiagnosticReportsAndLaboratoryResults, 'America/New_York');
599
+ expect(result).toBeDefined();
600
+ expect(result).toContain('Diagnostic');
601
+ expect(result).toContain('Chest X-Ray');
602
+ expect(result).toContain('MRI Brain');
603
+ console.info(result);
604
+ // Read narrative from file
605
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
606
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
607
+ }));
608
+ it('should generate narrative content for procedures using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
609
+ const section = ips_sections_1.IPSSections.PROCEDURES;
610
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockProcedures, 'America/New_York');
611
+ expect(result).toBeDefined();
612
+ expect(result).toContain('Procedures');
613
+ expect(result).toContain('Appendectomy');
614
+ expect(result).toContain('Colonoscopy');
615
+ console.info(result);
616
+ // Read narrative from file
617
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
618
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
619
+ }));
620
+ it('should generate narrative content for family history using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
621
+ const section = ips_sections_1.IPSSections.FAMILY_HISTORY;
622
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockFamilyHistory, 'America/New_York');
623
+ expect(result).toBeDefined();
624
+ expect(result).toContain('Family History');
625
+ expect(result).toContain('Heart Disease');
626
+ expect(result).toContain('Type 2 Diabetes');
627
+ console.info(result);
628
+ // Read narrative from file
629
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
630
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
631
+ }));
632
+ it('should generate narrative content for social history using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
633
+ const section = ips_sections_1.IPSSections.SOCIAL_HISTORY;
634
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockSocialHistory, 'America/New_York');
635
+ expect(result).toBeDefined();
636
+ expect(result).toContain('Social History');
637
+ expect(result).toContain('Tobacco Use');
638
+ expect(result).toContain('Alcohol Use');
639
+ console.info(result);
640
+ // Read narrative from file
641
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
642
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
643
+ }));
644
+ it('should generate narrative content for advance directives using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
645
+ const section = ips_sections_1.IPSSections.ADVANCE_DIRECTIVES;
646
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockAdvanceDirectives, 'America/New_York');
647
+ expect(result).toBeDefined();
648
+ expect(result).toContain('Advance Directives');
649
+ console.info(result);
650
+ // Read narrative from file
651
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
652
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
653
+ }));
654
+ it('should generate narrative content for care plans using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
655
+ const section = ips_sections_1.IPSSections.CARE_PLAN;
656
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockCarePlans, 'America/New_York');
657
+ expect(result).toBeDefined();
658
+ expect(result).toContain('Care');
659
+ // expect(result).toContain('Diabetes Management Plan');
660
+ console.info(result);
661
+ // Read narrative from file
662
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
663
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
664
+ }));
665
+ it('should generate narrative content for clinical impressions using NarrativeGenerator', () => __awaiter(void 0, void 0, void 0, function* () {
666
+ const section = ips_sections_1.IPSSections.CLINICAL_IMPRESSION;
667
+ const result = narrative_generator_1.NarrativeGenerator.generateNarrativeContent(section, mockClinicalImpressions, 'America/New_York');
668
+ expect(result).toBeDefined();
669
+ expect(result).toContain('Clinical Impressions');
670
+ expect(result).toContain('Type 2 Diabetes');
671
+ console.info(result);
672
+ // Read narrative from file
673
+ const expectedDiv = (0, testHelpers_1.readNarrativeFile)(path.join(__dirname, 'fixtures'), ips_section_loinc_codes_1.IPS_SECTION_LOINC_CODES[section], ips_section_loinc_codes_1.IPS_SECTION_DISPLAY_NAMES[section]);
674
+ yield (0, testHelpers_1.compareNarratives)(result, expectedDiv);
675
+ }));
676
+ });
@@ -0,0 +1 @@
1
+ export {};