Skip to content

Commit

Permalink
Update load_data_interventional.cypher
Browse files Browse the repository at this point in the history
Made the scripts more idempotent
  • Loading branch information
KirstenLangendorf authored Sep 21, 2020
1 parent 4d44cd4 commit b1ba244
Showing 1 changed file with 86 additions and 52 deletions.
138 changes: 86 additions & 52 deletions dataloader/load_data_interventional.cypher
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -21,8 +21,9 @@ ON CREATE set t.officialTitle=OfficialTitle
MERGE (si)-[:HAS_TITLE]->(t)
with si, study_metadata
UNWIND study_metadata.Acronym as Acronym
set si.acronym=Acronym;
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
set si.acronym=Acronym
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -45,8 +46,9 @@ MERGE (ct)-[:COMPLETED_AT]->(e)
with ct, s, study_metadata
UNWIND study_metadata.WhyStopped as WhyStopped
MERGE(ct)-[:WAS_STOPPED]->(r:StopReason{reason:WhyStopped})
MERGE(s)-[:HAS_REASON]->(r);
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
MERGE(s)-[:HAS_REASON]->(r)
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -73,13 +75,25 @@ FOREACH(ignoreMe IN CASE WHEN r.type='Principal Investigator' THEN [1] ELSE [] E
FOREACH(ignoreMe IN CASE WHEN r.type='Sponsor-Investigator' THEN [1] ELSE [] END |
MERGE(r)-[:IS_RESPOSIBLE]->(k)
MERGE(r)-[:IS_RESPOSIBLE]->(i))
with ct, study_metadata
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
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,ResponsiblePartyType,ResponsiblePartyInvestigatorFullName,ResponsiblePartyInvestigatorAffiliation,LeadSponsorName,CollaboratorName&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
match(ct:ClinicalTrial{NCTId:Id})
UNWIND study_metadata.CollaboratorName as CollaboratorName
MERGE(sp:Collaborator{name:CollaboratorName})
MERGE(ct)-[:IS_SUPPORTED_BY]->(sp);
MERGE(r:Response{YN:'Yes'});
MERGE(k:Response{YN:'No'});
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
MERGE(ct)-[:IS_SUPPORTED_BY]->(sp)
;
MERGE(r:Response{YN:'Yes'})
;
MERGE(k:Response{YN:'No'})
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -96,8 +110,9 @@ UNWIND study_metadata.NCTId as Id
match(ct:ClinicalTrial{NCTId:Id}),(r:Response{YN:'No'})
UNWIND study_metadata.IsUnapprovedDevice as IsUnapprovedDevice
FOREACH(ignoreMe IN CASE WHEN IsUnapprovedDevice='No' THEN [1] ELSE [] END |
MERGE(ct)-[:IS_FDA_REGULATED_DEVICE]->(r));
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
MERGE(ct)-[:IS_FDA_REGULATED_DEVICE]->(r))
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -114,8 +129,9 @@ UNWIND study_metadata.NCTId as Id
UNWIND study_metadata.IsFDARegulatedDrug as IsFDARegulatedDrug
match(ct:ClinicalTrial{NCTId:Id}),(r:Response{YN:'No'})
FOREACH(ignoreMe IN CASE WHEN IsFDARegulatedDrug='No' THEN [1] ELSE [] END |
MERGE(ct)-[:IS_FDA_REGULATED_DRUG]->(r));
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
MERGE(ct)-[:IS_FDA_REGULATED_DRUG]->(r))
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -132,8 +148,9 @@ UNWIND study_metadata.NCTId as Id
match(ct:ClinicalTrial{NCTId:Id}),(r:Response{YN:'No'})
UNWIND study_metadata.IsFDARegulatedDevice as IsFDARegulatedDevice
FOREACH(ignoreMe IN CASE WHEN IsFDARegulatedDevice='No' THEN [1] ELSE [] END |
MERGE(ct)-[:IS_FDA_REGULATED_DEVICE]->(r));
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
MERGE(ct)-[:IS_FDA_REGULATED_DEVICE]->(r))
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -150,8 +167,9 @@ UNWIND study_metadata.NCTId as Id
match(ct:ClinicalTrial{NCTId:Id}),(r:Response{YN:'No'})
UNWIND study_metadata.HasExpandedAccess as HasExpandedAccess
FOREACH(ignoreMe IN CASE WHEN HasExpandedAccess='No' THEN [1] ELSE [] END |
MERGE(ct)-[:HAS_EXPANDED_ACCESS]->(r));
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
MERGE(ct)-[:HAS_EXPANDED_ACCESS]->(r))
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -169,8 +187,9 @@ UNWIND study_metadata.Keyword as Keyword
MERGE (c:Condition{disease:Condition})
MERGE(k:Keyword{word:Keyword})
MERGE (ct)-[:IS_STUDYING]->(c)
MERGE (c)-[:HAS_KEYWORD]->(k);
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
MERGE (c)-[:HAS_KEYWORD]->(k)
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -191,8 +210,9 @@ MERGE(ct)-[:HAS_STUDY_DESIGN]->(m:Design{name:Model})
with ct, m, study_metadata
UNWIND study_metadata.DesignInterventionModelDescription as ModelDescription
match(ct)-[:HAS_STUDY_DESIGN]->(m:Design)
set m.description=ModelDescription;
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
set m.description=ModelDescription
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -208,8 +228,9 @@ MERGE(a:Arm{name:study_metadata.ArmGroupLabel[i]})
ON CREATE SET a.description=study_metadata.ArmGroupDescription[i]
ON CREATE SET a.type=study_metadata.ArmGroupType[i]
MERGE(ct)-[:HAS_STUDY_ARMS]->(a)-[:BELONGS_TO_MODEL]->(m)
);
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
)
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -222,9 +243,10 @@ with ct, study_metadata, RANGE(0,size(study_metadata.InterventionName)-1) as nel
FOREACH(i in nelem |
MERGE(ct)-[:INVESTIGATES_INTERVENTION]->(e:Intervention{name:study_metadata.InterventionName[i]})
ON CREATE SET e.description=study_metadata.InterventionDescription[i]
ON CREATE SET e.type=study_metadata.InterventionType[i]
);
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
ON CREATE SET e.type=study_metadata.InterventionType[i]
)
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -238,8 +260,9 @@ FOREACH(i in npout |
MERGE(ct)-[:HAS_PRIMARY_OUTCOME]->(a:Outcome{name:study_metadata.PrimaryOutcomeMeasure[i]})
ON CREATE SET a.description=study_metadata.PrimaryOutcomeDescription[i]
ON CREATE SET a.time=study_metadata.PrimaryOutcomeTimeFrame[i]
);
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
)
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -253,8 +276,9 @@ FOREACH(i in nsout |
MERGE(ct)-[:HAS_SECONDARY_OUTCOME]->(a:Outcome{name:study_metadata.SecondaryOutcomeMeasure[i]})
ON CREATE SET a.description=study_metadata.SecondaryOutcomeDescription[i]
ON CREATE SET a.time=study_metadata.SecondaryOutcomeTimeFrame[i]
);
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
)
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -268,8 +292,9 @@ FOREACH(i in noout |
MERGE(ct)-[:HAS_OTHER_OUTCOME]->(a:Outcome{name:study_metadata.OtherOutcomeMeasure[i]})
ON CREATE SET a.description=study_metadata.OtherOutcomeDescription[i]
ON CREATE SET a.time=study_metadata.OtherOutcomeTimeFrame[i]
);
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
)
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -283,8 +308,9 @@ MERGE (p:StudyPopulation{name:StudyPopulation})
MERGE (ct)-[:HAS_STUDY_POPULATION]->(p)
with study_metadata, ct, p
UNWIND study_metadata.SamplingMethod as SamplingMethod
SET p.sampling=SamplingMethod;
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
SET p.sampling=SamplingMethod
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -298,8 +324,9 @@ UNWIND study_metadata.Gender as Gender
MERGE (ct)-[:INCLUDES_GENDER]->(g:Gender{name:Gender})
with ct, g, study_metadata
UNWIND study_metadata.GenderDescription as GenderDescription
set g.description=GenderDescription;
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
set g.description=GenderDescription
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -311,8 +338,9 @@ match(ct:ClinicalTrial{NCTId:Id})
with study_metadata, ct
UNWIND study_metadata.MinimumAge as MinAge
UNWIND study_metadata.MaximumAge as MaxAge
MERGE(ct)-[:INCLUDES_AGE_RANGE]->(a:AgeRange{minAge:MinAge,maxAge:MaxAge});
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
MERGE(ct)-[:INCLUDES_AGE_RANGE]->(a:AgeRange{minAge:MinAge,maxAge:MaxAge})
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -322,15 +350,16 @@ with value.StudyFieldsResponse.StudyFields as coll unwind coll as study_metadata
UNWIND study_metadata.NCTId as Id
match(ct:ClinicalTrial{NCTId:Id})
UNWIND study_metadata.EligibilityCriteria as EligibilityCriteria
with study_metadata, ct, split(replace(replace(trim(substring(EligibilityCriteria,length(split(EligibilityCriteria,"Exclusion")[0])+19,size(EligibilityCriteria))),'\n','#'),'##','#'),'#') as Exclusion,
split(replace(replace(trim(substring(EligibilityCriteria,19,length(split(EligibilityCriteria,"Exclusion")[0])-19)),'\n','#'),'##','#'),'#') as Inclusion
with study_metadata, ct, Inclusion, Exclusion, RANGE(0,size(Inclusion)-1) as nincl
with study_metadata, ct, split(replace(replace(trim(substring(EligibilityCriteria,length(split(EligibilityCriteria,"Exclusion")[0]),size(EligibilityCriteria))),'\n','#'),'##','#'),'#') as Exclusion,
split(replace(replace(trim(substring(EligibilityCriteria,0,length(split(EligibilityCriteria,"Exclusion")[0]))),'\n','#'),'##','#'),'#') as Inclusion
with study_metadata, ct, Inclusion, Exclusion, RANGE(1,size(Inclusion)-1) as nincl
FOREACH(i in nincl |
MERGE(ct)-[:HAS_INCLUSION_CRITERIA]->(incl:InclusionCriteria{criteria:Inclusion[i]}) )
with study_metadata, ct, Inclusion, Exclusion, RANGE(0,size(Exclusion)-1) as nexcl
with study_metadata, ct, Inclusion, Exclusion, RANGE(1,size(Exclusion)-1) as nexcl
FOREACH(i in nexcl |
MERGE(ct)-[:HAS_EXCLUSION_CRITERIA]->(excl:ExclusionCriteria{criteria:Exclusion[i]}));
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
MERGE(ct)-[:HAS_EXCLUSION_CRITERIA]->(excl:ExclusionCriteria{criteria:Exclusion[i]}))
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -344,8 +373,9 @@ MERGE (c:Contact{name:Name, email:''})
MERGE (ct)-[:HAS_CONTACT_PERSON]->(c)
with study_metadata,c
UNWIND study_metadata.CentralContactEmail as Email
SET c.email=Email;
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
SET c.email=Email
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -367,8 +397,9 @@ FOREACH(i in ncity |
MERGE(ci:City{name:study_metadata.LocationCity[i]})
MERGE(c:Country{name:study_metadata.LocationCountry[i]})
MERGE(ci)-[:LOCATED_IN]->(c)
);
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
)
;
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
UNWIND nloop as i
with range(1+1000*i,1000+1000*i,999) as RANGES
Expand All @@ -390,6 +421,9 @@ FOREACH(i in nref |
with ct, study_metadata
UNWIND study_metadata.SeeAlsoLinkURL as URL
MERGE(l:Link{url:URL})
MERGE(ct)-[:REFERS_TO_URL]->(l);
match(i:InclusionCriteria) where i.criteria in ['-', 'none'] DETACH DELETE i;
match(e:ExclusionCriteria) where e.criteria in ['-', 'none'] DETACH DELETE e;
MERGE(ct)-[:REFERS_TO_URL]->(l)
;
match(i:InclusionCriteria) where i.criteria in ['-', 'none'] DETACH DELETE i
;
match(e:ExclusionCriteria) where e.criteria in ['-', 'none'] DETACH DELETE e
;

0 comments on commit b1ba244

Please sign in to comment.