@ovok/core 0.2.56 → 0.2.58
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.
|
@@ -33,10 +33,14 @@ class EcgService extends base_observation_service_1.BaseObservationService {
|
|
|
33
33
|
const heartRate = castedMeasurement.heartRate;
|
|
34
34
|
const diagramPoints = castedMeasurement.diagramPoints;
|
|
35
35
|
if (diagramPoints === null || diagramPoints === void 0 ? void 0 : diagramPoints.length) {
|
|
36
|
+
const duration = castedMeasurement.duration;
|
|
37
|
+
const period = typeof duration === "number" && Number.isFinite(duration) && duration > 0
|
|
38
|
+
? (duration * 1000) / diagramPoints.length
|
|
39
|
+
: 1;
|
|
36
40
|
values.push({
|
|
37
41
|
valueSampledData: {
|
|
38
42
|
origin: { value: 0, unit: "mV" },
|
|
39
|
-
period
|
|
43
|
+
period,
|
|
40
44
|
dimensions: 1,
|
|
41
45
|
data: diagramPoints.join(" "),
|
|
42
46
|
},
|
|
@@ -76,7 +80,12 @@ class EcgService extends base_observation_service_1.BaseObservationService {
|
|
|
76
80
|
],
|
|
77
81
|
},
|
|
78
82
|
id: "measurement-duration",
|
|
79
|
-
|
|
83
|
+
valueQuantity: {
|
|
84
|
+
value: castedMeasurement.duration,
|
|
85
|
+
unit: "s",
|
|
86
|
+
code: "s",
|
|
87
|
+
system: "http://unitsofmeasure.org",
|
|
88
|
+
},
|
|
80
89
|
},
|
|
81
90
|
],
|
|
82
91
|
},
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CapabilityStatement } from "@medplum/fhirtypes";
|
|
2
|
+
/**
|
|
3
|
+
* What a server must support for `@ovok/core` to work.
|
|
4
|
+
*
|
|
5
|
+
* `kind: requirements` rather than `capability`, and the distinction is the
|
|
6
|
+
* whole point. A `capability` statement would describe what this SDK CAN
|
|
7
|
+
* issue — and since `OvokClient extends MedplumClient` with no narrowing, the
|
|
8
|
+
* honest answer to that is "every interaction Medplum has", which tells a
|
|
9
|
+
* consumer nothing. `requirements` inverts it: here is the surface this
|
|
10
|
+
* library itself depends on, so pointing it at a server becomes a checkable
|
|
11
|
+
* proposition rather than a hope.
|
|
12
|
+
*
|
|
13
|
+
* Scope is therefore the SDK's OWN methods. Generic CRUD reached through the
|
|
14
|
+
* inherited Medplum client is the consuming application's business: that
|
|
15
|
+
* application knows which resources it touches, and this library does not
|
|
16
|
+
* require them.
|
|
17
|
+
*
|
|
18
|
+
* `implementation` is absent deliberately — FHIR forbids it for any kind but
|
|
19
|
+
* `instance`, and a client library has no endpoint to describe anyway. It
|
|
20
|
+
* cannot serve this at `/metadata`; it is published as a static artifact and
|
|
21
|
+
* exported so a consumer can compare it against a server's own statement.
|
|
22
|
+
*
|
|
23
|
+
* NOT DESCRIBED HERE, because a CapabilityStatement structurally cannot:
|
|
24
|
+
* seven of the SDK's ten HTTP call sites are ordinary REST, not FHIR —
|
|
25
|
+
* `POST /ai/session`, `POST /ai/fhir/search`, `POST /bots?identifier=`, and
|
|
26
|
+
* the auth surface (register, change-password, reset-password, Apple and
|
|
27
|
+
* Google sign-in, account deletion). Those are OpenAPI's job and are
|
|
28
|
+
* documented there. A conformance resource pretending to carry them would be
|
|
29
|
+
* readable by no FHIR client and no OpenAPI tool.
|
|
30
|
+
*/
|
|
31
|
+
export declare const OVOK_CORE_REQUIREMENTS: CapabilityStatement;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OVOK_CORE_REQUIREMENTS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* What a server must support for `@ovok/core` to work.
|
|
6
|
+
*
|
|
7
|
+
* `kind: requirements` rather than `capability`, and the distinction is the
|
|
8
|
+
* whole point. A `capability` statement would describe what this SDK CAN
|
|
9
|
+
* issue — and since `OvokClient extends MedplumClient` with no narrowing, the
|
|
10
|
+
* honest answer to that is "every interaction Medplum has", which tells a
|
|
11
|
+
* consumer nothing. `requirements` inverts it: here is the surface this
|
|
12
|
+
* library itself depends on, so pointing it at a server becomes a checkable
|
|
13
|
+
* proposition rather than a hope.
|
|
14
|
+
*
|
|
15
|
+
* Scope is therefore the SDK's OWN methods. Generic CRUD reached through the
|
|
16
|
+
* inherited Medplum client is the consuming application's business: that
|
|
17
|
+
* application knows which resources it touches, and this library does not
|
|
18
|
+
* require them.
|
|
19
|
+
*
|
|
20
|
+
* `implementation` is absent deliberately — FHIR forbids it for any kind but
|
|
21
|
+
* `instance`, and a client library has no endpoint to describe anyway. It
|
|
22
|
+
* cannot serve this at `/metadata`; it is published as a static artifact and
|
|
23
|
+
* exported so a consumer can compare it against a server's own statement.
|
|
24
|
+
*
|
|
25
|
+
* NOT DESCRIBED HERE, because a CapabilityStatement structurally cannot:
|
|
26
|
+
* seven of the SDK's ten HTTP call sites are ordinary REST, not FHIR —
|
|
27
|
+
* `POST /ai/session`, `POST /ai/fhir/search`, `POST /bots?identifier=`, and
|
|
28
|
+
* the auth surface (register, change-password, reset-password, Apple and
|
|
29
|
+
* Google sign-in, account deletion). Those are OpenAPI's job and are
|
|
30
|
+
* documented there. A conformance resource pretending to carry them would be
|
|
31
|
+
* readable by no FHIR client and no OpenAPI tool.
|
|
32
|
+
*/
|
|
33
|
+
exports.OVOK_CORE_REQUIREMENTS = {
|
|
34
|
+
resourceType: "CapabilityStatement",
|
|
35
|
+
id: "ovok-core-requirements",
|
|
36
|
+
url: "https://fhir.ovok.com/fhir/CapabilityStatement/ovok-core-requirements",
|
|
37
|
+
name: "OvokCoreClientRequirements",
|
|
38
|
+
title: "@ovok/core — server requirements",
|
|
39
|
+
status: "active",
|
|
40
|
+
/*
|
|
41
|
+
* The date this STATEMENT was last revised, which FHIR requires and which
|
|
42
|
+
* is not "now" — a statement that restamped itself on every read would
|
|
43
|
+
* report change where there is none. Bump it with `software.version` when
|
|
44
|
+
* the declared surface actually moves.
|
|
45
|
+
*/
|
|
46
|
+
date: "2026-09-19",
|
|
47
|
+
kind: "requirements",
|
|
48
|
+
description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
|
|
49
|
+
software: {
|
|
50
|
+
name: "@ovok/core",
|
|
51
|
+
version: "0.2.57",
|
|
52
|
+
},
|
|
53
|
+
fhirVersion: "4.0.1",
|
|
54
|
+
format: ["json"],
|
|
55
|
+
rest: [
|
|
56
|
+
{
|
|
57
|
+
mode: "client",
|
|
58
|
+
documentation: "Issued by the SDK's own methods. Interactions a consuming application makes through the inherited Medplum client are not this library's requirement.",
|
|
59
|
+
interaction: [
|
|
60
|
+
{
|
|
61
|
+
code: "transaction",
|
|
62
|
+
/*
|
|
63
|
+
* `createQuestionnaireResponseWithObservations` posts a
|
|
64
|
+
* `Bundle type=transaction` carrying the QuestionnaireResponse and
|
|
65
|
+
* its Observations together. Atomicity is why it is a transaction
|
|
66
|
+
* and not a batch: a response saved without its observations is a
|
|
67
|
+
* record that reads as complete and is not.
|
|
68
|
+
*/
|
|
69
|
+
documentation: "createQuestionnaireResponseWithObservations submits one transaction Bundle so the response and its observations land together or not at all.",
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
resource: [
|
|
73
|
+
{
|
|
74
|
+
type: "Observation",
|
|
75
|
+
interaction: [{ code: "create" }],
|
|
76
|
+
operation: [
|
|
77
|
+
{
|
|
78
|
+
name: "lastn",
|
|
79
|
+
/*
|
|
80
|
+
* Ovok's own canonical, not HL7's. The server operation
|
|
81
|
+
* diverges on every parameter — `patient` as a string rather
|
|
82
|
+
* than `subject` as a Reference, `max` as a string rather than
|
|
83
|
+
* an integer, one comma-separated `code` rather than a
|
|
84
|
+
* repeating one, and no category grouping at all.
|
|
85
|
+
*/
|
|
86
|
+
definition: "https://fhir.ovok.com/fhir/OperationDefinition/observation-lastn",
|
|
87
|
+
documentation: "getLatestObservationsByCodes reads the most recent Observations per code for one patient.",
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
type: "QuestionnaireResponse",
|
|
93
|
+
interaction: [{ code: "create" }],
|
|
94
|
+
documentation: "Created as an entry of the transaction Bundle above, never on its own by this library.",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -47,3 +47,4 @@ Object.defineProperty(exports, "OvokClient", { enumerable: true, get: function (
|
|
|
47
47
|
__exportStar(require("./hooks"), exports);
|
|
48
48
|
__exportStar(require("./utils"), exports);
|
|
49
49
|
__exportStar(require("./client/observation/services"), exports);
|
|
50
|
+
__exportStar(require("./conformance/capability-requirements"), exports);
|