Site Continuing Reviews
The participating sites are responsible for reporting continuing review data to the sIRB, so it must be uploaded to the IRB Exchange when it's recorded
What's Involved
- Adding a method to create JSON representing the site continuing review's data for upload to the IRB Exchange.
- Modifying the Report Continuing Review Data activity to trigger the upload of the site continuing review data to the IRB Exchange.
- Adding a method to download JSON from the IRB Exchange representing a site's continuing review, parse it and set the data on the site.
Create Site Continuing Review JSON
_IRBSubmission.toSiteCrJson Method Example
/** Converts the relevant data for a site into JSON for upload to the IRB Exchange.
*
* @param mss (_IRBSubmission) Study the site belongs to
* @param activity (_IRBSubmission_ReportContinuingReviewData) Activity to get comments from
*
* @returns {{JSON}}
*/
function toSiteCrJson(mss, activity) {
var jsonObj = {};
// Set scalar data
jsonObj.poRef = mss + "";
jsonObj.totalEnrollment = this.getQualifiedAttribute("customAttributes.continuingReviewProgressReport.customAttributes.enrollmentInfo.customAttributes.allSiteSinceActivation");
jsonObj.enrolledSinceLastApproval = this.getQualifiedAttribute("customAttributes.continuingReviewProgressReport.customAttributes.enrollmentInfo.customAttributes.allSiteSinceLastApproval");
jsonObj.comments = activity.getQualifiedAttribute("notesAsStr");
jsonObj.reportedDate = new Date();
// Set selection set
jsonObj.statements = getSelectionSetIds(this, "customAttributes.continuingReviewProgressReport.customAttributes.selectedStatements", "customAttributes.statement");
// Set document set
jsonObj.supportingDocuments = getDocSetPoRefs(this.getQualifiedAttribute("customAttributes.continuingReviewProgressReport.customAttributes.supportingDocuments"));
return JSON.stringify(jsonObj, null, null);
}
Report Continuing Review Data Activity
Code needs to be added to the post-processing script to upload the site continuing review data to the IRB Exchange if the site is connected to it. The initializeForm
method for the activity also needs to be created to download the data from the IRB Exchange onto the activity form on the sIRB side.
Report Continuing Review Data Post-Processing Script Snippet Example
activity.handleReportContinuingReview(targetEntity);
Report Continuing Review Data handleReportContinuingReview Method Snippet Example
// Upload site data to Exchange if pSite
var isExternal = targetEntity.getQualifiedAttribute("customAttributes.externalIRBInvolved");
var isExchangeEnabled = _IRBSettings.getIRBSettings().getQualifiedAttribute("customAttributes.isIRBExchangeEnabled");
if(isExchangeEnabled == true && isExternal == true) {
var accountName = targetEntity.getQualifiedAttribute("customAttributes.IRB.customAttributes.iRBExchangeAccountName");
if (accountName != null) {
var exchangeClient = ClickIRBUtils.getExchangeClient(accountName);
var containerRef = IrbExchangeReference.GetEntityForPoRef(targetEntity + "", exchangeClient + "");
if (containerRef != null) {
var exchangeClient = ClickIRBUtils.getExchangeClient(accountName);
var siteCrJson = targetEntity.toSiteCrJson(targetEntity, this);
exchangeClient.SaveSiteContinuingReview(siteCrJson);
}
}
}
Technical notes about this script snippet example:
- The data is uploaded only if this is a site on the participating site side and was created by a study downloaded from the IRB Exchange.
- The
_IRBSubmission.toSiteCrJson
method is called to get the JSON for the site continuing review. - The
IrbExchange.SaveSiteContinuingReview
method is called to upload the site continuing review data to the IRB Exchange.
_IRBSubmission_ReportContinuingReviewData.initializeForm Method Example
/** Called to initalize dates on the Submit Committee Review activity.
@param sch (SCH) Scripting context helper
**/
function initializeForm(sch)
{
var targetEntityOID = sch.queryString("LoggedFor");
var targetEntity = wom.getEntityFromString(targetEntityOID);
var isMssExternal = targetEntity.getQualifiedAttribute("customAttributes.mSSStudy.customAttributes.externalIRBInvolved");
var isExchangeEnabled = _IRBSettings.getIRBSettings().getQualifiedAttribute("customAttributes.isIRBExchangeEnabled");
if(isExchangeEnabled == true && isMssExternal == false) {
targetEntity.downloadSiteCrFromExchange(this);
} else {
var today = new Date();
var activity = sch.currentEntity;
activity.setQualifiedAttribute("customAttributes.reportedDate", today);
}
}
Technical notes about this method example:
- Site continuing review data is downloaded from the IRB Exchange if it's a site on the sIRB side.
- The
_IRBSubmission.downloadSiteCrFromExchange
method is called to download the data from the IRB Exchange and set it on the site.
Download and Parse the Site Continuing Review JSON
/** Downloads site CR data from the IRB Exchange.
*
* @param activity (_IRBSubmission_SubmitCommitteeMemberReviewNotes) Activity to load data on
*/
function downloadSiteCrFromExchange(activity) {
// Initialize the activity's reported date here with default date in case this is a manual CR report not using the exchange
activity.setQualifiedAttribute("customAttributes.reportedDate", new Date());
// Get CR item from Exchange
var accountName = this.getQualifiedAttribute("customAttributes.IRB.customAttributes.iRBExchangeAccountName");
if(accountName != null) {
var exchangeClient = ClickIRBUtils.getExchangeClient(accountName);
var siteParticipantId = this.getQualifiedAttribute("customAttributes.mSSPSiteInstitutionalProfile.customAttributes.exchangeId");
if (siteParticipantId == null) {
return;
}
var mss = this.getSiteMss();
var siteCrJsonStr = exchangeClient.GetSiteCr(mss, siteParticipantId);
if (siteCrJsonStr == null) {
return;
}
var siteCrJson = JSON.parse(siteCrJsonStr, null);
activity.setQualifiedAttribute("customAttributes.totalEnrollment", siteCrJson.totalEnrollment);
activity.setQualifiedAttribute("customAttributes.enrolledSinceLastApproval", siteCrJson.enrolledSinceLastApproval);
activity.setQualifiedAttribute("notesAsStr", siteCrJson.comments);
activity.setQualifiedAttribute("customAttributes.reportedDate", siteCrJson.reportedDate);
// Set CR selected statements
setSelectionSetFromJson("_IRBContinuingReviewStatements", activity, "customAttributes.selectedStatements", siteCrJson.statements, "customAttributes.statement", null);
// Download the documents for the site CR
downloadDocSet(exchangeClient, mss, activity, "customAttributes.supportingDocuments", siteCrJson.supportingDocuments, false, [], activity.loggedFor, null, null, null, null, null);
}
}
Technical notes about this method example:
- Unlike other submission types, site continuing reviews are downloaded in the foreground due to technical reasons related to operating via a standard activity.
- The
IrbExchange.GetSiteCr
method is called to get the site continuing review JSON.