@smile-cdr/fhirts 2.3.0 → 2.4.0

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 (306) hide show
  1. package/.claude/settings.local.json +12 -0
  2. package/.github/workflows/npm-publish.yml +12 -6
  3. package/.github/workflows/pr-build.yml +7 -3
  4. package/.prettierignore +22 -0
  5. package/.prettierrc +10 -0
  6. package/GETTINGSTARTED.md +57 -15
  7. package/dist/FHIR-DSTU2.js +1 -1
  8. package/dist/FHIR-R3.js +3 -1
  9. package/dist/FHIR-R4/classes/account.js +1 -1
  10. package/dist/FHIR-R4/classes/activityDefinition.js +1 -1
  11. package/dist/FHIR-R4/classes/address.js +1 -1
  12. package/dist/FHIR-R4/classes/adverseEvent.js +1 -1
  13. package/dist/FHIR-R4/classes/age.js +1 -1
  14. package/dist/FHIR-R4/classes/allergyIntolerance.js +1 -1
  15. package/dist/FHIR-R4/classes/allergyIntoleranceReaction.js +1 -1
  16. package/dist/FHIR-R4/classes/appointment.js +1 -1
  17. package/dist/FHIR-R4/classes/appointmentParticipant.js +1 -1
  18. package/dist/FHIR-R4/classes/auditEvent.js +1 -1
  19. package/dist/FHIR-R4/classes/auditEventNetwork.js +1 -1
  20. package/dist/FHIR-R4/classes/biologicallyDerivedProduct.js +1 -1
  21. package/dist/FHIR-R4/classes/biologicallyDerivedProductStorage.js +1 -1
  22. package/dist/FHIR-R4/classes/bundle.js +1 -1
  23. package/dist/FHIR-R4/classes/capabilityStatement.js +1 -1
  24. package/dist/FHIR-R4/classes/capabilityStatementDocument.js +1 -1
  25. package/dist/FHIR-R4/classes/capabilityStatementInteraction.js +1 -1
  26. package/dist/FHIR-R4/classes/capabilityStatementInteraction1.js +1 -1
  27. package/dist/FHIR-R4/classes/capabilityStatementResource.js +1 -1
  28. package/dist/FHIR-R4/classes/capabilityStatementRest.js +1 -1
  29. package/dist/FHIR-R4/classes/capabilityStatementSearchParam.js +1 -1
  30. package/dist/FHIR-R4/classes/capabilityStatementSupportedMessage.js +1 -1
  31. package/dist/FHIR-R4/classes/carePlanDetail.js +1 -1
  32. package/dist/FHIR-R4/classes/careTeam.js +1 -1
  33. package/dist/FHIR-R4/classes/catalogEntry.js +1 -1
  34. package/dist/FHIR-R4/classes/catalogEntryRelatedEntry.js +1 -1
  35. package/dist/FHIR-R4/classes/chargeItem.js +1 -1
  36. package/dist/FHIR-R4/classes/chargeItemDefinition.js +1 -1
  37. package/dist/FHIR-R4/classes/claim.js +1 -1
  38. package/dist/FHIR-R4/classes/claimResponseProcessNote.js +1 -1
  39. package/dist/FHIR-R4/classes/codeSystem.js +1 -1
  40. package/dist/FHIR-R4/classes/codeSystemProperty.js +1 -1
  41. package/dist/FHIR-R4/classes/compartmentDefinition.js +1 -1
  42. package/dist/FHIR-R4/classes/composition.js +1 -1
  43. package/dist/FHIR-R4/classes/compositionAttester.js +1 -1
  44. package/dist/FHIR-R4/classes/conceptMap.js +1 -1
  45. package/dist/FHIR-R4/classes/conceptMapTarget.js +1 -1
  46. package/dist/FHIR-R4/classes/conceptMapUnmapped.js +1 -1
  47. package/dist/FHIR-R4/classes/consent.js +1 -1
  48. package/dist/FHIR-R4/classes/consentData.js +1 -1
  49. package/dist/FHIR-R4/classes/consentProvision.js +1 -1
  50. package/dist/FHIR-R4/classes/contactPoint.js +1 -1
  51. package/dist/FHIR-R4/classes/contributor.js +1 -1
  52. package/dist/FHIR-R4/classes/count.js +1 -1
  53. package/dist/FHIR-R4/classes/coverageEligibilityResponse.js +1 -1
  54. package/dist/FHIR-R4/classes/dataRequirementSort.js +1 -1
  55. package/dist/FHIR-R4/classes/detectedIssue.js +1 -1
  56. package/dist/FHIR-R4/classes/device.js +1 -1
  57. package/dist/FHIR-R4/classes/deviceDefinitionDeviceName.js +1 -1
  58. package/dist/FHIR-R4/classes/deviceDeviceName.js +1 -1
  59. package/dist/FHIR-R4/classes/deviceMetric.js +1 -1
  60. package/dist/FHIR-R4/classes/deviceMetricCalibration.js +1 -1
  61. package/dist/FHIR-R4/classes/deviceUdiCarrier.js +1 -1
  62. package/dist/FHIR-R4/classes/deviceUseStatement.js +1 -1
  63. package/dist/FHIR-R4/classes/diagnosticReport.js +1 -1
  64. package/dist/FHIR-R4/classes/distance.js +1 -1
  65. package/dist/FHIR-R4/classes/documentManifest.js +1 -1
  66. package/dist/FHIR-R4/classes/documentReference.js +1 -1
  67. package/dist/FHIR-R4/classes/documentReferenceRelatesTo.js +1 -1
  68. package/dist/FHIR-R4/classes/duration.js +1 -1
  69. package/dist/FHIR-R4/classes/effectEvidenceSynthesis.js +1 -1
  70. package/dist/FHIR-R4/classes/effectEvidenceSynthesisResultsByExposure.js +1 -1
  71. package/dist/FHIR-R4/classes/elementDefinitionBinding.js +1 -1
  72. package/dist/FHIR-R4/classes/elementDefinitionConstraint.js +1 -1
  73. package/dist/FHIR-R4/classes/elementDefinitionDiscriminator.js +1 -1
  74. package/dist/FHIR-R4/classes/elementDefinitionSlicing.js +1 -1
  75. package/dist/FHIR-R4/classes/elementDefinitionType.js +1 -1
  76. package/dist/FHIR-R4/classes/encounter.js +1 -1
  77. package/dist/FHIR-R4/classes/encounterLocation.js +1 -1
  78. package/dist/FHIR-R4/classes/encounterStatusHistory.js +1 -1
  79. package/dist/FHIR-R4/classes/endpoint.js +1 -1
  80. package/dist/FHIR-R4/classes/enrollmentResponse.js +1 -1
  81. package/dist/FHIR-R4/classes/episodeOfCare.js +1 -1
  82. package/dist/FHIR-R4/classes/episodeOfCareStatusHistory.js +1 -1
  83. package/dist/FHIR-R4/classes/eventDefinition.js +1 -1
  84. package/dist/FHIR-R4/classes/evidence.js +1 -1
  85. package/dist/FHIR-R4/classes/evidenceVariable.js +1 -1
  86. package/dist/FHIR-R4/classes/evidenceVariableCharacteristic.js +1 -1
  87. package/dist/FHIR-R4/classes/exampleScenario.js +1 -1
  88. package/dist/FHIR-R4/classes/exampleScenarioActor.js +1 -1
  89. package/dist/FHIR-R4/classes/explanationOfBenefit.js +1 -1
  90. package/dist/FHIR-R4/classes/explanationOfBenefitProcessNote.js +1 -1
  91. package/dist/FHIR-R4/classes/expression.js +1 -1
  92. package/dist/FHIR-R4/classes/familyMemberHistory.js +1 -1
  93. package/dist/FHIR-R4/classes/flag.js +1 -1
  94. package/dist/FHIR-R4/classes/goal.js +1 -1
  95. package/dist/FHIR-R4/classes/graphDefinition.js +1 -1
  96. package/dist/FHIR-R4/classes/graphDefinitionCompartment.js +1 -1
  97. package/dist/FHIR-R4/classes/group.js +1 -1
  98. package/dist/FHIR-R4/classes/guidanceResponse.js +1 -1
  99. package/dist/FHIR-R4/classes/humanName.js +1 -1
  100. package/dist/FHIR-R4/classes/identifier.js +1 -1
  101. package/dist/FHIR-R4/classes/imagingStudy.js +1 -1
  102. package/dist/FHIR-R4/classes/implementationGuide.js +1 -1
  103. package/dist/FHIR-R4/classes/implementationGuidePage.js +1 -1
  104. package/dist/FHIR-R4/classes/implementationGuideParameter.js +1 -1
  105. package/dist/FHIR-R4/classes/insurancePlan.js +1 -1
  106. package/dist/FHIR-R4/classes/invoice.js +1 -1
  107. package/dist/FHIR-R4/classes/invoicePriceComponent.js +1 -1
  108. package/dist/FHIR-R4/classes/library.js +1 -1
  109. package/dist/FHIR-R4/classes/linkageItem.js +1 -1
  110. package/dist/FHIR-R4/classes/list.js +1 -1
  111. package/dist/FHIR-R4/classes/location.js +1 -1
  112. package/dist/FHIR-R4/classes/measure.js +1 -1
  113. package/dist/FHIR-R4/classes/measureReport.js +1 -1
  114. package/dist/FHIR-R4/classes/messageDefinition.js +1 -1
  115. package/dist/FHIR-R4/classes/messageHeaderResponse.js +1 -1
  116. package/dist/FHIR-R4/classes/molecularSequence.js +1 -1
  117. package/dist/FHIR-R4/classes/molecularSequenceQuality.js +1 -1
  118. package/dist/FHIR-R4/classes/molecularSequenceReferenceSeq.js +1 -1
  119. package/dist/FHIR-R4/classes/molecularSequenceRepository.js +1 -1
  120. package/dist/FHIR-R4/classes/namingSystem.js +1 -1
  121. package/dist/FHIR-R4/classes/namingSystemUniqueId.js +1 -1
  122. package/dist/FHIR-R4/classes/narrative.js +1 -1
  123. package/dist/FHIR-R4/classes/observation.js +1 -1
  124. package/dist/FHIR-R4/classes/observationDefinitionQualifiedInterval.js +1 -1
  125. package/dist/FHIR-R4/classes/operationDefinition.js +1 -1
  126. package/dist/FHIR-R4/classes/operationDefinitionBinding.js +1 -1
  127. package/dist/FHIR-R4/classes/operationDefinitionParameter.js +1 -1
  128. package/dist/FHIR-R4/classes/patient.js +1 -1
  129. package/dist/FHIR-R4/classes/patientContact.js +1 -1
  130. package/dist/FHIR-R4/classes/patientLink.js +1 -1
  131. package/dist/FHIR-R4/classes/paymentReconciliation.js +1 -1
  132. package/dist/FHIR-R4/classes/paymentReconciliationProcessNote.js +1 -1
  133. package/dist/FHIR-R4/classes/person.js +1 -1
  134. package/dist/FHIR-R4/classes/personLink.js +1 -1
  135. package/dist/FHIR-R4/classes/planDefinition.js +1 -1
  136. package/dist/FHIR-R4/classes/planDefinitionAction.js +1 -1
  137. package/dist/FHIR-R4/classes/planDefinitionCondition.js +1 -1
  138. package/dist/FHIR-R4/classes/planDefinitionParticipant.js +1 -1
  139. package/dist/FHIR-R4/classes/planDefinitionRelatedAction.js +1 -1
  140. package/dist/FHIR-R4/classes/practitioner.js +1 -1
  141. package/dist/FHIR-R4/classes/provenanceEntity.js +1 -1
  142. package/dist/FHIR-R4/classes/quantity.js +1 -1
  143. package/dist/FHIR-R4/classes/questionnaire.js +1 -1
  144. package/dist/FHIR-R4/classes/questionnaireEnableWhen.js +1 -1
  145. package/dist/FHIR-R4/classes/questionnaireItem.js +1 -1
  146. package/dist/FHIR-R4/classes/questionnaireResponse.js +1 -1
  147. package/dist/FHIR-R4/classes/relatedArtifact.js +1 -1
  148. package/dist/FHIR-R4/classes/relatedPerson.js +1 -1
  149. package/dist/FHIR-R4/classes/researchDefinition.js +1 -1
  150. package/dist/FHIR-R4/classes/researchElementDefinition.js +1 -1
  151. package/dist/FHIR-R4/classes/researchElementDefinitionCharacteristic.js +1 -1
  152. package/dist/FHIR-R4/classes/researchStudy.js +1 -1
  153. package/dist/FHIR-R4/classes/researchSubject.js +1 -1
  154. package/dist/FHIR-R4/classes/riskEvidenceSynthesis.js +1 -1
  155. package/dist/FHIR-R4/classes/searchParameter.js +1 -1
  156. package/dist/FHIR-R4/classes/slot.js +1 -1
  157. package/dist/FHIR-R4/classes/specimen.js +1 -1
  158. package/dist/FHIR-R4/classes/specimenDefinitionTypeTested.js +1 -1
  159. package/dist/FHIR-R4/classes/structureDefinition.js +1 -1
  160. package/dist/FHIR-R4/classes/structureDefinitionContext.js +1 -1
  161. package/dist/FHIR-R4/classes/structureMap.js +1 -1
  162. package/dist/FHIR-R4/classes/structureMapGroup.js +1 -1
  163. package/dist/FHIR-R4/classes/structureMapInput.js +1 -1
  164. package/dist/FHIR-R4/classes/structureMapSource.js +1 -1
  165. package/dist/FHIR-R4/classes/structureMapStructure.js +1 -1
  166. package/dist/FHIR-R4/classes/structureMapTarget.js +1 -1
  167. package/dist/FHIR-R4/classes/subscription.js +1 -1
  168. package/dist/FHIR-R4/classes/subscriptionChannel.js +1 -1
  169. package/dist/FHIR-R4/classes/substance.js +1 -1
  170. package/dist/FHIR-R4/classes/supplyDelivery.js +1 -1
  171. package/dist/FHIR-R4/classes/supplyRequest.js +1 -1
  172. package/dist/FHIR-R4/classes/task.js +1 -1
  173. package/dist/FHIR-R4/classes/terminologyCapabilities.js +1 -1
  174. package/dist/FHIR-R4/classes/testReport.js +1 -1
  175. package/dist/FHIR-R4/classes/testReportAssert.js +1 -1
  176. package/dist/FHIR-R4/classes/testReportOperation.js +1 -1
  177. package/dist/FHIR-R4/classes/testReportParticipant.js +1 -1
  178. package/dist/FHIR-R4/classes/testScript.js +1 -1
  179. package/dist/FHIR-R4/classes/testScriptAssert.js +1 -1
  180. package/dist/FHIR-R4/classes/testScriptOperation.js +1 -1
  181. package/dist/FHIR-R4/classes/timingRepeat.js +1 -1
  182. package/dist/FHIR-R4/classes/triggerDefinition.js +1 -1
  183. package/dist/FHIR-R4/classes/valueSet.js +1 -1
  184. package/dist/FHIR-R4/classes/valueSetFilter.js +1 -1
  185. package/dist/FHIR-R4/classes/visionPrescriptionLensSpecification.js +1 -1
  186. package/dist/FHIR-R4/classes/visionPrescriptionPrism.js +1 -1
  187. package/dist/FHIR-R4/interfaces/IAccount.js +1 -1
  188. package/dist/FHIR-R4/interfaces/IActivityDefinition.js +1 -1
  189. package/dist/FHIR-R4/interfaces/IAdverseEvent.js +1 -1
  190. package/dist/FHIR-R4/interfaces/IAllergyIntolerance.js +1 -1
  191. package/dist/FHIR-R4/interfaces/IAppointment.js +1 -1
  192. package/dist/FHIR-R4/interfaces/IAuditEvent.js +1 -1
  193. package/dist/FHIR-R4/interfaces/IBiologicallyDerivedProduct.js +1 -1
  194. package/dist/FHIR-R4/interfaces/IBundle.js +1 -1
  195. package/dist/FHIR-R4/interfaces/ICapabilityStatement.js +1 -1
  196. package/dist/FHIR-R4/interfaces/ICareTeam.js +1 -1
  197. package/dist/FHIR-R4/interfaces/ICatalogEntry.js +1 -1
  198. package/dist/FHIR-R4/interfaces/IChargeItem.js +1 -1
  199. package/dist/FHIR-R4/interfaces/IChargeItemDefinition.js +1 -1
  200. package/dist/FHIR-R4/interfaces/IClaim.js +1 -1
  201. package/dist/FHIR-R4/interfaces/ICodeSystem.js +1 -1
  202. package/dist/FHIR-R4/interfaces/ICompartmentDefinition.js +1 -1
  203. package/dist/FHIR-R4/interfaces/IComposition.js +1 -1
  204. package/dist/FHIR-R4/interfaces/IConceptMap.js +1 -1
  205. package/dist/FHIR-R4/interfaces/IConsent.js +1 -1
  206. package/dist/FHIR-R4/interfaces/ICoverageEligibilityResponse.js +1 -1
  207. package/dist/FHIR-R4/interfaces/IDetectedIssue.js +1 -1
  208. package/dist/FHIR-R4/interfaces/IDevice.js +1 -1
  209. package/dist/FHIR-R4/interfaces/IDeviceMetric.js +1 -1
  210. package/dist/FHIR-R4/interfaces/IDeviceUseStatement.js +1 -1
  211. package/dist/FHIR-R4/interfaces/IDiagnosticReport.js +1 -1
  212. package/dist/FHIR-R4/interfaces/IDocumentManifest.js +1 -1
  213. package/dist/FHIR-R4/interfaces/IDocumentReference.js +1 -1
  214. package/dist/FHIR-R4/interfaces/IEffectEvidenceSynthesis.js +1 -1
  215. package/dist/FHIR-R4/interfaces/IEncounter.js +1 -1
  216. package/dist/FHIR-R4/interfaces/IEndpoint.js +1 -1
  217. package/dist/FHIR-R4/interfaces/IEnrollmentResponse.js +1 -1
  218. package/dist/FHIR-R4/interfaces/IEpisodeOfCare.js +1 -1
  219. package/dist/FHIR-R4/interfaces/IEventDefinition.js +1 -1
  220. package/dist/FHIR-R4/interfaces/IEvidence.js +1 -1
  221. package/dist/FHIR-R4/interfaces/IEvidenceVariable.js +1 -1
  222. package/dist/FHIR-R4/interfaces/IExampleScenario.js +1 -1
  223. package/dist/FHIR-R4/interfaces/IExplanationOfBenefit.js +1 -1
  224. package/dist/FHIR-R4/interfaces/IFamilyMemberHistory.js +1 -1
  225. package/dist/FHIR-R4/interfaces/IFlag.js +1 -1
  226. package/dist/FHIR-R4/interfaces/IGoal.js +1 -1
  227. package/dist/FHIR-R4/interfaces/IGraphDefinition.js +1 -1
  228. package/dist/FHIR-R4/interfaces/IGroup.js +1 -1
  229. package/dist/FHIR-R4/interfaces/IGuidanceResponse.js +1 -1
  230. package/dist/FHIR-R4/interfaces/IImagingStudy.js +1 -1
  231. package/dist/FHIR-R4/interfaces/IImplementationGuide.js +1 -1
  232. package/dist/FHIR-R4/interfaces/IInsurancePlan.js +1 -1
  233. package/dist/FHIR-R4/interfaces/IInvoice.js +1 -1
  234. package/dist/FHIR-R4/interfaces/ILibrary.js +1 -1
  235. package/dist/FHIR-R4/interfaces/IList.js +1 -1
  236. package/dist/FHIR-R4/interfaces/ILocation.js +1 -1
  237. package/dist/FHIR-R4/interfaces/IMeasure.js +1 -1
  238. package/dist/FHIR-R4/interfaces/IMeasureReport.js +1 -1
  239. package/dist/FHIR-R4/interfaces/IMessageDefinition.js +1 -1
  240. package/dist/FHIR-R4/interfaces/IMolecularSequence.js +1 -1
  241. package/dist/FHIR-R4/interfaces/INamingSystem.js +1 -1
  242. package/dist/FHIR-R4/interfaces/IObservation.js +1 -1
  243. package/dist/FHIR-R4/interfaces/IOperationDefinition.js +1 -1
  244. package/dist/FHIR-R4/interfaces/IPatient.js +1 -1
  245. package/dist/FHIR-R4/interfaces/IPaymentReconciliation.js +1 -1
  246. package/dist/FHIR-R4/interfaces/IPerson.js +1 -1
  247. package/dist/FHIR-R4/interfaces/IPlanDefinition.js +1 -1
  248. package/dist/FHIR-R4/interfaces/IPractitioner.js +1 -1
  249. package/dist/FHIR-R4/interfaces/IQuestionnaire.js +1 -1
  250. package/dist/FHIR-R4/interfaces/IQuestionnaireResponse.js +1 -1
  251. package/dist/FHIR-R4/interfaces/IRelatedPerson.js +1 -1
  252. package/dist/FHIR-R4/interfaces/IResearchDefinition.js +1 -1
  253. package/dist/FHIR-R4/interfaces/IResearchElementDefinition.js +1 -1
  254. package/dist/FHIR-R4/interfaces/IResearchStudy.js +1 -1
  255. package/dist/FHIR-R4/interfaces/IResearchSubject.js +1 -1
  256. package/dist/FHIR-R4/interfaces/IRiskEvidenceSynthesis.js +1 -1
  257. package/dist/FHIR-R4/interfaces/ISearchParameter.js +1 -1
  258. package/dist/FHIR-R4/interfaces/ISlot.js +1 -1
  259. package/dist/FHIR-R4/interfaces/ISpecimen.js +1 -1
  260. package/dist/FHIR-R4/interfaces/IStructureDefinition.js +1 -1
  261. package/dist/FHIR-R4/interfaces/IStructureMap.js +1 -1
  262. package/dist/FHIR-R4/interfaces/ISubscription.js +1 -1
  263. package/dist/FHIR-R4/interfaces/ISubstance.js +1 -1
  264. package/dist/FHIR-R4/interfaces/ISupplyDelivery.js +1 -1
  265. package/dist/FHIR-R4/interfaces/ISupplyRequest.js +1 -1
  266. package/dist/FHIR-R4/interfaces/ITask.js +1 -1
  267. package/dist/FHIR-R4/interfaces/ITerminologyCapabilities.js +1 -1
  268. package/dist/FHIR-R4/interfaces/ITestReport.js +1 -1
  269. package/dist/FHIR-R4/interfaces/ITestScript.js +1 -1
  270. package/dist/FHIR-R4/interfaces/IValueSet.js +1 -1
  271. package/dist/FHIR-R5/fHIRJSONRESOURCE.d.ts +172 -0
  272. package/dist/FHIR-R5/fHIRJSONRESOURCE.js +2 -0
  273. package/dist/FHIR-R5/openApiSchemaUpdated.d.ts +172 -0
  274. package/dist/FHIR-R5/openApiSchemaUpdated.js +2 -0
  275. package/dist/index.d.ts +1 -1
  276. package/dist/index.js +39 -6
  277. package/dist/library/BundleUtils/BundleUtils.d.ts +11 -5
  278. package/dist/library/BundleUtils/BundleUtils.js +23 -5
  279. package/dist/library/BundleUtils/BundleUtils.spec.js +24 -24
  280. package/dist/library/PatchUtils/PatchUtils.d.ts +1 -1
  281. package/dist/library/PatchUtils/PatchUtils.js +31 -31
  282. package/dist/library/PatchUtils/PatchUtils.spec.js +159 -124
  283. package/dist/library/QueryBuilder/QueryBuilder.d.ts +1 -1
  284. package/dist/library/QueryBuilder/QueryBuilder.js +25 -17
  285. package/dist/library/QueryBuilder/QueryBuilder.spec.js +44 -43
  286. package/dist/library/ResourceUtils/ResourceUtils.d.ts +15 -7
  287. package/dist/library/ResourceUtils/ResourceUtils.js +19 -11
  288. package/dist/library/ResourceUtils/ResourceUtils.spec.js +113 -112
  289. package/dist/library/constants.js +2 -2
  290. package/dist/library/dataTypes.d.ts +6 -6
  291. package/eslint.config.mjs +69 -0
  292. package/package.json +21 -7
  293. package/src/FHIR-DSTU2.ts +1 -1
  294. package/src/FHIR-R3.ts +3 -1
  295. package/src/index.ts +12 -1
  296. package/src/library/BundleUtils/BundleUtils.spec.ts +26 -39
  297. package/src/library/BundleUtils/BundleUtils.ts +43 -29
  298. package/src/library/PatchUtils/PatchUtils.spec.ts +173 -129
  299. package/src/library/PatchUtils/PatchUtils.ts +39 -52
  300. package/src/library/QueryBuilder/QueryBuilder.spec.ts +54 -51
  301. package/src/library/QueryBuilder/QueryBuilder.ts +41 -31
  302. package/src/library/ResourceUtils/ResourceUtils.spec.ts +133 -164
  303. package/src/library/ResourceUtils/ResourceUtils.ts +37 -27
  304. package/src/library/constants.ts +17 -17
  305. package/src/library/dataTypes.ts +7 -7
  306. package/tsconfig.json +25 -2
@@ -1,4 +1,4 @@
1
- import { CodingKeys, IdentifierKeys } from "../dataTypes";
1
+ import { CodingKeys, IdentifierKeys } from '../dataTypes';
2
2
  export declare class ResourceUtils {
3
3
  /**
4
4
  *
@@ -7,38 +7,46 @@ export declare class ResourceUtils {
7
7
  * @returns json property if it exists
8
8
  * @limitation currently just supports get for top level property on resource
9
9
  */
10
- getResourceProperty(inputJson: object, propertyName: string): any;
10
+ getResourceProperty(inputJson: Record<string, any>, propertyName: string): any;
11
11
  /**
12
+ * Get identifiers from a list filtered by property value
12
13
  *
14
+ * @template T - The identifier type to return (defaults to any for backward compatibility)
13
15
  * @param identifierList list of identifiers
14
16
  * @param propertyToCompare identifier property to compare
15
17
  * @param propertyValue value we want to compare against
16
18
  * @returns array of matches
17
19
  * @limitations currently does not work with identifier.type, identifier.period & identifier.assigner
18
20
  */
19
- getIdentifiersByProperty(identifierList: any[], propertyToCompare: IdentifierKeys, propertyValue: any[IdentifierKeys]): any[];
21
+ getIdentifiersByProperty<T = any>(identifierList: any[] | null, propertyToCompare: IdentifierKeys, propertyValue: any[IdentifierKeys]): T[];
20
22
  /**
23
+ * Get extensions from a list filtered by URL
21
24
  *
25
+ * @template T - The extension type to return (defaults to any for backward compatibility)
22
26
  * @param extensionList list of extensions
23
27
  * @param extensionUrl Extension.url to compare
24
28
  * @returns array of matches
25
29
  */
26
- getExtensionsByUrl(extensionList: any[], extensionUrl: string): any[];
30
+ getExtensionsByUrl<T = any>(extensionList: any[] | null, extensionUrl: string): T[];
27
31
  /**
32
+ * Get codings from a list filtered by property value
28
33
  *
34
+ * @template T - The coding type to return (defaults to any for backward compatibility)
29
35
  * @param codingList list of codings
30
36
  * @param propertyToCompare coding property to compare
31
37
  * @param propertyValue value we want to compare against string or boolean
32
38
  * @returns array of matches
33
39
  */
34
- getCodingsByProperty(codingList: any[], propertyToCompare: CodingKeys, propertyValue: any[CodingKeys]): any[];
40
+ getCodingsByProperty<T = any>(codingList: any[] | null, propertyToCompare: CodingKeys, propertyValue: any[CodingKeys]): T[];
35
41
  /**
42
+ * Get values at a specific path in a FHIR resource
36
43
  *
44
+ * @template T - The value type to return (defaults to any for backward compatibility)
37
45
  * @param resource resource for which path needs to be validated
38
- * @param elementPath path to validate in resource
46
+ * @param elementPath path to validate in resource (e.g., "Patient.name.given")
39
47
  * @returns array of elements found at the provided path
40
48
  */
41
- getValuesAtResourcePath(resource: any, elementPath: string): any[];
49
+ getValuesAtResourcePath<T = any>(resource: any, elementPath: string): T[];
42
50
  private getValuesAtResourcePathInner;
43
51
  private isPrimitive;
44
52
  /**
@@ -11,13 +11,15 @@ class ResourceUtils {
11
11
  */
12
12
  getResourceProperty(inputJson, propertyName) {
13
13
  let resourcePropertyValue = null;
14
- if (inputJson.hasOwnProperty(propertyName)) {
14
+ if (Object.prototype.hasOwnProperty.call(inputJson, propertyName)) {
15
15
  resourcePropertyValue = inputJson[propertyName];
16
16
  }
17
17
  return resourcePropertyValue;
18
18
  }
19
19
  /**
20
+ * Get identifiers from a list filtered by property value
20
21
  *
22
+ * @template T - The identifier type to return (defaults to any for backward compatibility)
21
23
  * @param identifierList list of identifiers
22
24
  * @param propertyToCompare identifier property to compare
23
25
  * @param propertyValue value we want to compare against
@@ -30,18 +32,20 @@ class ResourceUtils {
30
32
  : [];
31
33
  }
32
34
  /**
35
+ * Get extensions from a list filtered by URL
33
36
  *
37
+ * @template T - The extension type to return (defaults to any for backward compatibility)
34
38
  * @param extensionList list of extensions
35
39
  * @param extensionUrl Extension.url to compare
36
40
  * @returns array of matches
37
41
  */
38
42
  getExtensionsByUrl(extensionList, extensionUrl) {
39
- return (extensionList === null || extensionList === void 0 ? void 0 : extensionList.length)
40
- ? extensionList.filter((x) => x["url"] === extensionUrl)
41
- : [];
43
+ return (extensionList === null || extensionList === void 0 ? void 0 : extensionList.length) ? extensionList.filter((x) => x['url'] === extensionUrl) : [];
42
44
  }
43
45
  /**
46
+ * Get codings from a list filtered by property value
44
47
  *
48
+ * @template T - The coding type to return (defaults to any for backward compatibility)
45
49
  * @param codingList list of codings
46
50
  * @param propertyToCompare coding property to compare
47
51
  * @param propertyValue value we want to compare against string or boolean
@@ -53,28 +57,32 @@ class ResourceUtils {
53
57
  : [];
54
58
  }
55
59
  /**
60
+ * Get values at a specific path in a FHIR resource
56
61
  *
62
+ * @template T - The value type to return (defaults to any for backward compatibility)
57
63
  * @param resource resource for which path needs to be validated
58
- * @param elementPath path to validate in resource
64
+ * @param elementPath path to validate in resource (e.g., "Patient.name.given")
59
65
  * @returns array of elements found at the provided path
60
66
  */
61
67
  getValuesAtResourcePath(resource, elementPath) {
62
68
  const pathSections = elementPath.split('.');
63
- if (!resource || (resource.resourceType !== pathSections[0]))
69
+ if (!resource || resource.resourceType !== pathSections[0]) {
64
70
  return [];
71
+ }
65
72
  return this.getValuesAtResourcePathInner(resource, pathSections);
66
73
  }
67
74
  getValuesAtResourcePathInner(resource, pathSections) {
75
+ var _a;
68
76
  let resourcePathValue;
69
77
  for (let index = 1; index < pathSections.length; index++) {
70
- const subPaths = pathSections[index];
78
+ const subPaths = (_a = pathSections[index]) !== null && _a !== void 0 ? _a : '';
71
79
  resourcePathValue = resourcePathValue ? resourcePathValue[subPaths] : resource[subPaths];
72
80
  if (resourcePathValue) {
73
81
  if (this.isPrimitive(resourcePathValue) || pathSections.length === 2) {
74
82
  return Array.isArray(resourcePathValue) ? [...resourcePathValue] : [resourcePathValue];
75
83
  }
76
84
  else if (Array.isArray(resourcePathValue) && resourcePathValue.length > 0) {
77
- let resultSet = [];
85
+ const resultSet = [];
78
86
  for (let subPathIndex = 0; subPathIndex < resourcePathValue.length; subPathIndex++) {
79
87
  const subPathValue = resourcePathValue[subPathIndex];
80
88
  if (this.isPrimitive(subPathValue)) {
@@ -86,7 +94,7 @@ class ResourceUtils {
86
94
  }
87
95
  return resultSet;
88
96
  }
89
- else if (typeof (resourcePathValue) === 'object') {
97
+ else if (typeof resourcePathValue === 'object') {
90
98
  return this.getValuesAtResourcePathInner(resourcePathValue, pathSections.slice(index));
91
99
  }
92
100
  }
@@ -97,7 +105,7 @@ class ResourceUtils {
97
105
  return [];
98
106
  }
99
107
  isPrimitive(value) {
100
- return typeof (value) === "boolean" || typeof (value) === "string";
108
+ return typeof value === 'boolean' || typeof value === 'string';
101
109
  }
102
110
  /**
103
111
  * @param resource resource to pull out references from
@@ -106,7 +114,7 @@ class ResourceUtils {
106
114
  getAllReferencesFromResource(resource) {
107
115
  const stringifiedResource = JSON.stringify(resource);
108
116
  const referenceJsonString = '"reference":';
109
- let references = [];
117
+ const references = [];
110
118
  let cursor = stringifiedResource.indexOf(referenceJsonString, 0);
111
119
  while (cursor > -1) {
112
120
  const referenceStart = stringifiedResource.indexOf(referenceJsonString, cursor) + referenceJsonString.length;
@@ -1,297 +1,298 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const ResourceUtils_1 = require("./ResourceUtils");
4
- const patientPayload = require("./../../test-resources/Patient-R4.json");
5
- const careTeamPayload = require("./../../test-resources/CareTeam-R4.json");
6
- const careTeamContainedPayload = require("./../../test-resources/CareTeam-R4-contained.json");
7
- describe("ResourceUtils", () => {
8
- let resourceUtils = new ResourceUtils_1.ResourceUtils();
9
- describe("#getResourceProperty()", () => {
10
- it("should return property if property exists in valid inputJson", () => {
4
+ const patientPayload = require('./../../test-resources/Patient-R4.json');
5
+ const careTeamPayload = require('./../../test-resources/CareTeam-R4.json');
6
+ const careTeamContainedPayload = require('./../../test-resources/CareTeam-R4-contained.json');
7
+ describe('ResourceUtils', () => {
8
+ const resourceUtils = new ResourceUtils_1.ResourceUtils();
9
+ describe('#getResourceProperty()', () => {
10
+ it('should return property if property exists in valid inputJson', () => {
11
11
  // execute
12
- const actual = resourceUtils.getResourceProperty(patientPayload, "deceasedBoolean");
12
+ const actual = resourceUtils.getResourceProperty(patientPayload, 'deceasedBoolean');
13
13
  // validate
14
14
  expect(actual).toBeFalse();
15
15
  });
16
- it("should return null if property exists in valid inputJson", () => {
16
+ it('should return null if property exists in valid inputJson', () => {
17
17
  // execute
18
- const actual = resourceUtils.getResourceProperty(patientPayload, "abcd");
18
+ const actual = resourceUtils.getResourceProperty(patientPayload, 'abcd');
19
19
  // validate
20
20
  expect(actual).toBeNull();
21
21
  });
22
- it("should return null if invalid inputJson is passed", () => {
22
+ it('should return null if invalid inputJson is passed', () => {
23
23
  // setup
24
24
  const inputPayload = [1, 2];
25
25
  // execute
26
- const actual = resourceUtils.getResourceProperty(inputPayload, "deceasedBoolean");
26
+ const actual = resourceUtils.getResourceProperty(inputPayload, 'deceasedBoolean');
27
27
  // validate
28
28
  expect(actual).toBeNull();
29
29
  });
30
30
  });
31
- describe("#getIdentifiersByProperty()", () => {
31
+ describe('#getIdentifiersByProperty()', () => {
32
32
  const identifierList = [
33
33
  {
34
- use: "temp",
35
- system: "http://hl7.org/fhir/sid/us-ssn",
36
- value: "abc",
34
+ use: 'temp',
35
+ system: 'http://hl7.org/fhir/sid/us-ssn',
36
+ value: 'abc',
37
37
  },
38
38
  {
39
- use: "usual",
40
- system: "http://ns.electronichealth.net.au/id/hi/ihi/1.0",
41
- value: "abc",
39
+ use: 'usual',
40
+ system: 'http://ns.electronichealth.net.au/id/hi/ihi/1.0',
41
+ value: 'abc',
42
42
  },
43
43
  ];
44
- it("should return empty array if null is passed as identifier list", () => {
44
+ it('should return empty array if null is passed as identifier list', () => {
45
45
  // setup
46
- const value = "shouldBeIgnored";
46
+ const value = 'shouldBeIgnored';
47
47
  // execute
48
- const actual = resourceUtils.getIdentifiersByProperty(null, "id", value);
48
+ const actual = resourceUtils.getIdentifiersByProperty(null, 'id', value);
49
49
  // validate
50
50
  expect(actual.length).toEqual(0);
51
51
  });
52
- it("should return empty array if property not found", () => {
52
+ it('should return empty array if property not found', () => {
53
53
  // setup
54
- const value = "abc";
54
+ const value = 'abc';
55
55
  // execute
56
- const actual = resourceUtils.getIdentifiersByProperty(identifierList, "extension", // no extensions in test data
56
+ const actual = resourceUtils.getIdentifiersByProperty(identifierList, 'extension', // no extensions in test data
57
57
  value);
58
58
  // validate
59
59
  expect(actual.length).toEqual(0);
60
60
  });
61
- it("should return empty array if no matches found", () => {
61
+ it('should return empty array if no matches found', () => {
62
62
  // setup
63
- const systemUrl = "http://somesystem.com";
63
+ const systemUrl = 'http://somesystem.com';
64
64
  // execute
65
- const actual = resourceUtils.getIdentifiersByProperty(identifierList, "system", systemUrl);
65
+ const actual = resourceUtils.getIdentifiersByProperty(identifierList, 'system', systemUrl);
66
66
  // validate
67
67
  expect(actual.length).toEqual(0);
68
68
  });
69
- it("should return array with all matches", () => {
69
+ it('should return array with all matches', () => {
70
70
  // setup
71
- const value = "abc";
71
+ const value = 'abc';
72
72
  // execute
73
- const actual = resourceUtils.getIdentifiersByProperty(identifierList, "value", value);
73
+ const actual = resourceUtils.getIdentifiersByProperty(identifierList, 'value', value);
74
74
  // validate
75
75
  expect(actual.length).toEqual(2);
76
76
  });
77
77
  });
78
- describe("#getExtensionsByUrl()", () => {
78
+ describe('#getExtensionsByUrl()', () => {
79
79
  const extensionList = [
80
80
  {
81
- url: "http://hl7.org/fhir/sid/us-ssn",
81
+ url: 'http://hl7.org/fhir/sid/us-ssn',
82
82
  valueBoolean: true,
83
83
  },
84
84
  {
85
- url: "http://ns.electronichealth.net.au/id/hi/ihi/1.0",
86
- valueString: "abc",
85
+ url: 'http://ns.electronichealth.net.au/id/hi/ihi/1.0',
86
+ valueString: 'abc',
87
87
  },
88
88
  ];
89
- it("should return empty array if null is passed as extension list", () => {
89
+ it('should return empty array if null is passed as extension list', () => {
90
90
  // execute
91
- const actual = resourceUtils.getExtensionsByUrl(null, "url");
91
+ const actual = resourceUtils.getExtensionsByUrl(null, 'url');
92
92
  // validate
93
93
  expect(actual.length).toEqual(0);
94
94
  });
95
- it("should return empty array if invalid extension array passed", () => {
95
+ it('should return empty array if invalid extension array passed', () => {
96
96
  // setup
97
97
  const extensionListInvalid = [
98
98
  {
99
99
  // @ts-ignore
100
- use: "temp",
101
- system: "http://hl7.org/fhir/sid/us-ssn",
102
- value: "abc",
100
+ use: 'temp',
101
+ system: 'http://hl7.org/fhir/sid/us-ssn',
102
+ value: 'abc',
103
103
  },
104
104
  ]; // disabling compiler warning for the test
105
- const url = "http://ns.electronichealth.net.au/id/hi/ihi/1.0";
105
+ const url = 'http://ns.electronichealth.net.au/id/hi/ihi/1.0';
106
106
  // execute
107
107
  const actual = resourceUtils.getExtensionsByUrl(extensionListInvalid, url);
108
108
  // validate
109
109
  expect(actual.length).toEqual(0);
110
110
  });
111
- it("should return empty array if no matches found", () => {
111
+ it('should return empty array if no matches found', () => {
112
112
  // setup
113
- const url = "http://somesystem.com";
113
+ const url = 'http://somesystem.com';
114
114
  // execute
115
115
  const actual = resourceUtils.getExtensionsByUrl(extensionList, url);
116
116
  // validate
117
117
  expect(actual.length).toEqual(0);
118
118
  });
119
- it("should return array with all matches", () => {
119
+ it('should return array with all matches', () => {
120
120
  // setup
121
- const url = "http://ns.electronichealth.net.au/id/hi/ihi/1.0";
121
+ const url = 'http://ns.electronichealth.net.au/id/hi/ihi/1.0';
122
122
  // execute
123
123
  const actual = resourceUtils.getExtensionsByUrl(extensionList, url);
124
124
  // validate
125
125
  expect(actual.length).toEqual(1);
126
126
  });
127
127
  });
128
- describe("#getCodingsByProperty()", () => {
128
+ describe('#getCodingsByProperty()', () => {
129
129
  const codingList = [
130
130
  {
131
- version: "1.0",
132
- system: "http://hl7.org/fhir/sid/us-ssn",
133
- code: "abc",
134
- display: "abc",
131
+ version: '1.0',
132
+ system: 'http://hl7.org/fhir/sid/us-ssn',
133
+ code: 'abc',
134
+ display: 'abc',
135
135
  userSelected: false,
136
136
  },
137
137
  {
138
- version: "1.1",
139
- system: "http://ns.electronichealth.net.au/id/hi/ihi/1.0",
140
- code: "abc",
141
- display: "abc",
138
+ version: '1.1',
139
+ system: 'http://ns.electronichealth.net.au/id/hi/ihi/1.0',
140
+ code: 'abc',
141
+ display: 'abc',
142
142
  },
143
143
  ];
144
- it("should return empty array if null is passed as coding list", () => {
144
+ it('should return empty array if null is passed as coding list', () => {
145
145
  // setup
146
- const value = "shouldBeIgnored";
146
+ const value = 'shouldBeIgnored';
147
147
  // execute
148
- const actual = resourceUtils.getCodingsByProperty(null, "extension", value);
148
+ const actual = resourceUtils.getCodingsByProperty(null, 'extension', value);
149
149
  // validate
150
150
  expect(actual.length).toEqual(0);
151
151
  });
152
- it("should return empty array if property not found", () => {
152
+ it('should return empty array if property not found', () => {
153
153
  // setup
154
- const value = "abc";
154
+ const value = 'abc';
155
155
  // execute
156
- const actual = resourceUtils.getCodingsByProperty(codingList, "id", // expect no ID in codingList
156
+ const actual = resourceUtils.getCodingsByProperty(codingList, 'id', // expect no ID in codingList
157
157
  value);
158
158
  // validate
159
159
  expect(actual.length).toEqual(0);
160
160
  });
161
- it("should return empty array if no matches found", () => {
161
+ it('should return empty array if no matches found', () => {
162
162
  // setup
163
- const systemUrl = "http://somesystem.com";
163
+ const systemUrl = 'http://somesystem.com';
164
164
  // execute
165
- const actual = resourceUtils.getCodingsByProperty(codingList, "system", systemUrl);
165
+ const actual = resourceUtils.getCodingsByProperty(codingList, 'system', systemUrl);
166
166
  // validate
167
167
  expect(actual.length).toEqual(0);
168
168
  });
169
- it("should return array with all matches for string values", () => {
169
+ it('should return array with all matches for string values', () => {
170
170
  // setup
171
- const value = "abc";
171
+ const value = 'abc';
172
172
  // execute
173
- const actual = resourceUtils.getCodingsByProperty(codingList, "code", value);
173
+ const actual = resourceUtils.getCodingsByProperty(codingList, 'code', value);
174
174
  // validate
175
175
  expect(actual.length).toEqual(2);
176
176
  });
177
- it("should return array with all matches for boolean values", () => {
177
+ it('should return array with all matches for boolean values', () => {
178
178
  // setup
179
179
  const value = false;
180
180
  // execute
181
- const actual = resourceUtils.getCodingsByProperty(codingList, "userSelected", value);
181
+ const actual = resourceUtils.getCodingsByProperty(codingList, 'userSelected', value);
182
182
  // validate
183
183
  expect(actual.length).toEqual(1);
184
184
  });
185
185
  });
186
- describe("#getValuesAtResourcePath()", () => {
187
- it("should return empty array if the root of the path path does not match the resource type", () => {
186
+ describe('#getValuesAtResourcePath()', () => {
187
+ it('should return empty array if the root of the path path does not match the resource type', () => {
188
188
  // execute
189
- const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, "Practitioner.name.given");
189
+ const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, 'Practitioner.name.given');
190
190
  // validate
191
191
  expect(pathValues.length).toEqual(0);
192
192
  });
193
- it("should return array with values if path exists for a top level element", () => {
193
+ it('should return array with values if path exists for a top level element', () => {
194
194
  // execute
195
- const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, "Patient.gender");
195
+ const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, 'Patient.gender');
196
196
  // validate
197
197
  expect(pathValues.length).toEqual(1);
198
- expect(pathValues[0]).toEqual("male");
198
+ expect(pathValues[0]).toEqual('male');
199
199
  });
200
200
  it('should return array with values if path exists for a top level element and is an object', () => {
201
201
  const expected = [
202
202
  {
203
203
  coding: [
204
204
  {
205
- system: "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus",
206
- code: "M",
207
- display: "Married"
208
- }
205
+ system: 'http://terminology.hl7.org/CodeSystem/v3-MaritalStatus',
206
+ code: 'M',
207
+ display: 'Married',
208
+ },
209
209
  ],
210
- text: "Getrouwd",
211
- }
210
+ text: 'Getrouwd',
211
+ },
212
212
  ];
213
213
  // execute
214
- const actual = resourceUtils.getValuesAtResourcePath(patientPayload, "Patient.maritalStatus");
214
+ const actual = resourceUtils.getValuesAtResourcePath(patientPayload, 'Patient.maritalStatus');
215
215
  // validate
216
216
  expect(actual.length).toEqual(1);
217
217
  expect(actual).toEqual(expected);
218
218
  });
219
- it("should return array with values if path exists for a top level element and is an array", () => {
219
+ it('should return array with values if path exists for a top level element and is an array', () => {
220
220
  // setup
221
221
  const expected = [
222
222
  {
223
- use: "usual",
224
- family: "van de Heuvel",
225
- given: ["Pieter", "Peter"],
226
- suffix: ["MSc"],
223
+ use: 'usual',
224
+ family: 'van de Heuvel',
225
+ given: ['Pieter', 'Peter'],
226
+ suffix: ['MSc'],
227
227
  },
228
228
  {
229
- use: "usual",
230
- family: "van de Heuvel",
231
- given: ["Pieter"],
232
- suffix: ["MSc"],
229
+ use: 'usual',
230
+ family: 'van de Heuvel',
231
+ given: ['Pieter'],
232
+ suffix: ['MSc'],
233
233
  },
234
234
  ];
235
235
  // execute
236
- const actual = resourceUtils.getValuesAtResourcePath(patientPayload, "Patient.name");
236
+ const actual = resourceUtils.getValuesAtResourcePath(patientPayload, 'Patient.name');
237
237
  // validate
238
238
  expect(actual.length).toEqual(2);
239
239
  expect(actual).toEqual(expected);
240
240
  });
241
- it("should return array with values for a array under object", () => {
241
+ it('should return array with values for a array under object', () => {
242
242
  // execute
243
- const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, "Patient.name.given");
243
+ const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, 'Patient.name.given');
244
244
  // validate
245
245
  expect(pathValues.length).toEqual(3);
246
- expect(pathValues[0]).toEqual("Pieter");
247
- expect(pathValues[1]).toEqual("Peter");
248
- expect(pathValues[2]).toEqual("Pieter");
246
+ expect(pathValues[0]).toEqual('Pieter');
247
+ expect(pathValues[1]).toEqual('Peter');
248
+ expect(pathValues[2]).toEqual('Pieter');
249
249
  });
250
- it("should return array with values if path exists for a deep array element", () => {
250
+ it('should return array with values if path exists for a deep array element', () => {
251
251
  // execute
252
- const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, "Patient.contact.relationship.coding.system");
252
+ const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, 'Patient.contact.relationship.coding.system');
253
253
  // validate
254
254
  expect(pathValues.length).toEqual(2);
255
- expect(pathValues[0]).toEqual("http://terminology.hl7.org/CodeSystem/v2-0131");
256
- expect(pathValues[1]).toEqual("http://terminology.hl7.org/CodeSystem/v2-0132");
255
+ expect(pathValues[0]).toEqual('http://terminology.hl7.org/CodeSystem/v2-0131');
256
+ expect(pathValues[1]).toEqual('http://terminology.hl7.org/CodeSystem/v2-0132');
257
257
  });
258
- it("should return array with values if path exists for a deep json element", () => {
258
+ it('should return array with values if path exists for a deep json element', () => {
259
259
  // execute
260
- const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, "Patient.maritalStatus.coding.system");
260
+ const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, 'Patient.maritalStatus.coding.system');
261
261
  // validate
262
262
  expect(pathValues.length).toEqual(1);
263
- expect(pathValues[0]).toEqual("http://terminology.hl7.org/CodeSystem/v3-MaritalStatus");
263
+ expect(pathValues[0]).toEqual('http://terminology.hl7.org/CodeSystem/v3-MaritalStatus');
264
264
  });
265
- it("should return empty array if path does not exist", () => {
265
+ it('should return empty array if path does not exist', () => {
266
266
  // execute
267
- const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, "Patient.contact.relationship.coding.abcd");
267
+ const pathValues = resourceUtils.getValuesAtResourcePath(patientPayload, 'Patient.contact.relationship.coding.abcd');
268
268
  // validate
269
269
  expect(pathValues.length).toEqual(0);
270
270
  });
271
271
  });
272
- describe("#getAllResourceReferences()", () => {
273
- it("should return array of all references in a resource when references found", () => {
272
+ describe('#getAllResourceReferences()', () => {
273
+ it('should return array of all references in a resource when references found', () => {
274
274
  // execute
275
275
  const actual = resourceUtils.getAllReferencesFromResource(careTeamPayload);
276
276
  // validate
277
277
  expect(actual.length).toEqual(6);
278
278
  });
279
- it("should return empty array if references in a resource not found", () => {
279
+ it('should return empty array if references in a resource not found', () => {
280
280
  // setup
281
281
  const input = {
282
- "resourceType": "Patient"
282
+ resourceType: 'Patient',
283
283
  };
284
284
  // execute
285
285
  const actual = resourceUtils.getAllReferencesFromResource(input);
286
286
  // validate
287
287
  expect(actual.length).toEqual(0);
288
288
  });
289
- it("should return array of all references in a resource when references found in contained resource", () => {
289
+ it('should return array of all references in a resource when references found in contained resource', () => {
290
+ var _a;
290
291
  // setup
291
292
  const input = careTeamContainedPayload;
292
293
  expect(input.contained).toHaveSize(1);
293
294
  // execute
294
- const actual = resourceUtils.getAllReferencesFromResource(input.contained[0]);
295
+ const actual = resourceUtils.getAllReferencesFromResource((_a = input.contained) === null || _a === void 0 ? void 0 : _a[0]);
295
296
  // validate
296
297
  expect(actual.length).toEqual(1);
297
298
  });
@@ -5,7 +5,7 @@ var SORT_ORDER;
5
5
  (function (SORT_ORDER) {
6
6
  SORT_ORDER[SORT_ORDER["ASCENDING"] = 0] = "ASCENDING";
7
7
  SORT_ORDER[SORT_ORDER["DESCENDING"] = 1] = "DESCENDING";
8
- })(SORT_ORDER = exports.SORT_ORDER || (exports.SORT_ORDER = {}));
8
+ })(SORT_ORDER || (exports.SORT_ORDER = SORT_ORDER = {}));
9
9
  var PATCH_DATATYPE;
10
10
  (function (PATCH_DATATYPE) {
11
11
  PATCH_DATATYPE["CODE"] = "valueCode";
@@ -19,4 +19,4 @@ var PATCH_DATATYPE;
19
19
  PATCH_DATATYPE["STRING"] = "valueString";
20
20
  PATCH_DATATYPE["ADDRESS"] = "valueAddress";
21
21
  PATCH_DATATYPE["REFERENCE"] = "valueReference";
22
- })(PATCH_DATATYPE = exports.PATCH_DATATYPE || (exports.PATCH_DATATYPE = {}));
22
+ })(PATCH_DATATYPE || (exports.PATCH_DATATYPE = PATCH_DATATYPE = {}));
@@ -1,9 +1,9 @@
1
- import { fhirR5 } from "..";
2
- import * as DSTU2 from "../FHIR-DSTU2";
3
- import * as fhirR3 from "../FHIR-R3";
4
- import { Coding as r4Coding } from "../FHIR-R4/classes/coding";
5
- import { Extension as r4Extension } from "../FHIR-R4/classes/extension";
6
- import { Identifier as r4Identifier } from "../FHIR-R4/classes/identifier";
1
+ import { fhirR5 } from '..';
2
+ import * as DSTU2 from '../FHIR-DSTU2';
3
+ import * as fhirR3 from '../FHIR-R3';
4
+ import { Coding as r4Coding } from '../FHIR-R4/classes/coding';
5
+ import { Extension as r4Extension } from '../FHIR-R4/classes/extension';
6
+ import { Identifier as r4Identifier } from '../FHIR-R4/classes/identifier';
7
7
  export type Identifier = r4Identifier & fhirR3.Identifier & DSTU2.Identifier & fhirR5.Identifier;
8
8
  export type IdentifierKeys = keyof Identifier;
9
9
  export type Extension = r4Extension & fhirR3.Extension & DSTU2.Extension & fhirR5.Extension;