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
+41-8Lines changed: 41 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# mCODE Extraction Framework
2
2
3
-
A Node.js framework for extracting mCODE FHIR resources. All resources are profiled per the [mCODE v1.0.0 R4 FHIR Implementation Guide](https://mcodeinitiative.github.io/index.html)
3
+
A Node.js framework for extracting mCODE FHIR resources. All resources are profiled per the [mCODE v1.16.0 R4 FHIR Implementation Guide](http://hl7.org/fhir/us/mcode/2021May/)
4
4
5
5
## Table of Contents
6
6
@@ -29,7 +29,8 @@ A Node.js framework for extracting mCODE FHIR resources. All resources are profi
29
29
30
30
## Prerequisites
31
31
32
-
-[Node.js >= 12](https://nodejs.org/en/)
32
+
-[Node.js v14.18.1 (LTS as of Oct 2021)](https://nodejs.org/en/)
33
+
- npm v6.14.15 (included in LTS of Oct 2021)
33
34
34
35
### Latest
35
36
@@ -43,7 +44,7 @@ There are various extractors, modules, and helper functions exposed by the frame
43
44
44
45
Each extractor exposes an asynchronous `get` function that will return a bundle of extracted mCODE data.
@@ -91,8 +92,11 @@ Examples files for these extractor can be found in the [`test/sample-client-data
91
92
92
93
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:
93
94
94
-
1.`patientIdCsvPath` should provide a file path to a CSV file containing MRN's for relevant patients;
95
-
2. For each extractor, `filePath:` should provide a file path to a CSV file containing that corresponding extractor's data;
95
+
1.`patientIdCsvPath` should correspond to an absolute file path to a CSV file containing MRN's for relevant patients;
96
+
2.`commonExtractorArgs.dataDirectory` should correspond to an absolute path to the dataDirectory containing all your exported CSV files;
97
+
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;
98
+
99
+
**Note**: Previous versions of the MEF 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.
96
100
97
101
For instructions on setting up an email notification trigger whenever an error is encountered in extraction, see the [Email Notification](#Email-Notification) section below.
98
102
@@ -115,7 +119,7 @@ In order to send an email, users must specify the hostname or IP address of an S
115
119
-`port`: `<number>` (Optional) The port to connect to (defaults to 587)
116
120
-`to`: `<string[]>` Comma separated list or an array of recipients email addresses that will appear on the _To:_ field
117
121
-`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)
118
-
-`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`)
122
+
-`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`)
119
123
120
124
An example of this object can be found in [`config/csv.config.example.json`](config/csv.config.example.json).
Patient data can be masked within the extracted `Patient` resource. When masked, the value of the field will be replaced with a [Data Absent Reason extension](https://www.hl7.org/fhir/extension-data-absent-reason.html) with the code `masked`.
137
-
Patient properties that can be masked are: `gender`, `mrn`, `name`, `address`, `birthDate`, `language`, `ethnicity`, `birthsex`, and `race`.
141
+
Patient properties that can be masked are: `genderAndSex`, `mrn`, `name`, `address`, `birthDate`, `language`, `ethnicity`, `race`, `telecom`, `multipleBirth`, `photo`, `contact`, `generalPractitioner`, `managingOrganization`, and `link`.
138
142
To mask a property, provide an array of the properties to mask in the `constructorArgs` of the Patient extractor. For example, the following configuration can be used to mask `address` and `birthDate`:
139
143
140
144
```bash
141
145
{
142
146
"label": "patient",
143
147
"type": "CSVPatientExtractor",
144
148
"constructorArgs": {
145
-
"filePath": "./data/patient-information.csv"
149
+
"fileName": "patient-information.csv"
146
150
"mask": ["address", "birthDate"]
147
151
}
148
152
}
149
153
```
150
154
155
+
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:
156
+
157
+
```bash
158
+
{
159
+
"label": "patient",
160
+
"type": "CSVPatientExtractor",
161
+
"constructorArgs": {
162
+
"fileName": "patient-information.csv"
163
+
"mask": "all"
164
+
}
165
+
}
166
+
```
167
+
151
168
### Extraction Date Range
152
169
153
170
The mCODE Extraction Client will extract all data that is provided in the CSV files by default, regardless of any dates associated with each row of data. It is recommended that any required date filtering is performed outside of the scope of this client.
@@ -182,6 +199,22 @@ cat -v <file.csv>
182
199
183
200
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.
184
201
202
+
#### Troubleshooting Additional Errors
203
+
The mCODE Extraction Framework 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 mCODE Extraction Framework to only read CSV files up to the specified line number:
**Note:** The mCODE Extraction Framework 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.
217
+
185
218
## Terminology and Architecture
186
219
187
220
This framework consists of three key components: Extractors, Modules and Templates. Below is, in order:
0 commit comments