@medplum/core 0.1.6 → 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 -2
- package/dist/cache.js.map +1 -1
- package/dist/client.d.ts +72 -54
- package/dist/client.js +267 -223
- package/dist/client.js.map +1 -1
- package/dist/crypto.js +13 -2
- package/dist/crypto.js.map +1 -1
- package/dist/eventtarget.js +1 -2
- package/dist/eventtarget.js.map +1 -1
- package/dist/format.d.ts +1 -1
- package/dist/format.js +4 -4
- package/dist/format.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/jwt.js.map +1 -1
- package/dist/outcomes.d.ts +4 -1
- package/dist/outcomes.js +71 -24
- package/dist/outcomes.js.map +1 -1
- package/dist/search.js +7 -9
- package/dist/search.js.map +1 -1
- package/dist/searchparams.d.ts +34 -0
- package/dist/searchparams.js +128 -0
- package/dist/searchparams.js.map +1 -0
- package/dist/storage.d.ts +36 -12
- package/dist/storage.js +55 -22
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +3 -5
- package/dist/types.js +32 -18
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +14 -3
- package/dist/utils.js +57 -12
- package/dist/utils.js.map +1 -1
- package/package.json +3 -16
- package/dist/cache.test.d.ts +0 -1
- package/dist/cache.test.js +0 -29
- package/dist/cache.test.js.map +0 -1
- package/dist/client.test.d.ts +0 -1
- package/dist/client.test.js +0 -294
- package/dist/client.test.js.map +0 -1
- package/dist/eventtarget.test.d.ts +0 -1
- package/dist/eventtarget.test.js +0 -44
- package/dist/eventtarget.test.js.map +0 -1
- package/dist/fhir/Account.d.ts +0 -240
- package/dist/fhir/Account.js +0 -7
- package/dist/fhir/Account.js.map +0 -1
- package/dist/fhir/ActivityDefinition.d.ts +0 -494
- package/dist/fhir/ActivityDefinition.js +0 -7
- package/dist/fhir/ActivityDefinition.js.map +0 -1
- package/dist/fhir/Address.d.ts +0 -74
- package/dist/fhir/Address.js +0 -7
- package/dist/fhir/Address.js.map +0 -1
- package/dist/fhir/AdverseEvent.d.ts +0 -287
- 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 -278
- package/dist/fhir/AllergyIntolerance.js +0 -7
- package/dist/fhir/AllergyIntolerance.js.map +0 -1
- package/dist/fhir/Annotation.d.ts +0 -38
- package/dist/fhir/Annotation.js +0 -7
- package/dist/fhir/Annotation.js.map +0 -1
- package/dist/fhir/Appointment.d.ts +0 -273
- package/dist/fhir/Appointment.js +0 -7
- package/dist/fhir/Appointment.js.map +0 -1
- package/dist/fhir/AppointmentResponse.d.ts +0 -123
- package/dist/fhir/AppointmentResponse.js +0 -7
- package/dist/fhir/AppointmentResponse.js.map +0 -1
- package/dist/fhir/Attachment.d.ts +0 -57
- 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 -105
- package/dist/fhir/Basic.js +0 -7
- package/dist/fhir/Basic.js.map +0 -1
- package/dist/fhir/Binary.d.ts +0 -58
- package/dist/fhir/Binary.js +0 -7
- package/dist/fhir/Binary.js.map +0 -1
- package/dist/fhir/BiologicallyDerivedProduct.d.ts +0 -356
- package/dist/fhir/BiologicallyDerivedProduct.js +0 -7
- package/dist/fhir/BiologicallyDerivedProduct.js.map +0 -1
- package/dist/fhir/BodyStructure.d.ts +0 -118
- package/dist/fhir/BodyStructure.js +0 -7
- package/dist/fhir/BodyStructure.js.map +0 -1
- package/dist/fhir/Bundle.d.ts +0 -373
- package/dist/fhir/Bundle.js +0 -7
- package/dist/fhir/Bundle.js.map +0 -1
- package/dist/fhir/CapabilityStatement.d.ts +0 -1068
- package/dist/fhir/CapabilityStatement.js +0 -7
- package/dist/fhir/CapabilityStatement.js.map +0 -1
- package/dist/fhir/CarePlan.d.ts +0 -421
- package/dist/fhir/CarePlan.js +0 -7
- package/dist/fhir/CarePlan.js.map +0 -1
- package/dist/fhir/CareTeam.d.ts +0 -203
- package/dist/fhir/CareTeam.js +0 -7
- package/dist/fhir/CareTeam.js.map +0 -1
- package/dist/fhir/CatalogEntry.d.ts +0 -184
- package/dist/fhir/CatalogEntry.js +0 -7
- package/dist/fhir/CatalogEntry.js.map +0 -1
- package/dist/fhir/ChargeItem.d.ts +0 -270
- package/dist/fhir/ChargeItem.js +0 -7
- package/dist/fhir/ChargeItem.js.map +0 -1
- package/dist/fhir/ChargeItemDefinition.d.ts +0 -402
- package/dist/fhir/ChargeItemDefinition.js +0 -7
- package/dist/fhir/ChargeItemDefinition.js.map +0 -1
- package/dist/fhir/Claim.d.ts +0 -1089
- package/dist/fhir/Claim.js +0 -7
- package/dist/fhir/Claim.js.map +0 -1
- package/dist/fhir/ClaimResponse.d.ts +0 -1037
- package/dist/fhir/ClaimResponse.js +0 -7
- package/dist/fhir/ClaimResponse.js.map +0 -1
- package/dist/fhir/ClientApplication.d.ts +0 -54
- package/dist/fhir/ClientApplication.js +0 -7
- package/dist/fhir/ClientApplication.js.map +0 -1
- package/dist/fhir/ClinicalImpression.d.ts +0 -301
- package/dist/fhir/ClinicalImpression.js +0 -7
- package/dist/fhir/ClinicalImpression.js.map +0 -1
- package/dist/fhir/CodeSystem.d.ts +0 -546
- package/dist/fhir/CodeSystem.js +0 -7
- package/dist/fhir/CodeSystem.js.map +0 -1
- package/dist/fhir/CodeableConcept.d.ts +0 -32
- package/dist/fhir/CodeableConcept.js +0 -7
- package/dist/fhir/CodeableConcept.js.map +0 -1
- package/dist/fhir/Coding.d.ts +0 -49
- package/dist/fhir/Coding.js +0 -7
- package/dist/fhir/Coding.js.map +0 -1
- package/dist/fhir/Communication.d.ts +0 -251
- package/dist/fhir/Communication.js +0 -7
- package/dist/fhir/Communication.js.map +0 -1
- package/dist/fhir/CommunicationRequest.d.ts +0 -248
- package/dist/fhir/CommunicationRequest.js +0 -7
- package/dist/fhir/CommunicationRequest.js.map +0 -1
- package/dist/fhir/CompartmentDefinition.d.ts +0 -218
- package/dist/fhir/CompartmentDefinition.js +0 -7
- package/dist/fhir/CompartmentDefinition.js.map +0 -1
- package/dist/fhir/Composition.d.ts +0 -455
- package/dist/fhir/Composition.js +0 -7
- package/dist/fhir/Composition.js.map +0 -1
- package/dist/fhir/ConceptMap.d.ts +0 -523
- package/dist/fhir/ConceptMap.js +0 -7
- package/dist/fhir/ConceptMap.js.map +0 -1
- package/dist/fhir/Condition.d.ts +0 -316
- package/dist/fhir/Condition.js +0 -7
- package/dist/fhir/Condition.js.map +0 -1
- package/dist/fhir/Consent.d.ts +0 -457
- package/dist/fhir/Consent.js +0 -7
- package/dist/fhir/Consent.js.map +0 -1
- package/dist/fhir/ContactDetail.d.ts +0 -30
- package/dist/fhir/ContactDetail.js +0 -7
- package/dist/fhir/ContactDetail.js.map +0 -1
- package/dist/fhir/ContactPoint.d.ts +0 -46
- package/dist/fhir/ContactPoint.js +0 -7
- package/dist/fhir/ContactPoint.js.map +0 -1
- package/dist/fhir/Contract.d.ts +0 -1431
- package/dist/fhir/Contract.js +0 -7
- package/dist/fhir/Contract.js.map +0 -1
- package/dist/fhir/Contributor.d.ts +0 -36
- 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 -323
- package/dist/fhir/Coverage.js +0 -7
- package/dist/fhir/Coverage.js.map +0 -1
- package/dist/fhir/CoverageEligibilityRequest.d.ts +0 -409
- package/dist/fhir/CoverageEligibilityRequest.js +0 -7
- package/dist/fhir/CoverageEligibilityRequest.js.map +0 -1
- package/dist/fhir/CoverageEligibilityResponse.d.ts +0 -430
- package/dist/fhir/CoverageEligibilityResponse.js +0 -7
- package/dist/fhir/CoverageEligibilityResponse.js.map +0 -1
- package/dist/fhir/DataRequirement.d.ts +0 -288
- package/dist/fhir/DataRequirement.js +0 -7
- package/dist/fhir/DataRequirement.js.map +0 -1
- package/dist/fhir/DetectedIssue.d.ts +0 -249
- package/dist/fhir/DetectedIssue.js +0 -7
- package/dist/fhir/DetectedIssue.js.map +0 -1
- package/dist/fhir/Device.d.ts +0 -488
- package/dist/fhir/Device.js +0 -7
- package/dist/fhir/Device.js.map +0 -1
- package/dist/fhir/DeviceDefinition.d.ts +0 -484
- package/dist/fhir/DeviceDefinition.js +0 -7
- package/dist/fhir/DeviceDefinition.js.map +0 -1
- package/dist/fhir/DeviceMetric.d.ts +0 -198
- package/dist/fhir/DeviceMetric.js +0 -7
- package/dist/fhir/DeviceMetric.js.map +0 -1
- package/dist/fhir/DeviceRequest.d.ts +0 -279
- package/dist/fhir/DeviceRequest.js +0 -7
- package/dist/fhir/DeviceRequest.js.map +0 -1
- package/dist/fhir/DeviceUseStatement.d.ts +0 -153
- package/dist/fhir/DeviceUseStatement.js +0 -7
- package/dist/fhir/DeviceUseStatement.js.map +0 -1
- package/dist/fhir/DiagnosticReport.d.ts +0 -239
- package/dist/fhir/DiagnosticReport.js +0 -7
- package/dist/fhir/DiagnosticReport.js.map +0 -1
- package/dist/fhir/Distance.d.ts +0 -46
- package/dist/fhir/Distance.js +0 -7
- package/dist/fhir/Distance.js.map +0 -1
- package/dist/fhir/DocumentManifest.d.ts +0 -190
- package/dist/fhir/DocumentManifest.js +0 -7
- package/dist/fhir/DocumentManifest.js.map +0 -1
- package/dist/fhir/DocumentReference.d.ts +0 -353
- package/dist/fhir/DocumentReference.js +0 -7
- package/dist/fhir/DocumentReference.js.map +0 -1
- package/dist/fhir/Dosage.d.ts +0 -171
- 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 -600
- package/dist/fhir/EffectEvidenceSynthesis.js +0 -7
- package/dist/fhir/EffectEvidenceSynthesis.js.map +0 -1
- package/dist/fhir/Element.d.ts +0 -20
- package/dist/fhir/Element.js +0 -7
- package/dist/fhir/Element.js.map +0 -1
- package/dist/fhir/ElementDefinition.d.ts +0 -2828
- package/dist/fhir/ElementDefinition.js +0 -7
- package/dist/fhir/ElementDefinition.js.map +0 -1
- package/dist/fhir/Encounter.d.ts +0 -546
- package/dist/fhir/Encounter.js +0 -7
- package/dist/fhir/Encounter.js.map +0 -1
- package/dist/fhir/Endpoint.d.ts +0 -139
- package/dist/fhir/Endpoint.js +0 -7
- package/dist/fhir/Endpoint.js.map +0 -1
- package/dist/fhir/EnrollmentRequest.d.ts +0 -108
- package/dist/fhir/EnrollmentRequest.js +0 -7
- package/dist/fhir/EnrollmentRequest.js.map +0 -1
- package/dist/fhir/EnrollmentResponse.d.ts +0 -113
- package/dist/fhir/EnrollmentResponse.js +0 -7
- package/dist/fhir/EnrollmentResponse.js.map +0 -1
- package/dist/fhir/EpisodeOfCare.d.ts +0 -243
- package/dist/fhir/EpisodeOfCare.js +0 -7
- package/dist/fhir/EpisodeOfCare.js.map +0 -1
- package/dist/fhir/EventDefinition.d.ts +0 -252
- package/dist/fhir/EventDefinition.js +0 -7
- package/dist/fhir/EventDefinition.js.map +0 -1
- package/dist/fhir/Evidence.d.ts +0 -251
- package/dist/fhir/Evidence.js +0 -7
- package/dist/fhir/Evidence.js.map +0 -1
- package/dist/fhir/EvidenceVariable.d.ts +0 -369
- package/dist/fhir/EvidenceVariable.js +0 -7
- package/dist/fhir/EvidenceVariable.js.map +0 -1
- package/dist/fhir/ExampleScenario.d.ts +0 -626
- package/dist/fhir/ExampleScenario.js +0 -7
- package/dist/fhir/ExampleScenario.js.map +0 -1
- package/dist/fhir/ExplanationOfBenefit.d.ts +0 -1854
- 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 -305
- package/dist/fhir/Extension.js +0 -7
- package/dist/fhir/Extension.js.map +0 -1
- package/dist/fhir/FamilyMemberHistory.d.ts +0 -297
- package/dist/fhir/FamilyMemberHistory.js +0 -7
- package/dist/fhir/FamilyMemberHistory.js.map +0 -1
- package/dist/fhir/Flag.d.ts +0 -121
- package/dist/fhir/Flag.js +0 -7
- package/dist/fhir/Flag.js.map +0 -1
- package/dist/fhir/Goal.d.ts +0 -290
- package/dist/fhir/Goal.js +0 -7
- package/dist/fhir/Goal.js.map +0 -1
- package/dist/fhir/GraphDefinition.d.ts +0 -359
- package/dist/fhir/GraphDefinition.js +0 -7
- package/dist/fhir/GraphDefinition.js.map +0 -1
- package/dist/fhir/Group.d.ts +0 -268
- package/dist/fhir/Group.js +0 -7
- package/dist/fhir/Group.js.map +0 -1
- package/dist/fhir/GuidanceResponse.d.ts +0 -184
- package/dist/fhir/GuidanceResponse.js +0 -7
- package/dist/fhir/GuidanceResponse.js.map +0 -1
- package/dist/fhir/HealthcareService.d.ts +0 -351
- package/dist/fhir/HealthcareService.js +0 -7
- package/dist/fhir/HealthcareService.js.map +0 -1
- package/dist/fhir/HumanName.d.ts +0 -57
- package/dist/fhir/HumanName.js +0 -7
- package/dist/fhir/HumanName.js.map +0 -1
- package/dist/fhir/Identifier.d.ts +0 -51
- package/dist/fhir/Identifier.js +0 -7
- package/dist/fhir/Identifier.js.map +0 -1
- package/dist/fhir/ImagingStudy.d.ts +0 -398
- package/dist/fhir/ImagingStudy.js +0 -7
- package/dist/fhir/ImagingStudy.js.map +0 -1
- package/dist/fhir/Immunization.d.ts +0 -440
- package/dist/fhir/Immunization.js +0 -7
- package/dist/fhir/Immunization.js.map +0 -1
- package/dist/fhir/ImmunizationEvaluation.d.ts +0 -146
- package/dist/fhir/ImmunizationEvaluation.js +0 -7
- package/dist/fhir/ImmunizationEvaluation.js.map +0 -1
- package/dist/fhir/ImmunizationRecommendation.d.ts +0 -253
- package/dist/fhir/ImmunizationRecommendation.js +0 -7
- package/dist/fhir/ImmunizationRecommendation.js.map +0 -1
- package/dist/fhir/ImplementationGuide.d.ts +0 -854
- package/dist/fhir/ImplementationGuide.js +0 -7
- package/dist/fhir/ImplementationGuide.js.map +0 -1
- package/dist/fhir/InsurancePlan.d.ts +0 -630
- package/dist/fhir/InsurancePlan.js +0 -7
- package/dist/fhir/InsurancePlan.js.map +0 -1
- package/dist/fhir/Invoice.d.ts +0 -331
- 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 -276
- package/dist/fhir/Library.js +0 -7
- package/dist/fhir/Library.js.map +0 -1
- package/dist/fhir/Linkage.d.ts +0 -142
- package/dist/fhir/Linkage.js +0 -7
- package/dist/fhir/Linkage.js.map +0 -1
- package/dist/fhir/List.d.ts +0 -193
- package/dist/fhir/List.js +0 -7
- package/dist/fhir/List.js.map +0 -1
- package/dist/fhir/Location.d.ts +0 -278
- package/dist/fhir/Location.js +0 -7
- package/dist/fhir/Location.js.map +0 -1
- package/dist/fhir/Login.d.ts +0 -108
- 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 -613
- package/dist/fhir/Measure.js +0 -7
- package/dist/fhir/Measure.js.map +0 -1
- package/dist/fhir/MeasureReport.d.ts +0 -460
- package/dist/fhir/MeasureReport.js +0 -7
- package/dist/fhir/MeasureReport.js.map +0 -1
- package/dist/fhir/Media.d.ts +0 -191
- package/dist/fhir/Media.js +0 -7
- package/dist/fhir/Media.js.map +0 -1
- package/dist/fhir/Medication.d.ts +0 -234
- package/dist/fhir/Medication.js +0 -7
- package/dist/fhir/Medication.js.map +0 -1
- package/dist/fhir/MedicationAdministration.d.ts +0 -343
- package/dist/fhir/MedicationAdministration.js +0 -7
- package/dist/fhir/MedicationAdministration.js.map +0 -1
- package/dist/fhir/MedicationDispense.d.ts +0 -332
- package/dist/fhir/MedicationDispense.js +0 -7
- package/dist/fhir/MedicationDispense.js.map +0 -1
- package/dist/fhir/MedicationKnowledge.d.ts +0 -979
- package/dist/fhir/MedicationKnowledge.js +0 -7
- package/dist/fhir/MedicationKnowledge.js.map +0 -1
- package/dist/fhir/MedicationRequest.d.ts +0 -468
- package/dist/fhir/MedicationRequest.js +0 -7
- package/dist/fhir/MedicationRequest.js.map +0 -1
- package/dist/fhir/MedicationStatement.d.ts +0 -210
- package/dist/fhir/MedicationStatement.js +0 -7
- package/dist/fhir/MedicationStatement.js.map +0 -1
- package/dist/fhir/MedicinalProduct.d.ts +0 -449
- package/dist/fhir/MedicinalProduct.js +0 -7
- package/dist/fhir/MedicinalProduct.js.map +0 -1
- package/dist/fhir/MedicinalProductAuthorization.d.ts +0 -267
- package/dist/fhir/MedicinalProductAuthorization.js +0 -7
- package/dist/fhir/MedicinalProductAuthorization.js.map +0 -1
- package/dist/fhir/MedicinalProductContraindication.d.ts +0 -165
- package/dist/fhir/MedicinalProductContraindication.js +0 -7
- package/dist/fhir/MedicinalProductContraindication.js.map +0 -1
- package/dist/fhir/MedicinalProductIndication.d.ts +0 -173
- package/dist/fhir/MedicinalProductIndication.js +0 -7
- package/dist/fhir/MedicinalProductIndication.js.map +0 -1
- package/dist/fhir/MedicinalProductIngredient.d.ts +0 -334
- package/dist/fhir/MedicinalProductIngredient.js +0 -7
- package/dist/fhir/MedicinalProductIngredient.js.map +0 -1
- package/dist/fhir/MedicinalProductInteraction.d.ts +0 -155
- package/dist/fhir/MedicinalProductInteraction.js +0 -7
- package/dist/fhir/MedicinalProductInteraction.js.map +0 -1
- package/dist/fhir/MedicinalProductManufactured.d.ts +0 -111
- package/dist/fhir/MedicinalProductManufactured.js +0 -7
- package/dist/fhir/MedicinalProductManufactured.js.map +0 -1
- package/dist/fhir/MedicinalProductPackaged.d.ts +0 -253
- 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 -99
- package/dist/fhir/MedicinalProductUndesirableEffect.js +0 -7
- package/dist/fhir/MedicinalProductUndesirableEffect.js.map +0 -1
- package/dist/fhir/MessageDefinition.d.ts +0 -331
- package/dist/fhir/MessageDefinition.js +0 -7
- package/dist/fhir/MessageDefinition.js.map +0 -1
- package/dist/fhir/MessageHeader.d.ts +0 -329
- package/dist/fhir/MessageHeader.js +0 -7
- package/dist/fhir/MessageHeader.js.map +0 -1
- package/dist/fhir/Meta.d.ts +0 -68
- package/dist/fhir/Meta.js +0 -7
- package/dist/fhir/Meta.js.map +0 -1
- package/dist/fhir/MolecularSequence.d.ts +0 -746
- package/dist/fhir/MolecularSequence.js +0 -7
- package/dist/fhir/MolecularSequence.js.map +0 -1
- package/dist/fhir/Money.d.ts +0 -28
- package/dist/fhir/Money.js +0 -7
- package/dist/fhir/Money.js.map +0 -1
- package/dist/fhir/NamingSystem.d.ts +0 -219
- package/dist/fhir/NamingSystem.js +0 -7
- package/dist/fhir/NamingSystem.js.map +0 -1
- package/dist/fhir/Narrative.d.ts +0 -31
- package/dist/fhir/Narrative.js +0 -7
- package/dist/fhir/Narrative.js.map +0 -1
- package/dist/fhir/NutritionOrder.d.ts +0 -558
- package/dist/fhir/NutritionOrder.js +0 -7
- package/dist/fhir/NutritionOrder.js.map +0 -1
- package/dist/fhir/Observation.d.ts +0 -487
- package/dist/fhir/Observation.js +0 -7
- package/dist/fhir/Observation.js.map +0 -1
- package/dist/fhir/ObservationDefinition.d.ts +0 -277
- 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 -168
- package/dist/fhir/OperationOutcome.js +0 -7
- package/dist/fhir/OperationOutcome.js.map +0 -1
- package/dist/fhir/Organization.d.ts +0 -187
- package/dist/fhir/Organization.js +0 -7
- package/dist/fhir/Organization.js.map +0 -1
- package/dist/fhir/OrganizationAffiliation.d.ts +0 -141
- package/dist/fhir/OrganizationAffiliation.js +0 -7
- package/dist/fhir/OrganizationAffiliation.js.map +0 -1
- package/dist/fhir/ParameterDefinition.d.ts +0 -56
- package/dist/fhir/ParameterDefinition.js +0 -7
- package/dist/fhir/ParameterDefinition.js.map +0 -1
- package/dist/fhir/Parameters.d.ts +0 -321
- package/dist/fhir/Parameters.js +0 -7
- package/dist/fhir/Parameters.js.map +0 -1
- package/dist/fhir/PasswordChangeRequest.d.ts +0 -50
- package/dist/fhir/PasswordChangeRequest.js +0 -7
- package/dist/fhir/PasswordChangeRequest.js.map +0 -1
- package/dist/fhir/Patient.d.ts +0 -339
- package/dist/fhir/Patient.js +0 -7
- package/dist/fhir/Patient.js.map +0 -1
- package/dist/fhir/PaymentNotice.d.ts +0 -131
- package/dist/fhir/PaymentNotice.js +0 -7
- package/dist/fhir/PaymentNotice.js.map +0 -1
- package/dist/fhir/PaymentReconciliation.d.ts +0 -276
- package/dist/fhir/PaymentReconciliation.js +0 -7
- package/dist/fhir/PaymentReconciliation.js.map +0 -1
- package/dist/fhir/Period.d.ts +0 -31
- package/dist/fhir/Period.js +0 -7
- package/dist/fhir/Period.js.map +0 -1
- package/dist/fhir/Person.d.ts +0 -172
- package/dist/fhir/Person.js +0 -7
- package/dist/fhir/Person.js.map +0 -1
- package/dist/fhir/PlanDefinition.d.ts +0 -855
- package/dist/fhir/PlanDefinition.js +0 -7
- package/dist/fhir/PlanDefinition.js.map +0 -1
- package/dist/fhir/Population.d.ts +0 -61
- package/dist/fhir/Population.js +0 -7
- package/dist/fhir/Population.js.map +0 -1
- package/dist/fhir/Practitioner.d.ts +0 -188
- package/dist/fhir/Practitioner.js +0 -7
- package/dist/fhir/Practitioner.js.map +0 -1
- package/dist/fhir/PractitionerRole.d.ts +0 -254
- package/dist/fhir/PractitionerRole.js +0 -7
- package/dist/fhir/PractitionerRole.js.map +0 -1
- package/dist/fhir/Procedure.d.ts +0 -355
- 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 -69
- package/dist/fhir/ProductShelfLife.js +0 -7
- package/dist/fhir/ProductShelfLife.js.map +0 -1
- package/dist/fhir/Project.d.ts +0 -46
- package/dist/fhir/Project.js +0 -7
- package/dist/fhir/Project.js.map +0 -1
- package/dist/fhir/ProjectMembership.d.ts +0 -54
- package/dist/fhir/ProjectMembership.js +0 -7
- package/dist/fhir/ProjectMembership.js.map +0 -1
- package/dist/fhir/Provenance.d.ts +0 -270
- package/dist/fhir/Provenance.js +0 -7
- package/dist/fhir/Provenance.js.map +0 -1
- package/dist/fhir/Quantity.d.ts +0 -49
- package/dist/fhir/Quantity.js +0 -7
- package/dist/fhir/Quantity.js.map +0 -1
- package/dist/fhir/Questionnaire.d.ts +0 -610
- package/dist/fhir/Questionnaire.js +0 -7
- package/dist/fhir/Questionnaire.js.map +0 -1
- package/dist/fhir/QuestionnaireResponse.d.ts +0 -305
- package/dist/fhir/QuestionnaireResponse.js +0 -7
- package/dist/fhir/QuestionnaireResponse.js.map +0 -1
- package/dist/fhir/Range.d.ts +0 -29
- 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 -66
- 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 -56
- 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 -427
- package/dist/fhir/RequestGroup.js +0 -7
- package/dist/fhir/RequestGroup.js.map +0 -1
- package/dist/fhir/ResearchDefinition.d.ts +0 -289
- package/dist/fhir/ResearchDefinition.js +0 -7
- package/dist/fhir/ResearchDefinition.js.map +0 -1
- package/dist/fhir/ResearchElementDefinition.d.ts +0 -430
- package/dist/fhir/ResearchElementDefinition.js +0 -7
- package/dist/fhir/ResearchElementDefinition.js.map +0 -1
- package/dist/fhir/ResearchStudy.d.ts +0 -320
- package/dist/fhir/ResearchStudy.js +0 -7
- package/dist/fhir/ResearchStudy.js.map +0 -1
- package/dist/fhir/ResearchSubject.d.ts +0 -116
- package/dist/fhir/ResearchSubject.js +0 -7
- package/dist/fhir/ResearchSubject.js.map +0 -1
- package/dist/fhir/Resource.d.ts +0 -154
- package/dist/fhir/Resource.js +0 -7
- package/dist/fhir/Resource.js.map +0 -1
- package/dist/fhir/RiskAssessment.d.ts +0 -237
- package/dist/fhir/RiskAssessment.js +0 -7
- package/dist/fhir/RiskAssessment.js.map +0 -1
- package/dist/fhir/RiskEvidenceSynthesis.d.ts +0 -539
- package/dist/fhir/RiskEvidenceSynthesis.js +0 -7
- package/dist/fhir/RiskEvidenceSynthesis.js.map +0 -1
- package/dist/fhir/SampledData.d.ts +0 -61
- package/dist/fhir/SampledData.js +0 -7
- package/dist/fhir/SampledData.js.map +0 -1
- package/dist/fhir/Schedule.d.ts +0 -122
- package/dist/fhir/Schedule.js +0 -7
- package/dist/fhir/Schedule.js.map +0 -1
- package/dist/fhir/SearchParameter.d.ts +0 -278
- package/dist/fhir/SearchParameter.js +0 -7
- package/dist/fhir/SearchParameter.js.map +0 -1
- package/dist/fhir/ServiceRequest.d.ts +0 -288
- package/dist/fhir/ServiceRequest.js +0 -7
- package/dist/fhir/ServiceRequest.js.map +0 -1
- package/dist/fhir/Signature.d.ts +0 -65
- package/dist/fhir/Signature.js +0 -7
- package/dist/fhir/Signature.js.map +0 -1
- package/dist/fhir/Slot.d.ts +0 -133
- package/dist/fhir/Slot.js +0 -7
- package/dist/fhir/Slot.js.map +0 -1
- package/dist/fhir/Specimen.d.ts +0 -357
- package/dist/fhir/Specimen.js +0 -7
- package/dist/fhir/Specimen.js.map +0 -1
- package/dist/fhir/SpecimenDefinition.d.ts +0 -359
- package/dist/fhir/SpecimenDefinition.js +0 -7
- package/dist/fhir/SpecimenDefinition.js.map +0 -1
- package/dist/fhir/StructureDefinition.d.ts +0 -443
- package/dist/fhir/StructureDefinition.js +0 -7
- package/dist/fhir/StructureDefinition.js.map +0 -1
- package/dist/fhir/StructureMap.d.ts +0 -908
- package/dist/fhir/StructureMap.js +0 -7
- package/dist/fhir/StructureMap.js.map +0 -1
- package/dist/fhir/Subscription.d.ts +0 -176
- package/dist/fhir/Subscription.js +0 -7
- package/dist/fhir/Subscription.js.map +0 -1
- package/dist/fhir/Substance.d.ts +0 -212
- package/dist/fhir/Substance.js +0 -7
- package/dist/fhir/Substance.js.map +0 -1
- package/dist/fhir/SubstanceAmount.d.ts +0 -138
- package/dist/fhir/SubstanceAmount.js +0 -7
- package/dist/fhir/SubstanceAmount.js.map +0 -1
- package/dist/fhir/SubstanceNucleicAcid.d.ts +0 -316
- 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 -217
- package/dist/fhir/SubstanceProtein.js +0 -7
- package/dist/fhir/SubstanceProtein.js.map +0 -1
- package/dist/fhir/SubstanceReferenceInformation.d.ts +0 -329
- package/dist/fhir/SubstanceReferenceInformation.js +0 -7
- package/dist/fhir/SubstanceReferenceInformation.js.map +0 -1
- package/dist/fhir/SubstanceSourceMaterial.d.ts +0 -594
- package/dist/fhir/SubstanceSourceMaterial.js +0 -7
- package/dist/fhir/SubstanceSourceMaterial.js.map +0 -1
- package/dist/fhir/SubstanceSpecification.d.ts +0 -826
- package/dist/fhir/SubstanceSpecification.js +0 -7
- package/dist/fhir/SubstanceSpecification.js.map +0 -1
- package/dist/fhir/SupplyDelivery.d.ts +0 -195
- package/dist/fhir/SupplyDelivery.js +0 -7
- package/dist/fhir/SupplyDelivery.js.map +0 -1
- package/dist/fhir/SupplyRequest.d.ts +0 -223
- package/dist/fhir/SupplyRequest.js +0 -7
- package/dist/fhir/SupplyRequest.js.map +0 -1
- package/dist/fhir/Task.d.ts +0 -789
- package/dist/fhir/Task.js +0 -7
- package/dist/fhir/Task.js.map +0 -1
- package/dist/fhir/TerminologyCapabilities.d.ts +0 -734
- package/dist/fhir/TerminologyCapabilities.js +0 -7
- package/dist/fhir/TerminologyCapabilities.js.map +0 -1
- package/dist/fhir/TestReport.d.ts +0 -554
- package/dist/fhir/TestReport.js +0 -7
- package/dist/fhir/TestReport.js.map +0 -1
- package/dist/fhir/TestScript.d.ts +0 -1192
- package/dist/fhir/TestScript.js +0 -7
- package/dist/fhir/TestScript.js.map +0 -1
- package/dist/fhir/Timing.d.ts +0 -201
- package/dist/fhir/Timing.js +0 -7
- package/dist/fhir/Timing.js.map +0 -1
- package/dist/fhir/TriggerDefinition.d.ts +0 -63
- package/dist/fhir/TriggerDefinition.js +0 -7
- package/dist/fhir/TriggerDefinition.js.map +0 -1
- package/dist/fhir/UsageContext.d.ts +0 -54
- package/dist/fhir/UsageContext.js +0 -7
- package/dist/fhir/UsageContext.js.map +0 -1
- package/dist/fhir/User.d.ts +0 -44
- package/dist/fhir/User.js +0 -7
- package/dist/fhir/User.js.map +0 -1
- package/dist/fhir/ValueSet.d.ts +0 -736
- 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 -261
- package/dist/fhir/VisionPrescription.js +0 -7
- package/dist/fhir/VisionPrescription.js.map +0 -1
- package/dist/fhir/index.d.ts +0 -194
- package/dist/fhir/index.js +0 -211
- 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/functions.test.d.ts +0 -1
- package/dist/fhirpath/functions.test.js +0 -162
- package/dist/fhirpath/functions.test.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 -285
- package/dist/fhirpath/parse.js.map +0 -1
- package/dist/fhirpath/parse.test.d.ts +0 -1
- package/dist/fhirpath/parse.test.js +0 -239
- package/dist/fhirpath/parse.test.js.map +0 -1
- package/dist/fhirpath/tokenize.d.ts +0 -13
- package/dist/fhirpath/tokenize.js +0 -43
- package/dist/fhirpath/tokenize.js.map +0 -1
- package/dist/fhirpath/tokenize.test.d.ts +0 -1
- package/dist/fhirpath/tokenize.test.js +0 -69
- package/dist/fhirpath/tokenize.test.js.map +0 -1
- package/dist/fhirpath/utils.d.ts +0 -13
- package/dist/fhirpath/utils.js +0 -34
- package/dist/fhirpath/utils.js.map +0 -1
- package/dist/fhirpath/utils.test.d.ts +0 -1
- package/dist/fhirpath/utils.test.js +0 -22
- package/dist/fhirpath/utils.test.js.map +0 -1
- package/dist/format.test.d.ts +0 -1
- package/dist/format.test.js +0 -127
- package/dist/format.test.js.map +0 -1
- package/dist/index.test.d.ts +0 -1
- package/dist/index.test.js +0 -11
- package/dist/index.test.js.map +0 -1
- package/dist/outcomes.test.d.ts +0 -1
- package/dist/outcomes.test.js +0 -30
- package/dist/outcomes.test.js.map +0 -1
- package/dist/search.test.d.ts +0 -1
- package/dist/search.test.js +0 -70
- package/dist/search.test.js.map +0 -1
- package/dist/storage.test.d.ts +0 -1
- package/dist/storage.test.js +0 -19
- package/dist/storage.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/utils.test.d.ts +0 -1
- package/dist/utils.test.js +0 -90
- package/dist/utils.test.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Medplum
|
|
2
2
|
|
|
3
|
-
Medplum is a healthcare platform that helps you quickly develop high-quality compliant applications.
|
|
3
|
+
Medplum is a healthcare platform that helps you quickly develop high-quality compliant applications. Medplum includes a FHIR server, React component library, and developer app.
|
|
4
4
|
|
|
5
5
|
# Medplum JS Client Library
|
|
6
6
|
|
|
@@ -8,11 +8,11 @@ The Medplum JS Client Library is a pure TypeScript library for calling a FHIR se
|
|
|
8
8
|
|
|
9
9
|
## Key Features
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
- FHIR validation and operations
|
|
12
|
+
- FHIR client to create, read, update, delete, patch, and search
|
|
13
|
+
- WebSockets for realtime communication
|
|
14
|
+
- Evaluation of [FhirPath](https://hl7.org/fhirpath/N1/index.html)
|
|
15
|
+
- No external dependencies
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
@@ -26,8 +26,8 @@ npm install medplum
|
|
|
26
26
|
import { MedplumClient } from '@medplum/core';
|
|
27
27
|
|
|
28
28
|
const medplum = new MedplumClient({
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
baseUrl: 'https://www.example.com/fhir/R4/',
|
|
30
|
+
clientId: 'MY_CLIENT_ID',
|
|
31
31
|
});
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -36,7 +36,7 @@ const medplum = new MedplumClient({
|
|
|
36
36
|
Authenticate with a FHIR server via OAuth2 redirect:
|
|
37
37
|
|
|
38
38
|
```typescript
|
|
39
|
-
medplum.signInWithRedirect().then(user => console.log(user));
|
|
39
|
+
medplum.signInWithRedirect().then((user) => console.log(user));
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
## Authenticating with Medplum
|
|
@@ -51,7 +51,7 @@ Before you begin
|
|
|
51
51
|
After that, you can use the `signIn()` method:
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
|
-
medplum.signIn(email, password, role, scope).then(user => console.log(user));
|
|
54
|
+
medplum.signIn(email, password, role, scope).then((user) => console.log(user));
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
## Search
|
|
@@ -59,24 +59,28 @@ medplum.signIn(email, password, role, scope).then(user => console.log(user));
|
|
|
59
59
|
Search for any resource using a [FHIR search](https://www.hl7.org/fhir/search.html) string:
|
|
60
60
|
|
|
61
61
|
```typescript
|
|
62
|
-
medplum.search('Patient?given=eve').then(bundle => {
|
|
63
|
-
bundle.entry.forEach(entry => console.log(entry.resource));
|
|
62
|
+
medplum.search('Patient?given=eve').then((bundle) => {
|
|
63
|
+
bundle.entry.forEach((entry) => console.log(entry.resource));
|
|
64
64
|
});
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Search using a structured object:
|
|
68
68
|
|
|
69
69
|
```typescript
|
|
70
|
-
medplum
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
medplum
|
|
71
|
+
.search({
|
|
72
|
+
resourceType: 'Patient',
|
|
73
|
+
filters: [
|
|
74
|
+
{
|
|
75
|
+
code: 'given',
|
|
76
|
+
operator: Operator.EQUALS,
|
|
77
|
+
value: 'eve',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
})
|
|
81
|
+
.then((bundle) => {
|
|
82
|
+
bundle.entry.forEach((entry) => console.log(entry.resource));
|
|
83
|
+
});
|
|
80
84
|
```
|
|
81
85
|
|
|
82
86
|
## Create
|
|
@@ -87,11 +91,11 @@ Create a new resource:
|
|
|
87
91
|
medplum.create({
|
|
88
92
|
resourceType: 'Observation',
|
|
89
93
|
subject: {
|
|
90
|
-
reference: 'Patient/123'
|
|
94
|
+
reference: 'Patient/123',
|
|
91
95
|
},
|
|
92
96
|
valueQuantity: {
|
|
93
97
|
// ...
|
|
94
|
-
}
|
|
98
|
+
},
|
|
95
99
|
// ...
|
|
96
100
|
});
|
|
97
101
|
```
|
|
@@ -118,4 +122,4 @@ medplum.readVersion('Patient', '123', '456');
|
|
|
118
122
|
|
|
119
123
|
## License
|
|
120
124
|
|
|
121
|
-
Apache 2.0.
|
|
125
|
+
Apache 2.0. Copyright © Medplum 2021
|
package/dist/cache.d.ts
CHANGED
package/dist/cache.js
CHANGED
|
@@ -6,12 +6,13 @@ exports.LRUCache = void 0;
|
|
|
6
6
|
* Source: https://stackoverflow.com/a/46432113
|
|
7
7
|
*/
|
|
8
8
|
class LRUCache {
|
|
9
|
-
max;
|
|
10
|
-
cache;
|
|
11
9
|
constructor(max = 10) {
|
|
12
10
|
this.max = max;
|
|
13
11
|
this.cache = new Map();
|
|
14
12
|
}
|
|
13
|
+
clear() {
|
|
14
|
+
this.cache.clear();
|
|
15
|
+
}
|
|
15
16
|
get(key) {
|
|
16
17
|
const item = this.cache.get(key);
|
|
17
18
|
if (item) {
|
package/dist/cache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,QAAQ;IAInB,YAAY,GAAG,GAAG,EAAE;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;IACzB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,GAAG,CAAC,GAAW;QACb,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SAC3B;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,GAAM;QACrB,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACxB;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE;YACtC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;SACjC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;IAEO,KAAK;QACX,2DAA2D;QAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;IACxC,CAAC;CACF;AAnCD,4BAmCC","sourcesContent":["/**\n * LRU cache (least recently used)\n * Source: https://stackoverflow.com/a/46432113\n */\nexport class LRUCache<T> {\n private readonly max: number;\n private readonly cache: Map<string, T>;\n\n constructor(max = 10) {\n this.max = max;\n this.cache = new Map();\n }\n\n clear() {\n this.cache.clear();\n }\n\n get(key: string): T | undefined {\n const item = this.cache.get(key);\n if (item) {\n this.cache.delete(key);\n this.cache.set(key, item);\n }\n return item;\n }\n\n set(key: string, val: T) {\n if (this.cache.has(key)) {\n this.cache.delete(key);\n } else if (this.cache.size >= this.max) {\n this.cache.delete(this.first());\n }\n this.cache.set(key, val);\n }\n\n private first() {\n // This works because the Map class maintains ordered keys.\n return this.cache.keys().next().value;\n }\n}\n"]}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
+
import { Binary, Bundle, Project, ProjectMembership, Reference, Resource, ValueSet } from '@medplum/fhirtypes';
|
|
1
2
|
import { EventTarget } from './eventtarget';
|
|
2
|
-
import { Binary, Bundle, Reference, Resource, ValueSet } from './fhir';
|
|
3
3
|
import { SearchRequest } from './search';
|
|
4
4
|
import { IndexedStructureDefinition } from './types';
|
|
5
5
|
import { ProfileResource } from './utils';
|
|
6
6
|
export interface MedplumClientOptions {
|
|
7
7
|
/**
|
|
8
8
|
* The client ID.
|
|
9
|
-
*
|
|
9
|
+
* Optional. Default is to defer to the server to use the default client.
|
|
10
|
+
* Use this to use a specific client for SMART-on-FHIR.
|
|
10
11
|
*/
|
|
11
|
-
clientId
|
|
12
|
+
clientId?: string;
|
|
12
13
|
/**
|
|
13
14
|
* Base server URL.
|
|
14
15
|
* Optional. Default value is "https://api.medplum.com/".
|
|
15
16
|
* Use this to point to a custom Medplum deployment.
|
|
16
17
|
*/
|
|
17
|
-
baseUrl
|
|
18
|
+
baseUrl?: string;
|
|
18
19
|
/**
|
|
19
20
|
* OAuth2 authorize URL.
|
|
20
21
|
* Optional. Default value is baseUrl + "/oauth2/authorize".
|
|
@@ -39,12 +40,6 @@ export interface MedplumClientOptions {
|
|
|
39
40
|
* Consider using this for performance of displaying Patient or Practitioner resources.
|
|
40
41
|
*/
|
|
41
42
|
resourceCacheSize?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Number of blob URLs to store in the cache.
|
|
44
|
-
* Optional. Default value is 100.
|
|
45
|
-
* Consider using this for performance of displaying Patient or Practitioner resources.
|
|
46
|
-
*/
|
|
47
|
-
blobCacheSize?: number;
|
|
48
43
|
/**
|
|
49
44
|
* Optional fetch implementation.
|
|
50
45
|
* Optional. Default is window.fetch.
|
|
@@ -62,69 +57,91 @@ export interface FetchLike {
|
|
|
62
57
|
(url: string, options?: any): Promise<any>;
|
|
63
58
|
}
|
|
64
59
|
export interface RegisterRequest {
|
|
65
|
-
firstName: string;
|
|
66
|
-
lastName: string;
|
|
67
|
-
projectName: string;
|
|
68
|
-
email: string;
|
|
69
|
-
password: string;
|
|
70
|
-
remember?: boolean;
|
|
60
|
+
readonly firstName: string;
|
|
61
|
+
readonly lastName: string;
|
|
62
|
+
readonly projectName: string;
|
|
63
|
+
readonly email: string;
|
|
64
|
+
readonly password: string;
|
|
65
|
+
readonly remember?: boolean;
|
|
71
66
|
}
|
|
72
67
|
export interface GoogleCredentialResponse {
|
|
73
68
|
readonly clientId: string;
|
|
74
69
|
readonly credential: string;
|
|
75
70
|
}
|
|
71
|
+
export interface LoginAuthenticationResponse {
|
|
72
|
+
readonly login: string;
|
|
73
|
+
readonly code?: string;
|
|
74
|
+
readonly memberships?: ProjectMembership[];
|
|
75
|
+
}
|
|
76
|
+
export interface LoginProfileResponse {
|
|
77
|
+
readonly login: string;
|
|
78
|
+
readonly scope: string;
|
|
79
|
+
}
|
|
80
|
+
export interface LoginScopeResponse {
|
|
81
|
+
readonly login: string;
|
|
82
|
+
readonly code: string;
|
|
83
|
+
}
|
|
84
|
+
export interface LoginState {
|
|
85
|
+
readonly project: Reference<Project>;
|
|
86
|
+
readonly profile: Reference<ProfileResource>;
|
|
87
|
+
readonly accessToken: string;
|
|
88
|
+
readonly refreshToken: string;
|
|
89
|
+
}
|
|
90
|
+
export interface TokenResponse {
|
|
91
|
+
readonly token_type: string;
|
|
92
|
+
readonly id_token: string;
|
|
93
|
+
readonly access_token: string;
|
|
94
|
+
readonly refresh_token: string;
|
|
95
|
+
readonly expires_in: number;
|
|
96
|
+
readonly project: Reference<Project>;
|
|
97
|
+
readonly profile: Reference<ProfileResource>;
|
|
98
|
+
}
|
|
76
99
|
export declare class MedplumClient extends EventTarget {
|
|
77
100
|
private readonly fetch;
|
|
78
101
|
private readonly storage;
|
|
79
102
|
private readonly schema;
|
|
80
103
|
private readonly resourceCache;
|
|
81
|
-
private readonly blobUrlCache;
|
|
82
104
|
private readonly baseUrl;
|
|
83
105
|
private readonly clientId;
|
|
84
106
|
private readonly authorizeUrl;
|
|
85
107
|
private readonly tokenUrl;
|
|
86
108
|
private readonly logoutUrl;
|
|
87
109
|
private readonly onUnauthenticated?;
|
|
110
|
+
private refreshPromise?;
|
|
111
|
+
private activeLogin?;
|
|
88
112
|
private profile?;
|
|
113
|
+
private loading;
|
|
89
114
|
constructor(options: MedplumClientOptions);
|
|
90
115
|
/**
|
|
91
116
|
* Clears all auth state including local storage and session storage.
|
|
92
117
|
*/
|
|
93
118
|
clear(): void;
|
|
94
|
-
get(url: string
|
|
119
|
+
get(url: string): Promise<any>;
|
|
95
120
|
post(url: string, body: any, contentType?: string): Promise<any>;
|
|
96
121
|
put(url: string, body: any, contentType?: string): Promise<any>;
|
|
122
|
+
delete(url: string): Promise<any>;
|
|
97
123
|
/**
|
|
98
124
|
* Tries to register a new user.
|
|
99
125
|
* @param request The registration request.
|
|
100
|
-
* @returns Promise to the
|
|
126
|
+
* @returns Promise to the authentication response.
|
|
101
127
|
*/
|
|
102
|
-
register(request: RegisterRequest): Promise<
|
|
128
|
+
register(request: RegisterRequest): Promise<void>;
|
|
103
129
|
/**
|
|
104
|
-
*
|
|
105
|
-
* @param email The
|
|
106
|
-
* @param password The user
|
|
107
|
-
* @param
|
|
108
|
-
* @
|
|
109
|
-
* @param remember Optional flag to "remember" to generate a refresh token and persist in local storage.
|
|
110
|
-
* @returns Promise to the user profile resource.
|
|
130
|
+
* Initiates a user login flow.
|
|
131
|
+
* @param email The email address of the user.
|
|
132
|
+
* @param password The password of the user.
|
|
133
|
+
* @param remember Optional flag to remember the user.
|
|
134
|
+
* @returns Promise to the authentication response.
|
|
111
135
|
*/
|
|
112
|
-
|
|
136
|
+
startLogin(email: string, password: string, remember?: boolean): Promise<LoginAuthenticationResponse>;
|
|
113
137
|
/**
|
|
114
138
|
* Tries to sign in with Google authentication.
|
|
115
139
|
* The response parameter is the result of a Google authentication.
|
|
116
140
|
* See: https://developers.google.com/identity/gsi/web/guides/handle-credential-responses-js-functions
|
|
117
141
|
* @param googleResponse The Google credential response.
|
|
118
|
-
* @returns Promise to the
|
|
119
|
-
*/
|
|
120
|
-
signInWithGoogle(googleResponse: GoogleCredentialResponse): Promise<ProfileResource>;
|
|
121
|
-
/**
|
|
122
|
-
* Handles a login response.
|
|
123
|
-
* This can be used for both "register" and "signIn".
|
|
124
|
-
* @param response The login response.
|
|
125
|
-
* @returns The user profile.
|
|
142
|
+
* @returns Promise to the authentication response.
|
|
126
143
|
*/
|
|
127
|
-
|
|
144
|
+
startGoogleLogin(googleResponse: GoogleCredentialResponse): Promise<LoginAuthenticationResponse>;
|
|
128
145
|
/**
|
|
129
146
|
* Signs out locally.
|
|
130
147
|
* Does not invalidate tokens with the server.
|
|
@@ -151,36 +168,33 @@ export declare class MedplumClient extends EventTarget {
|
|
|
151
168
|
* @returns Promise to expanded ValueSet.
|
|
152
169
|
*/
|
|
153
170
|
searchValueSet(system: string, filter: string): Promise<ValueSet>;
|
|
154
|
-
read(resourceType: string, id: string): Promise<
|
|
155
|
-
readCached(resourceType: string, id: string): Promise<
|
|
156
|
-
readReference(reference: Reference): Promise<
|
|
157
|
-
readCachedReference(reference: Reference): Promise<
|
|
171
|
+
read<T extends Resource>(resourceType: string, id: string): Promise<T>;
|
|
172
|
+
readCached<T extends Resource>(resourceType: string, id: string): Promise<T>;
|
|
173
|
+
readReference<T extends Resource>(reference: Reference<T>): Promise<T>;
|
|
174
|
+
readCachedReference<T extends Resource>(reference: Reference<T>): Promise<T>;
|
|
158
175
|
getTypeDefinition(resourceType: string): Promise<IndexedStructureDefinition>;
|
|
159
|
-
readHistory(resourceType: string, id: string): Promise<Bundle
|
|
176
|
+
readHistory<T extends Resource>(resourceType: string, id: string): Promise<Bundle<T>>;
|
|
160
177
|
readPatientEverything(id: string): Promise<Bundle>;
|
|
161
|
-
readBlob(url: string): Promise<Blob>;
|
|
162
|
-
readBlobAsObjectUrl(url: string): Promise<string>;
|
|
163
|
-
readCachedBlobAsObjectUrl(url: string): Promise<string>;
|
|
164
|
-
readBinary(id: string): Promise<Blob>;
|
|
165
178
|
create<T extends Resource>(resource: T): Promise<T>;
|
|
166
179
|
createBinary(data: any, contentType: string): Promise<Binary>;
|
|
167
180
|
update<T extends Resource>(resource: T): Promise<T>;
|
|
168
181
|
patch(resourceType: string, id: string, operations: any): Promise<any>;
|
|
182
|
+
deleteResource(resourceType: string, id: string): Promise<any>;
|
|
169
183
|
graphql(gql: any): Promise<any>;
|
|
170
184
|
subscribe(criteria: string, handler: (e: Resource) => void): Promise<EventSource>;
|
|
185
|
+
getActiveLogin(): LoginState | undefined;
|
|
186
|
+
setActiveLogin(login: LoginState): Promise<void>;
|
|
187
|
+
getLogins(): LoginState[];
|
|
188
|
+
private addLogin;
|
|
189
|
+
private refreshProfile;
|
|
171
190
|
getProfile(): ProfileResource | undefined;
|
|
172
|
-
|
|
173
|
-
private getAccessToken;
|
|
174
|
-
private setAccessToken;
|
|
175
|
-
private getRefreshToken;
|
|
176
|
-
private setRefreshToken;
|
|
191
|
+
isLoading(): boolean;
|
|
177
192
|
/**
|
|
178
193
|
* Makes an HTTP request.
|
|
179
194
|
* @param {string} method
|
|
180
195
|
* @param {string} url
|
|
181
196
|
* @param {string=} contentType
|
|
182
197
|
* @param {Object=} body
|
|
183
|
-
* @param {boolean=} blob
|
|
184
198
|
*/
|
|
185
199
|
private request;
|
|
186
200
|
/**
|
|
@@ -191,9 +205,13 @@ export declare class MedplumClient extends EventTarget {
|
|
|
191
205
|
* @param url The URL of the original request.
|
|
192
206
|
* @param contentType The content type of the original request.
|
|
193
207
|
* @param body The body of the original request.
|
|
194
|
-
* @param blob Optional blob flag of the original request.
|
|
195
208
|
*/
|
|
196
209
|
private handleUnauthenticated;
|
|
210
|
+
/**
|
|
211
|
+
* Starts a new PKCE flow.
|
|
212
|
+
* These PKCE values are stateful, and must survive redirects and page refreshes.
|
|
213
|
+
*/
|
|
214
|
+
private startPkce;
|
|
197
215
|
/**
|
|
198
216
|
* Redirects the user to the login screen for authorization.
|
|
199
217
|
* Clears all auth state including local storage and session storage.
|
|
@@ -205,7 +223,7 @@ export declare class MedplumClient extends EventTarget {
|
|
|
205
223
|
* See: https://openid.net/specs/openid-connect-core-1_0.html#TokenRequest
|
|
206
224
|
* @param code The authorization code received by URL parameter.
|
|
207
225
|
*/
|
|
208
|
-
|
|
226
|
+
processCode(code: string): Promise<ProfileResource>;
|
|
209
227
|
/**
|
|
210
228
|
* Tries to refresh the auth tokens.
|
|
211
229
|
* See: https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokens
|