Example #1
0
  private void open() {
    OrderSpecimenVoCollection potentialSpecimens =
        form.getGlobalContext().OCRR.getMyOrderPotentialSpecimens();
    // Sort potential specimens
    potentialSpecimens.sort();

    // Build alternative containers hash map
    HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>>
        alternativeContainers = buildHashMapOfAlternativeContainers(potentialSpecimens);

    // Check for alternative options
    if (!choicesAvailable(alternativeContainers)) {
      engine.close(DialogResult.CANCEL);
      return;
    }

    populateSpecimensWithAlternateContainers(potentialSpecimens, alternativeContainers);
  }
Example #2
0
 public void populate(ims.vo.ValueObjectBeanMap map, ims.ocrr.vo.beans.OcsOrderVoBean bean) {
   this.id = bean.getId();
   this.version = bean.getVersion();
   this.clinicalcontact =
       bean.getClinicalContact() == null
           ? null
           : new ims.core.admin.vo.ClinicalContactRefVo(
               new Integer(bean.getClinicalContact().getId()),
               bean.getClinicalContact().getVersion());
   this.patient = bean.getPatient() == null ? null : bean.getPatient().buildVo(map);
   this.orderedby = bean.getOrderedBy() == null ? null : bean.getOrderedBy().buildVo(map);
   this.responsibleclinician =
       bean.getResponsibleClinician() == null ? null : bean.getResponsibleClinician().buildVo(map);
   this.responsiblegp =
       bean.getResponsibleGp() == null ? null : bean.getResponsibleGp().buildVo(map);
   this.patientlocation =
       bean.getPatientLocation() == null ? null : bean.getPatientLocation().buildVo(map);
   this.patientclinic =
       bean.getPatientClinic() == null ? null : bean.getPatientClinic().buildVo(map);
   this.additclinnotes = bean.getAdditClinNotes();
   this.sysinfo = bean.getSysInfo() == null ? null : bean.getSysInfo().buildSystemInformation();
   this.carecontext = bean.getCareContext() == null ? null : bean.getCareContext().buildVo(map);
   this.orderinghospital =
       bean.getOrderingHospital() == null
           ? null
           : new ims.core.resource.place.vo.LocSiteRefVo(
               new Integer(bean.getOrderingHospital().getId()),
               bean.getOrderingHospital().getVersion());
   this.outpatientdept =
       bean.getOutpatientDept() == null ? null : bean.getOutpatientDept().buildVo(map);
   this.authorisationorderstatus =
       bean.getAuthorisationOrderStatus() == null
           ? null
           : ims.ocrr.vo.lookups.AuthorisationOrderStatus.buildLookup(
               bean.getAuthorisationOrderStatus());
   this.clinicaltrial = bean.getClinicalTrial();
   this.clinicaltrialtxt = bean.getClinicalTrialTxt();
   this.patmobility =
       bean.getPatMobility() == null
           ? null
           : ims.ocrr.vo.lookups.OrderPatMobility.buildLookup(bean.getPatMobility());
   this.ordercategory =
       bean.getOrderCategory() == null
           ? null
           : ims.ocrr.vo.lookups.OrderCategory.buildLookup(bean.getOrderCategory());
   this.specimens =
       ims.ocrr.vo.OrderSpecimenVoCollection.buildFromBeanCollection(bean.getSpecimens());
   this.investigations =
       ims.ocrr.vo.OrderInvestigationVoCollection.buildFromBeanCollection(
           bean.getInvestigations());
   this.wasprocessed = bean.getWasProcessed();
   this.clinicalinfo = bean.getClinicalInfo() == null ? null : bean.getClinicalInfo().buildVo(map);
   this.reportto = ims.ocrr.vo.OcsReportToVoCollection.buildFromBeanCollection(bean.getReportTo());
   this.summaryclinicalinformation = bean.getSummaryClinicalInformation();
   this.bleepextnumber = bean.getBleepExtNumber();
 }
Example #3
0
  /**
   * Build a hash map with OderSpecimen as key, configured SpecimenContainer as secondary key, and
   * OrderInvestigation collection as values
   *
   * <p>Instead of comparing every specimen container from every investigation with every specimen
   * from other investigations, build a hash map with OrderSpecimen primary key, SpecimenContainer
   * secondary key and add all investigations from an OrderSpecimen that have SpecimenContainer
   * configured. If there are more than one investigation in the collection, then that
   * SpecimenContainer is common to more than one investigation for the OrderSpecimen
   */
  private HashMap<
          OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>>
      buildHashMapOfAlternativeContainers(OrderSpecimenVoCollection myOrderPotentialSpecimens) {
    if (myOrderPotentialSpecimens == null || myOrderPotentialSpecimens.size() == 0) return null;

    HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>>
        generalAlternativeContainers =
            new HashMap<
                OrderSpecimenVo,
                HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>>();

    for (OrderSpecimenVo specimen : myOrderPotentialSpecimens) {
      HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>
          specimenAlternativeContainers =
              new HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>();

      for (int i = 0; i < specimen.getInvestigations().size(); i++) {
        OrderInvestigationVo investigation =
            (OrderInvestigationVo)
                specimen.getInvestigations().get(i); // Unsafe upcast due to performance reasons
        PathInvDetailsVo pathologyDetails = null;

        if (investigation.getInvestigation().getParentInvestigationPathDetails() != null) {
          pathologyDetails = investigation.getInvestigation().getParentInvestigationPathDetails();
        } else {
          pathologyDetails = investigation.getInvestigation().getPathInvDetails();
        }

        SpecimenVo specimenVo = pathologyDetails.getSpecimens().get(0);

        PathSpecimenContainerDetailVo pediatricContainer =
            specimenVo.getPaediatricContainers().get(0).getSpecContainer();
        addSpecimenInvestigationToMap(
            specimenAlternativeContainers, investigation, pediatricContainer);

        for (SpecimenContainerVo containers : specimenVo.getAlternativePaediatricContainers()) {
          addSpecimenInvestigationToMap(
              specimenAlternativeContainers, investigation, containers.getSpecContainer());
        }
      }

      generalAlternativeContainers.put(specimen, specimenAlternativeContainers);
    }

    return generalAlternativeContainers;
  }