Skip to content

Commit

Permalink
Update load_data_interventional.cypher
Browse files Browse the repository at this point in the history
  • Loading branch information
KirstenLangendorf authored Jul 6, 2020
1 parent 8e1a053 commit 95e4218
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions dataloader/load_data_interventional.cypher
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,19 @@ with RANGES, RANGES[1] as urange, RANGES[0] as lrange
call apoc.load.json('https://clinicaltrials.gov/api/query/study_fields?expr=COVID+AND+AREA%5BStudyType%5DInterventional&fields=NCTId,DesignPrimaryPurpose,Phase,DesignInterventionModel,DesignInterventionModelDescription&min_rnk='+lrange+'&max_rnk='+urange+'&fmt=json') yield value
with value.StudyFieldsResponse.StudyFields as coll unwind coll as study_metadata
UNWIND study_metadata.NCTId as Id
UNWIND study_metadata.DesignInterventionModel as Model
UNWIND study_metadata.DesignPrimaryPurpose as Purpose
UNWIND study_metadata.Phase as Phase
UNWIND study_metadata.DesignInterventionModelDescription as ModelDescription
match(ct:ClinicalTrial{NCTId:Id})
MERGE(m:Design{name:Model,description:ModelDescription})
MERGE(p:Purpose{name:Purpose})
MERGE(ph:Phase{phase:Phase})
MERGE(ct)-[:IS_PHASE]->(ph)
MERGE(ct)-[:HAS_PURPOSE]->(p)
MERGE (ct)-[:HAS_STUDY_DESIGN]->(m);
with ct, study_metadata
UNWIND study_metadata.DesignInterventionModel as Model
UNWIND study_metadata.DesignInterventionModelDescription as ModelDescription
MERGE(m:Design{name:Model,description:ModelDescription})
MERGE (ct)-[:HAS_STUDY_DESIGN]->(m)
with ct, study_metadata
UNWIND study_metadata.DesignPrimaryPurpose as Purpose
MERGE(p:Purpose{name:Purpose})
MERGE(ct)-[:HAS_PURPOSE]->(p);
// Arms, Groups and Interventions: ArmGroupLabel,ArmGroupType,ArmGroupDescription,InterventionType,InterventionName,InterventionOtherName,InterventionDescription
call apoc.load.json('https://clinicaltrials.gov/api/query/study_fields?expr=COVID+AND+AREA%5BStudyType%5DInterventional&fields=NCTId&fmt=json&max_rnk=1000') yield value
with value.StudyFieldsResponse.NStudiesFound as NStudies, RANGE(0,(value.StudyFieldsResponse.NStudiesFound/1000)) as nloop
Expand Down

0 comments on commit 95e4218

Please sign in to comment.