Exemplo n.º 1
0
  private void populateInstanceControls(SentToXrayVo selectedSendToXRay) {
    clearInstanceControls();

    if (selectedSendToXRay == null) {
      return;
    }

    selectedSendToXRay = domain.getSentToXRay(selectedSendToXRay);

    form.ccAllocatedBy().setValue(selectedSendToXRay.getSentBy());
    form.dtimSent().setValue(selectedSendToXRay.getSentDateTime());
    form.dtimReturned().setValue(selectedSendToXRay.getReturnedDateTime());

    if (selectedSendToXRay.getReturnedDateTime() != null) {
      form.chkReturned().setValue(true);
      form.dtimReturned().setValue(selectedSendToXRay.getReturnedDateTime());
      if (form.getLocalContext().getcurrentTracking().getCurrentStatus() != null) {
        form.cmbSetCurrentStatus()
            .setValue(form.getLocalContext().getcurrentTracking().getCurrentStatus().getStatus());
      }
    }
  }
Exemplo n.º 2
0
  private void populateRecordBrowser() {
    form.recbrSentToXRay().clear();

    SentToXrayVoCollection collSentToXRay =
        domain.getAllSentToXRay(form.getGlobalContext().Core.getCurrentCareContext());

    if (collSentToXRay == null) {
      return;
    }

    for (int i = 0; i < collSentToXRay.size(); i++) {
      SentToXrayVo sentToXRay = collSentToXRay.get(i);

      StringBuffer string = new StringBuffer();

      if (sentToXRay.getSentDateTimeIsNotNull()) {
        string.append("Sent on: " + sentToXRay.getSentDateTime());
      }

      if (sentToXRay.getSentByIsNotNull()) {
        string.append(" - " + sentToXRay.getSentBy().getName());
      }

      if (sentToXRay.getReturnedDateTimeIsNotNull()) {
        string.append(" - Returned on: " + sentToXRay.getReturnedDateTime());
      }

      form.recbrSentToXRay().newRow(sentToXRay, string.toString());
    }

    if (collSentToXRay.size() > 0 && form.getLocalContext().getselectedSendToXRay() == null) {
      form.getLocalContext().setselectedSendToXRay(collSentToXRay.get(0));
    }

    form.recbrSentToXRay().setValue(form.getLocalContext().getselectedSendToXRay());
    populateInstanceControls(form.getLocalContext().getselectedSendToXRay());
  }