@medplum/core 3.2.23 → 3.2.25

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.
@@ -217,7 +217,7 @@ export declare class ArithemticOperatorAtom extends BooleanInfixOperatorAtom {
217
217
  * @param arrayBuffer - The input array buffer.
218
218
  * @returns The base-64 encoded string.
219
219
  */
220
- export declare function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
220
+ export declare function arrayBufferToBase64(arrayBuffer: ArrayBufferLike | ArrayBufferView): string;
221
221
 
222
222
  /**
223
223
  * Converts an ArrayBuffer to hex string.
@@ -225,7 +225,7 @@ export declare function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
225
225
  * @param arrayBuffer - The input array buffer.
226
226
  * @returns The resulting hex string.
227
227
  */
228
- export declare function arrayBufferToHex(arrayBuffer: ArrayBuffer): string;
228
+ export declare function arrayBufferToHex(arrayBuffer: ArrayBufferLike | ArrayBufferView): string;
229
229
 
230
230
  export declare function arrayify<T>(value: T | T[] | undefined): T[] | undefined;
231
231
 
@@ -501,7 +501,7 @@ export declare interface ConceptMapTranslateParameters {
501
501
  targetsystem?: string;
502
502
  }
503
503
 
504
- export declare function conflict(details: string): OperationOutcome;
504
+ export declare function conflict(details: string, code?: string): OperationOutcome;
505
505
 
506
506
  export declare interface Constraint {
507
507
  key: string;
@@ -2807,6 +2807,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2807
2807
  private readonly tokenUrl;
2808
2808
  private readonly logoutUrl;
2809
2809
  private readonly fhircastHubUrl;
2810
+ private readonly defaultHeaders;
2810
2811
  private readonly onUnauthenticated?;
2811
2812
  private readonly autoBatchTime;
2812
2813
  private readonly autoBatchQueue;
@@ -2877,6 +2878,13 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2877
2878
  * @returns The current FHIRcast Hub URL.
2878
2879
  */
2879
2880
  getFhircastHubUrl(): string;
2881
+ /**
2882
+ * Returns default headers to include in all requests.
2883
+ * This can be used to set custom headers such as Cookies or Authorization headers.
2884
+ * @category HTTP
2885
+ * @returns Default headers to include in all requests.
2886
+ */
2887
+ getDefaultHeaders(): Record<string, string>;
2880
2888
  /**
2881
2889
  * Clears all auth state including local storage and session storage.
2882
2890
  * @category Authentication
@@ -4513,6 +4521,12 @@ export declare interface MedplumClientOptions {
4513
4521
  * Default is true.
4514
4522
  */
4515
4523
  extendedMode?: boolean;
4524
+ /**
4525
+ * Default headers to include in all requests.
4526
+ * This can be used to set custom headers such as Cookies or Authorization headers.
4527
+ * @default {}
4528
+ */
4529
+ defaultHeaders?: Record<string, string>;
4516
4530
  }
4517
4531
 
4518
4532
  export declare interface MedplumInfraConfig {
@@ -4773,6 +4787,8 @@ export declare class MockAsyncClientStorage extends ClientStorage implements ICl
4773
4787
 
4774
4788
  export declare const multipleMatches: OperationOutcome;
4775
4789
 
4790
+ export declare const NDC = "http://hl7.org/fhir/sid/ndc";
4791
+
4776
4792
  export declare interface NewPatientRequest {
4777
4793
  readonly login: string;
4778
4794
  readonly projectId: string;
@@ -4795,6 +4811,17 @@ export declare interface NewUserRequest {
4795
4811
  readonly clientId?: string;
4796
4812
  }
4797
4813
 
4814
+ /**
4815
+ * Normalizes an `ArrayBufferLike` (eg. an `ArrayBuffer`) to a raw `ArrayBufferLike` (without a view). If the passed buffer is a view, it gives the raw `ArrayBufferLike`.
4816
+ *
4817
+ * This is useful in cases where you need to operate on the raw bytes of an `ArrayBuffer` where a `TypedArray` (eg. `Uint32Array`) might be passed in.
4818
+ * This ensures that you will always operate on the raw bytes rather than accidentally truncating the input by operating on the elements of the view.
4819
+ *
4820
+ * @param typedArrayOrBuffer - The `ArrayBufferLike` (either `TypedArray` or raw `ArrayBuffer`) to normalize to raw `ArrayBuffer`.
4821
+ * @returns The raw `ArrayBuffer` without a view.
4822
+ */
4823
+ export declare function normalizeArrayBufferView(typedArrayOrBuffer: ArrayBufferLike | ArrayBufferView): ArrayBufferLike;
4824
+
4798
4825
  export declare function normalizeCreateBinaryOptions(arg1: BinarySource | CreateBinaryOptions, arg2: string | undefined | MedplumRequestOptions, arg3?: string, arg4?: (e: ProgressEvent) => void): CreateBinaryOptions;
4799
4826
 
4800
4827
  export declare function normalizeCreatePdfOptions(arg1: TDocumentDefinitions | CreatePdfOptions, arg2: string | undefined | MedplumRequestOptions, arg3: Record<string, CustomTableLayout> | undefined, arg4: TFontDictionary | undefined): CreatePdfOptions;
@@ -4914,6 +4941,7 @@ export declare enum Operator {
4914
4941
  ENDS_BEFORE = "eb",
4915
4942
  APPROXIMATELY = "ap",
4916
4943
  CONTAINS = "contains",
4944
+ STARTS_WITH = "sw",
4917
4945
  EXACT = "exact",
4918
4946
  TEXT = "text",
4919
4947
  NOT = "not",
@@ -217,7 +217,7 @@ export declare class ArithemticOperatorAtom extends BooleanInfixOperatorAtom {
217
217
  * @param arrayBuffer - The input array buffer.
218
218
  * @returns The base-64 encoded string.
219
219
  */
220
- export declare function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
220
+ export declare function arrayBufferToBase64(arrayBuffer: ArrayBufferLike | ArrayBufferView): string;
221
221
 
222
222
  /**
223
223
  * Converts an ArrayBuffer to hex string.
@@ -225,7 +225,7 @@ export declare function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
225
225
  * @param arrayBuffer - The input array buffer.
226
226
  * @returns The resulting hex string.
227
227
  */
228
- export declare function arrayBufferToHex(arrayBuffer: ArrayBuffer): string;
228
+ export declare function arrayBufferToHex(arrayBuffer: ArrayBufferLike | ArrayBufferView): string;
229
229
 
230
230
  export declare function arrayify<T>(value: T | T[] | undefined): T[] | undefined;
231
231
 
@@ -501,7 +501,7 @@ export declare interface ConceptMapTranslateParameters {
501
501
  targetsystem?: string;
502
502
  }
503
503
 
504
- export declare function conflict(details: string): OperationOutcome;
504
+ export declare function conflict(details: string, code?: string): OperationOutcome;
505
505
 
506
506
  export declare interface Constraint {
507
507
  key: string;
@@ -2807,6 +2807,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2807
2807
  private readonly tokenUrl;
2808
2808
  private readonly logoutUrl;
2809
2809
  private readonly fhircastHubUrl;
2810
+ private readonly defaultHeaders;
2810
2811
  private readonly onUnauthenticated?;
2811
2812
  private readonly autoBatchTime;
2812
2813
  private readonly autoBatchQueue;
@@ -2877,6 +2878,13 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2877
2878
  * @returns The current FHIRcast Hub URL.
2878
2879
  */
2879
2880
  getFhircastHubUrl(): string;
2881
+ /**
2882
+ * Returns default headers to include in all requests.
2883
+ * This can be used to set custom headers such as Cookies or Authorization headers.
2884
+ * @category HTTP
2885
+ * @returns Default headers to include in all requests.
2886
+ */
2887
+ getDefaultHeaders(): Record<string, string>;
2880
2888
  /**
2881
2889
  * Clears all auth state including local storage and session storage.
2882
2890
  * @category Authentication
@@ -4513,6 +4521,12 @@ export declare interface MedplumClientOptions {
4513
4521
  * Default is true.
4514
4522
  */
4515
4523
  extendedMode?: boolean;
4524
+ /**
4525
+ * Default headers to include in all requests.
4526
+ * This can be used to set custom headers such as Cookies or Authorization headers.
4527
+ * @default {}
4528
+ */
4529
+ defaultHeaders?: Record<string, string>;
4516
4530
  }
4517
4531
 
4518
4532
  export declare interface MedplumInfraConfig {
@@ -4773,6 +4787,8 @@ export declare class MockAsyncClientStorage extends ClientStorage implements ICl
4773
4787
 
4774
4788
  export declare const multipleMatches: OperationOutcome;
4775
4789
 
4790
+ export declare const NDC = "http://hl7.org/fhir/sid/ndc";
4791
+
4776
4792
  export declare interface NewPatientRequest {
4777
4793
  readonly login: string;
4778
4794
  readonly projectId: string;
@@ -4795,6 +4811,17 @@ export declare interface NewUserRequest {
4795
4811
  readonly clientId?: string;
4796
4812
  }
4797
4813
 
4814
+ /**
4815
+ * Normalizes an `ArrayBufferLike` (eg. an `ArrayBuffer`) to a raw `ArrayBufferLike` (without a view). If the passed buffer is a view, it gives the raw `ArrayBufferLike`.
4816
+ *
4817
+ * This is useful in cases where you need to operate on the raw bytes of an `ArrayBuffer` where a `TypedArray` (eg. `Uint32Array`) might be passed in.
4818
+ * This ensures that you will always operate on the raw bytes rather than accidentally truncating the input by operating on the elements of the view.
4819
+ *
4820
+ * @param typedArrayOrBuffer - The `ArrayBufferLike` (either `TypedArray` or raw `ArrayBuffer`) to normalize to raw `ArrayBuffer`.
4821
+ * @returns The raw `ArrayBuffer` without a view.
4822
+ */
4823
+ export declare function normalizeArrayBufferView(typedArrayOrBuffer: ArrayBufferLike | ArrayBufferView): ArrayBufferLike;
4824
+
4798
4825
  export declare function normalizeCreateBinaryOptions(arg1: BinarySource | CreateBinaryOptions, arg2: string | undefined | MedplumRequestOptions, arg3?: string, arg4?: (e: ProgressEvent) => void): CreateBinaryOptions;
4799
4826
 
4800
4827
  export declare function normalizeCreatePdfOptions(arg1: TDocumentDefinitions | CreatePdfOptions, arg2: string | undefined | MedplumRequestOptions, arg3: Record<string, CustomTableLayout> | undefined, arg4: TFontDictionary | undefined): CreatePdfOptions;
@@ -4914,6 +4941,7 @@ export declare enum Operator {
4914
4941
  ENDS_BEFORE = "eb",
4915
4942
  APPROXIMATELY = "ap",
4916
4943
  CONTAINS = "contains",
4944
+ STARTS_WITH = "sw",
4917
4945
  EXACT = "exact",
4918
4946
  TEXT = "text",
4919
4947
  NOT = "not",