@medplum/core 5.2.9 → 5.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.
@@ -2754,6 +2754,22 @@ export declare function getPendingMedicationOrderStatus(medicationRequest: Medic
2754
2754
  */
2755
2755
  export declare function getPreferredPharmaciesFromPatient(patient: Patient, preferenceTypeSystem?: string): PreferredPharmacy[];
2756
2756
 
2757
+ /**
2758
+ * A lab value's trailing zeros carry real significant-figure meaning (e.g. "1.30" vs "1.3"), but
2759
+ * JSON numbers can't distinguish them - `1.30` and `1.3` parse to the identical float, and that
2760
+ * distinction is gone the moment anything parses the response body as JSON. When the original
2761
+ * precision was captured before that happened (in `receive-from-health-gorilla`, using a custom
2762
+ * JSON.parse reviver to read the raw source of the parsed number), it's carried in the standard
2763
+ * HL7 `quantity-precision` extension on `valueQuantity`'s primitive sibling (`_value`), so the
2764
+ * value can still be displayed with its original precision even though `quantity.value` itself is
2765
+ * just the plain, precision-collapsed number.
2766
+ * @param quantity - A FHIR Quantity, e.g. an Observation's valueQuantity.
2767
+ * @returns The number of digits after the decimal point to display, or undefined if no precision
2768
+ * was preserved or the stored value is out of `toFixed()`'s valid range (quantity.value should
2769
+ * then be displayed with its default precision).
2770
+ */
2771
+ export declare function getPreservedValuePrecision(quantity: Quantity | undefined): number | undefined;
2772
+
2757
2773
  /**
2758
2774
  * Reads the appointment's primary provider, as {@link setPrimaryProvider} marked it.
2759
2775
  *
@@ -4299,16 +4315,23 @@ export declare interface MailAddress {
4299
4315
  /**
4300
4316
  * Email attachment definition.
4301
4317
  * Compatible with nodemailer Mail.Options.
4318
+ * Other nodemailer attachment options are ignored by the Medplum server.
4302
4319
  */
4303
4320
  export declare interface MailAttachment {
4304
- /** String, Buffer or a Stream contents for the attachment */
4321
+ /** String contents for the attachment */
4305
4322
  readonly content?: string;
4306
- /** path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) */
4323
+ /** A `Binary/{id}` reference, an HTTPS URL, or a data URI, if you want to stream the file instead of including it (better for larger attachments). Local file paths are not allowed. */
4307
4324
  readonly path?: string;
4308
4325
  /** filename to be reported as the name of the attached file, use of unicode is allowed. If you do not want to use a filename, set this value as false, otherwise a filename is generated automatically */
4309
4326
  readonly filename?: string | false;
4310
4327
  /** optional content type for the attachment, if not set will be derived from the filename property */
4311
4328
  readonly contentType?: string;
4329
+ /** optional content disposition type for the attachment, defaults to 'attachment' */
4330
+ readonly contentDisposition?: string;
4331
+ /** optional content id for using inline images in HTML message source */
4332
+ readonly cid?: string;
4333
+ /** If set and content is string, then encodes the content to a Buffer using the specified encoding. Example values: 'base64', 'hex', 'binary' etc. */
4334
+ readonly encoding?: string;
4312
4335
  }
4313
4336
 
4314
4337
  /**
@@ -4316,14 +4339,28 @@ export declare interface MailAttachment {
4316
4339
  */
4317
4340
  export declare type MailDestination = string | MailAddress | string[] | MailAddress[];
4318
4341
 
4342
+ /**
4343
+ * Email calendar event definition.
4344
+ * Compatible with nodemailer Mail.IcalAttachment.
4345
+ */
4346
+ export declare interface MailIcalEvent {
4347
+ /** Method of the calendar event, for example 'REQUEST' or 'CANCEL' */
4348
+ readonly method?: string;
4349
+ /** Filename of the calendar event attachment */
4350
+ readonly filename?: string;
4351
+ /** iCalendar contents of the event */
4352
+ readonly content: string;
4353
+ }
4354
+
4319
4355
  /**
4320
4356
  * Email message definition.
4321
4357
  * Compatible with nodemailer Mail.Options.
4358
+ * Other nodemailer message options are ignored by the Medplum server.
4322
4359
  */
4323
4360
  export declare interface MailOptions {
4324
- /** The e-mail address of the sender. All e-mail addresses can be plain `sender@server.com` or formatted `Sender Name <sender@server.com>` */
4361
+ /** The e-mail address of the sender. All e-mail addresses can be plain `sender@server.com` or formatted `Sender Name <sender@server.com>`. Must be an approved sender, otherwise the default sender address is used. */
4325
4362
  readonly from?: string | MailAddress;
4326
- /** An e-mail address that will appear on the Sender: field */
4363
+ /** Ignored by the Medplum server. The Sender: field is set to the from address. */
4327
4364
  readonly sender?: string | MailAddress;
4328
4365
  /** Comma separated list or an array of recipients e-mail addresses that will appear on the To: field */
4329
4366
  readonly to?: MailDestination;
@@ -4341,6 +4378,8 @@ export declare interface MailOptions {
4341
4378
  readonly html?: string;
4342
4379
  /** An array of attachment objects */
4343
4380
  readonly attachments?: MailAttachment[];
4381
+ /** iCalendar event to use as an alternative, for example an appointment invitation */
4382
+ readonly icalEvent?: string | MailIcalEvent;
4344
4383
  }
4345
4384
 
4346
4385
  /**
@@ -5874,6 +5913,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
5874
5913
  * });
5875
5914
  * ```
5876
5915
  *
5916
+ * Only the options in {@link MailOptions} are supported; other nodemailer options are ignored.
5877
5917
  * See the {@link https://nodemailer.com/extras/mailcomposer/ | nodemailer MailComposer options} for full details.
5878
5918
  * @category Media
5879
5919
  * @param email - The MailComposer options.
@@ -2754,6 +2754,22 @@ export declare function getPendingMedicationOrderStatus(medicationRequest: Medic
2754
2754
  */
2755
2755
  export declare function getPreferredPharmaciesFromPatient(patient: Patient, preferenceTypeSystem?: string): PreferredPharmacy[];
2756
2756
 
2757
+ /**
2758
+ * A lab value's trailing zeros carry real significant-figure meaning (e.g. "1.30" vs "1.3"), but
2759
+ * JSON numbers can't distinguish them - `1.30` and `1.3` parse to the identical float, and that
2760
+ * distinction is gone the moment anything parses the response body as JSON. When the original
2761
+ * precision was captured before that happened (in `receive-from-health-gorilla`, using a custom
2762
+ * JSON.parse reviver to read the raw source of the parsed number), it's carried in the standard
2763
+ * HL7 `quantity-precision` extension on `valueQuantity`'s primitive sibling (`_value`), so the
2764
+ * value can still be displayed with its original precision even though `quantity.value` itself is
2765
+ * just the plain, precision-collapsed number.
2766
+ * @param quantity - A FHIR Quantity, e.g. an Observation's valueQuantity.
2767
+ * @returns The number of digits after the decimal point to display, or undefined if no precision
2768
+ * was preserved or the stored value is out of `toFixed()`'s valid range (quantity.value should
2769
+ * then be displayed with its default precision).
2770
+ */
2771
+ export declare function getPreservedValuePrecision(quantity: Quantity | undefined): number | undefined;
2772
+
2757
2773
  /**
2758
2774
  * Reads the appointment's primary provider, as {@link setPrimaryProvider} marked it.
2759
2775
  *
@@ -4299,16 +4315,23 @@ export declare interface MailAddress {
4299
4315
  /**
4300
4316
  * Email attachment definition.
4301
4317
  * Compatible with nodemailer Mail.Options.
4318
+ * Other nodemailer attachment options are ignored by the Medplum server.
4302
4319
  */
4303
4320
  export declare interface MailAttachment {
4304
- /** String, Buffer or a Stream contents for the attachment */
4321
+ /** String contents for the attachment */
4305
4322
  readonly content?: string;
4306
- /** path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) */
4323
+ /** A `Binary/{id}` reference, an HTTPS URL, or a data URI, if you want to stream the file instead of including it (better for larger attachments). Local file paths are not allowed. */
4307
4324
  readonly path?: string;
4308
4325
  /** filename to be reported as the name of the attached file, use of unicode is allowed. If you do not want to use a filename, set this value as false, otherwise a filename is generated automatically */
4309
4326
  readonly filename?: string | false;
4310
4327
  /** optional content type for the attachment, if not set will be derived from the filename property */
4311
4328
  readonly contentType?: string;
4329
+ /** optional content disposition type for the attachment, defaults to 'attachment' */
4330
+ readonly contentDisposition?: string;
4331
+ /** optional content id for using inline images in HTML message source */
4332
+ readonly cid?: string;
4333
+ /** If set and content is string, then encodes the content to a Buffer using the specified encoding. Example values: 'base64', 'hex', 'binary' etc. */
4334
+ readonly encoding?: string;
4312
4335
  }
4313
4336
 
4314
4337
  /**
@@ -4316,14 +4339,28 @@ export declare interface MailAttachment {
4316
4339
  */
4317
4340
  export declare type MailDestination = string | MailAddress | string[] | MailAddress[];
4318
4341
 
4342
+ /**
4343
+ * Email calendar event definition.
4344
+ * Compatible with nodemailer Mail.IcalAttachment.
4345
+ */
4346
+ export declare interface MailIcalEvent {
4347
+ /** Method of the calendar event, for example 'REQUEST' or 'CANCEL' */
4348
+ readonly method?: string;
4349
+ /** Filename of the calendar event attachment */
4350
+ readonly filename?: string;
4351
+ /** iCalendar contents of the event */
4352
+ readonly content: string;
4353
+ }
4354
+
4319
4355
  /**
4320
4356
  * Email message definition.
4321
4357
  * Compatible with nodemailer Mail.Options.
4358
+ * Other nodemailer message options are ignored by the Medplum server.
4322
4359
  */
4323
4360
  export declare interface MailOptions {
4324
- /** The e-mail address of the sender. All e-mail addresses can be plain `sender@server.com` or formatted `Sender Name <sender@server.com>` */
4361
+ /** The e-mail address of the sender. All e-mail addresses can be plain `sender@server.com` or formatted `Sender Name <sender@server.com>`. Must be an approved sender, otherwise the default sender address is used. */
4325
4362
  readonly from?: string | MailAddress;
4326
- /** An e-mail address that will appear on the Sender: field */
4363
+ /** Ignored by the Medplum server. The Sender: field is set to the from address. */
4327
4364
  readonly sender?: string | MailAddress;
4328
4365
  /** Comma separated list or an array of recipients e-mail addresses that will appear on the To: field */
4329
4366
  readonly to?: MailDestination;
@@ -4341,6 +4378,8 @@ export declare interface MailOptions {
4341
4378
  readonly html?: string;
4342
4379
  /** An array of attachment objects */
4343
4380
  readonly attachments?: MailAttachment[];
4381
+ /** iCalendar event to use as an alternative, for example an appointment invitation */
4382
+ readonly icalEvent?: string | MailIcalEvent;
4344
4383
  }
4345
4384
 
4346
4385
  /**
@@ -5874,6 +5913,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
5874
5913
  * });
5875
5914
  * ```
5876
5915
  *
5916
+ * Only the options in {@link MailOptions} are supported; other nodemailer options are ignored.
5877
5917
  * See the {@link https://nodemailer.com/extras/mailcomposer/ | nodemailer MailComposer options} for full details.
5878
5918
  * @category Media
5879
5919
  * @param email - The MailComposer options.