-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #741 from FluxNotes/external_fhir_mapping
External fhir mapping
- Loading branch information
Showing
11 changed files
with
213 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
const CopyWebpackPlugin = require('copy-webpack-plugin'); | ||
const { | ||
override, | ||
useEslintRc, | ||
addWebpackExternals, | ||
addWebpackPlugin | ||
} = require("customize-cra"); | ||
|
||
|
||
module.exports = override( | ||
useEslintRc(), | ||
addWebpackExternals({ | ||
'fhir-mapper': "Mapper", | ||
'babel-polyfill': "_babelPolyfill" | ||
}), | ||
addWebpackPlugin(new CopyWebpackPlugin([ | ||
{ context:'node_modules/fhir-mapper/dist/', from: 'app.bundle.js*', to: 'static/js/fhir-mapper' } | ||
])) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { | ||
buildMappers, | ||
mappers, | ||
utils | ||
} from 'fhir-mapper'; | ||
|
||
const primaryCancerConditionCodes = [ | ||
'254837009', // Malignant neoplasm of breast (disorder) (B) | ||
'93761005', // Primary malignant neoplasm of colon (C) | ||
'109838007', // Overlapping malignant neoplasm of colon (C) | ||
'363406005', // Malignant tumor of colon (C) | ||
'94260004', // Secondary malignant neoplasm of colon (C) -- note this is a "secondary" code but is intended to be a primary cancer | ||
'254637007', // Non-small cell lung cancer (disorder) (L) | ||
'254632001', // Small cell carcinoma of lung (disorder) (L) | ||
'424132000', // Non-small cell carcinoma of lung, TNM stage 1 (disorder) (L) | ||
'425048006', // Non-small cell carcinoma of lung, TNM stage 2 (disorder) (L) | ||
'422968005', // Non-small cell carcinoma of lung, TNM stage 3 (disorder) (L) | ||
'423121009', // Non-small cell carcinoma of lung, TNM stage 4 (disorder) (L) | ||
'67811000119102', // Primary small cell malignant neoplasm of lung, TNM stage 1 (disorder) (L) | ||
'67821000119109', // Primary small cell malignant neoplasm of lung, TNM stage 2 (disorder) (L) | ||
'67831000119107', // Primary small cell malignant neoplasm of lung, TNM stage 3 (disorder) (L) | ||
'67841000119103', // Primary small cell malignant neoplasm of lung, TNM stage 4 (disorder) (L) | ||
// note that none of the 3 prostate cancer codes are in the recommended VS | ||
'126906006', // Neoplasm of prostate (P) | ||
'92691004', // Carcinoma in situ of prostate (disorder) (P) | ||
'314994000', // Metastasis from malignant tumor of prostate (disorder) (P) -- also a "secondary" code but intended to be a primary cancer | ||
]; | ||
|
||
|
||
|
||
let mapper = { | ||
filter: () => true, | ||
default: (resource, context) => mappers['syntheaToV05'].execute(resource, context), | ||
mappers: [ | ||
{ | ||
filter: "Condition.code.coding.where($this.code in %primaryCancerConditionCodes.first())", | ||
exec: (resource, context) => | ||
utils.applyProfile(resource, 'http://hl7.org/fhir/us/fhirURL/StructureDefinition/oncocore-CancerDisorderPresent') | ||
}, | ||
{filter: "Observation.code.text = 'AJCCV7 Breast Distant Metastasis (M) Pat'", | ||
exec: (resource, context) => { | ||
resource.code = {coding: [{code: '21901-4' , system: 'http://loinc.org'}]}; | ||
resource.valueCodeableConcept.coding = [{code: resource.valueCodeableConcept.text }]; | ||
|
||
// utils.applyProfile(resource, 'http://hl7.org/fhir/us/fhirURL/StructureDefinition/'); | ||
return resource; | ||
} | ||
}, | ||
{filter: "Observation.code.text = 'AJCCV7 Breast Distant Metastasis (M) Cli'", | ||
exec: (resource, context) => { | ||
resource.code = {coding: [{code: '21907-1' , system: 'http://loinc.org'}]}; | ||
resource.valueCodeableConcept.coding = [{code: resource.valueCodeableConcept.text }]; | ||
utils.applyProfile(resource, 'http://hl7.org/fhir/us/fhirURL/StructureDefinition/oncocore-TNMClinicalDistantMetastasesClassification'); | ||
return resource; | ||
} | ||
}, | ||
{filter: "Observation.code.text = 'AJCCV7 Breast Regional Lymph Nodes (N) P'", | ||
exec: (resource, context) => { | ||
resource.code = {coding: [{code: '21900-6' , system: 'http://loinc.org'}]}; | ||
resource.valueCodeableConcept.coding = [{code: resource.valueCodeableConcept.text }]; | ||
//utils.applyProfile(resource, 'http://hl7.org/fhir/us/fhirURL/StructureDefinition/'); | ||
return resource; | ||
} | ||
}, | ||
{filter: "Observation.code.text = 'AJCCV7 Breast Regional Lymph Nodes (N) C'", | ||
exec: (resource, context) => { | ||
resource.code = {coding: [{code: '21906-3' , system: 'http://loinc.org'}]}; | ||
resource.valueCodeableConcept.coding = [{code: resource.valueCodeableConcept.text }]; | ||
utils.applyProfile(resource, 'http://hl7.org/fhir/us/fhirURL/StructureDefinition/oncocore-TNMClinicalRegionalNodesClassification'); | ||
return resource; | ||
} | ||
}], | ||
}; | ||
export default buildMappers(mapper, { | ||
primaryCancerConditionCodes | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import {mappers} from 'fhir-mapper'; | ||
import cernerSandbox from './CernerSandboxMapper'; | ||
export default {...mappers, cernerSandbox}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.