@medplum/core 4.0.3 → 4.1.0

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.
@@ -66,26 +66,28 @@ export declare function accepted(location: string): OperationOutcome;
66
66
  *
67
67
  * Codes taken from http://hl7.org/fhir/codesystem-restful-interaction.html
68
68
  */
69
- export declare enum AccessPolicyInteraction {
70
- READ = "read",
71
- VREAD = "vread",
72
- UPDATE = "update",
73
- PATCH = "patch",
74
- DELETE = "delete",
75
- HISTORY = "history",
76
- HISTORY_INSTANCE = "history-instance",
77
- HISTORY_TYPE = "history-type",
78
- HISTORY_SYSTEM = "history-system",
79
- CREATE = "create",
80
- SEARCH = "search",
81
- SEARCH_TYPE = "search-type",
82
- SEARCH_SYSTEM = "search-system",
83
- SEARCH_COMPARTMENT = "search-compartment",
84
- CAPABILITIES = "capabilities",
85
- TRANSACTION = "transaction",
86
- BATCH = "batch",
87
- OPERATION = "operation"
88
- }
69
+ export declare const AccessPolicyInteraction: {
70
+ readonly READ: "read";
71
+ readonly VREAD: "vread";
72
+ readonly UPDATE: "update";
73
+ readonly PATCH: "patch";
74
+ readonly DELETE: "delete";
75
+ readonly HISTORY: "history";
76
+ readonly HISTORY_INSTANCE: "history-instance";
77
+ readonly HISTORY_TYPE: "history-type";
78
+ readonly HISTORY_SYSTEM: "history-system";
79
+ readonly CREATE: "create";
80
+ readonly SEARCH: "search";
81
+ readonly SEARCH_TYPE: "search-type";
82
+ readonly SEARCH_SYSTEM: "search-system";
83
+ readonly SEARCH_COMPARTMENT: "search-compartment";
84
+ readonly CAPABILITIES: "capabilities";
85
+ readonly TRANSACTION: "transaction";
86
+ readonly BATCH: "batch";
87
+ readonly OPERATION: "operation";
88
+ };
89
+
90
+ export declare type AccessPolicyInteraction = (typeof AccessPolicyInteraction)[keyof typeof AccessPolicyInteraction];
89
91
 
90
92
  /**
91
93
  * Adds the supplied profileUrl to the resource.meta.profile if it is not already
@@ -160,6 +162,7 @@ export declare interface AgentTransmitResponse extends BaseAgentMessage {
160
162
  export declare interface AgentUpgradeRequest extends BaseAgentRequestMessage {
161
163
  type: 'agent:upgrade:request';
162
164
  version?: string;
165
+ force?: boolean;
163
166
  }
164
167
 
165
168
  export declare interface AgentUpgradeResponse extends BaseAgentMessage {
@@ -530,6 +533,7 @@ export declare const ContentType: {
530
533
  readonly JAVASCRIPT: "text/javascript";
531
534
  readonly JSON: "application/json";
532
535
  readonly JSON_PATCH: "application/json-patch+json";
536
+ readonly MULTIPART_FORM_DATA: "multipart/form-data";
533
537
  readonly PNG: "image/png";
534
538
  readonly SCIM_JSON: "application/scim+json";
535
539
  readonly SVG: "image/svg+xml";
@@ -861,22 +865,30 @@ declare interface ErrorEvent_2 extends globalThis.Event {
861
865
  }
862
866
  export { ErrorEvent_2 as ErrorEvent }
863
867
 
868
+ /**
869
+ * Returns the escaped HTML string of the input string.
870
+ * @param unsafe - The unsafe HTML string to escape.
871
+ * @returns The escaped HTML string.
872
+ */
873
+ export declare function escapeHtml(unsafe: string): string;
874
+
864
875
  /**
865
876
  * Evaluates a FHIRPath expression against a resource or other object.
866
- * @param expression - The FHIRPath expression to parse.
877
+ * @param expression - The FHIRPath expression to evaluate.
867
878
  * @param input - The resource or object to evaluate the expression against.
868
879
  * @returns The result of the FHIRPath expression against the resource or object.
869
880
  */
870
- export declare function evalFhirPath(expression: string, input: unknown): unknown[];
881
+ export declare function evalFhirPath(expression: string | FhirPathAtom, input: unknown): unknown[];
871
882
 
872
883
  /**
873
884
  * Evaluates a FHIRPath expression against a resource or other object.
874
- * @param expression - The FHIRPath expression to parse.
885
+ * @param expression - The FHIRPath expression to evaluate.
875
886
  * @param input - The resource or object to evaluate the expression against.
876
887
  * @param variables - A map of variables for eval input.
888
+ * @param cache - Cache for parsed ASTs.
877
889
  * @returns The result of the FHIRPath expression against the resource or object.
878
890
  */
879
- export declare function evalFhirPathTyped(expression: string, input: TypedValue[], variables?: Record<string, TypedValue>): TypedValue[];
891
+ export declare function evalFhirPathTyped(expression: string | FhirPathAtom, input: TypedValue[], variables?: Record<string, TypedValue>, cache?: LRUCache<FhirPathAtom> | undefined): TypedValue[];
880
892
 
881
893
  /**
882
894
  * Evaluates a SQL-on-FHIR view on a set of FHIR resources.
@@ -1443,7 +1455,7 @@ export declare const forbidden: OperationOutcome;
1443
1455
  * @param options - Optional address format options.
1444
1456
  * @returns The formatted address string.
1445
1457
  */
1446
- export declare function formatAddress(address: Address, options?: AddressFormatOptions): string;
1458
+ export declare function formatAddress(address: Address | undefined, options?: AddressFormatOptions): string;
1447
1459
 
1448
1460
  /**
1449
1461
  * Formats a CodeableConcept element as a string.
@@ -1507,7 +1519,7 @@ export declare function formatHl7DateTime(isoDate: Date | string): string;
1507
1519
  * @param options - Optional name format options.
1508
1520
  * @returns The formatted name string.
1509
1521
  */
1510
- export declare function formatHumanName(name: HumanName, options?: HumanNameFormatOptions): string;
1522
+ export declare function formatHumanName(name: HumanName | undefined, options?: HumanNameFormatOptions): string;
1511
1523
 
1512
1524
  export declare function formatMoney(money: Money | undefined): string;
1513
1525
 
@@ -1703,6 +1715,8 @@ export declare function getNestedProperty(value: TypedValue | undefined, key: st
1703
1715
  withPath?: false;
1704
1716
  }): (TypedValue | TypedValue[] | undefined)[];
1705
1717
 
1718
+ export declare function getParsedExpressionForResourceType(resourceType: string, expression: string): FhirPathAtom;
1719
+
1706
1720
  /**
1707
1721
  * Returns the difference between two paths which is often suitable to use as a key in a `Record<string, InternalSchemaElement>`
1708
1722
  * @param parentPath - The parent path that will be removed from `path`.
@@ -2490,6 +2504,13 @@ export declare function isTextObject(value: unknown): value is {
2490
2504
  text: string;
2491
2505
  };
2492
2506
 
2507
+ /**
2508
+ * Returns true if the value is a TypedValue.
2509
+ * @param value - The unknown value to check.
2510
+ * @returns True if the value is a TypedValue.
2511
+ */
2512
+ export declare function isTypedValue(value: unknown): value is TypedValue;
2513
+
2493
2514
  export declare function isUnauthenticated(outcome: OperationOutcome): boolean;
2494
2515
 
2495
2516
  /**
@@ -2648,10 +2669,10 @@ export declare function loadDataType(sd: StructureDefinition): void;
2648
2669
  export declare class Logger {
2649
2670
  readonly write: (msg: string) => void;
2650
2671
  readonly metadata: Record<string, any>;
2651
- level: LogLevel;
2652
- readonly options?: LoggerOptions | undefined;
2672
+ readonly options?: LoggerOptions;
2653
2673
  readonly prefix?: string;
2654
- constructor(write: (msg: string) => void, metadata?: Record<string, any>, level?: LogLevel, options?: LoggerOptions | undefined);
2674
+ level: LogLevel;
2675
+ constructor(write: (msg: string) => void, metadata?: Record<string, any>, level?: LogLevel, options?: LoggerOptions);
2655
2676
  clone(override?: LoggerConfigOverride): Logger;
2656
2677
  private getLoggerConfig;
2657
2678
  error(msg: string, data?: Record<string, any> | Error): void;
@@ -2703,13 +2724,17 @@ export declare interface LoginState {
2703
2724
  *
2704
2725
  * The zero value means no server logs will be emitted.
2705
2726
  */
2706
- export declare enum LogLevel {
2707
- NONE = 0,
2708
- ERROR = 1,
2709
- WARN = 2,
2710
- INFO = 3,
2711
- DEBUG = 4
2712
- }
2727
+ export declare const LogLevel: {
2728
+ NONE: number;
2729
+ ERROR: number;
2730
+ WARN: number;
2731
+ INFO: number;
2732
+ DEBUG: number;
2733
+ };
2734
+
2735
+ export declare type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
2736
+
2737
+ export declare const LogLevelNames: string[];
2713
2738
 
2714
2739
  export declare const LOINC = "http://loinc.org";
2715
2740
 
@@ -5007,10 +5032,12 @@ export declare const notModified: OperationOutcome;
5007
5032
  * OAuth 2.0 Client Authentication Methods
5008
5033
  * See: https://datatracker.ietf.org/doc/html/rfc7523#section-2.2
5009
5034
  */
5010
- export declare enum OAuthClientAssertionType {
5035
+ export declare const OAuthClientAssertionType: {
5011
5036
  /** Using JWTs for Client Authentication */
5012
- JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
5013
- }
5037
+ readonly JwtBearer: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
5038
+ };
5039
+
5040
+ export declare type OAuthClientAssertionType = (typeof OAuthClientAssertionType)[keyof typeof OAuthClientAssertionType];
5014
5041
 
5015
5042
  /**
5016
5043
  * OAuth 2.0 Grant Type Identifiers
@@ -5018,42 +5045,48 @@ export declare enum OAuthClientAssertionType {
5018
5045
  * JWT bearer extension: https://datatracker.ietf.org/doc/html/rfc7523
5019
5046
  * Token exchange extension: https://datatracker.ietf.org/doc/html/rfc8693
5020
5047
  */
5021
- export declare enum OAuthGrantType {
5022
- ClientCredentials = "client_credentials",
5023
- AuthorizationCode = "authorization_code",
5024
- RefreshToken = "refresh_token",
5025
- JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer",
5026
- TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange"
5027
- }
5048
+ export declare const OAuthGrantType: {
5049
+ readonly ClientCredentials: "client_credentials";
5050
+ readonly AuthorizationCode: "authorization_code";
5051
+ readonly RefreshToken: "refresh_token";
5052
+ readonly JwtBearer: "urn:ietf:params:oauth:grant-type:jwt-bearer";
5053
+ readonly TokenExchange: "urn:ietf:params:oauth:grant-type:token-exchange";
5054
+ };
5055
+
5056
+ export declare type OAuthGrantType = (typeof OAuthGrantType)[keyof typeof OAuthGrantType];
5028
5057
 
5029
5058
  /**
5030
5059
  * OAuth 2.0 Client Authentication Methods
5031
5060
  * See: https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication
5032
5061
  */
5033
- export declare enum OAuthTokenAuthMethod {
5034
- ClientSecretBasic = "client_secret_basic",
5035
- ClientSecretPost = "client_secret_post",
5036
- ClientSecretJwt = "client_secret_jwt",
5037
- PrivateKeyJwt = "private_key_jwt",
5038
- None = "none"
5039
- }
5062
+ export declare const OAuthTokenAuthMethod: {
5063
+ readonly ClientSecretBasic: "client_secret_basic";
5064
+ readonly ClientSecretPost: "client_secret_post";
5065
+ readonly ClientSecretJwt: "client_secret_jwt";
5066
+ readonly PrivateKeyJwt: "private_key_jwt";
5067
+ readonly None: "none";
5068
+ };
5069
+
5070
+ export declare type OAuthTokenAuthMethod = (typeof OAuthTokenAuthMethod)[keyof typeof OAuthTokenAuthMethod];
5040
5071
 
5041
5072
  /**
5042
5073
  * OAuth 2.0 Token Type Identifiers
5043
5074
  * See: https://datatracker.ietf.org/doc/html/rfc8693#name-token-type-identifiers
5044
5075
  */
5045
- export declare enum OAuthTokenType {
5076
+ export declare const OAuthTokenType: {
5046
5077
  /** Indicates that the token is an OAuth 2.0 access token issued by the given authorization server. */
5047
- AccessToken = "urn:ietf:params:oauth:token-type:access_token",
5078
+ readonly AccessToken: "urn:ietf:params:oauth:token-type:access_token";
5048
5079
  /** Indicates that the token is an OAuth 2.0 refresh token issued by the given authorization server. */
5049
- RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token",
5080
+ readonly RefreshToken: "urn:ietf:params:oauth:token-type:refresh_token";
5050
5081
  /** Indicates that the token is an ID Token as defined in Section 2 of [OpenID.Core]. */
5051
- IdToken = "urn:ietf:params:oauth:token-type:id_token",
5082
+ readonly IdToken: "urn:ietf:params:oauth:token-type:id_token";
5052
5083
  /** Indicates that the token is a base64url-encoded SAML 1.1 [OASIS.saml-core-1.1] assertion. */
5053
- Saml1Token = "urn:ietf:params:oauth:token-type:saml1",
5084
+ readonly Saml1Token: "urn:ietf:params:oauth:token-type:saml1";
5054
5085
  /** Indicates that the token is a base64url-encoded SAML 2.0 [OASIS.saml-core-2.0-os] assertion. */
5055
- Saml2Token = "urn:ietf:params:oauth:token-type:saml2"
5056
- }
5086
+ readonly Saml2Token: "urn:ietf:params:oauth:token-type:saml2";
5087
+ };
5088
+
5089
+ export declare type OAuthTokenType = (typeof OAuthTokenType)[keyof typeof OAuthTokenType];
5057
5090
 
5058
5091
  export declare class OperationOutcomeError extends Error {
5059
5092
  readonly outcome: OperationOutcome;
@@ -5079,31 +5112,33 @@ export declare function operationOutcomeToString(outcome: OperationOutcome): str
5079
5112
  * These operators represent "modifiers" and "prefixes" in FHIR search.
5080
5113
  * See: https://www.hl7.org/fhir/search.html
5081
5114
  */
5082
- export declare enum Operator {
5083
- EQUALS = "eq",
5084
- NOT_EQUALS = "ne",
5085
- GREATER_THAN = "gt",
5086
- LESS_THAN = "lt",
5087
- GREATER_THAN_OR_EQUALS = "ge",
5088
- LESS_THAN_OR_EQUALS = "le",
5089
- STARTS_AFTER = "sa",
5090
- ENDS_BEFORE = "eb",
5091
- APPROXIMATELY = "ap",
5092
- CONTAINS = "contains",
5093
- STARTS_WITH = "sw",
5094
- EXACT = "exact",
5095
- TEXT = "text",
5096
- NOT = "not",
5097
- ABOVE = "above",
5098
- BELOW = "below",
5099
- IN = "in",
5100
- NOT_IN = "not-in",
5101
- OF_TYPE = "of-type",
5102
- MISSING = "missing",
5103
- PRESENT = "present",
5104
- IDENTIFIER = "identifier",
5105
- ITERATE = "iterate"
5106
- }
5115
+ export declare const Operator: {
5116
+ readonly EQUALS: "eq";
5117
+ readonly NOT_EQUALS: "ne";
5118
+ readonly GREATER_THAN: "gt";
5119
+ readonly LESS_THAN: "lt";
5120
+ readonly GREATER_THAN_OR_EQUALS: "ge";
5121
+ readonly LESS_THAN_OR_EQUALS: "le";
5122
+ readonly STARTS_AFTER: "sa";
5123
+ readonly ENDS_BEFORE: "eb";
5124
+ readonly APPROXIMATELY: "ap";
5125
+ readonly CONTAINS: "contains";
5126
+ readonly STARTS_WITH: "sw";
5127
+ readonly EXACT: "exact";
5128
+ readonly TEXT: "text";
5129
+ readonly NOT: "not";
5130
+ readonly ABOVE: "above";
5131
+ readonly BELOW: "below";
5132
+ readonly IN: "in";
5133
+ readonly NOT_IN: "not-in";
5134
+ readonly OF_TYPE: "of-type";
5135
+ readonly MISSING: "missing";
5136
+ readonly PRESENT: "present";
5137
+ readonly IDENTIFIER: "identifier";
5138
+ readonly ITERATE: "iterate";
5139
+ };
5140
+
5141
+ export declare type Operator = (typeof Operator)[keyof typeof Operator];
5107
5142
 
5108
5143
  /**
5109
5144
  * Operator precedence
@@ -5713,21 +5748,24 @@ export declare function satisfiedAccessPolicy(resource: Resource, interaction: A
5713
5748
  export declare interface SearchParameterDetails {
5714
5749
  readonly type: SearchParameterType;
5715
5750
  readonly elementDefinitions?: InternalSchemaElement[];
5751
+ readonly parsedExpression: FhirPathAtom;
5716
5752
  readonly array?: boolean;
5717
5753
  }
5718
5754
 
5719
- export declare enum SearchParameterType {
5720
- BOOLEAN = "BOOLEAN",
5721
- NUMBER = "NUMBER",
5722
- QUANTITY = "QUANTITY",
5723
- TEXT = "TEXT",
5724
- REFERENCE = "REFERENCE",
5725
- CANONICAL = "CANONICAL",
5726
- DATE = "DATE",
5727
- DATETIME = "DATETIME",
5728
- PERIOD = "PERIOD",
5729
- UUID = "UUID"
5730
- }
5755
+ export declare const SearchParameterType: {
5756
+ readonly BOOLEAN: "BOOLEAN";
5757
+ readonly NUMBER: "NUMBER";
5758
+ readonly QUANTITY: "QUANTITY";
5759
+ readonly TEXT: "TEXT";
5760
+ readonly REFERENCE: "REFERENCE";
5761
+ readonly CANONICAL: "CANONICAL";
5762
+ readonly DATE: "DATE";
5763
+ readonly DATETIME: "DATETIME";
5764
+ readonly PERIOD: "PERIOD";
5765
+ readonly UUID: "UUID";
5766
+ };
5767
+
5768
+ export declare type SearchParameterType = (typeof SearchParameterType)[keyof typeof SearchParameterType];
5731
5769
 
5732
5770
  export declare interface SearchRequest<T extends Resource = Resource> {
5733
5771
  readonly resourceType: T['resourceType'];
@@ -6088,7 +6126,7 @@ export declare class Tokenizer {
6088
6126
  private consumeMultiLineComment;
6089
6127
  private consumeSingleLineComment;
6090
6128
  private consumeString;
6091
- private consumeBacktickSymbol;
6129
+ private consumeQuotedSymbol;
6092
6130
  private consumeDateTime;
6093
6131
  private consumeNumber;
6094
6132
  private consumeSymbol;