@medplum/core 3.2.9 → 3.2.11

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.
@@ -668,7 +668,7 @@ export declare interface CreateMediaOptions extends CreateBinaryOptions {
668
668
  export declare function createOperationOutcomeIssue(severity: IssueSeverity, code: IssueType, message: string, path: string, data?: Record<string, any>): OperationOutcomeIssue;
669
669
 
670
670
  export declare interface CreatePdfFunction {
671
- (docDefinition: TDocumentDefinitions, tableLayouts?: Record<string, CustomTableLayout> | undefined, fonts?: TFontDictionary | undefined): Promise<any>;
671
+ (docDefinition: TDocumentDefinitions, tableLayouts?: Record<string, CustomTableLayout>, fonts?: TFontDictionary): Promise<any>;
672
672
  }
673
673
 
674
674
  /**
@@ -1367,9 +1367,10 @@ export declare function formatCodeableConcept(codeableConcept: CodeableConcept |
1367
1367
  /**
1368
1368
  * Formats a Coding element as a string.
1369
1369
  * @param coding - A FHIR Coding element
1370
+ * @param includeCode - If true, includes both the code and display if available
1370
1371
  * @returns The coding as a string.
1371
1372
  */
1372
- export declare function formatCoding(coding: Coding | undefined): string;
1373
+ export declare function formatCoding(coding: Coding | undefined, includeCode?: boolean): string;
1373
1374
 
1374
1375
  /**
1375
1376
  * Formats a FHIR date string as a human readable string.
@@ -1379,7 +1380,7 @@ export declare function formatCoding(coding: Coding | undefined): string;
1379
1380
  * @param options - Optional date format options.
1380
1381
  * @returns The formatted date string.
1381
1382
  */
1382
- export declare function formatDate(date: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
1383
+ export declare function formatDate(date: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
1383
1384
 
1384
1385
  /**
1385
1386
  * Formats a FHIR dateTime string as a human readable string.
@@ -1389,7 +1390,7 @@ export declare function formatDate(date: string | undefined, locales?: Intl.Loca
1389
1390
  * @param options - Optional dateTime format options.
1390
1391
  * @returns The formatted dateTime string.
1391
1392
  */
1392
- export declare function formatDateTime(dateTime: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
1393
+ export declare function formatDateTime(dateTime: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
1393
1394
 
1394
1395
  /**
1395
1396
  * Formats the family name portion of a FHIR HumanName element.
@@ -1436,7 +1437,7 @@ export declare function formatObservationValue(obs: Observation | ObservationCom
1436
1437
  * @param options - Optional period format options.
1437
1438
  * @returns The formatted period string.
1438
1439
  */
1439
- export declare function formatPeriod(period: Period | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
1440
+ export declare function formatPeriod(period: Period | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
1440
1441
 
1441
1442
  /**
1442
1443
  * Returns a human-readable string for a FHIR Quantity datatype, taking into account units and comparators
@@ -1471,7 +1472,7 @@ export declare function formatSearchQuery(definition: SearchRequest): string;
1471
1472
  * @param options - Optional time format options.
1472
1473
  * @returns The formatted time string.
1473
1474
  */
1474
- export declare function formatTime(time: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
1475
+ export declare function formatTime(time: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
1475
1476
 
1476
1477
  /**
1477
1478
  * Formats a FHIR Timing as a human readable string.
@@ -2192,6 +2193,8 @@ export declare function isCompletedSubscriptionRequest(subscriptionRequest: Subs
2192
2193
 
2193
2194
  export declare function isComplexTypeCode(code: string): boolean;
2194
2195
 
2196
+ export declare function isConflict(outcome: OperationOutcome): boolean;
2197
+
2195
2198
  export declare function isContextVersionRequired(event: string): event is FhircastEventVersionRequired;
2196
2199
 
2197
2200
  export declare function isCreated(outcome: OperationOutcome): boolean;
@@ -3749,8 +3752,8 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3749
3752
  private addLogin;
3750
3753
  private refreshProfile;
3751
3754
  /**
3752
- * Returns true if the client is waiting for authentication.
3753
- * @returns True if the client is waiting for authentication.
3755
+ * Returns true if the client is waiting for initial authentication.
3756
+ * @returns True if the client is waiting for initial authentication.
3754
3757
  * @category Authentication
3755
3758
  */
3756
3759
  isLoading(): boolean;
@@ -5220,20 +5223,20 @@ export declare class ReadablePromise<T> implements Promise<T> {
5220
5223
  * @param onrejected - The callback to execute when the Promise is rejected.
5221
5224
  * @returns A Promise for the completion of which ever callback is executed.
5222
5225
  */
5223
- then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
5226
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
5224
5227
  /**
5225
5228
  * Attaches a callback for only the rejection of the Promise.
5226
5229
  * @param onrejected - The callback to execute when the Promise is rejected.
5227
5230
  * @returns A Promise for the completion of the callback.
5228
5231
  */
5229
- catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
5232
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
5230
5233
  /**
5231
5234
  * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
5232
5235
  * resolved value cannot be modified from the callback.
5233
5236
  * @param onfinally - The callback to execute when the Promise is settled (fulfilled or rejected).
5234
5237
  * @returns A Promise for the completion of the callback.
5235
5238
  */
5236
- finally(onfinally?: (() => void) | undefined | null): Promise<T>;
5239
+ finally(onfinally?: (() => void) | null): Promise<T>;
5237
5240
  }
5238
5241
 
5239
5242
  export declare class ReconnectingWebSocket extends TypedEventTarget<WebSocketEventMap_2> implements IReconnectingWebSocket {
@@ -5517,6 +5520,8 @@ export declare function setIdentifier(resource: Resource & {
5517
5520
 
5518
5521
  export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
5519
5522
 
5523
+ export declare function singularize<T>(value: T | T[] | undefined): T | undefined;
5524
+
5520
5525
  /**
5521
5526
  * Sleeps for the specified number of milliseconds.
5522
5527
  * @param ms - Time delay in milliseconds
@@ -668,7 +668,7 @@ export declare interface CreateMediaOptions extends CreateBinaryOptions {
668
668
  export declare function createOperationOutcomeIssue(severity: IssueSeverity, code: IssueType, message: string, path: string, data?: Record<string, any>): OperationOutcomeIssue;
669
669
 
670
670
  export declare interface CreatePdfFunction {
671
- (docDefinition: TDocumentDefinitions, tableLayouts?: Record<string, CustomTableLayout> | undefined, fonts?: TFontDictionary | undefined): Promise<any>;
671
+ (docDefinition: TDocumentDefinitions, tableLayouts?: Record<string, CustomTableLayout>, fonts?: TFontDictionary): Promise<any>;
672
672
  }
673
673
 
674
674
  /**
@@ -1367,9 +1367,10 @@ export declare function formatCodeableConcept(codeableConcept: CodeableConcept |
1367
1367
  /**
1368
1368
  * Formats a Coding element as a string.
1369
1369
  * @param coding - A FHIR Coding element
1370
+ * @param includeCode - If true, includes both the code and display if available
1370
1371
  * @returns The coding as a string.
1371
1372
  */
1372
- export declare function formatCoding(coding: Coding | undefined): string;
1373
+ export declare function formatCoding(coding: Coding | undefined, includeCode?: boolean): string;
1373
1374
 
1374
1375
  /**
1375
1376
  * Formats a FHIR date string as a human readable string.
@@ -1379,7 +1380,7 @@ export declare function formatCoding(coding: Coding | undefined): string;
1379
1380
  * @param options - Optional date format options.
1380
1381
  * @returns The formatted date string.
1381
1382
  */
1382
- export declare function formatDate(date: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
1383
+ export declare function formatDate(date: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
1383
1384
 
1384
1385
  /**
1385
1386
  * Formats a FHIR dateTime string as a human readable string.
@@ -1389,7 +1390,7 @@ export declare function formatDate(date: string | undefined, locales?: Intl.Loca
1389
1390
  * @param options - Optional dateTime format options.
1390
1391
  * @returns The formatted dateTime string.
1391
1392
  */
1392
- export declare function formatDateTime(dateTime: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
1393
+ export declare function formatDateTime(dateTime: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
1393
1394
 
1394
1395
  /**
1395
1396
  * Formats the family name portion of a FHIR HumanName element.
@@ -1436,7 +1437,7 @@ export declare function formatObservationValue(obs: Observation | ObservationCom
1436
1437
  * @param options - Optional period format options.
1437
1438
  * @returns The formatted period string.
1438
1439
  */
1439
- export declare function formatPeriod(period: Period | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
1440
+ export declare function formatPeriod(period: Period | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
1440
1441
 
1441
1442
  /**
1442
1443
  * Returns a human-readable string for a FHIR Quantity datatype, taking into account units and comparators
@@ -1471,7 +1472,7 @@ export declare function formatSearchQuery(definition: SearchRequest): string;
1471
1472
  * @param options - Optional time format options.
1472
1473
  * @returns The formatted time string.
1473
1474
  */
1474
- export declare function formatTime(time: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
1475
+ export declare function formatTime(time: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
1475
1476
 
1476
1477
  /**
1477
1478
  * Formats a FHIR Timing as a human readable string.
@@ -2192,6 +2193,8 @@ export declare function isCompletedSubscriptionRequest(subscriptionRequest: Subs
2192
2193
 
2193
2194
  export declare function isComplexTypeCode(code: string): boolean;
2194
2195
 
2196
+ export declare function isConflict(outcome: OperationOutcome): boolean;
2197
+
2195
2198
  export declare function isContextVersionRequired(event: string): event is FhircastEventVersionRequired;
2196
2199
 
2197
2200
  export declare function isCreated(outcome: OperationOutcome): boolean;
@@ -3749,8 +3752,8 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3749
3752
  private addLogin;
3750
3753
  private refreshProfile;
3751
3754
  /**
3752
- * Returns true if the client is waiting for authentication.
3753
- * @returns True if the client is waiting for authentication.
3755
+ * Returns true if the client is waiting for initial authentication.
3756
+ * @returns True if the client is waiting for initial authentication.
3754
3757
  * @category Authentication
3755
3758
  */
3756
3759
  isLoading(): boolean;
@@ -5220,20 +5223,20 @@ export declare class ReadablePromise<T> implements Promise<T> {
5220
5223
  * @param onrejected - The callback to execute when the Promise is rejected.
5221
5224
  * @returns A Promise for the completion of which ever callback is executed.
5222
5225
  */
5223
- then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
5226
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
5224
5227
  /**
5225
5228
  * Attaches a callback for only the rejection of the Promise.
5226
5229
  * @param onrejected - The callback to execute when the Promise is rejected.
5227
5230
  * @returns A Promise for the completion of the callback.
5228
5231
  */
5229
- catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
5232
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
5230
5233
  /**
5231
5234
  * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
5232
5235
  * resolved value cannot be modified from the callback.
5233
5236
  * @param onfinally - The callback to execute when the Promise is settled (fulfilled or rejected).
5234
5237
  * @returns A Promise for the completion of the callback.
5235
5238
  */
5236
- finally(onfinally?: (() => void) | undefined | null): Promise<T>;
5239
+ finally(onfinally?: (() => void) | null): Promise<T>;
5237
5240
  }
5238
5241
 
5239
5242
  export declare class ReconnectingWebSocket extends TypedEventTarget<WebSocketEventMap_2> implements IReconnectingWebSocket {
@@ -5517,6 +5520,8 @@ export declare function setIdentifier(resource: Resource & {
5517
5520
 
5518
5521
  export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
5519
5522
 
5523
+ export declare function singularize<T>(value: T | T[] | undefined): T | undefined;
5524
+
5520
5525
  /**
5521
5526
  * Sleeps for the specified number of milliseconds.
5522
5527
  * @param ms - Time delay in milliseconds