Skip to content

Commit

Permalink
fix: SJIP-461 various fields fixes (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
adipaul1981 authored Jun 26, 2023
1 parent b893f1e commit 021f73f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 42 deletions.
8 changes: 5 additions & 3 deletions src/reports/biospecimen-data/configInclude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ const biospecimens: SheetConfig = {
root: null,
columns: [
{ field: 'participant.participant_id', header: 'Participant ID' },
{ field: 'participant.external_id', header: 'External Participant ID' },
{ field: 'collection_sample_id', header: 'Collection ID' },
{ field: 'collection_sample_type', header: 'Collection Sample Type' },
{ field: 'sample_id', header: 'Sample Id' },
{ field: 'container_id', header: 'Container Id' },
{ field: 'sample_id', header: 'Sample ID' },
{ field: 'container_id', header: 'Container ID' },
{ field: 'external_sample_id', header: 'External Sample ID' },
{ field: 'sample_type', header: 'Sample Type' },
{ field: 'parent_sample_id', header: 'Parent Sample Id' },
{ field: 'parent_sample_id', header: 'Parent Sample ID' },
{ field: 'parent_sample_type', header: 'Parent Sample Type' },
{ field: 'study.study_id', header: 'Study Code' },
{ field: 'age_at_biospecimen_collection', header: 'Age At Biospecimen Collection (Days)' },
Expand Down
32 changes: 12 additions & 20 deletions src/reports/clinical-data/configInclude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const participants: SheetConfig = {
sheetName: 'Participants',
root: null,
columns: [
{ field: 'participant_id' },
{ field: 'external_id' },
{ field: 'participant_id', header: 'Participant ID' },
{ field: 'external_id', header: 'External Participant ID' },
{ field: 'family.family_id', header: 'Family ID' },
{ field: 'family_type', header: 'Family Unit' },
{ field: 'study.study_name', header: 'Study Name' },
Expand All @@ -14,7 +14,7 @@ const participants: SheetConfig = {
{ field: 'race' },
{ field: 'ethnicity' },
{ field: 'down_syndrome_status' },
{ field: 'outcomes.vital_status' },
{ field: 'outcomes.vital_status', header: 'Vital Status' },
{
field: 'outcomes.age_at_event_days.value',
header: 'Age at the Last Vital Status (Days)',
Expand All @@ -38,8 +38,8 @@ const phenotypes: SheetConfig = {
sheetName: 'Phenotypes',
root: 'phenotype',
columns: [
{ field: 'participant_id' },
{ field: 'external_id' },
{ field: 'participant_id', header: 'Participant ID' },
{ field: 'external_id', header: 'External Participant ID' },
{
field: 'phenotype.hpo_phenotype_observed',
additionalFields: ['phenotype.hpo_phenotype_not_observed'],
Expand All @@ -53,12 +53,12 @@ const phenotypes: SheetConfig = {
},
{
field: 'phenotype.source_text',
header: 'Phenotype (Source Text)'
header: 'Condition (Source Text)',
},
{
field: 'phenotype.hpo_phenotype_observed',
header: 'Interpretation',
transform: (value, row) => (value ? 'Observed' : 'Not Observed'),
transform: (value, _) => (value ? 'Observed' : 'Not Observed'),
},
{
field: 'phenotype.age_at_event_days',
Expand All @@ -72,22 +72,14 @@ const diagnoses: SheetConfig = {
sheetName: 'Diagnoses',
root: 'diagnosis',
columns: [
{ field: 'participant_id' },
{ field: 'external_id' },
{
field: 'fhir_id',
header: 'Diagnosis Type',
transform: () => 'Clinical',
},
{ field: 'participant_id', header: 'Participant ID' },
{ field: 'external_id', header: 'External Participant ID' },
{ field: 'diagnosis.mondo_id_diagnosis', header: ' Diagnosis (MONDO)' },
{ field: 'diagnosis.ncit_id_diagnosis', header: 'Diagnosis (NCIT)' },
{ field: 'diagnosis.icd_id_diagnosis', header: 'Diagnosis (ICD)' },
{ field: 'diagnosis.source_text', header: 'Diagnosis (Source Text)' },
{ field: 'diagnosis.source_text', header: 'Condition (Source Text)' },
{
field: 'diagnosis.age_at_event_days',
header: 'Age at Diagnosis (Days)',
},
{ field: 'diagnosis.source_text_tumor_location' },
],
sort: [{ fhir_id: 'asc' }],
};
Expand Down Expand Up @@ -119,15 +111,15 @@ const familyRelationship: SheetConfig = {
sheetName: 'Family Relationship',
root: 'family.family_relations',
columns: [
{ field: 'participant_id' },
{ field: 'participant_id', header: 'Participant ID' },
{
field: 'family.family_relations',
header: 'Family Members ID',
transform: (value, row) => (row.family ? row.family.family_relations.related_participant_id : ''),
},
{
field: 'family.family_relations',
header: 'Relationship',
header: 'Family Member Relationship',
transform: (value, row) => (row.family ? row.family.family_relations.relation : ''),
},
],
Expand Down
30 changes: 11 additions & 19 deletions src/reports/family-clinical-data/configInclude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ const participants: SheetConfig = {
sheetName: 'Participants',
root: null,
columns: [
{ field: 'participant_id' },
{ field: 'external_id' },
{ field: 'participant_id', header: 'Participant ID' },
{ field: 'external_id', header: 'External Participant ID' },
{ field: 'families_id', header: 'Family ID' },
{ field: 'family_type', header: 'Family Unit' },
{ field: 'family.father_id', header: 'Father ID' },
{ field: 'family.mother_id', header: 'Mother ID' },
{ field: 'family.family_relations.relation', header: 'Family Relationship' },
{ field: 'family.family_relations.relation', header: 'Family Member Relationship' },
{ field: 'study.study_name', header: 'Study Name' },
{ field: 'study.study_id', header: 'Study Code' },
{ field: 'sex' },
{ field: 'race' },
{ field: 'ethnicity' },
{ field: 'down_syndrome_status' },
{ field: 'outcomes.vital_status' },
{ field: 'outcomes.vital_status', header: 'Vital Status' },
{
field: 'outcomes.age_at_event_days.value',
header: 'Age at the Last Vital Status (Days)',
Expand All @@ -41,8 +41,8 @@ const phenotypes: SheetConfig = {
sheetName: 'Phenotypes',
root: 'phenotype',
columns: [
{ field: 'participant_id' },
{ field: 'external_id' },
{ field: 'participant_id', header: 'Participant ID' },
{ field: 'external_id', header: 'External Participant ID' },
{ field: 'families_id', header: 'Family ID' },
{
field: 'phenotype.hpo_phenotype_observed',
Expand All @@ -57,12 +57,12 @@ const phenotypes: SheetConfig = {
},
{
field: 'phenotype.source_text',
header: 'Phenotype (Source Text)',
header: 'Condition (Source Text)',
},
{
field: 'phenotype.hpo_phenotype_observed',
header: 'Interpretation',
transform: (value, row) => (value ? 'Observed' : 'Not Observed'),
transform: (value, _) => (value ? 'Observed' : 'Not Observed'),
},
{
field: 'phenotype.age_at_event_days',
Expand All @@ -76,23 +76,15 @@ const diagnoses: SheetConfig = {
sheetName: 'Diagnoses',
root: 'diagnosis',
columns: [
{ field: 'participant_id' },
{ field: 'external_id' },
{ field: 'participant_id', header: 'Participant ID' },
{ field: 'external_id', header: 'External Participant ID' },
{ field: 'families_id', header: 'Family ID' },
{
field: 'fhir_id',
header: 'Diagnosis Type',
transform: () => 'Clinical',
},
{ field: 'diagnosis.mondo_id_diagnosis', header: ' Diagnosis (MONDO)' },
{ field: 'diagnosis.ncit_id_diagnosis', header: 'Diagnosis (NCIT)' },
{ field: 'diagnosis.icd_id_diagnosis', header: 'Diagnosis (ICD)' },
{ field: 'diagnosis.source_text', header: 'Diagnosis (Source Text)' },
{ field: 'diagnosis.source_text', header: 'Condition (Source Text)' },
{
field: 'diagnosis.age_at_event_days',
header: 'Age at Diagnosis (Days)',
},
{ field: 'diagnoses.source_text_tumor_location' },
],
sort: [{ families_id: 'asc' }, { participant_id: 'asc' }],
};
Expand Down

0 comments on commit 021f73f

Please sign in to comment.