@medplum/core 5.1.12 → 5.1.14
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 +7 -7
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/cjs/index.d.ts +319 -18
- package/dist/esm/index.d.ts +319 -18
- package/dist/esm/index.mjs +7 -7
- package/dist/esm/index.mjs.map +4 -4
- package/package.json +4 -4
package/dist/esm/index.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ import type { HumanName } from '@medplum/fhirtypes';
|
|
|
26
26
|
import type { Identifier } from '@medplum/fhirtypes';
|
|
27
27
|
import type { ImagingStudy } from '@medplum/fhirtypes';
|
|
28
28
|
import type { Media } from '@medplum/fhirtypes';
|
|
29
|
+
import type { Medication } from '@medplum/fhirtypes';
|
|
30
|
+
import type { MedicationRequest } from '@medplum/fhirtypes';
|
|
29
31
|
import type { Meta } from '@medplum/fhirtypes';
|
|
30
32
|
import type { Money } from '@medplum/fhirtypes';
|
|
31
33
|
import type { Observation } from '@medplum/fhirtypes';
|
|
@@ -35,6 +37,7 @@ import type { ObservationDefinitionQualifiedInterval } from '@medplum/fhirtypes'
|
|
|
35
37
|
import type { OperationOutcome } from '@medplum/fhirtypes';
|
|
36
38
|
import type { OperationOutcomeIssue } from '@medplum/fhirtypes';
|
|
37
39
|
import type { Organization } from '@medplum/fhirtypes';
|
|
40
|
+
import type { Parameters as Parameters_2 } from '@medplum/fhirtypes';
|
|
38
41
|
import type { Patient } from '@medplum/fhirtypes';
|
|
39
42
|
import type { Period } from '@medplum/fhirtypes';
|
|
40
43
|
import type { Practitioner } from '@medplum/fhirtypes';
|
|
@@ -293,7 +296,7 @@ export declare type AnchorResourceOpenEvent<T extends FhircastAnchorResourceType
|
|
|
293
296
|
* false if either operand evaluates to false,
|
|
294
297
|
* and the empty collection otherwise.
|
|
295
298
|
*/
|
|
296
|
-
export declare class AndAtom extends
|
|
299
|
+
export declare class AndAtom extends InfixOperatorAtom {
|
|
297
300
|
constructor(left: Atom, right: Atom);
|
|
298
301
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
299
302
|
}
|
|
@@ -325,7 +328,7 @@ export declare function applyDefaultValuesToResource(resource: Resource, schema:
|
|
|
325
328
|
|
|
326
329
|
export declare function applyFixedOrPatternValue(inputValue: any, key: string, element: InternalSchemaElement, elements: Record<string, InternalSchemaElement>): any;
|
|
327
330
|
|
|
328
|
-
export declare class
|
|
331
|
+
export declare class ArithmeticOperatorAtom extends InfixOperatorAtom {
|
|
329
332
|
readonly impl: (x: number, y: number) => number | boolean;
|
|
330
333
|
constructor(operator: string, left: Atom, right: Atom, impl: (x: number, y: number) => number | boolean);
|
|
331
334
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
@@ -431,10 +434,6 @@ export declare type BaseSchema = Record<string, {
|
|
|
431
434
|
*/
|
|
432
435
|
export declare type BinarySource = string | File | Blob | Uint8Array;
|
|
433
436
|
|
|
434
|
-
export declare abstract class BooleanInfixOperatorAtom extends InfixOperatorAtom {
|
|
435
|
-
abstract eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
436
|
-
}
|
|
437
|
-
|
|
438
437
|
/**
|
|
439
438
|
* Returns a single element array with a typed boolean value.
|
|
440
439
|
* @param value - The primitive boolean value.
|
|
@@ -496,6 +495,20 @@ export declare function buildElementsContext({ parentContext, path, elements, pr
|
|
|
496
495
|
accessPolicyResource?: AccessPolicyResource;
|
|
497
496
|
}): ElementsContextType | undefined;
|
|
498
497
|
|
|
498
|
+
/**
|
|
499
|
+
* Builds the `statusReason` CodeableConcept used when soft-deleting a draft
|
|
500
|
+
* `MedicationRequest` whose vendor-side outcome is unknown (see
|
|
501
|
+
* {@link MEDICATION_REQUEST_STATUS_REASON_RESPONSE_NOT_RECEIVED}).
|
|
502
|
+
*
|
|
503
|
+
* Paired with `status: 'unknown'` (a valid FHIR R4 MedicationRequest status),
|
|
504
|
+
* this is the standard shape every order-medication caller should write when
|
|
505
|
+
* `orderMedication(...)` throws after the draft MR has been created.
|
|
506
|
+
*
|
|
507
|
+
* @returns A `CodeableConcept` carrying our canonical system + code and a
|
|
508
|
+
* human-readable `text` summary.
|
|
509
|
+
*/
|
|
510
|
+
export declare function buildMedicationRequestResponseLostStatusReason(): CodeableConcept;
|
|
511
|
+
|
|
499
512
|
export declare function buildTypeName(components: string[]): string;
|
|
500
513
|
|
|
501
514
|
export declare function businessRule(key: string, message: string): OperationOutcome;
|
|
@@ -850,7 +863,7 @@ export declare interface Constraint {
|
|
|
850
863
|
description: string;
|
|
851
864
|
}
|
|
852
865
|
|
|
853
|
-
export declare class ContainsAtom extends
|
|
866
|
+
export declare class ContainsAtom extends InfixOperatorAtom {
|
|
854
867
|
constructor(left: Atom, right: Atom);
|
|
855
868
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
856
869
|
}
|
|
@@ -1278,12 +1291,12 @@ export declare function ensureNoLeadingSlash(url: string): string;
|
|
|
1278
1291
|
*/
|
|
1279
1292
|
export declare function ensureTrailingSlash(url: string): string;
|
|
1280
1293
|
|
|
1281
|
-
export declare class EqualsAtom extends
|
|
1294
|
+
export declare class EqualsAtom extends InfixOperatorAtom {
|
|
1282
1295
|
constructor(left: Atom, right: Atom);
|
|
1283
1296
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
1284
1297
|
}
|
|
1285
1298
|
|
|
1286
|
-
export declare class EquivalentAtom extends
|
|
1299
|
+
export declare class EquivalentAtom extends InfixOperatorAtom {
|
|
1287
1300
|
constructor(left: Atom, right: Atom);
|
|
1288
1301
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
1289
1302
|
}
|
|
@@ -2176,6 +2189,14 @@ export declare function getImageSrc(resource: Resource): string | undefined;
|
|
|
2176
2189
|
|
|
2177
2190
|
export declare function getInnerDerivedIdentifierExpression(expression: string): string | undefined;
|
|
2178
2191
|
|
|
2192
|
+
/**
|
|
2193
|
+
* Reads the medication-order iframe launch URL from MedicationRequest extensions.
|
|
2194
|
+
* @param medicationRequest - MR to read.
|
|
2195
|
+
* @param ext - Vendor extension URL configuration.
|
|
2196
|
+
* @returns The launch URL, if present.
|
|
2197
|
+
*/
|
|
2198
|
+
export declare function getMedicationOrderIframeUrl(medicationRequest: MedicationRequest, ext: MedicationOrderExtensions): string | undefined;
|
|
2199
|
+
|
|
2179
2200
|
export declare function getNestedProperty(value: TypedValueWithPath | undefined, key: string, options: {
|
|
2180
2201
|
profileUrl?: string;
|
|
2181
2202
|
withPath: true;
|
|
@@ -2207,6 +2228,22 @@ export declare function getPathDifference(parentPath: string, path: string): str
|
|
|
2207
2228
|
*/
|
|
2208
2229
|
export declare function getPathDisplayName(path: string): string;
|
|
2209
2230
|
|
|
2231
|
+
/**
|
|
2232
|
+
* Reads the pending medication-order id from MedicationRequest identifiers.
|
|
2233
|
+
* @param medicationRequest - Draft or active MR carrying vendor identifiers.
|
|
2234
|
+
* @param ext - Vendor extension URL and identifier system configuration.
|
|
2235
|
+
* @returns The pending order id string, if present.
|
|
2236
|
+
*/
|
|
2237
|
+
export declare function getPendingMedicationOrderId(medicationRequest: MedicationRequest, ext: MedicationOrderExtensions): string | undefined;
|
|
2238
|
+
|
|
2239
|
+
/**
|
|
2240
|
+
* Reads the pending medication-order status code from MedicationRequest extensions.
|
|
2241
|
+
* @param medicationRequest - MR to read.
|
|
2242
|
+
* @param ext - Vendor extension URL configuration.
|
|
2243
|
+
* @returns The status code (e.g. queued), if present.
|
|
2244
|
+
*/
|
|
2245
|
+
export declare function getPendingMedicationOrderStatus(medicationRequest: MedicationRequest, ext: MedicationOrderExtensions): string | undefined;
|
|
2246
|
+
|
|
2210
2247
|
/**
|
|
2211
2248
|
* Extracts preferred pharmacies from a Patient resource's extensions.
|
|
2212
2249
|
*
|
|
@@ -2776,12 +2813,12 @@ export declare interface ILoggerConfig {
|
|
|
2776
2813
|
* true left is false and right true, false or empty
|
|
2777
2814
|
* true left is empty
|
|
2778
2815
|
*/
|
|
2779
|
-
export declare class ImpliesAtom extends
|
|
2816
|
+
export declare class ImpliesAtom extends InfixOperatorAtom {
|
|
2780
2817
|
constructor(left: Atom, right: Atom);
|
|
2781
2818
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
2782
2819
|
}
|
|
2783
2820
|
|
|
2784
|
-
export declare class InAtom extends
|
|
2821
|
+
export declare class InAtom extends InfixOperatorAtom {
|
|
2785
2822
|
constructor(left: Atom, right: Atom);
|
|
2786
2823
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
2787
2824
|
}
|
|
@@ -2908,6 +2945,21 @@ export declare interface InternalTypeSchema {
|
|
|
2908
2945
|
mandatoryProperties?: Set<string>;
|
|
2909
2946
|
}
|
|
2910
2947
|
|
|
2948
|
+
/**
|
|
2949
|
+
* Stable error when a bot response does not match {@link MedicationOrderResponse}.
|
|
2950
|
+
*/
|
|
2951
|
+
export declare const INVALID_MEDICATION_ORDER_RESPONSE = "Invalid response from order medication bot";
|
|
2952
|
+
|
|
2953
|
+
/**
|
|
2954
|
+
* Stable error when an order-set widget-url response is missing `launchUrl`.
|
|
2955
|
+
*/
|
|
2956
|
+
export declare const INVALID_MEDICATION_ORDER_SET_RESPONSE = "Invalid response from order-set bot";
|
|
2957
|
+
|
|
2958
|
+
/**
|
|
2959
|
+
* Stable error when a bot response is not a Medication array.
|
|
2960
|
+
*/
|
|
2961
|
+
export declare const INVALID_MEDICATION_SEARCH_RESPONSE = "Invalid response from medication search bot";
|
|
2962
|
+
|
|
2911
2963
|
export declare function invalidSearchOperator(operator: Operator, searchParameterCodeOrId: string): OperationOutcome;
|
|
2912
2964
|
|
|
2913
2965
|
export declare interface InviteRequest {
|
|
@@ -2951,7 +3003,7 @@ export declare function isAccepted(outcome: OperationOutcome): boolean;
|
|
|
2951
3003
|
*/
|
|
2952
3004
|
export declare function isAddPharmacyResponse(value: unknown): value is AddPharmacyResponse;
|
|
2953
3005
|
|
|
2954
|
-
export declare class IsAtom extends
|
|
3006
|
+
export declare class IsAtom extends InfixOperatorAtom {
|
|
2955
3007
|
constructor(left: Atom, right: Atom);
|
|
2956
3008
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
2957
3009
|
}
|
|
@@ -3063,6 +3115,33 @@ export declare function isJwt(token: string): boolean;
|
|
|
3063
3115
|
|
|
3064
3116
|
export declare function isLowerCase(c: string): boolean;
|
|
3065
3117
|
|
|
3118
|
+
/**
|
|
3119
|
+
* Type guard: validates an array of Medication resources (drug search bot output).
|
|
3120
|
+
*
|
|
3121
|
+
* Walks every entry rather than spot-checking the first so a tuple-shaped
|
|
3122
|
+
* payload like `[Medication, MedicationRequest]` is rejected (see PR
|
|
3123
|
+
* [#8999](https://github.com/medplum/medplum/pull/8999#discussion_r3276251617)).
|
|
3124
|
+
*
|
|
3125
|
+
* @param value - Unknown bot JSON payload.
|
|
3126
|
+
* @returns True when the value is an array (possibly empty) where every entry
|
|
3127
|
+
* passes `isResource<Medication>`.
|
|
3128
|
+
*/
|
|
3129
|
+
export declare function isMedicationArray(value: unknown): value is Medication[];
|
|
3130
|
+
|
|
3131
|
+
/**
|
|
3132
|
+
* Type guard: validates an order-medication bot response.
|
|
3133
|
+
* @param value - Unknown bot JSON payload.
|
|
3134
|
+
* @returns True when the value matches MedicationOrderResponse.
|
|
3135
|
+
*/
|
|
3136
|
+
export declare function isMedicationOrderResponse(value: unknown): value is MedicationOrderResponse;
|
|
3137
|
+
|
|
3138
|
+
/**
|
|
3139
|
+
* Type guard: validates an order-set widget-URL bot response.
|
|
3140
|
+
* @param value - Unknown bot JSON payload.
|
|
3141
|
+
* @returns True when the value matches {@link MedicationOrderSetResponse}.
|
|
3142
|
+
*/
|
|
3143
|
+
export declare function isMedicationOrderSetResponse(value: unknown): value is MedicationOrderSetResponse;
|
|
3144
|
+
|
|
3066
3145
|
/**
|
|
3067
3146
|
* Returns true if the access token was issued by a Medplum server.
|
|
3068
3147
|
* @param accessToken - An access token of unknown origin.
|
|
@@ -3592,6 +3671,198 @@ export declare function matchesRange(value: number, range: Range_2, precision?:
|
|
|
3592
3671
|
*/
|
|
3593
3672
|
export declare function matchesSearchRequest(resource: Resource, searchRequest: SearchRequest): boolean;
|
|
3594
3673
|
|
|
3674
|
+
/**
|
|
3675
|
+
* Code stamped on `MedicationRequest.statusReason` when an order-medication
|
|
3676
|
+
* operation never returned a verifiable response — the vendor side may have
|
|
3677
|
+
* created (and sent) the prescription, or it may have rejected the request, and
|
|
3678
|
+
* we cannot tell from the client. Used in place of a hard `DELETE` so the
|
|
3679
|
+
* record stays addressable for later reconciliation against vendor webhooks.
|
|
3680
|
+
*/
|
|
3681
|
+
export declare const MEDICATION_REQUEST_STATUS_REASON_RESPONSE_NOT_RECEIVED = "response-not-received";
|
|
3682
|
+
|
|
3683
|
+
/**
|
|
3684
|
+
* Canonical CodeSystem URL for `MedicationRequest.statusReason` values stamped
|
|
3685
|
+
* by Medplum-managed order flows when a draft MR has to be retired without a
|
|
3686
|
+
* confirmed vendor outcome.
|
|
3687
|
+
*
|
|
3688
|
+
* Downstream reconciliation (vendor webhook bots, audit reports) should match
|
|
3689
|
+
* `statusReason.coding[?(@.system==MEDICATION_REQUEST_STATUS_REASON_SYSTEM)]`
|
|
3690
|
+
* to recognize records that originated from this soft-delete path rather than
|
|
3691
|
+
* a clinician decision.
|
|
3692
|
+
*/
|
|
3693
|
+
export declare const MEDICATION_REQUEST_STATUS_REASON_SYSTEM = "https://medplum.com/fhir/CodeSystem/medication-request-status-reason";
|
|
3694
|
+
|
|
3695
|
+
/**
|
|
3696
|
+
* Vendor-neutral drug line for {@link MedicationOrderRequest}.
|
|
3697
|
+
*/
|
|
3698
|
+
export declare interface MedicationOrderDrugInput {
|
|
3699
|
+
readonly ndc?: string;
|
|
3700
|
+
readonly rxNorm?: string;
|
|
3701
|
+
readonly routedMedId?: number;
|
|
3702
|
+
readonly quantity: number;
|
|
3703
|
+
readonly quantityQualifier?: string;
|
|
3704
|
+
readonly refill?: number;
|
|
3705
|
+
readonly drugOrder?: number;
|
|
3706
|
+
readonly sigLine3?: string;
|
|
3707
|
+
readonly useSubstitution?: boolean;
|
|
3708
|
+
}
|
|
3709
|
+
|
|
3710
|
+
/**
|
|
3711
|
+
* Vendor-neutral mapping of the extension URLs / identifier systems used to read
|
|
3712
|
+
* pending medication-order state stamped on a `MedicationRequest`.
|
|
3713
|
+
*/
|
|
3714
|
+
export declare interface MedicationOrderExtensions {
|
|
3715
|
+
readonly pendingOrderIdSystem: string;
|
|
3716
|
+
readonly pendingOrderStatusUrl: string;
|
|
3717
|
+
readonly iframeUrlExtension: string;
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
/**
|
|
3721
|
+
* Vendor-neutral input for an order-medication bot (matches the ScriptSure bot shape).
|
|
3722
|
+
*/
|
|
3723
|
+
export declare interface MedicationOrderRequest {
|
|
3724
|
+
readonly patientId: string;
|
|
3725
|
+
readonly medicationRequestId?: string;
|
|
3726
|
+
readonly combinationMed?: boolean;
|
|
3727
|
+
readonly drugs?: MedicationOrderDrugInput[];
|
|
3728
|
+
readonly compoundTitle?: string;
|
|
3729
|
+
readonly compoundQuantity?: number;
|
|
3730
|
+
readonly compoundQuantityQualifier?: string;
|
|
3731
|
+
readonly compoundSigs?: {
|
|
3732
|
+
readonly sigOrder: number;
|
|
3733
|
+
readonly line3: string;
|
|
3734
|
+
readonly drugId?: number;
|
|
3735
|
+
}[];
|
|
3736
|
+
readonly conditionIds?: string[];
|
|
3737
|
+
readonly coverageId?: string;
|
|
3738
|
+
readonly payerOrganizationId?: string;
|
|
3739
|
+
readonly pharmacyOrganizationId?: string;
|
|
3740
|
+
readonly diagnoses?: {
|
|
3741
|
+
readonly icdId: string;
|
|
3742
|
+
readonly name: string;
|
|
3743
|
+
}[];
|
|
3744
|
+
readonly pharmacyNcpdpId?: string;
|
|
3745
|
+
readonly pharmacyName?: string;
|
|
3746
|
+
readonly writtenDate?: string;
|
|
3747
|
+
readonly fillDate?: string;
|
|
3748
|
+
/** Days supply for ScriptSure pending order duration (used when no draft MR, e.g. compound). */
|
|
3749
|
+
readonly durationDays?: number;
|
|
3750
|
+
/** Notes to pharmacist (ScriptSure pending-order pharmacyNote); also stored on draft MR as `note`. */
|
|
3751
|
+
readonly pharmacyNote?: string;
|
|
3752
|
+
/** Free-text patient instructions (additional sig); maps to dosageInstruction[0].patientInstruction when using MR path. */
|
|
3753
|
+
readonly patientInstruction?: string;
|
|
3754
|
+
readonly appId?: string;
|
|
3755
|
+
}
|
|
3756
|
+
|
|
3757
|
+
/**
|
|
3758
|
+
* Encodes a {@link MedicationOrderRequest} as a FHIR `Parameters` body for the
|
|
3759
|
+
* vendor-neutral `$order-medication` custom operation.
|
|
3760
|
+
*
|
|
3761
|
+
* Nested arrays (`drugs`, `compoundSigs`, `diagnoses`) are emitted as one
|
|
3762
|
+
* `parameter` entry per element so the OperationDefinition's `max: '*'`
|
|
3763
|
+
* cardinality round-trips; primitive arrays (`conditionIds`) likewise emit
|
|
3764
|
+
* one entry per id. Optional fields are omitted entirely.
|
|
3765
|
+
*
|
|
3766
|
+
* @param req - The order-medication request (vendor-neutral).
|
|
3767
|
+
* @returns A `Parameters` resource ready to POST.
|
|
3768
|
+
*/
|
|
3769
|
+
export declare function medicationOrderRequestToParameters(req: MedicationOrderRequest): Parameters_2;
|
|
3770
|
+
|
|
3771
|
+
/**
|
|
3772
|
+
* Vendor-neutral output from an order-medication bot.
|
|
3773
|
+
*/
|
|
3774
|
+
export declare interface MedicationOrderResponse {
|
|
3775
|
+
readonly orderId: number;
|
|
3776
|
+
/**
|
|
3777
|
+
* Vendor-side patient id (numeric in ScriptSure today; other vendors may use a different
|
|
3778
|
+
* shape). Kept as `number` for backwards compatibility with the ScriptSure bot output.
|
|
3779
|
+
*/
|
|
3780
|
+
readonly vendorPatientId: number;
|
|
3781
|
+
readonly launchUrl: string;
|
|
3782
|
+
readonly medicationRequestId?: string;
|
|
3783
|
+
readonly pendingOrderStatus?: 'queued' | 'reused';
|
|
3784
|
+
}
|
|
3785
|
+
|
|
3786
|
+
/**
|
|
3787
|
+
* Vendor-neutral input for an order-set widget-URL bot.
|
|
3788
|
+
*
|
|
3789
|
+
* One of `planDefinitionId` (Medplum reverse-lookup to the vendor's orderset id
|
|
3790
|
+
* via a cross-system identifier) or `vendorOrderSetId` (escape hatch when no
|
|
3791
|
+
* synced PD exists) is required. Bots reject input where both are set so the
|
|
3792
|
+
* intent is unambiguous on the wire.
|
|
3793
|
+
*/
|
|
3794
|
+
export declare interface MedicationOrderSetRequest {
|
|
3795
|
+
readonly patientId: string;
|
|
3796
|
+
readonly planDefinitionId?: string;
|
|
3797
|
+
/**
|
|
3798
|
+
* Vendor-side order-set id. Numeric in ScriptSure today; kept as
|
|
3799
|
+
* `number | string` so vendors with non-numeric ids can adopt the operation
|
|
3800
|
+
* without a wire-format change.
|
|
3801
|
+
*/
|
|
3802
|
+
readonly vendorOrderSetId?: number | string;
|
|
3803
|
+
readonly appId?: string;
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3806
|
+
/**
|
|
3807
|
+
* Encodes a {@link MedicationOrderSetRequest} as a FHIR `Parameters` body for
|
|
3808
|
+
* the vendor-neutral `$order-set-url` custom operation
|
|
3809
|
+
* (`POST /fhir/R4/PlanDefinition/$order-set-url`). Optional fields are omitted
|
|
3810
|
+
* entirely so the wire payload mirrors the legacy `executeBot` plain-JSON
|
|
3811
|
+
* shape the bot's `parseInput` helper would otherwise have to coerce.
|
|
3812
|
+
*
|
|
3813
|
+
* `vendorOrderSetId` is encoded as `valueInteger` when numeric and
|
|
3814
|
+
* `valueString` otherwise — keeping the operation usable by future vendors
|
|
3815
|
+
* whose order-set ids are not numeric.
|
|
3816
|
+
*
|
|
3817
|
+
* @param req - Order-set request (vendor-neutral).
|
|
3818
|
+
* @returns A `Parameters` resource ready to POST.
|
|
3819
|
+
*/
|
|
3820
|
+
export declare function medicationOrderSetRequestToParameters(req: MedicationOrderSetRequest): Parameters_2;
|
|
3821
|
+
|
|
3822
|
+
/**
|
|
3823
|
+
* Vendor-neutral output from an order-set widget-URL bot.
|
|
3824
|
+
*
|
|
3825
|
+
* The bot itself does not create FHIR resources — it just resolves the vendor
|
|
3826
|
+
* ids and returns an iframe URL the prescriber loads to review/sign the whole
|
|
3827
|
+
* order set in one pass. Optional echoes (`vendorPatientId`, `vendorOrderSetId`,
|
|
3828
|
+
* `planDefinitionId`) are surfaced for diagnostics and audit logging.
|
|
3829
|
+
*/
|
|
3830
|
+
export declare interface MedicationOrderSetResponse {
|
|
3831
|
+
readonly launchUrl: string;
|
|
3832
|
+
readonly vendorPatientId?: number | string;
|
|
3833
|
+
readonly vendorOrderSetId?: number | string;
|
|
3834
|
+
readonly planDefinitionId?: string;
|
|
3835
|
+
}
|
|
3836
|
+
|
|
3837
|
+
/**
|
|
3838
|
+
* Parameters for a drug search bot used by {@link MedicationOrderRequest} flows.
|
|
3839
|
+
*/
|
|
3840
|
+
export declare interface MedicationSearchParams {
|
|
3841
|
+
readonly term?: string;
|
|
3842
|
+
readonly ndc?: string;
|
|
3843
|
+
readonly rxNorm?: string;
|
|
3844
|
+
readonly routedMedId?: number;
|
|
3845
|
+
readonly searchOtc?: boolean;
|
|
3846
|
+
readonly searchSupply?: boolean;
|
|
3847
|
+
readonly searchBrand?: boolean;
|
|
3848
|
+
readonly searchGeneric?: boolean;
|
|
3849
|
+
readonly includeCode?: boolean;
|
|
3850
|
+
/** When true, drug-search bot returns quantity qualifiers from GET /v3/prescription/quantityqualifier instead of Medication[]. */
|
|
3851
|
+
readonly quantityQualifiers?: boolean;
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
/**
|
|
3855
|
+
* Encodes a {@link MedicationSearchParams} as a FHIR `Parameters` body for the
|
|
3856
|
+
* vendor-neutral `$drug-search` (and `$drug-quantity-qualifiers`) custom
|
|
3857
|
+
* operations. Optional fields are omitted entirely so the wire payload stays
|
|
3858
|
+
* minimal and mirrors the legacy `executeBot` plain-JSON shape that the bot's
|
|
3859
|
+
* `parseInput` helper would otherwise have to coerce.
|
|
3860
|
+
*
|
|
3861
|
+
* @param params - Drug search parameters (vendor-neutral subset).
|
|
3862
|
+
* @returns A `Parameters` resource ready to POST.
|
|
3863
|
+
*/
|
|
3864
|
+
export declare function medicationSearchParamsToParameters(params: MedicationSearchParams): Parameters_2;
|
|
3865
|
+
|
|
3595
3866
|
export declare const MEDPLUM_CLI_CLIENT_ID = "medplum-cli";
|
|
3596
3867
|
|
|
3597
3868
|
export declare const MEDPLUM_RELEASES_URL = "https://meta.medplum.com/releases";
|
|
@@ -4902,6 +5173,13 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
4902
5173
|
* @returns The response body.
|
|
4903
5174
|
*/
|
|
4904
5175
|
startAsyncRequest<T>(url: string, options?: MedplumRequestOptions): Promise<T>;
|
|
5176
|
+
/**
|
|
5177
|
+
* Wraps `fetch` execution with token refresh and retry logic.
|
|
5178
|
+
* @param url - The URL to request
|
|
5179
|
+
* @param options - Optional fetch options
|
|
5180
|
+
* @returns The response
|
|
5181
|
+
*/
|
|
5182
|
+
wrappedFetch(url: string, options: RequestInit): Promise<Response>;
|
|
4905
5183
|
/**
|
|
4906
5184
|
* Returns the key value client.
|
|
4907
5185
|
* @returns The key value client.
|
|
@@ -4951,7 +5229,6 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
4951
5229
|
private deleteCacheEntry;
|
|
4952
5230
|
/**
|
|
4953
5231
|
* Makes an HTTP request.
|
|
4954
|
-
* @param method - The HTTP method (GET, POST, etc).
|
|
4955
5232
|
* @param url - The target URL.
|
|
4956
5233
|
* @param options - Optional fetch request init options.
|
|
4957
5234
|
* @param state - Optional request state.
|
|
@@ -5010,7 +5287,6 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
5010
5287
|
* Handles an unauthenticated response from the server.
|
|
5011
5288
|
* First, tries to refresh the access token and retry the request.
|
|
5012
5289
|
* Otherwise, calls unauthenticated callbacks and rejects.
|
|
5013
|
-
* @param method - The HTTP method of the original request.
|
|
5014
5290
|
* @param url - The URL of the original request.
|
|
5015
5291
|
* @param options - Optional fetch request init options.
|
|
5016
5292
|
* @returns The result of the retry.
|
|
@@ -6132,12 +6408,12 @@ export declare function normalizeErrorString(error: unknown): string;
|
|
|
6132
6408
|
*/
|
|
6133
6409
|
export declare function normalizeOperationOutcome(error: unknown): OperationOutcome;
|
|
6134
6410
|
|
|
6135
|
-
export declare class NotEqualsAtom extends
|
|
6411
|
+
export declare class NotEqualsAtom extends InfixOperatorAtom {
|
|
6136
6412
|
constructor(left: Atom, right: Atom);
|
|
6137
6413
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
6138
6414
|
}
|
|
6139
6415
|
|
|
6140
|
-
export declare class NotEquivalentAtom extends
|
|
6416
|
+
export declare class NotEquivalentAtom extends InfixOperatorAtom {
|
|
6141
6417
|
constructor(left: Atom, right: Atom);
|
|
6142
6418
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
6143
6419
|
}
|
|
@@ -6335,7 +6611,7 @@ export declare type Options<WS extends IWebSocket = WebSocket> = {
|
|
|
6335
6611
|
* true if either operand evaluates to true,
|
|
6336
6612
|
* and empty (`{ }`) otherwise:
|
|
6337
6613
|
*/
|
|
6338
|
-
export declare class OrAtom extends
|
|
6614
|
+
export declare class OrAtom extends InfixOperatorAtom {
|
|
6339
6615
|
constructor(left: Atom, right: Atom);
|
|
6340
6616
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
6341
6617
|
}
|
|
@@ -6345,6 +6621,30 @@ export declare class OrAtom extends BooleanInfixOperatorAtom {
|
|
|
6345
6621
|
*/
|
|
6346
6622
|
export declare type OutputRow = Record<string, any>;
|
|
6347
6623
|
|
|
6624
|
+
/**
|
|
6625
|
+
* Decodes the `Parameters` response from the `$order-medication` custom
|
|
6626
|
+
* operation into a typed {@link MedicationOrderResponse}. Throws
|
|
6627
|
+
* `INVALID_MEDICATION_ORDER_RESPONSE` when required fields are missing.
|
|
6628
|
+
*
|
|
6629
|
+
* @param params - The `Parameters` resource returned by the operation.
|
|
6630
|
+
* @returns A vendor-neutral {@link MedicationOrderResponse}.
|
|
6631
|
+
*/
|
|
6632
|
+
export declare function parametersToMedicationOrderResponse(params: Parameters_2): MedicationOrderResponse;
|
|
6633
|
+
|
|
6634
|
+
/**
|
|
6635
|
+
* Decodes the `Parameters` response from the `$order-set-url` custom operation
|
|
6636
|
+
* into a typed {@link MedicationOrderSetResponse}. Throws
|
|
6637
|
+
* `INVALID_MEDICATION_ORDER_SET_RESPONSE` when `launchUrl` is missing or empty.
|
|
6638
|
+
*
|
|
6639
|
+
* Echoed vendor ids (`vendorPatientId`, `vendorOrderSetId`) are preserved as
|
|
6640
|
+
* the wire type — `number` when sent as `valueInteger`, `string` when sent as
|
|
6641
|
+
* `valueString` — so downstream code can read either without conversion.
|
|
6642
|
+
*
|
|
6643
|
+
* @param params - The `Parameters` resource returned by the operation.
|
|
6644
|
+
* @returns A vendor-neutral {@link MedicationOrderSetResponse}.
|
|
6645
|
+
*/
|
|
6646
|
+
export declare function parametersToMedicationOrderSetResponse(params: Parameters_2): MedicationOrderSetResponse;
|
|
6647
|
+
|
|
6348
6648
|
/**
|
|
6349
6649
|
* Parses a FHIRPath expression into an AST.
|
|
6350
6650
|
* The result can be used to evaluate the expression against a resource or other object.
|
|
@@ -7020,6 +7320,7 @@ export declare class ParserBuilder {
|
|
|
7020
7320
|
readonly elementDefinitions?: InternalSchemaElement[];
|
|
7021
7321
|
readonly parsedExpression: FhirPathAtom;
|
|
7022
7322
|
readonly array?: boolean;
|
|
7323
|
+
readonly referenceTargetTypes?: ResourceType[];
|
|
7023
7324
|
}
|
|
7024
7325
|
|
|
7025
7326
|
export declare const SearchParameterType: {
|
|
@@ -7715,7 +8016,7 @@ export declare class ParserBuilder {
|
|
|
7715
8016
|
* false if either both operands evaluate to true or both operands evaluate to false,
|
|
7716
8017
|
* and the empty collection otherwise.
|
|
7717
8018
|
*/
|
|
7718
|
-
export declare class XorAtom extends
|
|
8019
|
+
export declare class XorAtom extends InfixOperatorAtom {
|
|
7719
8020
|
constructor(left: Atom, right: Atom);
|
|
7720
8021
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
7721
8022
|
}
|