@ovok/native 1.17.0-dev.2237 → 1.17.0-dev.2239
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/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js +7 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js +7 -13
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js +2 -2
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js +7 -1
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js +7 -13
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts +3 -3
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts +3 -3
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -13,7 +13,7 @@ const LIVE_SLOT_MS = 1_000;
|
|
|
13
13
|
|
|
14
14
|
/** The observations a live recording was saved as, rebuilt from its span alone; a single stand-in value gives each its identifiers. */
|
|
15
15
|
const observationsOfSpan = async (client, address, span) => {
|
|
16
|
-
const patientId = await (0, _seriesSaving.
|
|
16
|
+
const patientId = await (0, _seriesSaving.ownPatientId)(client);
|
|
17
17
|
const sourceId = (0, _readingSourceId.liveSourceId)(address, span);
|
|
18
18
|
if (span.channel === null) {
|
|
19
19
|
const field = (0, _seriesSaving.seriesFieldOf)(span.metric);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_next","require","_readingSourceId","_seriesSaving","LIVE_SLOT_MS","observationsOfSpan","client","address","span","patientId","
|
|
1
|
+
{"version":3,"names":["_next","require","_readingSourceId","_seriesSaving","LIVE_SLOT_MS","observationsOfSpan","client","address","span","patientId","ownPatientId","sourceId","liveSourceId","channel","field","seriesFieldOf","metric","seriesObservationsOf","start","from","intervalMs","values","measurement","measurementTypeKey","MeasurementTypeKey","ecg","diagramPoints","duration","recordedAt","measurements","build","deleteTargetsOf","observations","flatMap","identifier","system","value","SEGMENT_IDENTIFIER_SYSTEM","replaceLiveRecordings","reading","supersedes","target","source","outbox","enqueueDelete","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/live-supersession.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA;;AAGA,MAAMG,YAAY,GAAG,KAAK;;AAE1B;AACA,MAAMC,kBAAkB,GAAG,MAAAA,CAAOC,MAA0B,EAAEC,OAAe,EAAEC,IAAc,KAA6B;EACxH,MAAMC,SAAS,GAAG,MAAM,IAAAC,0BAAY,EAACJ,MAAM,CAAC;EAC5C,MAAMK,QAAQ,GAAG,IAAAC,6BAAY,EAACL,OAAO,EAAEC,IAAI,CAAC;EAE5C,IAAIA,IAAI,CAACK,OAAO,KAAK,IAAI,EAAE;IACzB,MAAMC,KAAK,GAAG,IAAAC,2BAAa,EAACP,IAAI,CAACQ,MAAM,CAAC;IAExC,OAAOF,KAAK,GAAG,IAAAG,kCAAoB,EAACH,K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,13 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ovokOutboxWatch = void 0;
|
|
7
|
+
var _next = require("@ovok/core/next");
|
|
7
8
|
var _ports = require("../core/ports.js");
|
|
8
9
|
const idsOf = items => new Set(items.map(({
|
|
9
10
|
id
|
|
10
11
|
}) => id));
|
|
11
12
|
const itemsIn = (items, state) => idsOf(items.filter(item => item.state === state));
|
|
13
|
+
|
|
14
|
+
/** A guest's items wait for an account, not for the network, so nothing says they are waiting to upload. */
|
|
15
|
+
const uploadsIn = items => itemsIn(items.filter(({
|
|
16
|
+
ownerKey
|
|
17
|
+
}) => ownerKey !== _next.GUEST_OWNER_KEY), "pending");
|
|
12
18
|
const viewOf = (items, sent) => ({
|
|
13
|
-
waiting:
|
|
19
|
+
waiting: uploadsIn(items),
|
|
14
20
|
rejected: itemsIn(items, "rejected"),
|
|
15
21
|
sent: idsOf(sent)
|
|
16
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_next","require","_ports","idsOf","items","Set","map","id","itemsIn","state","filter","item","uploadsIn","ownerKey","GUEST_OWNER_KEY","viewOf","sent","waiting","rejected","ovokOutboxWatch","outbox","logger","silentLogger","subscribe","listener","requests","watching","stop","request","then","recentlySent","error","name","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAIA,MAAME,KAAK,GAAIC,KAAoC,IAAkB,IAAIC,GAAG,CAACD,KAAK,CAACE,GAAG,CAAC,CAAC;EAAEC;AAAG,CAAC,KAAKA,EAAE,CAAC,CAAC;AAEvG,MAAMC,OAAO,GAAGA,CAACJ,KAA0B,EAAEK,KAAkB,KAC7DN,KAAK,CAACC,KAAK,CAACM,MAAM,CAAEC,IAAI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ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.seriesObservationsOf = exports.seriesFieldOf = exports.saveSeries = exports.ownPatientId = exports.isSeriesReading = void 0;
|
|
7
7
|
var _next = require("@ovok/core/next");
|
|
8
8
|
var _errors = require("../core/errors.js");
|
|
9
9
|
var _readingSourceId = require("./reading-source-id.js");
|
|
@@ -43,23 +43,17 @@ const isSeriesReading = reading => reading.series !== undefined;
|
|
|
43
43
|
exports.isSeriesReading = isSeriesReading;
|
|
44
44
|
const seriesFieldOf = metric => SERIES_FIELDS[metric];
|
|
45
45
|
|
|
46
|
-
/** The
|
|
46
|
+
/** The patient a series is saved for: the signed-in one, or the guest while nobody is signed in. */
|
|
47
47
|
exports.seriesFieldOf = seriesFieldOf;
|
|
48
|
-
const
|
|
48
|
+
const ownPatientId = async ({
|
|
49
49
|
session
|
|
50
50
|
}) => {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
throw new _errors.DeviceError("save-failed", "Sign in to save a series");
|
|
54
|
-
}
|
|
55
|
-
const {
|
|
56
|
-
reference
|
|
57
|
-
} = current.profile;
|
|
58
|
-
return reference.slice(reference.indexOf("/") + 1);
|
|
51
|
+
const reference = (await session.current())?.profile.reference;
|
|
52
|
+
return reference ? reference.slice(reference.indexOf("/") + 1) : _next.GUEST_PATIENT_ID;
|
|
59
53
|
};
|
|
60
54
|
|
|
61
55
|
/** The observations that hold one metric's values, one per second or at the interval given. */
|
|
62
|
-
exports.
|
|
56
|
+
exports.ownPatientId = ownPatientId;
|
|
63
57
|
const seriesObservationsOf = (field, {
|
|
64
58
|
start,
|
|
65
59
|
intervalMs,
|
|
@@ -91,7 +85,7 @@ const saveSeries = async (client, reading, device) => {
|
|
|
91
85
|
...series,
|
|
92
86
|
values: series.values.map(value => value === null ? null : toOvokUnit(value))
|
|
93
87
|
}, {
|
|
94
|
-
patientId: await
|
|
88
|
+
patientId: await ownPatientId(client),
|
|
95
89
|
...(0, _readingSourceId.sourceIdsOf)(reading, device.sn),
|
|
96
90
|
device
|
|
97
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_next","require","_errors","_readingSourceId","_readingValues","SERIES_FIELDS","heart_rate","type","MeasurementTypeKey","heartRate","property","pulse_rate","bloodOxygenPulseRate","spo2","respiration_rate","respiratoryRate","body_temperature","temperature","unsupported","what","DeviceError","isSeriesReading","reading","series","undefined","exports","seriesFieldOf","metric","
|
|
1
|
+
{"version":3,"names":["_next","require","_errors","_readingSourceId","_readingValues","SERIES_FIELDS","heart_rate","type","MeasurementTypeKey","heartRate","property","pulse_rate","bloodOxygenPulseRate","spo2","respiration_rate","respiratoryRate","body_temperature","temperature","unsupported","what","DeviceError","isSeriesReading","reading","series","undefined","exports","seriesFieldOf","metric","ownPatientId","session","reference","current","profile","slice","indexOf","GUEST_PATIENT_ID","seriesObservationsOf","field","start","intervalMs","values","rest","seriesObservations","measurementTypeKey","periodMs","saveSeries","client","device","toOvokUnit","TO_OVOK_UNIT","unit","observations","map","value","patientId","sourceIdsOf","sn","measurements","saveObservations"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/series-saving.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAUA,IAAAC,OAAA,GAAAD,OAAA;AAIA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAIA;;AAGA;;AAGA;;AAGA,MAAMI,aAAuD,GAAG;EAC9DC,UAAU,EAAE;IAAEC,IAAI,EAAEC,wBAAkB,CAACC,SAAS;IAAEC,QAAQ,EAAE;EAAY,CAAC;EACzEC,UAAU,EAAE;IAAEJ,IAAI,EAAEC,wBAAkB,CAACI,oBAAoB;IAAEF,QAAQ,EAAE;EAAY,CAAC;EACpFG,IAAI,EAAE;IAAEN,IAAI,EAAEC,wB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;IAAO;EAAE,CAAC;EAC7G,GAAGC;AACL,CAAC,CAAC;;AAEJ;AAAAhB,OAAA,CAAAW,oBAAA,GAAAA,oBAAA;AACA,MAAMS,UAAU,GAAG,MAAAA,CAAOC,MAAoB,EAAExB,OAAsB,EAAEyB,MAAyB,KAAsC;EACrI,MAAM;IAAExB;EAAO,CAAC,GAAGD,OAAO;EAC1B,MAAMe,KAAK,GAAGX,aAAa,CAACH,MAAM,CAACI,MAAM,CAAC;EAC1C,MAAMqB,UAAU,GAAGC,2BAAY,CAAC1B,MAAM,CAAC2B,IAAI,CAAC;EAE5C,IAAI,CAACb,KAAK,IAAI,CAACW,UAAU,EAAE;IACzB,MAAM9B,WAAW,CAAC,GAAGK,MAAM,CAACI,MAAM,OAAOJ,MAAM,CAAC2B,IAAI,EAAE,CAAC;EACzD;EAEA,MAAMC,YAAY,GAAGf,oBAAoB,CACvCC,KAAK,EACL;IAAE,GAAGd,MAAM;IAAEiB,MAAM,EAAEjB,MAAM,CAACiB,MAAM,CAACY,GAAG,CAAEC,KAAK,IAAMA,KAAK,KAAK,IAAI,GAAG,IAAI,GAAGL,UAAU,CAACK,KAAK,CAAE;EAAE,CAAC,EAChG;IAAEC,SAAS,EAAE,MAAM1B,YAAY,CAACkB,MAAM,CAAC;IAAE,GAAG,IAAAS,4BAAW,EAACjC,OAAO,EAAEyB,MAAM,CAACS,EAAE,CAAC;IAAET;EAAO,CACtF,CAAC;EAED,OAAOD,MAAM,CAACW,YAAY,CAACC,gBAAgB,CAACP,YAAY,CAAC;AAC3D,CAAC;AAAC1B,OAAA,CAAAoB,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { MeasurementTypeKey, SEGMENT_IDENTIFIER_SYSTEM } from "@ovok/core/next";
|
|
4
4
|
import { liveSourceId } from "./reading-source-id.js";
|
|
5
|
-
import { seriesFieldOf, seriesObservationsOf
|
|
5
|
+
import { ownPatientId, seriesFieldOf, seriesObservationsOf } from "./series-saving.js";
|
|
6
6
|
|
|
7
7
|
/** What queues the deletions: the outbox, with the measurements API and the session that name what to delete. */
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ const LIVE_SLOT_MS = 1_000;
|
|
|
10
10
|
|
|
11
11
|
/** The observations a live recording was saved as, rebuilt from its span alone; a single stand-in value gives each its identifiers. */
|
|
12
12
|
const observationsOfSpan = async (client, address, span) => {
|
|
13
|
-
const patientId = await
|
|
13
|
+
const patientId = await ownPatientId(client);
|
|
14
14
|
const sourceId = liveSourceId(address, span);
|
|
15
15
|
if (span.channel === null) {
|
|
16
16
|
const field = seriesFieldOf(span.metric);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","SEGMENT_IDENTIFIER_SYSTEM","liveSourceId","
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","SEGMENT_IDENTIFIER_SYSTEM","liveSourceId","ownPatientId","seriesFieldOf","seriesObservationsOf","LIVE_SLOT_MS","observationsOfSpan","client","address","span","patientId","sourceId","channel","field","metric","start","from","intervalMs","values","measurement","measurementTypeKey","ecg","diagramPoints","duration","recordedAt","measurements","build","deleteTargetsOf","observations","flatMap","identifier","system","value","replaceLiveRecordings","reading","supersedes","target","source","outbox","enqueueDelete"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/live-supersession.ts"],"mappings":";;AAAA,SAAyBA,kBAAkB,EAAQC,yBAAyB,QAAQ,iBAAiB;AAMrG,SAASC,YAAY,QAAQ,wBAAqB;AAClD,SAASC,YAAY,EAAEC,aAAa,EAAEC,oBAAoB,QAAQ,oBAAiB;;AAEnF;;AAGA,MAAMC,YAAY,GAAG,KAAK;;AAE1B;AACA,MAAMC,kBAAkB,GAAG,MAAAA,CAAOC,MAA0B,EAAEC,OAAe,EAAEC,IAAc,KAA6B;EACxH,MAAMC,SAAS,GAAG,MAAMR,YAAY,CAACK,MAAM,CAAC;EAC5C,MAAMI,QAAQ,GAA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M,CAAC7B,OAAO,EAAEC,IAAI,CAAC,CAAC,EAAE;MACpG,MAAMF,MAAM,CAAC+B,MAAM,CAACC,aAAa,CAACH,MAAM,CAAC;IAC3C;EACF;AACF,CAAC;AAED,SAASH,qBAAqB","ignoreList":[]}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { GUEST_OWNER_KEY } from "@ovok/core/next";
|
|
3
4
|
import { silentLogger } from "../core/ports.js";
|
|
4
5
|
const idsOf = items => new Set(items.map(({
|
|
5
6
|
id
|
|
6
7
|
}) => id));
|
|
7
8
|
const itemsIn = (items, state) => idsOf(items.filter(item => item.state === state));
|
|
9
|
+
|
|
10
|
+
/** A guest's items wait for an account, not for the network, so nothing says they are waiting to upload. */
|
|
11
|
+
const uploadsIn = items => itemsIn(items.filter(({
|
|
12
|
+
ownerKey
|
|
13
|
+
}) => ownerKey !== GUEST_OWNER_KEY), "pending");
|
|
8
14
|
const viewOf = (items, sent) => ({
|
|
9
|
-
waiting:
|
|
15
|
+
waiting: uploadsIn(items),
|
|
10
16
|
rejected: itemsIn(items, "rejected"),
|
|
11
17
|
sent: idsOf(sent)
|
|
12
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["silentLogger","idsOf","items","Set","map","id","itemsIn","state","filter","item","viewOf","sent","waiting","rejected","ovokOutboxWatch","outbox","logger","subscribe","listener","requests","watching","stop","request","then","recentlySent","error","name"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["GUEST_OWNER_KEY","silentLogger","idsOf","items","Set","map","id","itemsIn","state","filter","item","uploadsIn","ownerKey","viewOf","sent","waiting","rejected","ovokOutboxWatch","outbox","logger","subscribe","listener","requests","watching","stop","request","then","recentlySent","error","name"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"mappings":";;AAA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AC,CAAC,CAAC,CAAC;QAChD;MACF,CAAC,EACAC,KAAc,IAAKT,MAAM,CAACS,KAAK,CAAC,+BAA+B,EAAE;QAAEA,KAAK,EAAGA,KAAK,CAAWC;MAAK,CAAC,CACpG,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,MAAM;MACXN,QAAQ,GAAG,KAAK;MAChBC,IAAI,CAAC,CAAC;IACR,CAAC;EACH;AACF,CAAC,CAAC;AAEF,SAASP,eAAe","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { MeasurementTypeKey, seriesObservations } from "@ovok/core/next";
|
|
3
|
+
import { GUEST_PATIENT_ID, MeasurementTypeKey, seriesObservations } from "@ovok/core/next";
|
|
4
4
|
import { DeviceError } from "../core/errors.js";
|
|
5
5
|
import { sourceIdsOf } from "./reading-source-id.js";
|
|
6
6
|
import { TO_OVOK_UNIT } from "./reading-values.js";
|
|
@@ -39,18 +39,12 @@ const isSeriesReading = reading => reading.series !== undefined;
|
|
|
39
39
|
/** The field Ovok keeps a metric's series in; `undefined` for a metric it keeps none for. */
|
|
40
40
|
const seriesFieldOf = metric => SERIES_FIELDS[metric];
|
|
41
41
|
|
|
42
|
-
/** The
|
|
43
|
-
const
|
|
42
|
+
/** The patient a series is saved for: the signed-in one, or the guest while nobody is signed in. */
|
|
43
|
+
const ownPatientId = async ({
|
|
44
44
|
session
|
|
45
45
|
}) => {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
throw new DeviceError("save-failed", "Sign in to save a series");
|
|
49
|
-
}
|
|
50
|
-
const {
|
|
51
|
-
reference
|
|
52
|
-
} = current.profile;
|
|
53
|
-
return reference.slice(reference.indexOf("/") + 1);
|
|
46
|
+
const reference = (await session.current())?.profile.reference;
|
|
47
|
+
return reference ? reference.slice(reference.indexOf("/") + 1) : GUEST_PATIENT_ID;
|
|
54
48
|
};
|
|
55
49
|
|
|
56
50
|
/** The observations that hold one metric's values, one per second or at the interval given. */
|
|
@@ -84,11 +78,11 @@ const saveSeries = async (client, reading, device) => {
|
|
|
84
78
|
...series,
|
|
85
79
|
values: series.values.map(value => value === null ? null : toOvokUnit(value))
|
|
86
80
|
}, {
|
|
87
|
-
patientId: await
|
|
81
|
+
patientId: await ownPatientId(client),
|
|
88
82
|
...sourceIdsOf(reading, device.sn),
|
|
89
83
|
device
|
|
90
84
|
});
|
|
91
85
|
return client.measurements.saveObservations(observations);
|
|
92
86
|
};
|
|
93
|
-
export { isSeriesReading, saveSeries, seriesFieldOf, seriesObservationsOf
|
|
87
|
+
export { isSeriesReading, ownPatientId, saveSeries, seriesFieldOf, seriesObservationsOf };
|
|
94
88
|
//# sourceMappingURL=series-saving.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","seriesObservations","DeviceError","sourceIdsOf","TO_OVOK_UNIT","SERIES_FIELDS","heart_rate","type","heartRate","property","pulse_rate","bloodOxygenPulseRate","spo2","respiration_rate","respiratoryRate","body_temperature","temperature","unsupported","what","isSeriesReading","reading","series","undefined","seriesFieldOf","metric","
|
|
1
|
+
{"version":3,"names":["GUEST_PATIENT_ID","MeasurementTypeKey","seriesObservations","DeviceError","sourceIdsOf","TO_OVOK_UNIT","SERIES_FIELDS","heart_rate","type","heartRate","property","pulse_rate","bloodOxygenPulseRate","spo2","respiration_rate","respiratoryRate","body_temperature","temperature","unsupported","what","isSeriesReading","reading","series","undefined","seriesFieldOf","metric","ownPatientId","session","reference","current","profile","slice","indexOf","seriesObservationsOf","field","start","intervalMs","values","rest","measurementTypeKey","periodMs","saveSeries","client","device","toOvokUnit","unit","observations","map","value","patientId","sn","measurements","saveObservations"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/series-saving.ts"],"mappings":";;AAAA,SAEEA,gBAAgB,EAChBC,kBAAkB,EAGlBC,kBAAkB,QAEb,iBAAiB;AAExB,SAASC,WAAW,QAAQ,mBAAgB;AAI5C,SAAS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onjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ovok-outbox-watch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ovok-outbox-watch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqB,cAAc,EAA+B,MAAM,iBAAiB,CAAC;AAEtG,OAAO,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAC;AAErD,KAAK,aAAa,GAAG,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,OAAO,GAAG,cAAc,CAAC,CAAC;AAiBlF,iHAAiH;AACjH,QAAA,MAAM,eAAe,GAAI,QAAQ,aAAa,EAAE,SAAQ,MAAqB,KAAG,WAwB9E,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -15,14 +15,14 @@ type SeriesField = {
|
|
|
15
15
|
declare const isSeriesReading: (reading: Reading) => reading is SeriesReading;
|
|
16
16
|
/** The field Ovok keeps a metric's series in; `undefined` for a metric it keeps none for. */
|
|
17
17
|
declare const seriesFieldOf: (metric: string) => SeriesField | undefined;
|
|
18
|
-
/** The
|
|
19
|
-
declare const
|
|
18
|
+
/** The patient a series is saved for: the signed-in one, or the guest while nobody is signed in. */
|
|
19
|
+
declare const ownPatientId: ({ session }: Pick<Ovok, "session">) => Promise<string>;
|
|
20
20
|
/** The observations that hold one metric's values, one per second or at the interval given. */
|
|
21
21
|
declare const seriesObservationsOf: (field: SeriesField, { start, intervalMs, values }: Pick<Series, "start" | "intervalMs" | "values">, rest: Pick<SeriesObservationParams, "patientId" | "sourceId" | "formerSourceIds"> & {
|
|
22
22
|
device?: MeasurementDevice;
|
|
23
23
|
}) => import("@medplum/fhirtypes").Observation[];
|
|
24
24
|
/** Saves a series, in Ovok's unit, under a stable id; saving a longer version of it writes over the earlier one. */
|
|
25
25
|
declare const saveSeries: (client: SeriesClient, reading: SeriesReading, device: MeasurementDevice) => Promise<SaveObservationsResult>;
|
|
26
|
-
export { isSeriesReading, saveSeries, seriesFieldOf, seriesObservationsOf
|
|
26
|
+
export { isSeriesReading, ownPatientId, saveSeries, seriesFieldOf, seriesObservationsOf };
|
|
27
27
|
export type { MeasurementDevice, SeriesClient };
|
|
28
28
|
//# sourceMappingURL=series-saving.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"series-saving.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/series-saving.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"series-saving.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/series-saving.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAEvB,kBAAkB,EAClB,IAAI,EACJ,sBAAsB,EAEtB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKlD,KAAK,iBAAiB,GAAG,WAAW,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExE,2EAA2E;AAC3E,KAAK,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;AAE3D,qCAAqC;AACrC,KAAK,aAAa,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,yFAAyF;AACzF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAYlE,QAAA,MAAM,eAAe,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,aAA6C,CAAC;AAErG,6FAA6F;AAC7F,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,WAAW,GAAG,SAAgD,CAAC;AAEvG,oGAAoG;AACpG,QAAA,MAAM,YAAY,GAAU,aAAa,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,KAAG,OAAO,CAAC,MAAM,CAI9E,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,oBAAoB,GACxB,OAAO,WAAW,EAClB,+BAA+B,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC,EAC9E,MAAM,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAE,+CAKhH,CAAC;AAEL,oHAAoH;AACpH,QAAA,MAAM,UAAU,GAAU,QAAQ,YAAY,EAAE,SAAS,aAAa,EAAE,QAAQ,iBAAiB,KAAG,OAAO,CAAC,sBAAsB,CAgBjI,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC;AAC1F,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
|
package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ovok-outbox-watch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ovok-outbox-watch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqB,cAAc,EAA+B,MAAM,iBAAiB,CAAC;AAEtG,OAAO,EAAc,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAC;AAErD,KAAK,aAAa,GAAG,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,OAAO,GAAG,cAAc,CAAC,CAAC;AAiBlF,iHAAiH;AACjH,QAAA,MAAM,eAAe,GAAI,QAAQ,aAAa,EAAE,SAAQ,MAAqB,KAAG,WAwB9E,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -15,14 +15,14 @@ type SeriesField = {
|
|
|
15
15
|
declare const isSeriesReading: (reading: Reading) => reading is SeriesReading;
|
|
16
16
|
/** The field Ovok keeps a metric's series in; `undefined` for a metric it keeps none for. */
|
|
17
17
|
declare const seriesFieldOf: (metric: string) => SeriesField | undefined;
|
|
18
|
-
/** The
|
|
19
|
-
declare const
|
|
18
|
+
/** The patient a series is saved for: the signed-in one, or the guest while nobody is signed in. */
|
|
19
|
+
declare const ownPatientId: ({ session }: Pick<Ovok, "session">) => Promise<string>;
|
|
20
20
|
/** The observations that hold one metric's values, one per second or at the interval given. */
|
|
21
21
|
declare const seriesObservationsOf: (field: SeriesField, { start, intervalMs, values }: Pick<Series, "start" | "intervalMs" | "values">, rest: Pick<SeriesObservationParams, "patientId" | "sourceId" | "formerSourceIds"> & {
|
|
22
22
|
device?: MeasurementDevice;
|
|
23
23
|
}) => import("@medplum/fhirtypes").Observation[];
|
|
24
24
|
/** Saves a series, in Ovok's unit, under a stable id; saving a longer version of it writes over the earlier one. */
|
|
25
25
|
declare const saveSeries: (client: SeriesClient, reading: SeriesReading, device: MeasurementDevice) => Promise<SaveObservationsResult>;
|
|
26
|
-
export { isSeriesReading, saveSeries, seriesFieldOf, seriesObservationsOf
|
|
26
|
+
export { isSeriesReading, ownPatientId, saveSeries, seriesFieldOf, seriesObservationsOf };
|
|
27
27
|
export type { MeasurementDevice, SeriesClient };
|
|
28
28
|
//# sourceMappingURL=series-saving.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"series-saving.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/series-saving.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"series-saving.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/series-saving.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAEvB,kBAAkB,EAClB,IAAI,EACJ,sBAAsB,EAEtB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKlD,KAAK,iBAAiB,GAAG,WAAW,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExE,2EAA2E;AAC3E,KAAK,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;AAE3D,qCAAqC;AACrC,KAAK,aAAa,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,yFAAyF;AACzF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAYlE,QAAA,MAAM,eAAe,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,aAA6C,CAAC;AAErG,6FAA6F;AAC7F,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,WAAW,GAAG,SAAgD,CAAC;AAEvG,oGAAoG;AACpG,QAAA,MAAM,YAAY,GAAU,aAAa,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,KAAG,OAAO,CAAC,MAAM,CAI9E,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,oBAAoB,GACxB,OAAO,WAAW,EAClB,+BAA+B,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC,EAC9E,MAAM,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAE,+CAKhH,CAAC;AAEL,oHAAoH;AACpH,QAAA,MAAM,UAAU,GAAU,QAAQ,YAAY,EAAE,SAAS,aAAa,EAAE,QAAQ,iBAAiB,KAAG,OAAO,CAAC,sBAAsB,CAgBjI,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC;AAC1F,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovok/native",
|
|
3
|
-
"version": "1.17.0-dev.
|
|
3
|
+
"version": "1.17.0-dev.2239+63239a8",
|
|
4
4
|
"description": "React native component sdk for OVOK",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@medplum/react-hooks": "3.2.23",
|
|
106
106
|
"@opentelemetry/api": "^1.9.1",
|
|
107
107
|
"@opentelemetry/api-logs": "^0.222.0",
|
|
108
|
-
"@ovok/core": "^0.4.
|
|
108
|
+
"@ovok/core": "^0.4.55",
|
|
109
109
|
"@react-native-community/datetimepicker": "^9.1.0",
|
|
110
110
|
"@react-native-community/netinfo": "^12.0.1",
|
|
111
111
|
"@react-native-google-signin/google-signin": "^16.1.2",
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"@kingstinct/react-native-healthkit": ">=16.2.0",
|
|
191
191
|
"@opentelemetry/api": "^1.9.1",
|
|
192
192
|
"@opentelemetry/api-logs": "^0.222.0",
|
|
193
|
-
"@ovok/core": ">=0.4.
|
|
193
|
+
"@ovok/core": ">=0.4.55 || >=0.4.49-0",
|
|
194
194
|
"@react-native-community/datetimepicker": "*",
|
|
195
195
|
"@react-native-community/netinfo": "*",
|
|
196
196
|
"@react-native-google-signin/google-signin": "*",
|