@medplum/core 0.9.12 → 0.9.15

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.
@@ -1,4 +1,4 @@
1
- import { Patient, Practitioner, QuestionnaireResponse, QuestionnaireResponseItemAnswer, Reference, RelatedPerson, Resource } from '@medplum/fhirtypes';
1
+ import { CodeableConcept, ObservationDefinition, ObservationDefinitionQualifiedInterval, Patient, Practitioner, QuestionnaireResponse, QuestionnaireResponseItemAnswer, Range, Reference, RelatedPerson, Resource } from '@medplum/fhirtypes';
2
2
  export declare type ProfileResource = Patient | Practitioner | RelatedPerson;
3
3
  /**
4
4
  * Creates a reference resource.
@@ -141,3 +141,73 @@ export declare function arrayBufferToHex(arrayBuffer: ArrayBuffer): string;
141
141
  export declare function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string;
142
142
  export declare function capitalize(word: string): string;
143
143
  export declare function isLowerCase(c: string): boolean;
144
+ /**
145
+ * Tries to find a code string for a given system within a given codeable concept.
146
+ * @param concept The codeable concept.
147
+ * @param system The system string.
148
+ * @returns The code if found; otherwise undefined.
149
+ */
150
+ export declare function getCodeBySystem(concept: CodeableConcept, system: string): string | undefined;
151
+ /**
152
+ * Sets a code for a given system within a given codeable concept.
153
+ * @param concept The codeable concept.
154
+ * @param system The system string.
155
+ * @param code The code value.
156
+ */
157
+ export declare function setCodeBySystem(concept: CodeableConcept, system: string, code: string): void;
158
+ /**
159
+ * Tries to find an observation interval for the given patient and value.
160
+ * @param definition The observation definition.
161
+ * @param patient The patient.
162
+ * @param value The observation value.
163
+ * @returns The observation interval if found; otherwise undefined.
164
+ */
165
+ export declare function findObservationInterval(definition: ObservationDefinition, patient: Patient, value: number, category?: 'reference' | 'critical' | 'absolute'): ObservationDefinitionQualifiedInterval | undefined;
166
+ /**
167
+ * Returns true if the value is in the range accounting for precision.
168
+ * @param value The numeric value.
169
+ * @param range The numeric range.
170
+ * @param precision Optional precision in number of digits.
171
+ * @returns True if the value is within the range.
172
+ */
173
+ export declare function matchesRange(value: number, range: Range, precision?: number): boolean;
174
+ /**
175
+ * Returns true if the two numbers are equal to the given precision.
176
+ * @param a The first number.
177
+ * @param b The second number.
178
+ * @param precision Optional precision in number of digits.
179
+ * @returns True if the two numbers are equal to the given precision.
180
+ */
181
+ export declare function preciseEquals(a: number, b: number, precision?: number): boolean;
182
+ /**
183
+ * Returns true if the first number is less than the second number to the given precision.
184
+ * @param a The first number.
185
+ * @param b The second number.
186
+ * @param precision Optional precision in number of digits.
187
+ * @returns True if the first number is less than the second number to the given precision.
188
+ */
189
+ export declare function preciseLessThan(a: number, b: number, precision?: number): boolean;
190
+ /**
191
+ * Returns true if the first number is greater than the second number to the given precision.
192
+ * @param a The first number.
193
+ * @param b The second number.
194
+ * @param precision Optional precision in number of digits.
195
+ * @returns True if the first number is greater than the second number to the given precision.
196
+ */
197
+ export declare function preciseGreaterThan(a: number, b: number, precision?: number): boolean;
198
+ /**
199
+ * Returns true if the first number is less than or equal to the second number to the given precision.
200
+ * @param a The first number.
201
+ * @param b The second number.
202
+ * @param precision Optional precision in number of digits.
203
+ * @returns True if the first number is less than or equal to the second number to the given precision.
204
+ */
205
+ export declare function preciseLessThanOrEquals(a: number, b: number, precision?: number): boolean;
206
+ /**
207
+ * Returns true if the first number is greater than or equal to the second number to the given precision.
208
+ * @param a The first number.
209
+ * @param b The second number.
210
+ * @param precision Optional precision in number of digits.
211
+ * @returns True if the first number is greater than or equal to the second number to the given precision.
212
+ */
213
+ export declare function preciseGreaterThanOrEquals(a: number, b: number, precision?: number): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/core",
3
- "version": "0.9.12",
3
+ "version": "0.9.15",
4
4
  "description": "Medplum TS/JS Library",
5
5
  "author": "Medplum <hello@medplum.com>",
6
6
  "license": "Apache-2.0",
@@ -17,7 +17,7 @@
17
17
  "test": "jest"
18
18
  },
19
19
  "devDependencies": {
20
- "@medplum/fhirtypes": "0.9.12"
20
+ "@medplum/fhirtypes": "0.9.15"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "pdfmake": "0.2.5"