本文整理汇总了Java中org.oscarehr.common.model.Drug.getEndDate方法的典型用法代码示例。如果您正苦于以下问题:Java Drug.getEndDate方法的具体用法?Java Drug.getEndDate怎么用?Java Drug.getEndDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.oscarehr.common.model.Drug
的用法示例。
在下文中一共展示了Drug.getEndDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLastEndDateForCustomRx
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public Date getLastEndDateForCustomRx(int demoNo, String rxName) {
if (rxName == null) {
return null;
}
DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
Drug drug = drugDao.getLastRxForCustomRx(demoNo, rxName);
return (drug != null)?drug.getEndDate():null;
}
示例2: canPrescribe
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
/**
* Determines if all of the information to create a valid prescription is
* present in the drug object. Only check the bare minimum fields.
*
* @param d the drug to check.
* @return true if the drug contains the required fields, false otherwise.
*/
protected Boolean canPrescribe(Drug d){
if(d == null) return false;
if(d.getProviderNo() == null || d.getProviderNo().equals("")) return false;
if(d.getDemographicId() == null || d.getDemographicId() < 0) return false;
if(d.getRxDate() == null) return false;
if(d.getEndDate() == null || d.getRxDate().after(d.getEndDate())) return false;
if(d.getSpecial() == null || d.getSpecial().equals("")) return false;
return true;
}
示例3: compare
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public int compare(Drug a,Drug b) {
long now = System.currentTimeMillis();
long month = 1000L * 60L * 60L * 24L * 30L;
//current
if (!a.isExpired() && !a.isArchived()) {
if(!b.isExpired() && b.getEndDate()!=null && (b.getEndDate().getTime() - now <= month)) {
return -1;
}
if(b.isExpired() || b.isArchived() || b.isDiscontinued()) {
return -1;
}
}
//current but will expire
if (!a.isExpired() && a.getEndDate()!=null && (a.getEndDate().getTime() - now <= month)) {
if(b.isExpired() || b.isDiscontinued()) {
return -1;
}
}
//expired
if(a.isExpired() && b.isDiscontinued()) {
return -1;
}
//discontinued
if(a.isDiscontinued() && !b.isDiscontinued()) {
return 1;
}
if(a.isExpired()) {
if(!b.isExpired() && b.getEndDate()!=null && (b.getEndDate().getTime() - now <= month)) {
return 1;
}
if(!b.isExpired() && !b.isArchived()) {
return 1;
}
}
if(!a.isExpired() && a.getEndDate()!=null && (a.getEndDate().getTime() - now <= month)) {
if(!b.isExpired() && !b.isArchived()) {
return 1;
}
}
//all other are the same
return 0;
}