@medplum/core 0.2.2 → 0.3.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.
- package/README.md +29 -25
- package/dist/cache.d.ts +1 -0
- package/dist/cache.js +3 -0
- package/dist/cache.js.map +1 -1
- package/dist/client.d.ts +66 -54
- package/dist/client.js +153 -122
- package/dist/client.js.map +1 -1
- package/dist/eventtarget.js +1 -1
- package/dist/eventtarget.js.map +1 -1
- package/dist/format.d.ts +1 -1
- package/dist/format.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/jwt.js.map +1 -1
- package/dist/outcomes.d.ts +1 -1
- package/dist/outcomes.js +42 -28
- package/dist/outcomes.js.map +1 -1
- package/dist/search.js +4 -4
- package/dist/search.js.map +1 -1
- package/dist/searchparams.d.ts +1 -1
- package/dist/searchparams.js +1 -2
- package/dist/searchparams.js.map +1 -1
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +6 -6
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +11 -6
- package/dist/utils.js.map +1 -1
- package/package.json +5 -6
- package/dist/fhir/AccessPolicy.d.ts +0 -75
- package/dist/fhir/AccessPolicy.js +0 -7
- package/dist/fhir/AccessPolicy.js.map +0 -1
- package/dist/fhir/Account.d.ts +0 -247
- package/dist/fhir/Account.js +0 -7
- package/dist/fhir/Account.js.map +0 -1
- package/dist/fhir/ActivityDefinition.d.ts +0 -500
- package/dist/fhir/ActivityDefinition.js +0 -7
- package/dist/fhir/ActivityDefinition.js.map +0 -1
- package/dist/fhir/Address.d.ts +0 -75
- package/dist/fhir/Address.js +0 -7
- package/dist/fhir/Address.js.map +0 -1
- package/dist/fhir/AdverseEvent.d.ts +0 -303
- package/dist/fhir/AdverseEvent.js +0 -7
- package/dist/fhir/AdverseEvent.js.map +0 -1
- package/dist/fhir/Age.d.ts +0 -47
- package/dist/fhir/Age.js +0 -7
- package/dist/fhir/Age.js.map +0 -1
- package/dist/fhir/AllergyIntolerance.d.ts +0 -283
- package/dist/fhir/AllergyIntolerance.js +0 -7
- package/dist/fhir/AllergyIntolerance.js.map +0 -1
- package/dist/fhir/Annotation.d.ts +0 -42
- package/dist/fhir/Annotation.js +0 -7
- package/dist/fhir/Annotation.js.map +0 -1
- package/dist/fhir/Appointment.d.ts +0 -284
- package/dist/fhir/Appointment.js +0 -7
- package/dist/fhir/Appointment.js.map +0 -1
- package/dist/fhir/AppointmentResponse.d.ts +0 -131
- package/dist/fhir/AppointmentResponse.js +0 -7
- package/dist/fhir/AppointmentResponse.js.map +0 -1
- package/dist/fhir/Attachment.d.ts +0 -58
- package/dist/fhir/Attachment.js +0 -7
- package/dist/fhir/Attachment.js.map +0 -1
- package/dist/fhir/AuditEvent.d.ts +0 -458
- package/dist/fhir/AuditEvent.js +0 -7
- package/dist/fhir/AuditEvent.js.map +0 -1
- package/dist/fhir/Basic.d.ts +0 -110
- package/dist/fhir/Basic.js +0 -7
- package/dist/fhir/Basic.js.map +0 -1
- package/dist/fhir/Binary.d.ts +0 -59
- package/dist/fhir/Binary.js +0 -7
- package/dist/fhir/Binary.js.map +0 -1
- package/dist/fhir/BiologicallyDerivedProduct.d.ts +0 -358
- package/dist/fhir/BiologicallyDerivedProduct.js +0 -7
- package/dist/fhir/BiologicallyDerivedProduct.js.map +0 -1
- package/dist/fhir/BodyStructure.d.ts +0 -119
- package/dist/fhir/BodyStructure.js +0 -7
- package/dist/fhir/BodyStructure.js.map +0 -1
- package/dist/fhir/Bot.d.ts +0 -49
- package/dist/fhir/Bot.js +0 -7
- package/dist/fhir/Bot.js.map +0 -1
- package/dist/fhir/Bundle.d.ts +0 -379
- package/dist/fhir/Bundle.js +0 -7
- package/dist/fhir/Bundle.js.map +0 -1
- package/dist/fhir/CapabilityStatement.d.ts +0 -1044
- package/dist/fhir/CapabilityStatement.js +0 -7
- package/dist/fhir/CapabilityStatement.js.map +0 -1
- package/dist/fhir/CarePlan.d.ts +0 -446
- package/dist/fhir/CarePlan.js +0 -7
- package/dist/fhir/CarePlan.js.map +0 -1
- package/dist/fhir/CareTeam.d.ts +0 -211
- package/dist/fhir/CareTeam.js +0 -7
- package/dist/fhir/CareTeam.js.map +0 -1
- package/dist/fhir/CatalogEntry.d.ts +0 -195
- package/dist/fhir/CatalogEntry.js +0 -7
- package/dist/fhir/CatalogEntry.js.map +0 -1
- package/dist/fhir/ChargeItem.d.ts +0 -287
- package/dist/fhir/ChargeItem.js +0 -7
- package/dist/fhir/ChargeItem.js.map +0 -1
- package/dist/fhir/ChargeItemDefinition.d.ts +0 -401
- package/dist/fhir/ChargeItemDefinition.js +0 -7
- package/dist/fhir/ChargeItemDefinition.js.map +0 -1
- package/dist/fhir/Claim.d.ts +0 -1092
- package/dist/fhir/Claim.js +0 -7
- package/dist/fhir/Claim.js.map +0 -1
- package/dist/fhir/ClaimResponse.d.ts +0 -1040
- package/dist/fhir/ClaimResponse.js +0 -7
- package/dist/fhir/ClaimResponse.js.map +0 -1
- package/dist/fhir/ClientApplication.d.ts +0 -46
- package/dist/fhir/ClientApplication.js +0 -7
- package/dist/fhir/ClientApplication.js.map +0 -1
- package/dist/fhir/ClinicalImpression.d.ts +0 -306
- package/dist/fhir/ClinicalImpression.js +0 -7
- package/dist/fhir/ClinicalImpression.js.map +0 -1
- package/dist/fhir/CodeSystem.d.ts +0 -541
- package/dist/fhir/CodeSystem.js +0 -7
- package/dist/fhir/CodeSystem.js.map +0 -1
- package/dist/fhir/CodeableConcept.d.ts +0 -33
- package/dist/fhir/CodeableConcept.js +0 -7
- package/dist/fhir/CodeableConcept.js.map +0 -1
- package/dist/fhir/Coding.d.ts +0 -50
- package/dist/fhir/Coding.js +0 -7
- package/dist/fhir/Coding.js.map +0 -1
- package/dist/fhir/Communication.d.ts +0 -264
- package/dist/fhir/Communication.js +0 -7
- package/dist/fhir/Communication.js.map +0 -1
- package/dist/fhir/CommunicationRequest.d.ts +0 -261
- package/dist/fhir/CommunicationRequest.js +0 -7
- package/dist/fhir/CommunicationRequest.js.map +0 -1
- package/dist/fhir/CompartmentDefinition.d.ts +0 -217
- package/dist/fhir/CompartmentDefinition.js +0 -7
- package/dist/fhir/CompartmentDefinition.js.map +0 -1
- package/dist/fhir/Composition.d.ts +0 -429
- package/dist/fhir/Composition.js +0 -7
- package/dist/fhir/Composition.js.map +0 -1
- package/dist/fhir/ConceptMap.d.ts +0 -518
- package/dist/fhir/ConceptMap.js +0 -7
- package/dist/fhir/ConceptMap.js.map +0 -1
- package/dist/fhir/Condition.d.ts +0 -326
- package/dist/fhir/Condition.js +0 -7
- package/dist/fhir/Condition.js.map +0 -1
- package/dist/fhir/Consent.d.ts +0 -460
- package/dist/fhir/Consent.js +0 -7
- package/dist/fhir/Consent.js.map +0 -1
- package/dist/fhir/ContactDetail.d.ts +0 -31
- package/dist/fhir/ContactDetail.js +0 -7
- package/dist/fhir/ContactDetail.js.map +0 -1
- package/dist/fhir/ContactPoint.d.ts +0 -47
- package/dist/fhir/ContactPoint.js +0 -7
- package/dist/fhir/ContactPoint.js.map +0 -1
- package/dist/fhir/Contract.d.ts +0 -1452
- package/dist/fhir/Contract.js +0 -7
- package/dist/fhir/Contract.js.map +0 -1
- package/dist/fhir/Contributor.d.ts +0 -37
- package/dist/fhir/Contributor.js +0 -7
- package/dist/fhir/Contributor.js.map +0 -1
- package/dist/fhir/Count.d.ts +0 -49
- package/dist/fhir/Count.js +0 -7
- package/dist/fhir/Count.js.map +0 -1
- package/dist/fhir/Coverage.d.ts +0 -327
- package/dist/fhir/Coverage.js +0 -7
- package/dist/fhir/Coverage.js.map +0 -1
- package/dist/fhir/CoverageEligibilityRequest.d.ts +0 -404
- package/dist/fhir/CoverageEligibilityRequest.js +0 -7
- package/dist/fhir/CoverageEligibilityRequest.js.map +0 -1
- package/dist/fhir/CoverageEligibilityResponse.d.ts +0 -434
- package/dist/fhir/CoverageEligibilityResponse.js +0 -7
- package/dist/fhir/CoverageEligibilityResponse.js.map +0 -1
- package/dist/fhir/DataRequirement.d.ts +0 -239
- package/dist/fhir/DataRequirement.js +0 -7
- package/dist/fhir/DataRequirement.js.map +0 -1
- package/dist/fhir/DetectedIssue.d.ts +0 -252
- package/dist/fhir/DetectedIssue.js +0 -7
- package/dist/fhir/DetectedIssue.js.map +0 -1
- package/dist/fhir/Device.d.ts +0 -493
- package/dist/fhir/Device.js +0 -7
- package/dist/fhir/Device.js.map +0 -1
- package/dist/fhir/DeviceDefinition.d.ts +0 -486
- package/dist/fhir/DeviceDefinition.js +0 -7
- package/dist/fhir/DeviceDefinition.js.map +0 -1
- package/dist/fhir/DeviceMetric.d.ts +0 -199
- package/dist/fhir/DeviceMetric.js +0 -7
- package/dist/fhir/DeviceMetric.js.map +0 -1
- package/dist/fhir/DeviceRequest.d.ts +0 -296
- package/dist/fhir/DeviceRequest.js +0 -7
- package/dist/fhir/DeviceRequest.js.map +0 -1
- package/dist/fhir/DeviceUseStatement.d.ts +0 -168
- package/dist/fhir/DeviceUseStatement.js +0 -7
- package/dist/fhir/DeviceUseStatement.js.map +0 -1
- package/dist/fhir/DiagnosticReport.d.ts +0 -254
- package/dist/fhir/DiagnosticReport.js +0 -7
- package/dist/fhir/DiagnosticReport.js.map +0 -1
- package/dist/fhir/Distance.d.ts +0 -47
- package/dist/fhir/Distance.js +0 -7
- package/dist/fhir/Distance.js.map +0 -1
- package/dist/fhir/DocumentManifest.d.ts +0 -196
- package/dist/fhir/DocumentManifest.js +0 -7
- package/dist/fhir/DocumentManifest.js.map +0 -1
- package/dist/fhir/DocumentReference.d.ts +0 -349
- package/dist/fhir/DocumentReference.js +0 -7
- package/dist/fhir/DocumentReference.js.map +0 -1
- package/dist/fhir/Dosage.d.ts +0 -152
- package/dist/fhir/Dosage.js +0 -7
- package/dist/fhir/Dosage.js.map +0 -1
- package/dist/fhir/Duration.d.ts +0 -46
- package/dist/fhir/Duration.js +0 -7
- package/dist/fhir/Duration.js.map +0 -1
- package/dist/fhir/EffectEvidenceSynthesis.d.ts +0 -591
- package/dist/fhir/EffectEvidenceSynthesis.js +0 -7
- package/dist/fhir/EffectEvidenceSynthesis.js.map +0 -1
- package/dist/fhir/Element.d.ts +0 -21
- package/dist/fhir/Element.js +0 -7
- package/dist/fhir/Element.js.map +0 -1
- package/dist/fhir/ElementDefinition.d.ts +0 -2701
- package/dist/fhir/ElementDefinition.js +0 -7
- package/dist/fhir/ElementDefinition.js.map +0 -1
- package/dist/fhir/Encounter.d.ts +0 -558
- package/dist/fhir/Encounter.js +0 -7
- package/dist/fhir/Encounter.js.map +0 -1
- package/dist/fhir/Endpoint.d.ts +0 -140
- package/dist/fhir/Endpoint.js +0 -7
- package/dist/fhir/Endpoint.js.map +0 -1
- package/dist/fhir/EnrollmentRequest.d.ts +0 -113
- package/dist/fhir/EnrollmentRequest.js +0 -7
- package/dist/fhir/EnrollmentRequest.js.map +0 -1
- package/dist/fhir/EnrollmentResponse.d.ts +0 -117
- package/dist/fhir/EnrollmentResponse.js +0 -7
- package/dist/fhir/EnrollmentResponse.js.map +0 -1
- package/dist/fhir/EpisodeOfCare.d.ts +0 -246
- package/dist/fhir/EpisodeOfCare.js +0 -7
- package/dist/fhir/EpisodeOfCare.js.map +0 -1
- package/dist/fhir/EventDefinition.d.ts +0 -253
- package/dist/fhir/EventDefinition.js +0 -7
- package/dist/fhir/EventDefinition.js.map +0 -1
- package/dist/fhir/Evidence.d.ts +0 -252
- package/dist/fhir/Evidence.js +0 -7
- package/dist/fhir/Evidence.js.map +0 -1
- package/dist/fhir/EvidenceVariable.d.ts +0 -370
- package/dist/fhir/EvidenceVariable.js +0 -7
- package/dist/fhir/EvidenceVariable.js.map +0 -1
- package/dist/fhir/ExampleScenario.d.ts +0 -628
- package/dist/fhir/ExampleScenario.js +0 -7
- package/dist/fhir/ExampleScenario.js.map +0 -1
- package/dist/fhir/ExplanationOfBenefit.d.ts +0 -1841
- package/dist/fhir/ExplanationOfBenefit.js +0 -7
- package/dist/fhir/ExplanationOfBenefit.js.map +0 -1
- package/dist/fhir/Expression.d.ts +0 -45
- package/dist/fhir/Expression.js +0 -7
- package/dist/fhir/Expression.js.map +0 -1
- package/dist/fhir/Extension.d.ts +0 -306
- package/dist/fhir/Extension.js +0 -7
- package/dist/fhir/Extension.js.map +0 -1
- package/dist/fhir/FamilyMemberHistory.d.ts +0 -306
- package/dist/fhir/FamilyMemberHistory.js +0 -7
- package/dist/fhir/FamilyMemberHistory.js.map +0 -1
- package/dist/fhir/Flag.d.ts +0 -132
- package/dist/fhir/Flag.js +0 -7
- package/dist/fhir/Flag.js.map +0 -1
- package/dist/fhir/Goal.d.ts +0 -299
- package/dist/fhir/Goal.js +0 -7
- package/dist/fhir/Goal.js.map +0 -1
- package/dist/fhir/GraphDefinition.d.ts +0 -350
- package/dist/fhir/GraphDefinition.js +0 -7
- package/dist/fhir/GraphDefinition.js.map +0 -1
- package/dist/fhir/Group.d.ts +0 -271
- package/dist/fhir/Group.js +0 -7
- package/dist/fhir/Group.js.map +0 -1
- package/dist/fhir/GuidanceResponse.d.ts +0 -196
- package/dist/fhir/GuidanceResponse.js +0 -7
- package/dist/fhir/GuidanceResponse.js.map +0 -1
- package/dist/fhir/HealthcareService.d.ts +0 -356
- package/dist/fhir/HealthcareService.js +0 -7
- package/dist/fhir/HealthcareService.js.map +0 -1
- package/dist/fhir/HumanName.d.ts +0 -58
- package/dist/fhir/HumanName.js +0 -7
- package/dist/fhir/HumanName.js.map +0 -1
- package/dist/fhir/Identifier.d.ts +0 -53
- package/dist/fhir/Identifier.js +0 -7
- package/dist/fhir/Identifier.js.map +0 -1
- package/dist/fhir/ImagingStudy.d.ts +0 -407
- package/dist/fhir/ImagingStudy.js +0 -7
- package/dist/fhir/ImagingStudy.js.map +0 -1
- package/dist/fhir/Immunization.d.ts +0 -444
- package/dist/fhir/Immunization.js +0 -7
- package/dist/fhir/Immunization.js.map +0 -1
- package/dist/fhir/ImmunizationEvaluation.d.ts +0 -149
- package/dist/fhir/ImmunizationEvaluation.js +0 -7
- package/dist/fhir/ImmunizationEvaluation.js.map +0 -1
- package/dist/fhir/ImmunizationRecommendation.d.ts +0 -254
- package/dist/fhir/ImmunizationRecommendation.js +0 -7
- package/dist/fhir/ImmunizationRecommendation.js.map +0 -1
- package/dist/fhir/ImplementationGuide.d.ts +0 -824
- package/dist/fhir/ImplementationGuide.js +0 -7
- package/dist/fhir/ImplementationGuide.js.map +0 -1
- package/dist/fhir/InsurancePlan.d.ts +0 -624
- package/dist/fhir/InsurancePlan.js +0 -7
- package/dist/fhir/InsurancePlan.js.map +0 -1
- package/dist/fhir/Invoice.d.ts +0 -346
- package/dist/fhir/Invoice.js +0 -7
- package/dist/fhir/Invoice.js.map +0 -1
- package/dist/fhir/JsonWebKey.d.ts +0 -99
- package/dist/fhir/JsonWebKey.js +0 -7
- package/dist/fhir/JsonWebKey.js.map +0 -1
- package/dist/fhir/Library.d.ts +0 -277
- package/dist/fhir/Library.js +0 -7
- package/dist/fhir/Library.js.map +0 -1
- package/dist/fhir/Linkage.d.ts +0 -146
- package/dist/fhir/Linkage.js +0 -7
- package/dist/fhir/Linkage.js.map +0 -1
- package/dist/fhir/List.d.ts +0 -200
- package/dist/fhir/List.js +0 -7
- package/dist/fhir/List.js.map +0 -1
- package/dist/fhir/Location.d.ts +0 -277
- package/dist/fhir/Location.js +0 -7
- package/dist/fhir/Location.js.map +0 -1
- package/dist/fhir/Login.d.ts +0 -119
- package/dist/fhir/Login.js +0 -7
- package/dist/fhir/Login.js.map +0 -1
- package/dist/fhir/MarketingStatus.d.ts +0 -82
- package/dist/fhir/MarketingStatus.js +0 -7
- package/dist/fhir/MarketingStatus.js.map +0 -1
- package/dist/fhir/Measure.d.ts +0 -620
- package/dist/fhir/Measure.js +0 -7
- package/dist/fhir/Measure.js.map +0 -1
- package/dist/fhir/MeasureReport.d.ts +0 -463
- package/dist/fhir/MeasureReport.js +0 -7
- package/dist/fhir/MeasureReport.js.map +0 -1
- package/dist/fhir/Media.d.ts +0 -205
- package/dist/fhir/Media.js +0 -7
- package/dist/fhir/Media.js.map +0 -1
- package/dist/fhir/Medication.d.ts +0 -230
- package/dist/fhir/Medication.js +0 -7
- package/dist/fhir/Medication.js.map +0 -1
- package/dist/fhir/MedicationAdministration.d.ts +0 -352
- package/dist/fhir/MedicationAdministration.js +0 -7
- package/dist/fhir/MedicationAdministration.js.map +0 -1
- package/dist/fhir/MedicationDispense.d.ts +0 -343
- package/dist/fhir/MedicationDispense.js +0 -7
- package/dist/fhir/MedicationDispense.js.map +0 -1
- package/dist/fhir/MedicationKnowledge.d.ts +0 -992
- package/dist/fhir/MedicationKnowledge.js +0 -7
- package/dist/fhir/MedicationKnowledge.js.map +0 -1
- package/dist/fhir/MedicationRequest.d.ts +0 -481
- package/dist/fhir/MedicationRequest.js +0 -7
- package/dist/fhir/MedicationRequest.js.map +0 -1
- package/dist/fhir/MedicationStatement.d.ts +0 -228
- package/dist/fhir/MedicationStatement.js +0 -7
- package/dist/fhir/MedicationStatement.js.map +0 -1
- package/dist/fhir/MedicinalProduct.d.ts +0 -453
- package/dist/fhir/MedicinalProduct.js +0 -7
- package/dist/fhir/MedicinalProduct.js.map +0 -1
- package/dist/fhir/MedicinalProductAuthorization.d.ts +0 -271
- package/dist/fhir/MedicinalProductAuthorization.js +0 -7
- package/dist/fhir/MedicinalProductAuthorization.js.map +0 -1
- package/dist/fhir/MedicinalProductContraindication.d.ts +0 -170
- package/dist/fhir/MedicinalProductContraindication.js +0 -7
- package/dist/fhir/MedicinalProductContraindication.js.map +0 -1
- package/dist/fhir/MedicinalProductIndication.d.ts +0 -179
- package/dist/fhir/MedicinalProductIndication.js +0 -7
- package/dist/fhir/MedicinalProductIndication.js.map +0 -1
- package/dist/fhir/MedicinalProductIngredient.d.ts +0 -336
- package/dist/fhir/MedicinalProductIngredient.js +0 -7
- package/dist/fhir/MedicinalProductIngredient.js.map +0 -1
- package/dist/fhir/MedicinalProductInteraction.d.ts +0 -158
- package/dist/fhir/MedicinalProductInteraction.js +0 -7
- package/dist/fhir/MedicinalProductInteraction.js.map +0 -1
- package/dist/fhir/MedicinalProductManufactured.d.ts +0 -113
- package/dist/fhir/MedicinalProductManufactured.js +0 -7
- package/dist/fhir/MedicinalProductManufactured.js.map +0 -1
- package/dist/fhir/MedicinalProductPackaged.d.ts +0 -259
- package/dist/fhir/MedicinalProductPackaged.js +0 -7
- package/dist/fhir/MedicinalProductPackaged.js.map +0 -1
- package/dist/fhir/MedicinalProductPharmaceutical.d.ts +0 -331
- package/dist/fhir/MedicinalProductPharmaceutical.js +0 -7
- package/dist/fhir/MedicinalProductPharmaceutical.js.map +0 -1
- package/dist/fhir/MedicinalProductUndesirableEffect.d.ts +0 -101
- package/dist/fhir/MedicinalProductUndesirableEffect.js +0 -7
- package/dist/fhir/MedicinalProductUndesirableEffect.js.map +0 -1
- package/dist/fhir/MessageDefinition.d.ts +0 -330
- package/dist/fhir/MessageDefinition.js +0 -7
- package/dist/fhir/MessageDefinition.js.map +0 -1
- package/dist/fhir/MessageHeader.d.ts +0 -323
- package/dist/fhir/MessageHeader.js +0 -7
- package/dist/fhir/MessageHeader.js.map +0 -1
- package/dist/fhir/Meta.d.ts +0 -75
- package/dist/fhir/Meta.js +0 -7
- package/dist/fhir/Meta.js.map +0 -1
- package/dist/fhir/MolecularSequence.d.ts +0 -760
- package/dist/fhir/MolecularSequence.js +0 -7
- package/dist/fhir/MolecularSequence.js.map +0 -1
- package/dist/fhir/Money.d.ts +0 -29
- package/dist/fhir/Money.js +0 -7
- package/dist/fhir/Money.js.map +0 -1
- package/dist/fhir/NamingSystem.d.ts +0 -218
- package/dist/fhir/NamingSystem.js +0 -7
- package/dist/fhir/NamingSystem.js.map +0 -1
- package/dist/fhir/Narrative.d.ts +0 -32
- package/dist/fhir/Narrative.js +0 -7
- package/dist/fhir/Narrative.js.map +0 -1
- package/dist/fhir/NutritionOrder.d.ts +0 -566
- package/dist/fhir/NutritionOrder.js +0 -7
- package/dist/fhir/NutritionOrder.js.map +0 -1
- package/dist/fhir/Observation.d.ts +0 -520
- package/dist/fhir/Observation.js +0 -7
- package/dist/fhir/Observation.js.map +0 -1
- package/dist/fhir/ObservationDefinition.d.ts +0 -278
- package/dist/fhir/ObservationDefinition.js +0 -7
- package/dist/fhir/ObservationDefinition.js.map +0 -1
- package/dist/fhir/OperationDefinition.d.ts +0 -468
- package/dist/fhir/OperationDefinition.js +0 -7
- package/dist/fhir/OperationDefinition.js.map +0 -1
- package/dist/fhir/OperationOutcome.d.ts +0 -160
- package/dist/fhir/OperationOutcome.js +0 -7
- package/dist/fhir/OperationOutcome.js.map +0 -1
- package/dist/fhir/Organization.d.ts +0 -184
- package/dist/fhir/Organization.js +0 -7
- package/dist/fhir/Organization.js.map +0 -1
- package/dist/fhir/OrganizationAffiliation.d.ts +0 -145
- package/dist/fhir/OrganizationAffiliation.js +0 -7
- package/dist/fhir/OrganizationAffiliation.js.map +0 -1
- package/dist/fhir/ParameterDefinition.d.ts +0 -57
- package/dist/fhir/ParameterDefinition.js +0 -7
- package/dist/fhir/ParameterDefinition.js.map +0 -1
- package/dist/fhir/Parameters.d.ts +0 -319
- package/dist/fhir/Parameters.js +0 -7
- package/dist/fhir/Parameters.js.map +0 -1
- package/dist/fhir/PasswordChangeRequest.d.ts +0 -51
- package/dist/fhir/PasswordChangeRequest.js +0 -7
- package/dist/fhir/PasswordChangeRequest.js.map +0 -1
- package/dist/fhir/Patient.d.ts +0 -342
- package/dist/fhir/Patient.js +0 -7
- package/dist/fhir/Patient.js.map +0 -1
- package/dist/fhir/PaymentNotice.d.ts +0 -135
- package/dist/fhir/PaymentNotice.js +0 -7
- package/dist/fhir/PaymentNotice.js.map +0 -1
- package/dist/fhir/PaymentReconciliation.d.ts +0 -280
- package/dist/fhir/PaymentReconciliation.js +0 -7
- package/dist/fhir/PaymentReconciliation.js.map +0 -1
- package/dist/fhir/Period.d.ts +0 -32
- package/dist/fhir/Period.js +0 -7
- package/dist/fhir/Period.js.map +0 -1
- package/dist/fhir/Person.d.ts +0 -175
- package/dist/fhir/Person.js +0 -7
- package/dist/fhir/Person.js.map +0 -1
- package/dist/fhir/PlanDefinition.d.ts +0 -837
- package/dist/fhir/PlanDefinition.js +0 -7
- package/dist/fhir/PlanDefinition.js.map +0 -1
- package/dist/fhir/Population.d.ts +0 -62
- package/dist/fhir/Population.js +0 -7
- package/dist/fhir/Population.js.map +0 -1
- package/dist/fhir/Practitioner.d.ts +0 -191
- package/dist/fhir/Practitioner.js +0 -7
- package/dist/fhir/Practitioner.js.map +0 -1
- package/dist/fhir/PractitionerRole.d.ts +0 -259
- package/dist/fhir/PractitionerRole.js +0 -7
- package/dist/fhir/PractitionerRole.js.map +0 -1
- package/dist/fhir/Procedure.d.ts +0 -372
- package/dist/fhir/Procedure.js +0 -7
- package/dist/fhir/Procedure.js.map +0 -1
- package/dist/fhir/ProdCharacteristic.d.ts +0 -112
- package/dist/fhir/ProdCharacteristic.js +0 -7
- package/dist/fhir/ProdCharacteristic.js.map +0 -1
- package/dist/fhir/ProductShelfLife.d.ts +0 -70
- package/dist/fhir/ProductShelfLife.js +0 -7
- package/dist/fhir/ProductShelfLife.js.map +0 -1
- package/dist/fhir/Project.d.ts +0 -43
- package/dist/fhir/Project.js +0 -7
- package/dist/fhir/Project.js.map +0 -1
- package/dist/fhir/ProjectMembership.d.ts +0 -66
- package/dist/fhir/ProjectMembership.js +0 -7
- package/dist/fhir/ProjectMembership.js.map +0 -1
- package/dist/fhir/Provenance.d.ts +0 -258
- package/dist/fhir/Provenance.js +0 -7
- package/dist/fhir/Provenance.js.map +0 -1
- package/dist/fhir/Quantity.d.ts +0 -46
- package/dist/fhir/Quantity.js +0 -7
- package/dist/fhir/Quantity.js.map +0 -1
- package/dist/fhir/Questionnaire.d.ts +0 -603
- package/dist/fhir/Questionnaire.js +0 -7
- package/dist/fhir/Questionnaire.js.map +0 -1
- package/dist/fhir/QuestionnaireResponse.d.ts +0 -313
- package/dist/fhir/QuestionnaireResponse.js +0 -7
- package/dist/fhir/QuestionnaireResponse.js.map +0 -1
- package/dist/fhir/Range.d.ts +0 -30
- package/dist/fhir/Range.js +0 -7
- package/dist/fhir/Range.js.map +0 -1
- package/dist/fhir/Ratio.d.ts +0 -30
- package/dist/fhir/Ratio.js +0 -7
- package/dist/fhir/Ratio.js.map +0 -1
- package/dist/fhir/Reference.d.ts +0 -67
- package/dist/fhir/Reference.js +0 -7
- package/dist/fhir/Reference.js.map +0 -1
- package/dist/fhir/RefreshToken.d.ts +0 -45
- package/dist/fhir/RefreshToken.js +0 -7
- package/dist/fhir/RefreshToken.js.map +0 -1
- package/dist/fhir/RelatedArtifact.d.ts +0 -57
- package/dist/fhir/RelatedArtifact.js +0 -7
- package/dist/fhir/RelatedArtifact.js.map +0 -1
- package/dist/fhir/RelatedPerson.d.ts +0 -190
- package/dist/fhir/RelatedPerson.js +0 -7
- package/dist/fhir/RelatedPerson.js.map +0 -1
- package/dist/fhir/RequestGroup.d.ts +0 -434
- package/dist/fhir/RequestGroup.js +0 -7
- package/dist/fhir/RequestGroup.js.map +0 -1
- package/dist/fhir/ResearchDefinition.d.ts +0 -291
- package/dist/fhir/ResearchDefinition.js +0 -7
- package/dist/fhir/ResearchDefinition.js.map +0 -1
- package/dist/fhir/ResearchElementDefinition.d.ts +0 -431
- package/dist/fhir/ResearchElementDefinition.js +0 -7
- package/dist/fhir/ResearchElementDefinition.js.map +0 -1
- package/dist/fhir/ResearchStudy.d.ts +0 -318
- package/dist/fhir/ResearchStudy.js +0 -7
- package/dist/fhir/ResearchStudy.js.map +0 -1
- package/dist/fhir/ResearchSubject.d.ts +0 -119
- package/dist/fhir/ResearchSubject.js +0 -7
- package/dist/fhir/ResearchSubject.js.map +0 -1
- package/dist/fhir/Resource.d.ts +0 -156
- package/dist/fhir/Resource.js +0 -7
- package/dist/fhir/Resource.js.map +0 -1
- package/dist/fhir/RiskAssessment.d.ts +0 -246
- package/dist/fhir/RiskAssessment.js +0 -7
- package/dist/fhir/RiskAssessment.js.map +0 -1
- package/dist/fhir/RiskEvidenceSynthesis.d.ts +0 -530
- package/dist/fhir/RiskEvidenceSynthesis.js +0 -7
- package/dist/fhir/RiskEvidenceSynthesis.js.map +0 -1
- package/dist/fhir/SampledData.d.ts +0 -62
- package/dist/fhir/SampledData.js +0 -7
- package/dist/fhir/SampledData.js.map +0 -1
- package/dist/fhir/Schedule.d.ts +0 -129
- package/dist/fhir/Schedule.js +0 -7
- package/dist/fhir/Schedule.js.map +0 -1
- package/dist/fhir/SearchParameter.d.ts +0 -277
- package/dist/fhir/SearchParameter.js +0 -7
- package/dist/fhir/SearchParameter.js.map +0 -1
- package/dist/fhir/ServiceRequest.d.ts +0 -309
- package/dist/fhir/ServiceRequest.js +0 -7
- package/dist/fhir/ServiceRequest.js.map +0 -1
- package/dist/fhir/Signature.d.ts +0 -71
- package/dist/fhir/Signature.js +0 -7
- package/dist/fhir/Signature.js.map +0 -1
- package/dist/fhir/Slot.d.ts +0 -134
- package/dist/fhir/Slot.js +0 -7
- package/dist/fhir/Slot.js.map +0 -1
- package/dist/fhir/Specimen.d.ts +0 -366
- package/dist/fhir/Specimen.js +0 -7
- package/dist/fhir/Specimen.js.map +0 -1
- package/dist/fhir/SpecimenDefinition.d.ts +0 -363
- package/dist/fhir/SpecimenDefinition.js +0 -7
- package/dist/fhir/SpecimenDefinition.js.map +0 -1
- package/dist/fhir/StructureDefinition.d.ts +0 -438
- package/dist/fhir/StructureDefinition.js +0 -7
- package/dist/fhir/StructureDefinition.js.map +0 -1
- package/dist/fhir/StructureMap.d.ts +0 -904
- package/dist/fhir/StructureMap.js +0 -7
- package/dist/fhir/StructureMap.js.map +0 -1
- package/dist/fhir/Subscription.d.ts +0 -172
- package/dist/fhir/Subscription.js +0 -7
- package/dist/fhir/Subscription.js.map +0 -1
- package/dist/fhir/Substance.d.ts +0 -213
- package/dist/fhir/Substance.js +0 -7
- package/dist/fhir/Substance.js.map +0 -1
- package/dist/fhir/SubstanceAmount.d.ts +0 -115
- package/dist/fhir/SubstanceAmount.js +0 -7
- package/dist/fhir/SubstanceAmount.js.map +0 -1
- package/dist/fhir/SubstanceNucleicAcid.d.ts +0 -309
- package/dist/fhir/SubstanceNucleicAcid.js +0 -7
- package/dist/fhir/SubstanceNucleicAcid.js.map +0 -1
- package/dist/fhir/SubstancePolymer.d.ts +0 -405
- package/dist/fhir/SubstancePolymer.js +0 -7
- package/dist/fhir/SubstancePolymer.js.map +0 -1
- package/dist/fhir/SubstanceProtein.d.ts +0 -218
- package/dist/fhir/SubstanceProtein.js +0 -7
- package/dist/fhir/SubstanceProtein.js.map +0 -1
- package/dist/fhir/SubstanceReferenceInformation.d.ts +0 -330
- package/dist/fhir/SubstanceReferenceInformation.js +0 -7
- package/dist/fhir/SubstanceReferenceInformation.js.map +0 -1
- package/dist/fhir/SubstanceSourceMaterial.d.ts +0 -521
- package/dist/fhir/SubstanceSourceMaterial.js +0 -7
- package/dist/fhir/SubstanceSourceMaterial.js.map +0 -1
- package/dist/fhir/SubstanceSpecification.d.ts +0 -827
- package/dist/fhir/SubstanceSpecification.js +0 -7
- package/dist/fhir/SubstanceSpecification.js.map +0 -1
- package/dist/fhir/SupplyDelivery.d.ts +0 -205
- package/dist/fhir/SupplyDelivery.js +0 -7
- package/dist/fhir/SupplyDelivery.js.map +0 -1
- package/dist/fhir/SupplyRequest.d.ts +0 -237
- package/dist/fhir/SupplyRequest.js +0 -7
- package/dist/fhir/SupplyRequest.js.map +0 -1
- package/dist/fhir/Task.d.ts +0 -807
- package/dist/fhir/Task.js +0 -7
- package/dist/fhir/Task.js.map +0 -1
- package/dist/fhir/TerminologyCapabilities.d.ts +0 -716
- package/dist/fhir/TerminologyCapabilities.js +0 -7
- package/dist/fhir/TerminologyCapabilities.js.map +0 -1
- package/dist/fhir/TestReport.d.ts +0 -549
- package/dist/fhir/TestReport.js +0 -7
- package/dist/fhir/TestReport.js.map +0 -1
- package/dist/fhir/TestScript.d.ts +0 -1184
- package/dist/fhir/TestScript.js +0 -7
- package/dist/fhir/TestScript.js.map +0 -1
- package/dist/fhir/Timing.d.ts +0 -178
- package/dist/fhir/Timing.js +0 -7
- package/dist/fhir/Timing.js.map +0 -1
- package/dist/fhir/TriggerDefinition.d.ts +0 -65
- package/dist/fhir/TriggerDefinition.js +0 -7
- package/dist/fhir/TriggerDefinition.js.map +0 -1
- package/dist/fhir/UsageContext.d.ts +0 -61
- package/dist/fhir/UsageContext.js +0 -7
- package/dist/fhir/UsageContext.js.map +0 -1
- package/dist/fhir/User.d.ts +0 -45
- package/dist/fhir/User.js +0 -7
- package/dist/fhir/User.js.map +0 -1
- package/dist/fhir/ValueSet.d.ts +0 -725
- package/dist/fhir/ValueSet.js +0 -7
- package/dist/fhir/ValueSet.js.map +0 -1
- package/dist/fhir/VerificationResult.d.ts +0 -340
- package/dist/fhir/VerificationResult.js +0 -7
- package/dist/fhir/VerificationResult.js.map +0 -1
- package/dist/fhir/VisionPrescription.d.ts +0 -264
- package/dist/fhir/VisionPrescription.js +0 -7
- package/dist/fhir/VisionPrescription.js.map +0 -1
- package/dist/fhir/index.d.ts +0 -196
- package/dist/fhir/index.js +0 -213
- package/dist/fhir/index.js.map +0 -1
- package/dist/fhirpath/functions.d.ts +0 -6
- package/dist/fhirpath/functions.js +0 -349
- package/dist/fhirpath/functions.js.map +0 -1
- package/dist/fhirpath/index.d.ts +0 -2
- package/dist/fhirpath/index.js +0 -15
- package/dist/fhirpath/index.js.map +0 -1
- package/dist/fhirpath/parse.d.ts +0 -10
- package/dist/fhirpath/parse.js +0 -266
- package/dist/fhirpath/parse.js.map +0 -1
- package/dist/fhirpath/tokenize.d.ts +0 -13
- package/dist/fhirpath/tokenize.js +0 -39
- package/dist/fhirpath/tokenize.js.map +0 -1
- package/dist/fhirpath/utils.d.ts +0 -13
- package/dist/fhirpath/utils.js +0 -34
- package/dist/fhirpath/utils.js.map +0 -1
package/dist/fhirpath/parse.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface Atom {
|
|
2
|
-
eval(context: any): any;
|
|
3
|
-
}
|
|
4
|
-
export declare class FhirPathAtom implements Atom {
|
|
5
|
-
readonly original: string;
|
|
6
|
-
readonly child: Atom;
|
|
7
|
-
constructor(original: string, child: Atom);
|
|
8
|
-
eval(context: any): any[];
|
|
9
|
-
}
|
|
10
|
-
export declare function parseFhirPath(input: string): FhirPathAtom;
|
package/dist/fhirpath/parse.js
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseFhirPath = exports.FhirPathAtom = void 0;
|
|
4
|
-
const functions_1 = require("./functions");
|
|
5
|
-
const tokenize_1 = require("./tokenize");
|
|
6
|
-
const utils_1 = require("./utils");
|
|
7
|
-
class ParserBuilder {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.prefixParselets = {};
|
|
10
|
-
this.infixParselets = {};
|
|
11
|
-
}
|
|
12
|
-
registerInfix(tokenType, parselet) {
|
|
13
|
-
this.infixParselets[tokenType] = parselet;
|
|
14
|
-
return this;
|
|
15
|
-
}
|
|
16
|
-
registerPrefix(tokenType, parselet) {
|
|
17
|
-
this.prefixParselets[tokenType] = parselet;
|
|
18
|
-
return this;
|
|
19
|
-
}
|
|
20
|
-
prefix(tokenType, precedence, builder) {
|
|
21
|
-
return this.registerPrefix(tokenType, {
|
|
22
|
-
parse(parser, token) {
|
|
23
|
-
const right = parser.parse(precedence);
|
|
24
|
-
return builder(token, right);
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
infixLeft(tokenType, precedence, builder) {
|
|
29
|
-
return this.registerInfix(tokenType, {
|
|
30
|
-
parse(parser, left, token) {
|
|
31
|
-
const right = parser.parse(precedence);
|
|
32
|
-
return builder(left, token, right);
|
|
33
|
-
},
|
|
34
|
-
precedence
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
infixRight(tokenType, precedence, builder) {
|
|
38
|
-
return this.registerInfix(tokenType, {
|
|
39
|
-
parse(parser, left, token) {
|
|
40
|
-
const right = parser.parse(precedence - 1);
|
|
41
|
-
return builder(left, token, right);
|
|
42
|
-
},
|
|
43
|
-
precedence
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
construct(input) {
|
|
47
|
-
return new Parser(tokenize_1.tokenizer.tokenize(input), this.prefixParselets, this.infixParselets);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
class Parser {
|
|
51
|
-
constructor(tokens, prefixParselets, infixParselets) {
|
|
52
|
-
this.tokens = tokens;
|
|
53
|
-
this.prefixParselets = prefixParselets;
|
|
54
|
-
this.infixParselets = infixParselets;
|
|
55
|
-
}
|
|
56
|
-
match(expected) {
|
|
57
|
-
const token = this.look();
|
|
58
|
-
if ((token === null || token === void 0 ? void 0 : token.id) !== expected) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
this.consume();
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
parse(precedence = 0) {
|
|
65
|
-
const token = this.consume();
|
|
66
|
-
const prefix = this.prefixParselets[token.id];
|
|
67
|
-
if (!prefix) {
|
|
68
|
-
throw Error(`Parse error at ${token.value}. No matching prefix parselet.`);
|
|
69
|
-
}
|
|
70
|
-
let left = prefix.parse(this, token);
|
|
71
|
-
while (precedence < this.getPrecedence()) {
|
|
72
|
-
const next = this.consume();
|
|
73
|
-
const infix = this.infixParselets[next.id];
|
|
74
|
-
left = infix.parse(this, left, next);
|
|
75
|
-
}
|
|
76
|
-
return left;
|
|
77
|
-
}
|
|
78
|
-
getPrecedence() {
|
|
79
|
-
const nextToken = this.look();
|
|
80
|
-
if (!nextToken) {
|
|
81
|
-
return 0;
|
|
82
|
-
}
|
|
83
|
-
const parser = this.infixParselets[nextToken.id];
|
|
84
|
-
if (parser) {
|
|
85
|
-
return parser.precedence;
|
|
86
|
-
}
|
|
87
|
-
return 0;
|
|
88
|
-
}
|
|
89
|
-
consume() {
|
|
90
|
-
if (!this.tokens.length) {
|
|
91
|
-
throw Error('Cant consume any more tokens.');
|
|
92
|
-
}
|
|
93
|
-
return this.tokens.shift();
|
|
94
|
-
}
|
|
95
|
-
look() {
|
|
96
|
-
return this.tokens.length > 0 ? this.tokens[0] : undefined;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
class FhirPathAtom {
|
|
100
|
-
constructor(original, child) {
|
|
101
|
-
this.original = original;
|
|
102
|
-
this.child = child;
|
|
103
|
-
}
|
|
104
|
-
eval(context) {
|
|
105
|
-
try {
|
|
106
|
-
const result = (0, utils_1.applyMaybeArray)(context, e => this.child.eval(e));
|
|
107
|
-
if (Array.isArray(result)) {
|
|
108
|
-
return result.flat();
|
|
109
|
-
}
|
|
110
|
-
else if (result === undefined || result === null) {
|
|
111
|
-
return [];
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
return [result];
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
throw new Error(`FhirPathError on "${this.original}": ${error}`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
exports.FhirPathAtom = FhirPathAtom;
|
|
123
|
-
class LiteralAtom {
|
|
124
|
-
constructor(value) {
|
|
125
|
-
this.value = value;
|
|
126
|
-
}
|
|
127
|
-
eval() {
|
|
128
|
-
return this.value;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
class SymbolAtom {
|
|
132
|
-
constructor(name) {
|
|
133
|
-
this.name = name;
|
|
134
|
-
}
|
|
135
|
-
eval(context) {
|
|
136
|
-
return (0, utils_1.applyMaybeArray)(context, e => e.resourceType === this.name ? e : e[this.name]);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
class UnaryOperatorAtom {
|
|
140
|
-
constructor(child, impl) {
|
|
141
|
-
this.child = child;
|
|
142
|
-
this.impl = impl;
|
|
143
|
-
}
|
|
144
|
-
eval(context) {
|
|
145
|
-
return this.impl(this.child.eval(context));
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
class BinaryOperatorAtom {
|
|
149
|
-
constructor(left, right, impl) {
|
|
150
|
-
this.left = left;
|
|
151
|
-
this.right = right;
|
|
152
|
-
this.impl = impl;
|
|
153
|
-
}
|
|
154
|
-
eval(context) {
|
|
155
|
-
return this.impl(this.left.eval(context), this.right.eval(context));
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
class DotAtom {
|
|
159
|
-
constructor(left, right) {
|
|
160
|
-
this.left = left;
|
|
161
|
-
this.right = right;
|
|
162
|
-
}
|
|
163
|
-
eval(context) {
|
|
164
|
-
return this.right.eval(this.left.eval(context));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
class UnionAtom {
|
|
168
|
-
constructor(left, right) {
|
|
169
|
-
this.left = left;
|
|
170
|
-
this.right = right;
|
|
171
|
-
}
|
|
172
|
-
eval(context) {
|
|
173
|
-
const leftResult = this.left.eval(context);
|
|
174
|
-
const rightResult = this.right.eval(context);
|
|
175
|
-
if (leftResult && rightResult) {
|
|
176
|
-
return [leftResult, rightResult].flat();
|
|
177
|
-
}
|
|
178
|
-
return leftResult || rightResult;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
class IsAtom {
|
|
182
|
-
constructor(left, right) {
|
|
183
|
-
this.left = left;
|
|
184
|
-
this.right = right;
|
|
185
|
-
}
|
|
186
|
-
eval(context) {
|
|
187
|
-
const desiredResourceType = this.right.name;
|
|
188
|
-
return (0, utils_1.applyMaybeArray)(this.left.eval(context), e => (e === null || e === void 0 ? void 0 : e.resourceType) === desiredResourceType ? e : undefined);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
class FunctionAtom {
|
|
192
|
-
constructor(name, args, impl) {
|
|
193
|
-
this.name = name;
|
|
194
|
-
this.args = args;
|
|
195
|
-
this.impl = impl;
|
|
196
|
-
}
|
|
197
|
-
eval(context) {
|
|
198
|
-
if (context === undefined) {
|
|
199
|
-
return undefined;
|
|
200
|
-
}
|
|
201
|
-
const input = Array.isArray(context) ? context : [context];
|
|
202
|
-
return this.impl(input, ...this.args);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
const PARENTHESES_PARSELET = {
|
|
206
|
-
parse(parser) {
|
|
207
|
-
const expr = parser.parse();
|
|
208
|
-
if (!parser.match(')')) {
|
|
209
|
-
throw new Error('Parse error: expected `)`');
|
|
210
|
-
}
|
|
211
|
-
return expr;
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
const FUNCTION_CALL_PARSELET = {
|
|
215
|
-
parse(parser, left) {
|
|
216
|
-
if (!(left instanceof SymbolAtom)) {
|
|
217
|
-
throw new Error('Unexpected parentheses');
|
|
218
|
-
}
|
|
219
|
-
if (!(left.name in functions_1.functions)) {
|
|
220
|
-
throw new Error('Unrecognized function: ' + left.name);
|
|
221
|
-
}
|
|
222
|
-
const args = [];
|
|
223
|
-
while (!parser.match(')')) {
|
|
224
|
-
args.push(parser.parse());
|
|
225
|
-
}
|
|
226
|
-
return new FunctionAtom(left.name, args, functions_1.functions[left.name]);
|
|
227
|
-
},
|
|
228
|
-
precedence: 8 /* FunctionCall */
|
|
229
|
-
};
|
|
230
|
-
const parserBuilder = new ParserBuilder()
|
|
231
|
-
.registerPrefix('StringLiteral', { parse: (_, token) => new LiteralAtom(token.value.substring(1, token.value.length - 1)) })
|
|
232
|
-
.registerPrefix('Number', { parse: (_, token) => new LiteralAtom(parseFloat(token.value)) })
|
|
233
|
-
.registerPrefix('Symbol', { parse: (_, token) => new SymbolAtom(token.value) })
|
|
234
|
-
.registerPrefix('(', PARENTHESES_PARSELET)
|
|
235
|
-
.registerInfix('(', FUNCTION_CALL_PARSELET)
|
|
236
|
-
.prefix('-', 6 /* Negate */, (_, right) => new UnaryOperatorAtom(right, x => -x))
|
|
237
|
-
.infixLeft('.', 7 /* Dot */, (left, _, right) => new DotAtom(left, right))
|
|
238
|
-
.infixRight('^', 5 /* Exp */, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => Math.pow(x, y)))
|
|
239
|
-
.infixLeft('/', 4 /* MulDiv */, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x / y))
|
|
240
|
-
.infixLeft('*', 4 /* MulDiv */, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x * y))
|
|
241
|
-
.infixLeft('+', 3 /* AddSub */, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x + y))
|
|
242
|
-
.infixLeft('-', 3 /* AddSub */, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x - y))
|
|
243
|
-
.infixLeft('|', 1 /* Union */, (left, _, right) => new UnionAtom(left, right))
|
|
244
|
-
.infixLeft('=', 2 /* Equals */, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x === y))
|
|
245
|
-
.infixLeft('Symbol', 1 /* Union */, (left, symbol, right) => {
|
|
246
|
-
switch (symbol.value) {
|
|
247
|
-
case 'as':
|
|
248
|
-
return new BinaryOperatorAtom(left, right, (x) => x);
|
|
249
|
-
case 'is':
|
|
250
|
-
return new IsAtom(left, right);
|
|
251
|
-
case 'and':
|
|
252
|
-
return new BinaryOperatorAtom(left, right, (x, y) => x && y);
|
|
253
|
-
default:
|
|
254
|
-
throw new Error('Cannot use ' + symbol.value + ' as infix operator');
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
function parseFhirPath(input) {
|
|
258
|
-
try {
|
|
259
|
-
return new FhirPathAtom(input, parserBuilder.construct(input).parse());
|
|
260
|
-
}
|
|
261
|
-
catch (error) {
|
|
262
|
-
throw new Error(`FhirPathError on "${input}": ${error}`);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
exports.parseFhirPath = parseFhirPath;
|
|
266
|
-
//# sourceMappingURL=parse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/fhirpath/parse.ts"],"names":[],"mappings":";;;AAAA,2CAA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C,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;KAC7G,SAAS,CAAC,QAAQ,iBAAoB,CAAC,IAAU,EAAE,MAAa,EAAE,KAAW,EAAE,EAAE;IAChF,QAAQ,MAAM,CAAC,KAAK,EAAE;QACpB,KAAK,IAAI;YACP,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACvD,KAAK,IAAI;YACP,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACjC,KAAK,KAAK;YACR,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D;YACE,MAAM,IAAI,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,KAAK,GAAG,oBAAoB,CAAC,CAAC;KACxE;AACH,CAAC,CAAC,CAAC;AAEL,SAAgB,aAAa,CAAC,KAAa;IACzC,IAAI;QACF,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;KACxE;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,qBAAqB,KAAK,MAAM,KAAK,EAAE,CAAC,CAAC;KAC1D;AACH,CAAC;AAND,sCAMC","sourcesContent":["import { functions } from './functions';\nimport { Token, tokenizer } from './tokenize';\nimport { applyMaybeArray } from './utils';\n\nexport interface Atom {\n eval(context: any): any;\n}\n\ninterface PrefixParselet {\n parse(parser: Parser, token: Token): Atom;\n}\n\ninterface InfixParselet {\n precedence: number;\n parse(parser: Parser, left: Atom, token: Token): Atom;\n}\n\nclass ParserBuilder {\n private readonly prefixParselets: Record<string, PrefixParselet> = {};\n private readonly infixParselets: Record<string, InfixParselet> = {};\n\n public registerInfix(tokenType: string, parselet: InfixParselet): ParserBuilder {\n this.infixParselets[tokenType] = parselet;\n return this;\n }\n\n public registerPrefix(tokenType: string, parselet: PrefixParselet): ParserBuilder {\n this.prefixParselets[tokenType] = parselet;\n return this;\n }\n\n public prefix(tokenType: string, precedence: number, builder: (token: Token, right: Atom) => Atom): ParserBuilder {\n return this.registerPrefix(tokenType, {\n parse(parser, token) {\n const right = parser.parse(precedence)\n return builder(token, right)\n },\n });\n }\n\n public infixLeft(tokenType: string, precedence: number, builder: (left: Atom, token: Token, right: Atom) => Atom): ParserBuilder {\n return this.registerInfix(tokenType, {\n parse(parser, left, token) {\n const right = parser.parse(precedence)\n return builder(left, token, right)\n },\n precedence\n });\n }\n\n public infixRight(tokenType: string, precedence: number, builder: (left: Atom, token: Token, right: Atom) => Atom): ParserBuilder {\n return this.registerInfix(tokenType, {\n parse(parser, left, token) {\n const right = parser.parse(precedence - 1)\n return builder(left, token, right)\n },\n precedence\n });\n }\n\n public construct(input: string): Parser {\n return new Parser(tokenizer.tokenize(input), this.prefixParselets, this.infixParselets);\n }\n}\n\nclass Parser {\n constructor(\n private tokens: Token[],\n private prefixParselets: Record<string, PrefixParselet>,\n private infixParselets: Record<string, InfixParselet>,\n ) { }\n\n public match(expected: string): boolean {\n const token = this.look();\n if (token?.id !== expected) {\n return false;\n }\n\n this.consume();\n return true;\n }\n\n public parse(precedence = 0): Atom {\n const token = this.consume();\n const prefix = this.prefixParselets[token.id];\n if (!prefix) {\n throw Error(`Parse error at ${token.value}. No matching prefix parselet.`)\n }\n\n let left = prefix.parse(this, token);\n\n while (precedence < this.getPrecedence()) {\n const next = this.consume();\n const infix = this.infixParselets[next.id];\n left = infix.parse(this, left, next);\n }\n\n return left;\n }\n\n private getPrecedence(): number {\n const nextToken = this.look();\n if (!nextToken) {\n return 0;\n }\n const parser = this.infixParselets[nextToken.id];\n if (parser) {\n return parser.precedence;\n }\n return 0;\n }\n\n private consume(): Token {\n if (!this.tokens.length) {\n throw Error('Cant consume any more tokens.');\n }\n return this.tokens.shift() as Token;\n }\n\n private look(): Token | undefined {\n return this.tokens.length > 0 ? this.tokens[0] : undefined;\n }\n}\n\nconst enum Precedence {\n Union = 1,\n Equals = 2,\n AddSub = 3,\n MulDiv = 4,\n Exp = 5,\n Negate = 6,\n Dot = 7,\n FunctionCall = 8\n}\n\nexport class FhirPathAtom implements Atom {\n constructor(\n public readonly original: string,\n public readonly child: Atom) { }\n\n eval(context: any): any[] {\n try {\n const result = applyMaybeArray(context, e => this.child.eval(e));\n if (Array.isArray(result)) {\n return result.flat();\n } else if (result === undefined || result === null) {\n return [];\n } else {\n return [result];\n }\n } catch (error) {\n throw new Error(`FhirPathError on \"${this.original}\": ${error}`);\n }\n }\n}\n\nclass LiteralAtom implements Atom {\n constructor(public readonly value: any) { }\n eval(): any {\n return this.value;\n }\n}\n\nclass SymbolAtom implements Atom {\n constructor(public readonly name: string) { }\n eval(context: any): any {\n return applyMaybeArray(context, e => e.resourceType === this.name ? e : e[this.name]);\n }\n}\n\nclass UnaryOperatorAtom implements Atom {\n constructor(\n public readonly child: Atom,\n public readonly impl: (x: any) => any) { }\n\n eval(context: any): any {\n return this.impl(this.child.eval(context));\n }\n}\n\nclass BinaryOperatorAtom implements Atom {\n constructor(\n public readonly left: Atom,\n public readonly right: Atom,\n public readonly impl: (x: any, y: any) => any) { }\n\n eval(context: any): any {\n return this.impl(this.left.eval(context), this.right.eval(context));\n }\n}\n\nclass DotAtom implements Atom {\n constructor(public readonly left: Atom, public readonly right: Atom) { }\n eval(context: any): Atom {\n return this.right.eval(this.left.eval(context));\n }\n}\n\nclass UnionAtom implements Atom {\n constructor(public readonly left: Atom, public readonly right: Atom) { }\n eval(context: any): any {\n const leftResult = this.left.eval(context);\n const rightResult = this.right.eval(context);\n if (leftResult && rightResult) {\n return [leftResult, rightResult].flat();\n }\n return leftResult || rightResult;\n }\n}\n\nclass IsAtom implements Atom {\n constructor(\n public readonly left: Atom,\n public readonly right: Atom) { }\n\n eval(context: any): any {\n const desiredResourceType = (this.right as SymbolAtom).name;\n return applyMaybeArray(this.left.eval(context), e => e?.resourceType === desiredResourceType ? e : undefined);\n }\n}\n\nclass FunctionAtom implements Atom {\n constructor(\n public readonly name: string,\n public readonly args: Atom[],\n public readonly impl: (context: any[], ...a: Atom[]) => any[]\n ) { }\n eval(context: any): any {\n if (context === undefined) {\n return undefined;\n }\n const input = Array.isArray(context) ? context : [context];\n return this.impl(input, ...this.args);\n }\n}\n\nconst PARENTHESES_PARSELET: PrefixParselet = {\n parse(parser: Parser) {\n const expr = parser.parse();\n if (!parser.match(')')) {\n throw new Error('Parse error: expected `)`');\n }\n return expr;\n }\n};\n\nconst FUNCTION_CALL_PARSELET: InfixParselet = {\n parse(parser: Parser, left: Atom) {\n if (!(left instanceof SymbolAtom)) {\n throw new Error('Unexpected parentheses');\n }\n\n if (!(left.name in functions)) {\n throw new Error('Unrecognized function: ' + left.name);\n }\n\n const args = [];\n while (!parser.match(')')) {\n args.push(parser.parse());\n }\n\n return new FunctionAtom(left.name, args, functions[left.name]);\n },\n precedence: Precedence.FunctionCall\n};\n\nconst parserBuilder = new ParserBuilder()\n .registerPrefix('StringLiteral', { parse: (_, token) => new LiteralAtom(token.value.substring(1, token.value.length - 1)) })\n .registerPrefix('Number', { parse: (_, token) => new LiteralAtom(parseFloat(token.value)) })\n .registerPrefix('Symbol', { parse: (_, token) => new SymbolAtom(token.value) })\n .registerPrefix('(', PARENTHESES_PARSELET)\n .registerInfix('(', FUNCTION_CALL_PARSELET)\n .prefix('-', Precedence.Negate, (_, right) => new UnaryOperatorAtom(right, x => -x))\n .infixLeft('.', Precedence.Dot, (left, _, right) => new DotAtom(left, right))\n .infixRight('^', Precedence.Exp, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x ** y))\n .infixLeft('/', Precedence.MulDiv, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x / y))\n .infixLeft('*', Precedence.MulDiv, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x * y))\n .infixLeft('+', Precedence.AddSub, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x + y))\n .infixLeft('-', Precedence.AddSub, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x - y))\n .infixLeft('|', Precedence.Union, (left, _, right) => new UnionAtom(left, right))\n .infixLeft('=', Precedence.Equals, (left, _, right) => new BinaryOperatorAtom(left, right, (x, y) => x === y))\n .infixLeft('Symbol', Precedence.Union, (left: Atom, symbol: Token, right: Atom) => {\n switch (symbol.value) {\n case 'as':\n return new BinaryOperatorAtom(left, right, (x) => x);\n case 'is':\n return new IsAtom(left, right);\n case 'and':\n return new BinaryOperatorAtom(left, right, (x, y) => x && y);\n default:\n throw new Error('Cannot use ' + symbol.value + ' as infix operator');\n }\n });\n\nexport function parseFhirPath(input: string): FhirPathAtom {\n try {\n return new FhirPathAtom(input, parserBuilder.construct(input).parse());\n } catch (error) {\n throw new Error(`FhirPathError on \"${input}\": ${error}`);\n }\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface TokenMatcher {
|
|
2
|
-
id: string;
|
|
3
|
-
pattern: RegExp;
|
|
4
|
-
}
|
|
5
|
-
export interface Token extends TokenMatcher {
|
|
6
|
-
value: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class Tokenizer {
|
|
9
|
-
private matchAll;
|
|
10
|
-
constructor();
|
|
11
|
-
tokenize(str: string): Token[];
|
|
12
|
-
}
|
|
13
|
-
export declare const tokenizer: Tokenizer;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tokenizer = exports.Tokenizer = void 0;
|
|
4
|
-
const matchers = [
|
|
5
|
-
{ id: 'Comment', pattern: /\/\/.*$/ },
|
|
6
|
-
{ id: 'StringLiteral', pattern: /'[^']*'/ },
|
|
7
|
-
{ id: '(', pattern: /\(/ },
|
|
8
|
-
{ id: ')', pattern: /\)/ },
|
|
9
|
-
{ id: '*', pattern: /\*/ },
|
|
10
|
-
{ id: '/', pattern: /\// },
|
|
11
|
-
{ id: '+', pattern: /\+/ },
|
|
12
|
-
{ id: '-', pattern: /-/ },
|
|
13
|
-
{ id: '^', pattern: /\^/ },
|
|
14
|
-
{ id: '!', pattern: /!/ },
|
|
15
|
-
{ id: '.', pattern: /\./ },
|
|
16
|
-
{ id: '|', pattern: /\|/ },
|
|
17
|
-
{ id: '=', pattern: /=/ },
|
|
18
|
-
{ id: 'Number', pattern: /\d+/ },
|
|
19
|
-
{ id: 'Symbol', pattern: /\w+/ },
|
|
20
|
-
];
|
|
21
|
-
class Tokenizer {
|
|
22
|
-
constructor() {
|
|
23
|
-
this.matchAll = new RegExp(matchers.map(matcher => matcher.pattern.source).join('|'), 'g');
|
|
24
|
-
}
|
|
25
|
-
tokenize(str) {
|
|
26
|
-
// Double-execing the RegExp is actually not that slow. Faster than my attempted alternative implementation.
|
|
27
|
-
// https://jsperf.com/tokenization-strategies-jkearl-pratt/1
|
|
28
|
-
const tokens = str.match(this.matchAll);
|
|
29
|
-
if (!tokens) {
|
|
30
|
-
throw new Error('Could not tokenize');
|
|
31
|
-
}
|
|
32
|
-
return tokens.map(value => {
|
|
33
|
-
return Object.assign(Object.assign({}, matchers.find(matcher => matcher.pattern.test(value))), { value });
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.Tokenizer = Tokenizer;
|
|
38
|
-
exports.tokenizer = new Tokenizer();
|
|
39
|
-
//# sourceMappingURL=tokenize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokenize.js","sourceRoot":"","sources":["../../src/fhirpath/tokenize.ts"],"names":[],"mappings":";;;AAUA,MAAM,QAAQ,GAAmB;IAC/B,E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,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;SACvC;QAED,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACxB,uCACM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAkB,KAC1E,KAAK,IACL;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvBD,8BAuBC;AAEY,QAAA,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC","sourcesContent":["\nexport interface TokenMatcher {\n id: string;\n pattern: RegExp;\n}\n\nexport interface Token extends TokenMatcher {\n value: string\n}\n\nconst matchers: TokenMatcher[] = [\n { id: 'Comment', pattern: /\\/\\/.*$/ },\n { id: 'StringLiteral', pattern: /'[^']*'/ },\n { id: '(', pattern: /\\(/ },\n { id: ')', pattern: /\\)/ },\n { id: '*', pattern: /\\*/ },\n { id: '/', pattern: /\\// },\n { id: '+', pattern: /\\+/ },\n { id: '-', pattern: /-/ },\n { id: '^', pattern: /\\^/ },\n { id: '!', pattern: /!/ },\n { id: '.', pattern: /\\./ },\n { id: '|', pattern: /\\|/ },\n { id: '=', pattern: /=/ },\n { id: 'Number', pattern: /\\d+/ },\n { id: 'Symbol', pattern: /\\w+/ },\n];\n\nexport class Tokenizer {\n private matchAll: RegExp\n\n public constructor() {\n this.matchAll = new RegExp(matchers.map(matcher => matcher.pattern.source).join('|'), 'g');\n }\n\n public tokenize(str: string): Token[] {\n // Double-execing the RegExp is actually not that slow. Faster than my attempted alternative implementation.\n // https://jsperf.com/tokenization-strategies-jkearl-pratt/1\n\n const tokens = str.match(this.matchAll);\n if (!tokens) {\n throw new Error('Could not tokenize');\n }\n\n return tokens.map(value => {\n return {\n ...(matchers.find(matcher => matcher.pattern.test(value)) as TokenMatcher),\n value\n };\n });\n }\n}\n\nexport const tokenizer = new Tokenizer();\n"]}
|
package/dist/fhirpath/utils.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Applies a function to single value or an array of values.
|
|
3
|
-
* @param context The context which will be passed to the function.
|
|
4
|
-
* @param fn The function to apply.
|
|
5
|
-
* @returns The result of the function.
|
|
6
|
-
*/
|
|
7
|
-
export declare function applyMaybeArray(context: any, fn: (context: any) => any): any;
|
|
8
|
-
/**
|
|
9
|
-
* Converts any object into a boolean.
|
|
10
|
-
* @param obj Any value or array of values.
|
|
11
|
-
* @returns The converted boolean value according to FHIRPath rules.
|
|
12
|
-
*/
|
|
13
|
-
export declare function toBoolean(obj: any): boolean;
|
package/dist/fhirpath/utils.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toBoolean = exports.applyMaybeArray = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Applies a function to single value or an array of values.
|
|
6
|
-
* @param context The context which will be passed to the function.
|
|
7
|
-
* @param fn The function to apply.
|
|
8
|
-
* @returns The result of the function.
|
|
9
|
-
*/
|
|
10
|
-
function applyMaybeArray(context, fn) {
|
|
11
|
-
if (context === undefined) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
if (Array.isArray(context)) {
|
|
15
|
-
return context.map(e => fn(e)).filter(e => !!e).flat();
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
return fn(context);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.applyMaybeArray = applyMaybeArray;
|
|
22
|
-
/**
|
|
23
|
-
* Converts any object into a boolean.
|
|
24
|
-
* @param obj Any value or array of values.
|
|
25
|
-
* @returns The converted boolean value according to FHIRPath rules.
|
|
26
|
-
*/
|
|
27
|
-
function toBoolean(obj) {
|
|
28
|
-
if (Array.isArray(obj) && obj.length === 0) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
return !!obj;
|
|
32
|
-
}
|
|
33
|
-
exports.toBoolean = toBoolean;
|
|
34
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/fhirpath/utils.ts"],"names":[],"mappings":";;;AACA;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,OAAY,EAAE,EAAyB;IACrE,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC1B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;KACxD;SAAM;QACL,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC;KACpB;AACH,CAAC;AATD,0CASC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,GAAQ;IAChC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1C,OAAO,KAAK,CAAC;KACd;IACD,OAAO,CAAC,CAAC,GAAG,CAAC;AACf,CAAC;AALD,8BAKC","sourcesContent":["\n/**\n * Applies a function to single value or an array of values.\n * @param context The context which will be passed to the function.\n * @param fn The function to apply.\n * @returns The result of the function.\n */\nexport function applyMaybeArray(context: any, fn: (context: any) => any): any {\n if (context === undefined) {\n return undefined;\n }\n if (Array.isArray(context)) {\n return context.map(e => fn(e)).filter(e => !!e).flat();\n } else {\n return fn(context);\n }\n}\n\n/**\n * Converts any object into a boolean.\n * @param obj Any value or array of values.\n * @returns The converted boolean value according to FHIRPath rules.\n */\nexport function toBoolean(obj: any): boolean {\n if (Array.isArray(obj) && obj.length === 0) {\n return false;\n }\n return !!obj;\n}\n"]}
|