@ovok/core 0.2.55 → 0.2.56

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.
@@ -25,6 +25,14 @@ class BloodPressureService extends base_observation_service_1.BaseObservationSer
25
25
  valueKey: "diastolic",
26
26
  toFixed: 0,
27
27
  },
28
+ {
29
+ primaryCode: types_1.ObservationCode.MEAN_BLOOD_PRESSURE,
30
+ additionalCodes: [],
31
+ display: "Mean Arterial Pressure",
32
+ unit: "mmHg",
33
+ valueKey: "meanArterialPressure",
34
+ toFixed: 0,
35
+ },
28
36
  {
29
37
  primaryCode: types_1.ObservationCode.BLOOD_PRESSURE_HEART_RATE,
30
38
  additionalCodes: [
@@ -11,6 +11,7 @@ export declare enum ObservationCode {
11
11
  OXYGEN_SATURATION_HEART_RATE = "8889-8",
12
12
  DIASTOLIC_BLOOD_PRESSURE = "8462-4",
13
13
  SYSTOLIC_BLOOD_PRESSURE = "8480-6",
14
+ MEAN_BLOOD_PRESSURE = "8478-0",
14
15
  OXYGEN_SATURATION = "2708-6",
15
16
  OXYGEN_SATURATION_GRAPH = "2708",
16
17
  BODY_TEMPERATURE = "8310-5",
@@ -15,6 +15,7 @@ var ObservationCode;
15
15
  ObservationCode["OXYGEN_SATURATION_HEART_RATE"] = "8889-8";
16
16
  ObservationCode["DIASTOLIC_BLOOD_PRESSURE"] = "8462-4";
17
17
  ObservationCode["SYSTOLIC_BLOOD_PRESSURE"] = "8480-6";
18
+ ObservationCode["MEAN_BLOOD_PRESSURE"] = "8478-0";
18
19
  ObservationCode["OXYGEN_SATURATION"] = "2708-6";
19
20
  ObservationCode["OXYGEN_SATURATION_GRAPH"] = "2708";
20
21
  ObservationCode["BODY_TEMPERATURE"] = "8310-5";
@@ -5,6 +5,8 @@ export type BloodPressureMeasurement = Measurement & {
5
5
  measurementTypeKey: MeasurementTypeKey.bloodPressure;
6
6
  diastolic?: number;
7
7
  systolic?: number;
8
+ /** Mean arterial pressure, in mmHg. Reported by the device rather than derived. */
9
+ meanArterialPressure?: number;
8
10
  heartRate?: number;
9
11
  status?: BloodPressureStates;
10
12
  };
@@ -4,4 +4,11 @@ export type MeasurementDevice = {
4
4
  manufacturerData: string;
5
5
  sn: string;
6
6
  id: string;
7
+ /**
8
+ * Remaining charge, 0 to 100.
9
+ *
10
+ * Device state rather than a patient observation, so it travels with the device on an
11
+ * observation instead of becoming a measurement of its own.
12
+ */
13
+ batteryPercentage?: number;
7
14
  };
@@ -1,6 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDeviceObject = void 0;
4
+ const EXTENSION_BASE_URL = "http://ovok.com/fhir/StructureDefinition";
5
+ const LOCAL_NAME_URL = `${EXTENSION_BASE_URL}/device-local-name`;
6
+ const MANUFACTURER_DATA_URL = `${EXTENSION_BASE_URL}/device-manufacturer-data`;
7
+ const SERIAL_NUMBER_URL = `${EXTENSION_BASE_URL}/device-serial-number`;
8
+ const BATTERY_PERCENTAGE_URL = `${EXTENSION_BASE_URL}/device-battery-percentage`;
9
+ /**
10
+ * The battery extension is omitted rather than defaulted when the device did not report
11
+ * one, because a placeholder charge level would read as a real reading.
12
+ */
13
+ const getBatteryExtension = (batteryPercentage) => {
14
+ if (batteryPercentage === undefined) {
15
+ return [];
16
+ }
17
+ return [
18
+ {
19
+ url: BATTERY_PERCENTAGE_URL,
20
+ valueInteger: batteryPercentage,
21
+ },
22
+ ];
23
+ };
4
24
  const getDeviceObject = (measurementDevice) => {
5
25
  var _a, _b;
6
26
  if (!measurementDevice) {
@@ -17,17 +37,18 @@ const getDeviceObject = (measurementDevice) => {
17
37
  display: (_b = measurementDevice.name) !== null && _b !== void 0 ? _b : "no-name",
18
38
  extension: [
19
39
  {
20
- url: "http://ovok.com/fhir/StructureDefinition/device-local-name",
40
+ url: LOCAL_NAME_URL,
21
41
  valueString: measurementDevice.localName || "no-local-name",
22
42
  },
23
43
  {
24
- url: "http://ovok.com/fhir/StructureDefinition/device-manufacturer-data",
44
+ url: MANUFACTURER_DATA_URL,
25
45
  valueString: measurementDevice.manufacturerData || "no-manufacturer-data",
26
46
  },
27
47
  {
28
- url: "http://ovok.com/fhir/StructureDefinition/device-serial-number",
48
+ url: SERIAL_NUMBER_URL,
29
49
  valueString: measurementDevice.sn || "no-serial-number",
30
50
  },
51
+ ...getBatteryExtension(measurementDevice.batteryPercentage),
31
52
  ],
32
53
  };
33
54
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.2.55",
3
+ "version": "0.2.56",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",