Exemplo n.º 1
0
  /**
   * Will return SiteResearchStaff having at least one active role provided in roleCodes parameter.
   *
   * @param roleCodes - roles to check
   * @return A list of SiteResearchStaff
   */
  public List<SiteResearchStaff> findSiteResearchStaffByRoles(final String... roleCodes) {
    List<SiteResearchStaff> srsList = new ArrayList<SiteResearchStaff>();
    for (SiteResearchStaff srs : getSiteResearchStaffs()) {
      if (srs.hasActiveRolesOfType(roleCodes)) srsList.add(srs);
    }

    return srsList;
  }
Exemplo n.º 2
0
 /**
  * Will return all the SiteResearchStaff which are currently active.
  *
  * @return the in active site research staff
  */
 @Transient
 public List<SiteResearchStaff> getInActiveSiteResearchStaff() {
   List<SiteResearchStaff> srsList = new ArrayList<SiteResearchStaff>();
   for (SiteResearchStaff srs : getSiteResearchStaffs()) {
     if (!srs.isActive()) srsList.add(srs);
   }
   return srsList;
 }
Exemplo n.º 3
0
 /**
  * Gets the site roles mapping.
  *
  * @return the site roles mapping
  */
 @Transient
 public Map<String, List<String>> getSiteRolesMapping() {
   Map<String, List<String>> siteRolesMap = new HashMap<String, List<String>>();
   List<String> roleCodeList = null;
   for (SiteResearchStaff siteResearchStaff : getSiteResearchStaffs()) {
     for (SiteResearchStaffRole siteResearchStaffRole :
         siteResearchStaff.getSiteResearchStaffRoles()) {
       roleCodeList = new ArrayList<String>();
       roleCodeList.add(siteResearchStaffRole.getRoleCode());
     }
     siteRolesMap.put(siteResearchStaff.getOrganization().getNciInstituteCode(), roleCodeList);
   }
   return siteRolesMap;
 }
Exemplo n.º 4
0
 /**
  * Gets the all roles.
  *
  * @return the all roles
  */
 @Transient
 public List<String> getAllRoles() {
   Set<String> roleSet = new HashSet<String>();
   for (SiteResearchStaff siteResearchStaff : getSiteResearchStaffs()) {
     for (SiteResearchStaffRole siteResearchStaffRole :
         siteResearchStaff.getSiteResearchStaffRoles()) {
       if (siteResearchStaffRole.isActive()) {
         roleSet.add(siteResearchStaffRole.getRoleCode());
       }
     }
   }
   List<String> roleList = new ArrayList<String>();
   roleList.addAll(roleSet);
   return roleList;
 }