@ovok/core 0.4.49-dev.527 → 0.4.49-dev.529
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/client/observation/observation-coding.js +4 -1
- package/dist/client/observation/services/base-observation-service.js +6 -2
- package/dist/client/observation/services/blood-oxygen.js +8 -0
- package/dist/client/observation/services/ecg.d.ts +1 -3
- package/dist/client/observation/services/ecg.js +0 -10
- package/dist/client/observation/types/ObservationCode.d.ts +2 -0
- package/dist/client/observation/types/ObservationCode.js +2 -0
- package/dist/client/observation/types/measurement/PulseOximeterMeasurement.d.ts +2 -0
- package/dist/conformance/capability-requirements.js +1 -1
- package/package.json +1 -1
|
@@ -20,7 +20,10 @@ const UCUM_CODES = {
|
|
|
20
20
|
/** A quantity in `unit`, coded in UCUM when the unit has a UCUM code. */
|
|
21
21
|
const ucumQuantity = (value, unit) => {
|
|
22
22
|
const code = UCUM_CODES[unit];
|
|
23
|
-
|
|
23
|
+
if (code) {
|
|
24
|
+
return { value, unit, system: fhir_systems_1.UCUM_SYSTEM, code };
|
|
25
|
+
}
|
|
26
|
+
return unit ? { value, unit } : { value };
|
|
24
27
|
};
|
|
25
28
|
exports.ucumQuantity = ucumQuantity;
|
|
26
29
|
const CATEGORY_BY_TYPE = {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseObservationService = void 0;
|
|
4
|
+
const MeasurementTypes_1 = require("../../../types/MeasurementTypes");
|
|
4
5
|
const fhir_systems_1 = require("../fhir-systems");
|
|
5
6
|
const observation_coding_1 = require("../observation-coding");
|
|
6
7
|
const measurement_time_1 = require("./measurement-time");
|
|
8
|
+
/** Waveforms are coded in the ISO/IEEE 11073 nomenclature, everything else in LOINC. */
|
|
9
|
+
const MDC_CODES = new Set([MeasurementTypes_1.ObservationCode.ECG, MeasurementTypes_1.ObservationCode.PULSE_WAVE]);
|
|
10
|
+
const systemOf = (code) => (MDC_CODES.has(code) ? fhir_systems_1.MDC_SYSTEM : fhir_systems_1.LOINC_SYSTEM);
|
|
7
11
|
class BaseObservationService {
|
|
8
12
|
getFields() {
|
|
9
13
|
return this.observationMetadata.map(({ valueKey, primaryCode, unit, toFixed, display }) => ({
|
|
@@ -41,12 +45,12 @@ class BaseObservationService {
|
|
|
41
45
|
{
|
|
42
46
|
code: metadata.primaryCode,
|
|
43
47
|
display: metadata.display,
|
|
44
|
-
system:
|
|
48
|
+
system: systemOf(metadata.primaryCode),
|
|
45
49
|
},
|
|
46
50
|
...metadata.additionalCodes.map((code) => ({
|
|
47
51
|
code,
|
|
48
52
|
display: metadata.display,
|
|
49
|
-
system:
|
|
53
|
+
system: systemOf(code),
|
|
50
54
|
})),
|
|
51
55
|
],
|
|
52
56
|
text: metadata.display,
|
|
@@ -25,6 +25,14 @@ class BloodOxygenService extends base_observation_service_1.BaseObservationServi
|
|
|
25
25
|
valueKey: "pulseRate",
|
|
26
26
|
toFixed: 0,
|
|
27
27
|
},
|
|
28
|
+
{
|
|
29
|
+
primaryCode: MeasurementTypes_1.ObservationCode.PULSE_WAVE,
|
|
30
|
+
additionalCodes: [],
|
|
31
|
+
display: "Pulse wave",
|
|
32
|
+
unit: "",
|
|
33
|
+
valueKey: "pulseWave",
|
|
34
|
+
toFixed: 0,
|
|
35
|
+
},
|
|
28
36
|
];
|
|
29
37
|
}
|
|
30
38
|
getMeasurementDisplay(measurement) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Observation } from "@medplum/fhirtypes";
|
|
2
2
|
import { EcgMeasurement, Measurement, MeasurementTypeKey } from "../../../types/MeasurementTypes";
|
|
3
3
|
import { ObservationFragment } from "../types/generate-observation-body/ObservationFragment";
|
|
4
4
|
import { ObservationValue } from "../types/generate-observation-body/ObservationValue";
|
|
@@ -12,8 +12,6 @@ export declare class EcgService extends BaseObservationService<EcgMeasurement> {
|
|
|
12
12
|
/** Expand long recordings into bounded, timestamped observations. */
|
|
13
13
|
generateObservationFragments(measurement: Measurement): ObservationFragment[];
|
|
14
14
|
getAdditionalProperties(measurement: Measurement): Partial<Observation>[];
|
|
15
|
-
/** The waveform is coded in the ISO/IEEE 11073 nomenclature, not LOINC. */
|
|
16
|
-
getObservationCodes(): CodeableConcept[];
|
|
17
15
|
getMeasurementDisplay(measurement: Measurement): string;
|
|
18
16
|
getObservationDisplay(observations: Observation[]): string | undefined;
|
|
19
17
|
convertSamplesToMeasurement(): EcgMeasurement;
|
|
@@ -92,16 +92,6 @@ class EcgService extends base_observation_service_1.BaseObservationService {
|
|
|
92
92
|
];
|
|
93
93
|
return additionalProperties;
|
|
94
94
|
}
|
|
95
|
-
/** The waveform is coded in the ISO/IEEE 11073 nomenclature, not LOINC. */
|
|
96
|
-
getObservationCodes() {
|
|
97
|
-
return super.getObservationCodes().map((concept) => {
|
|
98
|
-
var _a;
|
|
99
|
-
return ({
|
|
100
|
-
...concept,
|
|
101
|
-
coding: (_a = concept.coding) === null || _a === void 0 ? void 0 : _a.map((coding) => coding.code === MeasurementTypes_1.ObservationCode.ECG ? { ...coding, system: fhir_systems_1.MDC_SYSTEM } : coding),
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
95
|
getMeasurementDisplay(measurement) {
|
|
106
96
|
const castedMeasurement = this.getCastedMeasurement(measurement);
|
|
107
97
|
return castedMeasurement.diagnosticResult || "Unknown";
|
|
@@ -38,6 +38,8 @@ export declare enum ObservationCode {
|
|
|
38
38
|
BODY_TEMPERATURE = "8310-5",
|
|
39
39
|
/** ECG waveform. */
|
|
40
40
|
ECG = "131328",
|
|
41
|
+
/** A pulse oximeter's pulse wave (plethysmogram). */
|
|
42
|
+
PULSE_WAVE = "150452",
|
|
41
43
|
/** Respiratory rate. */
|
|
42
44
|
RESPIRATORY_RATE = "9279-1",
|
|
43
45
|
/** Spirometry panel. */
|
|
@@ -42,6 +42,8 @@ var ObservationCode;
|
|
|
42
42
|
ObservationCode["BODY_TEMPERATURE"] = "8310-5";
|
|
43
43
|
/** ECG waveform. */
|
|
44
44
|
ObservationCode["ECG"] = "131328";
|
|
45
|
+
/** A pulse oximeter's pulse wave (plethysmogram). */
|
|
46
|
+
ObservationCode["PULSE_WAVE"] = "150452";
|
|
45
47
|
/** Respiratory rate. */
|
|
46
48
|
ObservationCode["RESPIRATORY_RATE"] = "9279-1";
|
|
47
49
|
/** Spirometry panel. */
|
|
@@ -16,4 +16,6 @@ export type PulseOximeterMeasurement = Measurement & {
|
|
|
16
16
|
bloodOxygen?: number;
|
|
17
17
|
/** Perfusion index. */
|
|
18
18
|
perfusionIndex?: number;
|
|
19
|
+
/** One pulse wave sample, in the sensor's own units; a series holds the wave at the sensor's rate. */
|
|
20
|
+
pulseWave?: number;
|
|
19
21
|
};
|
|
@@ -26,7 +26,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
26
26
|
description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
|
|
27
27
|
software: {
|
|
28
28
|
name: "@ovok/core",
|
|
29
|
-
version: "0.4.49-dev.
|
|
29
|
+
version: "0.4.49-dev.529+50057ff",
|
|
30
30
|
},
|
|
31
31
|
fhirVersion: "4.0.1",
|
|
32
32
|
format: ["json"],
|