本文整理汇总了Java中org.oscarehr.common.model.Drug.getCustomName方法的典型用法代码示例。如果您正苦于以下问题:Java Drug.getCustomName方法的具体用法?Java Drug.getCustomName怎么用?Java Drug.getCustomName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.oscarehr.common.model.Drug
的用法示例。
在下文中一共展示了Drug.getCustomName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMeds
import org.oscarehr.common.model.Drug; //导入方法依赖的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: getUniquePrescriptions
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public List<Drug> getUniquePrescriptions(String demographic_no) {
List<Drug> rs = findByDemographicIdOrderByPosition(new Integer(demographic_no), false);
List<Drug> rt = new ArrayList<Drug>();
for (Drug drug : rs) {
// Drug prescriptDrug = new PrescriptDrug();
boolean b = true;
for (int i = 0; i < rt.size(); i++) {
Drug p2 = rt.get(i);
if (p2.getGcnSeqNo() == drug.getGcnSeqNo()) {
if (p2.getGcnSeqNo() != 0) { // not custom - safe GCN
b = false;
} else {// custom
if (p2.getCustomName() != null && drug.getCustomName() != null) {
if (p2.getCustomName().equals(drug.getCustomName())) { // same custom
b = false;
}
}
}
}
}
if (b) {
rt.add(drug);
}
}
return rt;
}
示例3: addToFavorites
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public static boolean addToFavorites(String providerNo, String favoriteName, Drug drug) {
Favorite fav = new Favorite(0, providerNo, favoriteName, drug.getBrandName(), drug.getGcnSeqNo(), drug.getCustomName(), drug.getTakeMin(), drug.getTakeMax(), drug.getFreqCode(), drug.getDuration(), drug.getDurUnit(), drug.getQuantity(), drug.getDispensingUnits(), drug.getRepeat(), drug.isNoSubs(), drug.isPrn(), drug.getSpecial(), drug.getGenericName(), drug.getAtc(), drug.getRegionalIdentifier(), drug.getUnit(), drug.getUnitName(), drug.getMethod(), drug.getRoute(), drug.getDrugForm(), drug.isCustomInstructions(),
drug.getDosage());
fav.setDispenseInternal(drug.getDispenseInternal());
return fav.Save();
}
示例4: getDrugDisplayData
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private static DrugDisplayData getDrugDisplayData(Drug drug) {
DrugDisplayData drugDisplayData = new DrugDisplayData();
drugDisplayData.localDrugId = drug.getId();
RxProviderData.Provider prov = new RxProviderData().getProvider(drug.getProviderNo());
drugDisplayData.providerName = prov.getFirstName() + ' ' + prov.getSurname();
drugDisplayData.startDate = RxUtil.DateToString(drug.getRxDate());
drugDisplayData.dateStartDate = drug.getRxDate();
drugDisplayData.endDate = RxUtil.DateToString(drug.getEndDate());
drugDisplayData.writtenDate = RxUtil.DateToString(drug.getWrittenDate());
drugDisplayData.prescriptionDetails = RxPrescriptionData.getFullOutLine(drug.getSpecial()).replaceAll(";", " ");
drugDisplayData.nonAuthoritative = drug.isNonAuthoritative();
drugDisplayData.genericName = drug.getGenericName();
drugDisplayData.customName = drug.getCustomName();
drugDisplayData.brandName = drug.getBrandName();
drugDisplayData.isArchived = drug.isArchived();
drugDisplayData.pickupDate = RxUtil.DateToString(drug.getPickUpDateTime(),"yyyy-MM-dd");
drugDisplayData.pickupTime = RxUtil.DateToString(drug.getPickUpDateTime(),"hh:mm aa");
drugDisplayData.eTreatmentType = drug.getETreatmentType();
drugDisplayData.rxStatus = drug.getRxStatus();
drugDisplayData.dispenseInterval = drug.getDispenseInterval();
drugDisplayData.refillDuration = drug.getRefillDuration();
drugDisplayData.refillQuantity = drug.getRefillQuantity();
return (drugDisplayData);
}