@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/types.d.ts
CHANGED
package/dist/types.js
CHANGED
|
@@ -84,22 +84,22 @@ function indexStructureDefinition(structureDefinition, output) {
|
|
|
84
84
|
}
|
|
85
85
|
if (!output) {
|
|
86
86
|
output = {
|
|
87
|
-
types: {}
|
|
87
|
+
types: {},
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
output.types[typeName] = {
|
|
91
91
|
display: typeName,
|
|
92
92
|
description: structureDefinition.description,
|
|
93
|
-
properties: {}
|
|
93
|
+
properties: {},
|
|
94
94
|
};
|
|
95
95
|
const elements = (_a = structureDefinition.snapshot) === null || _a === void 0 ? void 0 : _a.element;
|
|
96
96
|
if (elements) {
|
|
97
97
|
// Filter out any elements missing path or type
|
|
98
|
-
const filtered = elements.filter(e => e.path !== typeName && e.path); // && e.type && e.type.length > 0);
|
|
98
|
+
const filtered = elements.filter((e) => e.path !== typeName && e.path); // && e.type && e.type.length > 0);
|
|
99
99
|
// First pass, build types
|
|
100
|
-
filtered.forEach(element => indexType(output, element));
|
|
100
|
+
filtered.forEach((element) => indexType(output, element));
|
|
101
101
|
// Second pass, build properties
|
|
102
|
-
filtered.forEach(element => indexProperty(output, element));
|
|
102
|
+
filtered.forEach((element) => indexProperty(output, element));
|
|
103
103
|
}
|
|
104
104
|
return output;
|
|
105
105
|
}
|
|
@@ -125,7 +125,7 @@ function indexType(output, element) {
|
|
|
125
125
|
display: typeName,
|
|
126
126
|
description: element.definition,
|
|
127
127
|
parentType: buildTypeName(parts.slice(0, parts.length - 1)),
|
|
128
|
-
properties: {}
|
|
128
|
+
properties: {},
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AACA,mCAAqC;AAErC;;;;GAIG;AACH,IAAY,YA6DX;AA7DD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,yCAAyB,CAAA;IACzB,yCAAyB,CAAA;IACzB,mDAAmC,CAA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;IACtE,4CAA4C;IAC5C,mCAAmC;IACnC,MAAM,YAAY,GAAI,QAAQ,CAAC,IAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,CAAC;IAE1E,2BAA2B;IAC3B,2CAA2C;IAC3C,uCAAuC;IACvC,sDAAsD;IACtD,8CAA8C;IAC9C,oCAAoC;IACpC,OAAO,YAAY;SAChB,KAAK,CAAC,WAAW,CAAC;SAClB,GAAG,CAAC,kBAAU,CAAC;SACf,IAAI,CAAC,GAAG,CAAC;SACT,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;SACjB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC;AAlBD,wDAkBC","sourcesContent":["import { ElementDefinition, SearchParameter, StructureDefinition } from './fhir';\nimport { capitalize } from './utils';\n\n/**\n * List of property types.\n * http://www.hl7.org/fhir/valueset-defined-types.html\n * The list here includes additions found from StructureDefinition resources.\n */\nexport enum PropertyType {\n Address = 'Address',\n Age = 'Age',\n Annotation = 'Annotation',\n Attachment = 'Attachment',\n BackboneElement = 'BackboneElement',\n CodeableConcept = 'CodeableConcept',\n Coding = 'Coding',\n ContactDetail = 'ContactDetail',\n ContactPoint = 'ContactPoint',\n Contributor = 'Contributor',\n Count = 'Count',\n DataRequirement = 'DataRequirement',\n Distance = 'Distance',\n Dosage = 'Dosage',\n Duration = 'Duration',\n Expression = 'Expression',\n Extension = 'Extension',\n HumanName = 'HumanName',\n Identifier = 'Identifier',\n MarketingStatus = 'MarketingStatus',\n Meta = 'Meta',\n Money = 'Money',\n Narrative = 'Narrative',\n ParameterDefinition = 'ParameterDefinition',\n Period = 'Period',\n Population = 'Population',\n ProdCharacteristic = 'ProdCharacteristic',\n ProductShelfLife = 'ProductShelfLife',\n Quantity = 'Quantity',\n Range = 'Range',\n Ratio = 'Ratio',\n Reference = 'Reference',\n RelatedArtifact = 'RelatedArtifact',\n Resource = 'Resource',\n SampledData = 'SampledData',\n Signature = 'Signature',\n SubstanceAmount = 'SubstanceAmount',\n SystemString = 'http://hl7.org/fhirpath/System.String',\n Timing = 'Timing',\n TriggerDefinition = 'TriggerDefinition',\n UsageContext = 'UsageContext',\n base64Binary = 'base64Binary',\n boolean = 'boolean',\n canonical = 'canonical',\n code = 'code',\n date = 'date',\n dateTime = 'dateTime',\n decimal = 'decimal',\n id = 'id',\n instant = 'instant',\n integer = 'integer',\n markdown = 'markdown',\n oid = 'oid',\n positiveInt = 'positiveInt',\n string = 'string',\n time = 'time',\n unsignedInt = 'unsignedInt',\n uri = 'uri',\n url = 'url',\n uuid = 'uuid',\n}\n\n/**\n * An IndexedStructureDefinition is a lookup-optimized version of a StructureDefinition.\n *\n * StructureDefinition resources contain schema information for other resource types.\n * These schemas can be used to automatically generate user interface elements for\n * resources.\n *\n * However, a StructureDefinition resource is not optimized for realtime lookups. All\n * resource types, sub types, and property definitions are stored in a flat array of\n * ElementDefinition objects. Therefore, to lookup the schema for a property (i.e., \"Patient.name\")\n * requires a linear scan of all ElementDefinition objects\n *\n * A StructureDefinition resource contains information about one or more types.\n * For example, the \"Patient\" StructureDefinition includes \"Patient\", \"Patient_Contact\",\n * \"Patient_Communication\", and \"Patient_Link\". This is inefficient.\n *\n * Instead, we create an indexed version of the StructureDefinition, called IndexedStructureDefinition.\n * In an IndexedStructureDefinition, retrieving a property definition is a hashtable lookup.\n *\n * The hierarchy is:\n * IndexedStructureDefinition - top level for one resource type\n * TypeSchema - one per resource type and all contained BackboneElements\n * PropertySchema - one per property/field\n */\nexport interface IndexedStructureDefinition {\n types: { [resourceType: string]: TypeSchema };\n}\n\n/**\n * An indexed TypeSchema.\n *\n * Example: The IndexedStructureDefinition for \"Patient\" would include the following TypeSchemas:\n * 1) Patient\n * 2) Patient_Contact\n * 3) Patient_Communication\n * 4) Patient_Link\n */\nexport interface TypeSchema {\n display: string;\n properties: { [name: string]: ElementDefinition };\n searchParams?: SearchParameter[];\n description?: string;\n parentType?: string;\n}\n\n/**\n * Indexes a StructureDefinition for fast lookup.\n * See comments on IndexedStructureDefinition for more details.\n * @param structureDefinition The original StructureDefinition.\n * @return An indexed IndexedStructureDefinition.\n */\nexport function indexStructureDefinition(structureDefinition: StructureDefinition, output?: IndexedStructureDefinition): IndexedStructureDefinition {\n const typeName = structureDefinition.name;\n if (!typeName) {\n throw new Error('Invalid StructureDefinition');\n }\n\n if (!output) {\n output = {\n types: {}\n } as IndexedStructureDefinition;\n }\n\n output.types[typeName] = {\n display: typeName,\n description: structureDefinition.description,\n properties: {}\n };\n\n const elements = structureDefinition.snapshot?.element;\n if (elements) {\n // Filter out any elements missing path or type\n const filtered = elements.filter(e => e.path !== typeName && e.path);// && e.type && e.type.length > 0);\n\n // First pass, build types\n filtered.forEach(element => indexType(output as IndexedStructureDefinition, element));\n\n // Second pass, build properties\n filtered.forEach(element => indexProperty(output as IndexedStructureDefinition, element));\n }\n\n return output;\n}\n\n/**\n * Indexes TypeSchema from an ElementDefinition.\n * In the common case, there will be many ElementDefinition instances per TypeSchema.\n * Only the first occurrence is saved.\n * @param output The work-in-progress IndexedStructureDefinition.\n * @param element The input ElementDefinition.\n */\nfunction indexType(output: IndexedStructureDefinition, element: ElementDefinition): void {\n const path = element.path as string;\n const typeCode = element.type?.[0]?.code;\n if (typeCode !== 'Element' && typeCode !== 'BackboneElement') {\n return;\n }\n const parts = path.split('.');\n const typeName = buildTypeName(parts);\n if (!(typeName in output.types)) {\n output.types[typeName] = {\n display: typeName,\n description: element.definition,\n parentType: buildTypeName(parts.slice(0, parts.length - 1)),\n properties: {}\n };\n }\n}\n\n/**\n * Indexes PropertySchema from an ElementDefinition.\n * @param output The work-in-progress IndexedStructureDefinition.\n * @param element The input ElementDefinition.\n */\nfunction indexProperty(output: IndexedStructureDefinition, element: ElementDefinition): void {\n const path = element.path as string;\n const parts = path.split('.');\n if (parts.length === 1) {\n return;\n }\n const typeName = buildTypeName(parts.slice(0, parts.length - 1));\n const typeSchema = output.types[typeName];\n const key = parts[parts.length - 1];\n typeSchema.properties[key] = element;\n}\n\nexport function buildTypeName(components: string[]): string {\n return components.map(capitalize).join('');\n}\n\nexport function getPropertyDisplayName(property: ElementDefinition): string {\n // Get the property name, which is the remainder after the last period\n // For example, for path \"Patient.birthDate\"\n // the property name is \"birthDate\"\n const propertyName = (property.path as string).split('.').pop() as string;\n\n // Split by capital letters\n // Capitalize the first letter of each word\n // Join together with spaces in between\n // Then normalize whitespace to single space character\n // For example, for property name \"birthDate\",\n // the display name is \"Birth Date\".\n return propertyName\n .split(/(?=[A-Z])/)\n .map(capitalize)\n .join(' ')\n .replace('_', ' ')\n .replace(/\\s+/g, ' ');\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AACA,mCAAqC;AAErC;;;;GAIG;AACH,IAAY,YA6DX;AA7DD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,yCAAyB,CAAA;IACzB,yCAAyB,CAAA;IACzB,mDAAmC,CAAA;IACnC,mDAAmC,CAAA;IACnC,iCAAiB,CAAA;IACjB,+CAA+B,CAAA;IAC/B,6CAA6B,CAAA;IAC7B,2CAA2B,CAAA;IAC3B,+BAAe,CAAA;IACf,mDAAmC,CAAA;IACnC,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;IACvB,yCAAyB,CAAA;IACzB,mDAAmC,CAAA;IACnC,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,2DAA2C,CAAA;IAC3C,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;IACzB,yDAAyC,CAAA;IACzC,qDAAqC,CAAA;IACrC,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,mDAAmC,CAAA;IACnC,qCAAqB,CAAA;IACrB,2CA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AM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,OAAO;KACR;IACD,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;AACvC,CAAC;AAED,SAAgB,aAAa,CAAC,UAAoB;IAChD,OAAO,UAAU,CAAC,GAAG,CAAC,kBAAU,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7C,CAAC;AAFD,sCAEC;AAED,SAAgB,sBAAsB,CAAC,QAA2B;IAChE,sEAAsE;IACtE,4CAA4C;IAC5C,mCAAmC;IACnC,MAAM,YAAY,GAAI,QAAQ,CAAC,IAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,CAAC;IAE1E,2BAA2B;IAC3B,2CAA2C;IAC3C,uCAAuC;IACvC,sDAAsD;IACtD,8CAA8C;IAC9C,oCAAoC;IACpC,OAAO,YAAY;SAChB,KAAK,CAAC,WAAW,CAAC;SAClB,GAAG,CAAC,kBAAU,CAAC;SACf,IAAI,CAAC,GAAG,CAAC;SACT,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;SACjB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC;AAlBD,wDAkBC","sourcesContent":["import { ElementDefinition, SearchParameter, StructureDefinition } from '@medplum/fhirtypes';\nimport { capitalize } from './utils';\n\n/**\n * List of property types.\n * http://www.hl7.org/fhir/valueset-defined-types.html\n * The list here includes additions found from StructureDefinition resources.\n */\nexport enum PropertyType {\n Address = 'Address',\n Age = 'Age',\n Annotation = 'Annotation',\n Attachment = 'Attachment',\n BackboneElement = 'BackboneElement',\n CodeableConcept = 'CodeableConcept',\n Coding = 'Coding',\n ContactDetail = 'ContactDetail',\n ContactPoint = 'ContactPoint',\n Contributor = 'Contributor',\n Count = 'Count',\n DataRequirement = 'DataRequirement',\n Distance = 'Distance',\n Dosage = 'Dosage',\n Duration = 'Duration',\n Expression = 'Expression',\n Extension = 'Extension',\n HumanName = 'HumanName',\n Identifier = 'Identifier',\n MarketingStatus = 'MarketingStatus',\n Meta = 'Meta',\n Money = 'Money',\n Narrative = 'Narrative',\n ParameterDefinition = 'ParameterDefinition',\n Period = 'Period',\n Population = 'Population',\n ProdCharacteristic = 'ProdCharacteristic',\n ProductShelfLife = 'ProductShelfLife',\n Quantity = 'Quantity',\n Range = 'Range',\n Ratio = 'Ratio',\n Reference = 'Reference',\n RelatedArtifact = 'RelatedArtifact',\n Resource = 'Resource',\n SampledData = 'SampledData',\n Signature = 'Signature',\n SubstanceAmount = 'SubstanceAmount',\n SystemString = 'http://hl7.org/fhirpath/System.String',\n Timing = 'Timing',\n TriggerDefinition = 'TriggerDefinition',\n UsageContext = 'UsageContext',\n base64Binary = 'base64Binary',\n boolean = 'boolean',\n canonical = 'canonical',\n code = 'code',\n date = 'date',\n dateTime = 'dateTime',\n decimal = 'decimal',\n id = 'id',\n instant = 'instant',\n integer = 'integer',\n markdown = 'markdown',\n oid = 'oid',\n positiveInt = 'positiveInt',\n string = 'string',\n time = 'time',\n unsignedInt = 'unsignedInt',\n uri = 'uri',\n url = 'url',\n uuid = 'uuid',\n}\n\n/**\n * An IndexedStructureDefinition is a lookup-optimized version of a StructureDefinition.\n *\n * StructureDefinition resources contain schema information for other resource types.\n * These schemas can be used to automatically generate user interface elements for\n * resources.\n *\n * However, a StructureDefinition resource is not optimized for realtime lookups. All\n * resource types, sub types, and property definitions are stored in a flat array of\n * ElementDefinition objects. Therefore, to lookup the schema for a property (i.e., \"Patient.name\")\n * requires a linear scan of all ElementDefinition objects\n *\n * A StructureDefinition resource contains information about one or more types.\n * For example, the \"Patient\" StructureDefinition includes \"Patient\", \"Patient_Contact\",\n * \"Patient_Communication\", and \"Patient_Link\". This is inefficient.\n *\n * Instead, we create an indexed version of the StructureDefinition, called IndexedStructureDefinition.\n * In an IndexedStructureDefinition, retrieving a property definition is a hashtable lookup.\n *\n * The hierarchy is:\n * IndexedStructureDefinition - top level for one resource type\n * TypeSchema - one per resource type and all contained BackboneElements\n * PropertySchema - one per property/field\n */\nexport interface IndexedStructureDefinition {\n types: { [resourceType: string]: TypeSchema };\n}\n\n/**\n * An indexed TypeSchema.\n *\n * Example: The IndexedStructureDefinition for \"Patient\" would include the following TypeSchemas:\n * 1) Patient\n * 2) Patient_Contact\n * 3) Patient_Communication\n * 4) Patient_Link\n */\nexport interface TypeSchema {\n display: string;\n properties: { [name: string]: ElementDefinition };\n searchParams?: SearchParameter[];\n description?: string;\n parentType?: string;\n}\n\n/**\n * Indexes a StructureDefinition for fast lookup.\n * See comments on IndexedStructureDefinition for more details.\n * @param structureDefinition The original StructureDefinition.\n * @return An indexed IndexedStructureDefinition.\n */\nexport function indexStructureDefinition(\n structureDefinition: StructureDefinition,\n output?: IndexedStructureDefinition\n): IndexedStructureDefinition {\n const typeName = structureDefinition.name;\n if (!typeName) {\n throw new Error('Invalid StructureDefinition');\n }\n\n if (!output) {\n output = {\n types: {},\n } as IndexedStructureDefinition;\n }\n\n output.types[typeName] = {\n display: typeName,\n description: structureDefinition.description,\n properties: {},\n };\n\n const elements = structureDefinition.snapshot?.element;\n if (elements) {\n // Filter out any elements missing path or type\n const filtered = elements.filter((e) => e.path !== typeName && e.path); // && e.type && e.type.length > 0);\n\n // First pass, build types\n filtered.forEach((element) => indexType(output as IndexedStructureDefinition, element));\n\n // Second pass, build properties\n filtered.forEach((element) => indexProperty(output as IndexedStructureDefinition, element));\n }\n\n return output;\n}\n\n/**\n * Indexes TypeSchema from an ElementDefinition.\n * In the common case, there will be many ElementDefinition instances per TypeSchema.\n * Only the first occurrence is saved.\n * @param output The work-in-progress IndexedStructureDefinition.\n * @param element The input ElementDefinition.\n */\nfunction indexType(output: IndexedStructureDefinition, element: ElementDefinition): void {\n const path = element.path as string;\n const typeCode = element.type?.[0]?.code;\n if (typeCode !== 'Element' && typeCode !== 'BackboneElement') {\n return;\n }\n const parts = path.split('.');\n const typeName = buildTypeName(parts);\n if (!(typeName in output.types)) {\n output.types[typeName] = {\n display: typeName,\n description: element.definition,\n parentType: buildTypeName(parts.slice(0, parts.length - 1)),\n properties: {},\n };\n }\n}\n\n/**\n * Indexes PropertySchema from an ElementDefinition.\n * @param output The work-in-progress IndexedStructureDefinition.\n * @param element The input ElementDefinition.\n */\nfunction indexProperty(output: IndexedStructureDefinition, element: ElementDefinition): void {\n const path = element.path as string;\n const parts = path.split('.');\n if (parts.length === 1) {\n return;\n }\n const typeName = buildTypeName(parts.slice(0, parts.length - 1));\n const typeSchema = output.types[typeName];\n const key = parts[parts.length - 1];\n typeSchema.properties[key] = element;\n}\n\nexport function buildTypeName(components: string[]): string {\n return components.map(capitalize).join('');\n}\n\nexport function getPropertyDisplayName(property: ElementDefinition): string {\n // Get the property name, which is the remainder after the last period\n // For example, for path \"Patient.birthDate\"\n // the property name is \"birthDate\"\n const propertyName = (property.path as string).split('.').pop() as string;\n\n // Split by capital letters\n // Capitalize the first letter of each word\n // Join together with spaces in between\n // Then normalize whitespace to single space character\n // For example, for property name \"birthDate\",\n // the display name is \"Birth Date\".\n return propertyName\n .split(/(?=[A-Z])/)\n .map(capitalize)\n .join(' ')\n .replace('_', ' ')\n .replace(/\\s+/g, ' ');\n}\n"]}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Patient, Practitioner, Reference, RelatedPerson, Resource } from '
|
|
1
|
+
import { Patient, Practitioner, Reference, RelatedPerson, Resource } from '@medplum/fhirtypes';
|
|
2
2
|
export declare type ProfileResource = Patient | Practitioner | RelatedPerson;
|
|
3
3
|
/**
|
|
4
4
|
* Creates a reference resource.
|
package/dist/utils.js
CHANGED
|
@@ -10,7 +10,7 @@ const format_1 = require("./format");
|
|
|
10
10
|
function createReference(resource) {
|
|
11
11
|
const reference = getReferenceString(resource);
|
|
12
12
|
const display = getDisplayString(resource);
|
|
13
|
-
return
|
|
13
|
+
return display === reference ? { reference } : { reference, display };
|
|
14
14
|
}
|
|
15
15
|
exports.createReference = createReference;
|
|
16
16
|
/**
|
|
@@ -28,9 +28,9 @@ exports.getReferenceString = getReferenceString;
|
|
|
28
28
|
* @returns True if the resource is a "ProfileResource".
|
|
29
29
|
*/
|
|
30
30
|
function isProfileResource(resource) {
|
|
31
|
-
return resource.resourceType === 'Patient' ||
|
|
31
|
+
return (resource.resourceType === 'Patient' ||
|
|
32
32
|
resource.resourceType === 'Practitioner' ||
|
|
33
|
-
resource.resourceType === 'RelatedPerson';
|
|
33
|
+
resource.resourceType === 'RelatedPerson');
|
|
34
34
|
}
|
|
35
35
|
exports.isProfileResource = isProfileResource;
|
|
36
36
|
/**
|
|
@@ -51,6 +51,11 @@ function getDisplayString(resource) {
|
|
|
51
51
|
return deviceName;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
if (resource.resourceType === 'User') {
|
|
55
|
+
if (resource.email) {
|
|
56
|
+
return resource.email;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
54
59
|
const simpleName = resource.name;
|
|
55
60
|
if (simpleName && typeof simpleName === 'string') {
|
|
56
61
|
return simpleName;
|
|
@@ -136,7 +141,7 @@ exports.stringify = stringify;
|
|
|
136
141
|
* @param {*} v Property value.
|
|
137
142
|
*/
|
|
138
143
|
function stringifyReplacer(k, v) {
|
|
139
|
-
return
|
|
144
|
+
return k === '__key' || isEmpty(v) ? undefined : v;
|
|
140
145
|
}
|
|
141
146
|
/**
|
|
142
147
|
* Returns true if the value is empty (null, undefined, empty string, or empty object).
|
|
@@ -162,8 +167,8 @@ function deepEquals(object1, object2, path) {
|
|
|
162
167
|
let keys1 = Object.keys(object1);
|
|
163
168
|
let keys2 = Object.keys(object2);
|
|
164
169
|
if (path === 'meta') {
|
|
165
|
-
keys1 = keys1.filter(k => k !== 'versionId' && k !== 'lastUpdated');
|
|
166
|
-
keys2 = keys2.filter(k => k !== 'versionId' && k !== 'lastUpdated');
|
|
170
|
+
keys1 = keys1.filter((k) => k !== 'versionId' && k !== 'lastUpdated' && k !== 'author');
|
|
171
|
+
keys2 = keys2.filter((k) => k !== 'versionId' && k !== 'lastUpdated' && k !== 'author');
|
|
167
172
|
}
|
|
168
173
|
if (keys1.length !== keys2.length) {
|
|
169
174
|
return false;
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AACA,qCAA2C;AAI3C;;;;GAIG;AACH,SAAgB,eAAe,CAAqB,QAAW;IAC7D,MAAM,SAAS,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAC1E,CAAC;AAJD,0CAIC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,QAAkB;IACnD,OAAO,QAAQ,CAAC,YAAY,GAAG,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC;AACnD,CAAC;AAFD,gDAEC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,QAAkB;IAClD,OAAO,QAAQ,CAAC,YAAY,KAAK,SAAS;QACxC,QAAQ,CAAC,YAAY,KAAK,cAAc;QACxC,QAAQ,CAAC,YAAY,KAAK,eAAe,CAAC;AAC9C,CA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EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAFD,gCAEC;AAED,SAAgB,WAAW,CAAC,CAAS;IACnC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAC/B,CAAC;AAFD,kCAEC","sourcesContent":["import { Device, Patient, Practitioner, Reference, RelatedPerson, Resource } from './fhir';\nimport { formatHumanName } from './format';\n\nexport type ProfileResource = Patient | Practitioner | RelatedPerson;\n\n/**\n * Creates a reference resource.\n * @param resource The FHIR reesource.\n * @returns A reference resource.\n */\nexport function createReference<T extends Resource>(resource: T): Reference<T> {\n const reference = getReferenceString(resource);\n const display = getDisplayString(resource);\n return (display === reference) ? { reference } : { reference, display };\n}\n\n/**\n * Returns a reference string for a resource.\n * @param resource The FHIR resource.\n * @returns A reference string of the form resourceType/id.\n */\nexport function getReferenceString(resource: Resource): string {\n return resource.resourceType + '/' + resource.id;\n}\n\n/**\n * Returns true if the resource is a \"ProfileResource\".\n * @param resource The FHIR resource.\n * @returns True if the resource is a \"ProfileResource\".\n */\nexport function isProfileResource(resource: Resource): boolean {\n return resource.resourceType === 'Patient' ||\n resource.resourceType === 'Practitioner' ||\n resource.resourceType === 'RelatedPerson';\n}\n\n/**\n * Returns a display string for the resource.\n * @param resource The input resource.\n * @return Human friendly display string.\n */\nexport function getDisplayString(resource: Resource): string {\n if (isProfileResource(resource)) {\n const profileName = getProfileResourceDisplayString(resource as ProfileResource);\n if (profileName) {\n return profileName;\n }\n }\n if (resource.resourceType === 'Device') {\n const deviceName = getDeviceDisplayString(resource);\n if (deviceName) {\n return deviceName;\n }\n }\n const simpleName = (resource as any).name;\n if (simpleName && typeof simpleName === 'string') {\n return simpleName;\n }\n return getReferenceString(resource);\n}\n\n/**\n * Returns a display string for a profile resource if one is found.\n * @param resource The profile resource.\n * @returns The display name if one is found.\n */\nfunction getProfileResourceDisplayString(resource: ProfileResource): string | undefined {\n const names = resource.name;\n if (names && names.length > 0) {\n return formatHumanName(names[0]);\n }\n return undefined;\n}\n\n/**\n * Returns a display string for a device resource if one is found.\n * @param device The device resource.\n * @returns The display name if one is found.\n */\nfunction getDeviceDisplayString(device: Device): string | undefined {\n const names = device.deviceName;\n if (names && names.length > 0) {\n return names[0].name;\n }\n return undefined;\n}\n\n/**\n * Returns an image URL for the resource, if one is available.\n * @param resource The input resource.\n * @returns The image URL for the resource or undefined.\n */\nexport function getImageSrc(resource: Resource): string | undefined {\n if (isProfileResource(resource)) {\n const photos = (resource as ProfileResource).photo;\n if (photos) {\n for (const photo of photos) {\n if (photo.url && photo.contentType && photo.contentType.startsWith('image/')) {\n return photo.url;\n }\n }\n }\n }\n return undefined;\n}\n\n/**\n * Returns a Date property as a Date.\n * When working with JSON objects, Dates are often serialized as ISO-8601 strings.\n * When that happens, we need to safely convert to a proper Date object.\n * @param date The date property value, which could be a string or a Date object.\n * @returns A Date object.\n */\nexport function getDateProperty(date: string | undefined): Date | undefined {\n return date ? new Date(date) : undefined;\n}\n\n/**\n * FHIR JSON stringify.\n * Removes properties with empty string values.\n * Removes objects with zero properties.\n * See: https://www.hl7.org/fhir/json.html\n * @param value The input value.\n * @param pretty Optional flag to pretty-print the JSON.\n * @returns The resulting JSON string.\n */\nexport function stringify(value: any, pretty?: boolean): string {\n return JSON.stringify(value, stringifyReplacer, pretty ? 2 : undefined);\n}\n\n/**\n * Evaluates JSON key/value pairs for FHIR JSON stringify.\n * Removes properties with empty string values.\n * Removes objects with zero properties.\n * Replaces any key/value pair of key \"__key\" with value undefined.\n * This function can be used as the 2nd argument to stringify to remove __key properties.\n * We add __key properties to array elements to improve React render performance.\n * @param {string} k Property key.\n * @param {*} v Property value.\n */\nfunction stringifyReplacer(k: string, v: any): any {\n return (k === '__key' || isEmpty(v)) ? undefined : v;\n}\n\n/**\n * Returns true if the value is empty (null, undefined, empty string, or empty object).\n * @param v Any value.\n * @returns True if the value is an empty string or an empty object.\n */\nfunction isEmpty(v: any): boolean {\n if (v === null || v === undefined) {\n return true;\n }\n const t = typeof v;\n return (t === 'string' && v === '') || (t === 'object' && Object.keys(v).length === 0);\n}\n\n/**\n * Resource equality.\n * Ignores meta.versionId and meta.lastUpdated.\n * See: https://dmitripavlutin.com/how-to-compare-objects-in-javascript/#4-deep-equality\n * @param object1 The first object.\n * @param object2 The second object.\n * @returns True if the objects are equal.\n */\nexport function deepEquals(object1: any, object2: any, path?: string): boolean {\n let keys1 = Object.keys(object1);\n let keys2 = Object.keys(object2);\n if (path === 'meta') {\n keys1 = keys1.filter(k => k !== 'versionId' && k !== 'lastUpdated');\n keys2 = keys2.filter(k => k !== 'versionId' && k !== 'lastUpdated');\n }\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (const key of keys1) {\n const val1 = object1[key];\n const val2 = object2[key];\n if (isObject(val1) && isObject(val2)) {\n if (!deepEquals(val1, val2, key)) {\n return false;\n }\n } else {\n if (val1 !== val2) {\n return false;\n }\n }\n }\n return true;\n}\n\nfunction isObject(object: any): boolean {\n return object !== null && typeof object === 'object';\n}\n\n// Precompute hex octets\n// See: https://stackoverflow.com/a/55200387\nconst byteToHex: string[] = [];\nfor (let n = 0; n < 256; n++) {\n byteToHex.push(n.toString(16).padStart(2, '0'));\n}\n\n/**\n * Converts an ArrayBuffer to hex string.\n * See: https://stackoverflow.com/a/55200387\n * @param arrayBuffer The input array buffer.\n * @returns The resulting hex string.\n */\nexport function arrayBufferToHex(arrayBuffer: ArrayBuffer): string {\n const bytes = new Uint8Array(arrayBuffer);\n const result: string[] = new Array(bytes.length);\n for (let i = 0; i < bytes.length; i++) {\n result[i] = byteToHex[bytes[i]];\n }\n return result.join('');\n}\n\n/**\n * Converts an ArrayBuffer to a base-64 encoded string.\n * @param arrayBuffer The input array buffer.\n * @returns The base-64 encoded string.\n */\nexport function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string {\n const bytes = new Uint8Array(arrayBuffer);\n const result: string[] = [];\n for (let i = 0; i < bytes.length; i++) {\n result[i] = String.fromCharCode(bytes[i]);\n }\n return window.btoa(result.join(''));\n}\n\nexport function capitalize(word: string): string {\n return word.charAt(0).toUpperCase() + word.substr(1);\n}\n\nexport function isLowerCase(c: string): boolean {\n return c === c.toLowerCase();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AACA,qCAA2C;AAI3C;;;;GAIG;AACH,SAAgB,eAAe,CAAqB,QAAW;IAC7D,MAAM,SAAS,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AACxE,CAAC;AAJD,0CAIC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,QAAkB;IACnD,OAAO,QAAQ,CAAC,YAAY,GAAG,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC;AACnD,CAAC;AAFD,gDAEC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,QAAkB;IAClD,OAAO,CACL,QAAQ,CAAC,YAAY,KAAK,SAAS;QACnC,QAAQ,CAAC,YAAY,KAAK,cAAc;QACxC,QAAQ,CAAC,YAAY,KAAK,eAAe,CAC1C,CAAC;AACJ,CAAC;AAND,8CAMC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,QAAkB;IACjD,IAAI,iBAAiB,CAAC,QAAQ,CAAC,EAAE;QAC/B,MAAM,WAAW,GAAG,+BAA+B,CAAC,QAA2B,CAAC,CAAC;QACjF,IAAI,WAAW,EAAE;YACf,OAAO,WAAW,CAAC;SACpB;KACF;IACD,IAAI,QAAQ,CAAC,YAAY,KAAK,QAAQ,EAAE;QACtC,MAAM,UAAU,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,UAAU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/B,CAAC;AAFD,kCAEC","sourcesContent":["import { Device, Patient, Practitioner, Reference, RelatedPerson, Resource } from '@medplum/fhirtypes';\nimport { formatHumanName } from './format';\n\nexport type ProfileResource = Patient | Practitioner | RelatedPerson;\n\n/**\n * Creates a reference resource.\n * @param resource The FHIR reesource.\n * @returns A reference resource.\n */\nexport function createReference<T extends Resource>(resource: T): Reference<T> {\n const reference = getReferenceString(resource);\n const display = getDisplayString(resource);\n return display === reference ? { reference } : { reference, display };\n}\n\n/**\n * Returns a reference string for a resource.\n * @param resource The FHIR resource.\n * @returns A reference string of the form resourceType/id.\n */\nexport function getReferenceString(resource: Resource): string {\n return resource.resourceType + '/' + resource.id;\n}\n\n/**\n * Returns true if the resource is a \"ProfileResource\".\n * @param resource The FHIR resource.\n * @returns True if the resource is a \"ProfileResource\".\n */\nexport function isProfileResource(resource: Resource): boolean {\n return (\n resource.resourceType === 'Patient' ||\n resource.resourceType === 'Practitioner' ||\n resource.resourceType === 'RelatedPerson'\n );\n}\n\n/**\n * Returns a display string for the resource.\n * @param resource The input resource.\n * @return Human friendly display string.\n */\nexport function getDisplayString(resource: Resource): string {\n if (isProfileResource(resource)) {\n const profileName = getProfileResourceDisplayString(resource as ProfileResource);\n if (profileName) {\n return profileName;\n }\n }\n if (resource.resourceType === 'Device') {\n const deviceName = getDeviceDisplayString(resource);\n if (deviceName) {\n return deviceName;\n }\n }\n if (resource.resourceType === 'User') {\n if (resource.email) {\n return resource.email;\n }\n }\n const simpleName = (resource as any).name;\n if (simpleName && typeof simpleName === 'string') {\n return simpleName;\n }\n return getReferenceString(resource);\n}\n\n/**\n * Returns a display string for a profile resource if one is found.\n * @param resource The profile resource.\n * @returns The display name if one is found.\n */\nfunction getProfileResourceDisplayString(resource: ProfileResource): string | undefined {\n const names = resource.name;\n if (names && names.length > 0) {\n return formatHumanName(names[0]);\n }\n return undefined;\n}\n\n/**\n * Returns a display string for a device resource if one is found.\n * @param device The device resource.\n * @returns The display name if one is found.\n */\nfunction getDeviceDisplayString(device: Device): string | undefined {\n const names = device.deviceName;\n if (names && names.length > 0) {\n return names[0].name;\n }\n return undefined;\n}\n\n/**\n * Returns an image URL for the resource, if one is available.\n * @param resource The input resource.\n * @returns The image URL for the resource or undefined.\n */\nexport function getImageSrc(resource: Resource): string | undefined {\n if (isProfileResource(resource)) {\n const photos = (resource as ProfileResource).photo;\n if (photos) {\n for (const photo of photos) {\n if (photo.url && photo.contentType && photo.contentType.startsWith('image/')) {\n return photo.url;\n }\n }\n }\n }\n return undefined;\n}\n\n/**\n * Returns a Date property as a Date.\n * When working with JSON objects, Dates are often serialized as ISO-8601 strings.\n * When that happens, we need to safely convert to a proper Date object.\n * @param date The date property value, which could be a string or a Date object.\n * @returns A Date object.\n */\nexport function getDateProperty(date: string | undefined): Date | undefined {\n return date ? new Date(date) : undefined;\n}\n\n/**\n * FHIR JSON stringify.\n * Removes properties with empty string values.\n * Removes objects with zero properties.\n * See: https://www.hl7.org/fhir/json.html\n * @param value The input value.\n * @param pretty Optional flag to pretty-print the JSON.\n * @returns The resulting JSON string.\n */\nexport function stringify(value: any, pretty?: boolean): string {\n return JSON.stringify(value, stringifyReplacer, pretty ? 2 : undefined);\n}\n\n/**\n * Evaluates JSON key/value pairs for FHIR JSON stringify.\n * Removes properties with empty string values.\n * Removes objects with zero properties.\n * Replaces any key/value pair of key \"__key\" with value undefined.\n * This function can be used as the 2nd argument to stringify to remove __key properties.\n * We add __key properties to array elements to improve React render performance.\n * @param {string} k Property key.\n * @param {*} v Property value.\n */\nfunction stringifyReplacer(k: string, v: any): any {\n return k === '__key' || isEmpty(v) ? undefined : v;\n}\n\n/**\n * Returns true if the value is empty (null, undefined, empty string, or empty object).\n * @param v Any value.\n * @returns True if the value is an empty string or an empty object.\n */\nfunction isEmpty(v: any): boolean {\n if (v === null || v === undefined) {\n return true;\n }\n const t = typeof v;\n return (t === 'string' && v === '') || (t === 'object' && Object.keys(v).length === 0);\n}\n\n/**\n * Resource equality.\n * Ignores meta.versionId and meta.lastUpdated.\n * See: https://dmitripavlutin.com/how-to-compare-objects-in-javascript/#4-deep-equality\n * @param object1 The first object.\n * @param object2 The second object.\n * @returns True if the objects are equal.\n */\nexport function deepEquals(object1: any, object2: any, path?: string): boolean {\n let keys1 = Object.keys(object1);\n let keys2 = Object.keys(object2);\n if (path === 'meta') {\n keys1 = keys1.filter((k) => k !== 'versionId' && k !== 'lastUpdated' && k !== 'author');\n keys2 = keys2.filter((k) => k !== 'versionId' && k !== 'lastUpdated' && k !== 'author');\n }\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (const key of keys1) {\n const val1 = object1[key];\n const val2 = object2[key];\n if (isObject(val1) && isObject(val2)) {\n if (!deepEquals(val1, val2, key)) {\n return false;\n }\n } else {\n if (val1 !== val2) {\n return false;\n }\n }\n }\n return true;\n}\n\nfunction isObject(object: any): boolean {\n return object !== null && typeof object === 'object';\n}\n\n// Precompute hex octets\n// See: https://stackoverflow.com/a/55200387\nconst byteToHex: string[] = [];\nfor (let n = 0; n < 256; n++) {\n byteToHex.push(n.toString(16).padStart(2, '0'));\n}\n\n/**\n * Converts an ArrayBuffer to hex string.\n * See: https://stackoverflow.com/a/55200387\n * @param arrayBuffer The input array buffer.\n * @returns The resulting hex string.\n */\nexport function arrayBufferToHex(arrayBuffer: ArrayBuffer): string {\n const bytes = new Uint8Array(arrayBuffer);\n const result: string[] = new Array(bytes.length);\n for (let i = 0; i < bytes.length; i++) {\n result[i] = byteToHex[bytes[i]];\n }\n return result.join('');\n}\n\n/**\n * Converts an ArrayBuffer to a base-64 encoded string.\n * @param arrayBuffer The input array buffer.\n * @returns The base-64 encoded string.\n */\nexport function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string {\n const bytes = new Uint8Array(arrayBuffer);\n const result: string[] = [];\n for (let i = 0; i < bytes.length; i++) {\n result[i] = String.fromCharCode(bytes[i]);\n }\n return window.btoa(result.join(''));\n}\n\nexport function capitalize(word: string): string {\n return word.charAt(0).toUpperCase() + word.substr(1);\n}\n\nexport function isLowerCase(c: string): boolean {\n return c === c.toLowerCase();\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medplum/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Medplum TS/JS Library",
|
|
5
5
|
"author": "Medplum <hello@medplum.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -13,12 +13,11 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"clean": "rimraf dist",
|
|
15
15
|
"build": "npm run clean && tsc",
|
|
16
|
-
"test": "jest"
|
|
17
|
-
|
|
16
|
+
"test": "jest"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@medplum/fhirtypes": "0.3.0"
|
|
18
20
|
},
|
|
19
|
-
"files": [
|
|
20
|
-
"dist"
|
|
21
|
-
],
|
|
22
21
|
"main": "dist/index.js",
|
|
23
22
|
"types": "dist/index.d.ts",
|
|
24
23
|
"sideEffects": false,
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Meta } from './Meta';
|
|
2
|
-
import { Reference } from './Reference';
|
|
3
|
-
/**
|
|
4
|
-
* Access Policy for user or user group that defines how entities can or
|
|
5
|
-
* cannot access resources.
|
|
6
|
-
*/
|
|
7
|
-
export interface AccessPolicy {
|
|
8
|
-
/**
|
|
9
|
-
* This is a AccessPolicy resource
|
|
10
|
-
*/
|
|
11
|
-
readonly resourceType: 'AccessPolicy';
|
|
12
|
-
/**
|
|
13
|
-
* The logical id of the resource, as used in the URL for the resource.
|
|
14
|
-
* Once assigned, this value never changes.
|
|
15
|
-
*/
|
|
16
|
-
readonly id?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The metadata about the resource. This is content that is maintained by
|
|
19
|
-
* the infrastructure. Changes to the content might not always be
|
|
20
|
-
* associated with version changes to the resource.
|
|
21
|
-
*/
|
|
22
|
-
readonly meta?: Meta;
|
|
23
|
-
/**
|
|
24
|
-
* A reference to a set of rules that were followed when the resource was
|
|
25
|
-
* constructed, and which must be understood when processing the content.
|
|
26
|
-
* Often, this is a reference to an implementation guide that defines the
|
|
27
|
-
* special rules along with other profiles etc.
|
|
28
|
-
*/
|
|
29
|
-
readonly implicitRules?: string;
|
|
30
|
-
/**
|
|
31
|
-
* The base language in which the resource is written.
|
|
32
|
-
*/
|
|
33
|
-
readonly language?: string;
|
|
34
|
-
/**
|
|
35
|
-
* A name associated with the AccessPolicy.
|
|
36
|
-
*/
|
|
37
|
-
readonly name?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Optional compartment for newly created resources. If this field is
|
|
40
|
-
* set, any resources created by a user with this access policy will
|
|
41
|
-
* automatically be included in the specified compartment.
|
|
42
|
-
*/
|
|
43
|
-
readonly compartment?: Reference;
|
|
44
|
-
/**
|
|
45
|
-
* Access details for a resource type.
|
|
46
|
-
*/
|
|
47
|
-
readonly resource?: AccessPolicyResource[];
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Access details for a resource type.
|
|
51
|
-
*/
|
|
52
|
-
export interface AccessPolicyResource {
|
|
53
|
-
/**
|
|
54
|
-
* The resource type.
|
|
55
|
-
*/
|
|
56
|
-
readonly resourceType?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Optional compartment restriction for the resource type.
|
|
59
|
-
*/
|
|
60
|
-
readonly compartment?: Reference;
|
|
61
|
-
/**
|
|
62
|
-
* Optional flag to indicate that the resource type is read-only.
|
|
63
|
-
*/
|
|
64
|
-
readonly readonly?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Optional list of hidden fields. Hidden fields are not readable or
|
|
67
|
-
* writeable.
|
|
68
|
-
*/
|
|
69
|
-
readonly hiddenFields?: string[];
|
|
70
|
-
/**
|
|
71
|
-
* Optional list of read-only fields. Read-only fields are readable but
|
|
72
|
-
* not writeable.
|
|
73
|
-
*/
|
|
74
|
-
readonly readonlyFields?: string[];
|
|
75
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccessPolicy.js","sourceRoot":"","sources":["../../src/fhir/AccessPolicy.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Generated by @medplum/generator\n * Do not edit manually.\n */\n\nimport { Meta } from './Meta';\nimport { Reference } from './Reference';\n\n/**\n * Access Policy for user or user group that defines how entities can or\n * cannot access resources.\n */\nexport interface AccessPolicy {\n\n /**\n * This is a AccessPolicy resource\n */\n readonly resourceType: 'AccessPolicy';\n\n /**\n * The logical id of the resource, as used in the URL for the resource.\n * Once assigned, this value never changes.\n */\n readonly id?: string;\n\n /**\n * The metadata about the resource. This is content that is maintained by\n * the infrastructure. Changes to the content might not always be\n * associated with version changes to the resource.\n */\n readonly meta?: Meta;\n\n /**\n * A reference to a set of rules that were followed when the resource was\n * constructed, and which must be understood when processing the content.\n * Often, this is a reference to an implementation guide that defines the\n * special rules along with other profiles etc.\n */\n readonly implicitRules?: string;\n\n /**\n * The base language in which the resource is written.\n */\n readonly language?: string;\n\n /**\n * A name associated with the AccessPolicy.\n */\n readonly name?: string;\n\n /**\n * Optional compartment for newly created resources. If this field is\n * set, any resources created by a user with this access policy will\n * automatically be included in the specified compartment.\n */\n readonly compartment?: Reference;\n\n /**\n * Access details for a resource type.\n */\n readonly resource?: AccessPolicyResource[];\n}\n\n/**\n * Access details for a resource type.\n */\nexport interface AccessPolicyResource {\n\n /**\n * The resource type.\n */\n readonly resourceType?: string;\n\n /**\n * Optional compartment restriction for the resource type.\n */\n readonly compartment?: Reference;\n\n /**\n * Optional flag to indicate that the resource type is read-only.\n */\n readonly readonly?: boolean;\n\n /**\n * Optional list of hidden fields. Hidden fields are not readable or\n * writeable.\n */\n readonly hiddenFields?: string[];\n\n /**\n * Optional list of read-only fields. Read-only fields are readable but\n * not writeable.\n */\n readonly readonlyFields?: string[];\n}\n"]}
|
package/dist/fhir/Account.d.ts
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { CodeableConcept } from './CodeableConcept';
|
|
2
|
-
import { Coverage } from './Coverage';
|
|
3
|
-
import { Device } from './Device';
|
|
4
|
-
import { Extension } from './Extension';
|
|
5
|
-
import { HealthcareService } from './HealthcareService';
|
|
6
|
-
import { Identifier } from './Identifier';
|
|
7
|
-
import { Location } from './Location';
|
|
8
|
-
import { Meta } from './Meta';
|
|
9
|
-
import { Narrative } from './Narrative';
|
|
10
|
-
import { Organization } from './Organization';
|
|
11
|
-
import { Patient } from './Patient';
|
|
12
|
-
import { Period } from './Period';
|
|
13
|
-
import { Practitioner } from './Practitioner';
|
|
14
|
-
import { PractitionerRole } from './PractitionerRole';
|
|
15
|
-
import { Reference } from './Reference';
|
|
16
|
-
import { RelatedPerson } from './RelatedPerson';
|
|
17
|
-
import { Resource } from './Resource';
|
|
18
|
-
/**
|
|
19
|
-
* A financial tool for tracking value accrued for a particular purpose.
|
|
20
|
-
* In the healthcare field, used to track charges for a patient, cost
|
|
21
|
-
* centers, etc.
|
|
22
|
-
*/
|
|
23
|
-
export interface Account {
|
|
24
|
-
/**
|
|
25
|
-
* This is a Account resource
|
|
26
|
-
*/
|
|
27
|
-
readonly resourceType: 'Account';
|
|
28
|
-
/**
|
|
29
|
-
* The logical id of the resource, as used in the URL for the resource.
|
|
30
|
-
* Once assigned, this value never changes.
|
|
31
|
-
*/
|
|
32
|
-
readonly id?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The metadata about the resource. This is content that is maintained by
|
|
35
|
-
* the infrastructure. Changes to the content might not always be
|
|
36
|
-
* associated with version changes to the resource.
|
|
37
|
-
*/
|
|
38
|
-
readonly meta?: Meta;
|
|
39
|
-
/**
|
|
40
|
-
* A reference to a set of rules that were followed when the resource was
|
|
41
|
-
* constructed, and which must be understood when processing the content.
|
|
42
|
-
* Often, this is a reference to an implementation guide that defines the
|
|
43
|
-
* special rules along with other profiles etc.
|
|
44
|
-
*/
|
|
45
|
-
readonly implicitRules?: string;
|
|
46
|
-
/**
|
|
47
|
-
* The base language in which the resource is written.
|
|
48
|
-
*/
|
|
49
|
-
readonly language?: string;
|
|
50
|
-
/**
|
|
51
|
-
* A human-readable narrative that contains a summary of the resource and
|
|
52
|
-
* can be used to represent the content of the resource to a human. The
|
|
53
|
-
* narrative need not encode all the structured data, but is required to
|
|
54
|
-
* contain sufficient detail to make it "clinically safe" for a human to
|
|
55
|
-
* just read the narrative. Resource definitions may define what content
|
|
56
|
-
* should be represented in the narrative to ensure clinical safety.
|
|
57
|
-
*/
|
|
58
|
-
readonly text?: Narrative;
|
|
59
|
-
/**
|
|
60
|
-
* These resources do not have an independent existence apart from the
|
|
61
|
-
* resource that contains them - they cannot be identified independently,
|
|
62
|
-
* and nor can they have their own independent transaction scope.
|
|
63
|
-
*/
|
|
64
|
-
readonly contained?: Resource[];
|
|
65
|
-
/**
|
|
66
|
-
* May be used to represent additional information that is not part of
|
|
67
|
-
* the basic definition of the resource. To make the use of extensions
|
|
68
|
-
* safe and manageable, there is a strict set of governance applied to
|
|
69
|
-
* the definition and use of extensions. Though any implementer can
|
|
70
|
-
* define an extension, there is a set of requirements that SHALL be met
|
|
71
|
-
* as part of the definition of the extension.
|
|
72
|
-
*/
|
|
73
|
-
readonly extension?: Extension[];
|
|
74
|
-
/**
|
|
75
|
-
* May be used to represent additional information that is not part of
|
|
76
|
-
* the basic definition of the resource and that modifies the
|
|
77
|
-
* understanding of the element that contains it and/or the understanding
|
|
78
|
-
* of the containing element's descendants. Usually modifier elements
|
|
79
|
-
* provide negation or qualification. To make the use of extensions safe
|
|
80
|
-
* and manageable, there is a strict set of governance applied to the
|
|
81
|
-
* definition and use of extensions. Though any implementer is allowed to
|
|
82
|
-
* define an extension, there is a set of requirements that SHALL be met
|
|
83
|
-
* as part of the definition of the extension. Applications processing a
|
|
84
|
-
* resource are required to check for modifier extensions.
|
|
85
|
-
*
|
|
86
|
-
* Modifier extensions SHALL NOT change the meaning of any elements on
|
|
87
|
-
* Resource or DomainResource (including cannot change the meaning of
|
|
88
|
-
* modifierExtension itself).
|
|
89
|
-
*/
|
|
90
|
-
readonly modifierExtension?: Extension[];
|
|
91
|
-
/**
|
|
92
|
-
* Unique identifier used to reference the account. Might or might not
|
|
93
|
-
* be intended for human use (e.g. credit card number).
|
|
94
|
-
*/
|
|
95
|
-
readonly identifier?: Identifier[];
|
|
96
|
-
/**
|
|
97
|
-
* Indicates whether the account is presently used/usable or not.
|
|
98
|
-
*/
|
|
99
|
-
readonly status?: string;
|
|
100
|
-
/**
|
|
101
|
-
* Categorizes the account for reporting and searching purposes.
|
|
102
|
-
*/
|
|
103
|
-
readonly type?: CodeableConcept;
|
|
104
|
-
/**
|
|
105
|
-
* Name used for the account when displaying it to humans in reports,
|
|
106
|
-
* etc.
|
|
107
|
-
*/
|
|
108
|
-
readonly name?: string;
|
|
109
|
-
/**
|
|
110
|
-
* Identifies the entity which incurs the expenses. While the immediate
|
|
111
|
-
* recipients of services or goods might be entities related to the
|
|
112
|
-
* subject, the expenses were ultimately incurred by the subject of the
|
|
113
|
-
* Account.
|
|
114
|
-
*/
|
|
115
|
-
readonly subject?: Reference<Patient | Device | Practitioner | PractitionerRole | Location | HealthcareService | Organization>[];
|
|
116
|
-
/**
|
|
117
|
-
* The date range of services associated with this account.
|
|
118
|
-
*/
|
|
119
|
-
readonly servicePeriod?: Period;
|
|
120
|
-
/**
|
|
121
|
-
* The party(s) that are responsible for covering the payment of this
|
|
122
|
-
* account, and what order should they be applied to the account.
|
|
123
|
-
*/
|
|
124
|
-
readonly coverage?: AccountCoverage[];
|
|
125
|
-
/**
|
|
126
|
-
* Indicates the service area, hospital, department, etc. with
|
|
127
|
-
* responsibility for managing the Account.
|
|
128
|
-
*/
|
|
129
|
-
readonly owner?: Reference<Organization>;
|
|
130
|
-
/**
|
|
131
|
-
* Provides additional information about what the account tracks and how
|
|
132
|
-
* it is used.
|
|
133
|
-
*/
|
|
134
|
-
readonly description?: string;
|
|
135
|
-
/**
|
|
136
|
-
* The parties responsible for balancing the account if other payment
|
|
137
|
-
* options fall short.
|
|
138
|
-
*/
|
|
139
|
-
readonly guarantor?: AccountGuarantor[];
|
|
140
|
-
/**
|
|
141
|
-
* Reference to a parent Account.
|
|
142
|
-
*/
|
|
143
|
-
readonly partOf?: Reference<Account>;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* The party(s) that are responsible for covering the payment of this
|
|
147
|
-
* account, and what order should they be applied to the account.
|
|
148
|
-
*/
|
|
149
|
-
export interface AccountCoverage {
|
|
150
|
-
/**
|
|
151
|
-
* Unique id for the element within a resource (for internal references).
|
|
152
|
-
* This may be any string value that does not contain spaces.
|
|
153
|
-
*/
|
|
154
|
-
readonly id?: string;
|
|
155
|
-
/**
|
|
156
|
-
* May be used to represent additional information that is not part of
|
|
157
|
-
* the basic definition of the element. To make the use of extensions
|
|
158
|
-
* safe and manageable, there is a strict set of governance applied to
|
|
159
|
-
* the definition and use of extensions. Though any implementer can
|
|
160
|
-
* define an extension, there is a set of requirements that SHALL be met
|
|
161
|
-
* as part of the definition of the extension.
|
|
162
|
-
*/
|
|
163
|
-
readonly extension?: Extension[];
|
|
164
|
-
/**
|
|
165
|
-
* May be used to represent additional information that is not part of
|
|
166
|
-
* the basic definition of the element and that modifies the
|
|
167
|
-
* understanding of the element in which it is contained and/or the
|
|
168
|
-
* understanding of the containing element's descendants. Usually
|
|
169
|
-
* modifier elements provide negation or qualification. To make the use
|
|
170
|
-
* of extensions safe and manageable, there is a strict set of governance
|
|
171
|
-
* applied to the definition and use of extensions. Though any
|
|
172
|
-
* implementer can define an extension, there is a set of requirements
|
|
173
|
-
* that SHALL be met as part of the definition of the extension.
|
|
174
|
-
* Applications processing a resource are required to check for modifier
|
|
175
|
-
* extensions.
|
|
176
|
-
*
|
|
177
|
-
* Modifier extensions SHALL NOT change the meaning of any elements on
|
|
178
|
-
* Resource or DomainResource (including cannot change the meaning of
|
|
179
|
-
* modifierExtension itself).
|
|
180
|
-
*/
|
|
181
|
-
readonly modifierExtension?: Extension[];
|
|
182
|
-
/**
|
|
183
|
-
* The party(s) that contribute to payment (or part of) of the charges
|
|
184
|
-
* applied to this account (including self-pay).
|
|
185
|
-
*
|
|
186
|
-
* A coverage may only be responsible for specific types of charges, and
|
|
187
|
-
* the sequence of the coverages in the account could be important when
|
|
188
|
-
* processing billing.
|
|
189
|
-
*/
|
|
190
|
-
readonly coverage?: Reference<Coverage>;
|
|
191
|
-
/**
|
|
192
|
-
* The priority of the coverage in the context of this account.
|
|
193
|
-
*/
|
|
194
|
-
readonly priority?: number;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* The parties responsible for balancing the account if other payment
|
|
198
|
-
* options fall short.
|
|
199
|
-
*/
|
|
200
|
-
export interface AccountGuarantor {
|
|
201
|
-
/**
|
|
202
|
-
* Unique id for the element within a resource (for internal references).
|
|
203
|
-
* This may be any string value that does not contain spaces.
|
|
204
|
-
*/
|
|
205
|
-
readonly id?: string;
|
|
206
|
-
/**
|
|
207
|
-
* May be used to represent additional information that is not part of
|
|
208
|
-
* the basic definition of the element. To make the use of extensions
|
|
209
|
-
* safe and manageable, there is a strict set of governance applied to
|
|
210
|
-
* the definition and use of extensions. Though any implementer can
|
|
211
|
-
* define an extension, there is a set of requirements that SHALL be met
|
|
212
|
-
* as part of the definition of the extension.
|
|
213
|
-
*/
|
|
214
|
-
readonly extension?: Extension[];
|
|
215
|
-
/**
|
|
216
|
-
* May be used to represent additional information that is not part of
|
|
217
|
-
* the basic definition of the element and that modifies the
|
|
218
|
-
* understanding of the element in which it is contained and/or the
|
|
219
|
-
* understanding of the containing element's descendants. Usually
|
|
220
|
-
* modifier elements provide negation or qualification. To make the use
|
|
221
|
-
* of extensions safe and manageable, there is a strict set of governance
|
|
222
|
-
* applied to the definition and use of extensions. Though any
|
|
223
|
-
* implementer can define an extension, there is a set of requirements
|
|
224
|
-
* that SHALL be met as part of the definition of the extension.
|
|
225
|
-
* Applications processing a resource are required to check for modifier
|
|
226
|
-
* extensions.
|
|
227
|
-
*
|
|
228
|
-
* Modifier extensions SHALL NOT change the meaning of any elements on
|
|
229
|
-
* Resource or DomainResource (including cannot change the meaning of
|
|
230
|
-
* modifierExtension itself).
|
|
231
|
-
*/
|
|
232
|
-
readonly modifierExtension?: Extension[];
|
|
233
|
-
/**
|
|
234
|
-
* The entity who is responsible.
|
|
235
|
-
*/
|
|
236
|
-
readonly party?: Reference<Patient | RelatedPerson | Organization>;
|
|
237
|
-
/**
|
|
238
|
-
* A guarantor may be placed on credit hold or otherwise have their role
|
|
239
|
-
* temporarily suspended.
|
|
240
|
-
*/
|
|
241
|
-
readonly onHold?: boolean;
|
|
242
|
-
/**
|
|
243
|
-
* The timeframe during which the guarantor accepts responsibility for
|
|
244
|
-
* the account.
|
|
245
|
-
*/
|
|
246
|
-
readonly period?: Period;
|
|
247
|
-
}
|
package/dist/fhir/Account.js
DELETED
package/dist/fhir/Account.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Account.js","sourceRoot":"","sources":["../../src/fhir/Account.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Generated by @medplum/generator\n * Do not edit manually.\n */\n\nimport { CodeableConcept } from './CodeableConcept';\nimport { Coverage } from './Coverage';\nimport { Device } from './Device';\nimport { Extension } from './Extension';\nimport { HealthcareService } from './HealthcareService';\nimport { Identifier } from './Identifier';\nimport { Location } from './Location';\nimport { Meta } from './Meta';\nimport { Narrative } from './Narrative';\nimport { Organization } from './Organization';\nimport { Patient } from './Patient';\nimport { Period } from './Period';\nimport { Practitioner } from './Practitioner';\nimport { PractitionerRole } from './PractitionerRole';\nimport { Reference } from './Reference';\nimport { RelatedPerson } from './RelatedPerson';\nimport { Resource } from './Resource';\n\n/**\n * A financial tool for tracking value accrued for a particular purpose.\n * In the healthcare field, used to track charges for a patient, cost\n * centers, etc.\n */\nexport interface Account {\n\n /**\n * This is a Account resource\n */\n readonly resourceType: 'Account';\n\n /**\n * The logical id of the resource, as used in the URL for the resource.\n * Once assigned, this value never changes.\n */\n readonly id?: string;\n\n /**\n * The metadata about the resource. This is content that is maintained by\n * the infrastructure. Changes to the content might not always be\n * associated with version changes to the resource.\n */\n readonly meta?: Meta;\n\n /**\n * A reference to a set of rules that were followed when the resource was\n * constructed, and which must be understood when processing the content.\n * Often, this is a reference to an implementation guide that defines the\n * special rules along with other profiles etc.\n */\n readonly implicitRules?: string;\n\n /**\n * The base language in which the resource is written.\n */\n readonly language?: string;\n\n /**\n * A human-readable narrative that contains a summary of the resource and\n * can be used to represent the content of the resource to a human. The\n * narrative need not encode all the structured data, but is required to\n * contain sufficient detail to make it "clinically safe" for a human to\n * just read the narrative. Resource definitions may define what content\n * should be represented in the narrative to ensure clinical safety.\n */\n readonly text?: Narrative;\n\n /**\n * These resources do not have an independent existence apart from the\n * resource that contains them - they cannot be identified independently,\n * and nor can they have their own independent transaction scope.\n */\n readonly contained?: Resource[];\n\n /**\n * May be used to represent additional information that is not part of\n * the basic definition of the resource. To make the use of extensions\n * safe and manageable, there is a strict set of governance applied to\n * the definition and use of extensions. Though any implementer can\n * define an extension, there is a set of requirements that SHALL be met\n * as part of the definition of the extension.\n */\n readonly extension?: Extension[];\n\n /**\n * May be used to represent additional information that is not part of\n * the basic definition of the resource and that modifies the\n * understanding of the element that contains it and/or the understanding\n * of the containing element's descendants. Usually modifier elements\n * provide negation or qualification. To make the use of extensions safe\n * and manageable, there is a strict set of governance applied to the\n * definition and use of extensions. Though any implementer is allowed to\n * define an extension, there is a set of requirements that SHALL be met\n * as part of the definition of the extension. Applications processing a\n * resource are required to check for modifier extensions.\n *\n * Modifier extensions SHALL NOT change the meaning of any elements on\n * Resource or DomainResource (including cannot change the meaning of\n * modifierExtension itself).\n */\n readonly modifierExtension?: Extension[];\n\n /**\n * Unique identifier used to reference the account. Might or might not\n * be intended for human use (e.g. credit card number).\n */\n readonly identifier?: Identifier[];\n\n /**\n * Indicates whether the account is presently used/usable or not.\n */\n readonly status?: string;\n\n /**\n * Categorizes the account for reporting and searching purposes.\n */\n readonly type?: CodeableConcept;\n\n /**\n * Name used for the account when displaying it to humans in reports,\n * etc.\n */\n readonly name?: string;\n\n /**\n * Identifies the entity which incurs the expenses. While the immediate\n * recipients of services or goods might be entities related to the\n * subject, the expenses were ultimately incurred by the subject of the\n * Account.\n */\n readonly subject?: Reference<Patient | Device | Practitioner | PractitionerRole | Location | HealthcareService | Organization>[];\n\n /**\n * The date range of services associated with this account.\n */\n readonly servicePeriod?: Period;\n\n /**\n * The party(s) that are responsible for covering the payment of this\n * account, and what order should they be applied to the account.\n */\n readonly coverage?: AccountCoverage[];\n\n /**\n * Indicates the service area, hospital, department, etc. with\n * responsibility for managing the Account.\n */\n readonly owner?: Reference<Organization>;\n\n /**\n * Provides additional information about what the account tracks and how\n * it is used.\n */\n readonly description?: string;\n\n /**\n * The parties responsible for balancing the account if other payment\n * options fall short.\n */\n readonly guarantor?: AccountGuarantor[];\n\n /**\n * Reference to a parent Account.\n */\n readonly partOf?: Reference<Account>;\n}\n\n/**\n * The party(s) that are responsible for covering the payment of this\n * account, and what order should they be applied to the account.\n */\nexport interface AccountCoverage {\n\n /**\n * Unique id for the element within a resource (for internal references).\n * This may be any string value that does not contain spaces.\n */\n readonly id?: string;\n\n /**\n * May be used to represent additional information that is not part of\n * the basic definition of the element. To make the use of extensions\n * safe and manageable, there is a strict set of governance applied to\n * the definition and use of extensions. Though any implementer can\n * define an extension, there is a set of requirements that SHALL be met\n * as part of the definition of the extension.\n */\n readonly extension?: Extension[];\n\n /**\n * May be used to represent additional information that is not part of\n * the basic definition of the element and that modifies the\n * understanding of the element in which it is contained and/or the\n * understanding of the containing element's descendants. Usually\n * modifier elements provide negation or qualification. To make the use\n * of extensions safe and manageable, there is a strict set of governance\n * applied to the definition and use of extensions. Though any\n * implementer can define an extension, there is a set of requirements\n * that SHALL be met as part of the definition of the extension.\n * Applications processing a resource are required to check for modifier\n * extensions.\n *\n * Modifier extensions SHALL NOT change the meaning of any elements on\n * Resource or DomainResource (including cannot change the meaning of\n * modifierExtension itself).\n */\n readonly modifierExtension?: Extension[];\n\n /**\n * The party(s) that contribute to payment (or part of) of the charges\n * applied to this account (including self-pay).\n *\n * A coverage may only be responsible for specific types of charges, and\n * the sequence of the coverages in the account could be important when\n * processing billing.\n */\n readonly coverage?: Reference<Coverage>;\n\n /**\n * The priority of the coverage in the context of this account.\n */\n readonly priority?: number;\n}\n\n/**\n * The parties responsible for balancing the account if other payment\n * options fall short.\n */\nexport interface AccountGuarantor {\n\n /**\n * Unique id for the element within a resource (for internal references).\n * This may be any string value that does not contain spaces.\n */\n readonly id?: string;\n\n /**\n * May be used to represent additional information that is not part of\n * the basic definition of the element. To make the use of extensions\n * safe and manageable, there is a strict set of governance applied to\n * the definition and use of extensions. Though any implementer can\n * define an extension, there is a set of requirements that SHALL be met\n * as part of the definition of the extension.\n */\n readonly extension?: Extension[];\n\n /**\n * May be used to represent additional information that is not part of\n * the basic definition of the element and that modifies the\n * understanding of the element in which it is contained and/or the\n * understanding of the containing element's descendants. Usually\n * modifier elements provide negation or qualification. To make the use\n * of extensions safe and manageable, there is a strict set of governance\n * applied to the definition and use of extensions. Though any\n * implementer can define an extension, there is a set of requirements\n * that SHALL be met as part of the definition of the extension.\n * Applications processing a resource are required to check for modifier\n * extensions.\n *\n * Modifier extensions SHALL NOT change the meaning of any elements on\n * Resource or DomainResource (including cannot change the meaning of\n * modifierExtension itself).\n */\n readonly modifierExtension?: Extension[];\n\n /**\n * The entity who is responsible.\n */\n readonly party?: Reference<Patient | RelatedPerson | Organization>;\n\n /**\n * A guarantor may be placed on credit hold or otherwise have their role\n * temporarily suspended.\n */\n readonly onHold?: boolean;\n\n /**\n * The timeframe during which the guarantor accepts responsibility for\n * the account.\n */\n readonly period?: Period;\n}\n"]}
|