Package healthwatcher.model.complaint

Examples of healthwatcher.model.complaint.Complaint


      Address endOcorrencia = new Address(ruaOcorrencia, compOcorrencia,
          cepOcorrencia, ufOcorrencia, telefoneOcorrencia,
          cidadeOcorrencia, bairroOcorrencia);
      Calendar agora = Calendar.getInstance();

      Complaint queixa = new SpecialComplaint(nomeSolicitante,
          descricaoQueixa, observacaoQueixa, emailSolicitante, null,
          1, null, new Date(agora.get(Calendar.DAY_OF_MONTH), agora
              .get(Calendar.MONTH), agora.get(Calendar.YEAR)),
          endSolicitante, idade, instrucao, ocupacao, endOcorrencia);
View Full Code Here


  }

    public void execute() throws Exception {
    PrintWriter out = response.getWriter();
   
        Complaint queixa;

        try {
            String descricaoQueixa = request.getInput("descricaoQueixa");
            String observacaoQueixa = request.getInput("observacaoQueixa");
            String nomeSolicitante = request.getInput("nomeSolicitante");
View Full Code Here

    PrintWriter out = response.getWriter();

    Long codQueixa = Long.parseLong(request.getInput("codQueixa"));

    try {
      Complaint q = facade.searchComplaint(codQueixa);

      out.println(HTMLCode.open("Queries - Complaints"));

      out.println("<body><h1>Search response<br>Complaint: " + codQueixa
          + "</h1>");

      out.println("<P>Complaint code: " + q.getCodigo() + "</P>");

      String t = null;

      if (q instanceof SpecialComplaint) {
        t = "Special";
      } else if (q instanceof FoodComplaint) {
        t = "Food";
      } else if (q instanceof AnimalComplaint) {
        t = "Animal";
      }

      out.println("<P>Complaint kind: " + t + "</P>");
      out.println("<P>Complainer: " + q.getSolicitante() + "</P>");
      out.println("<P>E-mail: " + q.getEmail() + "</P>");
      out.println("<P>Complaint's description: " + q.getDescricao()
          + "</P>");
      out.println("<P>Observation: " + q.getObservacao() + "</P>");

      if (q.getDataQueixa() != null) {
        out.println("<P>Date: "
            + lib.util.Date.format(q.getDataQueixa(),
                lib.util.Date.FORMATO1) + "</P>");
      }

      String sit;
      if (q.getSituacao() == Situation.QUEIXA_ABERTA) {
        sit = "Open";
      } else if (q.getSituacao() == Situation.QUEIXA_FECHADA) {
        sit = "Closed";
      } else {
        sit = "Suspended";
      }

      out.println("<P>Status: " + sit + "</P>");

      if (q.getSituacao() == Situation.QUEIXA_FECHADA) {
        if (q.getDataParecer() != null) {
          out.println("<P>Observation Date: "
              + lib.util.Date.format(q.getDataParecer(),
                  lib.util.Date.FORMATO1) + "</P>");
        }
      }

      Address end = q.getEnderecoSolicitante();

      if (end != null) {
        out.println("<P>Complainer's address: " + end.getStreet() + ","
            + end.getComplement() + " Province: "
            + end.getNeighbourhood() + " </P>");
View Full Code Here

       
  public void notify(Subject subject) throws TransactionException, ObjectNotFoundException,
      RepositoryException, RemoteException, ObjectNotValidException {
    try {
      if (subject instanceof Complaint) {
        Complaint complaint = (Complaint) subject;
        updateComplaint(complaint);
       
      } else if (subject instanceof Employee) {
        Employee employee = (Employee) subject;
        updateEmployee(employee);
View Full Code Here

   */
  public Complaint search(Long code) throws RepositoryException, ObjectNotFoundException {

    PersistenceManager pm = (PersistenceManager) mp.getCommunicationChannel();
    //pm.setDetachAllOnCommit(true);
    Complaint obj = null;

    Long id = null;
    String email = null;
    String descricao = null;
    Address enderecoSolicitante = null;
    String solicitante = null;
    String observation = null;
    Employee attendant = null;
    int situacao = 1;
    long timestamp = 0;

    try{

      String queryFood = ("select from "+FoodComplaint.class.getName()+" where id == "+code+"");
      List<FoodComplaint> food = (List<FoodComplaint>) pm.newQuery(queryFood).execute();

      String queryAnimal = ("select from "+AnimalComplaint.class.getName()+" where id == "+code+"");
      List<AnimalComplaint> animal = (List<AnimalComplaint>) pm.newQuery(queryAnimal).execute();

      String querySpecial = ("select from "+SpecialComplaint.class.getName()+" where id == "+code+"");
      List<SpecialComplaint> special = (List<SpecialComplaint>) pm.newQuery(querySpecial).execute();

      if (!animal.isEmpty()){
        id = animal.get(0).getId();
        email = animal.get(0).obterEmail();
        descricao = animal.get(0).obterDescricao();
        enderecoSolicitante = animal.get(0).obterEnderecoSolicitante();
        solicitante = animal.get(0).obterSolicitante();
        observation = animal.get(0).obterObservation();
        //attendant = animal.get(0).obterAttendant();
        timestamp = animal.get(0).obterTimestamp();
        situacao = animal.get(0).getSituacao();

        obj = animal.get(0);

      } else if(!food.isEmpty()){
        id = food.get(0).getId();
        solicitante = food.get(0).obterSolicitante();
        email = food.get(0).obterEmail();
        descricao = food.get(0).obterDescricao();
        observation = food.get(0).obterObservation();
        enderecoSolicitante = food.get(0).obterEnderecoSolicitante();
        //attendant = food.get(0).obterAttendant();
        situacao = food.get(0).getSituacao();

        obj = food.get(0);

      } else if (!special.isEmpty()){
        id = special.get(0).getId();
        solicitante = special.get(0).obterSolicitante();
        email = special.get(0).obterEmail();
        descricao = special.get(0).obterDescricao();
        observation = special.get(0).obterObservation();
        enderecoSolicitante = special.get(0).obterEnderecoSolicitante();
        //attendant = special.get(0).obterAttendant();
        situacao = special.get(0).getSituacao();

        obj = special.get(0);
      }

    } catch(Exception e) {
      e.printStackTrace();
    }

    obj.setCodigo(id);
    obj.setEmail(email);
    obj.setDescricao(descricao);
    obj.setEnderecoSolicitante(enderecoSolicitante);
    obj.setSolicitante(solicitante);
    obj.setObservacao(observation);
    obj.setAtendente(attendant);
    obj.setTimestamp(timestamp);
    obj.setSituacao(situacao);

    return obj;

  }
View Full Code Here

  public IteratorDsk getComplaintList() throws ObjectNotFoundException, RepositoryException {
    List<Complaint> cList = new ArrayList<Complaint>();
    PersistenceManager pm = (PersistenceManager) this.mp.getCommunicationChannel();   

    Complaint complaint = null;

    try {

      String queryFood = ("select id from "+FoodComplaint.class.getName());
      List<Long> food = (List<Long>) pm.newQuery(queryFood).execute();
View Full Code Here

              if (repTP==null||!repTP.hasNext()) {               
                  out.println("<p><center><font color=\"red\"><b> There isn't any complaints.</b></font></center></p>");
              } else {
                out.println("<div align=\"center\"><center><p><select name=\"numQueixa\" size=\"1\">");             
                  Complaint tp;
                  do {
                      tp = (Complaint) repTP.next();
                      out.println("<option value=\""      +
                                  tp.getCodigo() + "\"> " +
                                  tp.getDescricao()      +
                                  " </OPTION>");                   
                  } while (repTP.hasNext());
                  repTP.close();
                 
                  out.println("</select></p></center></div>");
View Full Code Here

          if (! request.isAuthorized()) {
                throw new InvalidSessionException();
           
         
            Long numQueixa = (new Long(request.getInput("numQueixa"))).longValue();
            Complaint q = facade.searchComplaint(numQueixa);
            q.addObserver(facade);
           
            request.put(UpdateComplaintSearch.QUEIXA, q);
           
            if (q.getSituacao() != Situation.QUEIXA_ABERTA) {
                throw new ObjectNotValidException("Complaint not open");
            }

            out.println(HTMLCode.open("Update complaint"));
            out.println("<script language=\"javascript\">");
            out.println("function submeterDados()");
            out.println("{");
   
            String a1 = "\"";
            String a2 = "\"";
   
            out.println("   var f = document.formAlterarQueixa2;");
            out.println("   if(f.obsQueixa.value ==" + a1 + a2 + ")");
            out.println("   {");
            out.println("           alert(\"Digite o parecer da queixa!\");");
            out.println("           f.obsQueixa.select();");
            out.println("           return;");
            out.println("   }");
            out.println("   f.submit();");
            out.println("}");
            out.println("//--></script>");
            out.println("<body><h1>Update Complaint:</h1>");
   
            out.println("<form method=\"POST\" name=\"formAlterarQueixa2\" action=\""+Constants.SYSTEM_ACTION+"?operation=UpdateComplaintData\">");
            out.println("<div align=\"center\"><center><h4>Complaint : " + numQueixa+ "</h4></center></div>");

            String t = null;
      if (q instanceof SpecialComplaint) {
        t = "Special complaint";
            } else if (q instanceof FoodComplaint) {
              t = "Food complaint";
            } else if (q instanceof AnimalComplaint) {
              t = "Animal complaint";
            }

      out.println("<div align=\"center\"><center><p><strong>Complaint kind: "+t+"</strong></p></center></div>");
            out.println("<div align=\"center\"><center><p><strong>Description: "+ q.getDescricao() + "</strong></p></center></div>");
            out.println("<div align=\"center\"><center><p><strong>Observation (complaint's solution):</strong><br><textarea rows=\"5\" name=\"obsQueixa\" cols=\"22\"></textarea></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 (InvalidSessionException e) {
          out.println(HTMLCode.errorPageAdministrator("<p>Ivalid Session! <br>You must <a href=\""+Constants.SYSTEM_LOGIN+"\">login</a> again!"));
View Full Code Here

      String localAtendimento = request.getInput("localAtendimento");
      String refeicaoSuspeita = request.getInput("refeicaoSuspeita");
      Calendar agora = Calendar.getInstance();

      Complaint queixa = new FoodComplaint(nomeSolicitante,
          descricaoQueixa, observacaoQueixa, emailSolicitante, null,
          1, null, new Date(agora.get(Calendar.DAY_OF_MONTH), agora
              .get(Calendar.MONTH), agora.get(Calendar.YEAR)),
          endSolicitante, qtdeComensais, qtdeDoentes,
          qtdeInternacoes, qtdeObitos, localAtendimento,
View Full Code Here

    }
  }

  public Complaint search(Long codigo) throws RepositoryException, ObjectNotFoundException {
    synchronized (this) {
      Complaint response = null;
      int i = getIndex(codigo);
      if (i == indice) {
        throw new ObjectNotFoundException("Complaint not found");
      } else {
        response = vetor[i];
View Full Code Here

TOP

Related Classes of healthwatcher.model.complaint.Complaint

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.