Skip to content

Commit 20391a2

Browse files
authored
Merge pull request #191 from mcode/develop
v2.2.1
2 parents 4532564 + 38bfb1d commit 20391a2

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mcode-extraction-framework",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "",
55
"contributors": [
66
"Julia Afeltra <jafeltra@mitre.org>",

src/extractors/CSVConditionExtractor.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@ function formatData(conditionData, patientId) {
2727
if (!(conditionId && codeSystem && code && category)) {
2828
throw new Error('The condition is missing an expected attribute. Condition id, code system, code, and category are all required.');
2929
}
30+
const codes = code.split('|').map((c) => c.trim()).filter((c) => c && c !== '');
31+
if (codes.length < code.split('|').length) {
32+
logger.warn('Delimiter (|) used to indicate multiple condition codes but no additional code provided');
33+
}
3034
return {
3135
id: conditionId,
3236
subject: {
3337
id: patientId,
3438
},
35-
code: code.split('|').map((c) => ({
39+
code: codes.map((c) => ({
3640
code: c,
3741
system: codeSystem,
3842
display: displayName,

0 commit comments

Comments
 (0)