Skip to content

Commit 9c3e8f6

Browse files
Merge pull request #55 from mcode/develop
v2.1.0
2 parents e4ed24c + 45b1f79 commit 9c3e8f6

9 files changed

Lines changed: 164 additions & 105 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @jafeltra @mgramigna @julianxcarter @dmendelowitz @dtphelan1
1+
* @julianxcarter @dmendelowitz @dtphelan1

README.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,18 @@ More information on the data that should be provided in each CSV file can be fou
5151
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:
5252

5353
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:
5758
- A `baseURL` field that indicates the base URL of the server to post messages to.
5859
- A `clientId` field containing the client ID that is registered for the ICAREdata OAuth2 framework.
5960
- An `aud` field containing the audience parameter that is registered for the client in the ICAREdata OAuth2 framework.
6061
- And private-key information corresponding to the registered client in the ICAREdata OAuth2 framework, which can be provided in two formats:
6162
- 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;
6263
- A `jwk` field, containing a JWK-JSON object configured to contain the relevant private-key information.
6364

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.
6466

6567
For instructions on setting up an email notification trigger whenever an error is encountered in extraction, see the [Email Notification](#Email-Notification) section below.`
6668

@@ -91,7 +93,7 @@ In order to send an email, users must specify the hostname or IP address of an S
9193
- `port`: `<number>` (Optional) The port to connect to (defaults to 587)
9294
- `to`: `<string[]>` Comma separated list or an array of recipients email addresses that will appear on the _To:_ field
9395
- `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`)
9597

9698
An example of this object can be found in [`config/csv.config.example.json`](config/csv.config.example.json).
9799

@@ -136,24 +138,24 @@ To mask a property, provide an array of the properties to mask in the `construct
136138
"label": "patient",
137139
"type": "CSVPatientExtractor",
138140
"constructorArgs": {
139-
"filePath": "./data/patient-information.csv"
141+
"fileName": "patient-information.csv"
140142
"mask": ["address", "birthDate"]
141143
}
142144
}
143145
```
144146

145147
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:
146148

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+
```
157159

158160
## Extraction Date Range
159161

@@ -183,6 +185,23 @@ cat -v <file.csv>
183185

184186
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.
185187

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:
191+
192+
```
193+
"commonExtractorArgs": {
194+
"dataDirectory": "/Users/*****/Documents/dataDirectory",
195+
"csvParse": {
196+
"options": {
197+
"to": 3
198+
}
199+
}
200+
},
201+
```
202+
203+
**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+
186205
## Developer Guide
187206

188207
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
197216
npm upgrade <pkg-name>
198217
```
199218

200-
201219
## License
202220

203221
(C) 2020 The MITRE Corporation. All Rights Reserved.

config/csv.config.example.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"patientIdCsvPath": "./data/patient-mrns.csv",
3-
"commonExtractorArgs": {},
3+
"commonExtractorArgs": {
4+
"dataDirectory": "Users/YourAccount/absolute/path/to/data/directory"
5+
},
46
"notificationInfo": {
57
"host": "smtp.example.com",
68
"port": 587,
@@ -16,36 +18,36 @@
1618
"label": "patient",
1719
"type": "CSVPatientExtractor",
1820
"constructorArgs": {
19-
"filePath": "./data/patient-information.csv"
21+
"fileName": "patient-information.csv"
2022
}
2123
},
2224
{
2325
"label": "condition",
2426
"type": "CSVConditionExtractor",
2527
"constructorArgs": {
26-
"filePath": "./data/condition-information.csv"
28+
"fileName": "condition-information.csv"
2729
}
2830
},
2931
{
3032
"label": "cancerDiseaseStatus",
3133
"type": "CSVCancerDiseaseStatusExtractor",
3234
"constructorArgs": {
33-
"filePath": "./data/cancer-disease-status-information.csv"
35+
"fileName": "cancer-disease-status-information.csv"
3436
}
3537
},
3638
{
3739
"label": "clinicalTrialInformation",
3840
"type": "CSVClinicalTrialInformationExtractor",
3941
"constructorArgs": {
40-
"filePath": "./data/clinical-trial-information.csv",
42+
"fileName": "clinical-trial-information.csv",
4143
"clinicalSiteID": "example-site-id"
4244
}
4345
},
4446
{
4547
"label": "treatmentPlanChange",
4648
"type": "CSVTreatmentPlanChangeExtractor",
4749
"constructorArgs": {
48-
"filePath": "./data/treatment-plan-change-information.csv"
50+
"fileName": "treatment-plan-change-information.csv"
4951
}
5052
}
5153
],
@@ -56,4 +58,4 @@
5658
"pkcs12": "./path/to/private/key.p12",
5759
"pkcs12Pass": "passwordForPKCS12File"
5860
}
59-
}
61+
}

0 commit comments

Comments
 (0)