Esempio n. 1
0
 private void addToSelection(MedicLiteVo item) {
   GenForm.grdSelectedTestsRow row = form.grdSelectedTests().getRows().newRow();
   row.setValue(item);
   row.setcolName(
       item != null && item.getMosIsNotNull() && item.getMos().getNameIsNotNull()
           ? item.getMos().getName().toString()
           : "");
 }
Esempio n. 2
0
  private void addToList(MedicLiteVo item) {
    if (item == null) return;

    GenForm.grdListedTestsRow row = form.grdListedTests().getRows().newRow();
    row.setValue(item);
    row.setcolName(
        item != null && item.getMosIsNotNull() && item.getMos().getNameIsNotNull()
            ? item.getMos().getName().toString()
            : "");
  }
Esempio n. 3
0
    public int compare(Object ob1, Object ob2) {
      PersonName pdate1 = null;
      PersonName pdate2 = null;
      if (ob1 instanceof MedicLiteVo) {
        MedicLiteVo ps1 = (MedicLiteVo) ob1;
        pdate1 =
            ps1.getMosIsNotNull() && ps1.getMos().getNameIsNotNull()
                ? ps1.getMos().getName()
                : null;
      }
      if (ob2 instanceof MedicLiteVo) {
        MedicLiteVo ps2 = (MedicLiteVo) ob2;
        pdate2 =
            ps2.getMosIsNotNull() && ps2.getMos().getNameIsNotNull()
                ? ps2.getMos().getName()
                : null;
      }
      if (pdate1 != null) return pdate1.compareTo(pdate2) * direction;
      if (pdate2 != null) return (-1) * direction;

      return 0;
    }
Esempio n. 4
0
 private void initialize() {
   form.grdSelectedTests().getRows().clear();
   form.grdListedTests().getRows().clear();
   if (form.getGlobalContext().Clinical.getSelectedHCPsIsNotNull()) {
     ArrayList<Object> tempArray = form.getGlobalContext().Clinical.getSelectedHCPs();
     for (int i = 0; i < tempArray.size(); i++) {
       grdSelectedTestsRow row = form.grdSelectedTests().getRows().newRow();
       row.setcolSelected(false);
       if (tempArray.get(i) instanceof MedicLiteVo) {
         MedicLiteVo tempVo = (MedicLiteVo) tempArray.get(i);
         row.setcolName(
             tempVo != null && tempVo.getMosIsNotNull() && tempVo.getMos().getNameIsNotNull()
                 ? tempVo.getMos().getName().toString()
                 : "");
         row.setValue(tempVo);
       } else if (tempArray.get(i) instanceof NurseVo) {
         NurseVo tempNurseVo = (NurseVo) tempArray.get(i);
         row.setcolName(
             tempNurseVo != null
                     && tempNurseVo.getMosIsNotNull()
                     && tempNurseVo.getMos().getNameIsNotNull()
                 ? tempNurseVo.getMos().getName().toString()
                 : "");
         row.setValue(tempNurseVo);
       } else if (tempArray.get(i) instanceof HcpLiteVo) // WDEV-15691
       {
         HcpLiteVo tempRadiographerVo = (HcpLiteVo) tempArray.get(i);
         row.setcolName(
             tempRadiographerVo != null
                     && tempRadiographerVo.getMosIsNotNull()
                     && tempRadiographerVo.getMos().getNameIsNotNull()
                 ? tempRadiographerVo.getMos().getName().toString()
                 : "");
         row.setValue(tempRadiographerVo);
       }
     }
   }
 }
Esempio n. 5
0
  protected void onFormOpen(Object[] args)
      throws ims.framework.exceptions.PresentationLogicException {
    LocationLiteVo locVo = null;
    LocSiteLiteVo locSiteVo = null;
    initialize();
    if (domain.getCurrentLocation() instanceof LocationLiteVo) {
      locVo = (LocationLiteVo) domain.getCurrentLocation();
    } else if (domain.getCurrentLocation() instanceof LocSiteLiteVo) {
      locSiteVo = (LocSiteLiteVo) domain.getCurrentLocation();
    }

    // WDEV-15691
    if (form.getGlobalContext().Clinical.getSelectedHcpIsNotNull()
        && (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST)
            || form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.MEDICAL))) {
      MedicLiteVoCollection medicColl = null;

      if (locVo != null) {
        if (locVo.getTypeIsNotNull() && locVo.getType().equals(LocationType.HOSP)) {
          if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST)
              && MedicGrade.CONS.equals(form.getGlobalContext().Clinical.getSelectedHcpGrade()))
            medicColl =
                domain.getMedics(
                    locVo,
                    HcpDisType.MEDICAL,
                    form.getGlobalContext().Clinical.getSelectedHcp(),
                    MedicGrade.CONS);
          else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST)
              && form.getGlobalContext().Clinical.getSelectedHcpGrade() == null)
            medicColl =
                domain.getMedics(
                    locVo,
                    HcpDisType.MEDICAL,
                    form.getGlobalContext().Clinical.getSelectedHcp(),
                    null);
          else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.MEDICAL))
            medicColl = domain.getMedics(locVo, HcpDisType.MEDICAL, null, null);
        } else if (locVo.getTypeIsNotNull() && !locVo.getType().equals(LocationType.HOSP)) {
          locVo = domain.getLocationLite(locVo);
          if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST)
              && MedicGrade.CONS.equals(form.getGlobalContext().Clinical.getSelectedHcpGrade()))
            medicColl =
                domain.getMedics(
                    locVo,
                    HcpDisType.MEDICAL,
                    form.getGlobalContext().Clinical.getSelectedHcp(),
                    MedicGrade.CONS);
          else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST)
              && form.getGlobalContext().Clinical.getSelectedHcpGrade() == null)
            medicColl =
                domain.getMedics(
                    locVo,
                    HcpDisType.MEDICAL,
                    form.getGlobalContext().Clinical.getSelectedHcp(),
                    null);
          else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.MEDICAL))
            medicColl = domain.getMedics(locVo, HcpDisType.MEDICAL, null, null);
        }
      } else if (locSiteVo != null) {
        locVo = domain.getLocationLite(locSiteVo);
        if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST)
            && MedicGrade.CONS.equals(form.getGlobalContext().Clinical.getSelectedHcpGrade()))
          medicColl =
              domain.getMedics(
                  locVo,
                  HcpDisType.MEDICAL,
                  form.getGlobalContext().Clinical.getSelectedHcp(),
                  MedicGrade.CONS);
        else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST)
            && form.getGlobalContext().Clinical.getSelectedHcpGrade() == null)
          medicColl =
              domain.getMedics(
                  locVo,
                  HcpDisType.MEDICAL,
                  form.getGlobalContext().Clinical.getSelectedHcp(),
                  null);
        else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.MEDICAL))
          medicColl = domain.getMedics(locVo, HcpDisType.MEDICAL, null, null);
      }

      if (medicColl != null) {
        if (form.getGlobalContext().Clinical.getMedicsSurgicalAuditIsNotNull()) {
          MedicLiteVoCollection tempColl =
              form.getGlobalContext().Clinical.getMedicsSurgicalAudit();
          for (int i = 0; tempColl != null && i < tempColl.size(); i++) {
            if (medicColl != null && medicColl.contains(tempColl.get(i)))
              medicColl.remove(tempColl.get(i));
          }
        }
        medicColl.sort(new MedicComparator(SortOrder.ASCENDING));
        for (int i = 0; i < medicColl.size(); i++) {
          grdListedTestsRow row = form.grdListedTests().getRows().newRow();
          row.setcolSelected(false);

          MedicLiteVo tempVo = medicColl.get(i);
          row.setcolName(
              tempVo != null && tempVo.getMosIsNotNull() && tempVo.getMos().getNameIsNotNull()
                  ? tempVo.getMos().getName().toString()
                  : "");
          row.setValue(tempVo);
        }
      }
    } else if (form.getGlobalContext().Clinical.getSelectedHcpIsNotNull()
        && form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.NURSING)) {
      NurseVoCollection nurseColl = null;
      if (locVo != null) {
        if (locVo.getTypeIsNotNull() && locVo.getType().equals(LocationType.HOSP)) {
          nurseColl = domain.getNurses(locVo, form.getGlobalContext().Clinical.getSelectedHcp());
        } else if (locVo.getTypeIsNotNull() && !locVo.getType().equals(LocationType.HOSP)) {
          locVo = domain.getLocationLite(locVo);
          nurseColl = domain.getNurses(locVo, form.getGlobalContext().Clinical.getSelectedHcp());
        }
      } else if (locSiteVo != null) {
        locVo = domain.getLocationLite(locSiteVo);
        nurseColl = domain.getNurses(locVo, form.getGlobalContext().Clinical.getSelectedHcp());
      }

      if (nurseColl != null) {
        if (form.getGlobalContext().Clinical.getNursessSurgicalAuditIsNotNull()) {
          NurseVoCollection tempnColl = form.getGlobalContext().Clinical.getNursessSurgicalAudit();

          for (int j = 0; tempnColl != null && j < tempnColl.size(); j++) {
            if (nurseColl.contains(tempnColl.get(j))) nurseColl.remove(tempnColl.get(j));
          }
        }
        nurseColl.sort(new NurseComparator(SortOrder.ASCENDING));
        for (int i = 0; i < nurseColl.size(); i++) {
          grdListedTestsRow row = form.grdListedTests().getRows().newRow();
          row.setcolSelected(false);

          NurseVo tempVo = nurseColl.get(i);
          row.setcolName(
              tempVo != null && tempVo.getMosIsNotNull() && tempVo.getMos().getNameIsNotNull()
                  ? tempVo.getMos().getName().toString()
                  : "");
          row.setValue(tempVo);
        }
      }
    }
    // WDEV-15691
    else if (form.getGlobalContext().Clinical.getSelectedHcpIsNotNull()
        && form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.RADIOGRAPHER)) {
      HcpLiteVoCollection radiographerColl = null; // WDEV-15691
      if (locVo != null) {
        if (locVo.getTypeIsNotNull() && locVo.getType().equals(LocationType.HOSP)) {
          radiographerColl =
              domain.getOtheDisciplineHcp(locVo, form.getGlobalContext().Clinical.getSelectedHcp());
        } else if (locVo.getTypeIsNotNull() && !locVo.getType().equals(LocationType.HOSP)) {
          locVo = domain.getLocationLite(locVo);
          radiographerColl =
              domain.getOtheDisciplineHcp(locVo, form.getGlobalContext().Clinical.getSelectedHcp());
        }
      } else if (locSiteVo != null) {
        locVo = domain.getLocationLite(locSiteVo);
        radiographerColl =
            domain.getOtheDisciplineHcp(locVo, form.getGlobalContext().Clinical.getSelectedHcp());
      }

      if (radiographerColl != null) {
        if (form.getGlobalContext().Clinical.getRadiographerSurgAuditProcDetailsIsNotNull()) {
          HcpLiteVoCollection tempnColl =
              form.getGlobalContext().Clinical.getRadiographerSurgAuditProcDetails();

          for (int j = 0; tempnColl != null && j < tempnColl.size(); j++) {
            if (radiographerColl.contains(tempnColl.get(j)))
              radiographerColl.remove(tempnColl.get(j));
          }
        }

        for (int i = 0; i < radiographerColl.size(); i++) {
          grdListedTestsRow row = form.grdListedTests().getRows().newRow();
          row.setcolSelected(false);

          HcpLiteVo tempVo = radiographerColl.get(i);
          row.setcolName(
              tempVo != null && tempVo.getMosIsNotNull() && tempVo.getMos().getNameIsNotNull()
                  ? tempVo.getMos().getName().toString()
                  : "");
          row.setValue(tempVo);
        }
      }
    }
  }