Skip to content

Commit

Permalink
Merge pull request #63 from mcode/add-all-extractors
Browse files Browse the repository at this point in the history
Adding remaining CSV extractors from the MEF
  • Loading branch information
rdingwell authored May 10, 2023
2 parents 9e5dfed + 48dddf3 commit 97a554e
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/ICARECSVClient.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
const {
BaseClient,
CSVAdverseEventExtractor,
CSVCancerDiseaseStatusExtractor,
CSVCancerRelatedMedicationAdministrationExtractor,
CSVCancerRelatedMedicationRequestExtractor,
CSVClinicalTrialInformationExtractor,
CSVConditionExtractor,
CSVCTCAdverseEventExtractor,
CSVClinicalTrialInformationExtractor,
CSVObservationExtractor,
CSVPatientExtractor,
CSVProcedureExtractor,
CSVStagingExtractor,
CSVTreatmentPlanChangeExtractor,
sortExtractors,
} = require('mcode-extraction-framework');
Expand All @@ -14,11 +20,17 @@ class ICARECSVClient extends BaseClient {
constructor({ extractors, commonExtractorArgs }) {
super();
this.registerExtractors(
CSVAdverseEventExtractor,
CSVCancerDiseaseStatusExtractor,
CSVConditionExtractor,
CSVCancerRelatedMedicationAdministrationExtractor,
CSVCancerRelatedMedicationRequestExtractor,
CSVClinicalTrialInformationExtractor,
CSVConditionExtractor,
CSVCTCAdverseEventExtractor,
CSVObservationExtractor,
CSVPatientExtractor,
CSVProcedureExtractor,
CSVStagingExtractor,
CSVTreatmentPlanChangeExtractor,
);
// Store the extractors defined by the configuration file as local state
Expand All @@ -28,10 +40,15 @@ class ICARECSVClient extends BaseClient {
{ type: 'CSVPatientExtractor', dependencies: [] },
{ type: 'CSVConditionExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVCancerDiseaseStatusExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVCTCAdverseEventExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVClinicalTrialInformationExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVTreatmentPlanChangeExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVStagingExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVCancerRelatedMedicationAdministrationExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVCancerRelatedMedicationRequestExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVProcedureExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVObservationExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVAdverseEventExtractor', dependencies: ['CSVPatientExtractor'] },
{ type: 'CSVCTCAdverseEventExtractor', dependencies: ['CSVPatientExtractor'] },
];
// Sort extractors based on order and dependencies
this.extractorConfig = sortExtractors(this.extractorConfig, dependencyInfo);
Expand Down
4 changes: 4 additions & 0 deletions test/sample-client-data/adverse-event-information.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mrn,adverseEventId,adverseEventCode,adverseEventCodeSystem,adverseEventDisplayText,suspectedCauseId,suspectedCauseType,seriousness,seriousnessCodeSystem,seriousnessDisplayText,category,categoryCodeSystem,categoryDisplayText,severity,actuality,studyId,effectiveDate,recordedDate
123,adverseEventId-1,109006,code-system,Anxiety disorder of childhood OR adolescence,procedure-id,Procedure,serious,http://terminology.hl7.org/CodeSystem/adverse-event-seriousness,Serious,product-use-error|product-quality|wrong-rate,http://terminology.hl7.org/CodeSystem/adverse-event-category|http://snomed.info/sct|http://terminology.hl7.org/CodeSystem/adverse-event-category,Product Use Error|Product Quality|Wrong Rate,severe,actual,researchId-1,12-09-1994,12-09-1994
456,adverseEventId-2,134006,http://snomed.info/sct,Decreased hair growth,medicationId-1,Medication,non-serious,http://terminology.hl7.org/CodeSystem/adverse-event-seriousness,Non-serious,product-quality|wrong-rate,http://terminology.hl7.org/CodeSystem/adverse-event-category|,Product Quality|,mild,potential,researchId-2,12-10-1995,12-10-1995
789,adverseEventId-3,150003,,,,,,,,product-use-error,,,,,,12-09-1994,
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mrn,medicationId,code,codeSystem,displayText,startDate,endDate,treatmentReasonCode,treatmentReasonCodeSystem,treatmentReasonDisplayText,treatmentIntent,status
123,medicationId-1,10760,http://www.nlm.nih.gov/research/umls/rxnorm,Triamcinolone Oral Paste,2020-01-01,2020-07-05,999000,http://snomed.info/sct,Mixed islet cell and exocrine adenocarcinoma,373808002,on-hold
456,medicationId-2,91318,http://www.nlm.nih.gov/research/umls/rxnorm,Coal Tar Topical Solution,2020-02-17,2020-08-13,915007,http://snomed.info/sct,Malignant melanoma in junctional nevus,373808002,completed
789,medicationId-3,91833,http://www.nlm.nih.gov/research/umls/rxnorm,Vitamin K1 Injectable Solution [Aquamephyton],2020-01-12,2020-10-01,900006,http://snomed.info/sct,Mucin-producing adenocarcinoma,363676003,stopped
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mrn,requestId,code,codeSystem,displayText,treatmentReasonCode,treatmentReasonCodeSystem,treatmentReasonDisplayText,procedureIntent,status,intent,authoredOn,requesterId
123,requestId-1,10760,http://www.nlm.nih.gov/research/umls/rxnorm,Triamcinolone Oral Paste,999000,http://snomed.info/sct,Mixed islet cell and exocrine adenocarcinoma,373808002,active,order,2020-01-01,requester-1
456,requestId-2,91318,http://www.nlm.nih.gov/research/umls/rxnorm,Coal Tar Topical Solution,915007,http://snomed.info/sct,Malignant melanoma in junctional nevus,373808002,on-hold,proposal,2019-02-02,requester-2
789,requestId-3,91833,http://www.nlm.nih.gov/research/umls/rxnorm,Vitamin K1 Injectable Solution [Aquamephyton],900006,http://snomed.info/sct,Mucin-producing adenocarcinoma,363676003,cancelled,plan,2021-06-12,requester-3
4 changes: 4 additions & 0 deletions test/sample-client-data/observation-information.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mrn,observationId,status,code,codeSystem,displayName,value,valueCodeSystem,effectiveDate,bodySite,laterality
123,observation-id-1,final,1695-6,http://loinc.org,,10828004,http://snomed.info/sct,2020-01-02,251007,66459002
456,observation-id-2,final,8302-2,http://loinc.org,Body height,66.89 [in_i],,2020-01-02,251007,66459002
789,observation-id-3,final,29463-7,http://loinc.org,Body Weight,185 [lb_av],,2020-01-02,251007,66459002
5 changes: 5 additions & 0 deletions test/sample-client-data/procedure-information.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mrn,procedureId,conditionId,status,code,codeSystem,displayName,reasonCode,reasonCodeSystem,reasonDisplayName,effectiveDate,bodySite,laterality,treatmentIntent
123,procedure-id-1,condition-id-1,completed,152198000,http://snomed.info/sct,Brachytherapy (procedure),363346000,http://snomed.info/sct,Malignant tumor,2020-01-01,41224006,51440002,373808002
456,procedure-id-2,condition-id-2,in-progress,174337000,http://snomed.info/sct,Destruction of lesion,363346000,http://snomed.info/sct,Malignant tumor,2020-01-12,41224006,51440002,373808002
789,procedure-id-3,condition-id-3,completed,172043006,http://snomed.info/sct,Total mastectomy,363346000,http://snomed.info/sct,Malignant tumor,2020-06-30,41224006,51440002,373808002
789,procedure-id-4,condition-id-3,in-progress,10611004,http://snomed.info/sct,Teleradiotherapy protons (procedure),363346000,http://snomed.info/sct,Malignant tumor,2020-01-12,41224006,51440002,373808002
6 changes: 6 additions & 0 deletions test/sample-client-data/staging-information.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mrn,conditionId,stageGroup,t,n,m,type,stagingSystem,stagingCodeSystem,effectiveDate
123,conditionId-1,3C,cT3,cN3,cM0,Clinical,C146985,http://ncimeta.nci.nih.gov,2020-01-01
456,conditionId-2,3C,cT3,cN3,cM0,Clinical,443830009,http://snomed.info/sct,2020-01-01
789,conditionId-3,3C,,cN3,cM0,Clinical,444256004,http://snomed.info/sct,2020-01-02
789,conditionId-3,3C,cT3,,cM0,Clinical,,,2020-01-03
789,conditionId-3,3C,cT3,cN3,,Clinical,258235000,http://snomed.info/sct,2020-01-04

0 comments on commit 97a554e

Please sign in to comment.