1313
1414 const parentDiv = $('#' + webpart.wrapperDivId)
1515 parentDiv.append('< div id = "' + webpart.wrapperDivId + '-studyCohorts" > </ div > ')
16+ parentDiv.append('< div id = "' + webpart.wrapperDivId + '-demographics" > </ div > ')
1617 parentDiv.append('< div id = "' + webpart.wrapperDivId + '-anchorEvents" > </ div > ')
1718 parentDiv.append('< div id = "' + webpart.wrapperDivId + '-expectedTimepoints" > </ div > ')
1819
1920 LDK.Utils.getBasicQWP({
2021 frame : 'portal' ,
2122 title : 'Cohorts' ,
22- name : 'query' ,
23+ name : 'query-studies ' ,
2324 schemaName : 'studies' ,
2425 queryName : 'studyCohorts' ,
2526 filterArray : [ LABKEY . Filter . create ( 'studyId' , studyId , LABKEY . Filter . Types . EQUAL ) ] ,
2627 maxRows : 20 ,
2728 renderTo : webpart . wrapperDivId + '-studyCohorts'
2829 } ).render();
2930
31+ if (LABKEY.getModuleContext('study')?.subject) {
32+ const hasAssignmentDataset = ! ! LABKEY . getModuleContext ( 'studies' ) ?. hasAssignmentDataset
33+ if ( hasAssignmentDataset ) {
34+ LABKEY . Query . selectRows ( {
35+ schemaName : 'studies' ,
36+ queryName : 'studies' ,
37+ columns : 'rowId,studyName' ,
38+ filterArray : [ LABKEY . Filter . create ( 'rowId' , studyId ) ] ,
39+ failure : LDK . Utils . getErrorCallback ( ) ,
40+ success : function ( results ) {
41+ const studyName = results . rows ?. [ 0 ] . studyName ;
42+ LDK . Assert . assertNotEmpty ( 'StudyName was empty in manageStudy.view' , studyName ) ;
43+
44+ const projectFieldName = 'allProjectsPivot/' + studyName + '::lastStartDate' ;
45+ const demographicsDefaultView = LABKEY . getModuleProperty ( 'studies' , 'demographicsDefaultView' )
46+ LDK . Utils . getBasicQWP ( {
47+ frame : 'portal' ,
48+ title : LABKEY . moduleContext . study ?. subject . nounPlural ,
49+ name : 'query-demographics' ,
50+ schemaName : 'study' ,
51+ queryName : 'demographics' ,
52+ viewName : demographicsDefaultView ,
53+ filterArray : [ LABKEY . Filter . create ( projectFieldName , null , LABKEY . Filter . Types . NONBLANK ) ] ,
54+ maxRows : 20 ,
55+ renderTo : webpart . wrapperDivId + '-demographics'
56+ } ) . render ( ) ;
57+ } ,
58+ scope : this
59+ } ) ;
60+ }
61+ }
62+
3063 LDK . Utils . getBasicQWP ( {
3164 frame : 'portal' ,
3265 title : 'Anchor Events' ,
33- name : 'query' ,
66+ name : 'query-anchorEvents ' ,
3467 schemaName : 'studies' ,
3568 queryName : 'anchorEvents' ,
3669 filterArray : [ LABKEY . Filter . create ( 'studyId' , studyId , LABKEY . Filter . Types . EQUAL ) ] ,
4174 LDK.Utils.getBasicQWP({
4275 frame : 'portal' ,
4376 title : 'Expected Timepoints' ,
44- name : 'query' ,
77+ name : 'query-expectedTimepoints ' ,
4578 schemaName : 'studies' ,
4679 queryName : 'expectedTimepoints' ,
4780 filterArray : [ LABKEY . Filter . create ( 'studyId' , studyId , LABKEY . Filter . Types . EQUAL ) ] ,
5487
5588</ script >
5689
57-
58- PLACEHOLDER: Make a page that accepts a studyId and renders useful UI to manage timepoints, run QC, and show data
5990< br > < br >
0 commit comments