The following example explains how to provide and use a site selection list on a Report Requester screen for an EDC project. This is intended for users who have access to all sites. This could be refined further to subset the selection just to the users sites by utilizing the method described in the post on Subsetting Site Reports
For this example, I provide a selection of all investigators defined in the study. This is intended for use in a Non-CRF data entry screen that is being used as a user report requester.
Add selection box
In Screen layout, add a selection list box to your data entry screen and size as desired.
Get and use investigator selection
Add the following code to the run report button objects code area (right click on the button and choose Code). This should be placed before your report processing. This will check the box for a selection and populate into the macro variable userInvestigators. This is the same macro variable that is used in the revised monitor reviewed report (monRev.sas), so this report will work as is.
Report button code
For this example, I provide a selection of all investigators defined in the study. This is intended for use in a Non-CRF data entry screen that is being used as a user report requester.
Add selection box
In Screen layout, add a selection list box to your data entry screen and size as desired.
- Name the object “SiteSelection” by right clicking and choosing Name.
- You can edit the title by right clicking on the box and choosing properties.
- Populate investigator selection
- Add the following code to the onLoad() method:
Code:
** get list of investigators and populate list box **; dsid=open('pviews.investigators'); nlevels=0; siteList=makelist(); rc=lvarlevel(dsid,'InvestigatorNumber',nlevels,siteList); if dsid then dsid = close(dsid); siteList=sortlist(siteList); siteSelection.items = siteList; rc=rc;
Get and use investigator selection
Add the following code to the run report button objects code area (right click on the button and choose Code). This should be placed before your report processing. This will check the box for a selection and populate into the macro variable userInvestigators. This is the same macro variable that is used in the revised monitor reviewed report (monRev.sas), so this report will work as is.
Report button code
Code:
** Get selected investigators **; dcl char userInvestigators = ''; if siteSelection.selectedIndex > 0 then userInvestigators="'"||trim(left(siteSelection.selectedItem))||"'"; call symput('userInvestigators',userInvestigators);