@medplum/core 4.1.5 → 4.1.7

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.
@@ -14,6 +14,7 @@ import { ConceptMap } from '@medplum/fhirtypes';
14
14
  import type { CustomTableLayout } from 'pdfmake/interfaces';
15
15
  import { Device } from '@medplum/fhirtypes';
16
16
  import { DiagnosticReport } from '@medplum/fhirtypes';
17
+ import { DocumentReference } from '@medplum/fhirtypes';
17
18
  import { ElementDefinition } from '@medplum/fhirtypes';
18
19
  import { ElementDefinitionBinding } from '@medplum/fhirtypes';
19
20
  import { Encounter } from '@medplum/fhirtypes';
@@ -47,6 +48,7 @@ import { Reference } from '@medplum/fhirtypes';
47
48
  import { RelatedPerson } from '@medplum/fhirtypes';
48
49
  import { Resource } from '@medplum/fhirtypes';
49
50
  import { ResourceType } from '@medplum/fhirtypes';
51
+ import { SampledData } from '@medplum/fhirtypes';
50
52
  import { SearchParameter } from '@medplum/fhirtypes';
51
53
  import { StructureDefinition } from '@medplum/fhirtypes';
52
54
  import { StructureMap } from '@medplum/fhirtypes';
@@ -276,6 +278,7 @@ export declare interface AtomContext {
276
278
  }
277
279
 
278
280
  export declare interface BackgroundJobContext {
281
+ project?: WithId<Project>;
279
282
  interaction: BackgroundJobInteraction;
280
283
  }
281
284
 
@@ -631,6 +634,13 @@ export declare function createConstraintIssue(expression: string, constraint: Co
631
634
 
632
635
  export declare const created: OperationOutcome;
633
636
 
637
+ export declare interface CreateDocumentReferenceOptions extends CreateBinaryOptions {
638
+ /**
639
+ * Optional additional fields for the DocumentReference resource.
640
+ */
641
+ readonly additionalFields?: Omit<Partial<DocumentReference>, 'content'>;
642
+ }
643
+
634
644
  /**
635
645
  * Creates a serializable JSON payload for the `FHIRcast` protocol
636
646
  *
@@ -701,6 +711,28 @@ export declare type CurrentContext<T extends FhircastAnchorResourceType | '' = F
701
711
  context: FhircastEventContext<AnchorResourceOpenEvent<T>>[];
702
712
  } : never;
703
713
 
714
+ export declare class DataSampler {
715
+ private code?;
716
+ private unit?;
717
+ private readonly sampling?;
718
+ private readonly dataPoints;
719
+ /**
720
+ * @param opts - Optional parameters.
721
+ * @param opts.code - Code for data points.
722
+ * @param opts.unit - Unit for data points.
723
+ * @param opts.sampling - Sampling information for high-frequency Observations.
724
+ */
725
+ constructor(opts?: {
726
+ code?: CodeableConcept;
727
+ unit?: QuantityUnit;
728
+ sampling?: SamplingInfo;
729
+ });
730
+ addObservation(obs: Observation): void;
731
+ addData(...data: number[]): void;
732
+ private checkUnit;
733
+ summarize(code: CodeableConcept, fn: StatsFn): Observation;
734
+ }
735
+
704
736
  export declare type DataTypesMap = {
705
737
  [type: string]: InternalTypeSchema;
706
738
  };
@@ -919,6 +951,10 @@ declare class EventTarget_2 {
919
951
  }
920
952
  export { EventTarget_2 as EventTarget }
921
953
 
954
+ export declare function expandSampledData(sample: SampledData): number[];
955
+
956
+ export declare function expandSampledObservation(obs: Observation): Observation[];
957
+
922
958
  export declare type ExtendedElementProperties = {
923
959
  readonly: boolean;
924
960
  hidden: boolean;
@@ -1964,6 +2000,16 @@ export declare class Hl7Field {
1964
2000
  * @returns The parsed HL7 field.
1965
2001
  */
1966
2002
  static parse(text: string, context?: Hl7Context): Hl7Field;
2003
+ /**
2004
+ * Sets a component value at the specified indices.
2005
+ * Note that the indices are 1-based, not 0-based.
2006
+ * @param component - The component index
2007
+ * @param value - The new component value
2008
+ * @param subcomponent - Optional subcomponent index
2009
+ * @param repetition - Optional repetition index
2010
+ * @returns true if the component was set, false otherwise
2011
+ */
2012
+ setComponent(component: number, value: string, subcomponent?: number, repetition?: number): boolean;
1967
2013
  }
1968
2014
 
1969
2015
  /**
@@ -2032,6 +2078,16 @@ export declare class Hl7Message {
2032
2078
  * @returns The parsed HL7 message.
2033
2079
  */
2034
2080
  static parse(text: string): Hl7Message;
2081
+ /**
2082
+ * Sets or replaces a segment at the specified index.
2083
+ * Only allows MSH header to be replaced as first segment.
2084
+ * If index is a number and is larger than the length of the segments array, it will be appended as the last segment.
2085
+ * If the index is a string, replaces the first segment with that name.
2086
+ * @param index - The segment index or name
2087
+ * @param segment - The new segment to set
2088
+ * @returns true if the segment was set, false otherwise
2089
+ */
2090
+ setSegment(index: number | string, segment: Hl7Segment): boolean;
2035
2091
  }
2036
2092
 
2037
2093
  /**
@@ -2053,7 +2109,7 @@ export declare class Hl7Segment {
2053
2109
  * Returns an HL7 field by index.
2054
2110
  * @param index - The HL7 field index.
2055
2111
  * @returns The HL7 field.
2056
- * @deprecated Use getSegment() instead. This method includes the segment name in the index, which leads to confusing behavior. This method will be removed in a future release.
2112
+ * @deprecated Use getField() instead. This method includes the segment name in the index, which leads to confusing behavior. This method will be removed in a future release.
2057
2113
  */
2058
2114
  get(index: number): Hl7Field;
2059
2115
  /**
@@ -2101,6 +2157,26 @@ export declare class Hl7Segment {
2101
2157
  * @returns The parsed HL7 segment.
2102
2158
  */
2103
2159
  static parse(text: string, context?: Hl7Context): Hl7Segment;
2160
+ /**
2161
+ * Sets a field at the specified index. If that index does not exist, it will be added.
2162
+ * Note that the index is 1-based, not 0-based.
2163
+ * @param index - The field index
2164
+ * @param field - The new field value
2165
+ * @returns true if the field was set, false otherwise
2166
+ */
2167
+ setField(index: number, field: Hl7Field | string): boolean;
2168
+ /**
2169
+ * Sets a component value by field index and component index.
2170
+ * This is a shortcut for `getField(field).setComponent(component, value)`.
2171
+ * Note that both indices are 1-based, not 0-based.
2172
+ * @param fieldIndex - The HL7 field index
2173
+ * @param component - The component index
2174
+ * @param value - The new component value
2175
+ * @param subcomponent - Optional subcomponent index
2176
+ * @param repetition - Optional repetition index
2177
+ * @returns true if the component was set, false otherwise
2178
+ */
2179
+ setComponent(fieldIndex: number, component: number, value: string, subcomponent?: number, repetition?: number): boolean;
2104
2180
  }
2105
2181
 
2106
2182
  export declare const HTTP_HL7_ORG = "http://hl7.org";
@@ -2960,6 +3036,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2960
3036
  private refreshPromise?;
2961
3037
  private profilePromise?;
2962
3038
  private sessionDetails?;
3039
+ private currentRateLimits?;
2963
3040
  private basicAuth?;
2964
3041
  private initPromise;
2965
3042
  private initComplete;
@@ -4103,6 +4180,15 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
4103
4180
  * @deprecated Use `createMedia` with `CreateMediaOptions` instead. To be removed in a future version.
4104
4181
  */
4105
4182
  uploadMedia(contents: string | Uint8Array | File | Blob, contentType: string, filename: string | undefined, additionalFields?: Partial<Media>, options?: MedplumRequestOptions): Promise<Media>;
4183
+ /**
4184
+ * Creates a FHIR DocumentReference resource with the provided data content.
4185
+ *
4186
+ * @category Create
4187
+ * @param createDocumentReferenceOptions - The document reference creation options. See `CreateDocumentReferenceOptions` for full details.
4188
+ * @param requestOptions - Optional fetch options.
4189
+ * @returns The new document reference resource.
4190
+ */
4191
+ createDocumentReference(createDocumentReferenceOptions: CreateDocumentReferenceOptions, requestOptions?: MedplumRequestOptions): Promise<DocumentReference>;
4106
4192
  /**
4107
4193
  * Performs Bulk Data Export operation request flow. See The FHIR "Bulk Data Export" for full details: https://build.fhir.org/ig/HL7/bulk-data/export.html#bulk-data-export
4108
4194
  * @param exportLevel - Optional export level. Defaults to system level export. 'Group/:id' - Group of Patients, 'Patient' - All Patients.
@@ -4172,6 +4258,13 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
4172
4258
  private fetchWithRetry;
4173
4259
  private logRequest;
4174
4260
  private logResponse;
4261
+ private setCurrentRateLimit;
4262
+ /**
4263
+ * Reports the last-seen rate limit information from the server.
4264
+ * @returns Array of applicable rate limits.
4265
+ */
4266
+ rateLimitStatus(): RateLimitInfo[];
4267
+ private getRetryDelay;
4175
4268
  private pollStatus;
4176
4269
  /**
4177
4270
  * Executes a batch of requests that were automatically batched together.
@@ -4820,6 +4913,10 @@ export declare interface MedplumRequestOptions extends RequestInit {
4820
4913
  * Optional max number of retries that should be made in the case of a failed request. Default is `2`.
4821
4914
  */
4822
4915
  maxRetries?: number;
4916
+ /**
4917
+ * Optional maximum time to wait between retries, in milliseconds; defaults to `2000` (2 s).
4918
+ */
4919
+ maxRetryTime?: number;
4823
4920
  /**
4824
4921
  * Optional flag to disable auto-batching for this specific request.
4825
4922
  * Only applies when the client is configured with auto-batching enabled.
@@ -5491,6 +5588,8 @@ export declare const protectedResourceTypes: string[];
5491
5588
 
5492
5589
  export declare type ProtocolsProvider = null | string | string[];
5493
5590
 
5591
+ export declare type QuantityUnit = Pick<Quantity, 'unit' | 'code' | 'system'>;
5592
+
5494
5593
  /**
5495
5594
  * QueryTypes defines the different ways to specify FHIR search parameters.
5496
5595
  *
@@ -5503,6 +5602,12 @@ export declare type ProtocolsProvider = null | string | string[];
5503
5602
  */
5504
5603
  export declare type QueryTypes = URLSearchParams | string[][] | Record<string, string | number | boolean | undefined> | string | undefined;
5505
5604
 
5605
+ export declare type RateLimitInfo = {
5606
+ name: string;
5607
+ remainingUnits: number;
5608
+ secondsUntilReset: number;
5609
+ };
5610
+
5506
5611
  /**
5507
5612
  * The ReadablePromise class wraps a request promise suitable for React Suspense.
5508
5613
  * See: https://blog.logrocket.com/react-suspense-data-fetching/#wrappromise-js
@@ -5739,6 +5844,8 @@ export declare type ResourceWithCode = Resource & Code;
5739
5844
 
5740
5845
  export declare const RXNORM = "http://www.nlm.nih.gov/research/umls/rxnorm";
5741
5846
 
5847
+ export declare type SamplingInfo = Omit<SampledData, 'data'>;
5848
+
5742
5849
  /**
5743
5850
  * Checks that there is an access policy permitting the given resource interaction, returning the matching policy object.
5744
5851
  * @param resource - The resource being acted upon.
@@ -5915,6 +6022,8 @@ export declare function splitN(str: string, delim: string, n: number): string[];
5915
6022
  */
5916
6023
  export declare function splitSearchOnComma(input: string): string[];
5917
6024
 
6025
+ export declare type StatsFn = (data: number[]) => number | Quantity;
6026
+
5918
6027
  /**
5919
6028
  * Reads data from a Readable stream and returns a Promise that resolves with a Buffer containing all the data.
5920
6029
  * @param stream - The Readable stream to read from.
@@ -6088,6 +6197,17 @@ export declare type SubscriptionRequest = {
6088
6197
  */
6089
6198
  export declare function subsetResource<T extends Resource>(resource: T | undefined, properties: string[]): T | undefined;
6090
6199
 
6200
+ /**
6201
+ * Summarizes a group of Observations into a single computed summary value, with the individual values
6202
+ * preserved in `Observation.component.valueSampledData`.
6203
+ *
6204
+ * @param observations - The Observations to summarize.
6205
+ * @param summaryCode - The code for the summarized value.
6206
+ * @param summarizeFn - Function to summarize the data points.
6207
+ * @returns - The summary Observation resource.
6208
+ */
6209
+ export declare function summarizeObservations(observations: Observation[] | Bundle<Observation>, summaryCode: CodeableConcept, summarizeFn: StatsFn): Observation;
6210
+
6091
6211
  export declare class SymbolAtom implements Atom {
6092
6212
  readonly name: string;
6093
6213
  constructor(name: string);
@@ -14,6 +14,7 @@ import { ConceptMap } from '@medplum/fhirtypes';
14
14
  import type { CustomTableLayout } from 'pdfmake/interfaces';
15
15
  import { Device } from '@medplum/fhirtypes';
16
16
  import { DiagnosticReport } from '@medplum/fhirtypes';
17
+ import { DocumentReference } from '@medplum/fhirtypes';
17
18
  import { ElementDefinition } from '@medplum/fhirtypes';
18
19
  import { ElementDefinitionBinding } from '@medplum/fhirtypes';
19
20
  import { Encounter } from '@medplum/fhirtypes';
@@ -47,6 +48,7 @@ import { Reference } from '@medplum/fhirtypes';
47
48
  import { RelatedPerson } from '@medplum/fhirtypes';
48
49
  import { Resource } from '@medplum/fhirtypes';
49
50
  import { ResourceType } from '@medplum/fhirtypes';
51
+ import { SampledData } from '@medplum/fhirtypes';
50
52
  import { SearchParameter } from '@medplum/fhirtypes';
51
53
  import { StructureDefinition } from '@medplum/fhirtypes';
52
54
  import { StructureMap } from '@medplum/fhirtypes';
@@ -276,6 +278,7 @@ export declare interface AtomContext {
276
278
  }
277
279
 
278
280
  export declare interface BackgroundJobContext {
281
+ project?: WithId<Project>;
279
282
  interaction: BackgroundJobInteraction;
280
283
  }
281
284
 
@@ -631,6 +634,13 @@ export declare function createConstraintIssue(expression: string, constraint: Co
631
634
 
632
635
  export declare const created: OperationOutcome;
633
636
 
637
+ export declare interface CreateDocumentReferenceOptions extends CreateBinaryOptions {
638
+ /**
639
+ * Optional additional fields for the DocumentReference resource.
640
+ */
641
+ readonly additionalFields?: Omit<Partial<DocumentReference>, 'content'>;
642
+ }
643
+
634
644
  /**
635
645
  * Creates a serializable JSON payload for the `FHIRcast` protocol
636
646
  *
@@ -701,6 +711,28 @@ export declare type CurrentContext<T extends FhircastAnchorResourceType | '' = F
701
711
  context: FhircastEventContext<AnchorResourceOpenEvent<T>>[];
702
712
  } : never;
703
713
 
714
+ export declare class DataSampler {
715
+ private code?;
716
+ private unit?;
717
+ private readonly sampling?;
718
+ private readonly dataPoints;
719
+ /**
720
+ * @param opts - Optional parameters.
721
+ * @param opts.code - Code for data points.
722
+ * @param opts.unit - Unit for data points.
723
+ * @param opts.sampling - Sampling information for high-frequency Observations.
724
+ */
725
+ constructor(opts?: {
726
+ code?: CodeableConcept;
727
+ unit?: QuantityUnit;
728
+ sampling?: SamplingInfo;
729
+ });
730
+ addObservation(obs: Observation): void;
731
+ addData(...data: number[]): void;
732
+ private checkUnit;
733
+ summarize(code: CodeableConcept, fn: StatsFn): Observation;
734
+ }
735
+
704
736
  export declare type DataTypesMap = {
705
737
  [type: string]: InternalTypeSchema;
706
738
  };
@@ -919,6 +951,10 @@ declare class EventTarget_2 {
919
951
  }
920
952
  export { EventTarget_2 as EventTarget }
921
953
 
954
+ export declare function expandSampledData(sample: SampledData): number[];
955
+
956
+ export declare function expandSampledObservation(obs: Observation): Observation[];
957
+
922
958
  export declare type ExtendedElementProperties = {
923
959
  readonly: boolean;
924
960
  hidden: boolean;
@@ -1964,6 +2000,16 @@ export declare class Hl7Field {
1964
2000
  * @returns The parsed HL7 field.
1965
2001
  */
1966
2002
  static parse(text: string, context?: Hl7Context): Hl7Field;
2003
+ /**
2004
+ * Sets a component value at the specified indices.
2005
+ * Note that the indices are 1-based, not 0-based.
2006
+ * @param component - The component index
2007
+ * @param value - The new component value
2008
+ * @param subcomponent - Optional subcomponent index
2009
+ * @param repetition - Optional repetition index
2010
+ * @returns true if the component was set, false otherwise
2011
+ */
2012
+ setComponent(component: number, value: string, subcomponent?: number, repetition?: number): boolean;
1967
2013
  }
1968
2014
 
1969
2015
  /**
@@ -2032,6 +2078,16 @@ export declare class Hl7Message {
2032
2078
  * @returns The parsed HL7 message.
2033
2079
  */
2034
2080
  static parse(text: string): Hl7Message;
2081
+ /**
2082
+ * Sets or replaces a segment at the specified index.
2083
+ * Only allows MSH header to be replaced as first segment.
2084
+ * If index is a number and is larger than the length of the segments array, it will be appended as the last segment.
2085
+ * If the index is a string, replaces the first segment with that name.
2086
+ * @param index - The segment index or name
2087
+ * @param segment - The new segment to set
2088
+ * @returns true if the segment was set, false otherwise
2089
+ */
2090
+ setSegment(index: number | string, segment: Hl7Segment): boolean;
2035
2091
  }
2036
2092
 
2037
2093
  /**
@@ -2053,7 +2109,7 @@ export declare class Hl7Segment {
2053
2109
  * Returns an HL7 field by index.
2054
2110
  * @param index - The HL7 field index.
2055
2111
  * @returns The HL7 field.
2056
- * @deprecated Use getSegment() instead. This method includes the segment name in the index, which leads to confusing behavior. This method will be removed in a future release.
2112
+ * @deprecated Use getField() instead. This method includes the segment name in the index, which leads to confusing behavior. This method will be removed in a future release.
2057
2113
  */
2058
2114
  get(index: number): Hl7Field;
2059
2115
  /**
@@ -2101,6 +2157,26 @@ export declare class Hl7Segment {
2101
2157
  * @returns The parsed HL7 segment.
2102
2158
  */
2103
2159
  static parse(text: string, context?: Hl7Context): Hl7Segment;
2160
+ /**
2161
+ * Sets a field at the specified index. If that index does not exist, it will be added.
2162
+ * Note that the index is 1-based, not 0-based.
2163
+ * @param index - The field index
2164
+ * @param field - The new field value
2165
+ * @returns true if the field was set, false otherwise
2166
+ */
2167
+ setField(index: number, field: Hl7Field | string): boolean;
2168
+ /**
2169
+ * Sets a component value by field index and component index.
2170
+ * This is a shortcut for `getField(field).setComponent(component, value)`.
2171
+ * Note that both indices are 1-based, not 0-based.
2172
+ * @param fieldIndex - The HL7 field index
2173
+ * @param component - The component index
2174
+ * @param value - The new component value
2175
+ * @param subcomponent - Optional subcomponent index
2176
+ * @param repetition - Optional repetition index
2177
+ * @returns true if the component was set, false otherwise
2178
+ */
2179
+ setComponent(fieldIndex: number, component: number, value: string, subcomponent?: number, repetition?: number): boolean;
2104
2180
  }
2105
2181
 
2106
2182
  export declare const HTTP_HL7_ORG = "http://hl7.org";
@@ -2960,6 +3036,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2960
3036
  private refreshPromise?;
2961
3037
  private profilePromise?;
2962
3038
  private sessionDetails?;
3039
+ private currentRateLimits?;
2963
3040
  private basicAuth?;
2964
3041
  private initPromise;
2965
3042
  private initComplete;
@@ -4103,6 +4180,15 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
4103
4180
  * @deprecated Use `createMedia` with `CreateMediaOptions` instead. To be removed in a future version.
4104
4181
  */
4105
4182
  uploadMedia(contents: string | Uint8Array | File | Blob, contentType: string, filename: string | undefined, additionalFields?: Partial<Media>, options?: MedplumRequestOptions): Promise<Media>;
4183
+ /**
4184
+ * Creates a FHIR DocumentReference resource with the provided data content.
4185
+ *
4186
+ * @category Create
4187
+ * @param createDocumentReferenceOptions - The document reference creation options. See `CreateDocumentReferenceOptions` for full details.
4188
+ * @param requestOptions - Optional fetch options.
4189
+ * @returns The new document reference resource.
4190
+ */
4191
+ createDocumentReference(createDocumentReferenceOptions: CreateDocumentReferenceOptions, requestOptions?: MedplumRequestOptions): Promise<DocumentReference>;
4106
4192
  /**
4107
4193
  * Performs Bulk Data Export operation request flow. See The FHIR "Bulk Data Export" for full details: https://build.fhir.org/ig/HL7/bulk-data/export.html#bulk-data-export
4108
4194
  * @param exportLevel - Optional export level. Defaults to system level export. 'Group/:id' - Group of Patients, 'Patient' - All Patients.
@@ -4172,6 +4258,13 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
4172
4258
  private fetchWithRetry;
4173
4259
  private logRequest;
4174
4260
  private logResponse;
4261
+ private setCurrentRateLimit;
4262
+ /**
4263
+ * Reports the last-seen rate limit information from the server.
4264
+ * @returns Array of applicable rate limits.
4265
+ */
4266
+ rateLimitStatus(): RateLimitInfo[];
4267
+ private getRetryDelay;
4175
4268
  private pollStatus;
4176
4269
  /**
4177
4270
  * Executes a batch of requests that were automatically batched together.
@@ -4820,6 +4913,10 @@ export declare interface MedplumRequestOptions extends RequestInit {
4820
4913
  * Optional max number of retries that should be made in the case of a failed request. Default is `2`.
4821
4914
  */
4822
4915
  maxRetries?: number;
4916
+ /**
4917
+ * Optional maximum time to wait between retries, in milliseconds; defaults to `2000` (2 s).
4918
+ */
4919
+ maxRetryTime?: number;
4823
4920
  /**
4824
4921
  * Optional flag to disable auto-batching for this specific request.
4825
4922
  * Only applies when the client is configured with auto-batching enabled.
@@ -5491,6 +5588,8 @@ export declare const protectedResourceTypes: string[];
5491
5588
 
5492
5589
  export declare type ProtocolsProvider = null | string | string[];
5493
5590
 
5591
+ export declare type QuantityUnit = Pick<Quantity, 'unit' | 'code' | 'system'>;
5592
+
5494
5593
  /**
5495
5594
  * QueryTypes defines the different ways to specify FHIR search parameters.
5496
5595
  *
@@ -5503,6 +5602,12 @@ export declare type ProtocolsProvider = null | string | string[];
5503
5602
  */
5504
5603
  export declare type QueryTypes = URLSearchParams | string[][] | Record<string, string | number | boolean | undefined> | string | undefined;
5505
5604
 
5605
+ export declare type RateLimitInfo = {
5606
+ name: string;
5607
+ remainingUnits: number;
5608
+ secondsUntilReset: number;
5609
+ };
5610
+
5506
5611
  /**
5507
5612
  * The ReadablePromise class wraps a request promise suitable for React Suspense.
5508
5613
  * See: https://blog.logrocket.com/react-suspense-data-fetching/#wrappromise-js
@@ -5739,6 +5844,8 @@ export declare type ResourceWithCode = Resource & Code;
5739
5844
 
5740
5845
  export declare const RXNORM = "http://www.nlm.nih.gov/research/umls/rxnorm";
5741
5846
 
5847
+ export declare type SamplingInfo = Omit<SampledData, 'data'>;
5848
+
5742
5849
  /**
5743
5850
  * Checks that there is an access policy permitting the given resource interaction, returning the matching policy object.
5744
5851
  * @param resource - The resource being acted upon.
@@ -5915,6 +6022,8 @@ export declare function splitN(str: string, delim: string, n: number): string[];
5915
6022
  */
5916
6023
  export declare function splitSearchOnComma(input: string): string[];
5917
6024
 
6025
+ export declare type StatsFn = (data: number[]) => number | Quantity;
6026
+
5918
6027
  /**
5919
6028
  * Reads data from a Readable stream and returns a Promise that resolves with a Buffer containing all the data.
5920
6029
  * @param stream - The Readable stream to read from.
@@ -6088,6 +6197,17 @@ export declare type SubscriptionRequest = {
6088
6197
  */
6089
6198
  export declare function subsetResource<T extends Resource>(resource: T | undefined, properties: string[]): T | undefined;
6090
6199
 
6200
+ /**
6201
+ * Summarizes a group of Observations into a single computed summary value, with the individual values
6202
+ * preserved in `Observation.component.valueSampledData`.
6203
+ *
6204
+ * @param observations - The Observations to summarize.
6205
+ * @param summaryCode - The code for the summarized value.
6206
+ * @param summarizeFn - Function to summarize the data points.
6207
+ * @returns - The summary Observation resource.
6208
+ */
6209
+ export declare function summarizeObservations(observations: Observation[] | Bundle<Observation>, summaryCode: CodeableConcept, summarizeFn: StatsFn): Observation;
6210
+
6091
6211
  export declare class SymbolAtom implements Atom {
6092
6212
  readonly name: string;
6093
6213
  constructor(name: string);