rxome-generator 1.0.3 → 1.0.4-beta.2
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/JSON_INPUT_FORMAT.md +380 -0
- package/README.html +834 -0
- package/README.md +50 -19
- package/demos/demo_overfull.json +144 -0
- package/index.js +3 -3
- package/lib/package-info.js +4 -0
- package/lib/phenopackets.js +1951 -0
- package/lib/rxome-api-demo.js +26 -0
- package/lib/rxome-api.js +257 -0
- package/lib/rxome-api.test.js +9 -9
- package/lib/{rxome-generator.cjs → rxome-generator.js} +94 -80
- package/lib/rxome-generator.test.js +26 -17
- package/package.json +11 -2
- package/rxcode.js +12 -5
- package/rxcode.test.js +38 -39
- package/lib/rxome-api-demo.cjs +0 -60
- package/lib/rxome-api.cjs +0 -192
package/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
<!--
|
|
1
2
|
# TODO:
|
|
2
3
|
* how to connect to docker container (shell)
|
|
3
4
|
|
|
5
|
+
```
|
|
6
|
+
docker run -it -rm node /bin/bash
|
|
7
|
+
cd root/
|
|
8
|
+
npm install rxome-generator
|
|
9
|
+
node_modules/.bin/rxcode id key
|
|
10
|
+
```
|
|
11
|
+
-->
|
|
4
12
|
# FindMe2care (RxOME) QR-code generator
|
|
5
13
|
Generates QR codes containing medical information for use with the FindMe2care platform
|
|
6
14
|
(formerly called RxOME).
|
|
@@ -63,7 +71,7 @@ For detailed descriptions see
|
|
|
63
71
|
|
|
64
72
|
#### Library Functions
|
|
65
73
|
Import the library with
|
|
66
|
-
> `
|
|
74
|
+
> `import * as Coder from './lib/rxome-generator.js';`
|
|
67
75
|
|
|
68
76
|
The following two async library functions generate QR codes:
|
|
69
77
|
> `Coder.writeQR( filename, data, api = RXAPI )`
|
|
@@ -226,7 +234,7 @@ rxcode U my_qr_code.png my_key_id my_private_key
|
|
|
226
234
|
```
|
|
227
235
|
|
|
228
236
|
## 2. QR-code generator service
|
|
229
|
-
The
|
|
237
|
+
The package *rxome-server* generates QR codes containing medical information for use with the FindMe2Care database
|
|
230
238
|
(formerly called RxOME). The command line tool `rxsrv` starts the QR generator as local service listening on localhost:*port* (default: port 1607).
|
|
231
239
|
A client can send POST requests to this port and retrieves the generated QR code by HTTP protocol.
|
|
232
240
|
|
|
@@ -286,10 +294,10 @@ export RXPORT=4242
|
|
|
286
294
|
rxsrv -e
|
|
287
295
|
```
|
|
288
296
|
|
|
289
|
-
Where `RXID` is the username
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
297
|
+
Where `RXID` is the API username (not to be confused with the login name)
|
|
298
|
+
of the laboratory on the FindMe2Care platform, `RXKEY` is the
|
|
299
|
+
private API access key matching the public key stored in the user's/lab's profile on the
|
|
300
|
+
FindMe2Care platform.
|
|
293
301
|
|
|
294
302
|
Note that storing secret information in environment variables may pose a security risk; therefore, this option is not recommended and should only be used if the software runs in an isolated environment.
|
|
295
303
|
|
|
@@ -332,13 +340,28 @@ Note that the Windows service is configured with a config file given by `%RXCFG%
|
|
|
332
340
|
the default file `%APPDATA\npm\node_modules\rxome-server-win\demo.cfg` is used.
|
|
333
341
|
|
|
334
342
|
### 2.3 Using Docker
|
|
335
|
-
Instead of installing node.js and starting the server manually, you can use a docker image to run the
|
|
343
|
+
Instead of installing node.js and starting the server manually, you can use a docker image to run the service, e.g., with
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
docker run -d -p 1607:1607 tomkamphans/rxsrv:current -i "your_key_id" -s "your_private_key"
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Also, you can specify key ID and key using environment variables, which may be useful in a docker compose or kubernetes setting:
|
|
336
350
|
|
|
337
351
|
```
|
|
338
|
-
docker run -d -p 1607:1607 -e RXID="
|
|
352
|
+
docker run -d -p 1607:1607 -e RXID=" your_key_id" -e RXKEY="your_private_key" tomkamphans/rxsrv:current
|
|
339
353
|
```
|
|
340
354
|
|
|
341
|
-
Where `
|
|
355
|
+
Where `your_key_id` is the lab's API user name and your_key is the private API key as described above.
|
|
356
|
+
|
|
357
|
+
When starting the first time (or when a new key pair should be used), you can start the service with
|
|
358
|
+
|
|
359
|
+
```
|
|
360
|
+
docker run -d -p 1607:1607 tomkamphans/rxsrv:current -i "your_key_id" -K
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
to generate a new key pair. Before starting the service, the script outputs the new keys. You should copy the public key into your FM2C profile, the private key
|
|
364
|
+
is immediately used to run the service.
|
|
342
365
|
|
|
343
366
|
Note that the first port number in `-p 1607:1607` denotes the port on *localhost* to which the docker internal port (denoted the second port number, in this case 1607 also) is mapped. So if you need to run the service on another port, say 8081, use
|
|
344
367
|
`docker run -p 8081:1607 ...`.
|
|
@@ -395,19 +418,25 @@ This yields a JSON response containing
|
|
|
395
418
|
### 2.5 Server Command-Line Tool
|
|
396
419
|
|
|
397
420
|
```
|
|
398
|
-
|
|
421
|
+
FindMe2care QR-Code generation server
|
|
422
|
+
|
|
423
|
+
Usage: rxsrv -e | -c <cfg_file> | -i <id> (-k <key_file> | -s <key> | -K) [-p <port>]
|
|
424
|
+
|
|
425
|
+
Starts the QR-code tool as service listening on localhost:<port>.
|
|
426
|
+
Before first use, please use the -K option to generate an API access key and deposit the public key
|
|
427
|
+
on the FindMe2care server.
|
|
399
428
|
|
|
400
|
-
|
|
429
|
+
Given multiple key options, -K has highest priority.
|
|
401
430
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
431
|
+
The command-line parameters -k, -s, -p precede the environment variables (if -e specified), which,
|
|
432
|
+
in turn, precede the config file (if -c is also specified).
|
|
433
|
+
A key string (-s) has precedence over a key from a key file (-k).
|
|
434
|
+
|
|
435
|
+
If no parameter is given, -e is assumed.
|
|
405
436
|
|
|
406
|
-
The command-line parameters -k, -s, -p precede the environment variables (if -e specified), which, in
|
|
407
|
-
turn, precede the config file (if -c is also specified). A key string (-s) has precedence over a key
|
|
408
|
-
from a key file (-k).
|
|
409
437
|
|
|
410
438
|
Options:
|
|
439
|
+
-V, --version output the version number
|
|
411
440
|
-c, --config <filename> JSON file with config, entries id, key, [port]; -c-- to read from stdin
|
|
412
441
|
-e, --environment use environment variables RXID, RXKEY, RXPORT to configure rxsrv (useful
|
|
413
442
|
for working with docker)
|
|
@@ -415,8 +444,10 @@ Options:
|
|
|
415
444
|
-k, --keyFile <filename> Filename with API access key (default: use -s)
|
|
416
445
|
-s, --key <key string> API access key
|
|
417
446
|
-p, --port <port> Set port for server, default: 1607
|
|
418
|
-
-
|
|
419
|
-
-h, --help display help
|
|
447
|
+
-K, --newkey Generate new key pair, print both keys and start the server with the keys
|
|
448
|
+
-h, --help display help for command
|
|
449
|
+
|
|
450
|
+
Author: Tom Kamphans, GeneTalk GmbH, 2023
|
|
420
451
|
```
|
|
421
452
|
|
|
422
453
|
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "QR-Code ID",
|
|
3
|
+
"comment": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in",
|
|
4
|
+
"subject": {
|
|
5
|
+
"id": "proband A",
|
|
6
|
+
"dateOfBirth": "1994-01-01T00:00:00Z",
|
|
7
|
+
"sex": "FEMALE"
|
|
8
|
+
},
|
|
9
|
+
"phenotypicFeatures": [
|
|
10
|
+
{
|
|
11
|
+
"type": {
|
|
12
|
+
"id": "HP:0030084"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": {
|
|
17
|
+
"id": "HP:0000555"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": {
|
|
22
|
+
"id": "HP:0000486"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": {
|
|
27
|
+
"id": "HP:0000541"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": {
|
|
32
|
+
"id": "HP:0084369"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": {
|
|
37
|
+
"id": "HP:0112358"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": {
|
|
42
|
+
"id": "HP:0000145"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": {
|
|
47
|
+
"id": "HP:1234567"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": {
|
|
52
|
+
"id": "HP:9876543"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": {
|
|
57
|
+
"id": "HP:5678912"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": {
|
|
62
|
+
"id": "HP:0031360"
|
|
63
|
+
},
|
|
64
|
+
"excluded": true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"type": {
|
|
68
|
+
"id": "HP:0001234"
|
|
69
|
+
},
|
|
70
|
+
"excluded": true
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"interpretations": [
|
|
74
|
+
{
|
|
75
|
+
"id": "interpretation.id",
|
|
76
|
+
"progressStatus": "SOLVED",
|
|
77
|
+
"diagnosis": {
|
|
78
|
+
"disease": {
|
|
79
|
+
"id": "OMIM:263750"
|
|
80
|
+
},
|
|
81
|
+
"genomicInterpretations": [
|
|
82
|
+
{
|
|
83
|
+
"variantInterpretation": {
|
|
84
|
+
"acmgPathogenicityClassification": "PATHOGENIC",
|
|
85
|
+
"variationDescriptor": {
|
|
86
|
+
"geneContext": {
|
|
87
|
+
"valueId": "HGNC:9884",
|
|
88
|
+
"symbol": "RB1"
|
|
89
|
+
},
|
|
90
|
+
"expressions": [
|
|
91
|
+
{
|
|
92
|
+
"syntax": "hgvs.c",
|
|
93
|
+
"value": "NM_000321.2:c.958C>T"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"allelicState": {
|
|
97
|
+
"id": "GENO:0000135"
|
|
98
|
+
},
|
|
99
|
+
"extensions": [
|
|
100
|
+
{
|
|
101
|
+
"name": "test-type",
|
|
102
|
+
"value": "Exome, short read"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"variantInterpretation": {
|
|
110
|
+
"acmgPathogenicityClassification": "LIKELY_PATHOGENIC",
|
|
111
|
+
"variationDescriptor": {
|
|
112
|
+
"geneContext": {
|
|
113
|
+
"valueId": "HGNC:9884",
|
|
114
|
+
"symbol": "RB1"
|
|
115
|
+
},
|
|
116
|
+
"expressions": [
|
|
117
|
+
{
|
|
118
|
+
"syntax": "hgvs.c",
|
|
119
|
+
"value": "NM_000321.2:c.1234A>G"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"allelicState": {
|
|
123
|
+
"label": "heterozygous"
|
|
124
|
+
},
|
|
125
|
+
"extensions": [
|
|
126
|
+
{
|
|
127
|
+
"name": "test-type",
|
|
128
|
+
"value": "Exome, short read"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"metaData": {
|
|
139
|
+
"created": "2021-05-14T10:35:00Z",
|
|
140
|
+
"createdBy": "mgz",
|
|
141
|
+
"submittedBy": "a_clinician@mgz-muenchen.de",
|
|
142
|
+
"phenopacketSchemaVersion": "2.0"
|
|
143
|
+
}
|
|
144
|
+
}
|
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './lib/rxome-api
|
|
2
|
-
export * from './lib/rxome-api-demo
|
|
3
|
-
export * from './lib/rxome-generator
|
|
1
|
+
export * from './lib/rxome-api';
|
|
2
|
+
export * from './lib/rxome-api-demo';
|
|
3
|
+
export * from './lib/rxome-generator';
|