@nmshd/connector-tui 3.0.0-alpha.1 → 3.0.0-alpha.3
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/ConnectorTUI.js +4 -3
- package/dist/ConnectorTUIBase.js +1 -4
- package/dist/client/ConnectorClient.js +9 -0
- package/dist/{IdentityDeletionProcessEndpoint.js → client/IdentityDeletionProcessEndpoint.js} +4 -4
- package/dist/mixins/AddIdentityDeletionProcess.js +3 -3
- package/dist/mixins/AddSendPremadeRequestByMessage.js +359 -0
- package/dist/mixins/AddSendRequestByMessage.js +43 -6
- package/dist/mixins/AddShareRequestByTemplate.js +3 -2
- package/dist/mixins/ConnectorTUIBaseWithMixins.js +3 -3
- package/dist/mixins/index.js +1 -0
- package/package.json +12 -12
package/dist/ConnectorTUI.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ApiKeyAuthenticator
|
|
1
|
+
import { ApiKeyAuthenticator } from "@nmshd/connector-sdk";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { readFile } from "fs/promises";
|
|
4
4
|
import { DateTime } from "luxon";
|
|
5
5
|
import prompts from "prompts";
|
|
6
|
+
import { ConnectorClient } from "./client/ConnectorClient.js";
|
|
6
7
|
import { ConnectorTUIBaseWithMixins } from "./mixins/index.js";
|
|
7
8
|
export class ConnectorTUI extends ConnectorTUIBaseWithMixins {
|
|
8
9
|
static async create(baseUrl, apiKey) {
|
|
9
|
-
const client = ConnectorClient
|
|
10
|
+
const client = new ConnectorClient({ baseUrl, authenticator: new ApiKeyAuthenticator(apiKey) });
|
|
10
11
|
const address = (await client.account.getIdentityInfo()).result.address;
|
|
11
12
|
const support = await client.monitoring.getSupport();
|
|
12
13
|
return new ConnectorTUI(client, address, support);
|
|
@@ -18,7 +19,7 @@ export class ConnectorTUI extends ConnectorTUIBaseWithMixins {
|
|
|
18
19
|
await this.#showStartupMessage(connectorVersionInfo);
|
|
19
20
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
20
21
|
while (true) {
|
|
21
|
-
const activeIdentityDeletionProcess = this.isDebugMode() ? await this.
|
|
22
|
+
const activeIdentityDeletionProcess = this.isDebugMode() ? await this.connectorClient.identityDeletionProcess.getActiveIdentityDeletionProcess() : undefined;
|
|
22
23
|
if (activeIdentityDeletionProcess?.isSuccess && activeIdentityDeletionProcess.result.status === "Approved") {
|
|
23
24
|
const gracePeriodEndsAtDateTime = DateTime.fromISO(activeIdentityDeletionProcess.result.gracePeriodEndsAt);
|
|
24
25
|
if (gracePeriodEndsAtDateTime.diffNow().milliseconds < 0) {
|
package/dist/ConnectorTUIBase.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { RelationshipStatus } from "@nmshd/connector-sdk";
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
3
|
import prompts from "prompts";
|
|
4
|
-
import { IdentityDeletionProcessEndpoint } from "./IdentityDeletionProcessEndpoint.js";
|
|
5
4
|
export class ConnectorTUIBase {
|
|
6
5
|
connectorClient;
|
|
7
6
|
connectorAddress;
|
|
8
7
|
support;
|
|
9
8
|
choices = [];
|
|
10
9
|
choicesInDeletion = [];
|
|
11
|
-
identityDeletionProcessEndpoint;
|
|
12
10
|
constructor(connectorClient, connectorAddress, support) {
|
|
13
11
|
this.connectorClient = connectorClient;
|
|
14
12
|
this.connectorAddress = connectorAddress;
|
|
15
13
|
this.support = support;
|
|
16
|
-
this.identityDeletionProcessEndpoint = new IdentityDeletionProcessEndpoint(this.connectorClient.account["httpClient"]);
|
|
17
14
|
}
|
|
18
15
|
async selectRelationship(prompt, ...status) {
|
|
19
16
|
if (status.length === 0)
|
|
@@ -63,7 +60,7 @@ export class ConnectorTUIBase {
|
|
|
63
60
|
const surname = relationshipAttributes.find((a) => a.content.value["@type"] === "Surname");
|
|
64
61
|
const givenName = relationshipAttributes.find((a) => a.content.value["@type"] === "GivenName");
|
|
65
62
|
if (!!surname || givenName) {
|
|
66
|
-
const name = `${(
|
|
63
|
+
const name = `${(givenName?.content.value).value || ""} ${(surname?.content.value).value || ""}`.trim();
|
|
67
64
|
return {
|
|
68
65
|
title: `${relationship.peer} (${name})`,
|
|
69
66
|
value,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConnectorClient as BaseConnectorClient } from "@nmshd/connector-sdk";
|
|
2
|
+
import { IdentityDeletionProcessEndpoint } from "./IdentityDeletionProcessEndpoint.js";
|
|
3
|
+
export class ConnectorClient extends BaseConnectorClient {
|
|
4
|
+
identityDeletionProcess;
|
|
5
|
+
constructor(config) {
|
|
6
|
+
super(config);
|
|
7
|
+
this.identityDeletionProcess = new IdentityDeletionProcessEndpoint(this.axiosInstance);
|
|
8
|
+
}
|
|
9
|
+
}
|
package/dist/{IdentityDeletionProcessEndpoint.js → client/IdentityDeletionProcessEndpoint.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Endpoint } from "@nmshd/connector-sdk
|
|
1
|
+
import { Endpoint } from "@nmshd/connector-sdk";
|
|
2
2
|
export var IdentityDeletionProcessStatus;
|
|
3
3
|
(function (IdentityDeletionProcessStatus) {
|
|
4
4
|
IdentityDeletionProcessStatus["WaitingForApproval"] = "WaitingForApproval";
|
|
@@ -8,12 +8,12 @@ export var IdentityDeletionProcessStatus;
|
|
|
8
8
|
})(IdentityDeletionProcessStatus || (IdentityDeletionProcessStatus = {}));
|
|
9
9
|
export class IdentityDeletionProcessEndpoint extends Endpoint {
|
|
10
10
|
async initiateIdentityDeletionProcess(lengthOfGracePeriodInDays) {
|
|
11
|
-
return await this.post("/api/
|
|
11
|
+
return await this.post("/api/core/v1/IdentityDeletionProcess", undefined, 200, { lengthOfGracePeriodInDays });
|
|
12
12
|
}
|
|
13
13
|
async getActiveIdentityDeletionProcess() {
|
|
14
|
-
return await this.get("/api/
|
|
14
|
+
return await this.get("/api/core/v1/IdentityDeletionProcess");
|
|
15
15
|
}
|
|
16
16
|
async cancelIdentityDeletionProcess() {
|
|
17
|
-
return await this.delete("/api/
|
|
17
|
+
return await this.delete("/api/core/v1/IdentityDeletionProcess", undefined, 200);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@ export function AddIdentityDeletionProcess(Base) {
|
|
|
13
13
|
}
|
|
14
14
|
async identityDeletionProcess() {
|
|
15
15
|
const choices = [];
|
|
16
|
-
const activeIdentityDeletionProcess = await this.
|
|
16
|
+
const activeIdentityDeletionProcess = await this.connectorClient.identityDeletionProcess.getActiveIdentityDeletionProcess();
|
|
17
17
|
if (activeIdentityDeletionProcess.isSuccess) {
|
|
18
18
|
choices.push({ title: "Show IdentityDeletionProcess", value: "Show" });
|
|
19
19
|
if (activeIdentityDeletionProcess.result.status === "Approved") {
|
|
@@ -49,12 +49,12 @@ export function AddIdentityDeletionProcess(Base) {
|
|
|
49
49
|
});
|
|
50
50
|
const oneSecondInDays = 1 / (24 * 60 * 60);
|
|
51
51
|
const lengthOfGracePeriodInDays = confirmation["IdentityDeletionProcess grace period"] ? oneSecondInDays : undefined;
|
|
52
|
-
const identityDeletionProcess = (await this.
|
|
52
|
+
const identityDeletionProcess = (await this.connectorClient.identityDeletionProcess.initiateIdentityDeletionProcess(lengthOfGracePeriodInDays)).result;
|
|
53
53
|
console.log("Identity Deletion Process initiated.");
|
|
54
54
|
this.showIdentityDeletionProcesses(identityDeletionProcess);
|
|
55
55
|
}
|
|
56
56
|
async cancelIdentityDeletionProcess() {
|
|
57
|
-
const identityDeletionProcess = (await this.
|
|
57
|
+
const identityDeletionProcess = (await this.connectorClient.identityDeletionProcess.cancelIdentityDeletionProcess()).result;
|
|
58
58
|
console.log("Identity Deletion Process canceled.");
|
|
59
59
|
this.showIdentityDeletionProcesses(identityDeletionProcess);
|
|
60
60
|
}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import prompts from "prompts";
|
|
2
|
+
export function AddSendPremadeRequestByMessage(Base) {
|
|
3
|
+
return class SendPremadeRequestByMessage extends Base {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
this.choices.push({ title: "Send Premade Request By Message", value: this.sendPremadeRequestByMessage });
|
|
7
|
+
}
|
|
8
|
+
async sendPremadeRequestByMessage() {
|
|
9
|
+
const recipient = await this.selectRelationship("Which relationship do you want to send the request to?");
|
|
10
|
+
if (!recipient)
|
|
11
|
+
return console.log("No recipient selected");
|
|
12
|
+
const peer = recipient.peer;
|
|
13
|
+
const whatRequest = await prompts({
|
|
14
|
+
message: "What kind of premade request do you want to send?",
|
|
15
|
+
type: "select",
|
|
16
|
+
name: "requestMethod",
|
|
17
|
+
choices: [
|
|
18
|
+
{
|
|
19
|
+
title: "Gynaecology Questionnaire",
|
|
20
|
+
value: this.createGynaecologyQuestionnaire.bind(this),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
if (!whatRequest.requestMethod || typeof whatRequest.requestMethod !== "function")
|
|
25
|
+
return;
|
|
26
|
+
const request = await whatRequest.requestMethod(peer);
|
|
27
|
+
const response = await this.connectorClient.outgoingRequests.createRequest({ peer, content: request });
|
|
28
|
+
if (response.isError) {
|
|
29
|
+
console.error("Error while creating LocalRequest", response.error);
|
|
30
|
+
const details = await this.connectorClient.outgoingRequests.canCreateRequest({ peer, content: request });
|
|
31
|
+
console.log("Details: ", details.result);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const messageResponse = await this.connectorClient.messages.sendMessage({
|
|
35
|
+
recipients: [peer],
|
|
36
|
+
content: response.result.content,
|
|
37
|
+
});
|
|
38
|
+
if (messageResponse.isError) {
|
|
39
|
+
return console.error("Error while sending message", messageResponse.error);
|
|
40
|
+
}
|
|
41
|
+
console.log("The following Request was sent:", JSON.stringify(response.result.content, null, 2));
|
|
42
|
+
console.log(`Request sent to '${peer}'`);
|
|
43
|
+
}
|
|
44
|
+
createGynaecologyQuestionnaire(_) {
|
|
45
|
+
const description = `Sehr geehrte Patientin,
|
|
46
|
+
wir begrüßen Sie herzlich in unserer Praxis.
|
|
47
|
+
Bitte beantworten Sie in Ruhe diese ersten Fragen,
|
|
48
|
+
die für eine richtige Beurteilung Ihrer Beschwerden
|
|
49
|
+
und die Behandlung wesentlich sind.
|
|
50
|
+
Selbstverständlich unterliegen alle Ihre Angaben der
|
|
51
|
+
ärztlichen Schweigepflicht.`;
|
|
52
|
+
return {
|
|
53
|
+
"@type": "Request",
|
|
54
|
+
description,
|
|
55
|
+
items: [
|
|
56
|
+
{
|
|
57
|
+
"@type": "RequestItemGroup",
|
|
58
|
+
title: "Persönliche Daten",
|
|
59
|
+
description: "Geben Sie hier Ihre grundlegenden persönlichen Informationen ein.",
|
|
60
|
+
items: [
|
|
61
|
+
{
|
|
62
|
+
"@type": "ReadAttributeRequestItem",
|
|
63
|
+
mustBeAccepted: true,
|
|
64
|
+
query: { "@type": "IdentityAttributeQuery", valueType: "GivenName" },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"@type": "ReadAttributeRequestItem",
|
|
68
|
+
mustBeAccepted: true,
|
|
69
|
+
query: { "@type": "IdentityAttributeQuery", valueType: "Surname" },
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"@type": "ReadAttributeRequestItem",
|
|
73
|
+
mustBeAccepted: false,
|
|
74
|
+
query: { "@type": "IdentityAttributeQuery", valueType: "StreetAddress" },
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"@type": "ReadAttributeRequestItem",
|
|
78
|
+
mustBeAccepted: false,
|
|
79
|
+
description: "Geben Sie eine Festnetz- oder Mobilfunknummer an.",
|
|
80
|
+
query: { "@type": "IdentityAttributeQuery", valueType: "PhoneNumber" },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"@type": "ReadAttributeRequestItem",
|
|
84
|
+
mustBeAccepted: false,
|
|
85
|
+
query: { "@type": "IdentityAttributeQuery", valueType: "EMailAddress" },
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"@type": "ReadAttributeRequestItem",
|
|
89
|
+
mustBeAccepted: false,
|
|
90
|
+
query: { "@type": "IdentityAttributeQuery", valueType: "BirthDate" },
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"@type": "RequestItemGroup",
|
|
96
|
+
title: "Allgemeines",
|
|
97
|
+
description: "In diesem Bereich werden allgemeine Informationen zu Ihrer Person und Ihrem Versichertenstatus abgefragt",
|
|
98
|
+
items: [
|
|
99
|
+
{
|
|
100
|
+
"@type": "FormFieldRequestItem",
|
|
101
|
+
mustBeAccepted: false,
|
|
102
|
+
title: "Ihr momentaner Hausarzt",
|
|
103
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"@type": "FormFieldRequestItem",
|
|
107
|
+
mustBeAccepted: false,
|
|
108
|
+
title: "Ihre Krankenkasse",
|
|
109
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"@type": "FormFieldRequestItem",
|
|
113
|
+
mustBeAccepted: true,
|
|
114
|
+
title: "Sind Sie privat versichert?",
|
|
115
|
+
settings: { "@type": "BooleanFormFieldSettings" },
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"@type": "FormFieldRequestItem",
|
|
119
|
+
mustBeAccepted: true,
|
|
120
|
+
title: "Körpergröße",
|
|
121
|
+
settings: { "@type": "IntegerFormFieldSettings", unit: "cm" },
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"@type": "FormFieldRequestItem",
|
|
125
|
+
mustBeAccepted: true,
|
|
126
|
+
title: "Gewicht",
|
|
127
|
+
settings: { "@type": "DoubleFormFieldSettings", unit: "kg" },
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"@type": "RequestItemGroup",
|
|
133
|
+
title: "Zyklus und Schwangerschaften",
|
|
134
|
+
description: "Bitte geben Sie hier alle Details zu Zyklus, Schwangerschaften und Geburten oder möglichen Komplikationen an.",
|
|
135
|
+
items: [
|
|
136
|
+
{
|
|
137
|
+
"@type": "FormFieldRequestItem",
|
|
138
|
+
mustBeAccepted: false,
|
|
139
|
+
title: "Wann war Ihre letzte reguläre Regelblutung?",
|
|
140
|
+
description: "Wenn Ihnen das genaue Datum bekannt ist, tragen Sie es hier ein. Andernfalls können Sie im folgenden Feld alternativ einen Zeitraum nennen.",
|
|
141
|
+
settings: { "@type": "DateFormFieldSettings" },
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"@type": "FormFieldRequestItem",
|
|
145
|
+
mustBeAccepted: false,
|
|
146
|
+
title: "Wann war Ihre letzte reguläre Regelblutung?",
|
|
147
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"@type": "FormFieldRequestItem",
|
|
151
|
+
mustBeAccepted: false,
|
|
152
|
+
title: "In welchem Alter hatten Sie Ihre erste Regelblutung?",
|
|
153
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"@type": "FormFieldRequestItem",
|
|
157
|
+
mustBeAccepted: false,
|
|
158
|
+
title: "Wie lange dauert Ihr Zyklus?",
|
|
159
|
+
settings: { "@type": "SelectionFormFieldSettings", options: ["24 Tage", "26 Tage", "28 Tage", "30 Tage", "32 Tage", "kürzer", "länger", "unregelmäßig"] },
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"@type": "FormFieldRequestItem",
|
|
163
|
+
mustBeAccepted: false,
|
|
164
|
+
title: "Anzahl Ihrer natürlichen Geburten",
|
|
165
|
+
settings: { "@type": "IntegerFormFieldSettings" },
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"@type": "FormFieldRequestItem",
|
|
169
|
+
mustBeAccepted: false,
|
|
170
|
+
title: "Geburtsjahre",
|
|
171
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"@type": "FormFieldRequestItem",
|
|
175
|
+
mustBeAccepted: false,
|
|
176
|
+
title: "Anzahl Ihrer Kaiserschnitte",
|
|
177
|
+
settings: { "@type": "IntegerFormFieldSettings" },
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"@type": "FormFieldRequestItem",
|
|
181
|
+
mustBeAccepted: false,
|
|
182
|
+
title: "Geburtsjahre",
|
|
183
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"@type": "FormFieldRequestItem",
|
|
187
|
+
mustBeAccepted: false,
|
|
188
|
+
title: "Anzahl Ihrer Saugglocken- oder Zangengeburten",
|
|
189
|
+
settings: { "@type": "IntegerFormFieldSettings" },
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"@type": "FormFieldRequestItem",
|
|
193
|
+
mustBeAccepted: false,
|
|
194
|
+
title: "Geburtsjahre",
|
|
195
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"@type": "FormFieldRequestItem",
|
|
199
|
+
mustBeAccepted: false,
|
|
200
|
+
title: "Anzahl Ihrer Schwangerschaftsabbrüche",
|
|
201
|
+
settings: { "@type": "IntegerFormFieldSettings" },
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"@type": "FormFieldRequestItem",
|
|
205
|
+
mustBeAccepted: false,
|
|
206
|
+
title: "Jahre",
|
|
207
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"@type": "FormFieldRequestItem",
|
|
211
|
+
mustBeAccepted: false,
|
|
212
|
+
title: "Gab es während der Schwangerschaft oder Geburt Komplikationen?",
|
|
213
|
+
settings: { "@type": "BooleanFormFieldSettings" },
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"@type": "FormFieldRequestItem",
|
|
217
|
+
mustBeAccepted: false,
|
|
218
|
+
title: "Welcher Art waren die Komplikationen?",
|
|
219
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"@type": "FormFieldRequestItem",
|
|
223
|
+
mustBeAccepted: false,
|
|
224
|
+
title: "Hatten Sie jemals eine gynäkologische Operation?",
|
|
225
|
+
settings: { "@type": "BooleanFormFieldSettings" },
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"@type": "RequestItemGroup",
|
|
231
|
+
title: "Verhütung und Vorsorge",
|
|
232
|
+
description: "Nennen Sie uns hier Ihre Verhütungsmethoden und Ihre erfolgten Vorsorgemaßnahmen.",
|
|
233
|
+
items: [
|
|
234
|
+
{
|
|
235
|
+
"@type": "FormFieldRequestItem",
|
|
236
|
+
mustBeAccepted: false,
|
|
237
|
+
title: "Wurde eine HPV-Impfung gegen Gebärmutterhalskrebs durchgeführt?",
|
|
238
|
+
settings: { "@type": "BooleanFormFieldSettings" },
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"@type": "FormFieldRequestItem",
|
|
242
|
+
mustBeAccepted: false,
|
|
243
|
+
title: "Mit welcher Methode verhüten Sie?",
|
|
244
|
+
settings: {
|
|
245
|
+
"@type": "SelectionFormFieldSettings",
|
|
246
|
+
allowMultipleSelection: true,
|
|
247
|
+
options: [
|
|
248
|
+
"keine",
|
|
249
|
+
"Verhütungsstäbchen (Implanon)",
|
|
250
|
+
"Sterilisation",
|
|
251
|
+
"3-Monats-Spritze",
|
|
252
|
+
"Hormonspirae (Mirena, Jaydess)",
|
|
253
|
+
"Sterilisation des Partners",
|
|
254
|
+
"Pflaster",
|
|
255
|
+
"Kondom",
|
|
256
|
+
"Kupferspirale",
|
|
257
|
+
"Nuvaring",
|
|
258
|
+
"Pille",
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"@type": "FormFieldRequestItem",
|
|
264
|
+
mustBeAccepted: false,
|
|
265
|
+
title: "Name der Pille",
|
|
266
|
+
description: "Wenn Sie mit der Pille verhüten, tragen Sie hier bitte den Namen ein.",
|
|
267
|
+
settings: { "@type": "StringFormFieldSettings" },
|
|
268
|
+
},
|
|
269
|
+
],
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"@type": "RequestItemGroup",
|
|
273
|
+
title: "Bekannte Erkrankungen und Infektionen",
|
|
274
|
+
description: "Nennen Sie uns alle Ihnen bekannten Erkrankungen oder Infektionen, die Sie in der Vergangenheit hatten.",
|
|
275
|
+
items: [
|
|
276
|
+
{
|
|
277
|
+
"@type": "FormFieldRequestItem",
|
|
278
|
+
mustBeAccepted: false,
|
|
279
|
+
title: "Haben oder hatten Sie eine der folgenden Erkrankungen oder Infektionen?",
|
|
280
|
+
settings: {
|
|
281
|
+
"@type": "SelectionFormFieldSettings",
|
|
282
|
+
allowMultipleSelection: true,
|
|
283
|
+
options: [
|
|
284
|
+
"Gerinnungsstörung",
|
|
285
|
+
"Bluthochdruck",
|
|
286
|
+
"Herzinfarkt",
|
|
287
|
+
"Diabetes mellitus",
|
|
288
|
+
"HIV",
|
|
289
|
+
"Hormonstörung",
|
|
290
|
+
"Arthrose",
|
|
291
|
+
"Asthma/COPD",
|
|
292
|
+
"Thrombose",
|
|
293
|
+
"Lebererkrankung",
|
|
294
|
+
"Epilepsie",
|
|
295
|
+
"Schilddrüsenerkrankung",
|
|
296
|
+
"Wechseljahrsbeschwerden",
|
|
297
|
+
"Krebserkrankungen",
|
|
298
|
+
"Schlaganfall",
|
|
299
|
+
"Migräne",
|
|
300
|
+
"Nierenerkrankung",
|
|
301
|
+
"Blutungsneigung",
|
|
302
|
+
"Hepatitis",
|
|
303
|
+
"Krampfadern",
|
|
304
|
+
"Harninkontinenz",
|
|
305
|
+
"Osteoporose",
|
|
306
|
+
],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"@type": "RequestItemGroup",
|
|
313
|
+
title: "Abschließendes und Einwilligungen",
|
|
314
|
+
description: "Bestätigen Sie abschließend die Richtigkeit Ihrer Angaben und geben Sie uns Einwilligungen.",
|
|
315
|
+
items: [
|
|
316
|
+
{
|
|
317
|
+
"@type": "FormFieldRequestItem",
|
|
318
|
+
mustBeAccepted: false,
|
|
319
|
+
title: "Wie finden Sie die Zeitschriftenauswahl in unserem Wartezimmer?",
|
|
320
|
+
description: "1 = sehr schlecht, 10 = sehr gut",
|
|
321
|
+
settings: { "@type": "RatingFormFieldSettings", maxRating: 10 },
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"@type": "FormFieldRequestItem",
|
|
325
|
+
mustBeAccepted: false,
|
|
326
|
+
title: "Wie zufrieden waren Sie mit dem Ablauf der Terminvereinbarung?",
|
|
327
|
+
description: "Vergeben Sie bis zu 5 Sterne, ein Stern bedeutet sehr unzufrieden, 5 Sterne vollstens zufrieden.",
|
|
328
|
+
settings: { "@type": "RatingFormFieldSettings", maxRating: 5 },
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"@type": "FormFieldRequestItem",
|
|
332
|
+
mustBeAccepted: false,
|
|
333
|
+
title: "Wie haben Sie von unserer Praxis erfahren?",
|
|
334
|
+
settings: { "@type": "SelectionFormFieldSettings", options: ["Hausarzt", "Internet", "von Bekannten", "zufällig", "sonstiges"] },
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"@type": "FormFieldRequestItem",
|
|
338
|
+
mustBeAccepted: true,
|
|
339
|
+
title: "Dürfen wir Ihnen Informationen zu unserer Praxis per E-Mail zusenden? ",
|
|
340
|
+
settings: { "@type": "BooleanFormFieldSettings" },
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"@type": "FormFieldRequestItem",
|
|
344
|
+
mustBeAccepted: true,
|
|
345
|
+
title: "Falls nötig bin ich damit einverstanden, dass Arztberichte an meine behandelnden Ärzte geschickt werden.",
|
|
346
|
+
settings: { "@type": "BooleanFormFieldSettings" },
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"@type": "ConsentRequestItem",
|
|
350
|
+
mustBeAccepted: true,
|
|
351
|
+
consent: "Ich bestätige hiermit die Richtigkeit und Vollständigkeit meiner Angaben.",
|
|
352
|
+
},
|
|
353
|
+
],
|
|
354
|
+
},
|
|
355
|
+
],
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
}
|
|
@@ -159,17 +159,23 @@ export function AddSendRequestByMessage(Base) {
|
|
|
159
159
|
type: "text",
|
|
160
160
|
name: "attributeType",
|
|
161
161
|
},
|
|
162
|
+
{
|
|
163
|
+
message: "What's the description of the RequestItem?",
|
|
164
|
+
type: "text",
|
|
165
|
+
name: "requestItemDescription",
|
|
166
|
+
format: (value) => (value === "" ? undefined : value),
|
|
167
|
+
},
|
|
162
168
|
{
|
|
163
169
|
message: "What's the title of the RelationshipAttribute?",
|
|
164
170
|
type: "text",
|
|
165
171
|
name: "attributeTitle",
|
|
166
|
-
|
|
172
|
+
format: (value) => (value === "" ? undefined : value),
|
|
167
173
|
},
|
|
168
174
|
{
|
|
169
175
|
message: "What's the description of the RelationshipAttribute?",
|
|
170
176
|
type: "text",
|
|
171
177
|
name: "attributeDescription",
|
|
172
|
-
|
|
178
|
+
format: (value) => (value === "" ? undefined : value),
|
|
173
179
|
},
|
|
174
180
|
{
|
|
175
181
|
message: "What's the key of the attribute you would like to query?",
|
|
@@ -182,16 +188,18 @@ export function AddSendRequestByMessage(Base) {
|
|
|
182
188
|
type: "select",
|
|
183
189
|
name: "owner",
|
|
184
190
|
choices: [
|
|
185
|
-
{ title: "
|
|
186
|
-
{ title: "The
|
|
187
|
-
{ title: "A third party", value: "thirdParty" },
|
|
191
|
+
{ title: "Yourself", value: "yourself" },
|
|
192
|
+
{ title: "The recipient", value: "" },
|
|
188
193
|
],
|
|
189
194
|
},
|
|
190
195
|
]);
|
|
191
196
|
const title = result.attributeTitle ?? `A ${result.attributeType} attribute`;
|
|
197
|
+
if (result.owner === "yourself")
|
|
198
|
+
result.owner = this.connectorAddress;
|
|
192
199
|
const requestItem = {
|
|
193
200
|
"@type": "ReadAttributeRequestItem",
|
|
194
201
|
mustBeAccepted: true,
|
|
202
|
+
description: result.requestItemDescription,
|
|
195
203
|
query: {
|
|
196
204
|
"@type": "RelationshipAttributeQuery",
|
|
197
205
|
owner: result.owner ?? "",
|
|
@@ -221,8 +229,13 @@ export function AddSendRequestByMessage(Base) {
|
|
|
221
229
|
},
|
|
222
230
|
{
|
|
223
231
|
message: "Who is the owner of the RelationshipAttribute?",
|
|
224
|
-
type: "
|
|
232
|
+
type: "select",
|
|
225
233
|
name: "owner",
|
|
234
|
+
choices: [
|
|
235
|
+
{ title: "The recipient or the third party", value: "" },
|
|
236
|
+
{ title: "The recipient", value: "recipient" },
|
|
237
|
+
{ title: "The third party", value: "thirdParty" },
|
|
238
|
+
],
|
|
226
239
|
},
|
|
227
240
|
{
|
|
228
241
|
message: "What are the third party addresses? (comma-separated)",
|
|
@@ -262,6 +275,15 @@ export function AddSendRequestByMessage(Base) {
|
|
|
262
275
|
type: "text",
|
|
263
276
|
name: "valueType",
|
|
264
277
|
},
|
|
278
|
+
{
|
|
279
|
+
message: "Type in the comma separated tags the fallback attribute should have",
|
|
280
|
+
type: "text",
|
|
281
|
+
format: (value) => value
|
|
282
|
+
.split(",")
|
|
283
|
+
.map((tag) => tag.trim())
|
|
284
|
+
.filter((tag) => tag.length > 0),
|
|
285
|
+
name: "tags",
|
|
286
|
+
},
|
|
265
287
|
]);
|
|
266
288
|
const requestItem = {
|
|
267
289
|
"@type": "ReadAttributeRequestItem",
|
|
@@ -271,6 +293,7 @@ export function AddSendRequestByMessage(Base) {
|
|
|
271
293
|
queryString: result.queryString,
|
|
272
294
|
attributeCreationHints: {
|
|
273
295
|
valueType: result.valueType,
|
|
296
|
+
tags: result.tags.length > 0 ? result.tags : undefined,
|
|
274
297
|
},
|
|
275
298
|
},
|
|
276
299
|
};
|
|
@@ -382,6 +405,15 @@ export function AddSendRequestByMessage(Base) {
|
|
|
382
405
|
type: "text",
|
|
383
406
|
name: "value",
|
|
384
407
|
},
|
|
408
|
+
{
|
|
409
|
+
message: "Type in the comma separated tags your proposed attribute or created attributes should have",
|
|
410
|
+
type: "text",
|
|
411
|
+
format: (value) => value
|
|
412
|
+
.split(",")
|
|
413
|
+
.map((tag) => tag.trim())
|
|
414
|
+
.filter((tag) => tag.length > 0),
|
|
415
|
+
name: "tags",
|
|
416
|
+
},
|
|
385
417
|
]);
|
|
386
418
|
const requestItem = {
|
|
387
419
|
"@type": "ProposeAttributeRequestItem",
|
|
@@ -389,6 +421,10 @@ export function AddSendRequestByMessage(Base) {
|
|
|
389
421
|
query: {
|
|
390
422
|
"@type": "IQLQuery",
|
|
391
423
|
queryString: result.queryString,
|
|
424
|
+
attributeCreationHints: {
|
|
425
|
+
valueType: result.attributeType,
|
|
426
|
+
tags: result.tags.length > 0 ? result.tags : undefined,
|
|
427
|
+
},
|
|
392
428
|
},
|
|
393
429
|
attribute: {
|
|
394
430
|
"@type": "IdentityAttribute",
|
|
@@ -397,6 +433,7 @@ export function AddSendRequestByMessage(Base) {
|
|
|
397
433
|
"@type": result.attributeType,
|
|
398
434
|
value: result.value,
|
|
399
435
|
},
|
|
436
|
+
tags: result.tags.length > 0 ? result.tags : undefined,
|
|
400
437
|
},
|
|
401
438
|
};
|
|
402
439
|
return requestItem;
|
|
@@ -90,8 +90,9 @@ export function AddShareRequestByTemplate(Base) {
|
|
|
90
90
|
}
|
|
91
91
|
async getOrCreateConnectorDisplayName(displayName) {
|
|
92
92
|
const response = await this.connectorClient.attributes.getOwnRepositoryAttributes({ "content.value.@type": "DisplayName" });
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
const displayNameWithValue = response.result.find((attr) => attr.content.value["@type"] === "DisplayName" && attr.content.value.value === displayName);
|
|
94
|
+
if (displayNameWithValue)
|
|
95
|
+
return displayNameWithValue;
|
|
95
96
|
const createAttributeResponse = await this.connectorClient.attributes.createRepositoryAttribute({ content: { value: { "@type": "DisplayName", value: displayName } } });
|
|
96
97
|
return createAttributeResponse.result;
|
|
97
98
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConnectorTUIBase } from "../ConnectorTUIBase.js";
|
|
2
|
-
import { AddAcceptPendingRelationships, AddAcceptPendingRequests, AddConnectorInfo, AddDecomposeRelationship, AddExit, AddGetAttributesOfRelationship, AddIdentityDeletionProcess, AddSendMail, AddSendRequestByMessage, AddShareRequestByTemplate, AddSync, AddTerminateRelationship, AddUploadFile, } from "./index.js";
|
|
2
|
+
import { AddAcceptPendingRelationships, AddAcceptPendingRequests, AddConnectorInfo, AddDecomposeRelationship, AddExit, AddGetAttributesOfRelationship, AddIdentityDeletionProcess, AddSendMail, AddSendPremadeRequestByMessage, AddSendRequestByMessage, AddShareRequestByTemplate, AddSync, AddTerminateRelationship, AddUploadFile, } from "./index.js";
|
|
3
3
|
export class ConnectorTUIBaseWithMixins
|
|
4
4
|
//
|
|
5
|
-
extends AddExit(AddConnectorInfo(AddDecomposeRelationship(AddTerminateRelationship(AddAcceptPendingRelationships(AddAcceptPendingRequests(AddGetAttributesOfRelationship(AddSendMail(AddSendRequestByMessage(AddShareRequestByTemplate(AddSync(AddUploadFile(AddIdentityDeletionProcess(
|
|
5
|
+
extends AddExit(AddConnectorInfo(AddDecomposeRelationship(AddTerminateRelationship(AddAcceptPendingRelationships(AddAcceptPendingRequests(AddGetAttributesOfRelationship(AddSendMail(AddSendPremadeRequestByMessage(AddSendRequestByMessage(AddShareRequestByTemplate(AddSync(AddUploadFile(AddIdentityDeletionProcess(
|
|
6
6
|
//
|
|
7
|
-
ConnectorTUIBase))))))))))))) {
|
|
7
|
+
ConnectorTUIBase)))))))))))))) {
|
|
8
8
|
}
|
package/dist/mixins/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./AddExit.js";
|
|
|
6
6
|
export * from "./AddGetAttributesOfRelationship.js";
|
|
7
7
|
export * from "./AddIdentityDeletionProcess.js";
|
|
8
8
|
export * from "./AddSendMail.js";
|
|
9
|
+
export * from "./AddSendPremadeRequestByMessage.js";
|
|
9
10
|
export * from "./AddSendRequestByMessage.js";
|
|
10
11
|
export * from "./AddShareRequestByTemplate.js";
|
|
11
12
|
export * from "./AddSync.js";
|
package/package.json
CHANGED
|
@@ -28,34 +28,34 @@
|
|
|
28
28
|
"watch": "node --watch --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"ts-node/esm\", pathToFileURL(\"./\"));' src/run.ts"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nmshd/connector-sdk": "^7.0.0-alpha.
|
|
32
|
-
"axios": "^1.
|
|
33
|
-
"chalk": "^5.
|
|
34
|
-
"dotenv": "^17.2.
|
|
35
|
-
"luxon": "^3.7.
|
|
31
|
+
"@nmshd/connector-sdk": "^7.0.0-alpha.33",
|
|
32
|
+
"axios": "^1.12.2",
|
|
33
|
+
"chalk": "^5.6.2",
|
|
34
|
+
"dotenv": "^17.2.2",
|
|
35
|
+
"luxon": "^3.7.2",
|
|
36
36
|
"prompts": "^2.4.2",
|
|
37
37
|
"qrcode-terminal": "^0.12.0",
|
|
38
38
|
"yargs": "^18.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@js-soft/eslint-config-ts": "^2.0.
|
|
41
|
+
"@js-soft/eslint-config-ts": "^2.0.3",
|
|
42
42
|
"@js-soft/license-check": "^1.0.9",
|
|
43
|
-
"@types/luxon": "^3.
|
|
44
|
-
"@types/node": "^
|
|
43
|
+
"@types/luxon": "^3.7.1",
|
|
44
|
+
"@types/node": "^24.5.2",
|
|
45
45
|
"@types/prompts": "^2.4.9",
|
|
46
46
|
"@types/qrcode-terminal": "^0.12.2",
|
|
47
47
|
"@types/yargs": "^17.0.33",
|
|
48
|
-
"eslint": "^9.
|
|
48
|
+
"eslint": "^9.36.0",
|
|
49
49
|
"prettier": "^3.6.2",
|
|
50
50
|
"ts-node": "^10.9.2",
|
|
51
|
-
"typescript": "^5.
|
|
51
|
+
"typescript": "^5.9.2"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": ">=22.
|
|
54
|
+
"node": ">=22.19.0"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public",
|
|
58
58
|
"provenance": true
|
|
59
59
|
},
|
|
60
|
-
"version": "3.0.0-alpha.
|
|
60
|
+
"version": "3.0.0-alpha.3"
|
|
61
61
|
}
|