Package healthwatcher.model.complaint

Examples of healthwatcher.model.complaint.Symptom


      if (repTP == null || !repTP.hasNext()) {
        out.println("</select></p></center></div>");
        out.println("<p><font color=\"red\"><b> There isn't any symptoms.</b></font></p>");
      } else {
        Symptom symptom;
        do {
          symptom = (Symptom) repTP.next();
          out.println("<option value=\"" + symptom.getId() + "\"> "
              + symptom.getDescription() + " </OPTION>");
        } while (repTP.hasNext());
        repTP.close();

        out.println("</select></p></center></div>");
        out.println("  <div align=\"center\"><center><p><input type=\"submit\" value=\"Search\" name=\"B1\"></p></center></div></form>");
View Full Code Here


  }

  public void execute() throws Exception {
    PrintWriter out = response.getWriter();
   
    Symptom symptom = null;
      
        try {
          if (! request.isAuthorized()) {
                throw new InvalidSessionException();
            }           

            //Complaint Normal
      String code = request.getInput("code");
      String description = request.getInput("description");     
     
      symptom = new Symptom(description);
      //#if relacional
      symptom.setId(Long.parseLong(code));
      //#endif
     
      File photo=new File(request.getInput("photo"));
      PutObjectRequest putRequest=new PutObjectRequest(Constants.S3BUCKET,
          code+".jpg", photo);
View Full Code Here

      if (!i.hasNext()) {
        out.println("<P>There isn't registered symptoms.</P>");
      } else {
        while (i.hasNext()) {
          Symptom s = (Symptom) i.next();
          out.println("<li> " + s.getDescription() + " </li>");
        }
      }
      out.println(HTMLCode.closeQueries());

    } catch (ObjectNotFoundException e) {
View Full Code Here

            }       
       
           
            Long symptomCode = (new Long(request.getInput("symptomCode"))).longValue();
           
            Symptom symptom = facade.searchSymptom(symptomCode);
           
            //#if relacional
            symptom.addObserver(facade);
            //#endif
           
            request.put(SYMPTOM, symptom);
           
            out.println("Update Symptom");
            out.println("<script language=\"javascript\">");
            out.println("function submeterDados(modulo)");
            out.println("{");
   
            String a1 = "\"";
            String a2 = "\"";
   
            out.println("   var f = document.formAlterarUnidade2;");
            out.println("   if(f.descricao.value ==" + a1 + a2 + ")");
            out.println("   {");
            out.println("           alert(\"Digite a nova descri��o do sintoma!\");");
            out.println("           f.descricao.select();");
            out.println("           return;");
            out.println("   }");
            out.println("   f.operation.value = \"UpdateSymptomData\";");
            out.println("   f.submit();");
            out.println("}");
            out.println("//--></script>");
            out.println("<body><h1>Update Symptom:</h1>");
           
            out.println("<form method=\"POST\" name=\"formAlterarUnidade2\" action=\"http://"+Constants.SERVLET_SERVER_PATH+"HWServlet\">");
            out.println("<input type=\"hidden\" name=\"operation\" value=\"UpdateSymptomData\">" );
            out.println("<div align=\"center\"><center><h4>Symptom: " + symptomCode + "</h4></center></div>");                     
            out.println("<div align=\"center\"><center><p><strong>Name:</strong><br><input type=\"text\" name=\"descricao\" value=\"" + symptom.getDescription() + "\" size=\"60\"></p></center></div>");
            out.println("<div align=\"center\"><center><h4><input type=\"button\" value=\"Update\" name=\"bt1\" onClick=\"javascript:submeterDados();\"><input type=\"reset\" value=\"Clear\" name=\"bt2\"></h4></center></div></form>");
           
            out.println(HTMLCode.closeAdministrator());                               
        } catch (ObjectNotFoundException e) {
            out.println("Symptom does not exist!");
View Full Code Here

        // c�digo encontrado na tabela de relacionamentos.
        sql = "select * from scbs_sintoma where " + "codigo = '" + codeSymptom + "'";

        Statement stmt2 = (Statement) this.mp.getCommunicationChannel();
        ResultSet resultSet2 = stmt2.executeQuery(sql);
        Symptom sintoma;

        if (resultSet2.next()) {
          sintoma = new Symptom(resultSet2.getString("descricao"));
          sintoma.setId((new Long(resultSet2.getString("codigo"))).longValue());
        } else {
          // Caso esse trecho de c�digo seja executado,
          // a tabela de relacinoamentos n�o est� consistente
          // com a tabela de sintomas
          throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
View Full Code Here

    }
  }
 
  public Symptom search(Long symptomCode) throws ObjectNotFoundException, RepositoryException {
    PersistenceManager pm = (PersistenceManager) mp.getCommunicationChannel();
    Symptom esp = null;
    try{
      String query = ("select from "+Symptom.class.getName()+" where id == "+symptomCode+"");
      List<Symptom> spec = (List<Symptom>)pm.newQuery(query).execute();
      esp = spec.get(0);
    }catch(Exception e){
View Full Code Here

    try {
      List<Long> ids = (List<Long>) q.execute();

      if (!ids.isEmpty()) {
        Symptom ms = search(ids.get(0));
        listaEsp.add(ms);
        try {
          ids.remove(0);
        } catch (UnsupportedOperationException uoe) {
          ids = new ArrayList<Long>(ids);
          ids.remove(0);
        }
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }

      while (!ids.isEmpty()) {
        Symptom ms = search(ids.get(0));
        listaEsp.add(ms);
        ids.remove(0);
      }
      pm.close();
    } catch (PersistenceMechanismException e) {
View Full Code Here

  }
  public void update(Symptom symptom) throws ObjectNotValidException, ObjectNotFoundException,
    ObjectNotValidException, RepositoryException {
    PersistenceManager pm = (PersistenceManager) this.mp.getCommunicationChannel();
    try {
      Symptom e = pm.getObjectById(Symptom.class, symptom.getId());
      e.setDescription(symptom.getDescription());
    } finally {
      pm.close();
    }
  }
View Full Code Here

  public void execute() throws Exception {
    PrintWriter out = response.getWriter();
   
    try {
     
          Symptom symptom;      
       
          if (! request.isAuthorized()) {
                throw new InvalidSessionException();
            }         
          symptom = (Symptom) request.get(UpdateSymptomSearch.SYMPTOM);
            String descricao = request.getInput("descricao");           
           
            symptom.setDescription(descricao);
          facade.updateSymptom(symptom);
         
            out.println(HTMLCode.htmlPageAdministrator("Operation executed", "Symptom updated"));

        }catch(Exception e){
View Full Code Here

            throw new ObjectNotValidException(ExceptionMessages.EXC_NULO);
        }
  }
 
  public Symptom search(Long symptomCode) throws ObjectNotFoundException, RepositoryException {
    Symptom symptom = null;
    String sql=null;
    Statement stmt=null;
        try {
          // Query montada para recuperar o sintoma
          // usando o identificador da sintoma informado como
          // parametro do metodo
            sql = "select * from scbs_sintoma where "
                + "codigo = '" + symptomCode + "'";

            stmt = (Statement)this.mp.getCommunicationChannel();
            resultSet  = stmt.executeQuery(sql);


            if (resultSet.next()) {
              symptom = new Symptom(resultSet.getString("descricao"));
              symptom.setId((new Long(resultSet.getString("codigo"))).longValue());

            } else {
                throw new ObjectNotFoundException(ExceptionMessages
                    .EXC_FALHA_PROCURA);
            }
View Full Code Here

TOP

Related Classes of healthwatcher.model.complaint.Symptom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.