本文整理汇总了Java中org.oscarehr.common.dao.DrugDao.findByDemographicId方法的典型用法代码示例。如果您正苦于以下问题:Java DrugDao.findByDemographicId方法的具体用法?Java DrugDao.findByDemographicId怎么用?Java DrugDao.findByDemographicId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.oscarehr.common.dao.DrugDao
的用法示例。
在下文中一共展示了DrugDao.findByDemographicId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMeds
import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public ActionForward getMeds(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException {
Integer demographicNo = Integer.parseInt(request.getParameter("demographicNo"));
DrugDao drugDao = SpringUtils.getBean(DrugDao.class);
List<Drug> drugs = drugDao.findByDemographicId(demographicNo, false);
StringBuilder output = new StringBuilder();
for(Drug drug:drugs) {
if(drug.isArchived() || drug.isDeleted() || drug.isDiscontinued() || drug.isExpired()) {
continue;
}
if(drug.getBrandName() != null && drug.getBrandName().length()>0) {
if(output.length()>0)
output.append(",");
output.append(drug.getBrandName());
}
else if(drug.getCustomName() != null && drug.getCustomName().length()>0) {
if(output.length()>0)
output.append(",");
output.append(drug.getCustomName());
} else {
if(output.length()>0)
output.append(",");
output.append(drug.getSpecial());
}
}
JSONObject json = JSONObject.fromObject(new LabelValueBean("meds",output.toString().trim()));
response.getWriter().println(json);
return null;
}
示例2: getPrescriptionsByPatientHideDeleted
import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public Prescription[] getPrescriptionsByPatientHideDeleted(int demographicNo) {
List<Prescription> lst = new ArrayList<Prescription>();
DrugDao dao = SpringUtils.getBean(DrugDao.class);
for (Drug drug : dao.findByDemographicId(demographicNo)) {
if ((drug.isCurrent() && !drug.isArchived() && !drug.isDeleted() && !drug.isDiscontinued()) || drug.isLongTerm()) {
lst.add(toPrescription(drug, demographicNo));
}
}
return lst.toArray(new Prescription[lst.size()]);
}
示例3: getActivePrescriptionsByPatient
import org.oscarehr.common.dao.DrugDao; //导入方法依赖的package包/类
public Prescription[] getActivePrescriptionsByPatient(int demographicNo) {
List<Prescription> lst = new ArrayList<Prescription>();
DrugDao dao = SpringUtils.getBean(DrugDao.class);
for (Drug drug : dao.findByDemographicId(demographicNo)) {
Prescription p = toPrescription(drug, demographicNo);
if (!p.isArchived() && !p.isDiscontinued() && p.isCurrent()) {
lst.add(p);
}
}
return lst.toArray(new Prescription[lst.size()]);
}