@ovok/core 0.4.18 → 0.4.20

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,3 +1,12 @@
1
+ /**
2
+ * Metadata attached to generated FHIR Observations.
3
+ *
4
+ * `id` is a runtime identifier used to associate measurements with a device. It is
5
+ * not persisted as `Observation.device.identifier`, because its meaning can vary by
6
+ * platform (for example, a Bluetooth address on Android and a local UUID on iOS).
7
+ * The manufacturer-reported serial number (`sn`) is used for that FHIR identifier
8
+ * when available; otherwise, the identifier is omitted.
9
+ */
1
10
  export type MeasurementDevice = {
2
11
  name: string;
3
12
  localName: string;
@@ -5,6 +14,7 @@ export type MeasurementDevice = {
5
14
  manufacturerName?: string;
6
15
  model?: string;
7
16
  sn: string;
17
+ /** Runtime association key; not written to the FHIR device identifier. */
8
18
  id: string;
9
19
  /**
10
20
  * Remaining charge, 0 to 100.
@@ -30,7 +30,7 @@ const getOptionalStringExtension = (url, value) => {
30
30
  return [{ url, valueString: value }];
31
31
  };
32
32
  const getDeviceObject = (measurementDevice) => {
33
- var _a, _b;
33
+ var _a;
34
34
  if (!measurementDevice) {
35
35
  return {
36
36
  identifier: {
@@ -39,10 +39,14 @@ const getDeviceObject = (measurementDevice) => {
39
39
  };
40
40
  }
41
41
  return {
42
- identifier: {
43
- value: (_a = measurementDevice.id) !== null && _a !== void 0 ? _a : "-1",
44
- },
45
- display: (_b = measurementDevice.name) !== null && _b !== void 0 ? _b : "no-name",
42
+ ...(measurementDevice.sn
43
+ ? {
44
+ identifier: {
45
+ value: measurementDevice.sn,
46
+ },
47
+ }
48
+ : {}),
49
+ display: (_a = measurementDevice.name) !== null && _a !== void 0 ? _a : "no-name",
46
50
  extension: [
47
51
  {
48
52
  url: LOCAL_NAME_URL,
@@ -43,7 +43,7 @@ async function getPatientLatestObservations(params = {}) {
43
43
  patient: params.patient,
44
44
  max: params.max,
45
45
  code,
46
- })}`);
46
+ })}`, { cache: "no-cache" });
47
47
  }
48
48
  async function getPatientDeviceTelemetry(deviceId) {
49
49
  return this.get(`/fhir/Device/${segment(deviceId)}/telemetry`);
@@ -48,7 +48,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
48
48
  description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
49
49
  software: {
50
50
  name: "@ovok/core",
51
- version: "0.4.18",
51
+ version: "0.4.20",
52
52
  },
53
53
  fhirVersion: "4.0.1",
54
54
  format: ["json"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.4.18",
3
+ "version": "0.4.20",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,6 +11,7 @@
11
11
  "test": "jest",
12
12
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
13
13
  "build": "rm -rf dist && tsc",
14
+ "docs:api-reference": "node scripts/generate-api-reference.mjs",
14
15
  "verify:package": "node scripts/verify-package.mjs",
15
16
  "prepare": "yarn lint && yarn build",
16
17
  "release": "release-it"