@medplum/core 5.1.24 → 5.1.27
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 +3 -3
- package/dist/cjs/index.d.ts +329 -4
- package/dist/esm/index.d.ts +329 -4
- package/dist/esm/index.mjs +7 -7
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +4 -4
package/dist/esm/index.d.ts
CHANGED
|
@@ -137,6 +137,8 @@ export declare interface AddFavoriteParams {
|
|
|
137
137
|
patientId: string;
|
|
138
138
|
pharmacy: Organization;
|
|
139
139
|
setAsPrimary: boolean;
|
|
140
|
+
/** Selected practice location for multi-practice deployments. */
|
|
141
|
+
organization?: Reference<Organization>;
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
export declare interface AddOperation {
|
|
@@ -442,6 +444,8 @@ export declare function assertOk<T>(outcome: OperationOutcome, resource: T | und
|
|
|
442
444
|
*/
|
|
443
445
|
export declare function assertReleaseManifest(candidate: unknown): asserts candidate is ReleaseManifest;
|
|
444
446
|
|
|
447
|
+
export declare function assertValidMedplumSemver(version: string): asserts version is MedplumSemver;
|
|
448
|
+
|
|
445
449
|
export declare interface AsyncCrawlerVisitor {
|
|
446
450
|
onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
|
|
447
451
|
onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
|
|
@@ -870,6 +874,14 @@ export declare type CodeChallengeMethod = 'plain' | 'S256';
|
|
|
870
874
|
*/
|
|
871
875
|
export declare function codingMatchesToken(coding: Coding, token: string): boolean;
|
|
872
876
|
|
|
877
|
+
/**
|
|
878
|
+
* Compares two Medplum semver version strings, ignoring any trailing commit-hash suffix.
|
|
879
|
+
* @param a - The first version to compare.
|
|
880
|
+
* @param b - The second version to compare.
|
|
881
|
+
* @returns A negative number if `a` is older than `b`, a positive number if `a` is newer than `b`, or `0` if they resolve to the same release.
|
|
882
|
+
*/
|
|
883
|
+
export declare function compareVersions(a: MedplumSemver, b: MedplumSemver): number;
|
|
884
|
+
|
|
873
885
|
export declare function compressElement(element: InternalSchemaElement): Partial<InternalSchemaElement>;
|
|
874
886
|
|
|
875
887
|
export declare class ConcatAtom extends InfixOperatorAtom {
|
|
@@ -942,6 +954,7 @@ export declare function contentTooLarge(text: string): OperationOutcome;
|
|
|
942
954
|
export declare const ContentType: {
|
|
943
955
|
readonly CSS: "text/css";
|
|
944
956
|
readonly DICOM: "application/dicom";
|
|
957
|
+
readonly EVENT_STREAM: "text/event-stream";
|
|
945
958
|
readonly FAVICON: "image/vnd.microsoft.icon";
|
|
946
959
|
readonly FHIR_JSON: "application/fhir+json";
|
|
947
960
|
readonly FORM_URL_ENCODED: "application/x-www-form-urlencoded";
|
|
@@ -1617,12 +1630,20 @@ export declare const ExternalSecretSystems: {
|
|
|
1617
1630
|
*/
|
|
1618
1631
|
export declare function extractAccountReferences(meta: Meta | undefined): Reference[] | undefined;
|
|
1619
1632
|
|
|
1633
|
+
/**
|
|
1634
|
+
* Fetches the version strings for all published Medplum releases.
|
|
1635
|
+
* @param appName - The name of the app to fetch the release list for.
|
|
1636
|
+
* @param params - An optional list of key-value pairs to be appended to the URL query string.
|
|
1637
|
+
* @returns An array of version strings (without the leading `v`), sorted from newest to oldest.
|
|
1638
|
+
*/
|
|
1639
|
+
export declare function fetchAllVersionStrings(appName: string, params?: Record<string, string>): Promise<MedplumSemver[]>;
|
|
1640
|
+
|
|
1620
1641
|
/**
|
|
1621
1642
|
* Fetches the latest Medplum release version string.
|
|
1622
1643
|
* @param appName - The name of the app to fetch the latest version for.
|
|
1623
1644
|
* @returns A version string corresponding to the latest Medplum release version.
|
|
1624
1645
|
*/
|
|
1625
|
-
export declare function fetchLatestVersionString(appName: string): Promise<
|
|
1646
|
+
export declare function fetchLatestVersionString(appName: string): Promise<MedplumSemver>;
|
|
1626
1647
|
|
|
1627
1648
|
export declare type FetchLike = (url: string, options?: any) => Promise<any>;
|
|
1628
1649
|
|
|
@@ -2585,6 +2606,8 @@ export declare function getSearchParameterDetails(resourceType: string, searchPa
|
|
|
2585
2606
|
*/
|
|
2586
2607
|
export declare function getSearchParameters(resourceType: string): Record<string, SearchParameter> | undefined;
|
|
2587
2608
|
|
|
2609
|
+
export declare function getSearchResourceTypes(searchRequest: SearchRequest): ResourceType[];
|
|
2610
|
+
|
|
2588
2611
|
export declare function getSmartHealthLinkId(manifestUrl: string): string | undefined;
|
|
2589
2612
|
|
|
2590
2613
|
export declare function getStatus(outcome: OperationOutcome): number;
|
|
@@ -2868,6 +2891,18 @@ export declare class Hl7Message {
|
|
|
2868
2891
|
* @returns The HL7 message as a string.
|
|
2869
2892
|
*/
|
|
2870
2893
|
toString(): string;
|
|
2894
|
+
/**
|
|
2895
|
+
* Returns this message's acknowledgment code (MSA-1), if it is a recognized
|
|
2896
|
+
* HL7 ACK code.
|
|
2897
|
+
*
|
|
2898
|
+
* Useful on an ACK message to decide the outcome of the acknowledged message —
|
|
2899
|
+
* e.g. AA/CA (accepted) vs AR/CR (rejected) vs AE/CE (error). The value is
|
|
2900
|
+
* upper-cased before matching. Returns undefined when there is no MSA segment,
|
|
2901
|
+
* MSA-1 is empty, or the value is not a known `AckCode`.
|
|
2902
|
+
*
|
|
2903
|
+
* @returns The `AckCode`, or undefined.
|
|
2904
|
+
*/
|
|
2905
|
+
getAckType(): AckCode | undefined;
|
|
2871
2906
|
/**
|
|
2872
2907
|
* Returns an HL7 "ACK" (acknowledgement) message for this message.
|
|
2873
2908
|
* @param options - The optional options to configure the "ACK" message.
|
|
@@ -3212,6 +3247,18 @@ export declare function intersection(objects: ArrayLike<{
|
|
|
3212
3247
|
[index: string]: any;
|
|
3213
3248
|
}>): string[];
|
|
3214
3249
|
|
|
3250
|
+
/**
|
|
3251
|
+
* Stable error when a cart-management bot response does not match
|
|
3252
|
+
* {@link MedicationCartManageResponse}.
|
|
3253
|
+
*/
|
|
3254
|
+
export declare const INVALID_MEDICATION_CART_RESPONSE = "Invalid response from cart-management bot";
|
|
3255
|
+
|
|
3256
|
+
/**
|
|
3257
|
+
* Stable error when a checkout-medications bot response does not match
|
|
3258
|
+
* {@link MedicationCheckoutResponse}.
|
|
3259
|
+
*/
|
|
3260
|
+
export declare const INVALID_MEDICATION_CHECKOUT_RESPONSE = "Invalid response from checkout-medications bot";
|
|
3261
|
+
|
|
3215
3262
|
/**
|
|
3216
3263
|
* Stable error when a bot response does not match {@link MedicationOrderResponse}.
|
|
3217
3264
|
*/
|
|
@@ -3274,6 +3321,13 @@ export declare interface IReconnectingWebSocketCtor {
|
|
|
3274
3321
|
|
|
3275
3322
|
export declare function isAccepted(outcome: OperationOutcome): boolean;
|
|
3276
3323
|
|
|
3324
|
+
/**
|
|
3325
|
+
* Type guard for a valid HL7 acknowledgment code (MSA-1).
|
|
3326
|
+
* @param value - The candidate code (already upper-cased, if applicable).
|
|
3327
|
+
* @returns True if `value` is one of the recognized `AckCode` values.
|
|
3328
|
+
*/
|
|
3329
|
+
export declare function isAckCode(value: string | undefined): value is AckCode;
|
|
3330
|
+
|
|
3277
3331
|
/**
|
|
3278
3332
|
* Type guard to validate an add pharmacy bot response.
|
|
3279
3333
|
* @param value - The value to check.
|
|
@@ -3408,6 +3462,20 @@ export declare function isLowerCase(c: string): boolean;
|
|
|
3408
3462
|
*/
|
|
3409
3463
|
export declare function isMedicationArray(value: unknown): value is Medication[];
|
|
3410
3464
|
|
|
3465
|
+
/**
|
|
3466
|
+
* Type guard: validates a cart-management bot response.
|
|
3467
|
+
* @param value - Unknown bot JSON payload.
|
|
3468
|
+
* @returns True when the value matches {@link MedicationCartManageResponse}.
|
|
3469
|
+
*/
|
|
3470
|
+
export declare function isMedicationCartManageResponse(value: unknown): value is MedicationCartManageResponse;
|
|
3471
|
+
|
|
3472
|
+
/**
|
|
3473
|
+
* Type guard: validates a checkout-medications bot response.
|
|
3474
|
+
* @param value - Unknown bot JSON payload.
|
|
3475
|
+
* @returns True when the value matches {@link MedicationCheckoutResponse}.
|
|
3476
|
+
*/
|
|
3477
|
+
export declare function isMedicationCheckoutResponse(value: unknown): value is MedicationCheckoutResponse;
|
|
3478
|
+
|
|
3411
3479
|
/**
|
|
3412
3480
|
* Type guard: validates an order-medication bot response.
|
|
3413
3481
|
* @param value - Unknown bot JSON payload.
|
|
@@ -3629,7 +3697,7 @@ export declare function isValidHostname(input: string): boolean;
|
|
|
3629
3697
|
* @param version - A version string that should be tested for valid semver semantics.
|
|
3630
3698
|
* @returns `true` if `version` is a valid semver version that conforms to the Medplum versioning system, otherwise `false`.
|
|
3631
3699
|
*/
|
|
3632
|
-
export declare function isValidMedplumSemver(version: string):
|
|
3700
|
+
export declare function isValidMedplumSemver(version: string): version is MedplumSemver;
|
|
3633
3701
|
|
|
3634
3702
|
/**
|
|
3635
3703
|
* Generic interface that an implementation of `WebSocket` must satisfy to be used with `ReconnectingWebSocket`.
|
|
@@ -3987,6 +4055,126 @@ export declare const MEDICATION_REQUEST_STATUS_REASON_RESPONSE_NOT_RECEIVED = "r
|
|
|
3987
4055
|
*/
|
|
3988
4056
|
export declare const MEDICATION_REQUEST_STATUS_REASON_SYSTEM = "https://medplum.com/fhir/CodeSystem/medication-request-status-reason";
|
|
3989
4057
|
|
|
4058
|
+
/**
|
|
4059
|
+
* Vendor-neutral input to clear the patient's whole vendor cart (`$clear-cart`).
|
|
4060
|
+
*/
|
|
4061
|
+
export declare interface MedicationCartClearRequest {
|
|
4062
|
+
readonly patientId: string;
|
|
4063
|
+
}
|
|
4064
|
+
|
|
4065
|
+
/**
|
|
4066
|
+
* Encodes a {@link MedicationCartClearRequest} as a FHIR `Parameters` body for
|
|
4067
|
+
* the `$clear-cart` custom operation. Emits the `action: 'clear'` discriminator.
|
|
4068
|
+
*
|
|
4069
|
+
* @param req - Clear request (vendor-neutral).
|
|
4070
|
+
* @returns A `Parameters` resource ready to POST.
|
|
4071
|
+
*/
|
|
4072
|
+
export declare function medicationCartClearRequestToParameters(req: MedicationCartClearRequest): Parameters_2;
|
|
4073
|
+
|
|
4074
|
+
/**
|
|
4075
|
+
* Per-item outcome from a cart remove/clear. `removed` = the vendor cart item
|
|
4076
|
+
* was deleted; `not-in-cart` = the draft was not staged (nothing to remove);
|
|
4077
|
+
* `failed` = the vendor delete failed (see `error`).
|
|
4078
|
+
*/
|
|
4079
|
+
export declare interface MedicationCartItemResult {
|
|
4080
|
+
readonly medicationRequestId?: string;
|
|
4081
|
+
/** Vendor cart-item reference that was removed (ScriptSure MedCart `rxId`), when known. */
|
|
4082
|
+
readonly vendorLineId?: string;
|
|
4083
|
+
readonly status: 'removed' | 'not-in-cart' | 'failed';
|
|
4084
|
+
readonly error?: string;
|
|
4085
|
+
}
|
|
4086
|
+
|
|
4087
|
+
/**
|
|
4088
|
+
* Vendor-neutral output from a cart remove/clear: the vendor patient id, the
|
|
4089
|
+
* number of cart items actually removed, and the per-line outcomes (one for a
|
|
4090
|
+
* remove, N for a clear).
|
|
4091
|
+
*/
|
|
4092
|
+
export declare interface MedicationCartManageResponse {
|
|
4093
|
+
/** Vendor-side patient id (numeric in ScriptSure today). */
|
|
4094
|
+
readonly vendorPatientId: number;
|
|
4095
|
+
readonly removedCount: number;
|
|
4096
|
+
readonly items: MedicationCartItemResult[];
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
/**
|
|
4100
|
+
* Vendor-neutral input to remove a single draft `MedicationRequest` from the
|
|
4101
|
+
* patient's vendor cart (`$remove-cart-medication`).
|
|
4102
|
+
*/
|
|
4103
|
+
export declare interface MedicationCartRemoveRequest {
|
|
4104
|
+
readonly patientId: string;
|
|
4105
|
+
readonly medicationRequestId: string;
|
|
4106
|
+
}
|
|
4107
|
+
|
|
4108
|
+
/**
|
|
4109
|
+
* Encodes a {@link MedicationCartRemoveRequest} as a FHIR `Parameters` body for
|
|
4110
|
+
* the `$remove-cart-medication` custom operation. Emits the `action: 'remove'`
|
|
4111
|
+
* discriminator the shared cart-management bot dispatches on.
|
|
4112
|
+
*
|
|
4113
|
+
* @param req - Remove request (vendor-neutral).
|
|
4114
|
+
* @returns A `Parameters` resource ready to POST.
|
|
4115
|
+
*/
|
|
4116
|
+
export declare function medicationCartRemoveRequestToParameters(req: MedicationCartRemoveRequest): Parameters_2;
|
|
4117
|
+
|
|
4118
|
+
/**
|
|
4119
|
+
* Per-line outcome from a cart checkout. A single bad line is reported here as
|
|
4120
|
+
* `failed` rather than rolling back the lines that already queued.
|
|
4121
|
+
*/
|
|
4122
|
+
export declare interface MedicationCheckoutItemResult {
|
|
4123
|
+
readonly medicationRequestId: string;
|
|
4124
|
+
/**
|
|
4125
|
+
* Vendor per-line reference returned at checkout, for diagnostics/audit. The
|
|
4126
|
+
* concrete meaning is vendor-specific: a cart-item id for cart-based vendors
|
|
4127
|
+
* (ScriptSure MedCart `rxId`) or a per-prescription id for queue-based ones.
|
|
4128
|
+
* Optional because the vendor may not mint one at add time.
|
|
4129
|
+
*/
|
|
4130
|
+
readonly vendorLineId?: string;
|
|
4131
|
+
readonly status: 'queued' | 'failed';
|
|
4132
|
+
/**
|
|
4133
|
+
* True when the line was **not** added because the same drug was already in
|
|
4134
|
+
* the vendor's cart (the vendor-recommended duplicate check matched). Reported
|
|
4135
|
+
* as `status: 'queued'` with this flag set so the caller can surface it.
|
|
4136
|
+
*/
|
|
4137
|
+
readonly duplicate?: boolean;
|
|
4138
|
+
readonly error?: string;
|
|
4139
|
+
}
|
|
4140
|
+
|
|
4141
|
+
/**
|
|
4142
|
+
* Vendor-neutral input for a cart-checkout bot: submit a set of draft
|
|
4143
|
+
* `MedicationRequest`s (the cart) to the vendor's electronic approval queue.
|
|
4144
|
+
*/
|
|
4145
|
+
export declare interface MedicationCheckoutRequest {
|
|
4146
|
+
readonly patientId: string;
|
|
4147
|
+
readonly medicationRequestIds: string[];
|
|
4148
|
+
readonly appId?: string;
|
|
4149
|
+
/** Selected practice location; omit for single-practice prescribers. */
|
|
4150
|
+
readonly organization?: Reference<Organization>;
|
|
4151
|
+
}
|
|
4152
|
+
|
|
4153
|
+
/**
|
|
4154
|
+
* Encodes a {@link MedicationCheckoutRequest} as a FHIR `Parameters` body for
|
|
4155
|
+
* the vendor-neutral `$checkout-medications` custom operation
|
|
4156
|
+
* (`POST /fhir/R4/MedicationRequest/$checkout-medications`).
|
|
4157
|
+
*
|
|
4158
|
+
* `medicationRequestIds` is emitted as one `parameter` entry per id so the
|
|
4159
|
+
* OperationDefinition's `max: '*'` cardinality round-trips. Optional fields are
|
|
4160
|
+
* omitted entirely.
|
|
4161
|
+
*
|
|
4162
|
+
* @param req - Cart checkout request (vendor-neutral).
|
|
4163
|
+
* @returns A `Parameters` resource ready to POST.
|
|
4164
|
+
*/
|
|
4165
|
+
export declare function medicationCheckoutRequestToParameters(req: MedicationCheckoutRequest): Parameters_2;
|
|
4166
|
+
|
|
4167
|
+
/**
|
|
4168
|
+
* Vendor-neutral output from a cart-checkout bot: a single embeddable approval
|
|
4169
|
+
* widget URL (the vendor's batch sign-off surface) plus per-line results.
|
|
4170
|
+
*/
|
|
4171
|
+
export declare interface MedicationCheckoutResponse {
|
|
4172
|
+
readonly approvalUrl: string;
|
|
4173
|
+
/** Vendor-side patient id (numeric in ScriptSure today). */
|
|
4174
|
+
readonly vendorPatientId: number;
|
|
4175
|
+
readonly items: MedicationCheckoutItemResult[];
|
|
4176
|
+
}
|
|
4177
|
+
|
|
3990
4178
|
/**
|
|
3991
4179
|
* Vendor-neutral drug line for {@link MedicationOrderRequest}.
|
|
3992
4180
|
*/
|
|
@@ -4010,6 +4198,14 @@ export declare interface MedicationOrderExtensions {
|
|
|
4010
4198
|
readonly pendingOrderIdSystem: string;
|
|
4011
4199
|
readonly pendingOrderStatusUrl: string;
|
|
4012
4200
|
readonly iframeUrlExtension: string;
|
|
4201
|
+
/**
|
|
4202
|
+
* Identifier system for the vendor's per-prescription message id (SureScripts
|
|
4203
|
+
* `messageId` in ScriptSure). Stamped on a draft `MedicationRequest` by the
|
|
4204
|
+
* cart-checkout flow and used to reconcile the approval webhook back to the
|
|
4205
|
+
* draft. Optional so existing single-order consumers don't have to populate it.
|
|
4206
|
+
* Consumed by the paired `medplum-ee` cart-checkout / prescription-webhook bots.
|
|
4207
|
+
*/
|
|
4208
|
+
readonly messageIdSystem?: string;
|
|
4013
4209
|
}
|
|
4014
4210
|
|
|
4015
4211
|
/**
|
|
@@ -4047,6 +4243,8 @@ export declare interface MedicationOrderRequest {
|
|
|
4047
4243
|
/** Free-text patient instructions (additional sig); maps to dosageInstruction[0].patientInstruction when using MR path. */
|
|
4048
4244
|
readonly patientInstruction?: string;
|
|
4049
4245
|
readonly appId?: string;
|
|
4246
|
+
/** Selected practice location for multi-practice deployments. */
|
|
4247
|
+
readonly organization?: Reference<Organization>;
|
|
4050
4248
|
}
|
|
4051
4249
|
|
|
4052
4250
|
/**
|
|
@@ -4096,6 +4294,8 @@ export declare interface MedicationOrderSetRequest {
|
|
|
4096
4294
|
*/
|
|
4097
4295
|
readonly vendorOrderSetId?: number | string;
|
|
4098
4296
|
readonly appId?: string;
|
|
4297
|
+
/** Selected practice location for multi-practice deployments. */
|
|
4298
|
+
readonly organization?: Reference<Organization>;
|
|
4099
4299
|
}
|
|
4100
4300
|
|
|
4101
4301
|
/**
|
|
@@ -4162,6 +4362,8 @@ export declare const MEDPLUM_CLI_CLIENT_ID = "medplum-cli";
|
|
|
4162
4362
|
|
|
4163
4363
|
export declare const MEDPLUM_RELEASES_URL = "https://meta.medplum.com/releases";
|
|
4164
4364
|
|
|
4365
|
+
export declare const MEDPLUM_SEMVER_REGEX: RegExp;
|
|
4366
|
+
|
|
4165
4367
|
export declare const MEDPLUM_VERSION: string;
|
|
4166
4368
|
|
|
4167
4369
|
/**
|
|
@@ -4360,6 +4562,28 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
4360
4562
|
* @param resourceType - The resource type to invalidate.
|
|
4361
4563
|
*/
|
|
4362
4564
|
invalidateSearches(resourceType: ResourceType): void;
|
|
4565
|
+
/**
|
|
4566
|
+
* Notifies listeners that a resource was modified outside of the standard CRUD methods,
|
|
4567
|
+
* and invalidates the relevant cached values.
|
|
4568
|
+
*
|
|
4569
|
+
* The client emits the `resourceModified` event automatically for `createResource`,
|
|
4570
|
+
* `updateResource`, `patchResource`, `deleteResource`, and related methods. Use this method
|
|
4571
|
+
* to announce modifications the client cannot classify itself, such as custom operations,
|
|
4572
|
+
* GraphQL mutations, or out-of-band changes:
|
|
4573
|
+
*
|
|
4574
|
+
* ```typescript
|
|
4575
|
+
* await medplum.post(medplum.fhirUrl('Appointment', '$book'), parameters);
|
|
4576
|
+
* medplum.notifyResourceModified({ resourceType: 'Appointment', operation: 'create' });
|
|
4577
|
+
* medplum.notifyResourceModified({ resourceType: 'Slot', operation: 'update' });
|
|
4578
|
+
* ```
|
|
4579
|
+
*
|
|
4580
|
+
* Cached searches for the resource type are invalidated. If `event.resource` is provided
|
|
4581
|
+
* for a non-delete operation, it becomes the cached read value; otherwise, if `event.id`
|
|
4582
|
+
* is provided, the cached read is invalidated.
|
|
4583
|
+
* @category Caching
|
|
4584
|
+
* @param event - The resource modification to announce.
|
|
4585
|
+
*/
|
|
4586
|
+
notifyResourceModified(event: ResourceModifiedEvent): void;
|
|
4363
4587
|
/**
|
|
4364
4588
|
* Makes an HTTP GET request to the specified URL.
|
|
4365
4589
|
*
|
|
@@ -5533,6 +5757,11 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
5533
5757
|
* @param key - The cache key to delete.
|
|
5534
5758
|
*/
|
|
5535
5759
|
private deleteCacheEntry;
|
|
5760
|
+
/**
|
|
5761
|
+
* Dispatches a `resourceModified` event if there are any listeners.
|
|
5762
|
+
* @param payload - The event payload.
|
|
5763
|
+
*/
|
|
5764
|
+
private dispatchResourceModified;
|
|
5536
5765
|
/**
|
|
5537
5766
|
* Makes an HTTP request.
|
|
5538
5767
|
* @param url - The target URL.
|
|
@@ -5592,8 +5821,8 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
|
|
|
5592
5821
|
/**
|
|
5593
5822
|
* Handles an unauthenticated (HTTP 401) response from the server.
|
|
5594
5823
|
*
|
|
5595
|
-
* Bounded and terminal: at most
|
|
5596
|
-
* + 1 recovery, tracked via
|
|
5824
|
+
* Bounded and terminal: at most `MAX_AUTH_ATTEMPTS` attempts per request (1 initial
|
|
5825
|
+
* + 1 recovery, tracked via `RequestState.authAttempt`). The recovery re-mints via a
|
|
5597
5826
|
* forced {@link MedplumClient.refresh} (bypassing the {@link MedplumClient.isAuthenticated}
|
|
5598
5827
|
* short-circuit on the rejected token), single-flight so concurrent 401s share one re-mint.
|
|
5599
5828
|
* A second 401 is terminal: clear auth, `onUnauthenticated`, reject — never recurse.
|
|
@@ -5943,6 +6172,10 @@ export declare type MedplumClientEventMap = {
|
|
|
5943
6172
|
error: Error;
|
|
5944
6173
|
};
|
|
5945
6174
|
};
|
|
6175
|
+
resourceModified: {
|
|
6176
|
+
type: 'resourceModified';
|
|
6177
|
+
payload: ResourceModifiedEvent;
|
|
6178
|
+
};
|
|
5946
6179
|
};
|
|
5947
6180
|
|
|
5948
6181
|
/**
|
|
@@ -6435,6 +6668,8 @@ export declare interface MedplumRequestOptions extends RequestInit {
|
|
|
6435
6668
|
duplex?: 'half';
|
|
6436
6669
|
}
|
|
6437
6670
|
|
|
6671
|
+
export declare type MedplumSemver = `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}`;
|
|
6672
|
+
|
|
6438
6673
|
export declare interface MedplumSourceInfraConfig {
|
|
6439
6674
|
name: ValueOrExternalSecret<string>;
|
|
6440
6675
|
stackName: ValueOrExternalSecret<string>;
|
|
@@ -6979,11 +7214,66 @@ export declare class OrAtom extends InfixOperatorAtom {
|
|
|
6979
7214
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
6980
7215
|
}
|
|
6981
7216
|
|
|
7217
|
+
/**
|
|
7218
|
+
* Vendor-neutral decoded response from the `$sync-orderset` custom operation
|
|
7219
|
+
* (`POST /fhir/R4/PlanDefinition/$sync-orderset`). `failedCount > 0` means the
|
|
7220
|
+
* synced vendor order set carries fewer meds than the `PlanDefinition`.
|
|
7221
|
+
*/
|
|
7222
|
+
export declare interface OrderSetSyncResponse {
|
|
7223
|
+
readonly mode: 'created' | 'noop-already-synced';
|
|
7224
|
+
readonly planDefinitionId?: string;
|
|
7225
|
+
readonly scriptSureOrdersetId?: number;
|
|
7226
|
+
readonly syncedCount: number;
|
|
7227
|
+
readonly failedCount: number;
|
|
7228
|
+
readonly results: OrderSetSyncSequenceResult[];
|
|
7229
|
+
}
|
|
7230
|
+
|
|
7231
|
+
/**
|
|
7232
|
+
* Per-action outcome from the vendor-neutral `$sync-orderset` operation. A
|
|
7233
|
+
* `'failed'` row carries `error` and was NOT added to the vendor order set, so
|
|
7234
|
+
* a later apply/signing session would open with fewer meds than the
|
|
7235
|
+
* `PlanDefinition` requested — callers must surface these.
|
|
7236
|
+
*/
|
|
7237
|
+
export declare interface OrderSetSyncSequenceResult {
|
|
7238
|
+
readonly actionTitle?: string;
|
|
7239
|
+
readonly activityDefinitionUrl?: string;
|
|
7240
|
+
readonly scriptSureSequenceId?: number;
|
|
7241
|
+
readonly scriptSureOrderId?: number;
|
|
7242
|
+
readonly status: 'synced' | 'failed';
|
|
7243
|
+
readonly error?: string;
|
|
7244
|
+
}
|
|
7245
|
+
|
|
6982
7246
|
/**
|
|
6983
7247
|
* SQL on FHIR output row.
|
|
6984
7248
|
*/
|
|
6985
7249
|
export declare type OutputRow = Record<string, any>;
|
|
6986
7250
|
|
|
7251
|
+
/**
|
|
7252
|
+
* Decodes the `Parameters` response from the `$remove-cart-medication` /
|
|
7253
|
+
* `$clear-cart` custom operations into a typed {@link MedicationCartManageResponse}.
|
|
7254
|
+
* Throws {@link INVALID_MEDICATION_CART_RESPONSE} when required top-level fields
|
|
7255
|
+
* are missing.
|
|
7256
|
+
*
|
|
7257
|
+
* @param params - The `Parameters` resource returned by the operation.
|
|
7258
|
+
* @returns A vendor-neutral {@link MedicationCartManageResponse}.
|
|
7259
|
+
*/
|
|
7260
|
+
export declare function parametersToMedicationCartManageResponse(params: Parameters_2): MedicationCartManageResponse;
|
|
7261
|
+
|
|
7262
|
+
/**
|
|
7263
|
+
* Decodes the `Parameters` response from the `$checkout-medications` custom
|
|
7264
|
+
* operation into a typed {@link MedicationCheckoutResponse}. Throws
|
|
7265
|
+
* `INVALID_MEDICATION_CHECKOUT_RESPONSE` when required top-level fields are
|
|
7266
|
+
* missing.
|
|
7267
|
+
*
|
|
7268
|
+
* The repeating `items` parameter is collected across every occurrence (each is
|
|
7269
|
+
* one queued/failed line); the scalar `approvalUrl` / `vendorPatientId` are read
|
|
7270
|
+
* once.
|
|
7271
|
+
*
|
|
7272
|
+
* @param params - The `Parameters` resource returned by the operation.
|
|
7273
|
+
* @returns A vendor-neutral {@link MedicationCheckoutResponse}.
|
|
7274
|
+
*/
|
|
7275
|
+
export declare function parametersToMedicationCheckoutResponse(params: Parameters_2): MedicationCheckoutResponse;
|
|
7276
|
+
|
|
6987
7277
|
/**
|
|
6988
7278
|
* Decodes the `Parameters` response from the `$order-medication` custom
|
|
6989
7279
|
* operation into a typed {@link MedicationOrderResponse}. Throws
|
|
@@ -7008,6 +7298,16 @@ export declare function parametersToMedicationOrderResponse(params: Parameters_2
|
|
|
7008
7298
|
*/
|
|
7009
7299
|
export declare function parametersToMedicationOrderSetResponse(params: Parameters_2): MedicationOrderSetResponse;
|
|
7010
7300
|
|
|
7301
|
+
/**
|
|
7302
|
+
* Decodes the `Parameters` response from the `$sync-orderset` custom operation
|
|
7303
|
+
* into a typed {@link OrderSetSyncResponse}, including the repeating per-action
|
|
7304
|
+
* `results` rows the server previously dropped.
|
|
7305
|
+
*
|
|
7306
|
+
* @param params - The `Parameters` resource returned by the operation.
|
|
7307
|
+
* @returns A vendor-neutral {@link OrderSetSyncResponse}.
|
|
7308
|
+
*/
|
|
7309
|
+
export declare function parametersToOrderSetSyncResponse(params: Parameters_2): OrderSetSyncResponse;
|
|
7310
|
+
|
|
7011
7311
|
/**
|
|
7012
7312
|
* Parses a FHIRPath expression into an AST.
|
|
7013
7313
|
* The result can be used to evaluate the expression against a resource or other object.
|
|
@@ -7193,6 +7493,8 @@ export declare class ParserBuilder {
|
|
|
7193
7493
|
address?: string;
|
|
7194
7494
|
phoneOrFax?: string;
|
|
7195
7495
|
ncpdpID?: string;
|
|
7496
|
+
/** Selected practice location for multi-practice deployments. */
|
|
7497
|
+
organization?: Reference<Organization>;
|
|
7196
7498
|
}
|
|
7197
7499
|
|
|
7198
7500
|
/**
|
|
@@ -7765,6 +8067,29 @@ export declare class ParserBuilder {
|
|
|
7765
8067
|
|
|
7766
8068
|
export declare function resourceMatchesSubscriptionCriteria({ resource, subscription, context, getPreviousResource, logger, }: ResourceMatchesSubscriptionCriteria): Promise<boolean>;
|
|
7767
8069
|
|
|
8070
|
+
/**
|
|
8071
|
+
* Payload of the `resourceModified` event, emitted after this client instance successfully
|
|
8072
|
+
* creates, updates, patches, or deletes a FHIR resource.
|
|
8073
|
+
*
|
|
8074
|
+
* Emitted by `createResource`, `createResourceIfNoneExist`, `updateResource`, `upsertResource`,
|
|
8075
|
+
* `patchResource`, `deleteResource`, and by `notifyResourceModified`.
|
|
8076
|
+
* Conditional methods (`createResourceIfNoneExist`, `upsertResource`) emit
|
|
8077
|
+
* even when the server made no change, except on HTTP 304 "Not Modified".
|
|
8078
|
+
*
|
|
8079
|
+
* @template T - The type of the modified resource. Defaults to `Resource`; narrow it (e.g. via
|
|
8080
|
+
* `useResourceModified('Slot', ...)`) to get a typed `resource` payload without extra guards.
|
|
8081
|
+
*/
|
|
8082
|
+
export declare interface ResourceModifiedEvent<T extends Resource = Resource> {
|
|
8083
|
+
/** The type of the modified resource. */
|
|
8084
|
+
resourceType: T['resourceType'];
|
|
8085
|
+
/** How the resource was modified. */
|
|
8086
|
+
operation: 'create' | 'update' | 'patch' | 'delete';
|
|
8087
|
+
/** The resource id, when known. */
|
|
8088
|
+
id?: string;
|
|
8089
|
+
/** The server-returned resource, when available. Undefined for deletes. */
|
|
8090
|
+
resource?: WithId<T>;
|
|
8091
|
+
}
|
|
8092
|
+
|
|
7768
8093
|
export declare type ResourceWithCode = Resource & Code;
|
|
7769
8094
|
|
|
7770
8095
|
export declare const ReturnAckCategory: {
|