@metriport/commonwell-cert-runner 1.4.17 → 1.4.19
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/LICENSE +20 -20
- package/README.md +124 -124
- package/lib/document-contribution.js +333 -333
- package/lib/index.js +32 -32
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License Copyright (c) 2022 Metriport Inc.
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of
|
|
4
|
-
charge, to any person obtaining a copy of this software and associated
|
|
5
|
-
documentation files (the "Software"), to deal in the Software without
|
|
6
|
-
restriction, including without limitation the rights to use, copy, modify, merge,
|
|
7
|
-
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
-
following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice
|
|
12
|
-
(including the next paragraph) shall be included in all copies or substantial
|
|
13
|
-
portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
16
|
-
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
18
|
-
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
19
|
-
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1
|
+
MIT License Copyright (c) 2022 Metriport Inc.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of
|
|
4
|
+
charge, to any person obtaining a copy of this software and associated
|
|
5
|
+
documentation files (the "Software"), to deal in the Software without
|
|
6
|
+
restriction, including without limitation the rights to use, copy, modify, merge,
|
|
7
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
+
following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice
|
|
12
|
+
(including the next paragraph) shall be included in all copies or substantial
|
|
13
|
+
portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
16
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
18
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
19
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
21
|
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
# `commonwell-cert-runner`
|
|
2
|
-
|
|
3
|
-
CommonWell Certification Runner by Metriport Inc.
|
|
4
|
-
|
|
5
|
-
Tool to run through Edge System CommonWell certification test cases.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
To install the program, execute the following command on your terminal:
|
|
10
|
-
|
|
11
|
-
`npm i -g @metriport/commonwell-cert-runner`
|
|
12
|
-
|
|
13
|
-
Note: you may have to run the command with `sudo`.
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
After installation, create a `.env` file defining the following variables:
|
|
18
|
-
|
|
19
|
-
- `COMMONWELL_ORG_NAME`: the organization that will be making the requests.
|
|
20
|
-
- `COMMONWELL_OID`: the organization ID.
|
|
21
|
-
- `COMMONWELL_SANDBOX_ORG_NAME`: the organization on sandbox for patient management and document contribution
|
|
22
|
-
- should be configured with your FHIR server and OAuth 2 data on Commonwell management portal
|
|
23
|
-
- `COMMONWELL_SANDBOX_OID`: the ID of the organization above
|
|
24
|
-
- `COMMONWELL_ORG_PRIVATE_KEY`: the RSA256 private key corresponding to the specified organization.
|
|
25
|
-
- `COMMONWELL_ORG_CERTIFICATE`: the public certificate/key corresponding to the private key.
|
|
26
|
-
- `COMMONWELL_MEMBER_OID`: the member ID for organization management
|
|
27
|
-
- `COMMONWELL_MEMBER_PRIVATE_KEY`: the RSA256 private key corresponding to the specified member management organization.
|
|
28
|
-
- `COMMONWELL_MEMBER_CERTIFICATE`: the public certificate/key corresponding to the private key.
|
|
29
|
-
- `DOCUMENT_PATIENT_FIRST_NAME`: the first name of a patient created along with the sandbox that has a document associated
|
|
30
|
-
- `DOCUMENT_PATIENT_LAST_NAME`: their last name
|
|
31
|
-
- `DOCUMENT_PATIENT_DATE_OF_BIRTH`: their date of birth on the format YYYY-MM-DD
|
|
32
|
-
- `DOCUMENT_PATIENT_GENDER`: their gender (M|F)
|
|
33
|
-
- `DOCUMENT_PATIENT_ZIP`: their address zip code
|
|
34
|
-
- `DOCUMENT_CONTRIBUTION_ORGANIZATION_ID`: organization suffix for the document contribution flow (usually in the format
|
|
35
|
-
"2.dddddd", with 'd' being a digit)
|
|
36
|
-
- `DOCUMENT_CONTRIBUTION_PATIENT_FIRST_NAME`: the first name of the patient to be created on the organization used for the
|
|
37
|
-
document contribution flow - same for the properties below [optional, defaults to the same name from the document patient
|
|
38
|
-
above]
|
|
39
|
-
- `DOCUMENT_CONTRIBUTION_PATIENT_LAST_NAME`
|
|
40
|
-
- `DOCUMENT_CONTRIBUTION_PATIENT_DATE_OF_BIRTH`
|
|
41
|
-
- `DOCUMENT_CONTRIBUTION_PATIENT_GENDER`
|
|
42
|
-
- `DOCUMENT_CONTRIBUTION_PATIENT_ZIP`
|
|
43
|
-
- `DOCUMENT_CONTRIBUTION_URL`: the url of the server where the documents are stored
|
|
44
|
-
- `DOCUMENT_CONTRIBUTION_FHIRURL`: the direct url of the FHIR server where the documents are stored, with no authentication required
|
|
45
|
-
- `DOCUMENT_CONTRIBUTION_AUTH_URL`: the url of the server used to authenticate document contribution requests
|
|
46
|
-
- `DOCUMENT_CONTRIBUTION_CLIENT_ID`: the client OAuth ID to authenticate document contribution requests
|
|
47
|
-
- `DOCUMENT_CONTRIBUTION_CLIENT_SECRET`: the client OAuth secret to authenticate document contribution requests
|
|
48
|
-
|
|
49
|
-
flow - must exist on the sandbox organization
|
|
50
|
-
|
|
51
|
-
Example file content looks like:
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
COMMONWELL_ORG_NAME=Metriport
|
|
55
|
-
COMMONWELL_OID=2.16.840.1.113883.3.9621
|
|
56
|
-
COMMONWELL_SANDBOX_ORG_NAME=Metriport-OrgA-1620
|
|
57
|
-
COMMONWELL_SANDBOX_OID=2.16.840.1.113883.3.3330.8889429.1620.1
|
|
58
|
-
COMMONWELL_ORG_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
|
|
59
|
-
...
|
|
60
|
-
-----END PRIVATE KEY-----"
|
|
61
|
-
COMMONWELL_ORG_CERTIFICATE="-----BEGIN CERTIFICATE-----
|
|
62
|
-
...
|
|
63
|
-
-----END CERTIFICATE-----"
|
|
64
|
-
COMMONWELL_MEMBER_OID=1.3.6.1.4.1.18.12.29.2022.945
|
|
65
|
-
COMMONWELL_ORG_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
|
|
66
|
-
...
|
|
67
|
-
-----END PRIVATE KEY-----"
|
|
68
|
-
COMMONWELL_ORG_CERTIFICATE="-----BEGIN CERTIFICATE-----
|
|
69
|
-
...
|
|
70
|
-
-----END CERTIFICATE-----"
|
|
71
|
-
DOCUMENT_PATIENT_FIRST_NAME="Stephen"
|
|
72
|
-
DOCUMENT_PATIENT_LAST_NAME="Pujols1234"
|
|
73
|
-
DOCUMENT_PATIENT_DATE_OF_BIRTH="1955-10-23"
|
|
74
|
-
DOCUMENT_PATIENT_GENDER="M"
|
|
75
|
-
DOCUMENT_PATIENT_ZIP="62732"
|
|
76
|
-
# This is optional, if not set the runner will attempt to create the patient above on the sandbox org
|
|
77
|
-
DOCUMENT_CONTRIBUTION_PATIENT_ID=<patient-id>%5E%5E%5Eurn%3aoid%3a<org-id>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
After the file is created, you can run execute following command on your terminal to run the program:
|
|
81
|
-
|
|
82
|
-
`cw-cert-runner --env-file "/path/to/created/env/file/.env"`
|
|
83
|
-
|
|
84
|
-
## Options
|
|
85
|
-
|
|
86
|
-
`--env-file <file-path>`
|
|
87
|
-
|
|
88
|
-
Absolute path to the .env file containing required config.
|
|
89
|
-
|
|
90
|
-
`-V, --version`
|
|
91
|
-
|
|
92
|
-
Output the version number.
|
|
93
|
-
|
|
94
|
-
`-h, --help`
|
|
95
|
-
|
|
96
|
-
Display help for command.
|
|
97
|
-
|
|
98
|
-
## Development
|
|
99
|
-
|
|
100
|
-
`npm run build`: builds the package
|
|
101
|
-
|
|
102
|
-
`npm start`: runs the local code pointing to `./.env`
|
|
103
|
-
|
|
104
|
-
(optionally) `npm run install-local`: installs the package globally from the local source
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
,▄,
|
|
108
|
-
▄▓███▌
|
|
109
|
-
▄▀╙ ▀▓▀ ²▄
|
|
110
|
-
▄└ ╙▌
|
|
111
|
-
,▀ ╨▄
|
|
112
|
-
▌ ║
|
|
113
|
-
▌
|
|
114
|
-
▌
|
|
115
|
-
,▓██▄ ╔███▄
|
|
116
|
-
╙███▌ ▀███▀
|
|
117
|
-
▀▄
|
|
118
|
-
▀╗▄ ,▄
|
|
119
|
-
'╙▀▀▀▀▀╙''
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
by Metriport Inc.
|
|
123
|
-
|
|
124
|
-
```
|
|
1
|
+
# `commonwell-cert-runner`
|
|
2
|
+
|
|
3
|
+
CommonWell Certification Runner by Metriport Inc.
|
|
4
|
+
|
|
5
|
+
Tool to run through Edge System CommonWell certification test cases.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
To install the program, execute the following command on your terminal:
|
|
10
|
+
|
|
11
|
+
`npm i -g @metriport/commonwell-cert-runner`
|
|
12
|
+
|
|
13
|
+
Note: you may have to run the command with `sudo`.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
After installation, create a `.env` file defining the following variables:
|
|
18
|
+
|
|
19
|
+
- `COMMONWELL_ORG_NAME`: the organization that will be making the requests.
|
|
20
|
+
- `COMMONWELL_OID`: the organization ID.
|
|
21
|
+
- `COMMONWELL_SANDBOX_ORG_NAME`: the organization on sandbox for patient management and document contribution
|
|
22
|
+
- should be configured with your FHIR server and OAuth 2 data on Commonwell management portal
|
|
23
|
+
- `COMMONWELL_SANDBOX_OID`: the ID of the organization above
|
|
24
|
+
- `COMMONWELL_ORG_PRIVATE_KEY`: the RSA256 private key corresponding to the specified organization.
|
|
25
|
+
- `COMMONWELL_ORG_CERTIFICATE`: the public certificate/key corresponding to the private key.
|
|
26
|
+
- `COMMONWELL_MEMBER_OID`: the member ID for organization management
|
|
27
|
+
- `COMMONWELL_MEMBER_PRIVATE_KEY`: the RSA256 private key corresponding to the specified member management organization.
|
|
28
|
+
- `COMMONWELL_MEMBER_CERTIFICATE`: the public certificate/key corresponding to the private key.
|
|
29
|
+
- `DOCUMENT_PATIENT_FIRST_NAME`: the first name of a patient created along with the sandbox that has a document associated
|
|
30
|
+
- `DOCUMENT_PATIENT_LAST_NAME`: their last name
|
|
31
|
+
- `DOCUMENT_PATIENT_DATE_OF_BIRTH`: their date of birth on the format YYYY-MM-DD
|
|
32
|
+
- `DOCUMENT_PATIENT_GENDER`: their gender (M|F)
|
|
33
|
+
- `DOCUMENT_PATIENT_ZIP`: their address zip code
|
|
34
|
+
- `DOCUMENT_CONTRIBUTION_ORGANIZATION_ID`: organization suffix for the document contribution flow (usually in the format
|
|
35
|
+
"2.dddddd", with 'd' being a digit)
|
|
36
|
+
- `DOCUMENT_CONTRIBUTION_PATIENT_FIRST_NAME`: the first name of the patient to be created on the organization used for the
|
|
37
|
+
document contribution flow - same for the properties below [optional, defaults to the same name from the document patient
|
|
38
|
+
above]
|
|
39
|
+
- `DOCUMENT_CONTRIBUTION_PATIENT_LAST_NAME`
|
|
40
|
+
- `DOCUMENT_CONTRIBUTION_PATIENT_DATE_OF_BIRTH`
|
|
41
|
+
- `DOCUMENT_CONTRIBUTION_PATIENT_GENDER`
|
|
42
|
+
- `DOCUMENT_CONTRIBUTION_PATIENT_ZIP`
|
|
43
|
+
- `DOCUMENT_CONTRIBUTION_URL`: the url of the server where the documents are stored
|
|
44
|
+
- `DOCUMENT_CONTRIBUTION_FHIRURL`: the direct url of the FHIR server where the documents are stored, with no authentication required
|
|
45
|
+
- `DOCUMENT_CONTRIBUTION_AUTH_URL`: the url of the server used to authenticate document contribution requests
|
|
46
|
+
- `DOCUMENT_CONTRIBUTION_CLIENT_ID`: the client OAuth ID to authenticate document contribution requests
|
|
47
|
+
- `DOCUMENT_CONTRIBUTION_CLIENT_SECRET`: the client OAuth secret to authenticate document contribution requests
|
|
48
|
+
|
|
49
|
+
flow - must exist on the sandbox organization
|
|
50
|
+
|
|
51
|
+
Example file content looks like:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
COMMONWELL_ORG_NAME=Metriport
|
|
55
|
+
COMMONWELL_OID=2.16.840.1.113883.3.9621
|
|
56
|
+
COMMONWELL_SANDBOX_ORG_NAME=Metriport-OrgA-1620
|
|
57
|
+
COMMONWELL_SANDBOX_OID=2.16.840.1.113883.3.3330.8889429.1620.1
|
|
58
|
+
COMMONWELL_ORG_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
|
|
59
|
+
...
|
|
60
|
+
-----END PRIVATE KEY-----"
|
|
61
|
+
COMMONWELL_ORG_CERTIFICATE="-----BEGIN CERTIFICATE-----
|
|
62
|
+
...
|
|
63
|
+
-----END CERTIFICATE-----"
|
|
64
|
+
COMMONWELL_MEMBER_OID=1.3.6.1.4.1.18.12.29.2022.945
|
|
65
|
+
COMMONWELL_ORG_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
|
|
66
|
+
...
|
|
67
|
+
-----END PRIVATE KEY-----"
|
|
68
|
+
COMMONWELL_ORG_CERTIFICATE="-----BEGIN CERTIFICATE-----
|
|
69
|
+
...
|
|
70
|
+
-----END CERTIFICATE-----"
|
|
71
|
+
DOCUMENT_PATIENT_FIRST_NAME="Stephen"
|
|
72
|
+
DOCUMENT_PATIENT_LAST_NAME="Pujols1234"
|
|
73
|
+
DOCUMENT_PATIENT_DATE_OF_BIRTH="1955-10-23"
|
|
74
|
+
DOCUMENT_PATIENT_GENDER="M"
|
|
75
|
+
DOCUMENT_PATIENT_ZIP="62732"
|
|
76
|
+
# This is optional, if not set the runner will attempt to create the patient above on the sandbox org
|
|
77
|
+
DOCUMENT_CONTRIBUTION_PATIENT_ID=<patient-id>%5E%5E%5Eurn%3aoid%3a<org-id>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
After the file is created, you can run execute following command on your terminal to run the program:
|
|
81
|
+
|
|
82
|
+
`cw-cert-runner --env-file "/path/to/created/env/file/.env"`
|
|
83
|
+
|
|
84
|
+
## Options
|
|
85
|
+
|
|
86
|
+
`--env-file <file-path>`
|
|
87
|
+
|
|
88
|
+
Absolute path to the .env file containing required config.
|
|
89
|
+
|
|
90
|
+
`-V, --version`
|
|
91
|
+
|
|
92
|
+
Output the version number.
|
|
93
|
+
|
|
94
|
+
`-h, --help`
|
|
95
|
+
|
|
96
|
+
Display help for command.
|
|
97
|
+
|
|
98
|
+
## Development
|
|
99
|
+
|
|
100
|
+
`npm run build`: builds the package
|
|
101
|
+
|
|
102
|
+
`npm start`: runs the local code pointing to `./.env`
|
|
103
|
+
|
|
104
|
+
(optionally) `npm run install-local`: installs the package globally from the local source
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
,▄,
|
|
108
|
+
▄▓███▌
|
|
109
|
+
▄▀╙ ▀▓▀ ²▄
|
|
110
|
+
▄└ ╙▌
|
|
111
|
+
,▀ ╨▄
|
|
112
|
+
▌ ║
|
|
113
|
+
▌
|
|
114
|
+
▌
|
|
115
|
+
,▓██▄ ╔███▄
|
|
116
|
+
╙███▌ ▀███▀
|
|
117
|
+
▀▄
|
|
118
|
+
▀╗▄ ,▄
|
|
119
|
+
'╙▀▀▀▀▀╙''
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
by Metriport Inc.
|
|
123
|
+
|
|
124
|
+
```
|
|
@@ -161,352 +161,352 @@ async function getOrCreateOrg(memberManagementApi, queryMeta) {
|
|
|
161
161
|
}
|
|
162
162
|
async function addOrgToFHIRServer(orgId, orgName, fhirApi) {
|
|
163
163
|
// TODO: #230 we could create data as a JS structure instead of string - easier for future code enhancements and maintenance.
|
|
164
|
-
const data = `{
|
|
165
|
-
"resourceType": "Organization",
|
|
166
|
-
"id": "${orgId}",
|
|
167
|
-
"meta": {
|
|
168
|
-
"versionId": "1",
|
|
169
|
-
"lastUpdated": "2023-02-04T13:23:38.744+00:00",
|
|
170
|
-
"source": "${rootOid}"
|
|
171
|
-
},
|
|
172
|
-
"identifier": [
|
|
173
|
-
{
|
|
174
|
-
"system": "urn:ietf:rfc:3986",
|
|
175
|
-
"value": "${orgId}"
|
|
176
|
-
}
|
|
177
|
-
],
|
|
178
|
-
"active": true,
|
|
179
|
-
"type": [
|
|
180
|
-
{
|
|
181
|
-
"coding": [
|
|
182
|
-
{
|
|
183
|
-
"system": "http://terminology.hl7.org/CodeSystem/organization-type",
|
|
184
|
-
"code": "prov",
|
|
185
|
-
"display": "Healthcare Provider"
|
|
186
|
-
}
|
|
187
|
-
],
|
|
188
|
-
"text": "Healthcare Provider"
|
|
189
|
-
}
|
|
190
|
-
],
|
|
191
|
-
"name": "${orgName}",
|
|
192
|
-
"telecom": [
|
|
193
|
-
{
|
|
194
|
-
"system": "phone",
|
|
195
|
-
"value": "5088287000"
|
|
196
|
-
}
|
|
197
|
-
],
|
|
198
|
-
"address": [
|
|
199
|
-
{
|
|
200
|
-
"line": [
|
|
201
|
-
"88 WASHINGTON STREET"
|
|
202
|
-
],
|
|
203
|
-
"city": "TAUNTON",
|
|
204
|
-
"state": "MA",
|
|
205
|
-
"postalCode": "02780",
|
|
206
|
-
"country": "US"
|
|
207
|
-
}
|
|
208
|
-
]
|
|
164
|
+
const data = `{
|
|
165
|
+
"resourceType": "Organization",
|
|
166
|
+
"id": "${orgId}",
|
|
167
|
+
"meta": {
|
|
168
|
+
"versionId": "1",
|
|
169
|
+
"lastUpdated": "2023-02-04T13:23:38.744+00:00",
|
|
170
|
+
"source": "${rootOid}"
|
|
171
|
+
},
|
|
172
|
+
"identifier": [
|
|
173
|
+
{
|
|
174
|
+
"system": "urn:ietf:rfc:3986",
|
|
175
|
+
"value": "${orgId}"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"active": true,
|
|
179
|
+
"type": [
|
|
180
|
+
{
|
|
181
|
+
"coding": [
|
|
182
|
+
{
|
|
183
|
+
"system": "http://terminology.hl7.org/CodeSystem/organization-type",
|
|
184
|
+
"code": "prov",
|
|
185
|
+
"display": "Healthcare Provider"
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"text": "Healthcare Provider"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"name": "${orgName}",
|
|
192
|
+
"telecom": [
|
|
193
|
+
{
|
|
194
|
+
"system": "phone",
|
|
195
|
+
"value": "5088287000"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"address": [
|
|
199
|
+
{
|
|
200
|
+
"line": [
|
|
201
|
+
"88 WASHINGTON STREET"
|
|
202
|
+
],
|
|
203
|
+
"city": "TAUNTON",
|
|
204
|
+
"state": "MA",
|
|
205
|
+
"postalCode": "02780",
|
|
206
|
+
"country": "US"
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
209
|
}`;
|
|
210
210
|
await fhirApi.put(`/Organization/${orgId}`, JSON.parse(data));
|
|
211
211
|
}
|
|
212
212
|
async function addPatientToFHIRServer(patientId, fhirApi) {
|
|
213
|
-
const data = `{
|
|
214
|
-
"resourceType": "Patient",
|
|
215
|
-
"id": "${patientId}",
|
|
216
|
-
"meta": {
|
|
217
|
-
"versionId": "6",
|
|
218
|
-
"lastUpdated": "2023-02-15T22:27:07.642+00:00",
|
|
219
|
-
"source": "${rootOid}"
|
|
220
|
-
},
|
|
221
|
-
"extension": [
|
|
222
|
-
{
|
|
223
|
-
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
|
|
224
|
-
"extension": [
|
|
225
|
-
{
|
|
226
|
-
"url": "ombCategory",
|
|
227
|
-
"valueCoding": {
|
|
228
|
-
"system": "urn:oid:2.16.840.1.113883.6.238",
|
|
229
|
-
"code": "2106-3",
|
|
230
|
-
"display": "White"
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
"url": "text",
|
|
235
|
-
"valueString": "White"
|
|
236
|
-
}
|
|
237
|
-
]
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",
|
|
241
|
-
"extension": [
|
|
242
|
-
{
|
|
243
|
-
"url": "ombCategory",
|
|
244
|
-
"valueCoding": {
|
|
245
|
-
"system": "urn:oid:2.16.840.1.113883.6.238",
|
|
246
|
-
"code": "2186-5",
|
|
247
|
-
"display": "Not Hispanic or Latino"
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
"url": "text",
|
|
252
|
-
"valueString": "Not Hispanic or Latino"
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
"url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
|
|
258
|
-
"valueString": "Deadra347 Borer986"
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
|
|
262
|
-
"valueCode": "M"
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
"url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace",
|
|
266
|
-
"valueAddress": {
|
|
267
|
-
"city": "Billerica",
|
|
268
|
-
"state": "Massachusetts",
|
|
269
|
-
"country": "US"
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
"url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years",
|
|
274
|
-
"valueDecimal": 14.062655945052095
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years",
|
|
278
|
-
"valueDecimal": 58.93734405494791
|
|
279
|
-
}
|
|
280
|
-
],
|
|
281
|
-
"identifier": [
|
|
282
|
-
{
|
|
283
|
-
"system": "https://github.com/synthetichealth/synthea",
|
|
284
|
-
"value": "2fa15bc7-8866-461a-9000-f739e425860a"
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
"type": {
|
|
288
|
-
"coding": [
|
|
289
|
-
{
|
|
290
|
-
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
|
|
291
|
-
"code": "MR",
|
|
292
|
-
"display": "Medical Record Number"
|
|
293
|
-
}
|
|
294
|
-
],
|
|
295
|
-
"text": "Medical Record Number"
|
|
296
|
-
},
|
|
297
|
-
"system": "http://hospital.smarthealthit.org",
|
|
298
|
-
"value": "2fa15bc7-8866-461a-9000-f739e425860a"
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
"type": {
|
|
302
|
-
"coding": [
|
|
303
|
-
{
|
|
304
|
-
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
|
|
305
|
-
"code": "SS",
|
|
306
|
-
"display": "Social Security Number"
|
|
307
|
-
}
|
|
308
|
-
],
|
|
309
|
-
"text": "Social Security Number"
|
|
310
|
-
},
|
|
311
|
-
"system": "http://hl7.org/fhir/sid/us-ssn",
|
|
312
|
-
"value": "999-93-7537"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
"type": {
|
|
316
|
-
"coding": [
|
|
317
|
-
{
|
|
318
|
-
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
|
|
319
|
-
"code": "DL",
|
|
320
|
-
"display": "Driver's License"
|
|
321
|
-
}
|
|
322
|
-
],
|
|
323
|
-
"text": "Driver's License"
|
|
324
|
-
},
|
|
325
|
-
"system": "urn:oid:2.16.840.1.113883.4.3.25",
|
|
326
|
-
"value": "S99948707"
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
"type": {
|
|
330
|
-
"coding": [
|
|
331
|
-
{
|
|
332
|
-
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
|
|
333
|
-
"code": "PPN",
|
|
334
|
-
"display": "Passport Number"
|
|
335
|
-
}
|
|
336
|
-
],
|
|
337
|
-
"text": "Passport Number"
|
|
338
|
-
},
|
|
339
|
-
"system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
|
|
340
|
-
"value": "X14078167X"
|
|
341
|
-
}
|
|
342
|
-
],
|
|
343
|
-
"name": [
|
|
344
|
-
{
|
|
345
|
-
"use": "official",
|
|
346
|
-
"family": "Rockefeller54",
|
|
347
|
-
"given": [
|
|
348
|
-
"Jonathan54"
|
|
349
|
-
],
|
|
350
|
-
"prefix": [
|
|
351
|
-
"Mr."
|
|
352
|
-
]
|
|
353
|
-
}
|
|
354
|
-
],
|
|
355
|
-
"telecom": [
|
|
356
|
-
{
|
|
357
|
-
"system": "phone",
|
|
358
|
-
"value": "555-677-3119",
|
|
359
|
-
"use": "home"
|
|
360
|
-
}
|
|
361
|
-
],
|
|
362
|
-
"gender": "male",
|
|
363
|
-
"birthDate": "1983-12-22",
|
|
364
|
-
"address": [
|
|
365
|
-
{
|
|
366
|
-
"extension": [
|
|
367
|
-
{
|
|
368
|
-
"url": "http://hl7.org/fhir/StructureDefinition/geolocation",
|
|
369
|
-
"extension": [
|
|
370
|
-
{
|
|
371
|
-
"url": "latitude",
|
|
372
|
-
"valueDecimal": 41.93879298871088
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
"url": "longitude",
|
|
376
|
-
"valueDecimal": -71.06682353144593
|
|
377
|
-
}
|
|
378
|
-
]
|
|
379
|
-
}
|
|
380
|
-
],
|
|
381
|
-
"line": [
|
|
382
|
-
"894 Brakus Bypass"
|
|
383
|
-
],
|
|
384
|
-
"city": "San Francisco",
|
|
385
|
-
"state": "California",
|
|
386
|
-
"postalCode": "81547",
|
|
387
|
-
"country": "US"
|
|
388
|
-
}
|
|
389
|
-
],
|
|
390
|
-
"maritalStatus": {
|
|
391
|
-
"coding": [
|
|
392
|
-
{
|
|
393
|
-
"system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus",
|
|
394
|
-
"code": "S",
|
|
395
|
-
"display": "S"
|
|
396
|
-
}
|
|
397
|
-
],
|
|
398
|
-
"text": "S"
|
|
399
|
-
},
|
|
400
|
-
"multipleBirthBoolean": false,
|
|
401
|
-
"communication": [
|
|
402
|
-
{
|
|
403
|
-
"language": {
|
|
404
|
-
"coding": [
|
|
405
|
-
{
|
|
406
|
-
"system": "urn:ietf:bcp:47",
|
|
407
|
-
"code": "en-US",
|
|
408
|
-
"display": "English"
|
|
409
|
-
}
|
|
410
|
-
],
|
|
411
|
-
"text": "English"
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
]
|
|
213
|
+
const data = `{
|
|
214
|
+
"resourceType": "Patient",
|
|
215
|
+
"id": "${patientId}",
|
|
216
|
+
"meta": {
|
|
217
|
+
"versionId": "6",
|
|
218
|
+
"lastUpdated": "2023-02-15T22:27:07.642+00:00",
|
|
219
|
+
"source": "${rootOid}"
|
|
220
|
+
},
|
|
221
|
+
"extension": [
|
|
222
|
+
{
|
|
223
|
+
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
|
|
224
|
+
"extension": [
|
|
225
|
+
{
|
|
226
|
+
"url": "ombCategory",
|
|
227
|
+
"valueCoding": {
|
|
228
|
+
"system": "urn:oid:2.16.840.1.113883.6.238",
|
|
229
|
+
"code": "2106-3",
|
|
230
|
+
"display": "White"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"url": "text",
|
|
235
|
+
"valueString": "White"
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",
|
|
241
|
+
"extension": [
|
|
242
|
+
{
|
|
243
|
+
"url": "ombCategory",
|
|
244
|
+
"valueCoding": {
|
|
245
|
+
"system": "urn:oid:2.16.840.1.113883.6.238",
|
|
246
|
+
"code": "2186-5",
|
|
247
|
+
"display": "Not Hispanic or Latino"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"url": "text",
|
|
252
|
+
"valueString": "Not Hispanic or Latino"
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
|
|
258
|
+
"valueString": "Deadra347 Borer986"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
|
|
262
|
+
"valueCode": "M"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace",
|
|
266
|
+
"valueAddress": {
|
|
267
|
+
"city": "Billerica",
|
|
268
|
+
"state": "Massachusetts",
|
|
269
|
+
"country": "US"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years",
|
|
274
|
+
"valueDecimal": 14.062655945052095
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years",
|
|
278
|
+
"valueDecimal": 58.93734405494791
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
"identifier": [
|
|
282
|
+
{
|
|
283
|
+
"system": "https://github.com/synthetichealth/synthea",
|
|
284
|
+
"value": "2fa15bc7-8866-461a-9000-f739e425860a"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"type": {
|
|
288
|
+
"coding": [
|
|
289
|
+
{
|
|
290
|
+
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
|
|
291
|
+
"code": "MR",
|
|
292
|
+
"display": "Medical Record Number"
|
|
293
|
+
}
|
|
294
|
+
],
|
|
295
|
+
"text": "Medical Record Number"
|
|
296
|
+
},
|
|
297
|
+
"system": "http://hospital.smarthealthit.org",
|
|
298
|
+
"value": "2fa15bc7-8866-461a-9000-f739e425860a"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"type": {
|
|
302
|
+
"coding": [
|
|
303
|
+
{
|
|
304
|
+
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
|
|
305
|
+
"code": "SS",
|
|
306
|
+
"display": "Social Security Number"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"text": "Social Security Number"
|
|
310
|
+
},
|
|
311
|
+
"system": "http://hl7.org/fhir/sid/us-ssn",
|
|
312
|
+
"value": "999-93-7537"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"type": {
|
|
316
|
+
"coding": [
|
|
317
|
+
{
|
|
318
|
+
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
|
|
319
|
+
"code": "DL",
|
|
320
|
+
"display": "Driver's License"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"text": "Driver's License"
|
|
324
|
+
},
|
|
325
|
+
"system": "urn:oid:2.16.840.1.113883.4.3.25",
|
|
326
|
+
"value": "S99948707"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"type": {
|
|
330
|
+
"coding": [
|
|
331
|
+
{
|
|
332
|
+
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
|
|
333
|
+
"code": "PPN",
|
|
334
|
+
"display": "Passport Number"
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"text": "Passport Number"
|
|
338
|
+
},
|
|
339
|
+
"system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
|
|
340
|
+
"value": "X14078167X"
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
"name": [
|
|
344
|
+
{
|
|
345
|
+
"use": "official",
|
|
346
|
+
"family": "Rockefeller54",
|
|
347
|
+
"given": [
|
|
348
|
+
"Jonathan54"
|
|
349
|
+
],
|
|
350
|
+
"prefix": [
|
|
351
|
+
"Mr."
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
"telecom": [
|
|
356
|
+
{
|
|
357
|
+
"system": "phone",
|
|
358
|
+
"value": "555-677-3119",
|
|
359
|
+
"use": "home"
|
|
360
|
+
}
|
|
361
|
+
],
|
|
362
|
+
"gender": "male",
|
|
363
|
+
"birthDate": "1983-12-22",
|
|
364
|
+
"address": [
|
|
365
|
+
{
|
|
366
|
+
"extension": [
|
|
367
|
+
{
|
|
368
|
+
"url": "http://hl7.org/fhir/StructureDefinition/geolocation",
|
|
369
|
+
"extension": [
|
|
370
|
+
{
|
|
371
|
+
"url": "latitude",
|
|
372
|
+
"valueDecimal": 41.93879298871088
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"url": "longitude",
|
|
376
|
+
"valueDecimal": -71.06682353144593
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
],
|
|
381
|
+
"line": [
|
|
382
|
+
"894 Brakus Bypass"
|
|
383
|
+
],
|
|
384
|
+
"city": "San Francisco",
|
|
385
|
+
"state": "California",
|
|
386
|
+
"postalCode": "81547",
|
|
387
|
+
"country": "US"
|
|
388
|
+
}
|
|
389
|
+
],
|
|
390
|
+
"maritalStatus": {
|
|
391
|
+
"coding": [
|
|
392
|
+
{
|
|
393
|
+
"system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus",
|
|
394
|
+
"code": "S",
|
|
395
|
+
"display": "S"
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
"text": "S"
|
|
399
|
+
},
|
|
400
|
+
"multipleBirthBoolean": false,
|
|
401
|
+
"communication": [
|
|
402
|
+
{
|
|
403
|
+
"language": {
|
|
404
|
+
"coding": [
|
|
405
|
+
{
|
|
406
|
+
"system": "urn:ietf:bcp:47",
|
|
407
|
+
"code": "en-US",
|
|
408
|
+
"display": "English"
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
"text": "English"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
415
|
}`;
|
|
416
416
|
await fhirApi.put(`/Patient/${patientId}`, JSON.parse(data));
|
|
417
417
|
}
|
|
418
418
|
async function addDocumentRefAndBinaryToFHIRServer(patientId, orgId, orgName, fhirApi) {
|
|
419
419
|
const binaryId = `${orgId}.969696`;
|
|
420
420
|
const payload = fs.readFileSync("./data/doc-contrib-payload");
|
|
421
|
-
const binaryData = `{
|
|
422
|
-
"resourceType": "Binary",
|
|
423
|
-
"id": "${binaryId}",
|
|
424
|
-
"contentType": "application/xml",
|
|
425
|
-
"data": "${payload}"
|
|
421
|
+
const binaryData = `{
|
|
422
|
+
"resourceType": "Binary",
|
|
423
|
+
"id": "${binaryId}",
|
|
424
|
+
"contentType": "application/xml",
|
|
425
|
+
"data": "${payload}"
|
|
426
426
|
}`;
|
|
427
427
|
await fhirApi.put(`/Binary/${binaryId}`, JSON.parse(binaryData));
|
|
428
428
|
const docRefId = `${orgId}.696969`;
|
|
429
|
-
const data = `{
|
|
430
|
-
"resourceType": "DocumentReference",
|
|
431
|
-
"id": "${docRefId}",
|
|
432
|
-
"meta": {
|
|
433
|
-
"versionId": "19",
|
|
434
|
-
"lastUpdated": "2023-02-24T16:07:16.796+00:00",
|
|
435
|
-
"source": "${rootOid}"
|
|
436
|
-
},
|
|
437
|
-
"contained": [
|
|
438
|
-
{
|
|
439
|
-
"resourceType": "Organization",
|
|
440
|
-
"id": "${orgId}",
|
|
441
|
-
"name": "${orgName}"
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
"resourceType": "Patient",
|
|
445
|
-
"id": "${patientId}"
|
|
446
|
-
}
|
|
447
|
-
],
|
|
448
|
-
"masterIdentifier": {
|
|
449
|
-
"system": "urn:ietf:rfc:3986",
|
|
450
|
-
"value": "${docRefId}"
|
|
451
|
-
},
|
|
452
|
-
"identifier": [
|
|
453
|
-
{
|
|
454
|
-
"use": "official",
|
|
455
|
-
"system": "urn:ietf:rfc:3986",
|
|
456
|
-
"value": "${docRefId}"
|
|
457
|
-
}
|
|
458
|
-
],
|
|
459
|
-
"status": "current",
|
|
460
|
-
"type": {
|
|
461
|
-
"coding": [
|
|
462
|
-
{
|
|
463
|
-
"system": "http://loinc.org/",
|
|
464
|
-
"code": "75622-1",
|
|
465
|
-
"display": "HIV 1 and 2 tests - Meaningful Use set"
|
|
466
|
-
}
|
|
467
|
-
]
|
|
468
|
-
},
|
|
469
|
-
"subject": {
|
|
470
|
-
"reference": "Patient/${patientId}",
|
|
471
|
-
"type": "Patient"
|
|
472
|
-
},
|
|
473
|
-
"author": [
|
|
474
|
-
{
|
|
475
|
-
"reference": "#${orgId}",
|
|
476
|
-
"type": "Organization"
|
|
477
|
-
}
|
|
478
|
-
],
|
|
479
|
-
"description": "Summarization Of Episode Notes - provided by Metriport",
|
|
480
|
-
"content": [
|
|
481
|
-
{
|
|
482
|
-
"attachment": {
|
|
483
|
-
"contentType": "application/xml",
|
|
484
|
-
"url": "${docUrl}/Binary/${binaryId}"
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
],
|
|
488
|
-
"context": {
|
|
489
|
-
"event": [
|
|
490
|
-
{
|
|
491
|
-
"coding": [
|
|
492
|
-
{
|
|
493
|
-
"system": "http://snomed.info/sct",
|
|
494
|
-
"code": "62479008",
|
|
495
|
-
"display": "AIDS"
|
|
496
|
-
}
|
|
497
|
-
],
|
|
498
|
-
"text": "AIDS"
|
|
499
|
-
}
|
|
500
|
-
],
|
|
501
|
-
"period": {
|
|
502
|
-
"start": "2022-10-05T22:00:00.000Z",
|
|
503
|
-
"end": "2022-10-05T23:00:00.000Z"
|
|
504
|
-
},
|
|
505
|
-
"sourcePatientInfo": {
|
|
506
|
-
"reference": "#${patientId}",
|
|
507
|
-
"type": "Patient"
|
|
508
|
-
}
|
|
509
|
-
}
|
|
429
|
+
const data = `{
|
|
430
|
+
"resourceType": "DocumentReference",
|
|
431
|
+
"id": "${docRefId}",
|
|
432
|
+
"meta": {
|
|
433
|
+
"versionId": "19",
|
|
434
|
+
"lastUpdated": "2023-02-24T16:07:16.796+00:00",
|
|
435
|
+
"source": "${rootOid}"
|
|
436
|
+
},
|
|
437
|
+
"contained": [
|
|
438
|
+
{
|
|
439
|
+
"resourceType": "Organization",
|
|
440
|
+
"id": "${orgId}",
|
|
441
|
+
"name": "${orgName}"
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"resourceType": "Patient",
|
|
445
|
+
"id": "${patientId}"
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
"masterIdentifier": {
|
|
449
|
+
"system": "urn:ietf:rfc:3986",
|
|
450
|
+
"value": "${docRefId}"
|
|
451
|
+
},
|
|
452
|
+
"identifier": [
|
|
453
|
+
{
|
|
454
|
+
"use": "official",
|
|
455
|
+
"system": "urn:ietf:rfc:3986",
|
|
456
|
+
"value": "${docRefId}"
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"status": "current",
|
|
460
|
+
"type": {
|
|
461
|
+
"coding": [
|
|
462
|
+
{
|
|
463
|
+
"system": "http://loinc.org/",
|
|
464
|
+
"code": "75622-1",
|
|
465
|
+
"display": "HIV 1 and 2 tests - Meaningful Use set"
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
"subject": {
|
|
470
|
+
"reference": "Patient/${patientId}",
|
|
471
|
+
"type": "Patient"
|
|
472
|
+
},
|
|
473
|
+
"author": [
|
|
474
|
+
{
|
|
475
|
+
"reference": "#${orgId}",
|
|
476
|
+
"type": "Organization"
|
|
477
|
+
}
|
|
478
|
+
],
|
|
479
|
+
"description": "Summarization Of Episode Notes - provided by Metriport",
|
|
480
|
+
"content": [
|
|
481
|
+
{
|
|
482
|
+
"attachment": {
|
|
483
|
+
"contentType": "application/xml",
|
|
484
|
+
"url": "${docUrl}/Binary/${binaryId}"
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
],
|
|
488
|
+
"context": {
|
|
489
|
+
"event": [
|
|
490
|
+
{
|
|
491
|
+
"coding": [
|
|
492
|
+
{
|
|
493
|
+
"system": "http://snomed.info/sct",
|
|
494
|
+
"code": "62479008",
|
|
495
|
+
"display": "AIDS"
|
|
496
|
+
}
|
|
497
|
+
],
|
|
498
|
+
"text": "AIDS"
|
|
499
|
+
}
|
|
500
|
+
],
|
|
501
|
+
"period": {
|
|
502
|
+
"start": "2022-10-05T22:00:00.000Z",
|
|
503
|
+
"end": "2022-10-05T23:00:00.000Z"
|
|
504
|
+
},
|
|
505
|
+
"sourcePatientInfo": {
|
|
506
|
+
"reference": "#${patientId}",
|
|
507
|
+
"type": "Patient"
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
510
|
}`;
|
|
511
511
|
await fhirApi.put(`/DocumentReference/${docRefId}`, JSON.parse(data));
|
|
512
512
|
return { docRefId, binaryId };
|
package/lib/index.js
CHANGED
|
@@ -36,44 +36,44 @@ const patient_management_1 = require("./patient-management");
|
|
|
36
36
|
const person_management_1 = require("./person-management");
|
|
37
37
|
const util_1 = require("./util");
|
|
38
38
|
function metriportBanner() {
|
|
39
|
-
return `
|
|
40
|
-
,▄,
|
|
41
|
-
▄▓███▌
|
|
42
|
-
▄▀╙ ▀▓▀ ²▄
|
|
43
|
-
▄└ ╙▌
|
|
44
|
-
,▀ ╨▄
|
|
45
|
-
▌ ║
|
|
46
|
-
▌
|
|
47
|
-
▌
|
|
48
|
-
,▓██▄ ╔███▄
|
|
49
|
-
╙███▌ ▀███▀
|
|
50
|
-
▀▄
|
|
51
|
-
▀╗▄ ,▄
|
|
52
|
-
'╙▀▀▀▀▀╙''
|
|
53
|
-
|
|
54
|
-
Metriport Inc.
|
|
55
|
-
|
|
56
|
-
CommonWell Cert Runner
|
|
39
|
+
return `
|
|
40
|
+
,▄,
|
|
41
|
+
▄▓███▌
|
|
42
|
+
▄▀╙ ▀▓▀ ²▄
|
|
43
|
+
▄└ ╙▌
|
|
44
|
+
,▀ ╨▄
|
|
45
|
+
▌ ║
|
|
46
|
+
▌
|
|
47
|
+
▌
|
|
48
|
+
,▓██▄ ╔███▄
|
|
49
|
+
╙███▌ ▀███▀
|
|
50
|
+
▀▄
|
|
51
|
+
▀╗▄ ,▄
|
|
52
|
+
'╙▀▀▀▀▀╙''
|
|
53
|
+
|
|
54
|
+
Metriport Inc.
|
|
55
|
+
|
|
56
|
+
CommonWell Cert Runner
|
|
57
57
|
`;
|
|
58
58
|
}
|
|
59
59
|
exports.program = new commander_1.Command();
|
|
60
60
|
exports.program
|
|
61
61
|
.name("cw-cert-runner")
|
|
62
62
|
.description("Tool to run through Edge System CommonWell certification test cases.")
|
|
63
|
-
.requiredOption(`--env-file <file-path>`, `Absolute path to the .env file containing required config. Example required file contents:
|
|
64
|
-
|
|
65
|
-
COMMONWELL_ORG_NAME=Metriport
|
|
66
|
-
COMMONWELL_OID=2.16.840.1.113883.3.9621
|
|
67
|
-
COMMONWELL_SANDBOX_ORG_NAME=Metriport-OrgA-1617
|
|
68
|
-
COMMONWELL_SANDBOX_OID=2.16.840.1.113883.3.3330.8889429.1617.1
|
|
69
|
-
COMMONWELL_ORG_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
|
|
70
|
-
fkadsjhfhdsakjfhdsakhfkdsahfadshfkhdsfhdsakfdhafkashdfkjhalsdkjf
|
|
71
|
-
-----END PRIVATE KEY-----
|
|
72
|
-
"
|
|
73
|
-
COMMONWELL_ORG_CERTIFICATE="-----BEGIN CERTIFICATE-----
|
|
74
|
-
asdlkfjladsjflkjdaslkfjdsafjadslfjasdlkfjdsaklfjdkalfjdslfjalkjs
|
|
75
|
-
-----END CERTIFICATE-----
|
|
76
|
-
"
|
|
63
|
+
.requiredOption(`--env-file <file-path>`, `Absolute path to the .env file containing required config. Example required file contents:
|
|
64
|
+
|
|
65
|
+
COMMONWELL_ORG_NAME=Metriport
|
|
66
|
+
COMMONWELL_OID=2.16.840.1.113883.3.9621
|
|
67
|
+
COMMONWELL_SANDBOX_ORG_NAME=Metriport-OrgA-1617
|
|
68
|
+
COMMONWELL_SANDBOX_OID=2.16.840.1.113883.3.3330.8889429.1617.1
|
|
69
|
+
COMMONWELL_ORG_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
|
|
70
|
+
fkadsjhfhdsakjfhdsakhfkdsahfadshfkhdsfhdsakfdhafkashdfkjhalsdkjf
|
|
71
|
+
-----END PRIVATE KEY-----
|
|
72
|
+
"
|
|
73
|
+
COMMONWELL_ORG_CERTIFICATE="-----BEGIN CERTIFICATE-----
|
|
74
|
+
asdlkfjladsjflkjdaslkfjdsafjadslfjasdlkfjdsaklfjdkalfjdslfjalkjs
|
|
75
|
+
-----END CERTIFICATE-----
|
|
76
|
+
"
|
|
77
77
|
`)
|
|
78
78
|
.addHelpText("before", metriportBanner())
|
|
79
79
|
.showHelpAfterError()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metriport/commonwell-cert-runner",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.19",
|
|
4
4
|
"description": "Tool to run through Edge System CommonWell certification test cases - by Metriport Inc.",
|
|
5
5
|
"author": "Metriport Inc. <contact@metriport.com>",
|
|
6
6
|
"homepage": "https://metriport.com/",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"url": "https://github.com/metriport/metriport/issues"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@metriport/commonwell-sdk": "^4.3.
|
|
44
|
+
"@metriport/commonwell-sdk": "^4.3.10",
|
|
45
45
|
"axios": "^1.3.5",
|
|
46
46
|
"commander": "^9.5.0",
|
|
47
47
|
"dayjs": "^1.11.7",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"ts-node": "^10.9.1",
|
|
62
62
|
"typescript": "^4.9.5"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "7a98be21d4d3c5ce41eab55f2629f1b7e2c3baf6"
|
|
65
65
|
}
|