Skip to content

Commit

Permalink
fixed cohorts missing headers
Browse files Browse the repository at this point in the history
  • Loading branch information
costero-e committed Jan 17, 2025
1 parent b2e44b7 commit abf8f24
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion csv/templates/cohorts.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cohortDataTypes|id,cohortDataTypes|label,cohortDesign|id,cohortDesign|label,cohortSize,cohortType,collectionEvents|eventAgeRange|availability,collectionEvents|eventAgeRange|availabilityCount,collectionEvents|eventAgeRange|distribution,collectionEvents|eventDataTypes|availability,collectionEvents|eventDataTypes|availabilityCount,collectionEvents|eventDataTypes|distribution,collectionEvents|eventDiseases|availability,collectionEvents|eventDiseases|availabilityCount,collectionEvents|eventDiseases|distribution,collectionEvents|eventEthnicities|availability,collectionEvents|eventEthnicities|availabilityCount,collectionEvents|eventEthnicities|distribution,collectionEvents|eventGenders|availability,collectionEvents|eventGenders|availabilityCount,collectionEvents|eventGenders|distribution,collectionEvents|eventLocations|availability,collectionEvents|eventLocations|availabilityCount,collectionEvents|eventLocations|distribution,collectionEvents|eventPhenotypes|availability,collectionEvents|eventPhenotypes|availabilityCount,collectionEvents|eventPhenotypes|distribution,collectionEvents|eventTimeline|availability,collectionEvents|eventTimeline|availabilityCount,collectionEvents|eventTimeline|distribution,exclusionCriteria|ageRange,exclusionCriteria|ageRange|end|iso8601duration,exclusionCriteria|ageRange|start|iso8601duration,exclusionCriteria|diseaseConditions|ageOfOnset,exclusionCriteria|diseaseConditions|diseaseCode|id,exclusionCriteria|diseaseConditions|diseaseCode|label,exclusionCriteria|diseaseConditions|familyHistory,exclusionCriteria|diseaseConditions|notes,exclusionCriteria|diseaseConditions|severity|id,exclusionCriteria|diseaseConditions|severity|label,exclusionCriteria|diseaseConditions|stage|id,exclusionCriteria|diseaseConditions|stage|label,exclusionCriteria|ethnicities|id,exclusionCriteria|ethnicities|label,exclusionCriteria|genders|id,exclusionCriteria|genders|label,exclusionCriteria|locations|id,exclusionCriteria|locations|label,exclusionCriteria|phenotypicConditions|evidence|evidenceCode,exclusionCriteria|phenotypicConditions|evidence|reference,exclusionCriteria|phenotypicConditions|excluded,exclusionCriteria|phenotypicConditions|featureType|id,exclusionCriteria|phenotypicConditions|featureType|label,exclusionCriteria|phenotypicConditions|modifiers,exclusionCriteria|phenotypicConditions|notes,exclusionCriteria|phenotypicConditions|onset,exclusionCriteria|phenotypicConditions|resolution,exclusionCriteria|phenotypicConditions|severity|id,exclusionCriteria|phenotypicConditions|severity|label,id,inclusionCriteria|ageRange,inclusionCriteria|ageRange|end|iso8601duration,inclusionCriteria|ageRange|start|iso8601duration,inclusionCriteria|diseaseConditions|ageOfOnset,inclusionCriteria|diseaseConditions|diseaseCode|id,inclusionCriteria|diseaseConditions|diseaseCode|label,inclusionCriteria|diseaseConditions|familyHistory,inclusionCriteria|diseaseConditions|notes,inclusionCriteria|diseaseConditions|severity|id,inclusionCriteria|diseaseConditions|severity|label,inclusionCriteria|diseaseConditions|stage|id,inclusionCriteria|diseaseConditions|stage|label,inclusionCriteria|ethnicities|id,inclusionCriteria|ethnicities|label,inclusionCriteria|genders|id,inclusionCriteria|genders|label,inclusionCriteria|locations|id,inclusionCriteria|locations|label,inclusionCriteria|phenotypicConditions|evidence|evidenceCode,inclusionCriteria|phenotypicConditions|evidence|reference,inclusionCriteria|phenotypicConditions|excluded,inclusionCriteria|phenotypicConditions|featureType|id,inclusionCriteria|phenotypicConditions|featureType|label,inclusionCriteria|phenotypicConditions|modifiers,inclusionCriteria|phenotypicConditions|notes,inclusionCriteria|phenotypicConditions|onset,inclusionCriteria|phenotypicConditions|resolution,inclusionCriteria|phenotypicConditions|severity|id,inclusionCriteria|phenotypicConditions|severity|label,name
cohortDataTypes|id,cohortDataTypes|label,cohortDesign|id,cohortDesign|label,collectionEvents|eventAgeRange|availability,collectionEvents|eventAgeRange|availabilityCount,collectionEvents|eventAgeRange|distribution,collectionEvents|eventCases,collectionEvents|eventControls,collectionEvents|eventDataTypes|availability,collectionEvents|eventDataTypes|availabilityCount,collectionEvents|eventDataTypes|distribution,collectionEvents|eventDate,collectionEvents|eventDiseases|availability,collectionEvents|eventDiseases|availabilityCount,collectionEvents|eventDiseases|distribution,collectionEvents|eventEthnicities|availability,collectionEvents|eventEthnicities|availabilityCount,collectionEvents|eventEthnicities|distribution,collectionEvents|eventGenders|availability,collectionEvents|eventGenders|availabilityCount,collectionEvents|eventGenders|distribution,collectionEvents|eventLocations|availability,collectionEvents|eventLocations|availabilityCount,collectionEvents|eventLocations|distribution,collectionEvents|eventNum,collectionEvents|eventPhenotypes|availability,collectionEvents|eventPhenotypes|availabilityCount,collectionEvents|eventPhenotypes|distribution,collectionEvents|eventSize,collectionEvents|eventTimeline|end,collectionEvents|eventTimeline|start,exclusionCriteria|ageRange,exclusionCriteria|ageRange|end|iso8601duration,exclusionCriteria|ageRange|start|iso8601duration,exclusionCriteria|diseaseConditions|ageOfOnset,exclusionCriteria|diseaseConditions|diseaseCode|id,exclusionCriteria|diseaseConditions|diseaseCode|label,exclusionCriteria|diseaseConditions|familyHistory,exclusionCriteria|diseaseConditions|notes,exclusionCriteria|diseaseConditions|severity|id,exclusionCriteria|diseaseConditions|severity|label,exclusionCriteria|diseaseConditions|stage|id,exclusionCriteria|diseaseConditions|stage|label,exclusionCriteria|ethnicities|id,exclusionCriteria|ethnicities|label,exclusionCriteria|genders|id,exclusionCriteria|genders|label,exclusionCriteria|locations|id,exclusionCriteria|locations|label,exclusionCriteria|phenotypicConditions|evidence|evidenceCode,exclusionCriteria|phenotypicConditions|evidence|reference,exclusionCriteria|phenotypicConditions|excluded,exclusionCriteria|phenotypicConditions|featureType|id,exclusionCriteria|phenotypicConditions|featureType|label,exclusionCriteria|phenotypicConditions|modifiers,exclusionCriteria|phenotypicConditions|notes,exclusionCriteria|phenotypicConditions|onset,exclusionCriteria|phenotypicConditions|resolution,exclusionCriteria|phenotypicConditions|severity|id,exclusionCriteria|phenotypicConditions|severity|label,inclusionCriteria|ageRange,inclusionCriteria|ageRange|end|iso8601duration,inclusionCriteria|ageRange|start|iso8601duration,inclusionCriteria|diseaseConditions|ageOfOnset,inclusionCriteria|diseaseConditions|diseaseCode|id,inclusionCriteria|diseaseConditions|diseaseCode|label,inclusionCriteria|diseaseConditions|familyHistory,inclusionCriteria|diseaseConditions|notes,inclusionCriteria|diseaseConditions|severity|id,inclusionCriteria|diseaseConditions|severity|label,inclusionCriteria|diseaseConditions|stage|id,inclusionCriteria|diseaseConditions|stage|label,inclusionCriteria|ethnicities|id,inclusionCriteria|ethnicities|label,inclusionCriteria|genders|id,inclusionCriteria|genders|label,inclusionCriteria|locations|id,inclusionCriteria|locations|label,inclusionCriteria|phenotypicConditions|evidence|evidenceCode,inclusionCriteria|phenotypicConditions|evidence|reference,inclusionCriteria|phenotypicConditions|excluded,inclusionCriteria|phenotypicConditions|featureType|id,inclusionCriteria|phenotypicConditions|featureType|label,inclusionCriteria|phenotypicConditions|modifiers,inclusionCriteria|phenotypicConditions|notes,inclusionCriteria|phenotypicConditions|onset,inclusionCriteria|phenotypicConditions|resolution,inclusionCriteria|phenotypicConditions|severity|id,inclusionCriteria|phenotypicConditions|severity|label
16 changes: 8 additions & 8 deletions files/deref_schemas/cohorts.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
"id": "",
"label": ""
},
"cohortSize": 0,
"cohortType": "",
"collectionEvents": [
{
"eventAgeRange": {
"availability": true,
"availabilityCount": 0,
"distribution": {}
},
"eventCases": 0,
"eventControls": 0,
"eventDataTypes": {
"availability": true,
"availabilityCount": 0,
"distribution": {}
},
"eventDate": "",
"eventDiseases": {
"availability": true,
"availabilityCount": 0,
Expand All @@ -41,15 +42,16 @@
"availabilityCount": 0,
"distribution": {}
},
"eventNum": 0,
"eventPhenotypes": {
"availability": true,
"availabilityCount": 0,
"distribution": {}
},
"eventSize": 0,
"eventTimeline": {
"availability": true,
"availabilityCount": 0,
"distribution": {}
"start": "",
"end": ""
}
}
],
Expand Down Expand Up @@ -208,7 +210,6 @@
}
]
},
"id": "",
"inclusionCriteria": {
"ageRange": {
"end": {
Expand Down Expand Up @@ -363,6 +364,5 @@
}
}
]
},
"name": ""
}
}
16 changes: 8 additions & 8 deletions files/headers/cohorts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ cohortDataTypes|id
cohortDataTypes|label
cohortDesign|id
cohortDesign|label
cohortSize
cohortType
collectionEvents|eventAgeRange|availability
collectionEvents|eventAgeRange|availabilityCount
collectionEvents|eventAgeRange|distribution
collectionEvents|eventCases
collectionEvents|eventControls
collectionEvents|eventDataTypes|availability
collectionEvents|eventDataTypes|availabilityCount
collectionEvents|eventDataTypes|distribution
collectionEvents|eventDate
collectionEvents|eventDiseases|availability
collectionEvents|eventDiseases|availabilityCount
collectionEvents|eventDiseases|distribution
Expand All @@ -22,12 +23,13 @@ collectionEvents|eventGenders|distribution
collectionEvents|eventLocations|availability
collectionEvents|eventLocations|availabilityCount
collectionEvents|eventLocations|distribution
collectionEvents|eventNum
collectionEvents|eventPhenotypes|availability
collectionEvents|eventPhenotypes|availabilityCount
collectionEvents|eventPhenotypes|distribution
collectionEvents|eventTimeline|availability
collectionEvents|eventTimeline|availabilityCount
collectionEvents|eventTimeline|distribution
collectionEvents|eventSize
collectionEvents|eventTimeline|end
collectionEvents|eventTimeline|start
exclusionCriteria|ageRange
exclusionCriteria|ageRange|end|iso8601duration
exclusionCriteria|ageRange|start|iso8601duration
Expand Down Expand Up @@ -57,7 +59,6 @@ exclusionCriteria|phenotypicConditions|onset
exclusionCriteria|phenotypicConditions|resolution
exclusionCriteria|phenotypicConditions|severity|id
exclusionCriteria|phenotypicConditions|severity|label
id
inclusionCriteria|ageRange
inclusionCriteria|ageRange|end|iso8601duration
inclusionCriteria|ageRange|start|iso8601duration
Expand Down Expand Up @@ -86,5 +87,4 @@ inclusionCriteria|phenotypicConditions|notes
inclusionCriteria|phenotypicConditions|onset
inclusionCriteria|phenotypicConditions|resolution
inclusionCriteria|phenotypicConditions|severity|id
inclusionCriteria|phenotypicConditions|severity|label
name
inclusionCriteria|phenotypicConditions|severity|label
21 changes: 13 additions & 8 deletions scripts/datasheet/cohorts.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,18 +702,23 @@ def treatment():
elif 'treatment' in v:
items_dict = treatment()
elif v == 'integer':
if k != 'collectionEvents':
finaldict[key]=0
if k == 'type':
pass
else:
items_dict[k]=0
elif v == 'object':
items_dict[k]={}
items_dict[k]['availability']=True
items_dict[k]['availabilityCount']=0
items_dict[k]['distribution']={}
if k != 'eventTimeline':
items_dict[k]={}
items_dict[k]['availability']=True
items_dict[k]['availabilityCount']=0
items_dict[k]['distribution']={}
else:
items_dict[k]={}
items_dict[k]['start']=''
items_dict[k]['end']=''
elif v == 'string':
if k != 'collectionEvents':
finaldict[key]=''
if k == 'type':
pass
else:
items_dict[k]=''
elif k == 'type':
Expand Down

0 comments on commit abf8f24

Please sign in to comment.