本文整理汇总了Java中org.oscarehr.common.model.Drug.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Drug.getId方法的具体用法?Java Drug.getId怎么用?Java Drug.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.oscarehr.common.model.Drug
的用法示例。
在下文中一共展示了Drug.getId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: checkDiscontinuedBefore
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public static boolean checkDiscontinuedBefore(RxPrescriptionData.Prescription rx) {
//check if this drug was discontinued before
//String sql="SELECT * FROM drugs WHERE archived=1 AND (archived_reason>'' OR archived_reason<'' ) AND ATC='" + this.atcCode + "' AND regional_identifier='" + this.regionalIdentifier + "' AND demographic_no=" + this.demographicNo+" order by written_date desc";
//the query will fail to check if a drug A is prescribed, and drug A is prescribed again, and then the first drug A is discontinued,when the second drug A is represcribed
//or a third drug A is added, no warning will be given.
boolean discontinuedLatest = false;
DrugDao dao = SpringUtils.getBean(DrugDao.class);
Drug drug = dao.findByDemographicIdRegionalIdentifierAndAtcCode(rx.getAtcCode(), rx.getRegionalIdentifier(), rx.getDemographicNo());
if (drug != null) {//get the first result which has the largest drugid and hence the most recent result.
int drugId = drug.getId();
boolean isLastPrescribed = checkLastPrescribed(rx, drugId);//check if this drug was saved after discontinued.
if (isLastPrescribed) {
//get date discontinued
//get reason for discontinued
Date archivedDate = drug.getArchivedDate();
// String archDate = rs.getString("archived_date");
String archDate = RxUtil.DateToString(archivedDate);
String archReason = drug.getArchivedReason();
rx.setLastArchDate(archDate);
rx.setLastArchReason(archReason);
discontinuedLatest = true;
} else {
discontinuedLatest = false;
MiscUtils.getLogger().debug("not last drug ");
}
} else {
discontinuedLatest = false;
}
return discontinuedLatest;
}
示例3: find
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
/**
* Mock find() method that searches that test data
* for a drug with appropriate ID.
*
* @param i
*
* @return
*/
public Drug find(Object i) {
int j = (Integer) i;
for (Drug d : this.drugs) {
if (j == d.getId()) return d;
}
return null;
}
示例4: toPrescription
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public Prescription toPrescription(Drug drug, int demographicNo) {
Prescription p = new Prescription(drug.getId(), drug.getProviderNo(), demographicNo);
p.setRxCreatedDate(drug.getCreateDate());
p.setRxDate(drug.getRxDate());
p.setEndDate(drug.getEndDate());
p.setWrittenDate(drug.getWrittenDate());
p.setBrandName(drug.getBrandName());
p.setGCN_SEQNO(drug.getGcnSeqNo());
p.setCustomName(drug.getCustomName());
p.setTakeMin(drug.getTakeMin());
p.setTakeMax(drug.getTakeMax());
p.setFrequencyCode(drug.getFreqCode());
p.setDuration(drug.getDuration());
p.setDurationUnit(drug.getDuration());
p.setQuantity(drug.getQuantity());
p.setDispensingUnits(drug.getDispensingUnits());
p.setRepeat(drug.getRepeat());
p.setLastRefillDate(drug.getLastRefillDate());
p.setNosubs(drug.isNoSubs());
p.setPrn(drug.isPrn());
p.setSpecial(drug.getSpecial());
p.setSpecialInstruction(drug.getSpecialInstruction());
p.setArchived(String.valueOf(drug.isArchived()));
p.setGenericName(drug.getGenericName());
p.setAtcCode(drug.getAtc());
p.setScript_no(ConversionUtils.toIntString(drug.getScriptNo()));
p.setRegionalIdentifier(drug.getRegionalIdentifier());
p.setUnit(drug.getUnit());
p.setUnitName(drug.getUnitName());
p.setMethod(drug.getMethod());
p.setRoute(drug.getRoute());
p.setDrugForm(drug.getDrugForm());
p.setCustomInstr(drug.isCustomInstructions());
p.setDosage(drug.getDosage());
p.setLongTerm(drug.getLongTerm());
p.setCustomNote(drug.isCustomNote());
p.setPastMed(drug.getPastMed());
p.setStartDateUnknown(drug.getStartDateUnknown());
p.setComment(drug.getComment());
if (drug.getPatientCompliance() == null) p.setPatientCompliance(null);
else p.setPatientCompliance(drug.getPatientCompliance());
p.setOutsideProviderName(drug.getOutsideProviderName());
p.setOutsideProviderOhip(drug.getOutsideProviderOhip());
p.setPickupDate(drug.getPickUpDateTime());
p.setPickupTime(drug.getPickUpDateTime());
p.setETreatmentType(drug.getETreatmentType());
p.setRxStatus(drug.getRxStatus());
if (drug.getDispenseInterval() != null) p.setDispenseInterval(drug.getDispenseInterval());
if (drug.getRefillDuration() != null) p.setRefillDuration(drug.getRefillDuration());
if (drug.getRefillQuantity() != null) p.setRefillQuantity(drug.getRefillQuantity());
p.setHideCpp(drug.getHideFromCpp());
return p;
}
示例5: addDrug
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public Drug addDrug(LoggedInInfo info, Drug d) {
// only return a drug if the ID is 1
// others we return null. This is useful for testing.
if (d.getId() == 1) {
return d;
}
return null;
}
示例6: updateDrug
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public Drug updateDrug(LoggedInInfo info, Drug d) {
if (d.getId() == 1) return d;
return null;
}
示例7: 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);
}