public ims.ocrr.orderingresults.vo.OrderInvestigationRefVoCollection toRefVoCollection() {
   ims.ocrr.orderingresults.vo.OrderInvestigationRefVoCollection result =
       new ims.ocrr.orderingresults.vo.OrderInvestigationRefVoCollection();
   for (int x = 0; x < this.col.size(); x++) {
     result.add(this.col.get(x));
   }
   return result;
 }
Example #2
0
  private float addInvestigationsWithAlternates(
      OrderInvestigationRefVoCollection investigations,
      grdItemsRow specimenRow,
      HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>
          alternativeContainers) {
    if (investigations == null || investigations.size() == 0)
      throw new CodingRuntimeException(
          "Logical Error - can't choose alternative containers for specimens without investigations");

    float totalRequiedVolume = 0;

    for (OrderInvestigationRefVo investigationRef : investigations) {
      // Upcast - possible error, but done due to performance consideration
      OrderInvestigationVo investigation = (OrderInvestigationVo) investigationRef;

      // Get investigation pathology details
      // Favor parent investigation Pathology Details - this might indicate an add-on investigation
      PathInvDetailsVo pathologyDetails = null;
      if (investigation.getInvestigation().getParentInvestigationPathDetails() != null) {
        pathologyDetails = investigation.getInvestigation().getParentInvestigationPathDetails();
      } else {
        pathologyDetails = investigation.getInvestigation().getPathInvDetails();
      }

      // Create child row for OrderInvestigationVo
      grdItemsRow investigationRow = specimenRow.getRows().newRow();

      // Set investigation name and value to row
      investigationRow.setColText(getInvestigationDisplayText(investigation, pathologyDetails));
      investigationRow.setValue(investigation);

      boolean isPaed = isUsePaedContainer();

      if (isPaed) {
        // Get specimen from pathology details - implementation only for Simple Investigation
        // Revise code when implementing Complex investigations
        SpecimenVo specimen = pathologyDetails.getSpecimens().get(0);
        // Pediatric container - alternate containers can only be configured for investigations with
        // only one pediatric container; any investigation must contain at least one pediatric
        // container
        SpecimenContainerVo paediatricContainer = specimen.getPaediatricContainers().get(0);

        investigationRow
            .getColContainer()
            .newRow(paediatricContainer, paediatricContainer.getSpecContainer().getName());
        investigationRow.getColContainer().setValue(paediatricContainer);

        totalRequiedVolume +=
            pathologyDetails.getSpecimens().get(0).getPaediatricContainers().get(0).getVolume();

        if (specimen.getAlternativePaediatricContainers() != null) {
          int addedAlternatives = 0;

          for (SpecimenContainerVo alternatePaedContainer :
              specimen.getAlternativePaediatricContainers()) {
            OrderInvestigationVoCollection orderInvestigations =
                alternativeContainers.get(alternatePaedContainer.getSpecContainer());

            if (orderInvestigations != null
                && orderInvestigations.size() > 1
                && orderInvestigations.contains(investigation)) {
              alternatePaedContainer
                  .getSpecContainer()
                  .setAlternativeVol(alternatePaedContainer.getVolume());
              investigationRow
                  .getColContainer()
                  .newRow(
                      alternatePaedContainer, alternatePaedContainer.getSpecContainer().getName());

              addedAlternatives++;
            }
          }

          investigationRow.setColContainerReadOnly(addedAlternatives == 0);
        }
      }
    }

    return totalRequiedVolume;
  }
 public void setOrderInvestigarionID(
     ims.ocrr.orderingresults.vo.OrderInvestigationRefVoCollection value) {
   if (value != null) {
     for (int x = 0; x < value.size(); x++) {
       if (value.get(x) != null
           && (value.get(x).getBoId() == null || value.get(x).getBoId().intValue() < 1))
         throw new ims.framework.exceptions.CodingRuntimeException(
             "Invalid domain object id found in 'OrderInvestigarionID' RefVoCollection context variable.");
     }
   }
   if (value == null) cxl_OrderInvestigarionID.setValue(context, null);
   else {
     ims.ocrr.orderingresults.vo.OrderInvestigationRefVoCollection copy =
         new ims.ocrr.orderingresults.vo.OrderInvestigationRefVoCollection();
     for (int x = 0; x < value.size(); x++) {
       copy.add(value.get(x));
     }
     value.clear();
     for (int x = 0; x < copy.size(); x++) {
       if (copy.get(x) == null) value.add(null);
       else
         value.add(
             new ims.ocrr.orderingresults.vo.OrderInvestigationRefVo(
                 copy.get(x).getBoId(), copy.get(x).getBoVersion()));
     }
     cxl_OrderInvestigarionID.setValue(context, value);
   }
 }