本文整理汇总了Java中org.oscarehr.common.model.Drug.isArchived方法的典型用法代码示例。如果您正苦于以下问题:Java Drug.isArchived方法的具体用法?Java Drug.isArchived怎么用?Java Drug.isArchived使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.oscarehr.common.model.Drug
的用法示例。
在下文中一共展示了Drug.isArchived方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillRx
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private void fillRx(LoggedInInfo loggedInInfo,List<SummaryItemTo1> list,Integer demographicNo,int count){
List<Drug> drugList = rxManager.getUniqueDrugsByPatient( loggedInInfo, demographicNo);
long now = System.currentTimeMillis();
long month = 1000L * 60L * 60L * 24L * 30L;
for( Drug drug :drugList ) {
if( drug.isArchived() )
continue;
if(drug.isHideFromDrugProfile()) {
continue;
}
String styleColor = "";
if (drug.isCurrent() && (drug.getEndDate().getTime() - now <= month)) {
styleColor="style=\"color:orange;font-weight:bold;\"";
}else if (drug.isCurrent() ) {
styleColor="style=\"color:blue;\"";
}else if (drug.isLongTerm() ) {
styleColor="style=\"color:grey;\"";
}else
continue;
String tmp = "";
if (drug.getFullOutLine()!=null) tmp=drug.getFullOutLine().replaceAll(";", " ");
String strTitle = StringUtils.maxLenString(tmp, MAX_LEN_TITLE, CROP_LEN_TITLE, ELLIPSES);
SummaryItemTo1 summaryItem = new SummaryItemTo1(drug.getId(),strTitle,"action","rx");
summaryItem.setDate(drug.getRxDate());
summaryItem.setAction("../oscarRx/choosePatient.do?demographicNo="+demographicNo); // for now, open the Rx module if the user clicks on any meds.
list.add(summaryItem);
count++;
}
}
示例2: 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;
}
示例3: getPrescriptionsByPatientHideDeleted
import org.oscarehr.common.model.Drug; //导入方法依赖的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()]);
}
示例4: 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;
}
示例5: getCurrentDrugs
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private List<Drug> getCurrentDrugs(LoggedInInfo info, int id) {
List<Drug> toReturn = new ArrayList<Drug>();
for (Drug d : this.drugs) {
if (!d.isArchived()) toReturn.add(d);
}
return toReturn;
}
示例6: getArchivedDrugs
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private List<Drug> getArchivedDrugs(LoggedInInfo info, int id) {
List<Drug> toReturn = new ArrayList<Drug>();
for (Drug d : this.drugs) {
if (d.isArchived()) toReturn.add(d);
}
return toReturn;
}
示例7: findByDemographicId
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public List<Drug> findByDemographicId(Integer demographicId, Boolean archived) {
List<Drug> toReturn = new ArrayList<Drug>();
for (Drug d : this.drugs) {
if (d.isArchived() == archived) {
toReturn.add(d);
}
}
return toReturn;
}
示例8: 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);
}