示例#1
0
 public void createStudyDefinition(Message message) throws RemoteException {
   List<Study> objects =
       xmUtils.getDomainObjectsFromList(Study.class, xmUtils.getArguments(message));
   if (objects.size() != 1) {
     throw new RemoteException(
         "Illegal Argument(s). Make sure there is exactly one study defination in the message.");
   }
   WebRequest webRequest =
       SessionAndAuditHelper.setupHibernateSessionAndAudit(
           interceptor, "C3PR Admin", "Coordinating Center", new Date(), "Coordinating Center");
   try {
     Study study = objects.get(0);
     studyFactory.buildStudy(study);
     for (StudySite studySite : study.getStudySites()) {
       studySite.setHostedMode(false);
       // TODO fix it later
       //                studySite.setSiteStudyStatus(SiteStudyStatus.PENDING);
     }
     for (StudyCoordinatingCenter studyCoordinatingCenter : study.getStudyCoordinatingCenters()) {
       studyCoordinatingCenter.setHostedMode(false);
     }
     study.setCoordinatingCenterStudyStatus(CoordinatingCenterStudyStatus.PENDING);
     studyDao.save(study);
     studyRepository.createStudy(study.getIdentifiers());
   } catch (C3PRCodedException e) {
     throw new RemoteException("error building the study", e);
   } finally {
     SessionAndAuditHelper.tearDownHibernateSession(interceptor, webRequest);
   }
 }
示例#2
0
 public void temporarilyCloseStudySiteToAccrualAndTreatment(Message message)
     throws RemoteException {
   List arguments = xmUtils.getArguments(message);
   List<Identifier> identifiers = xmUtils.getDomainObjectsFromList(Identifier.class, arguments);
   if (identifiers.size() == 0) {
     throw new RemoteException(
         "Illegal Argument(s). Make sure there is atleast one identifier in the message.");
   }
   List<HealthcareSite> heaList =
       xmUtils.getDomainObjectsFromList(HealthcareSite.class, arguments);
   if (heaList.size() != 1) {
     throw new RemoteException(
         "Illegal Argument(s). Make sure there is atleast one healtcare site defination in the message.");
   }
   WebRequest webRequest =
       SessionAndAuditHelper.setupHibernateSessionAndAudit(
           interceptor, "C3PR Admin", "Coordinating Center", new Date(), "Coordinating Center");
   try {
     // TODO fix it later
     //            studyRepository.temporarilyCloseStudySiteToAccrualAndTreatment(identifiers,
     // heaList.get(0).getPrimaryIdentifier());
   } catch (Exception e) {
     throw new RemoteException(e.getMessage());
   } finally {
     SessionAndAuditHelper.tearDownHibernateSession(interceptor, webRequest);
   }
 }
示例#3
0
 public void activateStudySite(gov.nih.nci.cabig.ccts.domain.Message message)
     throws RemoteException {
   List arguments = xmUtils.getArguments(message);
   List<Identifier> identifiers = xmUtils.getDomainObjectsFromList(Identifier.class, arguments);
   if (identifiers.size() == 0) {
     throw new RemoteException(
         "Illegal Argument(s). Make sure there is atleast one identifier in the message.");
   }
   List<StudySite> studySiteList = xmUtils.getDomainObjectsFromList(StudySite.class, arguments);
   if (studySiteList.size() != 1) {
     throw new RemoteException(
         "Illegal Argument(s). Make sure there is atleast one study site defination in the message.");
   }
   WebRequest webRequest =
       SessionAndAuditHelper.setupHibernateSessionAndAudit(
           interceptor, "C3PR Admin", "Coordinating Center", new Date(), "Coordinating Center");
   try {
     StudySite studySite =
         studyRepository
             .getUniqueStudy(identifiers)
             .getStudySite(studySiteList.get(0).getHealthcareSite().getPrimaryIdentifier());
     studySite.setIrbApprovalDate(studySiteList.get(0).getIrbApprovalDate());
     // TODO fix it later
     //        	studySite.setStartDate(studySiteList.get(0).getStartDate());
     studySiteDao.save(studySite);
     // TODO fix it later
     //            studyRepository.activateStudySite(identifiers,
     // studySiteList.get(0).getHealthcareSite().getPrimaryIdentifier());
   } catch (Exception e) {
     throw new RemoteException(e.getMessage());
   } finally {
     SessionAndAuditHelper.tearDownHibernateSession(interceptor, webRequest);
   }
 }
示例#4
0
 public void temporarilyCloseStudyToAccrualAndTreatment(Message message) throws RemoteException {
   List<Identifier> objects =
       xmUtils.getDomainObjectsFromList(Identifier.class, xmUtils.getArguments(message));
   if (objects.size() == 0) {
     throw new RemoteException(
         "Illegal Argument(s). Make sure there is atleast one identifier in the message.");
   }
   WebRequest webRequest =
       SessionAndAuditHelper.setupHibernateSessionAndAudit(
           interceptor, "C3PR Admin", "Coordinating Center", new Date(), "Coordinating Center");
   try {
     studyRepository.temporarilyCloseStudyToAccrualAndTreatment(objects);
   } catch (Exception e) {
     throw new RemoteException(e.getMessage());
   } finally {
     SessionAndAuditHelper.tearDownHibernateSession(interceptor, webRequest);
   }
 }