Package org.mbhcare.shared.entity

Examples of org.mbhcare.shared.entity.Fetal


  @UiHandler("listFetal")
  public void onFetalChange(ChangeEvent event) {
   
    ngaykinhcuoi.setValue(null);
    fetalId = "";
    Fetal fetal = list.get(listFetal.getSelectedIndex());
    if (!fetal.getId().equals("")){
      ngaykinhcuoi.setValue(fetal.getNgaykinhcuoi());
      fetalId = fetal.getId();     
     
      listAgeType.setSelectedIndex(0);//fetal.getDisplayType());
      lastSelectedAgeType = 0;
      onAgeTypeChange(null);
    }
View Full Code Here


        if (!d[1].equals(""))
        {
          dateNkk.setTime(Long.valueOf(d[1]));
          ngaykinhcuoi = dateFormat.format(dateNkk);
        }
        Fetal fetal =  new Fetal();
        fetal.setId(d[0]);
        fetal.setNgaykinhcuoi(dateNkk);
        fetal.setTime(Integer.valueOf(d[2]));
        fetal.setPatient(patientId);       
        //fetal.setDisplayType(Utils.parseInt(d[3]));
        list.add(fetal);
        listFetal.addItem(d[2], d[0]);
      }   
    }
    //Window.alert(String.valueOf(listFetal.getItemCount()));
    Fetal fetal =  new Fetal();
    fetal.setTime(listFetal.getItemCount());
    fetal.setPatient(patientId);
    list.add(fetal);
    listFetal.addItem(String.valueOf(listFetal.getItemCount()+1) + " ("+ constants.formNew()+")", "");
    //listFetal.setSelectedIndex(listFetal.getItemCount()-2);
    if(listFetal.getItemCount() == 1){
      listFetal.setSelectedIndex(0);
    } else {
      listFetal.setSelectedIndex(listFetal.getItemCount()-2);
   
    //set current fetal value
    Fetal currfetal = list.get(listFetal.getSelectedIndex());
    ngaykinhcuoi.setValue(currfetal.getNgaykinhcuoi());
    fetalId = currfetal.getId();
   
    listAgeType.setSelectedIndex(0);
    lastSelectedAgeType = 0;
    onAgeTypeChange(null);
  }
View Full Code Here

          Query query = pm.newQuery(Fetal.class);
          query.setFilter("patient == :patient");
          query.setResult("count(this)");
          int count = (Integer)query.execute(diagnosis.getPatient());
          //insert new one
          Fetal newfetal =  new Fetal();
          newfetal.setNgaykinhcuoi(diagnosis.getNgaykinhcuoi());
          newfetal.setPatient(diagnosis.getPatient());
          //newfetal.setDisplayType(diagnosis.getFetalDisplayType());
          newfetal.setTime(count+1);
          pm.makePersistent(newfetal);
          //set new fetal for diagnosis
          diagnosis.setFetal(newfetal.getId());

          //else update ngaykinhcuoi
        } else {
          Fetal fetal = pm.getObjectById(Fetal.class, diagnosis.getFetal());
          fetal.setNgaykinhcuoi(diagnosis.getNgaykinhcuoi());
          pm.makePersistent(fetal);
        }
        pm.currentTransaction().commit();
        // Is a insert statement?
        if(diagnosis.getId() == null) {
View Full Code Here

    try {
      //pm.currentTransaction().begin();
      for(String id : ids) {               
       
        //delete fetal
        Fetal fetal = pm.getObjectById(Fetal.class, id);
        pm.deletePersistent(fetal);
         
      }
      //pm.currentTransaction().commit();
    } catch(Exception e) {
View Full Code Here

  }

  @Override
  public Fetal selectById(String id) throws ServerException {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    Fetal fetal;
   
    try {
      fetal = pm.getObjectById(Fetal.class, id);

    } catch(Exception e) {
View Full Code Here

//    }
    try {       
      pm.currentTransaction().begin();
      // TODO check this
      if(fetal.getId() != null) {
        Fetal temp = pm.getObjectById(Fetal.class, fetal.getId());
        //temp.getFlags();       
     
      pm.makePersistent(fetal);
      pm.currentTransaction().commit();
    } catch(Exception e) {
View Full Code Here

TOP

Related Classes of org.mbhcare.shared.entity.Fetal

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.