Sample data. This database was generated by scripts/seed_dev_db.py —
every service, deploy, person and figure on this page is synthetic. Names are
sample.*@seed.invalid and image tags are prefixed SEED-.
Nothing here happened.
Query trends 80
stored2d agotop 80 of 3,123
Neo4j query shapes on automation over the last 5d, grouped by plan hash.
Click a column to sort; p95 drift (late-half ÷ early-half of the window) ranks the queries getting slower.
MATCH (doc0:Document{tildaid:$f0}) MATCH (org:Organization{tildaid:$scopeOrgId0}) CALL { WITH org, doc0 UNWIND [x IN $lists.allowedStudies0 WHERE x = doc0.studyId] AS studyId OPTIONAL MATCH (study:Study) WHERE study.tildaid = studyId // An…
MATCH (doc0:Document{tildaid:$f0}) MATCH (org:Organization{tildaid:$scopeOrgId0}) CALL { WITH org, doc0 UNWIND [x IN $lists.allowedStudies0 WHERE x = doc0.studyId] AS studyId OPTIONAL MATCH (study:Study) WHERE study.tildaid = studyId // An inactive actor carries no membership, so it is excluded here rather than at each use: // the sites, countries and roles below all hang off it. OPTIONAL MATCH (study)-[:STUDY_TO_ACTOR]-(studyActor:Actor{orgId:$ctxOrgId0})-[:FOR_USER]->(:User{tildaid:$ctxUserId0}) WHERE studyActor.state <> ? // Collect sites where user has membership in this study OPTIONAL MATCH (studyActor)-[:STUDYSITEACTOR_TO_ACTOR]-(:StudySiteActor)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) WITH org, study, studyActor, collect(DISTINCT site.tildaid) as userSiteIds // Collect countries where user has membership in this study OPTIONAL MATCH (studyActor)<-[:STUDYCOUNTRYACTOR_TO_ACTOR]-(sca:StudyCountryActor) WITH org, study, studyActor, userSiteIds, collect(DISTINCT sca.country) as userCountryIds // Pre-collect policies for this user/role in this study OPTIONAL MATCH (org)<-[:DOC_ACCESS_POLICY_TO_ORG]-(policy:DocumentAccessPolicy{status:?})-[:POLICY_TO_STUDY]->(study) WHERE EXISTS { MATCH (policy)-[:POLICY_FOR_USER]->(:User{tildaid:$ctxUserId0}) } OR (studyActor IS NOT NULL AND EXISTS { MATCH (policy)-[:POLICY_FOR_ROLE]->(role:Role)<-[:APPOINTED_AS]-(studyActor) }) WITH study, studyActor, userSiteIds, userCountryIds, collect(policy) as policies WITH {study:study, studyActor:studyActor, userSiteIds:userSiteIds, userCountryIds:userCountryIds, policies:policies} AS st WITH collect(distinct st) as studies // studyById lets each document row look its context up by study id instead of scanning // the whole list. Entries whose study did not resolve share the ? key; they all carry // the same empty context, so which one wins does not matter. The node-bearing maps go no // further than this subquery; studyIdsInScope needs no lookup, since an id with no Study // node can never equal a matched study?tildaScale??ReadWrite?ReadOnly?s folder and ancestors (up to ? levels for TMF hierarchy) OPTIONAL MATCH (doc1)<-[:INCLUDES]-(docFolder:Folder) OPTIONAL MATCH (docFolder)<-[:INCLUDES*?..?]-(ancestorFolder:Folder) WITH doc1, policies, userSiteIds, userCountryIds, defaultAccessLevel, collect(DISTINCT docFolder) + collect(DISTINCT ancestorFolder) AS folderHierarchy // Check document ownership OPTIONAL MATCH (doc1)-[:UPLOADED_BY]->(uploader:User{tildaid:$policyUploaderId0}) WITH doc1, policies, userSiteIds, userCountryIds, defaultAccessLevel, folderHierarchy, uploader IS NOT NULL AS isOwnedByUser // Filter policies by: // ?. Folder: policy applies if folder is in hierarchy OR policy has no folder (study-wide). A folder-less // ownership policy is the role?Owned Documents?Non Owned Documents?Staging?Pre-Staging?Owned Documents?Non Owned Documents?My Sites Documents?Other Sites Documents?My Countries Documents?Other Countries Documents?Study Scope Documents?NoAccess?NoAccess?ReadOnly?ReadOnly?ReadWrite?ReadOnly?NoAccess??Inactive' AND sst.tildaid IN studyIdsInScope AND (doc1.siteId = ? OR (a)-[:STUDYSITEACTOR_TO_ACTOR]-(:StudySiteActor)- [:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(:DslPlanDefinition{delpending:false,type:?})- [:PLAN_DEFINITION_TO_SITE]-(:Site{tildaid:doc1.siteId})) RETURN doc1 as doc UNION WITH doc1, studyIdsInScope, directAdmit WITH doc1, studyIdsInScope WHERE NOT directAdmit AND (NOT $nonSiteOnlyPatients0 OR doc1.patientId = ?) AND doc1.siteId <> ? MATCH (s:Site{tildaid:doc1.siteId, delpending:false})-[:PLAN_DEFINITION_TO_SITE]- (pd:DslPlanDefinition{delpending:false,type:?})-[:PLAN_DEFINITION_TO_STUDY]->(sst:Study) WHERE sst.tildaid IN studyIdsInScope RETURN doc1 as doc UNION WITH doc1, directAdmit WITH doc1 WHERE directAdmit RETURN doc1 as doc} WITH ({doc: doc, location: location, docObj: docObj, owned: owned, study: study, org: org, vector: vector, docAccessLevel: docAccessLevel}) as row WITH collect(DISTINCT row) as rows, count(DISTINCT row) as total unwind rows as row WITH row.doc as doc, row.location as location, row.docObj as docObj, row.owned as owned, row.study as study, row.org as org, row.vector as vector, row.docAccessLevel as docAccessLevel, total order by doc.createdat asc, doc.tildaid asc skip $skip0 WITH *, EXISTS { (doc)-[:HAS]-(:DocumentAnnotation)-[:ANNOTATION_SIGNER]-(:DocumentSigner{userId:$signerUserId3}) } AS isSigner CALL {return null as patientId, null as patientName, null as subjectId}CALL { return null as site, ? as siteNumber, [] as piNames }CALL { return null as visit }CALL { return null as user }CALL { return null as uploadedBy }CALL { return null as docType }CALL { return null as signedByUsers , null as reviewDate } WITH distinct total, doc, docObj, vector, owned, study, org, docAccessLevel, isSigner, patientId, patientName, subjectId, site, siteNumber, piNames, visit, user, uploadedBy, docType, signedByUsers, reviewDate CALL { return null as workOrders, false as woContact, null as latestAIRun, null as findingCount, null as queriesCount, null as confirmedCount, null as resolvedCount }CALL { return null as tags } CALL { return null as path, null as fold, null as collection, null as stateTags1 } CALL { return null as primaryFolder } CALL { return null as listingFolders } CALL { return null as stateTags2, null as stagingLabels } CALL { return [] as reviews} CALL { return null as templateDetails} CALL { with doc, docObj CALL { with doc, docObj with doc, docObj where doc.primaryVersionId = ? or doc.primaryVersionId is null optional match (doc)-[:UPLOADED_BY]->(uploader:User) return {tildaid: doc.tildaid, fileName: doc.fileName, originalFileName: doc.originalFileName, contentType: doc.contentType, date: doc.date, dateType: doc.dateType, versionName: doc.versionName, rejectReason: doc.rejectReason, language: doc.language, languages: doc.languages, needsAttention: doc.needsAttention, needsAttentionReasons: doc.needsAttentionReasons, trackActiveDuplicates: doc.trackActiveDuplicates, versionNumber: doc.versionNumber, majorVersion: doc.majorVersion, minorVersion: doc.minorVersion, generation: toString(doc.generation), cksum: doc.cksum, size: doc.size, status: doc.status, stateTag: doc.stateTag, pages: doc.pages, uploadMethod: doc.uploadMethod, changeLog: [], createdAt: doc.createdat, renderedCompletedAt: doc.renderedCompletedAt, renderedFieldsRevision: doc.renderedFieldsRevision, renderedSignersRevision: doc.renderedSignersRevision, tmfFiledAt: coalesce(doc.tmfFiledAt, ?), uploadedBy: case when uploader is null then null else {id: uploader.tildaid, name: uploader.name, profilePicURL: uploader.profilePicURL} end} as version union with doc optional match (doc)-[:DOCUMENT_VERSION]->(dv:DocumentVersion) where $versionsSeesPreRedaction0 or coalesce(dv.preRedaction, false) = false or dv.tildaid = doc.primaryVersionId optional match (doc)-[:DOCUMENT_TO_SOURCE]->(ds:DocumentSource)-[:DOCUMENT_SOURCE_TO_VERSION]->(dv) optional match (dv)-[:UPLOADED_BY]->(uploader:User) optional match (dv)-[:PROMOTED_FROM]->(psrc:Document) return case when dv is null then null else {tildaid: dv.tildaid, fileName: dv.fileName, originalFileName: dv.originalFileName, contentType: dv.contentType, date: dv.date, dateType: doc.dateType, versionName: dv.versionName, rejectReason: dv.rejectReason, language: dv.language, languages: dv.languages, needsAttention: dv.needsAttention, needsAttentionReasons: dv.needsAttentionReasons, trackActiveDuplicates: dv.trackActiveDuplicates, versionNumber: dv.versionNumber, majorVersion: dv.majorVersion, minorVersion: dv.minorVersion, documentSourceId: ds.tildaid, promotedFromDocumentId: psrc.tildaid, generation: toString(dv.generation), linearizedPdfUrl: dv.linearizedPdfUrl, linearizedPdfStatus: dv.linearizedPdfStatus, needsProcessedPdf: dv.needsProcessedPdf, langDetectionStatus: dv.langDetectionStatus, translatedPdfUrl: dv.translatedPdfUrl, translatedPdfStatus: dv.translatedPdfStatus, cksum: dv.cksum, size: dv.size, status: dv.status, stateTag: dv.stateTag, pages: dv.pages, uploadMethod: dv.uploadMethod, changeLog: [], url: dv.url, createdAt: dv.createdat, renderedCompletedAt: dv.renderedCompletedAt, renderedFieldsRevision: dv.renderedFieldsRevision, renderedSignersRevision: dv.renderedSignersRevision, preRedaction: coalesce(dv.preRedaction, false), tmfFiledAt: coalesce(dv.tmfFiledAt, ?), uploadedBy: case when uploader is null then null else {id: uploader.tildaid, name: uploader.name, profilePicURL: uploader.profilePicURL} end} end as version // TODO: [Major/Minor Versioning] Once client supports minor version UX, update ordering to: // } with doc, version order by version.majorVersion, version.minorVersion // This will display versions as ?.?, ?.?, ?.? instead of flat ?, ?, ? } with doc, version order by version.versionNumber where $versionsVersionId0 IS NULL OR version.tildaid = $versionsVersionId0 return collect(version) as versions } CALL { return null as annotationSpec, null as annotationVal } CALL { return [] as queries } CALL { return null as sharedWith, null as currentShare } CALL { WITH doc MATCH (doc)-[:DOCUMENT_VERSION]->(dv:DocumentVersion{tildaid: coalesce($docAttrVersionId0, doc.primaryVersionId)}) MATCH (doc)-[:DOCUMENT_TO_SOURCE]->(ds:DocumentSource)-[:DOCUMENT_SOURCE_TO_VERSION]->(dv) OPTIONAL MATCH (ds)-[:HAS_ATTRIBUTE]->(da:DocAttribute) OPTIONAL MATCH (da)-[:HAS_ATTRIBUTE_DEFINITION]->(dad:DocAttributeDefinition) RETURN collect(DISTINCT da{.*, name: COALESCE(dad.name, ?), description: COALESCE(dad.description, ?), documentSourceId: ds.tildaid}) as docAttributes } CALL { WITH doc OPTIONAL MATCH (doc)-[:DOCUMENT_VERSION]->(dv:DocumentVersion{tildaid: coalesce($notesVersionId0, doc.primaryVersionId)})-[:HAS_NOTE]->(n:DocumentNote{archived: false}) RETURN count(n) AS notesCount } CALL { return null as eventId, null as eventName, null as deliverable, null as eventScope } CALL { return null as copiedFrom } CALL { return [] as copiedTo, ? as copiedToCount } CALL { return null as promotedTo } CALL { return null AS docReviewStatus, null AS hasImportantComment, null AS discrepancyCount } CALL { return null as tmfCategorization } with distinct doc{.*, status: docObj.status, stateTag: docObj.stateTag, orgAlias: org.alias, owned: owned, docTypeName: doc.docTypeName, userId: doc.userId, user: CASE WHEN user IS NOT NULL THEN {id: user.tildaid, name: user.name, profilePicURL: user.profilePicURL} ELSE NULL END, createdDate: doc.createdat, updatedDate: COALESCE(doc.updatedat, doc.createdat), externalUrl: doc.url, study: study.name, studyId: study.tildaid, site: site.name, siteId: doc.siteId, siteNumber: siteNumber, piNames: piNames, patient: patientName, patientId: doc.patientId, subjectId: subjectId, visit: visit.title, visitId: doc.visitId, reviewDate: reviewDate, assignedToUsers: [], uploadedBy: {id: uploadedBy.tildaid, name: uploadedBy.name, profilePicURL: uploadedBy.profilePicURL}, signedByUsers: signedByUsers, tags: tags, listingFolders: listingFolders, primaryFolder: primaryFolder, latestAIRun: latestAIRun, findingCount: findingCount, queriesCount: queriesCount, confirmedCount: confirmedCount, resolvedCount: resolvedCount, notesCount: notesCount, stagingLabels: stagingLabels, workOrders: workOrders, woContact: COALESCE(woContact, false), stateTags1: stateTags1, stateTags2: stateTags2, docAccessLevel: docAccessLevel, isSigner: isSigner, docReviewStatus: docReviewStatus, hasImportantComment: hasImportantComment, discrepancyCount: discrepancyCount , templateDetails: templateDetails, docTypeDetails: docType{.*}, queries: queries, annotationSpec: annotationSpec, annotationVal: annotationVal, completedAt: annotationVal.completedAt, versions: versions, reviews: reviews, sharedWith: sharedWith, currentShare: currentShare, tmfCategorization: tmfCategorization, docAttributes: docAttributes, eventId: eventId, eventName: eventName, deliverable: deliverable, eventScope: eventScope, provenance: CASE WHEN copiedFrom IS NULL AND size(copiedTo) = ? THEN null ELSE {copiedFrom: copiedFrom, copiedTo: [x IN copiedTo WHERE x IS NOT NULL | x], copiedToCount: copiedToCount} END, promotedTo: promotedTo} AS document, total return document, total
docsvc
2
1.26 s
4.70 s
2.50 s
flat
MATCH (u:User{tildaid:$user}), (o:Organization{delpending:false, alias:$org}) CALL (u, o) { OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND c…
MATCH (u:User{tildaid:$user}), (o:Organization{delpending:false, alias:$org}) CALL (u, o) { OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND coalesce(a.state, ?) <> ? return r{.*} UNION MATCH (u)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(r:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:?}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND ? IN apoc.text.split(coalesce(r.tags, ?), ?) return distinct r{.*} } WITH u, o, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles, ANY(n IN COLLECT(r.external) WHERE n = true) as external, ANY(n IN COLLECT(r.name) WHERE n = ?) as isPatient, ALL(n IN COLLECT(r.piiAccess) WHERE n = false) as hidePhi WITH u, o, {organization:o{.*}, external: external, isPatient: isPatient, hidePhi: hidePhi, roles: roles, displayRoles: displayRoles } as context CALL (u, o) { MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:STAFF_TO_ACTOR]-(si:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]->(o) WHERE coalesce(a.state, ?) <> ? OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, si, a, r order by r.displayName WITH u, o, si, a, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles WITH CASE when not si is null then {siteId: si.tildaid, roles: roles, displayRoles: displayRoles} end as si return collect(si) as sites, apoc.coll.flatten(collect(si.roles)) as siteRoles } CALL (u, o) { CALL (u, o) { MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false, orgId:o.tildaid}) WHERE coalesce(a.state, ?) <> ? // Required pipeline barrier: without it the actor match re-expands // once per study in the org (?.0M -> 32k db hits, measured in Go). WITH DISTINCT u, o, a MATCH (a)<-[:STUDY_TO_ACTOR]-(s:Study{delpending:false})-[:STUDY_TO_ORG]->(o) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) RETURN s, r UNION // Delegated engagement Actors: orgId is TildaScale? roles. WITH s, r order by r.displayName WITH s, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles // Ordered so the studies array is a stable sequence for clients. WITH s, {studyId: s.tildaid, roles: roles, displayRoles: displayRoles, srcOrgId: s.srcorgid} as st ORDER BY s.name, s.tildaid return collect(st) as studies, apoc.coll.flatten(collect(st.roles)) as studyRoles } with distinct context, studies, apoc.coll.toSet(apoc.coll.flatten(collect(studyRoles))) as allStudyRoles, apoc.coll.toSet(apoc.coll.flatten(collect(siteRoles))) as siRoles with context, studies, apoc.coll.toSet(apoc.coll.flatten([context.roles, allStudyRoles, siRoles])) as allRoles return context{.*, studies: studies, allRoles: allRoles} as rc
feedsvc
9
269 ms
3.65 s
2.40 s
flat
MATCH (u:User{tildaid:$user}), (o:Organization{delpending:false, alias:$org}) CALL (u, o) { OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND c…
MATCH (u:User{tildaid:$user}), (o:Organization{delpending:false, alias:$org}) CALL (u, o) { OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND coalesce(a.state, ?) <> ? return r{.*} UNION MATCH (u)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(r:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:?}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND ? IN apoc.text.split(coalesce(r.tags, ?), ?) return distinct r{.*} } WITH u, o, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles, ANY(n IN COLLECT(r.external) WHERE n = true) as external, ANY(n IN COLLECT(r.name) WHERE n = ?) as isPatient, ALL(n IN COLLECT(r.piiAccess) WHERE n = false) as hidePhi WITH u, o, {organization:o{.*}, external: external, isPatient: isPatient, hidePhi: hidePhi, roles: roles, displayRoles: displayRoles } as context CALL (u, o) { MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:STAFF_TO_ACTOR]-(si:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]->(o) WHERE coalesce(a.state, ?) <> ? OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, si, a, r order by r.displayName WITH u, o, si, a, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles WITH CASE when not si is null then {siteId: si.tildaid, roles: roles, displayRoles: displayRoles} end as si return collect(si) as sites, apoc.coll.flatten(collect(si.roles)) as siteRoles } CALL (u, o) { CALL (u, o) { MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false, orgId:o.tildaid}) WHERE coalesce(a.state, ?) <> ? // Required pipeline barrier: without it the actor match re-expands // once per study in the org (?.0M -> 32k db hits, measured in Go). WITH DISTINCT u, o, a MATCH (a)<-[:STUDY_TO_ACTOR]-(s:Study{delpending:false})-[:STUDY_TO_ORG]->(o) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) RETURN s, r UNION // Delegated engagement Actors: orgId is TildaScale? roles. WITH s, r order by r.displayName WITH s, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles // Ordered so the studies array is a stable sequence for clients. WITH s, {studyId: s.tildaid, roles: roles, displayRoles: displayRoles, srcOrgId: s.srcorgid} as st ORDER BY s.name, s.tildaid return collect(st) as studies, apoc.coll.flatten(collect(st.roles)) as studyRoles } with distinct context, studies, apoc.coll.toSet(apoc.coll.flatten(collect(studyRoles))) as allStudyRoles, apoc.coll.toSet(apoc.coll.flatten(collect(siteRoles))) as siRoles with context, studies, apoc.coll.toSet(apoc.coll.flatten([context.roles, allStudyRoles, siRoles])) as allRoles return context{.*, studies: studies, allRoles: allRoles} as rc
feedsvc
12
196 ms
3.20 s
2.31 s
flat
MATCH (u:User{tildaid:$userId}) WHERE u.status<>?OPTIONAL MATCH (u)-[:INTERNAL_DATA]-(ui:UserInternal) WITH u, COALESCE(ui.pinHash IS NOT NULL AND ui.pinHash <> ?, false) AS pinSet, COALESCE(ui.needs2Factor, false) AS needs2Factor WITH u, …
MATCH (u:User{tildaid:$userId}) WHERE u.status<>?OPTIONAL MATCH (u)-[:INTERNAL_DATA]-(ui:UserInternal) WITH u, COALESCE(ui.pinHash IS NOT NULL AND ui.pinHash <> ?, false) AS pinSet, COALESCE(ui.needs2Factor, false) AS needs2Factor WITH u, u{.*, pinSet: pinSet, needs2Factor: needs2Factor} as profile CALL { with u CALL { WITH u MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization{delpending:false}),(a)-[:APPOINTED_AS]->(r:Role) return o, r UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization{delpending:false}) return o, {name: ?, listed: true, displayName: ?} as r UNION // TODO: temporary, until a TildaScale landing page lists a delegate's engagements. // Delegated roles are listed:false, so the display name is forced here. WITH u MATCH (u)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(o:Organization{delpending:false}), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:?}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND ? IN apoc.text.split(coalesce(dr.tags, ?), ?) return o, {name: dr.name, listed: true, displayName: dr.displayName} as r } WITH u, o, apoc.text.join(collect(distinct r.name), ?) as roles, [r IN collect(DISTINCT r) WHERE r.listed = true | r.displayName] AS displayRoles WHERE roles <> ? OR EXISTS { MATCH (u)-[:FOR_USER]-(:Actor{delpending:false,orgId:o.tildaid})-[:STUDY_TO_ACTOR]-(:Study{delpending:false}) } RETURN collect({orgName: o.name, orgAlias: o.alias, orgId: o.tildaid, orgType: o.orgType, status: o.status, role: roles, displayRoles: displayRoles, logoDocumentId: o.logoDocumentId, theme: o.theme, logoURL: o.logoURL, pinCheckEnabled: o.pinCheckEnabled, requireMFA: o.requireMFA}) AS organizations } return profile{.*, organizations: organizations}
onboardingsvc
1
1.10 s
1.95 s
1.10 s
flat
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=OrganizationSMO policies=lead-edit,lead-read MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)…
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=OrganizationSMO policies=lead-edit,lead-read MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANIZATION_TO_ACTOR]->(a) WHERE a.state <> ? AND a.delpending = false AND x.name IN $lists.roles_0 WITH * WHERE o.orgType = ? MATCH (o)-[:ORGANIZATION_TO_LEAD]->(l:Lead {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, null AS Study, null AS Site, null AS Patient UNION WITH u, o, c // scope=Study policies=study-lead-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role) WHERE a.state <> ? AND a.delpending = false AND o.tildaid = a.orgId AND x.name IN $lists.roles_1 WITH DISTINCT u, o, a, c MATCH (a)<-[:STUDY_TO_ACTOR]-(st:Study) WHERE EXISTS { (st)-[:STUDY_TO_ORG]->(o) } AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) MATCH (st)<-[:LEAD_TO_STUDY]-(l:Lead {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient UNION WITH u, o, c // scope=Study policies=study-lead-edit MATCH (u)<-[:FOR_USER]-(da:Actor)<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study)-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(x:Role)<-[:APPOINTED_AS]-(sa:Actor), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias:$tildaScaleAlias}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND da.delpending = false AND sa.state <> ? AND sa.delpending = false AND x.name IN $lists.roles_2 AND ? IN apoc.text.split(coalesce(x.tags, ?), ?) AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) MATCH (st)<-[:LEAD_TO_STUDY]-(l:Lead {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient } RETURN checkIdx, User, Organization, Study, Site, Patient
patientsvc
1
1.53 s
1.95 s
1.53 s
flat
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope {version:$scopeVersion}) UNWIND [r.name, m.name] as roleName WITH p, s, …
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope {version:$scopeVersion}) UNWIND [r.name, m.name] as roleName WITH p, s, apoc.text.join(collect(DISTINCT roleName), ?) as roleList RETURN { name: p.name, roleList: roleList, objectTypeList: p.objectTypeList, allowedOps: p.allowedOps, scope: s.name } as policy
exportsvc
1
1.30 s
1.95 s
1.30 s
flat
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=Organization policies=org-resources MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANI…
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=Organization policies=org-resources MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANIZATION_TO_ACTOR]->(a) WHERE a.state <> ? AND a.delpending = false AND x.name IN $lists.roles_0 MATCH (o)-[:ORGANIZATION_TO_PATIENT]->(p2:Patient {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, null AS Study, null AS Site, null AS Patient UNION WITH u, o, c // scope=Organization policies=org-resources MATCH (u)<-[:FOR_USER]-(da:Actor)<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study)-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(x:Role)<-[:APPOINTED_AS]-(sa:Actor), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias:$tildaScaleAlias}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND da.delpending = false AND sa.state <> ? AND sa.delpending = false AND x.name IN $lists.roles_1 AND ? IN apoc.text.split(coalesce(x.tags, ?), ?) MATCH (o)-[:ORGANIZATION_TO_PATIENT]->(p2:Patient {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, null AS Study, null AS Site, null AS Patient } RETURN checkIdx, User, Organization, Study, Site, Patient
patientsvc
3
447 ms
1.85 s
1.34 s
flat
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL (u, o, c) { // scope=Study policies=work-order-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role) WHERE a.state <> ? AN…
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL (u, o, c) { // scope=Study policies=work-order-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role) WHERE a.state <> ? AND a.delpending = false AND o.tildaid = a.orgId AND x.name IN $lists.roles_0 WITH DISTINCT u, o, a, c MATCH (a)<-[:STUDY_TO_ACTOR]-(st:Study) WHERE EXISTS { (st)-[:STUDY_TO_ORG]->(o) } AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient UNION // scope=Study policies=work-order-edit MATCH (u)<-[:FOR_USER]-(da:Actor)<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study)-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(x:Role)<-[:APPOINTED_AS]-(sa:Actor), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias:?}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND da.delpending = false AND sa.state <> ? AND sa.delpending = false AND x.name IN $lists.roles_1 AND ? IN apoc.text.split(coalesce(x.tags, ?), ?) AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient } RETURN checkIdx, User, Organization, Study, Site, Patient
feedsvc
4
260 ms
1.80 s
1.03 s
flat
MATCH (ph: Document {tildaid: $id}) MATCH (e: Event) - [:PART_OF_EVENT] - (es: EventScope) - [:APPLICABLE_TO] - (del: Deliverable) - [:TRACKS_PLACEHOLDER] - (ph) MATCH (ph) - [:SCOPED_TO] - (es) OPTIONAL MATCH (ph)-[:ACCEPTED_DOCUMENT]->(a…
MATCH (ph: Document {tildaid: $id}) MATCH (e: Event) - [:PART_OF_EVENT] - (es: EventScope) - [:APPLICABLE_TO] - (del: Deliverable) - [:TRACKS_PLACEHOLDER] - (ph) MATCH (ph) - [:SCOPED_TO] - (es) OPTIONAL MATCH (ph)-[:ACCEPTED_DOCUMENT]->(acceptedDoc:Document) WITH ph, e, es, del, acceptedDoc, coalesce(acceptedDoc, ph) AS d OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) OPTIONAL MATCH (siteFromEvent: Site{tildaid: es.scopeId}) WHERE es.scopeType = ? OPTIONAL MATCH (d)-[:DOC_TO_ORG]->(o:Organization) OPTIONAL MATCH (d)-[:DOCUMENT_TO_SOURCE]->(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(da:DocAttribute) where da.key in [?, ?, ?, ?] OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (uploader: User) OPTIONAL MATCH (study) - [:STUDY_TO_ACTOR] - (actor: Actor{userId: uploader.tildaid}) WITH d, e, es, del, b, study, b2, coalesce(site, siteFromEvent) AS site, o, head(collect(da)) as da, currentFolder, currentSubArtifact, stagingInfo, artifact, section, zone, collection, subArtifact, uploader, ph, acceptedDoc, head(collect(actor)) as actor CALL apoc.create.vNode([?], { tildaid: ph.tildaid, createdat: ph.createdat, updatedat: ph.updatedat, documentId: acceptedDoc.tildaid, documentCreatedAt: acceptedDoc.createdat, documentUpdatedAt: acceptedDoc.updatedat, orgName: o.name, orgId: o.tildaid, orgAlias: o.alias, studyName: study.name, studyId: study.tildaid, siteName: site.name, siteId: site.tildaid, documentStatus: d.status, country: CASE WHEN es.scopeType = ? THEN coalesce(es.scopeId, d.country) ELSE d.country END, languages: coalesce(apoc.convert.toJson(d.languages), ?), fileName: d.fileName, uploadedByName: uploader.name, uploadedById: uploader.tildaid, collection: d.collection, stateTag: d.stateTag, documentExpiryDate: da.value, zone: zone.name, zoneId: zone.tildaid, zoneNumber: case when zone.number is null then null else apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) end, section: section.name, sectionId: section.tildaid, sectionNumber: case when section.number is null then null else apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) end, artifact: artifact.name, artifactId: artifact.tildaid, artifactNumber: case when artifact.number is null then null else apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?) end, subArtifact: subArtifact.name, subArtifactId: subArtifact.tildaid, subArtifactNumber: case when subArtifact.number is null then null else apoc.text.lpad(toString(COALESCE(subArtifact.number, ?)), ?, ?) end, eventId: e.tildaid, eventCreatedAt: e.createdat, eventType: e.type, eventName: e.name, eventStatus: e.status, eventScopeId: es.tildaid, eventScopeName: es.name, scopeType: es.scopeType, eventScopeDecision: es.decision, deliverableId: del.tildaid, deliverableName: del.name, deliverableLocationId: del.locationId, deliverableLocationType: del.locationType, deliverableType: del.type, roles: actor.roles }) YIELD node return node
writedashrsvc
13
629 ms
1.67 s
1.18 s
flat
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=Organization policies=org-resources MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANI…
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=Organization policies=org-resources MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANIZATION_TO_ACTOR]->(a) WHERE a.state <> ? AND a.delpending = false AND x.name IN $lists.roles_0 MATCH (o)-[:ORGANIZATION_TO_PATIENT]->(p2:Patient {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, null AS Study, null AS Site, null AS Patient UNION WITH u, o, c // scope=Organization policies=org-resources MATCH (u)<-[:FOR_USER]-(da:Actor)<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study)-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(x:Role)<-[:APPOINTED_AS]-(sa:Actor), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias:$tildaScaleAlias}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND da.delpending = false AND sa.state <> ? AND sa.delpending = false AND x.name IN $lists.roles_1 AND ? IN apoc.text.split(coalesce(x.tags, ?), ?) MATCH (o)-[:ORGANIZATION_TO_PATIENT]->(p2:Patient {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, null AS Study, null AS Site, null AS Patient } RETURN checkIdx, User, Organization, Study, Site, Patient
patientsvc
7
146 ms
1.65 s
1.01 s
flat
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL (u, o, c) { // scope=Study policies=study-document-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role) WHERE a.state <> …
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL (u, o, c) { // scope=Study policies=study-document-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role) WHERE a.state <> ? AND a.delpending = false AND o.tildaid = a.orgId AND x.name IN $lists.roles_0 WITH DISTINCT u, o, a, c MATCH (a)<-[:STUDY_TO_ACTOR]-(st:Study) WHERE EXISTS { (st)-[:STUDY_TO_ORG]->(o) } AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient UNION // scope=Study policies=study-document-edit MATCH (u)<-[:FOR_USER]-(da:Actor)<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study)-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(x:Role)<-[:APPOINTED_AS]-(sa:Actor), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias:?}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND da.delpending = false AND sa.state <> ? AND sa.delpending = false AND x.name IN $lists.roles_1 AND ? IN apoc.text.split(coalesce(x.tags, ?), ?) AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient } RETURN checkIdx, User, Organization, Study, Site, Patient
feedsvc
7
240 ms
1.65 s
1.66 s
flat
MATCH (ph: Document {tildaid: $id}) MATCH (e: Event) - [:PART_OF_EVENT] - (es: EventScope) - [:APPLICABLE_TO] - (del: Deliverable) - [:TRACKS_PLACEHOLDER] - (ph) MATCH (ph) - [:SCOPED_TO] - (es) OPTIONAL MATCH (ph)-[:ACCEPTED_DOCUMENT]->(a…
MATCH (ph: Document {tildaid: $id}) MATCH (e: Event) - [:PART_OF_EVENT] - (es: EventScope) - [:APPLICABLE_TO] - (del: Deliverable) - [:TRACKS_PLACEHOLDER] - (ph) MATCH (ph) - [:SCOPED_TO] - (es) OPTIONAL MATCH (ph)-[:ACCEPTED_DOCUMENT]->(acceptedDoc:Document) WITH ph, e, es, del, acceptedDoc, coalesce(acceptedDoc, ph) AS d OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) OPTIONAL MATCH (siteFromEvent: Site{tildaid: es.scopeId}) WHERE es.scopeType = ? OPTIONAL MATCH (d)-[:DOC_TO_ORG]->(o:Organization) OPTIONAL MATCH (d)-[:DOCUMENT_TO_SOURCE]->(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(da:DocAttribute) where da.key in [?, ?, ?, ?] OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (uploader: User) OPTIONAL MATCH (study) - [:STUDY_TO_ACTOR] - (actor: Actor{userId: uploader.tildaid}) WITH d, e, es, del, b, study, b2, coalesce(site, siteFromEvent) AS site, o, head(collect(da)) as da, currentFolder, currentSubArtifact, stagingInfo, artifact, section, zone, collection, subArtifact, uploader, ph, acceptedDoc, head(collect(actor)) as actor CALL apoc.create.vNode([?], { tildaid: ph.tildaid, createdat: ph.createdat, updatedat: ph.updatedat, documentId: acceptedDoc.tildaid, documentCreatedAt: acceptedDoc.createdat, documentUpdatedAt: acceptedDoc.updatedat, orgName: o.name, orgId: o.tildaid, orgAlias: o.alias, studyName: study.name, studyId: study.tildaid, siteName: site.name, siteId: site.tildaid, documentStatus: d.status, country: CASE WHEN es.scopeType = ? THEN coalesce(es.scopeId, d.country) ELSE d.country END, languages: coalesce(apoc.convert.toJson(d.languages), ?), fileName: d.fileName, uploadedByName: uploader.name, uploadedById: uploader.tildaid, collection: d.collection, stateTag: d.stateTag, documentExpiryDate: da.value, zone: zone.name, zoneId: zone.tildaid, zoneNumber: case when zone.number is null then null else apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) end, section: section.name, sectionId: section.tildaid, sectionNumber: case when section.number is null then null else apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) end, artifact: artifact.name, artifactId: artifact.tildaid, artifactNumber: case when artifact.number is null then null else apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?) end, subArtifact: subArtifact.name, subArtifactId: subArtifact.tildaid, subArtifactNumber: case when subArtifact.number is null then null else apoc.text.lpad(toString(COALESCE(subArtifact.number, ?)), ?, ?) end, eventId: e.tildaid, eventCreatedAt: e.createdat, eventType: e.type, eventName: e.name, eventStatus: e.status, eventScopeId: es.tildaid, eventScopeName: es.name, scopeType: es.scopeType, eventScopeDecision: es.decision, deliverableId: del.tildaid, deliverableName: del.name, deliverableLocationId: del.locationId, deliverableLocationType: del.locationType, deliverableType: del.type, roles: actor.roles }) YIELD node return node
writedashrsvc
31
262 ms
1.61 s
1.33 s
flat
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL (u, o, c) { // scope=Study policies=study-document-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role) WHERE a.state <> …
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL (u, o, c) { // scope=Study policies=study-document-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role) WHERE a.state <> ? AND a.delpending = false AND o.tildaid = a.orgId AND x.name IN $lists.roles_0 WITH DISTINCT u, o, a, c MATCH (a)<-[:STUDY_TO_ACTOR]-(st:Study) WHERE EXISTS { (st)-[:STUDY_TO_ORG]->(o) } AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient UNION // scope=Study policies=study-document-edit MATCH (u)<-[:FOR_USER]-(da:Actor)<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study)-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(x:Role)<-[:APPOINTED_AS]-(sa:Actor), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias:?}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND da.delpending = false AND sa.state <> ? AND sa.delpending = false AND x.name IN $lists.roles_1 AND ? IN apoc.text.split(coalesce(x.tags, ?), ?) AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient } RETURN checkIdx, User, Organization, Study, Site, Patient
feedsvc
8
134 ms
1.60 s
1.06 s
flat
MATCH (dv:DocumentVersion {tildaid: $id})<-[:DOCUMENT_VERSION]-(d:Document) MATCH (r:Recommendation) WHERE r.doc_id = d.tildaid AND NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO…
MATCH (dv:DocumentVersion {tildaid: $id})<-[:DOCUMENT_VERSION]-(d:Document) MATCH (r:Recommendation) WHERE r.doc_id = d.tildaid AND NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO_ORGANIZATION]->(o:Organization) OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (u: User) OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) CALL { WITH d, site OPTIONAL MATCH (study:Study{tildaid: d.studyId})<-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition{delpending:false, type:?})-[:PLAN_DEFINITION_TO_SITE]->(site) RETURN COALESCE(pd.siteNumber, ?) AS siteNumber } CALL { WITH dv OPTIONAL MATCH (dv)<-[:DOCUMENT_SOURCE_TO_VERSION]-(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(docAttr: DocAttribute) WITH collect([coalesce(docAttr.key, ?), coalesce(docAttr.value, ?)]) AS attributePairs WITH apoc.map.fromPairs(attributePairs) AS attributesMap With apoc.convert.toJson(attributesMap) AS attributesJson RETURN attributesJson } WITH r, ai, o, d, dv, zone, section, artifact, subArtifact, u, study, site, siteNumber, attributesJson, // Document Scope key stripping: reduce the rec JSON envelope to the keys // valid for its OWN scope so irrelevant keys (e.g. country on a site rec) // don?scope?country?scope?siteName?siteId?siteNumber?scope?scope???{}?{}?????{}?{?{?{????DRecommendation?t emit irrelevant rows (e.g. country on a site-scoped rec). recommendedValue: CASE WHEN r.category = ? AND recAllowed IS NOT NULL THEN apoc.convert.toJson(apoc.map.fromPairs([k IN keys(recMap) WHERE k IN recAllowed | [k, recMap[k]]])) ELSE coalesce(CASE WHEN coalesce(r.data_formatted, ?) <> ? THEN r.data_formatted END, r.data, ?) END, // originalRecommendation = the AI?Document Scope????Document Metadata?{}??Document Scope???Document Naming??TMF Artifact???.???.??? ??Sub Artifact??Document Scope??country???site?????Document Metadata??Document Metadata?????{}??????{}??{}??Document Scope?????country???site??????Document Naming???????TMF Artifact????????.???.??? ??Sub Artifact???????Document Format?Document Summary?Quality Control?PHI Issues?Confirm?Fix It????' } ) YIELD node RETURN node
writedashrsvc
9
223 ms
1.55 s
1.81 s
flat
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=OrganizationSMO policies=lead-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANIZ…
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=OrganizationSMO policies=lead-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANIZATION_TO_ACTOR]->(a) WHERE a.state <> ? AND a.delpending = false AND x.name IN $lists.roles_0 WITH * WHERE o.orgType = ? MATCH (o)-[:ORGANIZATION_TO_LEAD]->(l:Lead {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, null AS Study, null AS Site, null AS Patient UNION WITH u, o, c // scope=Study policies=study-lead-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role) WHERE a.state <> ? AND a.delpending = false AND o.tildaid = a.orgId AND x.name IN $lists.roles_1 WITH DISTINCT u, o, a, c MATCH (a)<-[:STUDY_TO_ACTOR]-(st:Study) WHERE EXISTS { (st)-[:STUDY_TO_ORG]->(o) } AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) MATCH (st)<-[:LEAD_TO_STUDY]-(l:Lead {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient UNION WITH u, o, c // scope=Study policies=study-lead-edit MATCH (u)<-[:FOR_USER]-(da:Actor)<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study)-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(x:Role)<-[:APPOINTED_AS]-(sa:Actor), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias:$tildaScaleAlias}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND da.delpending = false AND sa.state <> ? AND sa.delpending = false AND x.name IN $lists.roles_2 AND ? IN apoc.text.split(coalesce(x.tags, ?), ?) AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) MATCH (st)<-[:LEAD_TO_STUDY]-(l:Lead {tildaid:c.id}) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient } RETURN checkIdx, User, Organization, Study, Site, Patient
patientsvc
9
167 ms
1.55 s
1.48 s
flat
match(q:Query {tildaid: $id}) match(c:CarePlan) where c.tildaid=q.careplanId match(soa:ScheduleOfActivities) where soa.tildaid=c.soaId match(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) where pd.tildaid=soa.planDefinitionId…
match(q:Query {tildaid: $id}) match(c:CarePlan) where c.tildaid=q.careplanId match(soa:ScheduleOfActivities) where soa.tildaid=c.soaId match(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) where pd.tildaid=soa.planDefinitionId match(study:Study) where study.tildaid=pd.studyId match(org:Organization) where org.tildaid=study.srcorgid OPTIONAL MATCH (pq:ParticipantQuestion {tildaid: q.scopeId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire)-[:PARTICIPANT_QUESTIONNAIRE]-(pa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(a:Activity|ActivityV2) OPTIONAL MATCH (fpa:ParticipantActivity {tildaid: q.scopeId})-[:BELONGS_TO_ACTIVITY]->(fa:Activity|ActivityV2) WHERE q.context = ? OPTIONAL MATCH (:ParticipantQuestionnaire {tildaid: q.scopeId})-[:PARTICIPANT_QUESTIONNAIRE]-(spa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(sa:Activity|ActivityV2) WHERE q.context = ? CALL apoc.create.vNode([?], { newState: q.state, careplanId: q.careplanId, studyId:study.tildaid, studyName: study.name, orgId: org.tildaid, orgName: org.name, orgAlias: org.alias, siteName: site.name, siteLocation: site.state, siteNumber: pd.siteNumber, createdat: q.createdat, updatedat: q.updatedat, firstResponse: q.firstResponse, queryType: q.queryType, activityId: coalesce(a.tildaid, fa.tildaid, sa.tildaid), activityName: coalesce(a.title, fa.title, sa.title), participantActivityId: coalesce(pa.tildaid, fpa.tildaid, spa.tildaid) } ) YIELD node return node
writedashrsvc
9
125 ms
1.55 s
1.10 s
flat
MATCH (d:Document {tildaid: $id}) MATCH (r:Recommendation)-[:RECOMMENDATION_TO_DOCUMENT]->(d) WHERE NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO_ORGANIZATION]->(o:Organization)…
MATCH (d:Document {tildaid: $id}) MATCH (r:Recommendation)-[:RECOMMENDATION_TO_DOCUMENT]->(d) WHERE NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO_ORGANIZATION]->(o:Organization) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (u: User) OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) OPTIONAL MATCH (dv:DocumentVersion{tildaid: d.primaryVersionId}) OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) CALL { WITH d, site OPTIONAL MATCH (study:Study{tildaid: d.studyId})<-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition{delpending:false, type:?})-[:PLAN_DEFINITION_TO_SITE]->(site) RETURN COALESCE(pd.siteNumber, ?) AS siteNumber } CALL { WITH dv OPTIONAL MATCH (dv)<-[:DOCUMENT_SOURCE_TO_VERSION]-(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(docAttr: DocAttribute) WITH collect([coalesce(docAttr.key, ?), coalesce(docAttr.value, ?)]) AS attributePairs WITH apoc.map.fromPairs(attributePairs) AS attributesMap WITH apoc.convert.toJson(attributesMap) AS attributesJson RETURN attributesJson } // Latest state-change ChangeLog on the version — gives us the user // who triggered the doc into its current state. Merge both event // types (Staging + StateTag) since the BE treats them as the same // documentState concept (mirrors the Python migration script). CALL { WITH dv OPTIONAL MATCH (dv)-[:ALL_CHANGELOG]-(dvcl:ChangeLog) WHERE dvcl.type IN [?, ?, ?] AND (dvcl.newValue CONTAINS ? OR dvcl.newValue CONTAINS ?) WITH dvcl ORDER BY dvcl.createdat DESC LIMIT ? OPTIONAL MATCH (changer:User {tildaid: dvcl.changedBy}) WHERE dvcl IS NOT NULL RETURN coalesce(dvcl.changedBy, ?) as statePromotedBy, coalesce(changer.name, ?) as statePromotedByName } WITH r, ai, o, d, dv, zone, section, artifact, subArtifact, u, study, site, siteNumber, attributesJson, statePromotedBy, statePromotedByName, // Document Scope key stripping: reduce the rec JSON envelope to the keys // valid for its OWN scope so irrelevant keys (e.g. country on a site rec) // don?scope?country?scope?siteName?siteId?siteNumber?scope?scope???{}?{}?????{}?{?{?{????DRecommendation????s ORIGINAL prediction (orig_data). // Same Document Scope extraction so this column lines up with // recommendedValue / actualValue. originalRecommendation: coalesce(r.orig_data, ?), recommendationCount: CASE r.category WHEN ? THEN size(keys(apoc.map.clean( apoc.convert.fromJsonMap(coalesce(r.data_formatted, ?)), [], [?]))) WHEN ? THEN apoc.coll.max([?, size([k IN keys(recMap) WHERE (recAllowed IS NULL OR k IN recAllowed) AND coalesce(toString(recMap[k]), ?) <> ?])]) ELSE ? END, actualValue: CASE r.category WHEN ? THEN coalesce(d.fileName, ?) WHEN ? THEN apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?) + ? + coalesce(artifact.name, ?) WHEN ? THEN coalesce(subArtifact.name, ?) WHEN ? THEN apoc.convert.toJson( CASE toLower(coalesce(d.tmfLevel, ?)) WHEN ? THEN {scope: toLower(coalesce(d.tmfLevel, ?)), country: coalesce(d.country, ?)} WHEN ? THEN {scope: toLower(coalesce(d.tmfLevel, ?)), siteId: coalesce(site.tildaid, ?), siteName: coalesce(site.name, ?), siteNumber: siteNumber} ELSE {scope: toLower(coalesce(d.tmfLevel, ?))} END) WHEN ? THEN attributesJson ELSE ? END, // accuracyCount: for Document Metadata, the number of keys whose // recommended value matches the actual value (?–N out of // recommendationCount). For all other categories, ? or ? (mirrors // ? or ? for other categories. NULL when not yet actioned. accuracyCount: CASE r.category WHEN ? THEN size([k IN keys(apoc.map.clean(apoc.convert.fromJsonMap(coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?)), [], [?])) WHERE apoc.map.clean(apoc.convert.fromJsonMap(coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?)), [], [?])[k] = apoc.map.clean(apoc.convert.fromJsonMap(coalesce(attributesJson, ?)), [], [?])[k]]) WHEN ? THEN size([k IN keys(cmpMap) WHERE (cmpAllowed IS NULL OR k IN cmpAllowed) AND coalesce(toString(cmpMap[k]), ?) <> ? AND toLower(coalesce(toString(cmpMap[k]), ?)) = toLower(coalesce(toString((CASE toLower(coalesce(d.tmfLevel, ?)) WHEN ? THEN {scope: toLower(coalesce(d.tmfLevel, ?)), country: coalesce(d.country, ?)} WHEN ? THEN {scope: toLower(coalesce(d.tmfLevel, ?)), siteId: coalesce(site.tildaid, ?), siteName: coalesce(site.name, ?), siteNumber: siteNumber} ELSE {scope: toLower(coalesce(d.tmfLevel, ?))} END)[k]), ?))]) ELSE CASE (CASE r.category WHEN ? THEN coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?) = coalesce(d.fileName, ?) WHEN ? THEN coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?) = ( apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?) + ? + coalesce(artifact.name, ?)) WHEN ? THEN coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?) = coalesce(subArtifact.name, ?) ELSE CASE WHEN r.category IN [?, ?, ?, ?] THEN r.user_action = ? OR (r.user_action = ? AND coalesce(r.comment, ?) = ?) END END) WHEN true THEN ? WHEN false THEN ? ELSE null END END, comment: r.comment, statePromotedBy: statePromotedBy, statePromotedByName: statePromotedByName } ) YIELD node RETURN node
writedashrsvc
10
216 ms
1.50 s
1.98 s
flat
match(q:Query {tildaid: $id}) match(c:CarePlan) where c.tildaid=q.careplanId match(soa:ScheduleOfActivities) where soa.tildaid=c.soaId match(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) where pd.tildaid=soa.planDefinitionId…
match(q:Query {tildaid: $id}) match(c:CarePlan) where c.tildaid=q.careplanId match(soa:ScheduleOfActivities) where soa.tildaid=c.soaId match(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) where pd.tildaid=soa.planDefinitionId match(study:Study) where study.tildaid=pd.studyId match(org:Organization) where org.tildaid=study.srcorgid OPTIONAL MATCH (pq:ParticipantQuestion {tildaid: q.scopeId})-[:PARTICIPANT_QUESTION]-(pqnr:ParticipantQuestionnaire)-[:PARTICIPANT_QUESTIONNAIRE]-(pa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(a:Activity|ActivityV2) OPTIONAL MATCH (fpa:ParticipantActivity {tildaid: q.scopeId})-[:BELONGS_TO_ACTIVITY]->(fa:Activity|ActivityV2) WHERE q.context = ? OPTIONAL MATCH (:ParticipantQuestionnaire {tildaid: q.scopeId})-[:PARTICIPANT_QUESTIONNAIRE]-(spa:ParticipantActivity)-[:BELONGS_TO_ACTIVITY]->(sa:Activity|ActivityV2) WHERE q.context = ? CALL apoc.create.vNode([?], { newState: q.state, careplanId: q.careplanId, studyId:study.tildaid, studyName: study.name, orgId: org.tildaid, orgName: org.name, orgAlias: org.alias, siteName: site.name, siteLocation: site.state, siteNumber: pd.siteNumber, createdat: q.createdat, updatedat: q.updatedat, firstResponse: q.firstResponse, queryType: q.queryType, activityId: coalesce(a.tildaid, fa.tildaid, sa.tildaid), activityName: coalesce(a.title, fa.title, sa.title), participantActivityId: coalesce(pa.tildaid, fpa.tildaid, spa.tildaid) } ) YIELD node return node
writedashrsvc
10
202 ms
1.50 s
1.02 s
flat
MATCH (ph: Document {tildaid: $id}) MATCH (e: Event) - [:PART_OF_EVENT] - (es: EventScope) - [:APPLICABLE_TO] - (del: Deliverable) - [:TRACKS_PLACEHOLDER] - (ph) MATCH (ph) - [:SCOPED_TO] - (es) OPTIONAL MATCH (ph)-[:ACCEPTED_DOCUMENT]->(a…
MATCH (ph: Document {tildaid: $id}) MATCH (e: Event) - [:PART_OF_EVENT] - (es: EventScope) - [:APPLICABLE_TO] - (del: Deliverable) - [:TRACKS_PLACEHOLDER] - (ph) MATCH (ph) - [:SCOPED_TO] - (es) OPTIONAL MATCH (ph)-[:ACCEPTED_DOCUMENT]->(acceptedDoc:Document) WITH ph, e, es, del, acceptedDoc, coalesce(acceptedDoc, ph) AS d OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) OPTIONAL MATCH (siteFromEvent: Site{tildaid: es.scopeId}) WHERE es.scopeType = ? OPTIONAL MATCH (d)-[:DOC_TO_ORG]->(o:Organization) OPTIONAL MATCH (d)-[:DOCUMENT_TO_SOURCE]->(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(da:DocAttribute) where da.key in [?, ?, ?, ?] OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (uploader: User) OPTIONAL MATCH (study) - [:STUDY_TO_ACTOR] - (actor: Actor{userId: uploader.tildaid}) WITH d, e, es, del, b, study, b2, coalesce(site, siteFromEvent) AS site, o, head(collect(da)) as da, currentFolder, currentSubArtifact, stagingInfo, artifact, section, zone, collection, subArtifact, uploader, ph, acceptedDoc, head(collect(actor)) as actor CALL apoc.create.vNode([?], { tildaid: ph.tildaid, createdat: ph.createdat, updatedat: ph.updatedat, documentId: acceptedDoc.tildaid, documentCreatedAt: acceptedDoc.createdat, documentUpdatedAt: acceptedDoc.updatedat, orgName: o.name, orgId: o.tildaid, orgAlias: o.alias, studyName: study.name, studyId: study.tildaid, siteName: site.name, siteId: site.tildaid, documentStatus: d.status, country: CASE WHEN es.scopeType = ? THEN coalesce(es.scopeId, d.country) ELSE d.country END, languages: coalesce(apoc.convert.toJson(d.languages), ?), fileName: d.fileName, uploadedByName: uploader.name, uploadedById: uploader.tildaid, collection: d.collection, stateTag: d.stateTag, documentExpiryDate: da.value, zone: zone.name, zoneId: zone.tildaid, zoneNumber: case when zone.number is null then null else apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) end, section: section.name, sectionId: section.tildaid, sectionNumber: case when section.number is null then null else apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) end, artifact: artifact.name, artifactId: artifact.tildaid, artifactNumber: case when artifact.number is null then null else apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?) end, subArtifact: subArtifact.name, subArtifactId: subArtifact.tildaid, subArtifactNumber: case when subArtifact.number is null then null else apoc.text.lpad(toString(COALESCE(subArtifact.number, ?)), ?, ?) end, eventId: e.tildaid, eventCreatedAt: e.createdat, eventType: e.type, eventName: e.name, eventStatus: e.status, eventScopeId: es.tildaid, eventScopeName: es.name, scopeType: es.scopeType, eventScopeDecision: es.decision, deliverableId: del.tildaid, deliverableName: del.name, deliverableLocationId: del.locationId, deliverableLocationType: del.locationType, deliverableType: del.type, roles: actor.roles }) YIELD node return node
writedashrsvc
12
107 ms
1.40 s
1.26 s
flat
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDe…
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDefinition{type:?}) match (sitePd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(w:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(t:Trigger{scope:?}) match (sitePd)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (sitePd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) match (scopeUser)-[:STUDYSITEACTOR_TO_ACTOR]->(actor:Actor{delpending:false})<-[:STUDY_TO_ACTOR]-(st) where not exists((scopeUser)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) return distinct scopeUser.tildaid as scopeTildaid, t.scope as workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, scopeUser.roles as roles UNION // Second part for StudySite scope match (t:Trigger{scope:?})-[:TRIGGER_TO_WORKFLOW]->(w:WorkflowV2) match (w)<-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]-(scopeSite:DslPlanDefinition{type:?}) where not exists((scopeSite)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) with distinct t.scope as workflowScope, scopeSite match (scopeSite)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (scopeSite)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct scopeSite.tildaid as scopeTildaid, workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, null as roles
regsvc
13
87 ms
1.35 s
1.08 s
flat
MATCH (u:User{tildaid:$user}), (o:Organization{delpending:false, alias:$org}) CALL (u, o) { OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND c…
MATCH (u:User{tildaid:$user}), (o:Organization{delpending:false, alias:$org}) CALL (u, o) { OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND coalesce(a.state, ?) <> ? return r{.*} UNION MATCH (u)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(r:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:?}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND ? IN apoc.text.split(coalesce(r.tags, ?), ?) return distinct r{.*} } WITH u, o, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles, ANY(n IN COLLECT(r.external) WHERE n = true) as external, ANY(n IN COLLECT(r.name) WHERE n = ?) as isPatient, ALL(n IN COLLECT(r.piiAccess) WHERE n = false) as hidePhi WITH u, o, {organization:o{.*}, external: external, isPatient: isPatient, hidePhi: hidePhi, roles: roles, displayRoles: displayRoles } as context CALL (u, o) { MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:STAFF_TO_ACTOR]-(si:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]->(o) WHERE coalesce(a.state, ?) <> ? OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, si, a, r order by r.displayName WITH u, o, si, a, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles WITH CASE when not si is null then {siteId: si.tildaid, roles: roles, displayRoles: displayRoles} end as si return collect(si) as sites, apoc.coll.flatten(collect(si.roles)) as siteRoles } CALL (u, o) { CALL (u, o) { MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false, orgId:o.tildaid}) WHERE coalesce(a.state, ?) <> ? // Required pipeline barrier: without it the actor match re-expands // once per study in the org (?.0M -> 32k db hits, measured in Go). WITH DISTINCT u, o, a MATCH (a)<-[:STUDY_TO_ACTOR]-(s:Study{delpending:false})-[:STUDY_TO_ORG]->(o) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) RETURN s, r UNION // Delegated engagement Actors: orgId is TildaScale? roles. WITH s, r order by r.displayName WITH s, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles // Ordered so the studies array is a stable sequence for clients. WITH s, {studyId: s.tildaid, roles: roles, displayRoles: displayRoles, srcOrgId: s.srcorgid} as st ORDER BY s.name, s.tildaid return collect(st) as studies, apoc.coll.flatten(collect(st.roles)) as studyRoles } with distinct context, studies, apoc.coll.toSet(apoc.coll.flatten(collect(studyRoles))) as allStudyRoles, apoc.coll.toSet(apoc.coll.flatten(collect(siteRoles))) as siRoles with context, studies, apoc.coll.toSet(apoc.coll.flatten([context.roles, allStudyRoles, siRoles])) as allRoles return context{.*, studies: studies, allRoles: allRoles} as rc
feedsvc
13
141 ms
1.35 s
1.80 s
flat
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL (u, o, c) { // scope=Organization policies=org-work-order-read MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORG…
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL (u, o, c) { // scope=Organization policies=org-work-order-read MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANIZATION_TO_ACTOR]->(a) WHERE a.state <> ? AND a.delpending = false AND x.name IN $lists.roles_0 RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, null AS Study, null AS Site, null AS Patient UNION // scope=Organization policies=org-work-order-read MATCH (u)<-[:FOR_USER]-(da:Actor)<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study)-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(x:Role)<-[:APPOINTED_AS]-(sa:Actor), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias:?}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND da.delpending = false AND sa.state <> ? AND sa.delpending = false AND x.name IN $lists.roles_1 AND ? IN apoc.text.split(coalesce(x.tags, ?), ?) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, null AS Study, null AS Site, null AS Patient } RETURN checkIdx, User, Organization, Study, Site, Patient
virtual-assistant
19
55 ms
1.05 s
1.00 s
flat
MATCH (u:User{tildaid:$user}), (o:Organization{delpending:false, alias:$org}) CALL (u, o) { OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND c…
MATCH (u:User{tildaid:$user}), (o:Organization{delpending:false, alias:$org}) CALL (u, o) { OPTIONAL MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:ORGANIZATION_TO_ACTOR]-(o), (a)-[:APPOINTED_AS]->(r:Role) WHERE not r.name = ? AND coalesce(a.state, ?) <> ? return r{.*} UNION MATCH (u)<-[:FOR_USER]-(da:Actor{delpending:false})<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study{delpending:false})-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(r:Role)<-[:APPOINTED_AS]-(sa:Actor{delpending:false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization{alias:?}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND ? IN apoc.text.split(coalesce(r.tags, ?), ?) return distinct r{.*} } WITH u, o, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles, ANY(n IN COLLECT(r.external) WHERE n = true) as external, ANY(n IN COLLECT(r.name) WHERE n = ?) as isPatient, ALL(n IN COLLECT(r.piiAccess) WHERE n = false) as hidePhi WITH u, o, {organization:o{.*}, external: external, isPatient: isPatient, hidePhi: hidePhi, roles: roles, displayRoles: displayRoles } as context CALL (u, o) { MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false})<-[:STAFF_TO_ACTOR]-(si:Site{delpending:false})-[:SITE_TO_SMO]->(:Smo)-[:IS_AN_ORG]->(o) WHERE coalesce(a.state, ?) <> ? OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) WITH u, o, si, a, r order by r.displayName WITH u, o, si, a, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles WITH CASE when not si is null then {siteId: si.tildaid, roles: roles, displayRoles: displayRoles} end as si return collect(si) as sites, apoc.coll.flatten(collect(si.roles)) as siteRoles } CALL (u, o) { CALL (u, o) { MATCH (u)<-[:FOR_USER]-(a:Actor{delpending:false, orgId:o.tildaid}) WHERE coalesce(a.state, ?) <> ? // Required pipeline barrier: without it the actor match re-expands // once per study in the org (?.0M -> 32k db hits, measured in Go). WITH DISTINCT u, o, a MATCH (a)<-[:STUDY_TO_ACTOR]-(s:Study{delpending:false})-[:STUDY_TO_ORG]->(o) OPTIONAL MATCH (a)-[:APPOINTED_AS]->(r:Role) RETURN s, r UNION // Delegated engagement Actors: orgId is TildaScale? roles. WITH s, r order by r.displayName WITH s, collect(distinct r.name) as roles, collect(distinct case when r.listed = true then r.displayName end) as displayRoles // Ordered so the studies array is a stable sequence for clients. WITH s, {studyId: s.tildaid, roles: roles, displayRoles: displayRoles, srcOrgId: s.srcorgid} as st ORDER BY s.name, s.tildaid return collect(st) as studies, apoc.coll.flatten(collect(st.roles)) as studyRoles } with distinct context, studies, apoc.coll.toSet(apoc.coll.flatten(collect(studyRoles))) as allStudyRoles, apoc.coll.toSet(apoc.coll.flatten(collect(siteRoles))) as siRoles with context, studies, apoc.coll.toSet(apoc.coll.flatten([context.roles, allStudyRoles, siRoles])) as allRoles return context{.*, studies: studies, allRoles: allRoles} as rc
feedsvc
19
103 ms
1.05 s
1.89 s
flat
match(org:Organization{tildaid:$leadOrgId}) with org match(lead:Lead)-[]-(org) with org, lead match(patient:Patient)<-[:LEAD_TO_PATIENT]-(lead) where lead.tildaid=$leadId with org, patient, lead match(patient)-[:HAS_PROTECTED_DATA_IN]->(ph…
match(org:Organization{tildaid:$leadOrgId}) with org match(lead:Lead)-[]-(org) with org, lead match(patient:Patient)<-[:LEAD_TO_PATIENT]-(lead) where lead.tildaid=$leadId with org, patient, lead match(patient)-[:HAS_PROTECTED_DATA_IN]->(phi:Phi) with * optional match(lead)-[:LEAD_TO_ADVOCATE]-(adv:Advocate) with * match(patient)-[]-(mg:MedicalGroup) with * match(lead)-[:LEAD_TO_STUDY]->(study:Study{tildaid:lead.studyid}) with * optional match(lead)-[]-(task:Task) with * optional match(advUser:User{tildaid:adv.userid}) with * optional match(lead)-[]-(:Task)-[]-(:Inbox{type:?})-[]-(assigned:User) with * optional match(formV2:FormInstance)-[:SCREENER_TO_LEAD]->(lead) with * optional match(form:ParticipantForm)-[:PARTICIPANTFORM_TO_PATIENT]->(patient)call{with * optional match (lead)-[:LEAD_TO_PATIENT]->(patient)<-[:RESEARCH_SUBJECT]-(cp:CarePlan)-[:EXECUTE_SOA]-(s:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_STUDY]-(study) where lead.status=? return cp order by cp.createdat desc limit ?} return patient, lead, phi, mg, study, task, adv, advUser, assigned, formV2, form, case cp.status when ?, ? then cp end, org limit $leadLimit
patientsvc
1
798 ms
975 ms
798 ms
flat
MATCH (study:Study )-[:MANAGED_BY]-(:Inbox)-[:BELONGS_TO]-(t:Task) WHERE NOT EXISTS ((t)-[:BELONGS_TO]-(:Inbox{type:?})) AND EXISTS((study)-[:STUDY_TO_ORG{inherited:false}]-(:Organization{orgType:?})) CALL { WITH t MATCH (t)<-[:CREATED_FRO…
MATCH (study:Study )-[:MANAGED_BY]-(:Inbox)-[:BELONGS_TO]-(t:Task) WHERE NOT EXISTS ((t)-[:BELONGS_TO]-(:Inbox{type:?})) AND EXISTS((study)-[:STUDY_TO_ORG{inherited:false}]-(:Organization{orgType:?})) CALL { WITH t MATCH (t)<-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(:ParticipantControl)-[:PARTICIPANT_CONTROL]-(:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) RETURN ptc, pw UNION ALL WITH t MATCH (t)<-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) RETURN ptc, pw } WITH DISTINCT study, t, ptc, pw MATCH (t)-[:BELONGS_TO]-(:Inbox)-[:MANAGED_BY]-(o:Organization) MATCH (ptc)-[:BELONGS_TO_TASKCONFIG]-(tc:TaskConfig) OPTIONAL MATCH (t)-[:BELONGS_TO]-(taskInbox:Inbox{type:?})--(taskUser:User) OPTIONAL MATCH (pw)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:StudySiteActor)-[:STUDYSITEACTOR_TO_ACTOR]-(:Actor{delpending:false})-[:FOR_USER]-(user:User) OPTIONAL MATCH (pw)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(scopeSite:Site)-[:SITE_TO_SMO]-(:Smo)-[:IS_AN_ORG]-(o) WITH DISTINCT study, t, o, tc, taskInbox, taskUser, user, scopeSite SKIP $skip LIMIT $limit WITH collect({study:study, t:t, o:o, tc:tc, taskInbox:taskInbox, taskUser:taskUser, user:user, scopeSite:scopeSite}) AS rows, collect(DISTINCT study) AS studies, collect(DISTINCT o) AS orgs, collect(DISTINCT scopeSite) AS sites CALL { WITH studies UNWIND studies AS study OPTIONAL MATCH (study)-[:STUDY_TO_ACTOR]-(a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(r:Role) WHERE r.name IN [?, ?, ?] RETURN study.tildaid AS studyId, collect(DISTINCT CASE WHEN r.name = ? THEN u.tildaid END) AS piTildaid, collect(DISTINCT CASE WHEN r.name = ? THEN u.tildaid END) AS smoTildaid, collect(DISTINCT CASE WHEN r.name = ? THEN u.tildaid END) AS raTildaid } WITH rows, orgs, sites, collect({studyId: studyId, pi: piTildaid, smo: smoTildaid, ra: raTildaid}) AS studyRoles CALL { WITH orgs UNWIND orgs AS o OPTIONAL MATCH (o)-[:ORGANIZATION_TO_ACTOR]-(a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(:Role{name:?}) RETURN o.tildaid AS orgId, collect(DISTINCT u.tildaid) AS adminTildaid } WITH rows, sites, studyRoles, collect({orgId: orgId, admin: adminTildaid}) AS orgRoles CALL { WITH sites UNWIND (CASE WHEN size(sites) = ? THEN [null] ELSE sites END) AS scopeSite OPTIONAL MATCH (scopeSite)-[:STAFF_TO_ACTOR]-(a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(:Role{name:?}) RETURN scopeSite.tildaid AS siteId, collect(DISTINCT u.tildaid) AS siteAdminTildaid } WITH rows, studyRoles, orgRoles, collect({siteId: siteId, admin: siteAdminTildaid}) AS siteRoles UNWIND rows AS row WITH row, [x IN studyRoles WHERE x.studyId = row.study.tildaid][?] AS sr, [x IN orgRoles WHERE x.orgId = row.o.tildaid][?] AS orr, [x IN siteRoles WHERE row.scopeSite IS NOT NULL AND x.siteId = row.scopeSite.tildaid][?] AS str RETURN DISTINCT row.t AS task, apoc.convert.toJson({userTildaid: row.user.tildaid, userName: row.user.name, PITildaid: sr.pi, studyOwnerTildaid: sr.smo, regAnalystTildaid: sr.ra, orgAdminTildaid: orr.admin, studyName: row.study.name, siteName: row.scopeSite.name, siteAdminTildaid: CASE WHEN row.scopeSite IS NULL THEN [] ELSE str.admin END}) AS details, row.tc.who AS dsnWho, row.o.alias AS orgAlias, row.taskInbox, row.taskUser.tildaid AS taskUserId
tusker
2
422 ms
950 ms
801 ms
flat
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {de…
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)<-[:FOR_USER]-(da:Actor {delpending: false})<-[:STUDY_TO_DELEGATED_ACTOR]-(dst:Study {delpending: false})-[:STUDY_TO_ORG]->(o:Organization {delpending: false}), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor {delpending: false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias: $tildaScaleAlias}) WHERE dst.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) RETURN o UNION WITH u MATCH (o:Organization {alias: $activeAlias, delpending: false}) RETURN o } OPTIONAL MATCH (st:Study {delpending: false})-[:STUDY_TO_ORG]->(o) RETURN collect(DISTINCT o.alias) AS aliases, collect(DISTINCT o.tildaid) AS orgIds, collect(DISTINCT st.tildaid) AS studyIds
dashql
6
347 ms
950 ms
745 ms
flat
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {de…
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)<-[:FOR_USER]-(da:Actor {delpending: false})<-[:STUDY_TO_DELEGATED_ACTOR]-(dst:Study {delpending: false})-[:STUDY_TO_ORG]->(o:Organization {delpending: false}), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor {delpending: false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias: $tildaScaleAlias}) WHERE dst.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) RETURN o UNION WITH u MATCH (o:Organization {alias: $activeAlias, delpending: false}) RETURN o } OPTIONAL MATCH (st:Study {delpending: false})-[:STUDY_TO_ORG]->(o) RETURN collect(DISTINCT o.alias) AS aliases, collect(DISTINCT o.tildaid) AS orgIds, collect(DISTINCT st.tildaid) AS studyIds
dashql
7
281 ms
942 ms
875 ms
flat
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {de…
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)<-[:FOR_USER]-(da:Actor {delpending: false})<-[:STUDY_TO_DELEGATED_ACTOR]-(dst:Study {delpending: false})-[:STUDY_TO_ORG]->(o:Organization {delpending: false}), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor {delpending: false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias: $tildaScaleAlias}) WHERE dst.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) RETURN o UNION WITH u MATCH (o:Organization {alias: $activeAlias, delpending: false}) RETURN o } OPTIONAL MATCH (st:Study {delpending: false})-[:STUDY_TO_ORG]->(o) RETURN collect(DISTINCT o.alias) AS aliases, collect(DISTINCT o.tildaid) AS orgIds, collect(DISTINCT st.tildaid) AS studyIds
dashql
7
179 ms
912 ms
629 ms
flat
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {de…
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)<-[:FOR_USER]-(da:Actor {delpending: false})<-[:STUDY_TO_DELEGATED_ACTOR]-(dst:Study {delpending: false})-[:STUDY_TO_ORG]->(o:Organization {delpending: false}), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor {delpending: false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias: $tildaScaleAlias}) WHERE dst.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) RETURN o UNION WITH u MATCH (o:Organization {alias: $activeAlias, delpending: false}) RETURN o } OPTIONAL MATCH (st:Study {delpending: false})-[:STUDY_TO_ORG]->(o) RETURN collect(DISTINCT o.alias) AS aliases, collect(DISTINCT o.tildaid) AS orgIds, collect(DISTINCT st.tildaid) AS studyIds
dashql
8
387 ms
900 ms
981 ms
flat
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDe…
// First part for StudySiteUser scope match (:StudySiteDuty)-[:STUDYSITEDUTY_TO_STUDYSITEACTOR]->(scopeUser:StudySiteActor{delpending:false}) with distinct scopeUser match (scopeUser)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]->(sitePd:DslPlanDefinition{type:?}) match (sitePd)-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]->(w:WorkflowV2)<-[:TRIGGER_TO_WORKFLOW]-(t:Trigger{scope:?}) match (sitePd)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (sitePd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) match (scopeUser)-[:STUDYSITEACTOR_TO_ACTOR]->(actor:Actor{delpending:false})<-[:STUDY_TO_ACTOR]-(st) where not exists((scopeUser)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) return distinct scopeUser.tildaid as scopeTildaid, t.scope as workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, scopeUser.roles as roles UNION // Second part for StudySite scope match (t:Trigger{scope:?})-[:TRIGGER_TO_WORKFLOW]->(w:WorkflowV2) match (w)<-[:PLAN_DEFINITION_TO_ADOPTED_WORKFLOWS]-(scopeSite:DslPlanDefinition{type:?}) where not exists((scopeSite)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:ParticipantWorkflow)) with distinct t.scope as workflowScope, scopeSite match (scopeSite)-[:PLAN_DEFINITION_TO_STUDY]->(st:Study)-[:STUDY_TO_ORG]->(o:Organization{orgType:?}) match (scopeSite)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct scopeSite.tildaid as scopeTildaid, workflowScope, st.tildaid as stId, o.alias as orgAlias, site.tildaid as siteId, null as roles
regsvc
7
114 ms
825 ms
793 ms
flat
MATCH (d:Document) -[:DOCUMENT_VERSION] - (dv: DocumentVersion {tildaid: $id}) OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) OPTIONAL MATCH (d…
MATCH (d:Document) -[:DOCUMENT_VERSION] - (dv: DocumentVersion {tildaid: $id}) OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) OPTIONAL MATCH (d)-[:DOC_TO_ORG]->(o:Organization) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (uploader: User) OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) CALL { WITH dv OPTIONAL MATCH (dv)<-[:DOCUMENT_SOURCE_TO_VERSION]-(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(da: DocAttribute) WITH collect([coalesce(da.key, ?), coalesce(da.value, ?)]) AS attributePairs WITH apoc.map.fromPairs(attributePairs) AS attributesMap WITH apoc.convert.toJson(attributesMap) AS attributesJson RETURN attributesJson } WITH d, dv, o, study, site, zone, section, artifact, subArtifact, uploader, attributesJson CALL apoc.create.vNode([?], { documentId: d.tildaid, orgId: o.tildaid, orgName: o.name, orgAlias: o.alias, studyId: study.tildaid, studyName: study.name, siteId: COALESCE(site.tildaid, ?), siteName: COALESCE(site.name, ?), zone: zone.name, zoneId: zone.tildaid, section: section.name, sectionId: section.tildaid, artifact: artifact.name, artifactId: artifact.tildaid, subArtifact: subArtifact.name, subArtifactId: subArtifact.tildaid, documentMetadata: attributesJson, uploadedByName: uploader.name, uploadedById: uploader.tildaid, createdat: d.createdat, updatedat: dv.updatedat, artifactNumber: apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?), subArtifactNumber: case when subArtifact.number is null then null else apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(subArtifact.number, ?)), ?, ?) end, tmfLevel: d.tmfLevel, country: d.country, language: d.language, fileName: d.fileName } ) YIELD node RETURN node
writedashrsvc
9
80 ms
775 ms
615 ms
flat
MATCH (dv:DocumentVersion {tildaid: $id})<-[:DOCUMENT_VERSION]-(d:Document) MATCH (r:Recommendation) WHERE r.doc_id = d.tildaid AND NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO…
MATCH (dv:DocumentVersion {tildaid: $id})<-[:DOCUMENT_VERSION]-(d:Document) MATCH (r:Recommendation) WHERE r.doc_id = d.tildaid AND NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO_ORGANIZATION]->(o:Organization) OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (u: User) OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) CALL { WITH d, site OPTIONAL MATCH (study:Study{tildaid: d.studyId})<-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition{delpending:false, type:?})-[:PLAN_DEFINITION_TO_SITE]->(site) RETURN COALESCE(pd.siteNumber, ?) AS siteNumber } CALL { WITH dv OPTIONAL MATCH (dv)<-[:DOCUMENT_SOURCE_TO_VERSION]-(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(docAttr: DocAttribute) WITH collect([coalesce(docAttr.key, ?), coalesce(docAttr.value, ?)]) AS attributePairs WITH apoc.map.fromPairs(attributePairs) AS attributesMap With apoc.convert.toJson(attributesMap) AS attributesJson RETURN attributesJson } WITH r, ai, o, d, dv, zone, section, artifact, subArtifact, u, study, site, siteNumber, attributesJson, // Document Scope key stripping: reduce the rec JSON envelope to the keys // valid for its OWN scope so irrelevant keys (e.g. country on a site rec) // don?scope?country?scope?siteName?siteId?siteNumber?scope?scope???{}?{}?????{}?{?{?{????DRecommendation?t emit irrelevant rows (e.g. country on a site-scoped rec). recommendedValue: CASE WHEN r.category = ? AND recAllowed IS NOT NULL THEN apoc.convert.toJson(apoc.map.fromPairs([k IN keys(recMap) WHERE k IN recAllowed | [k, recMap[k]]])) ELSE coalesce(CASE WHEN coalesce(r.data_formatted, ?) <> ? THEN r.data_formatted END, r.data, ?) END, // originalRecommendation = the AI?Document Scope????Document Metadata?{}??Document Scope???Document Naming??TMF Artifact???.???.??? ??Sub Artifact??Document Scope??country???site?????Document Metadata??Document Metadata?????{}??????{}??{}??Document Scope?????country???site??????Document Naming???????TMF Artifact????????.???.??? ??Sub Artifact???????Document Format?Document Summary?Quality Control?PHI Issues?Confirm?Fix It????' } ) YIELD node RETURN node
writedashrsvc
12
49 ms
700 ms
556 ms
flat
MATCH (pa:ParticipantActivity{tildaid:$pmParticipantActivityId}) -[:BELONGS_TO_ACTIVITY]-(a:ActivityV2{tildaid:$pmActivityId}) // LEVEL ?: Participant objects (Questionnaire, DocumentSet, CheckList, TaskList) OPTIONAL MATCH (pa)-[:PARTICIP…
MATCH (pa:ParticipantActivity{tildaid:$pmParticipantActivityId}) -[:BELONGS_TO_ACTIVITY]-(a:ActivityV2{tildaid:$pmActivityId}) // LEVEL ?: Participant objects (Questionnaire, DocumentSet, CheckList, TaskList) OPTIONAL MATCH (pa)-[:PARTICIPANT_QUESTIONNAIRE|PARTICIPANT_DOCUMENTSET|PARTICIPANT_CHECKLIST|PARTICIPANT_TASKLIST]-(pObj1)- [:BELONGS_TO_QUESTIONNAIRE|BELONGS_TO_DOCUMENTSET|BELONGS_TO_CHECKLIST|BELONGS_TO_TASKLIST]-(obj1) WHERE (pObj1.delpending is null or pObj1.delpending <> true) AND obj1.tildaid=$pdSubObjectId // LEVEL ?: Sub-objects (Questions, Tables, DocUploads, Todos, TaskConfigs, ESign, Timer, Media, DocOverlay) OPTIONAL MATCH (pObj1)-[:PARTICIPANT_QUESTION|PARTICIPANT_TABLE|PARTICIPANT_DOC_UPLOAD|PARTICIPANT_DOC_OVERLAY|PARTICIPANT_TODO|PARTICIPANT_TASKCONFIG|PARTICIPANT_ESIGN|PARTICIPANT_TIMER|PARTICIPANT_MEDIA]-(pSubObj1)- [:BELONGS_TO_QUESTION|BELONGS_TO_TABLE|BELONGS_TO_DOC_UPLOAD|BELONGS_TO_DOC_OVERLAY|BELONGS_TO_TODOV2|BELONGS_TO_TASKCONFIG|BELONGS_TO_ESIGN|BELONGS_TO_TIMER|BELONGS_TO_MEDIA]-(subObj1) WHERE (pSubObj1.delpending is null or pSubObj1.delpending <> true) // LEVEL ?: For tables, get their questions and docuploads (one more level deep) OPTIONAL MATCH (pSubObj1)-[:PARTICIPANT_QUESTION|PARTICIPANT_DOC_UPLOAD]-(pSubSubObj1)- [:BELONGS_TO_QUESTION|BELONGS_TO_DOC_UPLOAD]-(subSubObj1) WHERE pSubObj1:ParticipantTable and (pSubSubObj1.delpending is null or pSubSubObj1.delpending <> true) // Fetch metadata for Level ? (table sub-objects) - counts plus the latest changelog, // which the visit PDF prints as the answer?Draft? hdmObjId, so fall back to // that when no object has the row?s Object Access (freeze/lock) changelogs separately from the per-cell changeLogCount OPTIONAL MATCH (hdmObj)-[:ALL_CHANGELOG]-(oaClog:ChangeLog{type:?}) WITH pa, a, obj1, pObj1, pSubObj1, subObj1, hdmObj, creatorUser, fallbackUser, pSubSubObjs, count(distinct oaClog) as rowObjAccessCount // Collect hdmObj with pSubSubObjs into hdmpSubSubObj WITH DISTINCT pa, a, obj1, pObj1, pSubObj1, subObj1, CASE WHEN size(pSubSubObjs) > ? THEN { pSubSubObjs: pSubSubObjs, hdmObj: hdmObj, objectAccessCount: rowObjAccessCount } ELSE null END as hdmpSubSubObj WITH DISTINCT pa, a, obj1, pObj1, pSubObj1, subObj1,collect(hdmpSubSubObj) as hdmpSubSubObjs // Fetch metadata for Level ? OPTIONAL MATCH (pSubObj1)-[:ALL_CHANGELOG]-(cl2:ChangeLog) WHERE cl2.type IN $pdClogTypes OPTIONAL MATCH (pSubObj1)-[:HAS_QUERY]-(q2:Query) WHERE q2.delpending = false AND q2.state <> ? OPTIONAL MATCH (pSubObj1)-[:BELONGS_TO]-(doc2:Document{archived:false}) OPTIONAL MATCH (doc2)-[:TAIL_CHANGELOG]-(docCL2:ChangeLog) OPTIONAL MATCH (doc2)-[:HAS_QUERY]-(dq2:Query) WHERE NOT dq2.state IN [?] // Aggregate Level ? WITH DISTINCT pa, a, obj1, pObj1, pSubObj1, subObj1, hdmpSubSubObjs, COUNT(DISTINCT dq2) AS doc2QueryCount, COUNT(DISTINCT cl2) AS clog2Count, COUNT(DISTINCT q2) AS query2Count, reduce(l = null, c IN COLLECT(DISTINCT cl2) | CASE WHEN l IS NULL OR c.createdat > l.createdat THEN c ELSE l END) AS lastClog2, doc2, docCL2 ORDER BY docCL2.createdat DESC WITH pa, a, obj1.tildaid AS obj1Id, obj1.title as obj1Title, pObj1, pSubObj1, subObj1, hdmpSubSubObjs, clog2Count, query2Count, lastClog2, CASE WHEN doc2 IS NOT NULL THEN { id: doc2.tildaid, docKind: doc2.docKind, versionNumber: doc2.versionNumber, fileName: doc2.fileName, uploadedBy: docCL2.who, uploadedAt: docCL2.createdat, size: doc2.size, status: doc2.status, pages: doc2.pages, docType: doc2.docTypeName, contentType: doc2.contentType, queryCount: doc2QueryCount, orgRelation: case when (doc2)-[:DOC_TO_ORG]->(:Organization{tildaid:$orgRelationOrgId}) then ? when (:Organization{tildaid:$orgRelationOrgId})<-[:DOC_SHARED_TO_ORG]-(:DocumentShare)-[:REFERS_TO]->(doc2) then ? else ? end } END as opDoc2 With pa, a, obj1Id, obj1Title, pObj1, pSubObj1, subObj1, hdmpSubSubObjs, clog2Count, query2Count, lastClog2, COLLECT(opDoc2) as opdocs2 WITH pa, a, obj1Id, obj1Title, pObj1, COLLECT({ subObj1Id: subObj1.tildaid, subObj1Title: subObj1.title, pSubObj1: pSubObj1, label: labels(pSubObj1)[?], hdmpSubSubObjs: hdmpSubSubObjs, docs: opdocs2, changeLogCount: clog2Count, changeLogs: CASE WHEN lastClog2 IS NULL THEN [] ELSE [lastClog2] END, queryCount: query2Count }) AS pSubObjs WITH DISTINCT pa, a, pObj1, obj1Id, obj1Title, pSubObjs RETURN {pa:pa, a:a, pObj1:pObj1, obj1Id:obj1Id, obj1Title:obj1Title, pSubObjs:pSubObjs}
writeexecsvc
14
40 ms
650 ms
539 ms
flat
MATCH (study:Study {tildaid: $studyId})-[:MANAGED_BY]-(:Inbox)-[:BELONGS_TO]-(t:Task) WHERE NOT EXISTS ((t)-[:BELONGS_TO]-(:Inbox{type:?})) CALL { WITH t MATCH (t)<-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]…
MATCH (study:Study {tildaid: $studyId})-[:MANAGED_BY]-(:Inbox)-[:BELONGS_TO]-(t:Task) WHERE NOT EXISTS ((t)-[:BELONGS_TO]-(:Inbox{type:?})) CALL { WITH t MATCH (t)<-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(:ParticipantControl)-[:PARTICIPANT_CONTROL]-(:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) RETURN ptc, pw UNION ALL WITH t MATCH (t)<-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) RETURN ptc, pw } WITH DISTINCT study, t, ptc, pw MATCH (t)-[:BELONGS_TO]-(:Inbox)-[:MANAGED_BY]-(o:Organization) MATCH (ptc)-[:BELONGS_TO_TASKCONFIG]-(tc:TaskConfig) OPTIONAL MATCH (t)-[:BELONGS_TO]-(taskInbox:Inbox{type:?})--(taskUser:User) OPTIONAL MATCH (pw)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:StudySiteActor)-[:STUDYSITEACTOR_TO_ACTOR]-(:Actor{delpending:false})-[:FOR_USER]-(user:User) OPTIONAL MATCH (pw)-[:PARTICIPANTWORKFLOW_TO_SCOPE]-(:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(scopeSite:Site)-[:SITE_TO_SMO]-(:Smo)-[:IS_AN_ORG]-(o) WITH DISTINCT study, t, o, tc, taskInbox, taskUser, user, scopeSite SKIP $skip LIMIT $limit WITH collect({study:study, t:t, o:o, tc:tc, taskInbox:taskInbox, taskUser:taskUser, user:user, scopeSite:scopeSite}) AS rows, collect(DISTINCT study) AS studies, collect(DISTINCT o) AS orgs, collect(DISTINCT scopeSite) AS sites CALL { WITH studies UNWIND studies AS study OPTIONAL MATCH (study)-[:STUDY_TO_ACTOR]-(a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(r:Role) WHERE r.name IN [?, ?, ?] RETURN study.tildaid AS studyId, collect(DISTINCT CASE WHEN r.name = ? THEN u.tildaid END) AS piTildaid, collect(DISTINCT CASE WHEN r.name = ? THEN u.tildaid END) AS smoTildaid, collect(DISTINCT CASE WHEN r.name = ? THEN u.tildaid END) AS raTildaid } WITH rows, orgs, sites, collect({studyId: studyId, pi: piTildaid, smo: smoTildaid, ra: raTildaid}) AS studyRoles CALL { WITH orgs UNWIND orgs AS o OPTIONAL MATCH (o)-[:ORGANIZATION_TO_ACTOR]-(a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(:Role{name:?}) RETURN o.tildaid AS orgId, collect(DISTINCT u.tildaid) AS adminTildaid } WITH rows, sites, studyRoles, collect({orgId: orgId, admin: adminTildaid}) AS orgRoles CALL { WITH sites UNWIND (CASE WHEN size(sites) = ? THEN [null] ELSE sites END) AS scopeSite OPTIONAL MATCH (scopeSite)-[:STAFF_TO_ACTOR]-(a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(:Role{name:?}) RETURN scopeSite.tildaid AS siteId, collect(DISTINCT u.tildaid) AS siteAdminTildaid } WITH rows, studyRoles, orgRoles, collect({siteId: siteId, admin: siteAdminTildaid}) AS siteRoles UNWIND rows AS row WITH row, [x IN studyRoles WHERE x.studyId = row.study.tildaid][?] AS sr, [x IN orgRoles WHERE x.orgId = row.o.tildaid][?] AS orr, [x IN siteRoles WHERE row.scopeSite IS NOT NULL AND x.siteId = row.scopeSite.tildaid][?] AS str RETURN DISTINCT row.t AS task, apoc.convert.toJson({userTildaid: row.user.tildaid, userName: row.user.name, PITildaid: sr.pi, studyOwnerTildaid: sr.smo, regAnalystTildaid: sr.ra, orgAdminTildaid: orr.admin, studyName: row.study.name, siteName: row.scopeSite.name, siteAdminTildaid: CASE WHEN row.scopeSite IS NULL THEN [] ELSE str.admin END}) AS details, row.tc.who AS dsnWho, row.o.alias AS orgAlias, row.taskInbox, row.taskUser.tildaid AS taskUserId
tusker
18
50 ms
550 ms
871 ms
flat
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {de…
OPTIONAL MATCH (u:User {tildaid: $userId}) CALL { WITH u MATCH (u)<-[:FOR_USER]-(:Actor {delpending: false})<-[:ORGANIZATION_TO_ACTOR]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)-[:SUPPORTS_ORG]-(o:Organization {delpending: false}) RETURN o UNION WITH u MATCH (u)<-[:FOR_USER]-(da:Actor {delpending: false})<-[:STUDY_TO_DELEGATED_ACTOR]-(dst:Study {delpending: false})-[:STUDY_TO_ORG]->(o:Organization {delpending: false}), (da)-[:APPOINTED_AS]->(dr:Role)<-[:APPOINTED_AS]-(sa:Actor {delpending: false}), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias: $tildaScaleAlias}) WHERE dst.srcorgid = o.tildaid AND da.state <> ? AND sa.state <> ? AND $orgDelegatedTag IN apoc.text.split(coalesce(dr.tags, ?), ?) RETURN o UNION WITH u MATCH (o:Organization {alias: $activeAlias, delpending: false}) RETURN o } OPTIONAL MATCH (st:Study {delpending: false})-[:STUDY_TO_ORG]->(o) RETURN collect(DISTINCT o.alias) AS aliases, collect(DISTINCT o.tildaid) AS orgIds, collect(DISTINCT st.tildaid) AS studyIds
dashql
38
32 ms
525 ms
579 ms
flat
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope {version:$scopeVersion}) UNWIND [r.name, m.name] as roleName WITH p, s, …
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope {version:$scopeVersion}) UNWIND [r.name, m.name] as roleName WITH p, s, apoc.text.join(collect(DISTINCT roleName), ?) as roleList RETURN { name: p.name, roleList: roleList, objectTypeList: p.objectTypeList, allowedOps: p.allowedOps, heldAt: p.heldAt, scope: s.name } as policy
rag-agent
1
424 ms
485 ms
424 ms
flat
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope {version:$scopeVersion}) UNWIND [r.name, m.name] as roleName WITH p, s, …
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope {version:$scopeVersion}) UNWIND [r.name, m.name] as roleName WITH p, s, apoc.text.join(collect(DISTINCT roleName), ?) as roleList RETURN { name: p.name, roleList: roleList, objectTypeList: p.objectTypeList, allowedOps: p.allowedOps, heldAt: p.heldAt, scope: s.name } as policy
rag-agent
1
421 ms
485 ms
421 ms
flat
match(phi:Phi)<-[r:HAS_PROTECTED_DATA_IN]-(p:Patient)-[:ORGANIZATION_TO_PATIENT]-(:Organization{tildaid:$phiOrgId}) with phi, p match(p)-[]-(mg:MedicalGroup) with phi, p, mg optional match(p)-[r:USER_TO_PATIENT]-(u:User) with u.tildaid as …
match(phi:Phi)<-[r:HAS_PROTECTED_DATA_IN]-(p:Patient)-[:ORGANIZATION_TO_PATIENT]-(:Organization{tildaid:$phiOrgId}) with phi, p match(p)-[]-(mg:MedicalGroup) with phi, p, mg optional match(p)-[r:USER_TO_PATIENT]-(u:User) with u.tildaid as patUserId, phi, p, mg optional match(p)-[r:INTERESTED_CONDITIONS]->(cond:AdvCampaignCondition) with patUserId, phi, p, mg, collect(cond.tildaid) as condIds with * optional match(p)-[:BINDER_FOR]-(:Binder{binderType:?, scope:?})-[:INCLUDES]-(doc:Document{docTypeName:?})-[:BELONGS_TO]-(pdo:ParticipantDocOverlay{participantReviewed:true}) with count(pdo) as pdoCount, phi, p, mg, condIds, patUserId with * optional match(adv:Advocate{orgid:$phiOrgId, userid:patUserId}) with * match(phi)-[]-(ehrPhi:EhrPhi) return phi, p, mg, ehrPhi, condIds, patUserId, pdoCount, adv limit $pgLimit
patientsvc
1
203 ms
485 ms
203 ms
flat
match(phi:Phi)<-[r:HAS_PROTECTED_DATA_IN]-(p:Patient)-[:ORGANIZATION_TO_PATIENT]-(:Organization{tildaid:$phiOrgId}) where (tolower(trim(phi.firstname)) contains tolower($phiSearch) or tolower(trim(phi.lastname)) contains tolower($phiSearch…
match(phi:Phi)<-[r:HAS_PROTECTED_DATA_IN]-(p:Patient)-[:ORGANIZATION_TO_PATIENT]-(:Organization{tildaid:$phiOrgId}) where (tolower(trim(phi.firstname)) contains tolower($phiSearch) or tolower(trim(phi.lastname)) contains tolower($phiSearch) or tolower(trim(phi.firstname))+?+tolower(trim(phi.lastname)) contains tolower($phiSearch) or tolower(trim(phi.email)) contains tolower($phiSearch) or tolower(trim(phi.mobilephone)) contains tolower($phiSearch) or tolower(trim(phi.homephone)) contains tolower($phiSearch) or toString(p.ufid) contains tolower($phiSearch)) with phi, p match(p)-[]-(mg:MedicalGroup) with phi, p, mg optional match(p)-[r:USER_TO_PATIENT]-(u:User) with u.tildaid as patUserId, phi, p, mg optional match(p)-[r:INTERESTED_CONDITIONS]->(cond:AdvCampaignCondition) with patUserId, phi, p, mg, collect(cond.tildaid) as condIds with * optional match(p)-[:BINDER_FOR]-(:Binder{binderType:?, scope:?})-[:INCLUDES]-(doc:Document{docTypeName:?})-[:BELONGS_TO]-(pdo:ParticipantDocOverlay{participantReviewed:true}) with count(pdo) as pdoCount, phi, p, mg, condIds, patUserId with * optional match(adv:Advocate{orgid:$phiOrgId, userid:patUserId}) with * match(phi)-[]-(ehrPhi:EhrPhi) return phi, p, mg, ehrPhi, condIds, patUserId, pdoCount, adv limit $pgLimit
patientsvc
1
233 ms
485 ms
233 ms
flat
MATCH (b:Budget)-[:BUDGET_TO_ORG]->(o:Organization {alias: $orgAlias}) WHERE b.studyId IN $filterStudyIds WITH b.name AS name, b, CASE b.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END AS statusPriority WITH name,…
MATCH (b:Budget)-[:BUDGET_TO_ORG]->(o:Organization {alias: $orgAlias}) WHERE b.studyId IN $filterStudyIds WITH b.name AS name, b, CASE b.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END AS statusPriority WITH name, b, statusPriority ORDER BY name, statusPriority WITH name, collect(b) AS budgetsPerGroup WITH name, budgetsPerGroup[?] AS b ORDER BY b.createdat DESC WITH collect(b) AS budgetList WITH budgetList, size(budgetList) AS totalCount WITH budgetList[$pageSkip..$pageEnd] AS paginatedBudgets, totalCount UNWIND paginatedBudgets AS b OPTIONAL MATCH (u:User {tildaid: b.configuredBy}) OPTIONAL MATCH (b)-[:BUDGET_TO_SITE|BUDGET_TO_SITE_DRAFT]->(site:Site) OPTIONAL MATCH (b)-[:BUDGET_TO_STUDY]->(study:Study) // Fetch linked budgets OPTIONAL MATCH (b)-[:BUDGET_TO_BUDGET*?..]-(linkedBudget:Budget) WHERE linkedBudget.tildaid <> b.tildaid WITH b, totalCount, u, collect(DISTINCT site) as sites, study, collect(linkedBudget) as tempLinkedBudgets // Handle linked budgets info collection WITH b, totalCount, u, sites, study, [budget IN tempLinkedBudgets | { budget: budget, sites: [(budget)-[:BUDGET_TO_SITE|BUDGET_TO_SITE_DRAFT]->(s2:Site) | s2], linkedUser: head([linkedUser IN [(budget)<-[:CONFIGURED_BY]-(u2:User) | u2] | linkedUser]), statusPriority: CASE budget.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END }] as linkedBudgetsInfo // Sort linked budgets safely by handling empty collections WITH b, totalCount, u, sites, study, CASE WHEN size(linkedBudgetsInfo) > ? THEN apoc.coll.sortMulti( linkedBudgetsInfo, [?, ?] ) ELSE [] END as linkedBudgetsInfo // Final collection of data for node creation WITH b, u, sites, study.name AS studyName, study.sponsor AS sponsor, u.name AS configuredByName, totalCount, linkedBudgetsInfo CALL apoc.create.vNode( [?], { tildaid: b.tildaid, createdat: b.createdat, updatedat: b.updatedat, orgAlias: b.orgAlias, name: b.name, studyId: b.studyId, protocolVersionId: b.protocolVersionId, effectiveDate: b.effectiveDate, type: b.type, version: b.version, status: b.status, configuredBy: b.configuredBy, sourceBudgetId: b.sourceBudgetId, screenFailureRatioScreenFailed: b.screenFailureRatioScreenFailed, screenFailureRatioEnrolled: b.screenFailureRatioEnrolled, screenFailureAllowance: b.screenFailureAllowance, screenFailureCalculationMode: b.screenFailureCalculationMode, siteInfo: [site IN sites | { id: site.tildaid, name: site.name }], studyName: studyName, sponsor: sponsor, configuredByName: configuredByName, budgetVersions: [info IN linkedBudgetsInfo | { tildaid: info.budget.tildaid, createdat: info.budget.createdat, updatedat: info.budget.updatedat, orgAlias: info.budget.orgAlias, name: info.budget.name, studyId: info.budget.studyId, protocolVersionId: info.budget.protocolVersionId, effectiveDate: info.budget.effectiveDate, type: info.budget.type, version: info.budget.version, status: info.budget.status, configuredBy: info.budget.configuredBy, sourceBudgetId: info.budget.sourceBudgetId, screenFailureRatioScreenFailed: info.budget.screenFailureRatioScreenFailed, screenFailureRatioEnrolled: info.budget.screenFailureRatioEnrolled, screenFailureAllowance: info.budget.screenFailureAllowance, screenFailureCalculationMode: info.budget.screenFailureCalculationMode, error: info.budget.error, studyName: info.study.name, sponsor: info.study.sponsor, configuredByName: info.user.name, siteInfo: [site IN info.sites | { id: site.tildaid, name: site.name }] }] } ) YIELD node AS budgetNode RETURN budgetNode, totalCount
writefinsvc
1
330 ms
485 ms
330 ms
flat
MATCH (b:Budget)-[:BUDGET_TO_ORG]->(o:Organization {alias: $orgAlias}) WHERE b.studyId IN $filterStudyIds WITH b.name AS name, b, CASE b.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END AS statusPriority WITH name,…
MATCH (b:Budget)-[:BUDGET_TO_ORG]->(o:Organization {alias: $orgAlias}) WHERE b.studyId IN $filterStudyIds WITH b.name AS name, b, CASE b.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END AS statusPriority WITH name, b, statusPriority ORDER BY name, statusPriority WITH name, collect(b) AS budgetsPerGroup WITH name, budgetsPerGroup[?] AS b ORDER BY b.createdat DESC WITH collect(b) AS budgetList WITH budgetList, size(budgetList) AS totalCount WITH budgetList[$pageSkip..$pageEnd] AS paginatedBudgets, totalCount UNWIND paginatedBudgets AS b OPTIONAL MATCH (u:User {tildaid: b.configuredBy}) OPTIONAL MATCH (b)-[:BUDGET_TO_SITE|BUDGET_TO_SITE_DRAFT]->(site:Site) OPTIONAL MATCH (b)-[:BUDGET_TO_STUDY]->(study:Study) // Fetch linked budgets OPTIONAL MATCH (b)-[:BUDGET_TO_BUDGET*?..]-(linkedBudget:Budget) WHERE linkedBudget.tildaid <> b.tildaid WITH b, totalCount, u, collect(DISTINCT site) as sites, study, collect(linkedBudget) as tempLinkedBudgets // Handle linked budgets info collection WITH b, totalCount, u, sites, study, [budget IN tempLinkedBudgets | { budget: budget, sites: [(budget)-[:BUDGET_TO_SITE|BUDGET_TO_SITE_DRAFT]->(s2:Site) | s2], linkedUser: head([linkedUser IN [(budget)<-[:CONFIGURED_BY]-(u2:User) | u2] | linkedUser]), statusPriority: CASE budget.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END }] as linkedBudgetsInfo // Sort linked budgets safely by handling empty collections WITH b, totalCount, u, sites, study, CASE WHEN size(linkedBudgetsInfo) > ? THEN apoc.coll.sortMulti( linkedBudgetsInfo, [?, ?] ) ELSE [] END as linkedBudgetsInfo // Final collection of data for node creation WITH b, u, sites, study.name AS studyName, study.sponsor AS sponsor, u.name AS configuredByName, totalCount, linkedBudgetsInfo CALL apoc.create.vNode( [?], { tildaid: b.tildaid, createdat: b.createdat, updatedat: b.updatedat, orgAlias: b.orgAlias, name: b.name, studyId: b.studyId, protocolVersionId: b.protocolVersionId, effectiveDate: b.effectiveDate, type: b.type, version: b.version, status: b.status, configuredBy: b.configuredBy, sourceBudgetId: b.sourceBudgetId, screenFailureRatioScreenFailed: b.screenFailureRatioScreenFailed, screenFailureRatioEnrolled: b.screenFailureRatioEnrolled, screenFailureAllowance: b.screenFailureAllowance, screenFailureCalculationMode: b.screenFailureCalculationMode, siteInfo: [site IN sites | { id: site.tildaid, name: site.name }], studyName: studyName, sponsor: sponsor, configuredByName: configuredByName, budgetVersions: [info IN linkedBudgetsInfo | { tildaid: info.budget.tildaid, createdat: info.budget.createdat, updatedat: info.budget.updatedat, orgAlias: info.budget.orgAlias, name: info.budget.name, studyId: info.budget.studyId, protocolVersionId: info.budget.protocolVersionId, effectiveDate: info.budget.effectiveDate, type: info.budget.type, version: info.budget.version, status: info.budget.status, configuredBy: info.budget.configuredBy, sourceBudgetId: info.budget.sourceBudgetId, screenFailureRatioScreenFailed: info.budget.screenFailureRatioScreenFailed, screenFailureRatioEnrolled: info.budget.screenFailureRatioEnrolled, screenFailureAllowance: info.budget.screenFailureAllowance, screenFailureCalculationMode: info.budget.screenFailureCalculationMode, error: info.budget.error, studyName: info.study.name, sponsor: info.study.sponsor, configuredByName: info.user.name, siteInfo: [site IN info.sites | { id: site.tildaid, name: site.name }] }] } ) YIELD node AS budgetNode RETURN budgetNode, totalCount
writefinsvc
1
467 ms
485 ms
467 ms
flat
call { match (task:Task{assignment:?}) where (task.state = ? or task.state = ?) return task } with task where not exists ( (task)-[:CREATED_FROM_SPEC]-(:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_…
call { match (task:Task{assignment:?}) where (task.state = ? or task.state = ?) return task } with task where not exists ( (task)-[:CREATED_FROM_SPEC]-(:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(:ParticipantControl) ) and not exists ( (task)<-[:CREATED_FROM_SPEC]-(:ParticipantDslSpecNode)<-[:PARTICIPANT_DSLTASK_TO_ALL_PARTICIPANT_DSLSPECNODE]-(:ParticipantDslTask)<-[:PARTICIPANT_DSLTASK]-(:ParticipantControl) ) match (task)-[:WITH_CONTEXT]->() optional match (task)-[:BELONGS_TO]->(userinbox:Inbox{type:?})-[:OWNED_BY]->(user:User) optional match (user)-[:USER_TO_PATIENT]-(patient:Patient) optional match (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(org:Organization) optional match (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(study:Study) optional match (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(site:Site) return distinct task, userinbox, org, study.name, site.name, patient.tildaid skip $skip limit $limit
tusker
2
182 ms
470 ms
345 ms
flat
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope{version:?}) // Both names go through one column: apoc.text.join takes a …
MATCH (p:Policy)-[:IS_ASSIGNED_TO]->(r:Role) WHERE coalesce(p.state, ?) IN [?, ?] OPTIONAL MATCH (r)<-[:MIMICS]-(m:Role) OPTIONAL MATCH (p)-[:APPLICABLE_IN]->(s:Scope{version:?}) // Both names go through one column: apoc.text.join takes a list of strings, // and concatenating two collected lists does not type-check as one. UNWIND [r.name, m.name] as roleName WITH p, s, apoc.text.join(collect(DISTINCT roleName), ?) as roleList return apoc.create.vNode([?], { name: p.name, description: p.description, roleList: roleList, objectTypeList: p.objectTypeList, allowedOps: p.allowedOps, scope: s.name})
writeschema-migrate
3
119 ms
455 ms
214 ms
0.2× ↓
MATCH(org:Organization{tildaid:$orgId})-[:ORGANIZATION_TO_PATIENT]-(p:Patient{tildaid:$id}) OPTIONAL MATCH (p)-[r:INTERESTED_CONDITIONS]->(cond:AdvCampaignCondition) with p, collect(cond.tildaid) as condIds OPTIONAL MATCH (p)-[:HAS_PROTECT…
MATCH(org:Organization{tildaid:$orgId})-[:ORGANIZATION_TO_PATIENT]-(p:Patient{tildaid:$id}) OPTIONAL MATCH (p)-[r:INTERESTED_CONDITIONS]->(cond:AdvCampaignCondition) with p, collect(cond.tildaid) as condIds OPTIONAL MATCH (p)-[:HAS_PROTECTED_DATA_IN]-(phi:Phi) OPTIONAL MATCH (p)<-[:RESEARCH_SUBJECT]-(cp:CarePlan)-[:EXECUTE_SOA]-(:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_STUDY]-(st:Study) OPTIONAL MATCH (pd)-[:PLAN_DEFINITION_TO_SITE]-(si:Site) WITH p, phi,condIds, cp, st, si ORDER BY st.name ASC WITH p, phi,condIds, collect({cp: cp, st: st, site:si}) AS cpStudyPairs OPTIONAL MATCH (s:Study)<-[:LEAD_TO_STUDY]-(l:Lead)-[:LEAD_TO_PATIENT]->(p) WITH p, phi,condIds, cpStudyPairs, l, s ORDER BY s.name ASC WITH p, phi,condIds, cpStudyPairs, collect({l: l, s: s}) AS lStudyPairs // Combine studyInfo and leadStudyInfo, ignoring leadStudyInfo if studyId matches WITH p, phi,condIds, cpStudyPairs, lStudyPairs, [pair IN cpStudyPairs WHERE pair.st IS NOT NULL OR pair.cp IS NOT NULL | { id: pair.st.tildaid, name: pair.st.name, sponsor: pair.st.sponsor, careplanId: pair.cp.tildaid, cpstatus: pair.cp.status, site: pair.site.name, subjectid: pair.cp.subjectid, isLocked: coalesce(pair.st.isLocked, false) } ] AS studyInfo, [pair IN lStudyPairs WHERE pair.s IS NOT NULL AND NOT pair.s.tildaid IN [cpPair IN cpStudyPairs WHERE cpPair.st IS NOT NULL | cpPair.st.tildaid] | { id: pair.s.tildaid, name: pair.s.name, sponsor: pair.s.sponsor, lstatus: pair.l.status, leadId: pair.l.tildaid, isLocked: coalesce(pair.s.isLocked, false) } ] AS leadStudyInfo WITH p, phi, condIds,studyInfo + leadStudyInfo AS combinedStudyInfo CALL apoc.create.vNode( [?], { patientId: p.tildaid, preferredLanguage: p.preferredlanguage, contactpreference: p.contactpreference, timepreference: p.timepreference, gender: p.sex, phiId: phi.tildaid, dob: phi.dob, firstname: phi.firstname, middlename: phi.middlename, lastname: phi.lastname, nickname: phi.nickname, suffix: phi.suffix, preferredname: phi.preferredname, address1: phi.address1, address2: phi.address2, city: phi.city, state: phi.state, country: phi.country, zippostalcode: phi.zippostalcode, latitude: phi.latitude, longitude: phi.longitude, email: phi.email, homephone: phi.homephone, workphone: phi.workphone, mobilephone: phi.mobilephone, primaryphonetype: phi.primaryphonetype, secondaryphonetype: phi.secondaryphonetype, emergencycontactname: phi.emergencycontactname, emergencycontactphonenumber: phi.emergencycontactphonenumber, emergencycontactrelation: phi.emergencycontactrelation, emergencycontactemail: phi.emergencycontactemail, hasStudyPartner: phi.hasstudypartner, studyPartnerName: phi.studypartnername, studyPartnerRelation: phi.studypartnerrelation, studyPartnerIsEmergencyContact: phi.studypartnerisemergencycontact, studyPartnerAddress1: phi.studypartneraddress1, studyPartnerAddress2: phi.studypartneraddress2, studyPartnerCity: phi.studypartnercity, studyPartnerState: phi.studypartnerstate, studyPartnerZipCode: phi.studypartnerzipcode, studyPartnerCountry: phi.studypartnercountry, studyPartnerEmail: phi.studypartneremail, studyPartnerPhone: phi.studypartnerphone, interestedconditionids: condIds, studyInfo: combinedStudyInfo }) YIELD node AS vNodes WITH COLLECT(vNodes) as profiles UNWIND profiles AS allprofiles RETURN allprofiles
writepatientsvc
3
84 ms
455 ms
250 ms
flat
MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] …
MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] AND ptc.status <> ? RETURN DISTINCT t.tildaid UNION MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pc:ParticipantControl)-[:PARTICIPANT_CONTROL]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] AND ptc.status <> ? RETURN DISTINCT t.tildaid UNION match (t:Task)-[:CREATED_FROM_SPEC]-(ptd:ParticipantTodo)-[:PARTICIPANT_TODO]-(pc:ParticipantControl)-[:PARTICIPANT_CONTROL]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) where t.state in [?, ?] and ptd.status <> ? return distinct t.tildaid
regsvc
4
59 ms
440 ms
232 ms
flat
MATCH (b:Budget)-[:BUDGET_TO_ORG]->(o:Organization {alias: $orgAlias}) WITH b.name AS name, b, CASE b.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END AS statusPriority WITH name, b, statusPriority ORDER BY name, s…
MATCH (b:Budget)-[:BUDGET_TO_ORG]->(o:Organization {alias: $orgAlias}) WITH b.name AS name, b, CASE b.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END AS statusPriority WITH name, b, statusPriority ORDER BY name, statusPriority WITH name, collect(b) AS budgetsPerGroup WITH name, budgetsPerGroup[?] AS b ORDER BY b.createdat DESC WITH collect(b) AS budgetList WITH budgetList, size(budgetList) AS totalCount WITH budgetList[$pageSkip..$pageEnd] AS paginatedBudgets, totalCount UNWIND paginatedBudgets AS b OPTIONAL MATCH (u:User {tildaid: b.configuredBy}) OPTIONAL MATCH (b)-[:BUDGET_TO_SITE|BUDGET_TO_SITE_DRAFT]->(site:Site) OPTIONAL MATCH (b)-[:BUDGET_TO_STUDY]->(study:Study) // Fetch linked budgets OPTIONAL MATCH (b)-[:BUDGET_TO_BUDGET*?..]-(linkedBudget:Budget) WHERE linkedBudget.tildaid <> b.tildaid WITH b, totalCount, u, collect(DISTINCT site) as sites, study, collect(linkedBudget) as tempLinkedBudgets // Handle linked budgets info collection WITH b, totalCount, u, sites, study, [budget IN tempLinkedBudgets | { budget: budget, sites: [(budget)-[:BUDGET_TO_SITE|BUDGET_TO_SITE_DRAFT]->(s2:Site) | s2], linkedUser: head([linkedUser IN [(budget)<-[:CONFIGURED_BY]-(u2:User) | u2] | linkedUser]), statusPriority: CASE budget.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END }] as linkedBudgetsInfo // Sort linked budgets safely by handling empty collections WITH b, totalCount, u, sites, study, CASE WHEN size(linkedBudgetsInfo) > ? THEN apoc.coll.sortMulti( linkedBudgetsInfo, [?, ?] ) ELSE [] END as linkedBudgetsInfo // Final collection of data for node creation WITH b, u, sites, study.name AS studyName, study.sponsor AS sponsor, u.name AS configuredByName, totalCount, linkedBudgetsInfo CALL apoc.create.vNode( [?], { tildaid: b.tildaid, createdat: b.createdat, updatedat: b.updatedat, orgAlias: b.orgAlias, name: b.name, studyId: b.studyId, protocolVersionId: b.protocolVersionId, effectiveDate: b.effectiveDate, type: b.type, version: b.version, status: b.status, configuredBy: b.configuredBy, sourceBudgetId: b.sourceBudgetId, screenFailureRatioScreenFailed: b.screenFailureRatioScreenFailed, screenFailureRatioEnrolled: b.screenFailureRatioEnrolled, screenFailureAllowance: b.screenFailureAllowance, screenFailureCalculationMode: b.screenFailureCalculationMode, siteInfo: [site IN sites | { id: site.tildaid, name: site.name }], studyName: studyName, sponsor: sponsor, configuredByName: configuredByName, budgetVersions: [info IN linkedBudgetsInfo | { tildaid: info.budget.tildaid, createdat: info.budget.createdat, updatedat: info.budget.updatedat, orgAlias: info.budget.orgAlias, name: info.budget.name, studyId: info.budget.studyId, protocolVersionId: info.budget.protocolVersionId, effectiveDate: info.budget.effectiveDate, type: info.budget.type, version: info.budget.version, status: info.budget.status, configuredBy: info.budget.configuredBy, sourceBudgetId: info.budget.sourceBudgetId, screenFailureRatioScreenFailed: info.budget.screenFailureRatioScreenFailed, screenFailureRatioEnrolled: info.budget.screenFailureRatioEnrolled, screenFailureAllowance: info.budget.screenFailureAllowance, screenFailureCalculationMode: info.budget.screenFailureCalculationMode, error: info.budget.error, studyName: info.study.name, sponsor: info.study.sponsor, configuredByName: info.user.name, siteInfo: [site IN info.sites | { id: site.tildaid, name: site.name }] }] } ) YIELD node AS budgetNode RETURN budgetNode, totalCount
writefinsvc
4
79 ms
440 ms
312 ms
flat
MATCH(lead:Lead {tildaid: $id}) MATCH (lead)-[:LEAD_TO_STUDY]-(study:Study) match (lead)-[:LEAD_TO_PATIENT]->(patient:Patient) MATCH(org:Organization) WHERE org.tildaid=study.srcorgid OPTIONAL MATCH (study)-[:PLAN_DEFINITION_TO_STUDY]-(dsl…
MATCH(lead:Lead {tildaid: $id}) MATCH (lead)-[:LEAD_TO_STUDY]-(study:Study) match (lead)-[:LEAD_TO_PATIENT]->(patient:Patient) MATCH(org:Organization) WHERE org.tildaid=study.srcorgid OPTIONAL MATCH (study)-[:PLAN_DEFINITION_TO_STUDY]-(dsl:DslPlanDefinition)-[:SOA_TO_PLAN_DEFINITION]-(:ScheduleOfActivities)-[:EXECUTE_SOA]-(:CarePlan)-[:RESEARCH_SUBJECT]-(patient) OPTIONAL MATCH (dsl)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) OPTIONAL MATCH (lead)-[:LEAD_TO_ADVOCATE]-(adv:Advocate)-[:ADV_TO_PORTAL_ORG]-(advOrg:AdvOrg) OPTIONAL MATCH (user:User{tildaid: adv.userid}) OPTIONAL MATCH (recruiterOrg:Organization{tildaid: adv.orgid}) CALL apoc.create.vNode([?], { studyName: study.name, orgId: org.tildaid, orgName: org.name, orgAlias: org.alias, siteId: site.tildaid, siteName: site.name, createdat: lead.createdat, updatedat: lead.updatedat, sourceType: lead.sourcetype, status: lead.status, leadId: lead.tildaid, patientId: lead.patientid, studyId: lead.studyid, recruiterOrg: recruiterOrg.name, recruiter: user.name, sex: patient.sex, ethnicity: patient.ethnicity } ) YIELD node RETURN node
writedashrsvc
4
58 ms
440 ms
230 ms
flat
MATCH (b:Budget)-[:BUDGET_TO_ORG]->(o:Organization {alias: $orgAlias}) WITH b.name AS name, b, CASE b.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END AS statusPriority WITH name, b, statusPriority ORDER BY name, s…
MATCH (b:Budget)-[:BUDGET_TO_ORG]->(o:Organization {alias: $orgAlias}) WITH b.name AS name, b, CASE b.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END AS statusPriority WITH name, b, statusPriority ORDER BY name, statusPriority WITH name, collect(b) AS budgetsPerGroup WITH name, budgetsPerGroup[?] AS b ORDER BY b.createdat DESC WITH collect(b) AS budgetList WITH budgetList, size(budgetList) AS totalCount WITH budgetList[$pageSkip..$pageEnd] AS paginatedBudgets, totalCount UNWIND paginatedBudgets AS b OPTIONAL MATCH (u:User {tildaid: b.configuredBy}) OPTIONAL MATCH (b)-[:BUDGET_TO_SITE|BUDGET_TO_SITE_DRAFT]->(site:Site) OPTIONAL MATCH (b)-[:BUDGET_TO_STUDY]->(study:Study) // Fetch linked budgets OPTIONAL MATCH (b)-[:BUDGET_TO_BUDGET*?..]-(linkedBudget:Budget) WHERE linkedBudget.tildaid <> b.tildaid WITH b, totalCount, u, collect(DISTINCT site) as sites, study, collect(linkedBudget) as tempLinkedBudgets // Handle linked budgets info collection WITH b, totalCount, u, sites, study, [budget IN tempLinkedBudgets | { budget: budget, sites: [(budget)-[:BUDGET_TO_SITE|BUDGET_TO_SITE_DRAFT]->(s2:Site) | s2], linkedUser: head([linkedUser IN [(budget)<-[:CONFIGURED_BY]-(u2:User) | u2] | linkedUser]), statusPriority: CASE budget.status WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? ELSE ? END }] as linkedBudgetsInfo // Sort linked budgets safely by handling empty collections WITH b, totalCount, u, sites, study, CASE WHEN size(linkedBudgetsInfo) > ? THEN apoc.coll.sortMulti( linkedBudgetsInfo, [?, ?] ) ELSE [] END as linkedBudgetsInfo // Final collection of data for node creation WITH b, u, sites, study.name AS studyName, study.sponsor AS sponsor, u.name AS configuredByName, totalCount, linkedBudgetsInfo CALL apoc.create.vNode( [?], { tildaid: b.tildaid, createdat: b.createdat, updatedat: b.updatedat, orgAlias: b.orgAlias, name: b.name, studyId: b.studyId, protocolVersionId: b.protocolVersionId, effectiveDate: b.effectiveDate, type: b.type, version: b.version, status: b.status, configuredBy: b.configuredBy, sourceBudgetId: b.sourceBudgetId, screenFailureRatioScreenFailed: b.screenFailureRatioScreenFailed, screenFailureRatioEnrolled: b.screenFailureRatioEnrolled, screenFailureAllowance: b.screenFailureAllowance, screenFailureCalculationMode: b.screenFailureCalculationMode, siteInfo: [site IN sites | { id: site.tildaid, name: site.name }], studyName: studyName, sponsor: sponsor, configuredByName: configuredByName, budgetVersions: [info IN linkedBudgetsInfo | { tildaid: info.budget.tildaid, createdat: info.budget.createdat, updatedat: info.budget.updatedat, orgAlias: info.budget.orgAlias, name: info.budget.name, studyId: info.budget.studyId, protocolVersionId: info.budget.protocolVersionId, effectiveDate: info.budget.effectiveDate, type: info.budget.type, version: info.budget.version, status: info.budget.status, configuredBy: info.budget.configuredBy, sourceBudgetId: info.budget.sourceBudgetId, screenFailureRatioScreenFailed: info.budget.screenFailureRatioScreenFailed, screenFailureRatioEnrolled: info.budget.screenFailureRatioEnrolled, screenFailureAllowance: info.budget.screenFailureAllowance, screenFailureCalculationMode: info.budget.screenFailureCalculationMode, error: info.budget.error, studyName: info.study.name, sponsor: info.study.sponsor, configuredByName: info.user.name, siteInfo: [site IN info.sites | { id: site.tildaid, name: site.name }] }] } ) YIELD node AS budgetNode RETURN budgetNode, totalCount
writefinsvc
5
65 ms
425 ms
315 ms
flat
MATCH (pt:ParticipantTable {tildaid: $pt_id})-[:PARTICIPANT_QUESTION|PARTICIPANT_DOC_UPLOAD]-(pobj) WHERE pobj.hdmClassId = $hdm_class_id AND (pobj.delpending IS NULL OR pobj.delpending <> true) OPTIONAL MATCH (pobj)-[:ALL_CHANGELOG]-(clog…
MATCH (pt:ParticipantTable {tildaid: $pt_id})-[:PARTICIPANT_QUESTION|PARTICIPANT_DOC_UPLOAD]-(pobj) WHERE pobj.hdmClassId = $hdm_class_id AND (pobj.delpending IS NULL OR pobj.delpending <> true) OPTIONAL MATCH (pobj)-[:ALL_CHANGELOG]-(clog:ChangeLog) WHERE clog.type IN $changelog_types WITH pobj, count(clog) AS clogCount OPTIONAL MATCH (pobj)-[:HAS_QUERY]-(qr:Query) WHERE qr.delpending = false WITH pobj, clogCount, count(qr) AS queryCount OPTIONAL MATCH (pobj)-[:BELONGS_TO]-(doc:Document {archived: false}) OPTIONAL MATCH (doc)-[:TAIL_CHANGELOG]-(docCL:ChangeLog) OPTIONAL MATCH (doc)-[:HAS_QUERY]-(dq:Query) WHERE NOT dq.state IN [?] WITH DISTINCT pobj, clogCount, queryCount, doc, docCL, count(dq) AS docQueryCount WITH pobj, clogCount, queryCount, collect(DISTINCT CASE WHEN doc IS NOT NULL THEN { id: doc.tildaid, docKind: doc.docKind, versionNumber: doc.versionNumber, fileName: doc.fileName, uploadedBy: docCL.who, uploadedAt: docCL.createdat, size: doc.size, status: doc.status, pages: doc.pages, docType: doc.docTypeName, contentType: doc.contentType, queryCount: docQueryCount } END) AS documents OPTIONAL MATCH (q:QuestionV2 {tildaid: pobj.questionId}) OPTIONAL MATCH (q)-[:QUESTION_TO_QUESTION_SPEC]->(qs:QuestionSpec) OPTIONAL MATCH (qs)-[:QUESTION_SPEC_TO_RESPONSE_SET]->(rs:ResponseSet) RETURN pobj, clogCount, queryCount, documents, q, qs, rs
writeexportsvc
5
52 ms
425 ms
252 ms
flat
MATCH (pv:ParticipantVisit {tildaid: $id})-[:BELONGS_TO_VISIT]-(v:Visit|VisitV2) MATCH (pv)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(cp:CarePlan)-[:EXECUTE_SOA]->(soa:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION]->(pd:DslPlanDefinition)- [:…
MATCH (i:TMFSyncItem) WHERE i.status IN [?, ?] AND ( (i.direction = ? AND ( (i.status = ? AND i.next_retry_at IS NULL) OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) OR (i.direction = ? AND ( i.status = ? OR (i.status = ? A…
MATCH (i:TMFSyncItem) WHERE i.status IN [?, ?] AND ( (i.direction = ? AND ( (i.status = ? AND i.next_retry_at IS NULL) OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) OR (i.direction = ? AND ( i.status = ? OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) ) MATCH (j:TMFSyncJob {id: i.sync_job_id}) WHERE j.status IN [?, ?] AND coalesce(j.redrive_count, ?) < $max_redrives AND coalesce(j.lane, ?) <> ? AND coalesce(j.type, ?) <> ? RETURN DISTINCT j.id AS job_id, j.connector_type AS connector_type, j.direction AS direction LIMIT $limit
tmfsync
18
28 ms
365 ms
280 ms
flat
match (st:Study)-[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) WHERE st.tildaid=$studyId AND site.tildaid=$siteId optional match (pd)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(studySiteActor:StudySit…
match (st:Study)-[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) WHERE st.tildaid=$studyId AND site.tildaid=$siteId optional match (pd)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(studySiteActor:StudySiteActor)-[:STUDYSITEACTOR_TO_ACTOR]- (a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(role:Role) where role.name contains ? or role.name contains ? and u.status<>? and a.state = ? CALL { with st optional match (st)-[]-(:StudyPartnership{delpending:false,status:?,type:?})-[:FOR_PARTNER]-(clab:Partner{type:?}) return clab as lab union with site, st optional match (site)-[]-(:StudyPartnership{delpending:false,status:?,type:?,studyId:st.tildaid})-[:FOR_PARTNER]-(llab:Partner{type:?}) return llab as lab } CALL { with st optional match (st)-[]-(:StudyPartnership{delpending:false,status:?,type:?})-[:FOR_PARTNER]-(cirb:Partner{type:?}) return cirb as irb union with site, st optional match (site)-[]-(:StudyPartnership{delpending:false,status:?,type:?,studyId:st.tildaid})-[:FOR_PARTNER]-(lirb:Partner{type:?}) return lirb as irb } WITH distinct st, site, pd, u, COLLECT(role.name) AS rolesList, role, case when not lab is null then {name: lab.name, tildaid: lab.tildaid, suite: lab.suite, streetAddress: lab.streetAddress, city: lab.city, state: lab.state, country: lab.country, postalCode: lab.postalCode, created: lab.createdat} end as activeLab, case when not irb is null then {name: irb.name, tildaid: irb.tildaid, suite: irb.suite, streetAddress: irb.streetAddress, city: irb.city, state: irb.state, country: irb.country, postalCode: irb.postalCode, created: irb.createdat} end as activeIRB, case when not a is null then {name: u.name, id: u.tildaid, credentials: u.credentials, education: ?, startDate: a.startDate, endDate: a.endDate, role: role.name} end as investigator WITH distinct st, site, pd, u, rolesList, role, activeLab, activeIRB, investigator order by activeLab.created, activeIRB.created WITH distinct st.tildaid as studyId, site.tildaid as siteId, pd.tildaid as pdId, {name: st.name, description: st.description, phase: st.phase, protocolNumber: st.protocolnumber, protocolVersion: st.protocolversion} as studyInfo, {name: site.name, suite: site.suite, streetAddress: site.streetAddress, city: site.city, state: site.state, country: site.country, postalCode: site.postalCode} as sitePrimary, pd, COLLECT(distinct investigator) AS investigators, COLLECT(distinct activeLab) as labs, COLLECT(distinct activeIRB) as irbs RETURN distinct studyId, siteId, pdId, studyInfo, {primary: sitePrimary, siteNumber: pd.siteNumber} as siteInfo, investigators, labs, irbs
regsvc
9
46 ms
365 ms
406 ms
flat
MATCH (o:Organization {tildaid: $org_id})-[:STUDY_TO_ORG]-(study:Study {tildaid: $study_id}) -[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition) -[:SOA_TO_PLAN_DEFINITION]-(:ScheduleOfActivities) -[:EXECUTE_SOA]-(cp:CarePlan) WHERE coalesc…
MATCH (o:Organization {tildaid: $org_id})-[:STUDY_TO_ORG]-(study:Study {tildaid: $study_id}) -[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition) -[:SOA_TO_PLAN_DEFINITION]-(:ScheduleOfActivities) -[:EXECUTE_SOA]-(cp:CarePlan) WHERE coalesce(pd.deltimestamp, ?) = ? AND coalesce(cp.isDeleted, false) = false AND cp.status IN [?, ?, ?] AND ($site_id IS NULL OR (pd)-[:PLAN_DEFINITION_TO_SITE]-(:Site {tildaid: $site_id})) WITH DISTINCT cp CALL (cp) { MATCH (cp)-[:EXECUTE_SOA]-(:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION]-(pd2:DslPlanDefinition) -[:PLAN_DEFINITION_TO_SITE]-(s:Site) RETURN s.tildaid AS site_id ORDER BY site_id LIMIT ? } RETURN cp.tildaid AS careplan_id, coalesce(cp.subjectid, ?) AS subject_number, site_id ORDER BY careplan_id
data_monitor
9
27 ms
365 ms
233 ms
flat
MATCH (ph: Document {tildaid: $id}) MATCH (e: Event) - [:PART_OF_EVENT] - (es: EventScope) - [:APPLICABLE_TO] - (del: Deliverable) - [:TRACKS_PLACEHOLDER] - (ph) MATCH (ph) - [:SCOPED_TO] - (es) OPTIONAL MATCH (ph)-[:ACCEPTED_DOCUMENT]->(a…
MATCH (ph: Document {tildaid: $id}) MATCH (e: Event) - [:PART_OF_EVENT] - (es: EventScope) - [:APPLICABLE_TO] - (del: Deliverable) - [:TRACKS_PLACEHOLDER] - (ph) MATCH (ph) - [:SCOPED_TO] - (es) OPTIONAL MATCH (ph)-[:ACCEPTED_DOCUMENT]->(acceptedDoc:Document) WITH ph, e, es, del, acceptedDoc, coalesce(acceptedDoc, ph) AS d OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) OPTIONAL MATCH (siteFromEvent: Site{tildaid: es.scopeId}) WHERE es.scopeType = ? OPTIONAL MATCH (d)-[:DOC_TO_ORG]->(o:Organization) OPTIONAL MATCH (d)-[:DOCUMENT_TO_SOURCE]->(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(da:DocAttribute) where da.key in [?, ?, ?, ?] OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (uploader: User) OPTIONAL MATCH (study) - [:STUDY_TO_ACTOR] - (actor: Actor{userId: uploader.tildaid}) WITH d, e, es, del, b, study, b2, coalesce(site, siteFromEvent) AS site, o, head(collect(da)) as da, currentFolder, currentSubArtifact, stagingInfo, artifact, section, zone, collection, subArtifact, uploader, ph, acceptedDoc, head(collect(actor)) as actor CALL apoc.create.vNode([?], { tildaid: ph.tildaid, createdat: ph.createdat, updatedat: ph.updatedat, documentId: acceptedDoc.tildaid, documentCreatedAt: acceptedDoc.createdat, documentUpdatedAt: acceptedDoc.updatedat, orgName: o.name, orgId: o.tildaid, orgAlias: o.alias, studyName: study.name, studyId: study.tildaid, siteName: site.name, siteId: site.tildaid, documentStatus: d.status, country: CASE WHEN es.scopeType = ? THEN coalesce(es.scopeId, d.country) ELSE d.country END, languages: coalesce(apoc.convert.toJson(d.languages), ?), fileName: d.fileName, uploadedByName: uploader.name, uploadedById: uploader.tildaid, collection: d.collection, stateTag: d.stateTag, documentExpiryDate: da.value, zone: zone.name, zoneId: zone.tildaid, zoneNumber: case when zone.number is null then null else apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) end, section: section.name, sectionId: section.tildaid, sectionNumber: case when section.number is null then null else apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) end, artifact: artifact.name, artifactId: artifact.tildaid, artifactNumber: case when artifact.number is null then null else apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?) end, subArtifact: subArtifact.name, subArtifactId: subArtifact.tildaid, subArtifactNumber: case when subArtifact.number is null then null else apoc.text.lpad(toString(COALESCE(subArtifact.number, ?)), ?, ?) end, eventId: e.tildaid, eventCreatedAt: e.createdat, eventType: e.type, eventName: e.name, eventStatus: e.status, eventScopeId: es.tildaid, eventScopeName: es.name, scopeType: es.scopeType, eventScopeDecision: es.decision, deliverableId: del.tildaid, deliverableName: del.name, deliverableLocationId: del.locationId, deliverableLocationType: del.locationType, deliverableType: del.type, roles: actor.roles }) YIELD node return node
writedashrsvc
20
23 ms
350 ms
211 ms
flat
MATCH (wo:WorkOrder {tildaid: $id}) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_ORGANIZATION]->(org:Organization) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_STUDY]->(study:Study) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_SITE]->(site:Site) // Parent WorkOrderC…
MATCH (wo:WorkOrder {tildaid: $id}) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_ORGANIZATION]->(org:Organization) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_STUDY]->(study:Study) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_SITE]->(site:Site) // Parent WorkOrderConfig (WorkOrder.parent_id -> WorkOrderConfig). Null for standalone WOs. // Carries the ENG-? ? timing, denormalized onto each child WO below. OPTIONAL MATCH (cfg:WorkOrderConfig {tildaid: wo.parent_id}) // Template lineage via the same config. Null for ad-hoc configs (no template). OPTIONAL MATCH (cfg)-[:WORK_ORDER_CONFIG_TO_TEMPLATE]->(tmpl:WorkOrderTemplate) CALL apoc.create.vNode([?], { tildaid: wo.tildaid, workOrderId: wo.work_order_id, workOrderType: wo.work_order_type, title: wo.title, status: wo.status, priority: wo.priority, goal: wo.goal, emailSubject: wo.email_subject, summary: wo.summary, forms: wo.forms, creatorId: wo.creator_id, assignedToId: wo.assigned_to_id, resolvedBy: wo.resolved_by, parentId: wo.parent_id, eventId: wo.event_id, templateId: tmpl.tildaid, templateName: tmpl.title, threadId: wo.thread_id, rfcMsgId: wo.rfc_msgid, createdat: wo.createdat, updatedat: wo.updatedat, lastReachout: wo.last_reachout, lastResponse: wo.last_response, dueDate: wo.due_date, resolvedAt: wo.resolved_at, statusUpdatedAt: wo.status_updated_at, activatedAt: wo.activated_at, // ENG-? ? timing, denormalized from the parent WorkOrderConfig (cfg). // configActivatedAt is distinct from activatedAt above (the child WO?t trip Neo4j?RECEIVED?RECEIVED?Received?Accepted?SENT?RECEIVED?RECEIVED' | wd]), contactList: wo.contact_list, ccList: wo.cc_list, delpending: wo.delpending, deltimestamp: wo.deltimestamp, holdbitmap: wo.holdbitmap, orgId: coalesce(org.tildaid, wo.org_id), orgName: org.name, orgAlias: org.alias, studyId: coalesce(study.tildaid, wo.study_id), studyName: study.name, siteId: coalesce(site.tildaid, wo.site_id), siteName: site.name } ) YIELD node RETURN node
writedashrsvc
10
27 ms
350 ms
262 ms
flat
match (st:Study)-[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) WHERE st.tildaid=$studyId AND site.tildaid=$siteId optional match (pd)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(studySiteActor:StudySit…
match (st:Study)-[:PLAN_DEFINITION_TO_STUDY]-(pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) WHERE st.tildaid=$studyId AND site.tildaid=$siteId optional match (pd)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]-(studySiteActor:StudySiteActor)-[:STUDYSITEACTOR_TO_ACTOR]- (a:Actor{delpending:false})-[:FOR_USER]-(u:User), (a)-[:APPOINTED_AS]-(role:Role) where role.name contains ? or role.name contains ? and u.status<>? and a.state = ? CALL { with st optional match (st)-[]-(:StudyPartnership{delpending:false,status:?,type:?})-[:FOR_PARTNER]-(clab:Partner{type:?}) return clab as lab union with site, st optional match (site)-[]-(:StudyPartnership{delpending:false,status:?,type:?,studyId:st.tildaid})-[:FOR_PARTNER]-(llab:Partner{type:?}) return llab as lab } CALL { with st optional match (st)-[]-(:StudyPartnership{delpending:false,status:?,type:?})-[:FOR_PARTNER]-(cirb:Partner{type:?}) return cirb as irb union with site, st optional match (site)-[]-(:StudyPartnership{delpending:false,status:?,type:?,studyId:st.tildaid})-[:FOR_PARTNER]-(lirb:Partner{type:?}) return lirb as irb } WITH distinct st, site, pd, u, COLLECT(role.name) AS rolesList, role, case when not lab is null then {name: lab.name, tildaid: lab.tildaid, suite: lab.suite, streetAddress: lab.streetAddress, city: lab.city, state: lab.state, country: lab.country, postalCode: lab.postalCode, created: lab.createdat} end as activeLab, case when not irb is null then {name: irb.name, tildaid: irb.tildaid, suite: irb.suite, streetAddress: irb.streetAddress, city: irb.city, state: irb.state, country: irb.country, postalCode: irb.postalCode, created: irb.createdat} end as activeIRB, case when not a is null then {name: u.name, id: u.tildaid, credentials: u.credentials, education: ?, startDate: a.startDate, endDate: a.endDate, role: role.name} end as investigator WITH distinct st, site, pd, u, rolesList, role, activeLab, activeIRB, investigator order by activeLab.created, activeIRB.created WITH distinct st.tildaid as studyId, site.tildaid as siteId, pd.tildaid as pdId, {name: st.name, description: st.description, phase: st.phase, protocolNumber: st.protocolnumber, protocolVersion: st.protocolversion} as studyInfo, {name: site.name, suite: site.suite, streetAddress: site.streetAddress, city: site.city, state: site.state, country: site.country, postalCode: site.postalCode} as sitePrimary, pd, COLLECT(distinct investigator) AS investigators, COLLECT(distinct activeLab) as labs, COLLECT(distinct activeIRB) as irbs RETURN distinct studyId, siteId, pdId, studyInfo, {primary: sitePrimary, siteNumber: pd.siteNumber} as siteInfo, investigators, labs, irbs
regsvc
10
36 ms
350 ms
342 ms
flat
MATCH (i:TMFSyncItem) WHERE i.status IN [?, ?] AND ( (i.direction = ? AND ( (i.status = ? AND i.next_retry_at IS NULL) OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) OR (i.direction = ? AND ( i.status = ? OR (i.status = ? A…
MATCH (i:TMFSyncItem) WHERE i.status IN [?, ?] AND ( (i.direction = ? AND ( (i.status = ? AND i.next_retry_at IS NULL) OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) OR (i.direction = ? AND ( i.status = ? OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) ) MATCH (j:TMFSyncJob {id: i.sync_job_id}) WHERE j.status IN [?, ?] AND coalesce(j.redrive_count, ?) >= $max_redrives RETURN j.direction AS direction, count(DISTINCT j.id) AS n
tmfsync
10
36 ms
350 ms
349 ms
flat
MATCH (i:TMFSyncItem) WHERE i.status IN [?, ?] AND ( (i.direction = ? AND ( (i.status = ? AND i.next_retry_at IS NULL) OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) OR (i.direction = ? AND ( i.status = ? OR (i.status = ? A…
MATCH (i:TMFSyncItem) WHERE i.status IN [?, ?] AND ( (i.direction = ? AND ( (i.status = ? AND i.next_retry_at IS NULL) OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) OR (i.direction = ? AND ( i.status = ? OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) ) MATCH (j:TMFSyncJob {id: i.sync_job_id}) WHERE j.status IN [?, ?] AND coalesce(j.redrive_count, ?) < $max_redrives AND coalesce(j.lane, ?) <> ? AND coalesce(j.type, ?) <> ? RETURN DISTINCT j.id AS job_id, j.connector_type AS connector_type, j.direction AS direction LIMIT $limit
tmfsync
10
37 ms
350 ms
360 ms
flat
MATCH (d:Document {tildaid: $id}) MATCH (r:Recommendation)-[:RECOMMENDATION_TO_DOCUMENT]->(d) WHERE NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO_ORGANIZATION]->(o:Organization)…
MATCH (d:Document {tildaid: $id}) MATCH (r:Recommendation)-[:RECOMMENDATION_TO_DOCUMENT]->(d) WHERE NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO_ORGANIZATION]->(o:Organization) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (u: User) OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) OPTIONAL MATCH (dv:DocumentVersion{tildaid: d.primaryVersionId}) OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) CALL { WITH d, site OPTIONAL MATCH (study:Study{tildaid: d.studyId})<-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition{delpending:false, type:?})-[:PLAN_DEFINITION_TO_SITE]->(site) RETURN COALESCE(pd.siteNumber, ?) AS siteNumber } CALL { WITH dv OPTIONAL MATCH (dv)<-[:DOCUMENT_SOURCE_TO_VERSION]-(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(docAttr: DocAttribute) WITH collect([coalesce(docAttr.key, ?), coalesce(docAttr.value, ?)]) AS attributePairs WITH apoc.map.fromPairs(attributePairs) AS attributesMap WITH apoc.convert.toJson(attributesMap) AS attributesJson RETURN attributesJson } // Latest state-change ChangeLog on the version — gives us the user // who triggered the doc into its current state. Merge both event // types (Staging + StateTag) since the BE treats them as the same // documentState concept (mirrors the Python migration script). CALL { WITH dv OPTIONAL MATCH (dv)-[:ALL_CHANGELOG]-(dvcl:ChangeLog) WHERE dvcl.type IN [?, ?, ?] AND (dvcl.newValue CONTAINS ? OR dvcl.newValue CONTAINS ?) WITH dvcl ORDER BY dvcl.createdat DESC LIMIT ? OPTIONAL MATCH (changer:User {tildaid: dvcl.changedBy}) WHERE dvcl IS NOT NULL RETURN coalesce(dvcl.changedBy, ?) as statePromotedBy, coalesce(changer.name, ?) as statePromotedByName } WITH r, ai, o, d, dv, zone, section, artifact, subArtifact, u, study, site, siteNumber, attributesJson, statePromotedBy, statePromotedByName, // Document Scope key stripping: reduce the rec JSON envelope to the keys // valid for its OWN scope so irrelevant keys (e.g. country on a site rec) // don?scope?country?scope?siteName?siteId?siteNumber?scope?scope???{}?{}?????{}?{?{?{????DRecommendation????s ORIGINAL prediction (orig_data). // Same Document Scope extraction so this column lines up with // recommendedValue / actualValue. originalRecommendation: coalesce(r.orig_data, ?), recommendationCount: CASE r.category WHEN ? THEN size(keys(apoc.map.clean( apoc.convert.fromJsonMap(coalesce(r.data_formatted, ?)), [], [?]))) WHEN ? THEN apoc.coll.max([?, size([k IN keys(recMap) WHERE (recAllowed IS NULL OR k IN recAllowed) AND coalesce(toString(recMap[k]), ?) <> ?])]) ELSE ? END, actualValue: CASE r.category WHEN ? THEN coalesce(d.fileName, ?) WHEN ? THEN apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?) + ? + coalesce(artifact.name, ?) WHEN ? THEN coalesce(subArtifact.name, ?) WHEN ? THEN apoc.convert.toJson( CASE toLower(coalesce(d.tmfLevel, ?)) WHEN ? THEN {scope: toLower(coalesce(d.tmfLevel, ?)), country: coalesce(d.country, ?)} WHEN ? THEN {scope: toLower(coalesce(d.tmfLevel, ?)), siteId: coalesce(site.tildaid, ?), siteName: coalesce(site.name, ?), siteNumber: siteNumber} ELSE {scope: toLower(coalesce(d.tmfLevel, ?))} END) WHEN ? THEN attributesJson ELSE ? END, // accuracyCount: for Document Metadata, the number of keys whose // recommended value matches the actual value (?–N out of // recommendationCount). For all other categories, ? or ? (mirrors // ? or ? for other categories. NULL when not yet actioned. accuracyCount: CASE r.category WHEN ? THEN size([k IN keys(apoc.map.clean(apoc.convert.fromJsonMap(coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?)), [], [?])) WHERE apoc.map.clean(apoc.convert.fromJsonMap(coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?)), [], [?])[k] = apoc.map.clean(apoc.convert.fromJsonMap(coalesce(attributesJson, ?)), [], [?])[k]]) WHEN ? THEN size([k IN keys(cmpMap) WHERE (cmpAllowed IS NULL OR k IN cmpAllowed) AND coalesce(toString(cmpMap[k]), ?) <> ? AND toLower(coalesce(toString(cmpMap[k]), ?)) = toLower(coalesce(toString((CASE toLower(coalesce(d.tmfLevel, ?)) WHEN ? THEN {scope: toLower(coalesce(d.tmfLevel, ?)), country: coalesce(d.country, ?)} WHEN ? THEN {scope: toLower(coalesce(d.tmfLevel, ?)), siteId: coalesce(site.tildaid, ?), siteName: coalesce(site.name, ?), siteNumber: siteNumber} ELSE {scope: toLower(coalesce(d.tmfLevel, ?))} END)[k]), ?))]) ELSE CASE (CASE r.category WHEN ? THEN coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?) = coalesce(d.fileName, ?) WHEN ? THEN coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?) = ( apoc.text.lpad(toString(COALESCE(zone.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(section.number, ?)), ?, ?) + ? + apoc.text.lpad(toString(COALESCE(artifact.number, ?)), ?, ?) + ? + coalesce(artifact.name, ?)) WHEN ? THEN coalesce( CASE WHEN coalesce(r.orig_data,?) <> ? THEN r.orig_data END, CASE WHEN coalesce(r.data_formatted,?) <> ? THEN r.data_formatted END, r.data, ?) = coalesce(subArtifact.name, ?) ELSE CASE WHEN r.category IN [?, ?, ?, ?] THEN r.user_action = ? OR (r.user_action = ? AND coalesce(r.comment, ?) = ?) END END) WHEN true THEN ? WHEN false THEN ? ELSE null END END, comment: r.comment, statePromotedBy: statePromotedBy, statePromotedByName: statePromotedByName } ) YIELD node RETURN node
writedashrsvc
11
30 ms
335 ms
320 ms
flat
MATCH (a:Recommendation {tildaid: $from_id}) MATCH (b:Organization {tildaid: $to_id}) CREATE (a)-[r:RECOMMENDATION_TO_ORGANIZATION]->(b) SET r = $properties, r.createdat = timestamp() RETURN r
MATCH (a:Recommendation {tildaid: $from_id}) MATCH (b:Organization {tildaid: $to_id}) CREATE (a)-[r:RECOMMENDATION_TO_ORGANIZATION]->(b) SET r = $properties, r.createdat = timestamp() RETURN r
writedocproc
24
38 ms
320 ms
450 ms
flat
MATCH (i:TMFSyncItem) WHERE i.status IN [?, ?] AND ( (i.direction = ? AND ( (i.status = ? AND i.next_retry_at IS NULL) OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) OR (i.direction = ? AND ( i.status = ? OR (i.status = ? A…
MATCH (i:TMFSyncItem) WHERE i.status IN [?, ?] AND ( (i.direction = ? AND ( (i.status = ? AND i.next_retry_at IS NULL) OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) OR (i.direction = ? AND ( i.status = ? OR (i.status = ? AND i.updated_at < $now_ms - $stuck_age_ms))) ) MATCH (j:TMFSyncJob {id: i.sync_job_id}) WHERE j.status IN [?, ?] AND coalesce(j.redrive_count, ?) < $max_redrives AND coalesce(j.lane, ?) <> ? AND coalesce(j.type, ?) <> ? RETURN DISTINCT j.id AS job_id, j.connector_type AS connector_type, j.direction AS direction LIMIT $limit
tmfsync
26
19 ms
305 ms
258 ms
flat
MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] …
MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] AND ptc.status <> ? RETURN DISTINCT t.tildaid UNION MATCH (t:Task)-[:CREATED_FROM_SPEC]-(ptc:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(ptl:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(pc:ParticipantControl)-[:PARTICIPANT_CONTROL]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]->(pw:ParticipantWorkflow) WHERE t.state IN [?, ?] AND ptc.status <> ? RETURN DISTINCT t.tildaid UNION match (t:Task)-[:CREATED_FROM_SPEC]-(ptd:ParticipantTodo)-[:PARTICIPANT_TODO]-(pc:ParticipantControl)-[:PARTICIPANT_CONTROL]-(pa:ParticipantActivity)-[:PARTICIPANT_ACTIVITY]-(pw:ParticipantWorkflow) where t.state in [?, ?] and ptd.status <> ? return distinct t.tildaid
regsvc
14
19 ms
290 ms
250 ms
flat
MATCH(lead:Lead {tildaid: $id}) MATCH (lead)-[:LEAD_TO_STUDY]-(study:Study) match (lead)-[:LEAD_TO_PATIENT]->(patient:Patient) MATCH(org:Organization) WHERE org.tildaid=study.srcorgid OPTIONAL MATCH (study)-[:PLAN_DEFINITION_TO_STUDY]-(dsl…
MATCH(lead:Lead {tildaid: $id}) MATCH (lead)-[:LEAD_TO_STUDY]-(study:Study) match (lead)-[:LEAD_TO_PATIENT]->(patient:Patient) MATCH(org:Organization) WHERE org.tildaid=study.srcorgid OPTIONAL MATCH (study)-[:PLAN_DEFINITION_TO_STUDY]-(dsl:DslPlanDefinition)-[:SOA_TO_PLAN_DEFINITION]-(:ScheduleOfActivities)-[:EXECUTE_SOA]-(:CarePlan)-[:RESEARCH_SUBJECT]-(patient) OPTIONAL MATCH (dsl)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) OPTIONAL MATCH (lead)-[:LEAD_TO_ADVOCATE]-(adv:Advocate)-[:ADV_TO_PORTAL_ORG]-(advOrg:AdvOrg) OPTIONAL MATCH (user:User{tildaid: adv.userid}) OPTIONAL MATCH (recruiterOrg:Organization{tildaid: adv.orgid}) CALL apoc.create.vNode([?], { studyName: study.name, orgId: org.tildaid, orgName: org.name, orgAlias: org.alias, siteId: site.tildaid, siteName: site.name, createdat: lead.createdat, updatedat: lead.updatedat, sourceType: lead.sourcetype, status: lead.status, leadId: lead.tildaid, patientId: lead.patientid, studyId: lead.studyid, recruiterOrg: recruiterOrg.name, recruiter: user.name, sex: patient.sex, ethnicity: patient.ethnicity } ) YIELD node RETURN node
writedashrsvc
15
17 ms
275 ms
243 ms
flat
MATCH (pv:ParticipantVisit {tildaid: $id})-[:BELONGS_TO_VISIT]-(v:Visit|VisitV2) MATCH (pv)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(cp:CarePlan)-[:EXECUTE_SOA]->(soa:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION]->(pd:DslPlanDefinition)- [:…
MATCH (pv:ParticipantVisit {tildaid: $id})-[:BELONGS_TO_VISIT]-(v:Visit|VisitV2) MATCH (pv)-[:CAREPLAN_TO_ALL_PARTICIPANTVISITS]-(cp:CarePlan)-[:EXECUTE_SOA]->(soa:ScheduleOfActivities)-[:SOA_TO_PLAN_DEFINITION]->(pd:DslPlanDefinition)- [:PLAN_DEFINITION_TO_STUDY]-(s:Study) OPTIONAL MATCH (pd)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) OPTIONAL MATCH (site)-[:SITE_TO_SMO]-(:Smo)-[:IS_AN_ORG]-(org:Organization) OPTIONAL MATCH (pv)-[:BELONGS_TO_PARTICIPANT_VISIT]-(va:VisitAppointment)-[]-(:Site) OPTIONAL MATCH (cp)-[:RESEARCH_SUBJECT]-(p:Patient) WITH pv, v, cp, soa, pd, s, site, org, p, va ORDER BY va.createdat DESC WITH pv, v, cp, soa, pd, s, site, org, p, head(collect(DISTINCT {isManual: va.isManual})) as apptData CALL apoc.create.vNode([?], { siteId: coalesce(site.tildaid, ?), siteName: coalesce(site.name, ?), studyId: s.tildaid, studyName: s.name, orgId: coalesce(org.tildaid, ?), orgName: coalesce(org.name, ?), orgAlias: coalesce(org.alias, ?), createdat: pv.createdat, updatedat: pv.updatedat, branchLevel: pv.branchLevel, pre: pv.pre, migrationReady: pv.migrationReady, carePlanStatus: cp.status, sex: p.sex, ethnicity: p.ethnicity, isManual: coalesce(apptData.isManual, false) } ) YIELD node return node
writedashrsvc
15
32 ms
275 ms
460 ms
flat
MATCH(lead:Lead {tildaid: $id}) MATCH (lead)-[:LEAD_TO_STUDY]-(study:Study) match (lead)-[:LEAD_TO_PATIENT]->(patient:Patient) MATCH(org:Organization) WHERE org.tildaid=study.srcorgid OPTIONAL MATCH (study)-[:PLAN_DEFINITION_TO_STUDY]-(dsl…
MATCH(lead:Lead {tildaid: $id}) MATCH (lead)-[:LEAD_TO_STUDY]-(study:Study) match (lead)-[:LEAD_TO_PATIENT]->(patient:Patient) MATCH(org:Organization) WHERE org.tildaid=study.srcorgid OPTIONAL MATCH (study)-[:PLAN_DEFINITION_TO_STUDY]-(dsl:DslPlanDefinition)-[:SOA_TO_PLAN_DEFINITION]-(:ScheduleOfActivities)-[:EXECUTE_SOA]-(:CarePlan)-[:RESEARCH_SUBJECT]-(patient) OPTIONAL MATCH (dsl)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) OPTIONAL MATCH (lead)-[:LEAD_TO_ADVOCATE]-(adv:Advocate)-[:ADV_TO_PORTAL_ORG]-(advOrg:AdvOrg) OPTIONAL MATCH (user:User{tildaid: adv.userid}) OPTIONAL MATCH (recruiterOrg:Organization{tildaid: adv.orgid}) CALL apoc.create.vNode([?], { studyName: study.name, orgId: org.tildaid, orgName: org.name, orgAlias: org.alias, siteId: site.tildaid, siteName: site.name, createdat: lead.createdat, updatedat: lead.updatedat, sourceType: lead.sourcetype, status: lead.status, leadId: lead.tildaid, patientId: lead.patientid, studyId: lead.studyid, recruiterOrg: recruiterOrg.name, recruiter: user.name, sex: patient.sex, ethnicity: patient.ethnicity } ) YIELD node RETURN node
writedashrsvc
17
14 ms
245 ms
215 ms
flat
MATCH (wo:WorkOrder {tildaid: $id}) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_ORGANIZATION]->(org:Organization) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_STUDY]->(study:Study) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_SITE]->(site:Site) // Parent WorkOrderC…
MATCH (wo:WorkOrder {tildaid: $id}) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_ORGANIZATION]->(org:Organization) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_STUDY]->(study:Study) OPTIONAL MATCH (wo)-[:WORK_ORDER_TO_SITE]->(site:Site) // Parent WorkOrderConfig (WorkOrder.parent_id -> WorkOrderConfig). Null for standalone WOs. // Carries the ENG-? ? timing, denormalized onto each child WO below. OPTIONAL MATCH (cfg:WorkOrderConfig {tildaid: wo.parent_id}) // Template lineage via the same config. Null for ad-hoc configs (no template). OPTIONAL MATCH (cfg)-[:WORK_ORDER_CONFIG_TO_TEMPLATE]->(tmpl:WorkOrderTemplate) CALL apoc.create.vNode([?], { tildaid: wo.tildaid, workOrderId: wo.work_order_id, workOrderType: wo.work_order_type, title: wo.title, status: wo.status, priority: wo.priority, goal: wo.goal, emailSubject: wo.email_subject, summary: wo.summary, forms: wo.forms, creatorId: wo.creator_id, assignedToId: wo.assigned_to_id, resolvedBy: wo.resolved_by, parentId: wo.parent_id, eventId: wo.event_id, templateId: tmpl.tildaid, templateName: tmpl.title, threadId: wo.thread_id, rfcMsgId: wo.rfc_msgid, createdat: wo.createdat, updatedat: wo.updatedat, lastReachout: wo.last_reachout, lastResponse: wo.last_response, dueDate: wo.due_date, resolvedAt: wo.resolved_at, statusUpdatedAt: wo.status_updated_at, activatedAt: wo.activated_at, // ENG-? ? timing, denormalized from the parent WorkOrderConfig (cfg). // configActivatedAt is distinct from activatedAt above (the child WO?t trip Neo4j?RECEIVED?RECEIVED?Received?Accepted?SENT?RECEIVED?RECEIVED' | wd]), contactList: wo.contact_list, ccList: wo.cc_list, delpending: wo.delpending, deltimestamp: wo.deltimestamp, holdbitmap: wo.holdbitmap, orgId: coalesce(org.tildaid, wo.org_id), orgName: org.name, orgAlias: org.alias, studyId: coalesce(study.tildaid, wo.study_id), studyName: study.name, siteId: coalesce(site.tildaid, wo.site_id), siteName: site.name } ) YIELD node RETURN node
writedashrsvc
17
13 ms
245 ms
205 ms
flat
MATCH (st:Study {tildaid: $study_id})-[:STUDY_TO_ACTOR]-> (a:Actor)-[:STUDYSITEACTOR_TO_ACTOR]-(ssa:StudySiteActor)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]- (site:Site) WHERE pd.siteNumber = …
MATCH (st:Study {tildaid: $study_id})-[:STUDY_TO_ACTOR]-> (a:Actor)-[:STUDYSITEACTOR_TO_ACTOR]-(ssa:StudySiteActor)-[:STUDYSITEACTOR_TO_PLAN_DEFINITION]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]- (site:Site) WHERE pd.siteNumber = $site_id AND site.tildaid IS NOT NULL AND pd.delpending = false AND ssa.delpending = false AND site.delpending = false AND a.orgId = site.orgId MATCH (a)-[:FOR_USER]->(u:User) WHERE u.status <> ? AND (a.state IS NULL OR a.state <> ?) WITH st, site, u, collect({roles: coalesce(ssa.roles, []), ends: coalesce(ssa.endDates, [])}) AS assignments, head([n IN collect(trim(coalesce(a.actorName, ?))) WHERE n <> ?]) AS actorName, head(collect(coalesce(a.state, ?))) AS state, head(collect(a.tildaid)) AS actorId, min(ssa.createdat) AS addedAt OPTIONAL MATCH (site)-[:STAFF_TO_ACTOR]->(siteActor:Actor)-[:FOR_USER]->(u) WHERE coalesce(siteActor.delpending, false) = false AND trim(coalesce(siteActor.actorName, ?)) <> ? WITH st, u, assignments, actorName, state, actorId, addedAt, head(collect(DISTINCT trim(siteActor.actorName))) AS siteActorName CALL (st, u) { OPTIONAL MATCH (co:ClinOp {deltimestamp: ?})-[:FOR_USER]->(u) WHERE trim(coalesce(co.actorName, ?)) <> ? AND EXISTS { (st)-[:STUDY_TO_ORG]-(:Organization {tildaid: co.orgId}) } WITH co ORDER BY co.createdat RETURN head(collect(trim(co.actorName))) AS clinopName } RETURN u.tildaid AS userId, CASE WHEN trim(coalesce(clinopName, ?)) <> ? THEN trim(clinopName) WHEN trim(coalesce(u.name, ?)) <> ? THEN trim(u.name) WHEN trim(coalesce(u.fullname, ?)) <> ? THEN trim(u.fullname) WHEN trim(coalesce(actorName, ?)) <> ? THEN trim(actorName) WHEN trim(coalesce(siteActorName, ?)) <> ? THEN trim(siteActorName) ELSE ? END AS userName, COALESCE(u.email, ?) AS userEmail, u.contact AS userContact, state, actorId, addedAt, assignments ORDER BY userName
virtual-assistant
18
14 ms
230 ms
224 ms
flat
call { match (task:Task{assignment:?}) where (task.state = ? or task.state = ?) and not exists ((task)-[:BELONGS_TO]-(:Inbox{type:?})) and coalesce(task.dist_next_retry_at <= datetime(), coalesce(task.dist_deferred, false) = false) return …
call { match (task:Task{assignment:?}) where (task.state = ? or task.state = ?) and not exists ((task)-[:BELONGS_TO]-(:Inbox{type:?})) and coalesce(task.dist_next_retry_at <= datetime(), coalesce(task.dist_deferred, false) = false) return task } with task where not exists ( (task)-[:CREATED_FROM_SPEC]-(:ParticipantTaskConfig)-[:PARTICIPANT_TASKCONFIG]-(:ParticipantTaskList)-[:PARTICIPANT_TASKLIST]-(:ParticipantControl) ) and not exists ( (task)<-[:CREATED_FROM_SPEC]-(:ParticipantDslSpecNode)<-[:PARTICIPANT_DSLTASK_TO_ALL_PARTICIPANT_DSLSPECNODE]-(:ParticipantDslTask)<-[:PARTICIPANT_DSLTASK]-(:ParticipantControl) ) match (task)-[:WITH_CONTEXT]->() optional match (task)-[:BELONGS_TO]->(userinbox:Inbox{type:?})-[:OWNED_BY]->(user:User) optional match (user)-[:USER_TO_PATIENT]-(patient:Patient) optional match (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(org:Organization) optional match (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(study:Study) optional match (task)-[:BELONGS_TO]->(:Inbox{type:?})-[:MANAGED_BY]->(site:Site) return distinct task, userinbox, org, study.name, site.name, patient.tildaid skip $skip limit $limit
tusker
19
22 ms
215 ms
381 ms
flat
MATCH (:Folder {tildaid: $folderId})-[:INCLUDES]->(d:Document) WHERE d.tildaid > $after AND d.collection = ? AND NOT (coalesce(d.archived, false) OR coalesce(d.deltimestamp, ?) > ? OR coalesce(d.stateTag, ?) = ?) AND (size(coalesce(d.needs…
MATCH (:Folder {tildaid: $folderId})-[:INCLUDES]->(d:Document) WHERE d.tildaid > $after AND d.collection = ? AND NOT (coalesce(d.archived, false) OR coalesce(d.deltimestamp, ?) > ? OR coalesce(d.stateTag, ?) = ?) AND (size(coalesce(d.needsAttentionReasons, [])) > ? OR d.stateTag IN [?, ?]) WITH d ORDER BY d.tildaid LIMIT $limit RETURN d.tildaid AS id, [(d)<-[:INCLUDES]-(:Binder)-[:BINDER_FOR]->(st:Study) | st.tildaid] AS studyIds
feedsvc
1
115 ms
195 ms
115 ms
flat
MATCH (f:ConfigFinding) WHERE f.studyId = $studyId AND f.dedupeKey > $after AND (f.status = ? OR coalesce(f.resolvedAt, ?) > $resolvedSince) WITH f ORDER BY f.dedupeKey LIMIT $limit OPTIONAL MATCH (s:Site {tildaid: f.siteId}) OPTIONAL MATC…
MATCH (f:ConfigFinding) WHERE f.studyId = $studyId AND f.dedupeKey > $after AND (f.status = ? OR coalesce(f.resolvedAt, ?) > $resolvedSince) WITH f ORDER BY f.dedupeKey LIMIT $limit OPTIONAL MATCH (s:Site {tildaid: f.siteId}) OPTIONAL MATCH (siteOrg:Organization {tildaid: s.orgId}) OPTIONAL MATCH (d:Document {tildaid: f.sourceDocId}) OPTIONAL MATCH (d)-[:DOC_TO_ORG]->(docOrg:Organization) WITH f, s, siteOrg, d, head(collect(docOrg.alias)) AS docOrgAlias RETURN f.dedupeKey AS cursor, f.findingId AS id, f.status AS status, coalesce(f.siteId, ?) AS siteId, coalesce(s.name, ?) AS siteName, coalesce(docOrgAlias, siteOrg.alias) AS orgAlias, coalesce(d.fileName, ?) AS fileName, coalesce(f.sourceKind, ?) AS sourceKind, coalesce(f.sourceDocId, ?) AS docId, coalesce(f.entityId, ?) AS entityId, coalesce(f.changes, ?) CONTAINS ? AS conflict, f.createdAt AS createdAt, coalesce(f.changes, ?) AS changes, coalesce(f.title, ?) AS title, coalesce(f.subtitle, ?) AS subtitle, head([(f)-[r:FOUND_IN]->(:Document) | coalesce(r.pages, [])]) AS pages
feedsvc
1
165 ms
195 ms
165 ms
flat
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=OrganizationSMO policies=lead-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANIZ…
MATCH (u:User {tildaid:$user}) OPTIONAL MATCH (o:Organization {alias:$org}) UNWIND $lists.checks AS c CALL { WITH u, o, c // scope=OrganizationSMO policies=lead-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role), (o)-[:ORGANIZATION_TO_ACTOR]->(a) WHERE a.state <> ? AND a.delpending = false AND x.name IN $lists.roles_0 WITH * WHERE o.orgType = ? RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, null AS Study, null AS Site, null AS Patient UNION WITH u, o, c // scope=Study policies=study-lead-edit MATCH (u)<-[:FOR_USER]-(a:Actor)-[:APPOINTED_AS]->(x:Role) WHERE a.state <> ? AND a.delpending = false AND o.tildaid = a.orgId AND x.name IN $lists.roles_1 WITH DISTINCT u, o, a, c MATCH (a)<-[:STUDY_TO_ACTOR]-(st:Study) WHERE EXISTS { (st)-[:STUDY_TO_ORG]->(o) } AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient UNION WITH u, o, c // scope=Study policies=study-lead-edit MATCH (u)<-[:FOR_USER]-(da:Actor)<-[:STUDY_TO_DELEGATED_ACTOR]-(st:Study)-[:STUDY_TO_ORG]->(o), (da)-[:APPOINTED_AS]->(x:Role)<-[:APPOINTED_AS]-(sa:Actor), (da)-[:DELEGATED_FROM]->(sa)<-[:ORGANIZATION_TO_ACTOR]-(:Organization {alias:$tildaScaleAlias}) WHERE st.srcorgid = o.tildaid AND da.state <> ? AND da.delpending = false AND sa.state <> ? AND sa.delpending = false AND x.name IN $lists.roles_2 AND ? IN apoc.text.split(coalesce(x.tags, ?), ?) AND ( size(c.studyIds) = ? OR st.tildaid IN c.studyIds ) RETURN DISTINCT c.idx AS checkIdx, u AS User, o AS Organization, st AS Study, null AS Site, null AS Patient } RETURN checkIdx, User, Organization, Study, Site, Patient
patientsvc
1
133 ms
195 ms
133 ms
flat
match (org:Organization{tildaid: $orgID})-[:STUDY_TO_ORG]- (st:Study{tildaid: $studyID}) call { with org,st with org,st match (org)-[:STUDY_TO_ORG]-(st)-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:S…
match (org:Organization{tildaid: $orgID})-[:STUDY_TO_ORG]- (st:Study{tildaid: $studyID}) call { with org,st with org,st match (org)-[:STUDY_TO_ORG]-(st)-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_SITE]-(site:Site) where org.orgType=? or org.orgType=? return site, pd union with org,st with org,st match (org)-[:IS_AN_ORG]-(:Smo)-[:SITE_TO_SMO]-(site:Site)-[:PLAN_DEFINITION_TO_SITE]- (pd:DslPlanDefinition)-[:PLAN_DEFINITION_TO_STUDY]-(st) return site, pd } return collect(site.tildaid)
enrollsvc
2
68 ms
190 ms
137 ms
flat
MATCH (f:ConfigFinding) WHERE f.studyId = $studyId AND f.dedupeKey > $after AND (f.status = ? OR coalesce(f.resolvedAt, ?) > $resolvedSince) WITH f ORDER BY f.dedupeKey LIMIT $limit OPTIONAL MATCH (s:Site {tildaid: f.siteId}) OPTIONAL MATC…
MATCH (f:ConfigFinding) WHERE f.studyId = $studyId AND f.dedupeKey > $after AND (f.status = ? OR coalesce(f.resolvedAt, ?) > $resolvedSince) WITH f ORDER BY f.dedupeKey LIMIT $limit OPTIONAL MATCH (s:Site {tildaid: f.siteId}) OPTIONAL MATCH (siteOrg:Organization {tildaid: s.orgId}) OPTIONAL MATCH (d:Document {tildaid: f.sourceDocId}) OPTIONAL MATCH (d)-[:DOC_TO_ORG]->(docOrg:Organization) WITH f, s, siteOrg, d, head(collect(docOrg.alias)) AS docOrgAlias RETURN f.dedupeKey AS cursor, f.findingId AS id, f.status AS status, coalesce(f.siteId, ?) AS siteId, coalesce(s.name, ?) AS siteName, coalesce(docOrgAlias, siteOrg.alias) AS orgAlias, coalesce(d.fileName, ?) AS fileName, coalesce(f.sourceKind, ?) AS sourceKind, coalesce(f.sourceDocId, ?) AS docId, coalesce(f.entityId, ?) AS entityId, coalesce(f.changes, ?) CONTAINS ? AS conflict, f.createdAt AS createdAt, coalesce(f.changes, ?) AS changes, coalesce(f.title, ?) AS title, coalesce(f.subtitle, ?) AS subtitle, head([(f)-[r:FOUND_IN]->(:Document) | coalesce(r.pages, [])]) AS pages
feedsvc
2
62 ms
190 ms
122 ms
flat
MATCH (pt:ParticipantTable {tildaid: $pt_id})-[:PARTICIPANT_QUESTION|PARTICIPANT_DOC_UPLOAD]-(pobj) WHERE pobj.hdmClassId = $hdm_class_id AND (pobj.delpending IS NULL OR pobj.delpending <> true) OPTIONAL MATCH (pobj)-[:ALL_CHANGELOG]-(clog…
MATCH (pt:ParticipantTable {tildaid: $pt_id})-[:PARTICIPANT_QUESTION|PARTICIPANT_DOC_UPLOAD]-(pobj) WHERE pobj.hdmClassId = $hdm_class_id AND (pobj.delpending IS NULL OR pobj.delpending <> true) OPTIONAL MATCH (pobj)-[:ALL_CHANGELOG]-(clog:ChangeLog) WHERE clog.type IN $changelog_types WITH pobj, count(clog) AS clogCount OPTIONAL MATCH (pobj)-[:HAS_QUERY]-(qr:Query) WHERE qr.delpending = false WITH pobj, clogCount, count(qr) AS queryCount OPTIONAL MATCH (pobj)-[:BELONGS_TO]-(doc:Document {archived: false}) OPTIONAL MATCH (doc)-[:TAIL_CHANGELOG]-(docCL:ChangeLog) OPTIONAL MATCH (doc)-[:HAS_QUERY]-(dq:Query) WHERE NOT dq.state IN [?] WITH DISTINCT pobj, clogCount, queryCount, doc, docCL, count(dq) AS docQueryCount WITH pobj, clogCount, queryCount, collect(DISTINCT CASE WHEN doc IS NOT NULL THEN { id: doc.tildaid, docKind: doc.docKind, versionNumber: doc.versionNumber, fileName: doc.fileName, uploadedBy: docCL.who, uploadedAt: docCL.createdat, size: doc.size, status: doc.status, pages: doc.pages, docType: doc.docTypeName, contentType: doc.contentType, queryCount: docQueryCount } END) AS documents OPTIONAL MATCH (q:QuestionV2 {tildaid: pobj.questionId}) OPTIONAL MATCH (q)-[:QUESTION_TO_QUESTION_SPEC]->(qs:QuestionSpec) OPTIONAL MATCH (qs)-[:QUESTION_SPEC_TO_RESPONSE_SET]->(rs:ResponseSet) RETURN pobj, clogCount, queryCount, documents, q, qs, rs
writeexportsvc
3
53 ms
185 ms
156 ms
flat
match (cp:CarePlan{tildaid:$cpId})-[:EXECUTE_SOA]-(s:ScheduleOfActivities)- [:SOA_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition)- [:PLAN_DEFINITION_TO_STUDY]-(st:Study) optional match (p:Patient {tildaid: cp.participantId}) optional match (phi…
match (cp:CarePlan{tildaid:$cpId})-[:EXECUTE_SOA]-(s:ScheduleOfActivities)- [:SOA_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition)- [:PLAN_DEFINITION_TO_STUDY]-(st:Study) optional match (p:Patient {tildaid: cp.participantId}) optional match (phi:Phi {tildaid: p.phiid}) optional match (pd)-[:PLAN_DEFINITION_TO_SITE]->(site:Site) return distinct {CarePlan:cp},{Patient:p},{Phi:phi},{Site:site},{Study:st}
finsvc
4
34 ms
180 ms
134 ms
flat
match (cp:CarePlan{tildaid:$cpId})-[:EXECUTE_SOA]-(s:ScheduleOfActivities)- [:SOA_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition)- [:PLAN_DEFINITION_TO_STUDY]-(st:Study) optional match (p:Patient {tildaid: cp.participantId}) optional match (phi…
match (cp:CarePlan{tildaid:$cpId})-[:EXECUTE_SOA]-(s:ScheduleOfActivities)- [:SOA_TO_PLAN_DEFINITION]-(pd:DslPlanDefinition)- [:PLAN_DEFINITION_TO_STUDY]-(st:Study) optional match (p:Patient {tildaid: cp.participantId}) optional match (phi:Phi {tildaid: p.phiid}) return distinct {CarePlan:cp},{Study:st},{Patient:p},{Phi:phi}
notifsvc
4
35 ms
180 ms
136 ms
flat
MATCH (dv:DocumentVersion {tildaid: $id})<-[:DOCUMENT_VERSION]-(d:Document) MATCH (r:Recommendation) WHERE r.doc_id = d.tildaid AND NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO…
MATCH (dv:DocumentVersion {tildaid: $id})<-[:DOCUMENT_VERSION]-(d:Document) MATCH (r:Recommendation) WHERE r.doc_id = d.tildaid AND NOT r.category IN [?, ?, ?] MATCH (ai:AIRun)-[:AI_RUN_TO_RECOMMENDATION]->(r) MATCH (r)-[:RECOMMENDATION_TO_ORGANIZATION]->(o:Organization) OPTIONAL MATCH (d)<-[:INCLUDES]-(currentFolder:Folder{folderType:?, delpending: FALSE}) WHERE currentFolder.scope IN [?, ?] OPTIONAL MATCH (d)-[:FILED_UNDER_SUBARTIFACT]->(currentSubArtifact:SubArtifact)<-[:INCLUDES]-(currentFolder) OPTIONAL MATCH (d)-[:HAS_STAGING_INFO]->(stagingInfo:DocumentStagingInfo) OPTIONAL MATCH (artifact:Folder{tildaid:coalesce(stagingInfo.folderId, currentFolder.tildaid, ?)})<-[:INCLUDES]-(section:Folder)<-[:INCLUDES]-(zone:Folder)<-[:INCLUDES]-(collection:Folder{level:?}) OPTIONAL MATCH (artifact)-[:INCLUDES]->(subArtifact:SubArtifact{tildaid:coalesce(stagingInfo.subArtifactId, currentSubArtifact.tildaid, ?)}) OPTIONAL MATCH (d) - [:UPLOADED_BY] - (u: User) OPTIONAL MATCH (d)<-[:INCLUDES]-(b:Binder)-[:BINDER_FOR]->(study:Study) OPTIONAL MATCH (d)<-[:INCLUDES]-(b2:Binder)-[:BINDER_FOR]->(site:Site) CALL { WITH d, site OPTIONAL MATCH (study:Study{tildaid: d.studyId})<-[:PLAN_DEFINITION_TO_STUDY]- (pd:DslPlanDefinition{delpending:false, type:?})-[:PLAN_DEFINITION_TO_SITE]->(site) RETURN COALESCE(pd.siteNumber, ?) AS siteNumber } CALL { WITH dv OPTIONAL MATCH (dv)<-[:DOCUMENT_SOURCE_TO_VERSION]-(ds:DocumentSource)-[:HAS_ATTRIBUTE]->(docAttr: DocAttribute) WITH collect([coalesce(docAttr.key, ?), coalesce(docAttr.value, ?)]) AS attributePairs WITH apoc.map.fromPairs(attributePairs) AS attributesMap With apoc.convert.toJson(attributesMap) AS attributesJson RETURN attributesJson } WITH r, ai, o, d, dv, zone, section, artifact, subArtifact, u, study, site, siteNumber, attributesJson, // Document Scope key stripping: reduce the rec JSON envelope to the keys // valid for its OWN scope so irrelevant keys (e.g. country on a site rec) // don?scope?country?scope?siteName?siteId?siteNumber?scope?scope???{}?{}?????{}?{?{?{????DRecommendation?t emit irrelevant rows (e.g. country on a site-scoped rec). recommendedValue: CASE WHEN r.category = ? AND recAllowed IS NOT NULL THEN apoc.convert.toJson(apoc.map.fromPairs([k IN keys(recMap) WHERE k IN recAllowed | [k, recMap[k]]])) ELSE coalesce(CASE WHEN coalesce(r.data_formatted, ?) <> ? THEN r.data_formatted END, r.data, ?) END, // originalRecommendation = the AI?Document Scope????Document Metadata?{}??Document Scope???Document Naming??TMF Artifact???.???.??? ??Sub Artifact??Document Scope??country???site?????Document Metadata??Document Metadata?????{}??????{}??{}??Document Scope?????country???site??????Document Naming???????TMF Artifact????????.???.??? ??Sub Artifact???????Document Format?Document Summary?Quality Control?PHI Issues?Confirm?Fix It????' } ) YIELD node RETURN node
writedashrsvc
24
102 ms
180 ms
2.23 s
flat
MATCH (f:ConfigFinding) WHERE f.studyId = $studyId AND f.dedupeKey > $after AND (f.status = ? OR coalesce(f.resolvedAt, ?) > $resolvedSince) WITH f ORDER BY f.dedupeKey LIMIT $limit OPTIONAL MATCH (s:Site {tildaid: f.siteId}) OPTIONAL MATC…
MATCH (f:ConfigFinding) WHERE f.studyId = $studyId AND f.dedupeKey > $after AND (f.status = ? OR coalesce(f.resolvedAt, ?) > $resolvedSince) WITH f ORDER BY f.dedupeKey LIMIT $limit OPTIONAL MATCH (s:Site {tildaid: f.siteId}) OPTIONAL MATCH (siteOrg:Organization {tildaid: s.orgId}) OPTIONAL MATCH (d:Document {tildaid: f.sourceDocId}) OPTIONAL MATCH (d)-[:DOC_TO_ORG]->(docOrg:Organization) WITH f, s, siteOrg, d, head(collect(docOrg.alias)) AS docOrgAlias RETURN f.dedupeKey AS cursor, f.findingId AS id, f.status AS status, coalesce(f.siteId, ?) AS siteId, coalesce(s.name, ?) AS siteName, coalesce(docOrgAlias, siteOrg.alias) AS orgAlias, coalesce(d.fileName, ?) AS fileName, coalesce(f.sourceKind, ?) AS sourceKind, coalesce(f.sourceDocId, ?) AS docId, coalesce(f.entityId, ?) AS entityId, coalesce(f.changes, ?) CONTAINS ? AS conflict, f.createdAt AS createdAt, coalesce(f.changes, ?) AS changes, coalesce(f.title, ?) AS title, coalesce(f.subtitle, ?) AS subtitle, head([(f)-[r:FOUND_IN]->(:Document) | coalesce(r.pages, [])]) AS pages
feedsvc
5
28 ms
175 ms
135 ms
flat
p95 drift compares the query's p95 in the recent half of the window to the earlier half — ≥1.2×
means it's slowing down. Click a row for its p50/p95 latency trend over time. Latency percentiles come from
per-bucket histograms (no individual queries stored).