You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-16Lines changed: 34 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,16 +51,18 @@ More information on the data that should be provided in each CSV file can be fou
51
51
After exporting your CSV files to the `data` directory, kickstart the creation of a configuration file by renaming the provided `csv.config.example.json` to `csv.config.json`. Then, ensure the following configuration parameters are properly set:
52
52
53
53
1.`patientIdCsvPath` should provide a file path to a CSV file containing MRN's for relevant patients;
54
-
2. For each extractor, `filePath:` should provide a file path to a CSV file containing that corresponding extractor's data;
55
-
3. For the ClinicalInformationExtractor, `clinicalSiteID` should correspond to the researchId used by your clinical site in support of the ICAREdata trial;
56
-
4. The `awsConfig` object needs to be updated to include the following fields with information that is sent separately by the ICAREdata team:
54
+
2.`commonExtractorArgs.dataDirectory` should correspond to an absolute path to the dataDirectory containing all your exported CSV files;
55
+
3. For each extractor, `fileName` should correspond to the file name this extractor should be reading from. Note: combining the `dataDirectory` above and `fileName` should resolve to a file on disk containing this corresponding extractor's data;
56
+
4. For the ClinicalInformationExtractor, `clinicalSiteID` should correspond to the researchId used by your clinical site in support of the ICAREdata trial;
57
+
5. The `awsConfig` object needs to be updated to include the following fields with information that is sent separately by the ICAREdata team:
57
58
- A `baseURL` field that indicates the base URL of the server to post messages to.
58
59
- A `clientId` field containing the client ID that is registered for the ICAREdata OAuth2 framework.
59
60
- An `aud` field containing the audience parameter that is registered for the client in the ICAREdata OAuth2 framework.
60
61
- And private-key information corresponding to the registered client in the ICAREdata OAuth2 framework, which can be provided in two formats:
61
62
- Two fields - `pkcs12` and `pkcs12Pass` - where the former is a filepath to your locally saved P12 file and the latter is the password for opening that file, or;
62
63
- A `jwk` field, containing a JWK-JSON object configured to contain the relevant private-key information.
63
64
65
+
**Note**: Previous versions of the extraction client suggested using a `filePath` property for each extractor; while this property should still work without issue, the recommended approach is to use a common dataDirectory for all CSV files and to have each Extractor call out the name of the CSV file they need.
64
66
65
67
For instructions on setting up an email notification trigger whenever an error is encountered in extraction, see the [Email Notification](#Email-Notification) section below.`
66
68
@@ -91,7 +93,7 @@ In order to send an email, users must specify the hostname or IP address of an S
91
93
-`port`: `<number>` (Optional) The port to connect to (defaults to 587)
92
94
-`to`: `<string[]>` Comma separated list or an array of recipients email addresses that will appear on the _To:_ field
93
95
-`from`: `<string>` (Optional) The email address of the sender. All email addresses can be plain `'sender@server.com'` or formatted `'"Sender Name" sender@server.com'` (defaults to mcode-extraction-errors@mitre.org, which cannot receive reply emails)
94
-
-`tlsRejectUnauthorized`: `<boolean>` (Optional) A boolean value to set the [node.js TLSSocket option](https://nodejs.org/api/tls.html#tls_class_tls_tlssocket) for rejecting any unauthorized connections, `tls.rejectUnauthorized`. (defaults to `true`)
96
+
-`tlsRejectUnauthorized`: `<boolean>` (Optional) A boolean value to set the [node.js TLSSocket option](https://nodejs.org/api/tls.html#tls_class_tls_tlssocket) for rejecting any unauthorized connections, `tls.rejectUnauthorized`. (defaults to `true`)
95
97
96
98
An example of this object can be found in [`config/csv.config.example.json`](config/csv.config.example.json).
97
99
@@ -136,24 +138,24 @@ To mask a property, provide an array of the properties to mask in the `construct
136
138
"label": "patient",
137
139
"type": "CSVPatientExtractor",
138
140
"constructorArgs": {
139
-
"filePath": "./data/patient-information.csv"
141
+
"fileName": "patient-information.csv"
140
142
"mask": ["address", "birthDate"]
141
143
}
142
144
}
143
145
```
144
146
145
147
Alternatively, providing a string with a value of `all` in the `constructorArgs` of the Patient extractor will mask all of the supported properties listed above. The following configuration can be used to mask all properties of the `Patient` resource, rather than listing each individual property:
146
148
147
-
```bash
148
-
{
149
-
"label": "patient",
150
-
"type": "CSVPatientExtractor",
151
-
"constructorArgs": {
152
-
"filePath": "./data/patient-information.csv"
153
-
"mask": "all"
154
-
}
155
-
}
156
-
```
149
+
```bash
150
+
{
151
+
"label": "patient",
152
+
"type": "CSVPatientExtractor",
153
+
"constructorArgs": {
154
+
"fileName": "patient-information.csv"
155
+
"mask": "all"
156
+
}
157
+
}
158
+
```
157
159
158
160
## Extraction Date Range
159
161
@@ -183,6 +185,23 @@ cat -v <file.csv>
183
185
184
186
If there is an unexpected symbol at the beginning of the file, then there may be a byte order marker that needs to be removed.
185
187
188
+
#### Troubleshooting Additional Errors
189
+
190
+
The extraction client uses the node `csv-parse` library to parse specified CSV files. [Parsing options for the `csv-parse` library](https://csv.js.org/parse/options/) can be included in the configuration file within the `commonExtractorArgs.csvParse.options` section. For example, the following configuration will pass the `to` option to the `csv-parse` module, causing the extraction client to only read CSV files up to the specified line number:
**Note:** The extraction client enables the `bom`, `skip_empty_lines`, and `skip_lines_with_empty_values` options by default, including these options in the configuration file will cause these default options to be overwritten.
204
+
186
205
## Developer Guide
187
206
188
207
After making changes to any of the dependent libraries, including the [mCODE Extraction Framework](https://github.com/mcode/mcode-extraction-framework), you will need to run the following command ensure you have the updated dependencies:
@@ -197,7 +216,6 @@ If you need to update the version of a package (e.g. update `mcode-extraction-fr
197
216
npm upgrade <pkg-name>
198
217
```
199
218
200
-
201
219
## License
202
220
203
221
(C) 2020 The MITRE Corporation. All Rights Reserved.
0 commit comments