-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add report for eids with onset terms
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
class EidsWithOnsetTerms < Report | ||
attr_reader :onset_terms | ||
|
||
def self.name | ||
"EIDs with Onset Terms" | ||
end | ||
|
||
def self.description | ||
"Generate a list of EIDs with any of the following onset terms: Young adult, early young adult, intermediate young adult, late young adult, childhood, juvenile, pediatric, congenital, and infantile." | ||
end | ||
|
||
def setup | ||
@onset_terms = Phenotype.where(hpo_class: [ | ||
'Young adult onset', | ||
'Intermediate young adult onset', | ||
'Late young adult onset', | ||
'Childhood onset', | ||
'Juvenile onset', | ||
'Pediatric onset', | ||
'Congenital onset', | ||
'Infantile onset' | ||
]) | ||
end | ||
|
||
def headers | ||
[ | ||
"EID", | ||
"Link", | ||
"HPO Term", | ||
"HPO ID" | ||
] | ||
end | ||
|
||
def execute | ||
onset_terms.each do |term| | ||
term.evidence_items.each do |eid| | ||
data << ["EID#{eid.id}", "https://civicdb.org/#{eid.link}", term.hpo_class, term.hpo_id] | ||
end | ||
end | ||
end | ||
end |
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,5 +1,6 @@ | ||
module Reports | ||
AVAILABLE_REPORTS = [ | ||
OrganizationContributions | ||
OrganizationContributions, | ||
EidsWithOnsetTerms | ||
] | ||
end |