Ejemplo n.º 1
0
 @Override
 public void onEvent(Event event) throws Exception {
   try {
     Date begin_date = view.getBeginDatabox().getValue();
     Date end_date = view.getEndDatabox().getValue();
     if (view.getSelectedNode() == null) {
       Messagebox.show(
           ErrorMessage.UNSELECT_MONITOR, "提示", Messagebox.OK, Messagebox.INFORMATION);
       return;
     }
     if (begin_date.after(end_date)) {
       Messagebox.show(ErrorMessage.TIME_ERROR, "提示", Messagebox.OK, Messagebox.INFORMATION);
       return;
     }
     Events.sendEvent(new Event(Events.ON_CLICK, view.getQueryBtn()));
     Window win = (Window) Executions.createComponents("/main/report/export.zul", null, null);
     win.setAttribute("colorlist", view.getColorlist());
     win.setAttribute("stateBeanData", view.getStateBean());
     win.setAttribute("persistTimeData", view.getStateItems());
     win.setSizable(false);
     win.setClosable(true);
     win.doModal();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Ejemplo n.º 2
0
  /**
   * 生成报告按钮事件
   *
   * @param event
   * @throws Exception
   */
  public void onClick$CreateReportBtn(Event event) throws Exception {

    if (topNList.getSelectedItem() == null) {
      try {
        Messagebox.show("请选择报告!", "提示", Messagebox.OK, Messagebox.INFORMATION);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      return;
    }

    View view = Toolkit.getToolkit().getSvdbView(event.getTarget().getDesktop());
    String loginname = view.getLoginName();
    Listitem item = topNList.getSelectedItem();
    String section = item.getId();
    this.iniFile = new IniFile(INI_FILE);
    try {
      this.iniFile.load();
    } catch (Exception e) {
    }
    Map<String, String> reportDefine = this.iniFile.getSectionData(section);
    String Period = reportDefine.get("Period");
    String filetype = reportDefine.get("fileType");
    if (filetype == null) {
      filetype = "html";
    }
    Date tmStart = null;
    Date tmEnd = new Date();

    if (Period.equals("Month")) tmStart = Toolkit.getToolkit().delDay(new Date(), 30);
    else if (Period.equals("Week")) tmStart = Toolkit.getToolkit().delDay(new Date(), 7);
    else if (Period.equals("Day")) tmStart = Toolkit.getToolkit().delDay(new Date(), 1);
    else {
      Toolkit.getToolkit().showError("报告区间不支持:");
      return;
    }

    TopNReport tmpTopNReport = new TopNReport(section, reportDefine, tmStart, tmEnd, view, false);

    //	    tmpTopNReport.createReport();
    Thread thread = new Thread(tmpTopNReport);
    thread.setName("TopNReport -- TopNReport.java");
    thread.start();
    final Window win =
        (Window) Executions.createComponents("/main/progress/topnprogress.zul", null, null);
    win.setAttribute("topnreport", tmpTopNReport);
    win.setAttribute("filetype", filetype);
    win.setAttribute("reportname", tmpTopNReport.strReportName);
    win.doModal();
    // AMedia(String name, String format, String ctype, URL url, String charset)
    // 刷新日志数据

    // addlog
    //		View view = Toolkit.getToolkit().getSvdbView(event.getTarget().getDesktop());
    String minfo = loginname + " " + "在" + OpObjectId.topn_report.name + "中进行了手动生成报告操作.";
    AppendOperateLog.addOneLog(loginname, minfo, OpTypeId.add, OpObjectId.topn_report);
    onSelecttopNList(event);
  }
Ejemplo n.º 3
0
  /**
   * 添加TOPN报告
   *
   * @param event
   * @throws InterruptedException
   * @throws SuspendNotAllowedException
   */
  public void onClick$addTopN(Event event) throws SuspendNotAllowedException, InterruptedException {
    final Window win = (Window) Executions.createComponents(EditTOPN, null, null);
    win.setAttribute("isedit", false);
    win.setAttribute("tTopNReportComposer", this);
    win.setAttribute("iniFile", iniFile);
    win.doModal();

    refreshInifile();
  }
Ejemplo n.º 4
0
  public void onSetBatchButton(Event event) {
    final Window win = (Window) Executions.createComponents(batchMonitors_TargetUrl, null, null);
    win.setAttribute("monitorlistbox", monitorlistbox);
    Label pall = (Label) setMonitorWin.getDesktop().getPage("setMonitorPage").getFellow("all");
    win.setAttribute("all", pall);
    Label pok = (Label) setMonitorWin.getDesktop().getPage("setMonitorPage").getFellow("ok");
    win.setAttribute("ok", pok);
    Label pwarn = (Label) setMonitorWin.getDesktop().getPage("setMonitorPage").getFellow("warn");
    win.setAttribute("warn", pwarn);
    Label perror = (Label) setMonitorWin.getDesktop().getPage("setMonitorPage").getFellow("error");
    win.setAttribute("error", perror);
    Label pforbid =
        (Label) setMonitorWin.getDesktop().getPage("setMonitorPage").getFellow("forbid");
    win.setAttribute("forbid", pforbid);
    Label pbad = (Label) setMonitorWin.getDesktop().getPage("setMonitorPage").getFellow("bad");
    win.setAttribute("bad", pbad);

    Label pnullspecial =
        (Label) setMonitorWin.getDesktop().getPage("setMonitorPage").getFellow("nullspecial");
    win.setAttribute("null", pnullspecial);

    try {
      win.doModal();
    } catch (SuspendNotAllowedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
Ejemplo n.º 5
0
 @Override
 public void doAfterCompose(Component comp) throws Exception {
   super.doAfterCompose(comp);
   winCardiaca.setAttribute(comp.getId() + "ctrl", this);
   servicioCardiaca = (ServicioCardiaca) SpringUtil.getBean("beanServicioCardiaca");
   apagarBotones();
 }
 public void onClick$toolbarButtonEditar() {
   Productos productoSeleccionado = null;
   if (listboxProductos.getSelectedItem() != null) {
     productoSeleccionado = listboxProductos.getSelectedItem().getValue();
   } else {
     alert("Por favor seleccione un producto de la lista");
     return;
   }
   Window win =
       (Window)
           Executions.createComponents(
               "/Modulo_Control_Productos/RegistroProductos.zul", null, null);
   win.setTitle("Editar Producto");
   String opcion = "editar";
   win.setAttribute("productos", productoSeleccionado);
   win.setAttribute("op", opcion);
   win.doModal();
   actualizarLista("");
 }
Ejemplo n.º 7
0
 @Override
 public void onEvent(Event arg0) throws Exception {
   // TODO Auto-generated method stub
   try {
     final Window win =
         (Window) Executions.createComponents("/main/progress/topnprogress.zul", null, null);
     win.setAttribute("topnreport", topNReport);
     win.doModal();
   } catch (Exception e) {
   }
 }
 @Override
 public void doAfterCompose(Component comp) throws Exception {
   super.doAfterCompose(comp);
   winEditParesiaPlejia.setAttribute(comp.getId() + "ctrl", this);
   servicioParesiaPlejia = (ServicioParesiaPlejia) SpringUtil.getBean("beanServicioParesiaPlejia");
   paresiaPlejia = new ParesiaPlejia();
   ctrlwinparesiaPlejia = (ctrlWinParesiaPlejia) arg.get("ctrlWinParesiaPlejia");
   if (!(arg.get("objeto") == null)) {
     paresiaPlejia = (ParesiaPlejia) arg.get("objeto");
   }
 }
 @Override
 public void doAfterCompose(Component comp) throws Exception {
   super.doAfterCompose(comp);
   winEditConfiguracion.setAttribute(comp.getId() + "ctrl", this);
   servicioConfiguracion = (ServicioConfiguracion) SpringUtil.getBean("beanServicioConfiguracion");
   configuracion = new Configuracion();
   ctrlwinconfiguracion = (ctrlWinConfiguracion) arg.get("ctrlWinConfiguracion");
   if (!(arg.get("objeto") == null)) {
     configuracion = (Configuracion) arg.get("objeto");
   }
 }
 public void onEventCreate(CalendarsEvent event) throws InterruptedException, RemoteException {
   StorageComponentProxy proxy = SystemDictionary.getSCProxy();
   bookEventWin = (Window) Executions.createComponents("bookEvent.zul", self.getParent(), null);
   bookEventWin.setAttribute("calendars", cal);
   bookEventWin.setAttribute("calevent", event);
   bookEventWin.getFellow("qsrow").setVisible(true);
   Date setting = event.getBeginDate();
   setting.setTime(setting.getTime() + 43200000);
   ((Datebox) bookEventWin.getFellow("datetask")).setValue(setting);
   ((Timebox) bookEventWin.getFellow("timetask")).setValue(setting);
   ((Button) bookEventWin.getFellow("savebutton")).setVisible(true);
   ((Listbox) bookEventWin.getFellow("tasktypesel")).setSelectedIndex(0);
   String userid = (String) Sessions.getCurrent().getAttribute("userid");
   ((Textbox) bookEventWin.getFellow("userid")).setValue(userid);
   Toolbar toolbar = (Toolbar) self.getFellow("toolbar");
   String currentexecutor = ((Label) toolbar.getFellow("exechelp")).getValue();
   SystemDictionary.webguiLog("DEBUG", "Executor: " + currentexecutor);
   OperationResult opres =
       proxy.getUserIdByPersonId(currentexecutor, SystemDictionary.USERTYPE_PATIENT_INT, userid);
   Patient patient = proxy.getPatient(currentexecutor, userid);
   Carer carer = patient.getPatientCarer();
   OperationResult realexecutor =
       proxy.getUserIdByPersonId(carer.getID(), SystemDictionary.USERTYPE_CARER_INT, userid);
   SystemDictionary.webguiLog(
       "DEBUG", "Executor req: " + realexecutor.getCode() + ":" + opres.getDescription());
   ((Textbox) bookEventWin.getFellow("objid")).setValue(realexecutor.getCode());
   ((Textbox) bookEventWin.getFellow("addressedid")).setValue(opres.getCode());
   ((Textbox) bookEventWin.getFellow("objstr")).setValue(carer.toString());
   ((Textbox) bookEventWin.getFellow("addressedstr")).setValue(patient.toString());
   User assigner = proxy.getUser(userid);
   Clinician assg = proxy.getClinician(assigner.getPersonID(), userid);
   ((Textbox) bookEventWin.getFellow("userstr")).setValue(assg.toString());
   ((Listbox) bookEventWin.getFellow("questnamefield")).setSelectedIndex(0);
   // bookEventWin.getFellow("assignerrow").setVisible(false);
   bookEventWin.getFellow("massivequestionrow").setVisible(true);
   bookEventWin.getFellow("massivecheckrow").setVisible(true);
   bookEventWin.setTitle("New Task");
   bookEventWin.setVisible(true);
   bookEventWin.doModal();
 }
Ejemplo n.º 11
0
 /**
  * 编辑TOP_N报告
  *
  * @param section
  * @throws Exception
  */
 public void onTpenEditTop_NReport(Event section) throws Exception {
   View view = Toolkit.getToolkit().getSvdbView(Executions.getCurrent().getDesktop());
   if (this.editFlag) {
     final Window win = (Window) Executions.createComponents(EditTOPN, null, null);
     win.setAttribute("isedit", true);
     win.setAttribute("tTopNReportComposer", this);
     win.setAttribute("iniFile", iniFile);
     win.setAttribute("currsection", section.getData());
     try {
       win.doModal();
     } catch (Exception e) {
       return;
     }
     refreshInifile();
     String loginname = view.getLoginName();
     String minfo =
         loginname
             + " "
             + "在"
             + OpObjectId.topn_report.name
             + "中进行了  "
             + OpTypeId.edit.name
             + "操作。";
     AppendOperateLog.addOneLog(loginname, minfo, OpTypeId.edit, OpObjectId.topn_report);
   } else {
     try {
       Messagebox.show(
           "用户:" + view.getLoginName() + " 没有  编辑TopN报告  的权限!",
           "提示",
           Messagebox.OK,
           Messagebox.INFORMATION);
       return;
     } catch (Exception e) {
     }
   }
 }
  @Override
  public void doAfterCompose(Component comp) throws Exception {
    super.doAfterCompose(comp);
    winServicioCirugiaTransquirurgico.setAttribute(comp.getId() + "ctrl", this);
    servicioPaciente = (ServicioPaciente) SpringUtil.getBean("beanServicioPaciente");
    servicioCirugiaTransquirurgico =
        (ServicioCirugiaTransquirurgico) SpringUtil.getBean("beanServicioCirugiaTransquirurgico");

    cirugiaTransquirurgico = new CirugiaTransquirurgico();

    usuario = SessionAdministrator.getLoggedUsuario();
    veterinario = usuario.getPersona().getVeterinario();
    dbFechaActual.setValue(HelperDate.now());

    visibilidadSecciones(true, false, false);
    actividadBotones(true, true, false, true, true, true);

    txtHm.setValue(
        ((Referencia) arg.get("objeto")).getHistorial().getPaciente().getHistoriaMedica());
    btnBuscar.setVisible(false);
    onClick$btnBuscar();
  }
  public void onEventEdit(CalendarsEvent event) throws InterruptedException, RemoteException {
    try {
      StorageComponentProxy proxy = SystemDictionary.getSCProxy();
      Session ses = Sessions.getCurrent();
      String userid = (String) ses.getAttribute("userid");
      bookEventWin = (Window) Executions.createComponents("bookEvent.zul", self.getParent(), null);
      bookEventWin.setAttribute("calendars", cal);
      bookEventWin.setAttribute("calevent", event);
      Date setting = event.getCalendarEvent().getBeginDate();
      SimpleCalendarEvent scevent = (SimpleCalendarEvent) event.getCalendarEvent();
      bookEventWin.getFellow("cancelbutton").setVisible(true);
      ((Datebox) bookEventWin.getFellow("datetask")).setValue(setting);
      ((Datebox) bookEventWin.getFellow("datetask")).setReadonly(true);
      ((Datebox) bookEventWin.getFellow("datetask")).setButtonVisible(false);
      ((Timebox) bookEventWin.getFellow("timetask")).setValue(setting);
      ((Timebox) bookEventWin.getFellow("timetask")).setReadonly(true);
      ((Timebox) bookEventWin.getFellow("timetask")).setButtonVisible(false);
      ((Textbox) bookEventWin.getFellow("taskidfield"))
          .setValue((String) scevent.getParams().get("task"));
      ((Textbox) bookEventWin.getFellow("taskstatusfield"))
          .setValue(
              SystemDictionary.getTaskStatusLabel((String) scevent.getParams().get("status")));
      bookEventWin.getFellow("rowtaskstatus").setVisible(true);
      if (scevent.getParams().get("status").equals(SystemDictionary.TASK_STATUS_COMPLETED)) {
        bookEventWin.getFellow("cancelbutton").setVisible(false);
        String tasktype = (String) scevent.getParams().get("type");
        if (tasktype.equals(SystemDictionary.TASK_TYPE_CARERQS)
            || tasktype.equals(SystemDictionary.TASK_TYPE_PATIENTQS)) {
          // TODO retrieve Questionnaire answers and show in the task window
          Questionnaire q = (Questionnaire) scevent.getParams().get("questionnaire");
          QuestionnaireAnswers qa =
              proxy.getQuestionnaireAnswersByTask((String) scevent.getParams().get("task"), userid);
          SystemDictionary.webguiLog(
              "INFO", "task id: " + (String) scevent.getParams().get("task"));
          // SystemDictionary.webguiLog("INFO", "ANSWERS LENGTH: "+ qa.getAnswer().length);
          // SystemDictionary.webguiLog("INFO", "getQuestion: "+ q.getQuestion().length);
          ArrayList<QuestionnaireAnswer> qalist = new ArrayList<QuestionnaireAnswer>();
          if (qa.getAnswer() != null)
            for (int i = 0; i < qa.getAnswer().length; i++) {
              qalist.add(i, qa.getAnswer(i));
            }

          String responses = provideQuestionnaireResponse(toPlainList(q.getQuestion()), qalist);
          SystemDictionary.webguiLog("DEBUG", "RESPONSES: " + responses);
          bookEventWin.getFellow("qsanswersrow").setVisible(true);
          ((Label) bookEventWin.getFellow("qsanswersfield")).setValue(responses);

        } else if (tasktype.equals(SystemDictionary.TASK_TYPE_BLOODPRESSURE_MEASUREMENT)
            || tasktype.equals(SystemDictionary.TASK_TYPE_WEIGHT_MEASUREMENT)
            || tasktype.equals(SystemDictionary.TASK_TYPE_ACTMONITOR)) {
          String resultfieldvalue = "";
          SearchCriteria searchc =
              new SearchCriteria(
                  "task",
                  new SystemParameter(SystemDictionary.COMPARE_EQ, ""),
                  (String) scevent.getParams().get("task"),
                  "");
          Measurement[] results = proxy.getMeasurement(new SearchCriteria[] {searchc}, userid);
          if (results.length <= 0) {
            resultfieldvalue = "No measurement could be retrieved";
          } else {
            resultfieldvalue = "Use 'Monitor Measurements' button for viewing the measurements";
            /*SystemDictionary.webguiLog("DEBUG", "RESULTS LENGHT: "+results.length);
            for(int ii = 0 ; ii < results.length ; ii++){
            	resultfieldvalue += results[ii].getValue()+""+results[ii].getUnits()+"\n";
            }*/
          }
          bookEventWin.getFellow("mresultrow").setVisible(true);
          ((Label) bookEventWin.getFellow("mresultrowfield")).setValue(resultfieldvalue);
        }
      }
      User addressed = proxy.getUser((String) scevent.getParams().get("objid"));
      Patient patient = proxy.getPatient(addressed.getPersonID(), userid);
      ((Textbox) bookEventWin.getFellow("addressedid"))
          .setValue((String) scevent.getParams().get("objid"));
      ((Textbox) bookEventWin.getFellow("addressedstr")).setValue(patient.toString());
      User object = proxy.getUser((String) scevent.getParams().get("exec"));
      Carer executor = proxy.getCarer(object.getPersonID(), userid);
      ((Textbox) bookEventWin.getFellow("objid"))
          .setValue((String) scevent.getParams().get("exec"));
      ((Textbox) bookEventWin.getFellow("objstr")).setValue(executor.toString());
      User assigner = proxy.getUser((String) scevent.getParams().get("assign"));
      Clinician assg = proxy.getClinician(assigner.getPersonID(), userid);
      ((Textbox) bookEventWin.getFellow("userid"))
          .setValue((String) scevent.getParams().get("assign"));
      ((Textbox) bookEventWin.getFellow("userstr")).setValue(assg.toString());
      ((Textbox) bookEventWin.getFellow("tasktypetext")).setValue(scevent.getContent());
      bookEventWin.getFellow("tasktypetext").setVisible(true);
      // ((Combobox)bookEventWin.getFellow("addressedtext")).setVisible(false);
      int tasktype2 = Integer.parseInt((String) scevent.getParams().get("type"));
      this.showCustomFields(tasktype2);
      bookEventWin.getFellow("tasktypesel").setVisible(false);
      @SuppressWarnings("rawtypes")
      List items = ((Listbox) bookEventWin.getFellow("urlfield")).getItems();
      @SuppressWarnings("rawtypes")
      Iterator it = items.iterator();
      while (it.hasNext()) {
        Listitem currentitem = (Listitem) it.next();
        if (currentitem.getValue().equals((String) scevent.getParams().get("url"))) {
          ((Listbox) bookEventWin.getFellow("urlfield")).setSelectedItem(currentitem);
          break;
        }
      }
      ((Listbox) bookEventWin.getFellow("urlfield")).setDisabled(true);
      if (scevent.getParams().get("questionnaire") != null) {
        items = ((Listbox) bookEventWin.getFellow("questnamefield")).getItems();
        it = items.iterator();
        while (it.hasNext()) {
          Listitem currentitem = (Listitem) it.next();
          if (currentitem
              .getValue()
              .equals(((Questionnaire) scevent.getParams().get("questionnaire")).getID())) {
            ((Listbox) bookEventWin.getFellow("questnamefield")).setSelectedItem(currentitem);
            break;
          }
        }
      }
      ((Listbox) bookEventWin.getFellow("questnamefield")).setDisabled(true);
      // ((Textbox)bookEventWin.getFellow("urlfield")).setValue((String)scevent.getParams().get("url"));
      ((Textbox) bookEventWin.getFellow("textfield"))
          .setValue((String) scevent.getParams().get("text"));

      bookEventWin.setTitle("View Task");
      bookEventWin.setVisible(true);
      bookEventWin.doModal();
    } catch (Exception e) {
      e.printStackTrace();
      Executions.sendRedirect("");
    }
  }