Examples of MedicalSpeciality


Examples of healthwatcher.model.healthguide.MedicalSpeciality

  }

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

            //Complaint Normal
      String code = request.getInput("codeSpeciality");
      String description = request.getInput("descricaoMedica");     
      System.out.println("asdfas!! "+description);
      speciality = new MedicalSpeciality(description);
     
      //#if norelacional
//@      speciality.setCode(Integer.parseInt(code)); //Thiago alterou aqui
      //#endif
     
      //#if relacional
      speciality.setId(Long.parseLong(code));
      //#endif
     
      facade.insert(speciality);
       
            out.println(HTMLCode.htmlPageAdministrator("Operation executed", "MedicalSpecialty inserted"));
View Full Code Here

Examples of healthwatcher.model.healthguide.MedicalSpeciality

      if (repTP == null || !repTP.hasNext()) {
        out.println("</select></p></center></div>");
        out.println("<p><font color=\"red\"><b> There isn't any medical speciality.</b></font></p>");
      } else {
        MedicalSpeciality speciality;
        do {
          speciality = (MedicalSpeciality) repTP.next();
          out.println("<option value=\"" + speciality.getId() + "\"> "
              + speciality.getDescricao() + " </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

Examples of healthwatcher.model.healthguide.MedicalSpeciality

  public void execute() throws Exception {
    PrintWriter out = response.getWriter();
   
    try {
          MedicalSpeciality speciality;      
       
          if (! request.isAuthorized()) {
                throw new InvalidSessionException();
            }         
          speciality = (MedicalSpeciality) request.get(UpdateMedicalSpecialitySearch.SPECIALITY);
            String descricao = request.getInput("descricao");           
           
            speciality.setDescricao(descricao);
          facade.updateMedicalSpeciality(speciality);
            out.println(HTMLCode.htmlPageAdministrator("Operation executed", "Medical Speciality updated"));

        }catch(Exception e){
            out.println(HTMLCode.errorPage("Communication error, please try again later."));
View Full Code Here

Examples of healthwatcher.model.healthguide.MedicalSpeciality

      String query = ("select from "+MedicalSpeciality.class.getName()+" where teste == "+hehe+"");
      List<MedicalSpeciality> listEsp = (List<MedicalSpeciality>)pm.newQuery(query).execute();
      List<MedicalSpeciality> specialities = new ArrayList<MedicalSpeciality>();
     
      if (!listEsp.isEmpty()) {
        MedicalSpeciality esp = specialityRep.search(listEsp.get(0).getId());
        specialities.add(esp);
        try {
          listEsp.remove(0);
        } catch (UnsupportedOperationException uoe) {
          listEsp = new ArrayList<MedicalSpeciality>(listEsp);
          listEsp.remove(0);
        }
      } else {
        //throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }

      while(!listEsp.isEmpty()){
        MedicalSpeciality ms = specialityRep.search(listEsp.get(0).getId());
        specialities.add(ms);
        listEsp.remove(0);
      }
     
      pm.close();
View Full Code Here

Examples of healthwatcher.model.healthguide.MedicalSpeciality

  public void update(MedicalSpeciality esp) throws RepositoryException, ObjectNotFoundException,
      ObjectNotValidException {
    PersistenceManager pm = (PersistenceManager) this.mp.getCommunicationChannel();
    try {
      MedicalSpeciality e = pm.getObjectById(MedicalSpeciality.class, esp.getId());
      e.setDescricao(esp.getDescricao());
    } finally {
      pm.close();
    }
  }
View Full Code Here

Examples of healthwatcher.model.healthguide.MedicalSpeciality

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

      if (!ids.isEmpty()) {
        MedicalSpeciality 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()) {
        MedicalSpeciality ms = search(ids.get(0));
        listaEsp.add(ms);
        ids.remove(0);
      }
      pm.close();
    } catch (PersistenceMechanismException e) {
View Full Code Here

Examples of healthwatcher.model.healthguide.MedicalSpeciality

    }
  }

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

Examples of healthwatcher.model.healthguide.MedicalSpeciality

      if (!repEsp.hasNext()) {
        out.println("</select></p></center></div>");
        out.println("<P>There isn't registered specialties.</P>");
      } else {
        MedicalSpeciality esp;

        do {
          esp = (MedicalSpeciality) repEsp.next();
         
          //#if relacional
          out.println("<option value=\"" + esp.getId() + "\"> "
              + esp.getDescricao() + " </OPTION>");
          //#endif
         
          //#if norelacional
//@          out.println("<option value=\"" + esp.getCode() + "\"> "//thiago alterou aqui
//@              + esp.getDescricao() + " </OPTION>");
View Full Code Here

Examples of healthwatcher.model.healthguide.MedicalSpeciality

      if (!rs.next()) {
        throw new ObjectNotFoundException("");
      }
      do {
        MedicalSpeciality esp = search((new Long(rs.getString("codigo"))).longValue());
        listaEsp.add(esp);
      } while (rs.next());

      rs.close();
      stmt.close();
View Full Code Here

Examples of healthwatcher.model.healthguide.MedicalSpeciality

    }
  }

  public MedicalSpeciality search(Long code) throws RepositoryException, ObjectNotFoundException {

    MedicalSpeciality esp = null;
    String sql = null;
    try {
      sql = "select * from scbs_especialidade where " + "codigo = '" + code + "'";

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

      if (resultSet.next()) {
        esp = new MedicalSpeciality(resultSet.getString("descricao"));
        esp.setId((new Long(resultSet.getString("codigo"))).longValue());
      } else {
        throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
      }
      resultSet.close();
      stmt.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.