Skip to content

Commit

Permalink
Merge pull request #122 from x-atlas-consortia/organs_fix
Browse files Browse the repository at this point in the history
Fix to organs query to account for multiple FMA codes for left and ri…
  • Loading branch information
yuanzhou authored Sep 3, 2024
2 parents 10b9931 + 841b1af commit 2dab157
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hs_ontology_api/cypher/organs.cypher
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CALL
{
WITH OrganCUI OPTIONAL MATCH (pOrgan:Concept)-[r1:CODE]->(cOrgan:Code)-[r2:PT]->(tOrgan:Term)
WHERE pOrgan.CUI=OrganCUI AND cOrgan.SAB IN ['FMA']
AND r2.CUI=pOrgan.CUI RETURN cOrgan.CodeID AS OrganFMA
AND r2.CUI=pOrgan.CUI RETURN CASE WHEN pOrgan.CUI= 'C0222601' THEN 'FMA:57991' WHEN pOrgan.CUI='C0222600' THEN 'FMA:57987' ELSE cOrgan.CodeID END AS OrganFMA
}
// RUI codes are property nodes linked to organ nodes.
CALL
Expand All @@ -33,4 +33,4 @@ CALL
// Filter out the "Other" organ node.
WITH OrganCode,OrganSAB,OrganName,OrganTwoCharacterCode,OrganUBERON,OrganFMA,OrganCUI
WHERE NOT (OrganCode = 'C030071' AND OrganSAB=$sab)
RETURN OrganCode,OrganSAB,OrganName,CASE WHEN OrganUBERON IS NULL THEN OrganFMA ELSE OrganUBERON END AS OrganUBERON,OrganTwoCharacterCode,OrganCUI ORDER BY OrganName
RETURN DISTINCT OrganCode,OrganSAB,OrganName,CASE WHEN OrganUBERON IS NULL THEN OrganFMA ELSE OrganUBERON END AS OrganUBERON,OrganTwoCharacterCode,OrganCUI ORDER BY OrganName

0 comments on commit 2dab157

Please sign in to comment.