Examples of Medication


Examples of com.krminc.phr.domain.Medication

                throw new WebApplicationException(Response.Status.PRECONDITION_FAILED);
            }
           
            persistenceSvc.beginTx();
            EntityManager em = persistenceSvc.getEntityManager();
            Medication entity = data.resolveEntity(em);
            createEntity(data.resolveEntity(em));
            persistenceSvc.commitTx();
            return Response.created(uriInfo.getAbsolutePath().resolve(entity.getMedicationId() + "/")).build();
        } finally {
            persistenceSvc.close();
        }
    }
View Full Code Here

Examples of com.krminc.phr.domain.Medication

    final Logger logger = LoggerFactory.getLogger(ImmunizationConverter.class);
    public boolean hasError = false;
   
    /** Creates a new instance of MedicationConverter */
    public MedicationConverter() {
        entity = new Medication();
    }
View Full Code Here

Examples of databeans.Medication

    }
  }
  public void create(Medication med) throws DAOException {
    try{
      Transaction.begin();
      Medication dbMed = factory.create(med.getMedid());
      factory.copyInto(med,dbMed);
      Transaction.commit();
    }catch(DuplicateKeyException e){
      throw new DAOException("A medication named " + med.getName() + "has already existed.");
    }catch(RollbackException e){
View Full Code Here

Examples of databeans.Medication

    Medication[] medlist = medDAO.getMedicationList(user.getEmailAddress());
    if(medlist!=null) {
      for(int i = 0; i < medlist.length; i++) {
        // create new schedule object for each medication time
        Medication m = medlist[i];
        int freq1 = getFreq1(m); // number of times
        int freq2 = getFreq2(m); // every x hours
        int startTimeInMin = getStartTimeInMin(m);
        int startHr = getStartHr(m);
        ScheduleItem[] daily = new ScheduleItem[freq1];
        // create array of start times
        int[] times = new int[freq1];
        for(int j = 0; j < freq1; j++) {
          times[j] = startHr+freq2*j;
          // create schedule item
          daily[j] = new ScheduleItem();
          daily[j].setSortTime(startTimeInMin+freq2*j*60);
          daily[j].setTime(times[j] + ":" + m.getStartTimeMin());
          daily[j].setName(m.getName());
        }
        // add schedule items to correct days
        String[] days = getDays(m);
        populateSchedule(days, daily);
      }
View Full Code Here

Examples of databeans.Medication

          }
          dayCheckDL = dayCheckDL.substring(4,dayCheckDL.length());
          //if user want some medication schedule be deleted.
          if(delMed != null){
            newMed = delMed;
            addMed = new Medication(Integer.parseInt(newMed));
            createMed(addMed,form);
            addMed.setUsername(user.getEmailAddress());
            addMed.setDayChecks(dayCheckDL);
            //addMed.setAllNum(allNum + 1); 
            //create a new user.
            medDAO.create(addMed);
            synchronized(session){
        session.setAttribute("deletelist",delList);
        request.setAttribute("addmedform", null);
        request.setAttribute("message","Successfully added " + form.getName()+ ". ");
        }
          //if no scheduled medication be deleted.
          }else{
            int allSize = medDAO.size();
            //System.out.println("all size is " + Integer.toString(allSize));
            //initialization situation.
            if(allSize == 0){
              newMed = Integer.toString(allSize);
                System.out.println("all size is " + newMed);
              addMed = new Medication(Integer.parseInt(newMed));
              createMed(addMed,form);
                addMed.setUsername(user.getEmailAddress());
                addMed.setDayChecks(dayCheckDL);
                medDAO.create(addMed);
                synchronized(session){
            session.setAttribute("deletelist", null);
            request.setAttribute("addmedform", null);
            request.setAttribute("message","Successfully added " + form.getName() + ".");
                }
            }else{
              allSize = medDAO.getLastId();
              newMed = Integer.toString(allSize);
              addMed = new Medication(Integer.parseInt(newMed) + 1);
              createMed(addMed,form);
                addMed.setUsername(user.getEmailAddress());
                addMed.setDayChecks(dayCheckDL);
                medDAO.create(addMed);
                synchronized(session){
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.