/** Adds a kc column */
 public void addColumnKcData(String cui, String domainObjectType) {
   if (ApiFunctions.isEmpty(cui)) {
     throw new ApiException("Null cui encountered");
   } else if (ApiFunctions.isEmpty(domainObjectType)) {
     throw new ApiException("Null domain object type encountered");
   } else {
     if (TagTypes.DOMAIN_OBJECT_VALUE_SAMPLE.equalsIgnoreCase(domainObjectType)) {
       getQuerySampleKcData().addColumn(cui);
     } else if (TagTypes.DOMAIN_OBJECT_VALUE_CASE.equalsIgnoreCase(domainObjectType)) {
       getQueryConsentKcData().addColumn(cui);
     } else if (TagTypes.DOMAIN_OBJECT_VALUE_DONOR.equalsIgnoreCase(domainObjectType)) {
       getQueryDonorKcData().addColumn(cui);
     } else {
       throw new ApiException("Unknown domain object type encountered: " + domainObjectType);
     }
   }
 }
 public Account getAccount(String id) {
   id = ApiFunctions.safeTrim(id);
   if (ApiFunctions.isEmpty(id)) {
     throw new ApiException("A non-empty account id must be specified.");
   } else {
     return (Account) _accountMap.get(id.toLowerCase());
   }
 }
 private void validatePrinterLabelTemplates(
     Account account, LabelPrinter printer, StringBuffer problems, boolean appendComma) {
   Map templates = printer.getLabelTemplates();
   // if there are no label templates defined for the printer, return an error
   if (templates.isEmpty()) {
     if (appendComma) {
       problems.append(",");
     }
     problems.append(
         " printer with name = "
             + printer.getName()
             + " in account with id = "
             + account.getId()
             + " has no label templates defined.");
     appendComma = true;
   } else {
     Iterator iterator = templates.keySet().iterator();
     while (iterator.hasNext()) {
       LabelTemplate template = (LabelTemplate) templates.get(iterator.next());
       // make sure every template refers to a known template definition
       String templateDefinitionName = template.getLabelTemplateDefinitionName();
       if (printer
               .getParent()
               .getLabelTemplateDefinitions()
               .get(templateDefinitionName.toLowerCase())
           == null) {
         if (appendComma) {
           problems.append(",");
         }
         problems.append(
             " label template for printer ("
                 + printer.getName()
                 + ") references an unknown labelTemplateDefinition ("
                 + templateDefinitionName
                 + ")");
         appendComma = true;
       }
       // make sure every template has a fully qualified name value
       String fullName = template.getFullyQualifiedName();
       if (ApiFunctions.isEmpty(fullName)) {
         if (appendComma) {
           problems.append(",");
         }
         problems.append(
             " label template with labelTemplateDefinitionName = "
                 + templateDefinitionName
                 + " has no fully qualified name value");
         appendComma = true;
       }
     }
   }
 }
示例#4
0
 /**
  * Creates a new <code>PathReportSectionData</code>, initialized from the data in the
  * PathReportSectionData passed in.
  *
  * @param pathReportSectionData the <code>PathReportSectionData</code>
  */
 public PathReportSectionData(PathReportSectionData pathReportSectionData) {
   this();
   BigrBeanUtilsBean.SINGLETON.copyProperties(this, pathReportSectionData);
   // any mutable objects must be handled seperately (BigrBeanUtilsBean.copyProperties
   // does a shallow copy.
   if (!ApiFunctions.isEmpty(pathReportSectionData.getFindings())) {
     _findings.clear();
     Iterator iterator = pathReportSectionData.getFindings().iterator();
     while (iterator.hasNext()) {
       _findings.add(
           new PathReportSectionFindingData((PathReportSectionFindingData) iterator.next()));
     }
   }
 }
示例#5
0
  /**
   * Insert the method's description here. Creation date: (2/8/2001 6:51:19 PM)
   *
   * @param myError java.lang.String
   */
  private void retry(String myError) throws Exception {
    // Get the security info.
    SecurityInfo securityInfo = WebUtils.getSecurityInfo(request);

    String boxLayoutId = request.getParameter("boxLayoutId");
    boxLayoutId = BoxLayoutUtils.checkBoxLayoutId(boxLayoutId, false, true, true);
    if (!ApiFunctions.isEmpty(boxLayoutId)) {
      String accountId = securityInfo.getAccount();
      if (!BoxLayoutUtils.isValidBoxLayoutForAccount(boxLayoutId, accountId)) {
        // The box layout id is not part of the account box layout group.
        BoxScanData bsd = BoxLayoutUtils.prepareForBoxScan(securityInfo);
        boxLayoutId = bsd.getDefaultBoxLayoutId();
      }
    }
    BoxLayoutDto boxLayoutDto = BoxLayoutUtils.getBoxLayoutDto(boxLayoutId);
    request.setAttribute("boxLayoutDto", boxLayoutDto);

    retry(myError, RETRY_PATH);
  }
示例#6
0
  /** Insert the method's description here. Creation date: (2/2/2001 2:39:22 PM) */
  public void invoke() throws Exception {

    SecurityInfo securityInfo = WebUtils.getSecurityInfo(request);

    // Check if box layout is valid for this account.
    String boxLayoutId = request.getParameter("boxLayoutId");
    boxLayoutId = BoxLayoutUtils.checkBoxLayoutId(boxLayoutId, false, true, true);
    if (!ApiFunctions.isEmpty(boxLayoutId)) {
      String accountId = securityInfo.getAccount();
      if (!BoxLayoutUtils.isValidBoxLayoutForAccount(boxLayoutId, accountId)) {
        // The box layout id is not part of the account box layout group.
        retry("The box layout selected does not belong to this account.");
      }
    }
    BoxLayoutDto boxLayoutDto = BoxLayoutUtils.getBoxLayoutDto(boxLayoutId);
    request.setAttribute("boxLayoutDto", boxLayoutDto);

    // Scan through all of the box cells to find the sample ids and/or aliases.
    // Here we're just accumulating non-null entries, we do validation later.
    //
    HashMap sampleNumberToSample = new HashMap();
    for (int i = 0; i < boxLayoutDto.getBoxCapacity(); i++) {
      String sampleNumber = "smpl" + (i + 1);
      String sampleIdOrAlias = ApiFunctions.safeString(request.getParameter(sampleNumber)).trim();
      if (!ApiFunctions.isEmpty(sampleIdOrAlias)) {
        sampleNumberToSample.put(sampleNumber, sampleIdOrAlias);
      }
    }

    // Get relevant information about the samples, and populate the request with that information.
    // If there was a problem getting the information return an error (but populate any retrieved
    // sample information first so it is retained for existing samples)
    String error = getSampleInfo(sampleNumberToSample, securityInfo);
    for (int i = 0; i < boxLayoutDto.getBoxCapacity(); i++) {
      String sampleNumber = "smpl" + (i + 1);
      String sampleIdOrAlias = ApiFunctions.safeString(request.getParameter(sampleNumber)).trim();
      if (!ApiFunctions.isEmpty(sampleIdOrAlias)) {
        SampleData sample = (SampleData) sampleNumberToSample.get(sampleNumber);
        request.setAttribute("smplType" + (i + 1), sample.getSampleType());
        request.setAttribute("smplAlias" + (i + 1), sample.getSampleAlias());
      }
    }
    if (!ApiFunctions.isEmpty(error)) {
      retry(error);
      return;
    }

    // iterate over the samples, gathering data we'll need for additional checking.  Note that
    // at this point, regardless of whether the sample was scanned via its system id or alias,
    // we have retrieved the sample id, sample alias, and sample type for every sample.
    List systemSampleIds = new ArrayList();
    Iterator i = sampleNumberToSample.keySet().iterator();
    while (i.hasNext()) {
      String sampleNumber = (String) i.next();
      SampleData sample = (SampleData) sampleNumberToSample.get(sampleNumber);
      if (sample != null) {
        String sampleId = sample.getSampleId();
        systemSampleIds.add(sampleId);
      }
    }

    // SWP-1100 - if nothing has been scanned in, return an error
    if (sampleNumberToSample.size() == 0) {
      retry("Please enter sample(s) before continuing.");
      return;
    }

    // Now perform some additional checks.  Pass true for the check to make sure that samples
    // exist, because for a check-out operation we always require that all of the samples
    // actually exist.  Note however that since we've already performed that check above this check
    // should always succeed.
    if (!ApiFunctions.isEmpty(systemSampleIds)) {
      // MR7356 Don't allow samples on open requests to be scanned into the new box
      boolean enforceRequestedSampleRestrictions = true;
      SampleOperationHome sampleOpHome =
          (SampleOperationHome) EjbHomes.getHome(SampleOperationHome.class);
      SampleOperation sampleOp = sampleOpHome.create();
      String validSampleSetError =
          sampleOp.validSamplesForBoxScan(
              systemSampleIds,
              true,
              enforceRequestedSampleRestrictions,
              false,
              securityInfo,
              boxLayoutDto);
      if (validSampleSetError != null) {
        retry(validSampleSetError);
        return;
      }
    }

    Vector staffNames = new Vector();
    String account = securityInfo.getAccount();
    ListGeneratorHome home = (ListGeneratorHome) EjbHomes.getHome(ListGeneratorHome.class);
    ListGenerator list = home.create();
    staffNames = list.lookupArdaisStaffByAccountId(account);
    request.setAttribute("staff", staffNames);

    servletCtx
        .getRequestDispatcher("/hiddenJsps/iltds/storage/checkOutBox/checkOutBoxConfirm.jsp")
        .forward(request, response);
  }
示例#7
0
  private String getSampleInfo(HashMap sampleNumberToSample, SecurityInfo securityInfo) {
    Set problems = new HashSet();
    List encounteredAliases = new ArrayList();

    Iterator i = sampleNumberToSample.keySet().iterator();
    while (i.hasNext()) {
      String sampleNumber = (String) i.next();
      String sampleIdOrAlias = (String) sampleNumberToSample.get(sampleNumber);
      String sampleTypeCui = null;
      String sampleAlias = null;
      // if the value begins with the prefix for any of our sample ids (FR, PA, SX) then
      // assume it is a sample id.  Return an error if the sample doesn't exist.
      if (IltdsUtils.isSystemSampleId(sampleIdOrAlias)) {
        try {
          SampleAccessBean sample = new SampleAccessBean(new SampleKey(sampleIdOrAlias));
          sampleTypeCui = sample.getSampleTypeCid();
          sampleAlias = sample.getCustomerId();
        } catch (ObjectNotFoundException e) {
          StringBuffer error = new StringBuffer(100);
          error.append("Sample ");
          error.append(sampleIdOrAlias);
          error.append(" does not exist in the database.");
          problems.add(error.toString());
        } catch (Exception e) {
          ApiFunctions.throwAsRuntimeException(e);
        }
      }
      // if the value does not begin with the prefix for any of our sample ids (FR, PA, SX) then
      // assume it is a sample alias and handle the alias as follows:
      // - if the alias corresponds to multiple existing sample ids, return an error.
      // - if the alias corresponds to a single existing sample id, see if the account to which that
      //      sample belongs requires unique aliases.
      //      - if not, return an error since we cannot be positive the sample we found was the one
      //        intended.
      //      - if so
      //         - if the specified alias has already been encountered return an error since the
      //           same sample cannot be scanned into multiple locations in a box.
      //         - if the alias has not yet been encountered then get the information for that
      //           sample.
      // - if the alias corresponds to no existing sample return an error.
      else {
        // pass false to the findSampleIdsFromCustomerId call, to take into account any samples that
        // have been created via a box scan but have not yet been annotated.
        List existingSamples = IltdsUtils.findSamplesFromCustomerId(sampleIdOrAlias, false);
        // if multiple samples with the specified alias were found, return an error.
        if (existingSamples.size() > 1) {
          StringBuffer error = new StringBuffer(100);
          error.append("The alias \"");
          error.append(Escaper.htmlEscapeAndPreserveWhitespace(sampleIdOrAlias));
          error.append("\" corresponds to multiple existing samples.  Please scan the specific");
          error.append(" sample id you wish to use.");
          problems.add(error.toString());
        }
        // if a single sample was found, do some further checking
        else if (existingSamples.size() == 1) {
          String accountId = ((SampleData) existingSamples.get(0)).getArdaisAcctKey();
          AccountDto accountDto = IltdsUtils.getAccountById(accountId, false, false);
          boolean aliasMustBeUnique =
              FormLogic.DB_YES.equalsIgnoreCase(accountDto.getRequireUniqueSampleAliases());
          // if the account to which the sample belongs does not require unique sample aliases,
          // return an error since we cannot be sure the sample we found was the one intended.
          if (!aliasMustBeUnique) {
            StringBuffer error = new StringBuffer(100);
            error.append("The alias \"");
            error.append(Escaper.htmlEscapeAndPreserveWhitespace(sampleIdOrAlias));
            error.append("\" does not uniquely identify a sample.");
            error.append(" Please scan the specific sample id you wish to use.");
            problems.add(error.toString());
          }
          // if we've already encountered this alias, return an error (the same sample cannot
          // be scanned into multiple locations in a box)
          else if (encounteredAliases.contains(sampleIdOrAlias.toUpperCase())) {
            StringBuffer error = new StringBuffer(100);
            error.append("The alias \"");
            error.append(Escaper.htmlEscapeAndPreserveWhitespace(sampleIdOrAlias));
            error.append("\" appears more than once.");
            problems.add(error.toString());
            // still fill in the sample information so the resulting screen looks correct (otherwise
            // the first instance of this alias has information but the second does not)
            SampleData sample = (SampleData) existingSamples.get(0);
            sampleIdOrAlias = sample.getSampleId();
            sampleTypeCui = sample.getSampleTypeCui();
            sampleAlias = sample.getSampleAlias();
          }
          // otherwise store the encountered alias (in uppercase, so we can compare subsequent
          // aliases to this one without case accounting for any differences) and get the
          // information
          // for the sample
          else {
            encounteredAliases.add(sampleIdOrAlias.toUpperCase());
            SampleData sample = (SampleData) existingSamples.get(0);
            sampleIdOrAlias = sample.getSampleId();
            sampleTypeCui = sample.getSampleTypeCui();
            sampleAlias = sample.getSampleAlias();
          }
        }
        // if no matching sample was found, return an error
        else {
          StringBuffer error = new StringBuffer(100);
          error.append("Sample \"");
          error.append(Escaper.htmlEscapeAndPreserveWhitespace(sampleIdOrAlias));
          error.append("\" does not exist in the database.");
          problems.add(error.toString());
        }
      }
      // Create a sample data to hold the information
      SampleData sample = new SampleData();
      sample.setSampleId(sampleIdOrAlias);
      sample.setSampleAlias(sampleAlias);
      sample.setSampleTypeCui(sampleTypeCui);
      if (!ApiFunctions.isEmpty(sampleTypeCui)) {
        sample.setSampleType(GbossFactory.getInstance().getDescription(sampleTypeCui));
      }
      // replace the map entry with the sample data object
      sampleNumberToSample.put(sampleNumber, sample);
    }

    String returnValue = null;
    if (!problems.isEmpty()) {
      StringBuffer buff = new StringBuffer("The following problems were found: ");
      Iterator problemIterator = problems.iterator();
      while (problemIterator.hasNext()) {
        buff.append((String) problemIterator.next());
        buff.append("  ");
      }
      returnValue = buff.toString();
    }
    return returnValue;
  }
 private void validateAccountLabelPrinters(Account account, StringBuffer problems) {
   boolean appendComma = problems.length() > 0;
   Map printers = account.getLabelPrinters();
   // if there are no label printers defined for the account, return an error
   if (printers.isEmpty()) {
     if (appendComma) {
       problems.append(",");
     }
     problems.append(" account with id = " + account.getId() + " has no printers defined.");
     appendComma = true;
   } else {
     Map displayNames = new HashMap();
     Iterator iterator = printers.keySet().iterator();
     while (iterator.hasNext()) {
       LabelPrinter printer = (LabelPrinter) printers.get(iterator.next());
       String name = printer.getName();
       // check that the name by which the printer will be displayed (display name if present,
       // otherwise name) is unique
       String displayName = printer.getDisplayName();
       if (ApiFunctions.isEmpty(displayName)) {
         displayName = name;
       }
       if (displayNames.put(displayName, displayName) != null) {
         if (appendComma) {
           problems.append(",");
         }
         problems.append(
             " printer with name = "
                 + name
                 + " has the same display name as another printer in the account");
         appendComma = true;
       }
       // make sure the printer is set up for at least one type of printing mechanism
       // (i.e. tcp/ip, email, etc)
       if (!printer.isEmailBasedPrintingEnabled()
           && !printer.isFileBasedPrintingEnabled()
           && !printer.isTcpIpBasedPrintingEnabled()) {
         if (appendComma) {
           problems.append(",");
         }
         problems.append(" printer with name = " + name + " has no printing mechanism enabled");
         appendComma = true;
       }
       // make sure all required printing information has been specified
       else {
         if (printer.isEmailBasedPrintingEnabled()) {
           if (ApiFunctions.isEmpty(printer.getEmailAddress())) {
             if (appendComma) {
               problems.append(",");
             }
             problems.append(" printer with name = " + name + " has no email address.");
             appendComma = true;
           }
           if (ApiFunctions.isEmpty(printer.getEmailSubject())) {
             if (appendComma) {
               problems.append(",");
             }
             problems.append(" printer with name = " + name + " has no email subject.");
             appendComma = true;
           }
         }
         if (printer.isFileBasedPrintingEnabled()) {
           if (!ApiFunctions.isEmpty(printer.getFileTransferCommand())
               && printer
                       .getFileTransferCommand()
                       .indexOf(Constants.LABEL_PRINTING_TRANSFER_COMMAND_FILE_INSERTION_STRING)
                   < 0) {
             if (appendComma) {
               problems.append(",");
             }
             problems.append(
                 " printer with name = "
                     + name
                     + " has a file transfer command with no insertion point for the filename.");
             appendComma = true;
           }
           if (ApiFunctions.isEmpty(printer.getFileName())) {
             if (appendComma) {
               problems.append(",");
             }
             problems.append(" printer with name = " + name + " has no file name.");
             appendComma = true;
           }
           if (ApiFunctions.isEmpty(printer.getFileExtension())) {
             if (appendComma) {
               problems.append(",");
             }
             problems.append(" printer with name = " + name + " has no file extension.");
             appendComma = true;
           }
         }
         if (printer.isTcpIpBasedPrintingEnabled()) {
           if (ApiFunctions.isEmpty(printer.getTcpIpHost())) {
             if (appendComma) {
               problems.append(",");
             }
             problems.append(" printer with name = " + name + " has no tcp/ip host.");
             appendComma = true;
           }
           String tcpIpPort = printer.getTcpIpPort();
           if (ApiFunctions.isEmpty(tcpIpPort)) {
             if (appendComma) {
               problems.append(",");
             }
             problems.append(" printer with name = " + name + " has no tcp/ip port.");
             appendComma = true;
           } else {
             if (!ApiFunctions.isInteger(tcpIpPort)) {
               if (appendComma) {
                 problems.append(",");
               }
               problems.append(" printer with name = " + name + " has an invalid tcp/ip port.");
               appendComma = true;
             }
           }
         }
       }
       // validate the label templates specified as available on this printer
       validatePrinterLabelTemplates(account, printer, problems, appendComma);
     }
   }
 }
 private void validateAccountLabelTemplateDefinitions(Account account, StringBuffer problems) {
   boolean appendComma = problems.length() > 0;
   Map templateDefinitions = account.getLabelTemplateDefinitions();
   // if there are no label template definitions defined for the account, return an error
   if (templateDefinitions.isEmpty()) {
     if (appendComma) {
       problems.append(",");
     }
     problems.append(
         " account with id = " + account.getId() + " has no label template definitions defined.");
     appendComma = true;
   } else {
     Map displayNames = new HashMap();
     Iterator iterator = templateDefinitions.keySet().iterator();
     while (iterator.hasNext()) {
       LabelTemplateDefinition templateDefinition =
           (LabelTemplateDefinition) templateDefinitions.get(iterator.next());
       String name = templateDefinition.getName();
       // check that the name by which the template will be displayed (display name if present,
       // otherwise name) is unique
       String displayName = templateDefinition.getDisplayName();
       if (ApiFunctions.isEmpty(displayName)) {
         displayName = name;
       }
       if (displayNames.put(displayName, displayName) != null) {
         if (appendComma) {
           problems.append(",");
         }
         problems.append(
             " label template definition with name = "
                 + name
                 + " has the same display name as another template definition in the account");
         appendComma = true;
       }
       // check that the object type is valid
       String objectType = templateDefinition.getObjectType();
       if (ApiFunctions.isEmpty(objectType)) {
         if (appendComma) {
           problems.append(",");
         }
         problems.append(
             " label template definition with name = " + name + " has an empty object type");
         appendComma = true;
       } else {
         if (Constants.LABEL_PRINTING_OBJECT_TYPES.get(objectType) == null) {
           if (appendComma) {
             problems.append(",");
           }
           problems.append(
               " label template definition with name = " + name + " has an unknown object type");
           appendComma = true;
         }
       }
       // check that the object subtype(s), if present, is/are valid
       Collection objectSubtypes = templateDefinition.getObjectSubtypesCollection();
       if (!ApiFunctions.isEmpty(objectSubtypes)) {
         // currently only sample objects can have a subtype
         if (!Constants.LABEL_PRINTING_OBJECT_TYPE_SAMPLE.equalsIgnoreCase(objectType)) {
           if (appendComma) {
             problems.append(",");
           }
           problems.append(
               " label template definition with name = "
                   + name
                   + " has object subtype(s) specified but does not have an object type of "
                   + Constants.LABEL_PRINTING_OBJECT_TYPE_SAMPLE);
           appendComma = true;
         }
         Iterator subtypeIterator = objectSubtypes.iterator();
         while (subtypeIterator.hasNext()) {
           String objectSubtype = (String) subtypeIterator.next();
           // make sure the subtype(s) is/are valid sample type(s)
           if (SystemConfiguration.getSampleType(objectSubtype) == null) {
             if (appendComma) {
               problems.append(",");
             }
             problems.append(
                 " label template definition with name = "
                     + name
                     + " has an unknown object subtype value of "
                     + objectSubtype);
             appendComma = true;
           }
         }
       }
       // check that the results form definition name is valid
       String formDefinitionName = templateDefinition.getResultsFormDefinitionName();
       if (ApiFunctions.isEmpty(formDefinitionName)) {
         if (appendComma) {
           problems.append(",");
         }
         problems.append(
             " label template definition with name = "
                 + name
                 + " has no results form definition name");
         appendComma = true;
       } else {
         if (templateDefinition
                 .getParent()
                 .getResultsFormDefinitions()
                 .get(formDefinitionName.toLowerCase())
             == null) {
           if (appendComma) {
             problems.append(",");
           }
           problems.append(
               " label template definition with name = "
                   + name
                   + " references an unknown results form definition name ("
                   + formDefinitionName
                   + ")");
           appendComma = true;
         }
       }
     }
   }
 }
  private void validateAccount(Account account, StringBuffer problems) {
    boolean appendComma = problems.length() > 0;
    // validate the account id exists and is a known account id
    String id = ApiFunctions.safeTrim(account.getId());
    if (ApiFunctions.isEmpty(id)) {
      if (appendComma) {
        problems.append(",");
      }
      problems.append(" account with empty id encountered");
      appendComma = true;
    } else {
      ArdaisaccountAccessBean ardaisAccount = null;
      try {
        ardaisAccount = new ArdaisaccountAccessBean(new ArdaisaccountKey(id));
      } catch (Exception e) {
        if (appendComma) {
          problems.append(",");
        }
        problems.append(" account with unknown id (" + id + ") encountered");
        appendComma = true;
      }
    }

    // validate that the bartender command line exists and has the correct insertion points
    String bartenderCommandLine = account.getBartenderCommandLine();
    if (ApiFunctions.isEmpty(bartenderCommandLine)) {
      if (appendComma) {
        problems.append(",");
      }
      problems.append(" account with empty bartenderCommandLine encountered.");
      appendComma = true;
    } else {
      if (bartenderCommandLine.indexOf(Constants.LABEL_PRINTING_INSERTION_STRING_LABEL_PRINTER)
          <= 0) {
        if (appendComma) {
          problems.append(",");
        }
        problems.append(
            " account with bartenderCommandLine having no printer insertion string encountered.");
        appendComma = true;
      }
      if (bartenderCommandLine.indexOf(Constants.LABEL_PRINTING_INSERTION_STRING_LABEL_TEMPLATE)
          <= 0) {
        if (appendComma) {
          problems.append(",");
        }
        problems.append(
            " account with bartenderCommandLine having no template insertion string encountered.");
        appendComma = true;
      }
    }

    // validate the results form definitions in the account
    validateAccountResultsFormDefinitions(account, problems);

    // validate the label template definitions in the account
    validateAccountLabelTemplateDefinitions(account, problems);

    // validate the label printers in the account
    validateAccountLabelPrinters(account, problems);
  }
示例#11
0
 /* (non-Javadoc)
  * @see com.ardais.bigr.btx.framework.DescribableAsHistoryObject#describeAsHistoryObject()
  */
 public Object describeAsHistoryObject() {
   BtxHistoryAttributes attributes = new BtxHistoryAttributes();
   if (!ApiFunctions.isEmpty(getConsentId())) {
     attributes.setAttribute("consentId", getConsentId());
   }
   if (!ApiFunctions.isEmpty(getCellInfiltrateAmount())) {
     attributes.setAttribute(
         "cellInfiltrateAmount",
         GbossFactory.getInstance().getDescription(getCellInfiltrateAmount()));
   }
   if (!ApiFunctions.isEmpty(getDiagnosis())) {
     attributes.setAttribute("diagnosis", BigrGbossData.getDiagnosisDescription(getDiagnosis()));
   }
   if (!ApiFunctions.isEmpty(getDiagnosisOther())) {
     attributes.setAttribute("diagnosisOther", getDiagnosisOther());
   }
   if (!ApiFunctions.isEmpty(getDistantMetastasis())) {
     attributes.setAttribute(
         "distantMetastasis", GbossFactory.getInstance().getDescription(getDistantMetastasis()));
   }
   if (!ApiFunctions.isEmpty(getDistantMetastasisInd())) {
     attributes.setAttribute("distantMetastasisInd", getDistantMetastasisInd());
   }
   if (!ApiFunctions.isEmpty(getDistantMetastasisOther())) {
     attributes.setAttribute("distantMetastasisOther", getDistantMetastasisOther());
   }
   if (!ApiFunctions.isEmpty(getExtensiveIntraductalComp())) {
     attributes.setAttribute(
         "extensiveIntraductalComp",
         GbossFactory.getInstance().getDescription(getExtensiveIntraductalComp()));
   }
   if (!ApiFunctions.isEmpty(getExtranodalSpread())) {
     attributes.setAttribute(
         "extranodalSpread", GbossFactory.getInstance().getDescription(getExtranodalSpread()));
   }
   if (getGleasonPrimary() != null && !ApiFunctions.isEmpty(getGleasonPrimary().toString())) {
     attributes.setAttribute("gleasonPrimary", getGleasonPrimary().toString());
   }
   if (getGleasonSecondary() != null && !ApiFunctions.isEmpty(getGleasonSecondary().toString())) {
     attributes.setAttribute("gleasonSecondary", getGleasonSecondary().toString());
   }
   if (getGleasonTotal() != null && !ApiFunctions.isEmpty(getGleasonTotal().toString())) {
     attributes.setAttribute("gleasonTotal", getGleasonTotal().toString());
   }
   if (!ApiFunctions.isEmpty(getHistologicalNuclearGrade())) {
     attributes.setAttribute(
         "histologicalNuclearGrade",
         GbossFactory.getInstance().getDescription(getHistologicalNuclearGrade()));
   }
   if (!ApiFunctions.isEmpty(getHistologicalNuclearGradeOther())) {
     attributes.setAttribute("histologicalNuclearGradeOther", getHistologicalNuclearGradeOther());
   }
   if (!ApiFunctions.isEmpty(getHistologicalType())) {
     attributes.setAttribute(
         "histologicalType", GbossFactory.getInstance().getDescription(getHistologicalType()));
   }
   if (!ApiFunctions.isEmpty(getHistologicalTypeOther())) {
     attributes.setAttribute("histologicalTypeOther", getHistologicalTypeOther());
   }
   if (!ApiFunctions.isEmpty(getInflammCellInfiltrate())) {
     attributes.setAttribute(
         "inflammCellInfiltrate",
         GbossFactory.getInstance().getDescription(getInflammCellInfiltrate()));
   }
   if (!ApiFunctions.isEmpty(getJointComponent())) {
     attributes.setAttribute(
         "jointComponent", GbossFactory.getInstance().getDescription(getJointComponent()));
   }
   if (!ApiFunctions.isEmpty(getLymphaticVascularInvasion())) {
     attributes.setAttribute(
         "lymphaticVascularInvasion",
         GbossFactory.getInstance().getDescription(getLymphaticVascularInvasion()));
   }
   if (!ApiFunctions.isEmpty(getLymphNodeNotes())) {
     attributes.setAttribute("lymphNodeNotes", getLymphNodeNotes());
   }
   if (!ApiFunctions.isEmpty(getLymphNodeStage())) {
     attributes.setAttribute(
         "lymphNodeStage", GbossFactory.getInstance().getDescription(getLymphNodeStage()));
   }
   if (!ApiFunctions.isEmpty(getLymphNodeStageOther())) {
     attributes.setAttribute("lymphNodeStageOther", getLymphNodeStageOther());
   }
   if (!ApiFunctions.isEmpty(getLymphNodeStageInd())) {
     attributes.setAttribute("lymphNodeStageInd", getLymphNodeStageInd());
   }
   if (!ApiFunctions.isEmpty(getMarginsInvolved())) {
     attributes.setAttribute("marginsInvolved", getMarginsInvolved());
   }
   if (!ApiFunctions.isEmpty(getMarginsUninvolved())) {
     attributes.setAttribute("marginsUninvolved", getMarginsUninvolved());
   }
   if (!ApiFunctions.isEmpty(getPerineuralInvasion())) {
     attributes.setAttribute(
         "perineuralInvasion", GbossFactory.getInstance().getDescription(getPerineuralInvasion()));
   }
   if (!ApiFunctions.isEmpty(getPrimary())) {
     attributes.setAttribute("primary", getPrimary());
   }
   if (!ApiFunctions.isEmpty(getSectionIdentifier())) {
     attributes.setAttribute(
         "sectionIdentifier", GbossFactory.getInstance().getDescription(getSectionIdentifier()));
   }
   if (!ApiFunctions.isEmpty(getSectionNotes())) {
     attributes.setAttribute("sectionNotes", getSectionNotes());
   }
   if (!ApiFunctions.isEmpty(getSizeLargestNodalMets())) {
     attributes.setAttribute("sizeLargestNodalMets", getSizeLargestNodalMets());
   }
   if (!ApiFunctions.isEmpty(getStageGrouping())) {
     attributes.setAttribute(
         "stageGrouping", GbossFactory.getInstance().getDescription(getStageGrouping()));
   }
   if (!ApiFunctions.isEmpty(getStageGroupingOther())) {
     attributes.setAttribute("stageGroupingOther", getStageGroupingOther());
   }
   if (!ApiFunctions.isEmpty(getTissueFinding())) {
     attributes.setAttribute(
         "tissueFinding", BigrGbossData.getTissueDescription(getTissueFinding()));
   }
   if (!ApiFunctions.isEmpty(getTissueFindingOther())) {
     attributes.setAttribute("tissueFindingOther", getTissueFindingOther());
   }
   if (!ApiFunctions.isEmpty(getTissueOrigin())) {
     attributes.setAttribute(
         "tissueOrigin", BigrGbossData.getTissueDescription(getTissueOrigin()));
   }
   if (!ApiFunctions.isEmpty(getTissueOriginOther())) {
     attributes.setAttribute("tissueOriginOther", getTissueOriginOther());
   }
   if (!ApiFunctions.isEmpty(getTotalNodesExamined())) {
     attributes.setAttribute(
         "totalNodesExamined", GbossFactory.getInstance().getDescription(getTotalNodesExamined()));
   }
   if (!ApiFunctions.isEmpty(getTotalNodesPositive())) {
     attributes.setAttribute(
         "totalNodesPositive", GbossFactory.getInstance().getDescription(getTotalNodesPositive()));
   }
   if (!ApiFunctions.isEmpty(getTumorConfig())) {
     attributes.setAttribute(
         "tumorConfig", GbossFactory.getInstance().getDescription(getTumorConfig()));
   }
   if (!ApiFunctions.isEmpty(getTumorSize())) {
     attributes.setAttribute("tumorSize", getTumorSize());
   }
   if (!ApiFunctions.isEmpty(getTumorStageDesc())) {
     attributes.setAttribute(
         "tumorStageDesc", GbossFactory.getInstance().getDescription(getTumorStageDesc()));
   }
   if (!ApiFunctions.isEmpty(getTumorStageDescInd())) {
     attributes.setAttribute("tumorStageDescInd", getTumorStageDescInd());
   }
   if (!ApiFunctions.isEmpty(getTumorStageDescOther())) {
     attributes.setAttribute("tumorStageDescOther", getTumorStageDescOther());
   }
   if (!ApiFunctions.isEmpty(getTumorStageType())) {
     attributes.setAttribute(
         "tumorStageType", GbossFactory.getInstance().getDescription(getTumorStageType()));
   }
   if (!ApiFunctions.isEmpty(getTumorStageTypeOther())) {
     attributes.setAttribute("tumorStageTypeOther", getTumorStageTypeOther());
   }
   if (!ApiFunctions.isEmpty(getTumorWeight())) {
     attributes.setAttribute("tumorWeight", getTumorWeight());
   }
   if (!ApiFunctions.isEmpty(getVenousVesselInvasion())) {
     attributes.setAttribute(
         "venousVesselInvasion",
         GbossFactory.getInstance().getDescription(getVenousVesselInvasion()));
   }
   return attributes;
 }
示例#12
0
 private String getSessionAttributeQualifiedName(String name) {
   String partnerName = getPartnerName();
   return (ApiFunctions.isEmpty(partnerName))
       ? SESSION_ATTRIBUTE_PREFIX + name
       : SESSION_ATTRIBUTE_PREFIX + "." + partnerName + "." + name;
 }