当前位置: 首页>>代码示例>>Java>>正文


Java DrugDao.find方法代码示例

本文整理汇总了Java中org.oscarehr.common.dao.DrugDao.find方法的典型用法代码示例。如果您正苦于以下问题:Java DrugDao.find方法的具体用法?Java DrugDao.find怎么用?Java DrugDao.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.oscarehr.common.dao.DrugDao的用法示例。


在下文中一共展示了DrugDao.find方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Delete

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public void Delete() {
	try {
		DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
		Drug drug = drugDao.find(getDrugId());
		if (drug != null) {
			drug.setArchived(true);
			drugDao.merge(drug);
		}
	} catch (Exception e) {
		logger.error("unexpected error", e);
	}
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:13,代码来源:RxPrescriptionData.java

示例2: addFav2

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public ActionForward addFav2(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException {

if (!securityInfoManager.hasPrivilege(LoggedInInfo.getLoggedInInfoFromSession(request), "_rx", "w", null)) {
	throw new RuntimeException("missing required security object (_rx)");
}
  	
      RxSessionBean bean = (RxSessionBean)request.getSession().getAttribute("RxSessionBean");
      if(bean==null) {
          response.sendRedirect("error.html");
          return null;
      }
      String randomId=request.getParameter("randomId");
      String favoriteName=request.getParameter("favoriteName");
      String drugIdStr=request.getParameter("drugId");
      String providerNo = bean.getProviderNo();

      if(drugIdStr!=null){
          int drugId=Integer.parseInt(drugIdStr);
      	DrugDao drugDao=(DrugDao) SpringUtils.getBean("drugDao");        	
          Drug drug=drugDao.find(drugId);
          RxPrescriptionData.addToFavorites(providerNo, favoriteName, drug);
      }
      else{
          int stashId=bean.getIndexFromRx(Integer.parseInt(randomId));
          bean.getStashItem(stashId).AddToFavorites(providerNo, favoriteName);
      }
     
      /*
      request.setAttribute("BoxNoFillFirstLoad", "true");
      MiscUtils.getLogger().debug("fill box no");
      */
      RxUtil.printStashContent(bean);

      return null;
  }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:40,代码来源:RxAddFavoriteAction.java

示例3: Delete

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public void Delete() {
    try {
    	DrugDao drugDao=(DrugDao) SpringUtils.getBean("drugDao");
    	Drug drug=drugDao.find(getDrugId());
    	if (drug!=null)
    	{
    		drug.setArchived(true);
    		drugDao.merge(drug);
    	}
    } catch (Exception e) {
        logger.error("unexpected error", e);
    }
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:14,代码来源:RxPrescriptionData.java

示例4: addFav2

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public ActionForward addFav2(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException {

    RxSessionBean bean = (RxSessionBean)request.getSession().getAttribute("RxSessionBean");
    if(bean==null) {
        response.sendRedirect("error.html");
        return null;
    }
    String randomId=request.getParameter("randomId");
    String favoriteName=request.getParameter("favoriteName");
    String drugIdStr=request.getParameter("drugId");
    String providerNo = bean.getProviderNo();

    if(drugIdStr!=null){
        int drugId=Integer.parseInt(drugIdStr);
    	DrugDao drugDao=(DrugDao) SpringUtils.getBean("drugDao");        	
        Drug drug=drugDao.find(drugId);
        RxPrescriptionData.addToFavorites(providerNo, favoriteName, drug);
    }
    else{
        int stashId=bean.getIndexFromRx(Integer.parseInt(randomId));
        bean.getStashItem(stashId).AddToFavorites(providerNo, favoriteName);
    }
   
    /*
    request.setAttribute("BoxNoFillFirstLoad", "true");
    MiscUtils.getLogger().debug("fill box no");
    */
    RxUtil.printStashContent(bean);

    return null;
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:36,代码来源:RxAddFavoriteAction.java

示例5: getPrescription

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public Prescription getPrescription(int drugId) {

		DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
		Drug drug = drugDao.find(drugId);

		Prescription prescription = new Prescription(drugId, drug.getProviderNo(), drug.getDemographicId());
		prescription.setRxCreatedDate(drug.getCreateDate());
		prescription.setRxDate(drug.getRxDate());
		prescription.setEndDate(drug.getEndDate());
		prescription.setWrittenDate(drug.getWrittenDate());
		prescription.setBrandName(drug.getBrandName());
		prescription.setGCN_SEQNO(drug.getGcnSeqNo());
		prescription.setCustomName(drug.getCustomName());
		prescription.setTakeMin(drug.getTakeMin());
		prescription.setTakeMax(drug.getTakeMax());
		prescription.setFrequencyCode(drug.getFreqCode());
		String dur = drug.getDuration();
		if (StringUtils.isBlank(dur) || dur.equalsIgnoreCase("null")) dur = "";
		prescription.setDuration(dur);
		prescription.setDurationUnit(drug.getDurUnit());
		prescription.setQuantity(drug.getQuantity());
		prescription.setDispensingUnits(drug.getDispensingUnits());
		prescription.setRepeat(drug.getRepeat());
		prescription.setLastRefillDate(drug.getLastRefillDate());
		prescription.setNosubs(drug.isNoSubs());
		prescription.setPrn(drug.isPrn());
		prescription.setSpecial(drug.getSpecial());
		prescription.setGenericName(drug.getGenericName());
		prescription.setAtcCode(drug.getAtc());
		prescription.setScript_no(String.valueOf(drug.getScriptNo()));
		prescription.setRegionalIdentifier(drug.getRegionalIdentifier());
		prescription.setUnit(drug.getUnit());
		prescription.setUnitName(drug.getUnitName());
		prescription.setMethod(drug.getMethod());
		prescription.setRoute(drug.getRoute());
		prescription.setDrugForm(drug.getDrugForm());
		prescription.setCustomInstr(drug.isCustomInstructions());
		prescription.setDosage(drug.getDosage());
		prescription.setLongTerm(drug.isLongTerm());
		prescription.setCustomNote(drug.isCustomNote());
		prescription.setPastMed(drug.getPastMed());
		prescription.setDispenseInternal(drug.getDispenseInternal());
		prescription.setStartDateUnknown(drug.getStartDateUnknown());
		prescription.setComment(drug.getComment());
		if (drug.getPatientCompliance() == null) prescription.setPatientCompliance(null);
		else prescription.setPatientCompliance(drug.getPatientCompliance());
		prescription.setOutsideProviderName(drug.getOutsideProviderName());
		prescription.setOutsideProviderOhip(drug.getOutsideProviderOhip());
		prescription.setSpecialInstruction(drug.getSpecialInstruction());
		prescription.setPickupDate(drug.getPickUpDateTime());
		prescription.setPickupTime(drug.getPickUpDateTime());
		prescription.setETreatmentType(drug.getETreatmentType());
		prescription.setRxStatus(drug.getRxStatus());
		if (drug.getDispenseInterval() != null) prescription.setDispenseInterval(drug.getDispenseInterval());
		if (drug.getRefillDuration() != null) prescription.setRefillDuration(drug.getRefillDuration());
		if (drug.getRefillQuantity() != null) prescription.setRefillQuantity(drug.getRefillQuantity());

		if (prescription.getSpecial() == null || prescription.getSpecial().length() <= 6) {
			logger.warn("I strongly suspect something is wrong, either special is null or it appears to not contain anything useful. drugId=" + drugId + ", drug.special=" + prescription.getSpecial());
			logger.warn("data from db is : " + drug.getSpecial());
		}
		prescription.setDispenseInternal(drug.getDispenseInternal());
		return prescription;
	}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:65,代码来源:RxPrescriptionData.java

示例6: unspecified

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public ActionForward unspecified(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {
  	
if (!securityInfoManager.hasPrivilege(LoggedInInfo.getLoggedInInfoFromSession(request), "_rx", "w", null)) {
	throw new RuntimeException("missing required security object (_rx)");
}
      
      // Setup variables        
      
      RxAddFavoriteForm frm = (RxAddFavoriteForm)form;
      
      String favoriteName = frm.getFavoriteName();
      
      RxSessionBean bean = (RxSessionBean)request.getSession().getAttribute("RxSessionBean");
      if(bean==null) {
          response.sendRedirect("error.html");
          return null;
      }
      
      String providerNo = bean.getProviderNo();
      
      if(frm.getDrugId()!=null) {
          int drugId = Integer.parseInt(frm.getDrugId());
          
      	DrugDao drugDao=(DrugDao) SpringUtils.getBean("drugDao");        	
          Drug drug=drugDao.find(drugId);
          RxPrescriptionData.addToFavorites(providerNo, favoriteName, drug);
      }
      else {
          int stashId = Integer.parseInt(frm.getStashId());
          
          bean.getStashItem(stashId).AddToFavorites(providerNo, favoriteName);
      }
      
      ActionForward fwd = mapping.findForward("success");
      String s = fwd.getPath() + frm.getReturnParams();
      request.setAttribute("BoxNoFillFirstLoad", "true");
      MiscUtils.getLogger().debug("fill box no");
      
      fwd = new ActionForward(s, true);
      
      return fwd;
  }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:47,代码来源:RxAddFavoriteAction.java

示例7: getPrescription

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public Prescription getPrescription(int drugId) {

		DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
		Drug drug = drugDao.find(drugId);

		Prescription prescription = new Prescription(drugId, drug.getProviderNo(), drug.getDemographicId());
		prescription.setRxCreatedDate(drug.getCreateDate());
		prescription.setRxDate(drug.getRxDate());
		prescription.setEndDate(drug.getEndDate());
		prescription.setWrittenDate(drug.getWrittenDate());
		prescription.setBrandName(drug.getBrandName());
		prescription.setGCN_SEQNO(drug.getGcnSeqNo());
		prescription.setCustomName(drug.getCustomName());
		prescription.setTakeMin(drug.getTakeMin());
		prescription.setTakeMax(drug.getTakeMax());
		prescription.setFrequencyCode(drug.getFreqCode());
		String dur = drug.getDuration();
		if(StringUtils.isBlank(dur) || dur.equalsIgnoreCase("null") ) dur = "";
		prescription.setDuration(dur);
		prescription.setDurationUnit(drug.getDurUnit());
		prescription.setQuantity(drug.getQuantity());
		prescription.setRepeat(drug.getRepeat());
		prescription.setLastRefillDate(drug.getLastRefillDate());
		prescription.setNosubs(drug.isNoSubs());
		prescription.setPrn(drug.isPrn());
		prescription.setSpecial(drug.getSpecial());
		prescription.setGenericName(drug.getGenericName());
		prescription.setAtcCode(drug.getAtc());
		prescription.setScript_no(String.valueOf(drug.getScriptNo()));
		prescription.setRegionalIdentifier(drug.getRegionalIdentifier());
		prescription.setUnit(drug.getUnit());
		prescription.setUnitName(drug.getUnitName());
		prescription.setMethod(drug.getMethod());
		prescription.setRoute(drug.getRoute());
		prescription.setDrugForm(drug.getDrugForm());
		prescription.setCustomInstr(drug.isCustomInstructions());
		prescription.setDosage(drug.getDosage());
		prescription.setLongTerm(drug.isLongTerm());
		prescription.setCustomNote(drug.isCustomNote());
		prescription.setPastMed(drug.getPastMed());
		prescription.setStartDateUnknown(drug.getStartDateUnknown());
		prescription.setComment(drug.getComment());
		if (drug.getPatientCompliance() == null) prescription.setPatientCompliance(null);
		else prescription.setPatientCompliance(drug.getPatientCompliance());
		prescription.setOutsideProviderName(drug.getOutsideProviderName());
		prescription.setOutsideProviderOhip(drug.getOutsideProviderOhip());
		prescription.setSpecialInstruction(drug.getSpecialInstruction());
		prescription.setPickupDate(drug.getPickUpDateTime());
		prescription.setPickupTime(drug.getPickUpDateTime());
		prescription.setETreatmentType(drug.getETreatmentType());
		prescription.setRxStatus(drug.getRxStatus());
		if (drug.getDispenseInterval() != null) prescription.setDispenseInterval(drug.getDispenseInterval());
		if (drug.getRefillDuration() != null) prescription.setRefillDuration(drug.getRefillDuration());
		if (drug.getRefillQuantity() != null) prescription.setRefillQuantity(drug.getRefillQuantity());

		if (prescription.getSpecial() == null || prescription.getSpecial().length() <= 6) {
			logger.error("I strongly suspect something is wrong, either special is null or it appears to not contain anything useful. drugId=" + drugId + ", drug.special=" + prescription.getSpecial(), new IllegalStateException("Drug special is blank or invalid"));
			logger.error("data from db is : " + drug.getSpecial());
		}

		return prescription;
	}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:63,代码来源:RxPrescriptionData.java

示例8: unspecified

import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public ActionForward unspecified(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
    
    // Setup variables        
    
    RxAddFavoriteForm frm = (RxAddFavoriteForm)form;
    
    String favoriteName = frm.getFavoriteName();
    
    RxSessionBean bean = (RxSessionBean)request.getSession().getAttribute("RxSessionBean");
    if(bean==null) {
        response.sendRedirect("error.html");
        return null;
    }
    
    String providerNo = bean.getProviderNo();
    
    if(frm.getDrugId()!=null) {
        int drugId = Integer.parseInt(frm.getDrugId());
        
    	DrugDao drugDao=(DrugDao) SpringUtils.getBean("drugDao");        	
        Drug drug=drugDao.find(drugId);
        RxPrescriptionData.addToFavorites(providerNo, favoriteName, drug);
    }
    else {
        int stashId = Integer.parseInt(frm.getStashId());
        
        bean.getStashItem(stashId).AddToFavorites(providerNo, favoriteName);
    }
    
    ActionForward fwd = mapping.findForward("success");
    String s = fwd.getPath() + frm.getReturnParams();
    request.setAttribute("BoxNoFillFirstLoad", "true");
    MiscUtils.getLogger().debug("fill box no");
    
    fwd = new ActionForward(s, true);
    
    return fwd;
}
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:43,代码来源:RxAddFavoriteAction.java


注:本文中的org.oscarehr.common.dao.DrugDao.find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。