@medplum/core 5.1.28 → 5.1.29
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/dist/cjs/index.cjs +8 -8
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +103 -1
- package/dist/esm/index.d.ts +103 -1
- package/dist/esm/index.mjs +8 -8
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +3 -3
package/dist/cjs/index.d.ts
CHANGED
|
@@ -831,6 +831,17 @@ export declare function checkIfValidMedplumVersion(appName: string, version: str
|
|
|
831
831
|
*/
|
|
832
832
|
export declare function clearReleaseCache(): void;
|
|
833
833
|
|
|
834
|
+
/**
|
|
835
|
+
* Immutably clears one scheduling parameter a Schedule sets for a HealthcareService, dropping that
|
|
836
|
+
* calendar back to the service-level parameter of the same name. Pairs with `setScheduleParameter`
|
|
837
|
+
* and `getScheduleParameters`.
|
|
838
|
+
* @param schedule - Schedule to update
|
|
839
|
+
* @param service - HealthcareService referenced by the parameters
|
|
840
|
+
* @param url - Url of the SchedulingParameters sub-extension to remove, for example `availability`
|
|
841
|
+
* @returns A cloned Schedule without the matching parameter
|
|
842
|
+
*/
|
|
843
|
+
export declare function clearScheduleParameter(schedule: Schedule, service: WithId<HealthcareService>, url: string): Schedule;
|
|
844
|
+
|
|
834
845
|
/**
|
|
835
846
|
* Log level for MedplumClient requests and responses.
|
|
836
847
|
* - 'none': No logging
|
|
@@ -1632,6 +1643,15 @@ export declare interface ExtendedInternalSchemaElement extends InternalSchemaEle
|
|
|
1632
1643
|
readonly?: boolean;
|
|
1633
1644
|
}
|
|
1634
1645
|
|
|
1646
|
+
/**
|
|
1647
|
+
* Anything that can carry FHIR extensions: resources such as `Patient`, data types such as
|
|
1648
|
+
* `CodeableConcept`, and extensions themselves. Structural, so any of those is accepted, while a
|
|
1649
|
+
* type that cannot hold extensions, `Binary` being the notable example, is rejected.
|
|
1650
|
+
*/
|
|
1651
|
+
export declare interface Extensible {
|
|
1652
|
+
extension?: Extension[];
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1635
1655
|
export declare type ExternalSecret<T extends ExternalSecretPrimitive = ExternalSecretPrimitive> = {
|
|
1636
1656
|
system: ExternalSecretSystem;
|
|
1637
1657
|
key: string;
|
|
@@ -2466,6 +2486,18 @@ export declare function getExpressionsForResourceType(resourceType: string, expr
|
|
|
2466
2486
|
*/
|
|
2467
2487
|
export declare function getExtension(resource: any, ...urls: string[]): Extension | undefined;
|
|
2468
2488
|
|
|
2489
|
+
/**
|
|
2490
|
+
* Returns every extension reachable by the given extension URLs.
|
|
2491
|
+
*
|
|
2492
|
+
* Like `getExtension`, but does not stop at the first match: extensions that repeat under one URL are
|
|
2493
|
+
* all returned, at every level. Use it for extensions defined with a cardinality above one, where
|
|
2494
|
+
* `getExtension` would silently read only the first.
|
|
2495
|
+
* @param extensible - The base resource, data type, or extension. Anything that may hold an `extension` array.
|
|
2496
|
+
* @param urlOrUrls - One extension URL, or an array of them where each entry represents descending a level in a nested extension.
|
|
2497
|
+
* @returns Every matching extension, in document order. Empty if none match or no URL is given.
|
|
2498
|
+
*/
|
|
2499
|
+
export declare function getExtensions(extensible: Extensible | undefined, urlOrUrls: string | string[]): Extension[];
|
|
2500
|
+
|
|
2469
2501
|
/**
|
|
2470
2502
|
* Returns an extension value by extension URLs.
|
|
2471
2503
|
* @param resource - The base resource.
|
|
@@ -2608,6 +2640,30 @@ export declare function getReferenceString(input: Reference | Resource): string
|
|
|
2608
2640
|
*/
|
|
2609
2641
|
export declare function getResourceTypes(): ResourceType[];
|
|
2610
2642
|
|
|
2643
|
+
/**
|
|
2644
|
+
* Reads one scheduling parameter a Schedule sets for a HealthcareService, taking precedence over the
|
|
2645
|
+
* service-level parameter of the same name. Pairs with `setScheduleParameter` and `clearScheduleParameter`.
|
|
2646
|
+
*
|
|
2647
|
+
* The result is a list rather than a single extension because a Schedule may carry more than one
|
|
2648
|
+
* SchedulingParameters extension matching the service, and because a parameter may legitimately repeat.
|
|
2649
|
+
* @param schedule - Schedule to inspect
|
|
2650
|
+
* @param service - HealthcareService referenced by the parameters
|
|
2651
|
+
* @param url - Url of the SchedulingParameters sub-extension to read, for example `availability`
|
|
2652
|
+
* @returns Every matching sub-extension, in document order
|
|
2653
|
+
*/
|
|
2654
|
+
export declare function getScheduleParameters(schedule: Schedule, service: WithId<HealthcareService>, url: string): Extension[];
|
|
2655
|
+
|
|
2656
|
+
/**
|
|
2657
|
+
* Resolves the timezone used by scheduling in server priority order: the Schedule's parameters for the
|
|
2658
|
+
* service, then the service's own parameters, then the actor's standard FHIR timezone extension.
|
|
2659
|
+
* @param service - HealthcareService whose parameters may define a timezone
|
|
2660
|
+
* @param schedule - Schedule whose parameters may define a timezone. Omit to resolve the service's own timezone,
|
|
2661
|
+
* as when the service default hours are being read on their own rather than through a particular calendar.
|
|
2662
|
+
* @param actor - Optional Schedule actor used as a timezone fallback
|
|
2663
|
+
* @returns The resolved IANA timezone identifier, if present
|
|
2664
|
+
*/
|
|
2665
|
+
export declare function getSchedulingTimezone(service: WithId<HealthcareService>, schedule?: Schedule, actor?: Resource): string | undefined;
|
|
2666
|
+
|
|
2611
2667
|
/**
|
|
2612
2668
|
* Returns a search parameter for a resource type by search code.
|
|
2613
2669
|
* @param resourceType - The FHIR resource type.
|
|
@@ -2720,6 +2776,9 @@ export declare interface GoogleLoginRequest extends BaseLoginRequest {
|
|
|
2720
2776
|
|
|
2721
2777
|
/**
|
|
2722
2778
|
* Returns whether a Schedule or HealthcareService has a SchedulingParameters extension.
|
|
2779
|
+
*
|
|
2780
|
+
* Unscoped: on a Schedule, where the extension repeats once per service, this reports that some
|
|
2781
|
+
* service is configured rather than any particular one. Ask `getScheduleParameters` about a service.
|
|
2723
2782
|
* @param resource - Schedule or HealthcareService to inspect
|
|
2724
2783
|
* @returns True if the resource has a SchedulingParameters extension
|
|
2725
2784
|
*/
|
|
@@ -3668,7 +3727,7 @@ export declare function isStringArray(arr: any[]): arr is string[];
|
|
|
3668
3727
|
|
|
3669
3728
|
export declare type IssueSeverity = 'error' | 'fatal' | 'warning' | 'information';
|
|
3670
3729
|
|
|
3671
|
-
export declare type IssueType = 'structure' | 'invariant' | 'processing';
|
|
3730
|
+
export declare type IssueType = 'structure' | 'invariant' | 'processing' | 'required';
|
|
3672
3731
|
|
|
3673
3732
|
/**
|
|
3674
3733
|
* Returns true if the input value is an object with a string text property.
|
|
@@ -4223,6 +4282,25 @@ export declare interface MedicationOrderDrugInput {
|
|
|
4223
4282
|
readonly ndc?: string;
|
|
4224
4283
|
readonly rxNorm?: string;
|
|
4225
4284
|
readonly routedMedId?: number;
|
|
4285
|
+
/**
|
|
4286
|
+
* Vendor formulation key, paired with {@link routedMedId} to order a drug that
|
|
4287
|
+
* has no dose-level product to resolve an NDC from — OTC / topical /
|
|
4288
|
+
* wide-multi-strength generics for which the vendor's dose-format lookup
|
|
4289
|
+
* returns nothing. Supply {@link drugName} alongside it, since there is no
|
|
4290
|
+
* catalog row to derive a name from.
|
|
4291
|
+
*/
|
|
4292
|
+
readonly gcnSeqno?: number;
|
|
4293
|
+
/** Drug name, required for a {@link gcnSeqno}-keyed line (no catalog row to name it). */
|
|
4294
|
+
readonly drugName?: string;
|
|
4295
|
+
/**
|
|
4296
|
+
* Dose text for a {@link gcnSeqno}-keyed line, e.g. `"solution"`.
|
|
4297
|
+
*
|
|
4298
|
+
* Optional, and only worth sending when the caller holds dose text *separate*
|
|
4299
|
+
* from {@link drugName} — a hand-entered form, say. Passing a full product
|
|
4300
|
+
* label duplicates it in the description the vendor renders. When omitted, the
|
|
4301
|
+
* vendor derives the dose from the formulation key or falls back to the sig.
|
|
4302
|
+
*/
|
|
4303
|
+
readonly line1?: string;
|
|
4226
4304
|
readonly quantity: number;
|
|
4227
4305
|
readonly quantityQualifier?: string;
|
|
4228
4306
|
readonly refill?: number;
|
|
@@ -4378,6 +4456,13 @@ export declare interface MedicationSearchParams {
|
|
|
4378
4456
|
readonly ndc?: string;
|
|
4379
4457
|
readonly rxNorm?: string;
|
|
4380
4458
|
readonly routedMedId?: number;
|
|
4459
|
+
/**
|
|
4460
|
+
* Vendor formulation keys under {@link routedMedId}, from the name-search hit.
|
|
4461
|
+
* Only used when the drug has no dose-level products: each key is resolved to
|
|
4462
|
+
* its marketed strength so the caller still gets selectable formulations
|
|
4463
|
+
* instead of an empty result. Ignored otherwise.
|
|
4464
|
+
*/
|
|
4465
|
+
readonly gcnSeqnos?: number[];
|
|
4381
4466
|
readonly searchOtc?: boolean;
|
|
4382
4467
|
readonly searchSupply?: boolean;
|
|
4383
4468
|
readonly searchBrand?: boolean;
|
|
@@ -8322,6 +8407,23 @@ export declare class ParserBuilder {
|
|
|
8322
8407
|
use?: Identifier['use'];
|
|
8323
8408
|
}
|
|
8324
8409
|
|
|
8410
|
+
/**
|
|
8411
|
+
* Immutably sets one scheduling parameter on a Schedule for a HealthcareService, so that calendar keeps
|
|
8412
|
+
* it in place of the service-level parameter of the same name. Whatever the Schedule already holds at the
|
|
8413
|
+
* sub-extension's url is replaced, and the SchedulingParameters extension is created if the Schedule has
|
|
8414
|
+
* none for the service yet.
|
|
8415
|
+
*
|
|
8416
|
+
* Untyped by design, taking any sub-extension of the shape the parameter calls for, for example
|
|
8417
|
+
* `{ url: 'bufferBefore', valueDuration: { value: 10, unit: 'min' } }`. A parameter whose value is a nested
|
|
8418
|
+
* structure rather than a single `value[x]` is worth a typed wrapper over this; `availability` has one in
|
|
8419
|
+
* `@medplum/react-scheduling`. Pairs with `clearScheduleParameter` and `getScheduleParameters`.
|
|
8420
|
+
* @param schedule - Schedule to update
|
|
8421
|
+
* @param service - HealthcareService referenced by the parameters
|
|
8422
|
+
* @param subextension - SchedulingParameters sub-extension to set
|
|
8423
|
+
* @returns A cloned Schedule containing the parameter
|
|
8424
|
+
*/
|
|
8425
|
+
export declare function setScheduleParameter(schedule: Schedule, service: WithId<HealthcareService>, subextension: Extension): Schedule;
|
|
8426
|
+
|
|
8325
8427
|
export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
|
|
8326
8428
|
|
|
8327
8429
|
export declare function singularize<T>(value: T | T[] | undefined): T | undefined;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -831,6 +831,17 @@ export declare function checkIfValidMedplumVersion(appName: string, version: str
|
|
|
831
831
|
*/
|
|
832
832
|
export declare function clearReleaseCache(): void;
|
|
833
833
|
|
|
834
|
+
/**
|
|
835
|
+
* Immutably clears one scheduling parameter a Schedule sets for a HealthcareService, dropping that
|
|
836
|
+
* calendar back to the service-level parameter of the same name. Pairs with `setScheduleParameter`
|
|
837
|
+
* and `getScheduleParameters`.
|
|
838
|
+
* @param schedule - Schedule to update
|
|
839
|
+
* @param service - HealthcareService referenced by the parameters
|
|
840
|
+
* @param url - Url of the SchedulingParameters sub-extension to remove, for example `availability`
|
|
841
|
+
* @returns A cloned Schedule without the matching parameter
|
|
842
|
+
*/
|
|
843
|
+
export declare function clearScheduleParameter(schedule: Schedule, service: WithId<HealthcareService>, url: string): Schedule;
|
|
844
|
+
|
|
834
845
|
/**
|
|
835
846
|
* Log level for MedplumClient requests and responses.
|
|
836
847
|
* - 'none': No logging
|
|
@@ -1632,6 +1643,15 @@ export declare interface ExtendedInternalSchemaElement extends InternalSchemaEle
|
|
|
1632
1643
|
readonly?: boolean;
|
|
1633
1644
|
}
|
|
1634
1645
|
|
|
1646
|
+
/**
|
|
1647
|
+
* Anything that can carry FHIR extensions: resources such as `Patient`, data types such as
|
|
1648
|
+
* `CodeableConcept`, and extensions themselves. Structural, so any of those is accepted, while a
|
|
1649
|
+
* type that cannot hold extensions, `Binary` being the notable example, is rejected.
|
|
1650
|
+
*/
|
|
1651
|
+
export declare interface Extensible {
|
|
1652
|
+
extension?: Extension[];
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1635
1655
|
export declare type ExternalSecret<T extends ExternalSecretPrimitive = ExternalSecretPrimitive> = {
|
|
1636
1656
|
system: ExternalSecretSystem;
|
|
1637
1657
|
key: string;
|
|
@@ -2466,6 +2486,18 @@ export declare function getExpressionsForResourceType(resourceType: string, expr
|
|
|
2466
2486
|
*/
|
|
2467
2487
|
export declare function getExtension(resource: any, ...urls: string[]): Extension | undefined;
|
|
2468
2488
|
|
|
2489
|
+
/**
|
|
2490
|
+
* Returns every extension reachable by the given extension URLs.
|
|
2491
|
+
*
|
|
2492
|
+
* Like `getExtension`, but does not stop at the first match: extensions that repeat under one URL are
|
|
2493
|
+
* all returned, at every level. Use it for extensions defined with a cardinality above one, where
|
|
2494
|
+
* `getExtension` would silently read only the first.
|
|
2495
|
+
* @param extensible - The base resource, data type, or extension. Anything that may hold an `extension` array.
|
|
2496
|
+
* @param urlOrUrls - One extension URL, or an array of them where each entry represents descending a level in a nested extension.
|
|
2497
|
+
* @returns Every matching extension, in document order. Empty if none match or no URL is given.
|
|
2498
|
+
*/
|
|
2499
|
+
export declare function getExtensions(extensible: Extensible | undefined, urlOrUrls: string | string[]): Extension[];
|
|
2500
|
+
|
|
2469
2501
|
/**
|
|
2470
2502
|
* Returns an extension value by extension URLs.
|
|
2471
2503
|
* @param resource - The base resource.
|
|
@@ -2608,6 +2640,30 @@ export declare function getReferenceString(input: Reference | Resource): string
|
|
|
2608
2640
|
*/
|
|
2609
2641
|
export declare function getResourceTypes(): ResourceType[];
|
|
2610
2642
|
|
|
2643
|
+
/**
|
|
2644
|
+
* Reads one scheduling parameter a Schedule sets for a HealthcareService, taking precedence over the
|
|
2645
|
+
* service-level parameter of the same name. Pairs with `setScheduleParameter` and `clearScheduleParameter`.
|
|
2646
|
+
*
|
|
2647
|
+
* The result is a list rather than a single extension because a Schedule may carry more than one
|
|
2648
|
+
* SchedulingParameters extension matching the service, and because a parameter may legitimately repeat.
|
|
2649
|
+
* @param schedule - Schedule to inspect
|
|
2650
|
+
* @param service - HealthcareService referenced by the parameters
|
|
2651
|
+
* @param url - Url of the SchedulingParameters sub-extension to read, for example `availability`
|
|
2652
|
+
* @returns Every matching sub-extension, in document order
|
|
2653
|
+
*/
|
|
2654
|
+
export declare function getScheduleParameters(schedule: Schedule, service: WithId<HealthcareService>, url: string): Extension[];
|
|
2655
|
+
|
|
2656
|
+
/**
|
|
2657
|
+
* Resolves the timezone used by scheduling in server priority order: the Schedule's parameters for the
|
|
2658
|
+
* service, then the service's own parameters, then the actor's standard FHIR timezone extension.
|
|
2659
|
+
* @param service - HealthcareService whose parameters may define a timezone
|
|
2660
|
+
* @param schedule - Schedule whose parameters may define a timezone. Omit to resolve the service's own timezone,
|
|
2661
|
+
* as when the service default hours are being read on their own rather than through a particular calendar.
|
|
2662
|
+
* @param actor - Optional Schedule actor used as a timezone fallback
|
|
2663
|
+
* @returns The resolved IANA timezone identifier, if present
|
|
2664
|
+
*/
|
|
2665
|
+
export declare function getSchedulingTimezone(service: WithId<HealthcareService>, schedule?: Schedule, actor?: Resource): string | undefined;
|
|
2666
|
+
|
|
2611
2667
|
/**
|
|
2612
2668
|
* Returns a search parameter for a resource type by search code.
|
|
2613
2669
|
* @param resourceType - The FHIR resource type.
|
|
@@ -2720,6 +2776,9 @@ export declare interface GoogleLoginRequest extends BaseLoginRequest {
|
|
|
2720
2776
|
|
|
2721
2777
|
/**
|
|
2722
2778
|
* Returns whether a Schedule or HealthcareService has a SchedulingParameters extension.
|
|
2779
|
+
*
|
|
2780
|
+
* Unscoped: on a Schedule, where the extension repeats once per service, this reports that some
|
|
2781
|
+
* service is configured rather than any particular one. Ask `getScheduleParameters` about a service.
|
|
2723
2782
|
* @param resource - Schedule or HealthcareService to inspect
|
|
2724
2783
|
* @returns True if the resource has a SchedulingParameters extension
|
|
2725
2784
|
*/
|
|
@@ -3668,7 +3727,7 @@ export declare function isStringArray(arr: any[]): arr is string[];
|
|
|
3668
3727
|
|
|
3669
3728
|
export declare type IssueSeverity = 'error' | 'fatal' | 'warning' | 'information';
|
|
3670
3729
|
|
|
3671
|
-
export declare type IssueType = 'structure' | 'invariant' | 'processing';
|
|
3730
|
+
export declare type IssueType = 'structure' | 'invariant' | 'processing' | 'required';
|
|
3672
3731
|
|
|
3673
3732
|
/**
|
|
3674
3733
|
* Returns true if the input value is an object with a string text property.
|
|
@@ -4223,6 +4282,25 @@ export declare interface MedicationOrderDrugInput {
|
|
|
4223
4282
|
readonly ndc?: string;
|
|
4224
4283
|
readonly rxNorm?: string;
|
|
4225
4284
|
readonly routedMedId?: number;
|
|
4285
|
+
/**
|
|
4286
|
+
* Vendor formulation key, paired with {@link routedMedId} to order a drug that
|
|
4287
|
+
* has no dose-level product to resolve an NDC from — OTC / topical /
|
|
4288
|
+
* wide-multi-strength generics for which the vendor's dose-format lookup
|
|
4289
|
+
* returns nothing. Supply {@link drugName} alongside it, since there is no
|
|
4290
|
+
* catalog row to derive a name from.
|
|
4291
|
+
*/
|
|
4292
|
+
readonly gcnSeqno?: number;
|
|
4293
|
+
/** Drug name, required for a {@link gcnSeqno}-keyed line (no catalog row to name it). */
|
|
4294
|
+
readonly drugName?: string;
|
|
4295
|
+
/**
|
|
4296
|
+
* Dose text for a {@link gcnSeqno}-keyed line, e.g. `"solution"`.
|
|
4297
|
+
*
|
|
4298
|
+
* Optional, and only worth sending when the caller holds dose text *separate*
|
|
4299
|
+
* from {@link drugName} — a hand-entered form, say. Passing a full product
|
|
4300
|
+
* label duplicates it in the description the vendor renders. When omitted, the
|
|
4301
|
+
* vendor derives the dose from the formulation key or falls back to the sig.
|
|
4302
|
+
*/
|
|
4303
|
+
readonly line1?: string;
|
|
4226
4304
|
readonly quantity: number;
|
|
4227
4305
|
readonly quantityQualifier?: string;
|
|
4228
4306
|
readonly refill?: number;
|
|
@@ -4378,6 +4456,13 @@ export declare interface MedicationSearchParams {
|
|
|
4378
4456
|
readonly ndc?: string;
|
|
4379
4457
|
readonly rxNorm?: string;
|
|
4380
4458
|
readonly routedMedId?: number;
|
|
4459
|
+
/**
|
|
4460
|
+
* Vendor formulation keys under {@link routedMedId}, from the name-search hit.
|
|
4461
|
+
* Only used when the drug has no dose-level products: each key is resolved to
|
|
4462
|
+
* its marketed strength so the caller still gets selectable formulations
|
|
4463
|
+
* instead of an empty result. Ignored otherwise.
|
|
4464
|
+
*/
|
|
4465
|
+
readonly gcnSeqnos?: number[];
|
|
4381
4466
|
readonly searchOtc?: boolean;
|
|
4382
4467
|
readonly searchSupply?: boolean;
|
|
4383
4468
|
readonly searchBrand?: boolean;
|
|
@@ -8322,6 +8407,23 @@ export declare class ParserBuilder {
|
|
|
8322
8407
|
use?: Identifier['use'];
|
|
8323
8408
|
}
|
|
8324
8409
|
|
|
8410
|
+
/**
|
|
8411
|
+
* Immutably sets one scheduling parameter on a Schedule for a HealthcareService, so that calendar keeps
|
|
8412
|
+
* it in place of the service-level parameter of the same name. Whatever the Schedule already holds at the
|
|
8413
|
+
* sub-extension's url is replaced, and the SchedulingParameters extension is created if the Schedule has
|
|
8414
|
+
* none for the service yet.
|
|
8415
|
+
*
|
|
8416
|
+
* Untyped by design, taking any sub-extension of the shape the parameter calls for, for example
|
|
8417
|
+
* `{ url: 'bufferBefore', valueDuration: { value: 10, unit: 'min' } }`. A parameter whose value is a nested
|
|
8418
|
+
* structure rather than a single `value[x]` is worth a typed wrapper over this; `availability` has one in
|
|
8419
|
+
* `@medplum/react-scheduling`. Pairs with `clearScheduleParameter` and `getScheduleParameters`.
|
|
8420
|
+
* @param schedule - Schedule to update
|
|
8421
|
+
* @param service - HealthcareService referenced by the parameters
|
|
8422
|
+
* @param subextension - SchedulingParameters sub-extension to set
|
|
8423
|
+
* @returns A cloned Schedule containing the parameter
|
|
8424
|
+
*/
|
|
8425
|
+
export declare function setScheduleParameter(schedule: Schedule, service: WithId<HealthcareService>, subextension: Extension): Schedule;
|
|
8426
|
+
|
|
8325
8427
|
export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
|
|
8326
8428
|
|
|
8327
8429
|
export declare function singularize<T>(value: T | T[] | undefined): T | undefined;
|