本文整理汇总了Java中org.oscarehr.common.model.Drug.setPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Drug.setPosition方法的具体用法?Java Drug.setPosition怎么用?Java Drug.setPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.oscarehr.common.model.Drug
的用法示例。
在下文中一共展示了Drug.setPosition方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAsDomainObject
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
/**
* Converts from a transfer object to a Drug domain object.
*
* @param loggedInInfo information regarding the current logged in user.
* @param t the transfer object to copy the data from
* @return a Drug domain object representing this data.
* @throws ConversionException if conversion did not complete properly.
*/
@Override
public Drug getAsDomainObject(LoggedInInfo loggedInInfo, DrugTo1 t) throws ConversionException {
Drug d = new Drug();
// Copy fields from DrugTo1 object
// over to the new Drug object.
// This is not quite a one-to-one copy, some transformation
// is done on types.
try {
d.setId(t.getDrugId());
d.setBrandName(t.getBrandName());
d.setGenericName(t.getGenericName());
d.setDemographicId(t.getDemographicNo());
d.setProviderNo(t.getProviderNo().toString()); // Cast to string.
d.setAtc(t.getAtc());
d.setRegionalIdentifier(t.getRegionalIdentifier());
d.setDosage(t.getStrength() + t.getStrengthUnit());
d.setTakeMax(t.getTakeMax());
d.setTakeMin(t.getTakeMin());
d.setRxDate(t.getRxDate());
d.setEndDate(t.getEndDate());
d.setFreqCode(t.getFrequency());
d.setDuration(t.getDuration().toString()); // Cast to string.
d.setDurUnit(t.getDurationUnit());
d.setRepeat(t.getRepeats());
d.setSpecial(t.getInstructions());
d.setArchived(t.isArchived());
d.setArchivedReason(t.getArchivedReason());
d.setArchivedDate(t.getArchivedDate());
d.setRoute(t.getRoute());
d.setDrugForm(t.getForm());
d.setMethod(t.getMethod());
d.setPrn(t.isPrn());
d.setLongTerm(t.getLongTerm());
d.setNoSubs(t.getNoSubstitutions());
d.setPosition(1);
d.setOutsideProviderName(t.getExternalProvider());
d.setSpecialInstruction(t.getAdditionalInstructions());
if(t.getQuantity() != null){
d.setQuantity(t.getQuantity().toString());
}
populateDrugStrength(d, t);
}catch(RuntimeException re){
throw new ConversionException();
}
return d;
}
示例2: updateChartWithPrescription
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
/**
* Update a patient's chart in OSCAR by adding a new Prescription.
* @param prescription The prescription to add
*/
public static void updateChartWithPrescription(Drug prescription) throws IllegalArgumentException {
// A prescription session bean to perform the loading and saving
//RxSessionBean bean = new RxSessionBean();
// The unique ID for the new prescription
//int rxStashIndex;
// Throw an error if the ATC code is not set... we need it to store a prescription
//if (!prescription.isValidAtcCode()) {
// throw new IllegalArgumentException("Failed to save prescription because it's ATC code is invalid.");
//}
// Save the prescription
//bean.addAttributeName(prescription.getAtc() + "-" + String.valueOf(bean.getStashIndex()));
//rxStashIndex = bean.addStashItem(prescription);
//bean.setStashIndex(rxStashIndex);
CaseManagementManager caseManagementManager = (CaseManagementManager) SpringUtils.getBean("caseManagementManager");
DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
ProgramManager programManager = (ProgramManager) SpringUtils.getBean("programManager");
prescription.setPosition(0);
drugDao.persist(prescription);
String programId = String.valueOf(programManager.getProgramIdByProgramName("OSCAR"));
//add an CME entry
CaseManagementNote cmNote = new CaseManagementNote();
cmNote.setUpdate_date(new Date());
cmNote.setObservation_date(new Date());
cmNote.setDemographic_no(prescription.getDemographicId().toString());
cmNote.setProviderNo(prescription.getProviderNo());
cmNote.setSigning_provider_no(prescription.getProviderNo());
cmNote.setSigned(true);
cmNote.setHistory("");
cmNote.setReporter_program_team("0");
cmNote.setProgram_no(programId);
cmNote.setUuid(UUID.randomUUID().toString());
cmNote.setReporter_caisi_role("2");
cmNote.setNote(prescription.getComment());
caseManagementManager.saveNoteSimple(cmNote); //new note id created
CaseManagementNoteLink cml = new CaseManagementNoteLink();
cml.setTableName(CaseManagementNoteLink.DRUGS);
cml.setTableId((long)prescription.getId());
cml.setNoteId(cmNote.getId()); //new note id
cml.setOtherId(null);
caseManagementManager.saveNoteLink(cml);
}
示例3: update
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
if (!securityInfoManager.hasPrivilege(LoggedInInfo.getLoggedInInfoFromSession(request), "_rx", "u", null)) {
throw new RuntimeException("missing required security object (_rx)");
}
String demographicNo = request.getParameter("demographicNo");
int drugId = Integer.parseInt(request.getParameter("drugId"));
int swapDrugId = Integer.parseInt(request.getParameter("swapDrugId"));
CaseManagementManager caseManagementManager = (CaseManagementManager) SpringUtils.getBean("caseManagementManager");
List<Drug> drugs = caseManagementManager.getPrescriptions(demographicNo, true);
DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
Drug myDrug = null;
Drug swapDrug = null;
for (Drug drug : drugs) {
if (drug.getId().intValue() == drugId) {
myDrug = drug;
}
if (drug.getId().intValue() == swapDrugId) {
swapDrug = drug;
}
}
if (myDrug == null || swapDrug == null) {
MiscUtils.getLogger().warn("Couldn't find the drugs to swap!");
} else {
int myPosition = myDrug.getPosition();
int swapPosition = swapDrug.getPosition();
myDrug.setPosition(swapPosition);
swapDrug.setPosition(myPosition);
drugDao.merge(myDrug);
drugDao.merge(swapDrug);
}
try {
response.getWriter().println("ok");
} catch (IOException e) {
logger.error("error", e);
}
return null;
}
示例4: syncDrug
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
private void syncDrug(Drug drug, Integer scriptId) {
// the fields set are based on previous code, I don't know the details of why which are and are not set and can not audit it at this point in time.
drug.setProviderNo(getProviderNo());
drug.setDemographicId(getDemographicNo());
drug.setRxDate(getRxDate());
drug.setEndDate(getEndDate());
drug.setWrittenDate(getWrittenDate());
drug.setBrandName(getBrandName());
drug.setGcnSeqNo(getGCN_SEQNO());
drug.setCustomName(getCustomName());
drug.setTakeMin(getTakeMin());
drug.setTakeMax(getTakeMax());
drug.setFreqCode(getFrequencyCode());
drug.setDuration(getDuration());
drug.setDurUnit(getDurationUnit());
drug.setQuantity(getQuantity());
drug.setDispensingUnits(getDispensingUnits());
drug.setRepeat(getRepeat());
drug.setLastRefillDate(getLastRefillDate());
drug.setNoSubs(getNosubs());
drug.setPrn(getPrn());
drug.setSpecial(getSpecial());
drug.setGenericName(getGenericName());
drug.setScriptNo(scriptId);
drug.setAtc(atcCode);
drug.setRegionalIdentifier(regionalIdentifier);
drug.setUnit(getUnit());
drug.setMethod(getMethod());
drug.setRoute(getRoute());
drug.setDrugForm(getDrugForm());
drug.setOutsideProviderName(getOutsideProviderName());
drug.setOutsideProviderOhip(getOutsideProviderOhip());
drug.setCustomInstructions(getCustomInstr());
drug.setDosage(getDosage());
drug.setUnitName(getUnitName());
drug.setLongTerm(getLongTerm());
drug.setCustomNote(isCustomNote());
drug.setPastMed(getPastMed());
drug.setDispenseInternal(getDispenseInternal());
drug.setSpecialInstruction(getSpecialInstruction());
drug.setPatientCompliance(getPatientCompliance());
drug.setNonAuthoritative(isNonAuthoritative());
drug.setPickUpDateTime(getPickupDate());
drug.setETreatmentType(getETreatmentType());
drug.setRxStatus(getRxStatus());
drug.setDispenseInterval(getDispenseInterval());
drug.setRefillQuantity(getRefillQuantity());
drug.setRefillDuration(getRefillDuration());
drug.setHideFromCpp(false);
drug.setPosition(position);
drug.setComment(getComment());
drug.setStartDateUnknown(getStartDateUnknown());
drug.setDispenseInternal(getDispenseInternal());
}
示例5: getDrug
import org.oscarehr.common.model.Drug; //导入方法依赖的package包/类
Drug getDrug(String providerNo, Integer demographicId, Date rxDate,Date endDate,Date writtenDate,String brandName,int gcnSeqNo, String customName,float takeMin,float takeMax,String freqCode,
String duration,String durUnit,String quantity, Integer repeat, boolean noSubs, boolean prn,String special,String special_instruction,String genericName,String atc,Integer scriptNo,String regionalIdentifier,
String unit,String method,String route,String drugForm, Date createDate,String dosage,boolean customInstructions,String unitName,Boolean longTerm,Boolean pastMed, Boolean patientCompliance,String outsideProviderName,
String outsideProviderOhip ,Boolean hideFromDrugProfile, Boolean customNote){
Drug drug = new Drug();
drug.setProviderNo(providerNo);
drug.setDemographicId(demographicId);
drug.setRxDate(rxDate);
drug.setEndDate(endDate);
drug.setWrittenDate(writtenDate);
drug.setBrandName(brandName);
drug.setGcnSeqNo(gcnSeqNo);
drug.setCustomName(customName);
drug.setTakeMin(takeMin);
drug.setTakeMax(takeMax);
drug.setFreqCode(freqCode);
drug.setDuration(duration);
drug.setDurUnit(durUnit);
drug.setQuantity(quantity);
drug.setRepeat(repeat);
drug.setNoSubs(noSubs);
drug.setPrn(prn);
drug.setSpecial(special);
drug.setSpecialInstruction(special_instruction);
drug.setGenericName(genericName);
drug.setAtc(atc);
drug.setScriptNo(scriptNo);
drug.setRegionalIdentifier(regionalIdentifier);
drug.setUnit(unit);
drug.setMethod(method);
drug.setRoute(route);
drug.setDrugForm(drugForm);
drug.setCreateDate(createDate);
drug.setDosage(dosage);
drug.setCustomInstructions(customInstructions);
drug.setUnitName(unitName);
drug.setLongTerm(longTerm);
drug.setPastMed(pastMed);
drug.setPatientCompliance(patientCompliance);
drug.setOutsideProviderName(outsideProviderName);
drug.setOutsideProviderOhip(outsideProviderOhip);
drug.setHideFromDrugProfile(hideFromDrugProfile);
drug.setCustomNote(customNote);
drug.setPosition(0);
return drug;
}