Skip to content

Commit 0f32a75

Browse files
committed
Add cypher query for cohorts indice
1 parent eca7fcd commit 0f32a75

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

config/es_indices_ccdi_model.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ Indices:
203203
cypher_queries:
204204
- query: |
205205
MATCH (p:participant)-[:of_participant]->(cg:consent_group)-[:of_consent_group]->(stu:study)
206-
WITH p, stu
206+
WITH p, cg, stu
207207
SKIP $skip LIMIT $limit
208208
OPTIONAL MATCH (d:diagnosis)-[*..4]->(p)
209+
OPTIONAL MATCH (ga:genetic_analysis)-[*..4]->(p)
209210
OPTIONAL MATCH (sur:survival)-[:of_survival]->(p)
210211
OPTIONAL MATCH (t:treatment)-[:of_treatment]->(p)
211212
OPTIONAL MATCH (tresp:treatment_response)-[:of_treatment_response]->(p)
@@ -217,9 +218,10 @@ Indices:
217218
p.participant_id AS participant_id,
218219
p.race AS race,
219220
p.sex_at_birth AS sex_at_birth,
221+
cg.consent_group_name AS consent_group_name,
222+
cg.consent_group_number AS consent_group_number,
223+
stu.study_id AS study_id,
220224
stu.dbgap_accession AS dbgap_accession,
221-
stu.study_status AS study_status,
222-
apoc.text.join(COLLECT(distinct d.diagnosis), ';') AS diagnosis_str,
223225
(CASE
224226
WHEN COUNT(DISTINCT d) > 0 THEN COLLECT(DISTINCT {
225227
id: d.id,
@@ -241,6 +243,31 @@ Indices:
241243
})
242244
ELSE []
243245
END) AS diagnoses,
246+
(CASE
247+
WHEN COUNT(DISTINCT ga) > 0 THEN COLLECT(DISTINCT {
248+
id: ga.id,
249+
genetic_analysis_id: ga.genetic_analysis_id,
250+
alteration: ga.alteration,
251+
alteration_effect: ga.alteration_effect,
252+
alteration_type: ga.alteration_type,
253+
chromosome: ga.chromosome,
254+
cytoband: ga.cytoband,
255+
exon: ga.exon,
256+
fusion_partner_exon: ga.fusion_partner_exon,
257+
fusion_partner_gene: ga.fusion_partner_gene,
258+
gene_symbol: ga.gene_symbol,
259+
genomic_source_category: ga.genomic_source_category,
260+
hgvs_coding: ga.hgvs_coding,
261+
hgvs_genome: ga.hgvs_genome,
262+
hgvs_protein: ga.hgvs_protein,
263+
reference_genome: ga.reference_genome,
264+
reported_significance: ga.reported_significance,
265+
reported_significance_system: ga.reported_significance_system,
266+
status: ga.status,
267+
test: ga.test
268+
})
269+
ELSE []
270+
END) AS genetic_analyses,
244271
(CASE
245272
WHEN COUNT(DISTINCT sur) > 0 THEN COLLECT(DISTINCT {
246273
id: sur.id,

0 commit comments

Comments
 (0)