@medplum/core 2.1.2 → 2.1.4
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.
- package/dist/cjs/index.cjs +4 -4
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +4 -4
- package/dist/types/constants.d.ts +6 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/search/search.d.ts +11 -0
- package/dist/types/types.d.ts +6 -0
- package/dist/types/utils.d.ts +19 -1
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const UCUM = "http://unitsofmeasure.org";
|
|
2
|
+
export declare const LOINC = "http://loinc.org";
|
|
3
|
+
export declare const SNOMED = "http://snomed.info/sct";
|
|
4
|
+
export declare const RXNORM = "http://www.nlm.nih.gov/research/umls/rxnorm";
|
|
5
|
+
export declare const CPT = "http://www.ama-assn.org/go/cpt";
|
|
6
|
+
export declare const ICD10 = "http://hl7.org/fhir/sid/icd-10";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Resource } from '@medplum/fhirtypes';
|
|
2
|
+
import { TypedValue } from '../types';
|
|
2
3
|
export declare const DEFAULT_SEARCH_COUNT = 20;
|
|
3
4
|
export interface SearchRequest<T extends Resource = Resource> {
|
|
4
5
|
readonly resourceType: T['resourceType'];
|
|
@@ -82,6 +83,16 @@ export declare function parseSearchDefinition<T extends Resource = Resource>(url
|
|
|
82
83
|
* @returns Parsed search definition.
|
|
83
84
|
*/
|
|
84
85
|
export declare function parseCriteriaAsSearchRequest(criteria: string): SearchRequest;
|
|
86
|
+
/**
|
|
87
|
+
* Parses an extended FHIR search criteria string (i.e. application/x-fhir-query), evaluating
|
|
88
|
+
* any embedded FHIRPath subexpressions (e.g. `{{ %patient.id }}`) with the provided variables.
|
|
89
|
+
*
|
|
90
|
+
* @see https://hl7.org/fhir/fhir-xquery.html
|
|
91
|
+
* @param query The X-Fhir-Query string to parse
|
|
92
|
+
* @param variables Values to pass into embedded FHIRPath expressions
|
|
93
|
+
* @returns The parsed search request
|
|
94
|
+
*/
|
|
95
|
+
export declare function parseXFhirQuery(query: string, variables: Record<string, TypedValue>): SearchRequest;
|
|
85
96
|
/**
|
|
86
97
|
* Formats a search definition object into a query string.
|
|
87
98
|
* Note: The return value does not include the resource type.
|
package/dist/types/types.d.ts
CHANGED
|
@@ -212,3 +212,9 @@ export declare function isReference(value: unknown): value is Reference & {
|
|
|
212
212
|
* Global schema singleton.
|
|
213
213
|
*/
|
|
214
214
|
export declare const globalSchema: IndexedStructureDefinition;
|
|
215
|
+
/**
|
|
216
|
+
* Output the string representation of a value, suitable for use as part of a search query.
|
|
217
|
+
* @param v The value to format as a string
|
|
218
|
+
* @returns The stringified value
|
|
219
|
+
*/
|
|
220
|
+
export declare function stringifyTypedValue(v: TypedValue): string;
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeableConcept, Extension, ObservationDefinition, ObservationDefinitionQualifiedInterval, Patient, Practitioner, QuestionnaireResponse, QuestionnaireResponseItemAnswer, Range, Reference, RelatedPerson, Resource, ResourceType } from '@medplum/fhirtypes';
|
|
1
|
+
import { CodeableConcept, Extension, Identifier, ObservationDefinition, ObservationDefinitionQualifiedInterval, Patient, Practitioner, QuestionnaireResponse, QuestionnaireResponseItemAnswer, Range, Reference, RelatedPerson, Resource, ResourceType } from '@medplum/fhirtypes';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
@@ -110,6 +110,24 @@ export declare function getAllQuestionnaireAnswers(response: QuestionnaireRespon
|
|
|
110
110
|
* @returns The identifier value if found; otherwise undefined.
|
|
111
111
|
*/
|
|
112
112
|
export declare function getIdentifier(resource: Resource, system: string): string | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Sets a resource identifier for the given system.
|
|
115
|
+
*
|
|
116
|
+
* Note that this method is only available on resources that have an "identifier" property,
|
|
117
|
+
* and that property must be an array of Identifier objects,
|
|
118
|
+
* which is not true for all FHIR resources.
|
|
119
|
+
*
|
|
120
|
+
* If the identifier already exists, then the value is updated.
|
|
121
|
+
*
|
|
122
|
+
* Otherwise a new identifier is added.
|
|
123
|
+
*
|
|
124
|
+
* @param resource The resource to add the identifier to.
|
|
125
|
+
* @param system The identifier system.
|
|
126
|
+
* @param value The identifier value.
|
|
127
|
+
*/
|
|
128
|
+
export declare function setIdentifier(resource: Resource & {
|
|
129
|
+
identifier?: Identifier[];
|
|
130
|
+
}, system: string, value: string): void;
|
|
113
131
|
/**
|
|
114
132
|
* Returns an extension value by extension URLs.
|
|
115
133
|
* @param resource The base resource.
|