@nabla/connect-protocol 0.2.0 → 0.3.0
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/commands.d.ts +3 -1
- package/dist/export.d.ts +34 -7
- package/dist/session.d.ts +14 -0
- package/dist/version.d.ts +6 -1
- package/package.json +1 -1
package/dist/commands.d.ts
CHANGED
|
@@ -2,13 +2,15 @@ import type { NablaConnectCommandExportNoteEvent, NablaConnectCommandStartNoteGe
|
|
|
2
2
|
import type { NablaConnectSessionHelloMessage } from "./session.js";
|
|
3
3
|
import type { NablaConnectProtocolVersion } from "./version.js";
|
|
4
4
|
/**
|
|
5
|
-
* `sessionId` and `requestId` are non-empty strings of at most
|
|
5
|
+
* `clientId`, `sessionId` and `requestId` are non-empty strings of at most
|
|
6
6
|
* `NablaConnectBoundedIdMaxLength` characters. `expectedRevision` is a positive
|
|
7
7
|
* integer: the revision of the snapshot the host acted on.
|
|
8
8
|
*/
|
|
9
9
|
export type NablaConnectCommandBase = {
|
|
10
10
|
/** The version pinned by the session handshake. */
|
|
11
11
|
version: NablaConnectProtocolVersion;
|
|
12
|
+
/** The `clientId` of the `session:hello`. The iframe ignores another one. */
|
|
13
|
+
clientId: string;
|
|
12
14
|
sessionId: string;
|
|
13
15
|
requestId: string;
|
|
14
16
|
expectedRevision: number;
|
package/dist/export.d.ts
CHANGED
|
@@ -1,7 +1,40 @@
|
|
|
1
1
|
import type { NablaConnectExportNoteEvent, NablaConnectExportPatientInstructionsEvent } from "./events.js";
|
|
2
|
+
export type NablaConnectIcd10Entry = {
|
|
3
|
+
system: "http://hl7.org/fhir/sid/icd-10-cm";
|
|
4
|
+
code: string;
|
|
5
|
+
display: string;
|
|
6
|
+
isHcc: boolean;
|
|
7
|
+
isMcc: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type NablaConnectSnomedEntry = {
|
|
10
|
+
system: "http://snomed.info/sct";
|
|
11
|
+
code: string;
|
|
12
|
+
display: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A subsection of a note section, with its normalized codes. `title` is `null` for a
|
|
16
|
+
* subsection without a title. The code lists are empty when no codes are available at
|
|
17
|
+
* export time.
|
|
18
|
+
*/
|
|
19
|
+
export type NablaConnectNoteSubsection = {
|
|
20
|
+
title: string | null;
|
|
21
|
+
text: string;
|
|
22
|
+
icd10Codes: NablaConnectIcd10Entry[];
|
|
23
|
+
snomedCodes: NablaConnectSnomedEntry[];
|
|
24
|
+
};
|
|
25
|
+
/** The content of a note section, discriminated by `type`. */
|
|
26
|
+
export type NablaConnectNoteSectionContent = {
|
|
27
|
+
type: "TEXT";
|
|
28
|
+
text: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: "SUBSECTIONS";
|
|
31
|
+
subsections: NablaConnectNoteSubsection[];
|
|
32
|
+
};
|
|
2
33
|
export type NablaConnectExportableNoteSection = {
|
|
3
34
|
category: string | null;
|
|
35
|
+
/** @deprecated The `NOTE_EXPORT` callback deprecates it: read `structuredContent`. */
|
|
4
36
|
content: string;
|
|
37
|
+
structuredContent: NablaConnectNoteSectionContent;
|
|
5
38
|
title: string;
|
|
6
39
|
};
|
|
7
40
|
export type NablaConnectExportableNote = {
|
|
@@ -9,13 +42,7 @@ export type NablaConnectExportableNote = {
|
|
|
9
42
|
freeText: string | null;
|
|
10
43
|
};
|
|
11
44
|
export type NablaConnectVisitDiagnosisSystem = "http://hl7.org/fhir/sid/icd-10-cm";
|
|
12
|
-
export type NablaConnectVisitDiagnosis =
|
|
13
|
-
system: NablaConnectVisitDiagnosisSystem;
|
|
14
|
-
code: string;
|
|
15
|
-
display: string;
|
|
16
|
-
isHcc: boolean;
|
|
17
|
-
isMcc: boolean;
|
|
18
|
-
};
|
|
45
|
+
export type NablaConnectVisitDiagnosis = NablaConnectIcd10Entry;
|
|
19
46
|
export type NablaConnectExportTranscriptItem = {
|
|
20
47
|
text: string;
|
|
21
48
|
speakerType: string;
|
package/dist/session.d.ts
CHANGED
|
@@ -7,11 +7,15 @@ import type { NablaConnectProtocolVersion } from "./version.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Setup messages are not versioned and only ever gain fields. `supportedVersions` is
|
|
9
9
|
* bounded by `NablaConnectSupportedVersionsMaxLength`.
|
|
10
|
+
*
|
|
11
|
+
* `clientId` is the client the document was loaded for, read from its URL, or `null` for a
|
|
12
|
+
* document that was loaded for none. It is a bounded id.
|
|
10
13
|
*/
|
|
11
14
|
export type NablaConnectSessionAvailableMessage = {
|
|
12
15
|
event: NablaConnectSessionAvailableEvent;
|
|
13
16
|
data: {
|
|
14
17
|
supportedVersions: number[];
|
|
18
|
+
clientId: string | null;
|
|
15
19
|
};
|
|
16
20
|
};
|
|
17
21
|
/**
|
|
@@ -21,24 +25,32 @@ export type NablaConnectSessionAvailableMessage = {
|
|
|
21
25
|
*
|
|
22
26
|
* `sdkVersion` is the semver of the SDK, bounded by `NablaConnectSdkVersionMaxLength`.
|
|
23
27
|
* The iframe logs it. It is not clinical data.
|
|
28
|
+
*
|
|
29
|
+
* `clientId` is a bounded id that identifies the SDK client. The iframe only answers the
|
|
30
|
+
* client its document was loaded for, and ignores a message with another or no `clientId`.
|
|
24
31
|
*/
|
|
25
32
|
export type NablaConnectSessionHelloMessage = {
|
|
26
33
|
event: NablaConnectSessionHelloEvent;
|
|
27
34
|
data: {
|
|
28
35
|
supportedVersions: number[];
|
|
29
36
|
sdkVersion: string;
|
|
37
|
+
clientId: string;
|
|
30
38
|
};
|
|
31
39
|
};
|
|
32
40
|
/**
|
|
33
41
|
* The iframe pinned the highest version both sides support. Every later message of the
|
|
34
42
|
* session carries and is validated against it, and the first `stateChanged` follows.
|
|
35
43
|
* A repeated `session:hello` in the same session gets the same message back.
|
|
44
|
+
*
|
|
45
|
+
* `clientId` echoes the one of the `session:hello` it answers. The iframe posts to a window
|
|
46
|
+
* its host shares with other clients, so each client tells its own messages by it.
|
|
36
47
|
*/
|
|
37
48
|
export type NablaConnectSessionReadyMessage = {
|
|
38
49
|
event: NablaConnectSessionReadyEvent;
|
|
39
50
|
data: {
|
|
40
51
|
version: NablaConnectProtocolVersion;
|
|
41
52
|
sessionId: string;
|
|
53
|
+
clientId: string;
|
|
42
54
|
};
|
|
43
55
|
};
|
|
44
56
|
export type NablaConnectSessionRejectionReason = "UNSUPPORTED_VERSION";
|
|
@@ -47,11 +59,13 @@ export type NablaConnectSessionRejectionReason = "UNSUPPORTED_VERSION";
|
|
|
47
59
|
* offer. The host gets no session. `supportedVersions` is what the iframe speaks. If they
|
|
48
60
|
* are all newer than the SDK's, the SDK is too old and the integrator upgrades
|
|
49
61
|
* `@nabla/connect-sdk`. If they are all older, the iframe is behind the SDK.
|
|
62
|
+
* `clientId` echoes the one of the `session:hello` it answers.
|
|
50
63
|
*/
|
|
51
64
|
export type NablaConnectSessionRejectedMessage = {
|
|
52
65
|
event: NablaConnectSessionRejectedEvent;
|
|
53
66
|
data: {
|
|
54
67
|
reason: NablaConnectSessionRejectionReason;
|
|
55
68
|
supportedVersions: number[];
|
|
69
|
+
clientId: string;
|
|
56
70
|
};
|
|
57
71
|
};
|
package/dist/version.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export type NablaConnectProtocolVersion = 1;
|
|
9
9
|
/**
|
|
10
|
-
* Ids (`sessionId`, `requestId`) are non-empty strings of at most this many characters.
|
|
10
|
+
* Ids (`clientId`, `sessionId`, `requestId`) are non-empty strings of at most this many characters.
|
|
11
11
|
* Types cannot express the bound: consumers must enforce it.
|
|
12
12
|
*/
|
|
13
13
|
export type NablaConnectBoundedIdMaxLength = 64;
|
|
@@ -18,3 +18,8 @@ export type NablaConnectBoundedIdMaxLength = 64;
|
|
|
18
18
|
export type NablaConnectSupportedVersionsMaxLength = 16;
|
|
19
19
|
/** `sdkVersion` is a non-empty string of at most this many characters. */
|
|
20
20
|
export type NablaConnectSdkVersionMaxLength = 64;
|
|
21
|
+
/**
|
|
22
|
+
* The query parameter of the iframe URL that carries the `clientId` the document is loaded
|
|
23
|
+
* for. The SDK sets it. The iframe only answers the client it names.
|
|
24
|
+
*/
|
|
25
|
+
export type NablaConnectClientIdParam = "nablaConnectClientId";
|
package/package.json
CHANGED