Upload Submissions to IRB Exchange
We wrote one common method for uploading most types of submissions to the IRB Exchange.
_IRBSubmission.uploadToExchange Method Example
/** Upload or update MSS to IRB Exchange.
*
* @param activity (_IRBSubmission_SubmitActionResponse) Submit Action Response activity holds data for that case
*/
function uploadToExchange(activity) {
var STUDY_SUBMISSION_TYPE_ID = "STUDY";
var SITE_SUBMISSION_TYPE_ID = "IRBSITE";
var RNI_SUBMISSION_TYPE_ID = "RNI";
var MOD_SUBMISSION_TYPE_ID = "MOD";
var MODCR_SUBMISSION_TYPE_ID = "MODCR";
var CR_SUBMISSION_TYPE_ID = "CR";
var isExchangeEnabled = _IRBSettings.getIRBSettings().getQualifiedAttribute("customAttributes.isIRBExchangeEnabled");
if(isExchangeEnabled == true) {
var accountName = this.getQualifiedAttribute("customAttributes.IRB.customAttributes.iRBExchangeAccountName");
if(accountName != null) {
var exchangeClient = ClickIRBUtils.getExchangeClient(accountName);
// Add or update the study to the Exchange
var submissionTypeID = this.getQualifiedAttribute("customAttributes.submissionType.ID");
switch (submissionTypeID) {
case STUDY_SUBMISSION_TYPE_ID:
var isExternal = this.getQualifiedAttribute("customAttributes.externalIRBInvolved");
if(isExternal == false) {
exchangeClient.SaveStudy(this.toMssJson(exchangeClient));
}
break;
case SITE_SUBMISSION_TYPE_ID:
// Check for and upload site data
var containerRef = IrbExchangeReference.GetEntityForPoRef(this + "", exchangeClient + "");
if (containerRef != null) {
exchangeClient.SaveSite(this.toSiteJson());
}
// Check for and upload sIRB site review data
var mss = this.getSiteMss();
if(mss != null) {
var containerRef = IrbExchangeReference.GetEntityForPoRef(mss + "", exchangeClient + "");
if (containerRef != null) {
var pSiteIp = this.getQualifiedAttribute("customAttributes.mSSPSiteInstitutionalProfile");
var pSiteExchangeID = pSiteIp.getExchangeId();
if (pSiteExchangeID != null) {
exchangeClient.SaveSiteSirbReviewData(this.toSiteSirbReviewDataJson(mss));
}
}
}
break;
case RNI_SUBMISSION_TYPE_ID:
var mss = this.getQualifiedAttribute("customAttributes.reportableNewInformation.customAttributes.relatedStudies").elements().item(1);
var containerRef = IrbExchangeReference.GetEntityForPoRef(mss + "", exchangeClient + "");
if (containerRef != null) {
exchangeClient.SaveReportableNewInformation(this.toRniJson(activity, mss));
this.setQualifiedAttribute("customAttributes.canDownloadExchangeUpdates", true);
}
break;
case MOD_SUBMISSION_TYPE_ID:
case MODCR_SUBMISSION_TYPE_ID:
case CR_SUBMISSION_TYPE_ID:
var parentType = this.getQualifiedAttribute("customAttributes.parentStudy.customAttributes.submissionType.ID");
var parentStudy = this.getQualifiedAttribute("customAttributes.parentStudy");
if (parentType == "STUDY") {
exchangeClient.SaveStudy(parentStudy.toMssJson(exchangeClient));
} else {
var isExternal = parentStudy.getQualifiedAttribute("customAttributes.externalIRBInvolved");
if(isExternal == true) {
var containerRef = IrbExchangeReference.GetEntityForPoRef(parentStudy + "", exchangeClient + "");
if (containerRef != null) {
exchangeClient.SaveSiteModification(this.toSiteModJson());
}
}
}
break;
default:
throw new Error("Unexpected submission type encountered: submission type ID = " + submissionTypeID);
}
}
}
}
Technical notes about this method example:
- Submissions are only uploaded to the IRB Exchange if integration is enabled in IRB Settings.
- Submissions are uploaded to the IRB Exchange using the IRB Exchange account selected on the assigned IRB office that corresponds to the store's default endpoint.
- Studies are uploaded using the
IrbExchange.SaveStudy
method. - Sites are uploaded to the IRB Exchange if their respective study has been uploaded to the IRB Exchange and it's on the participating site side using the
IrbExchange.SaveSite
method. - Site review data from the sIRB is uploaded to the IRB Exchange using the
IrbExchange.SaveSiteSirbReviewDates
method. - Reportable New Information is uploaded to the IRB Exchange if an external study downloaded from the IRB Exchange is set as a related submission. It calls the
IrbExchange.SaveReportableNewInformation
method to upload the data to the IRB Exchange. - When a study follow-on submission is approved, it will upload any changes from a modification (mostly SmartForm data) and changes from a continuing review (review dates and pre-review data) to the IRB Exchange if the study has been uploaded.
- Site modifications are uploaded to the IRB Exchange if their initial site's study was downloaded from the IRB Exchange. This is done via the method call
IrbExchange.SaveSiteModification
.