本文整理汇总了Java中org.oscarehr.common.dao.DrugDao类的典型用法代码示例。如果您正苦于以下问题:Java DrugDao类的具体用法?Java DrugDao怎么用?Java DrugDao使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DrugDao类属于org.oscarehr.common.dao包,在下文中一共展示了DrugDao类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PatientExport
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public PatientExport(Integer demographicNo) {
demographicDao = SpringUtils.getBean(DemographicDao.class);
allergyDao = SpringUtils.getBean(AllergyDao.class);
measurementDao = SpringUtils.getBean(MeasurementDao.class);
measurementsExtDao = SpringUtils.getBean(MeasurementsExtDao.class);
caseManagementIssueDao = SpringUtils.getBean(CaseManagementIssueDAO.class);
caseManagementIssueNotesDao = SpringUtils.getBean(CaseManagementIssueNotesDao.class);
caseManagementNoteDao = SpringUtils.getBean(CaseManagementNoteDAO.class);
caseManagementNoteExtDao = SpringUtils.getBean(CaseManagementNoteExtDAO.class);
preventionDao = SpringUtils.getBean(PreventionDao.class);
preventionExtDao = SpringUtils.getBean(PreventionExtDao.class);
patientLabRoutingDao = SpringUtils.getBean(PatientLabRoutingDao.class);
hl7TextInfoDao = SpringUtils.getBean(Hl7TextInfoDao.class);
drugDao = SpringUtils.getBean(DrugDao.class);
dxResearchDao = SpringUtils.getBean(DxresearchDAO.class);
loaded = loadPatient(demographicNo);
}
示例2: _init
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
private void _init() {
// this class was created before Oscar's Manager classes were discovered.
setDemographicDao( (DemographicDao) SpringUtils.getBean(DemographicDao.class) );
setAllergyDao( (AllergyDao) SpringUtils.getBean(AllergyDao.class) );
setDemographicCustDao( (DemographicCustDao) SpringUtils.getBean(DemographicCustDao.class) );
setDrugDao( (DrugDao) SpringUtils.getBean(DrugDao.class) );
setDrugReasonDao( (DrugReasonDao) SpringUtils.getBean(DrugReasonDao.class) );
setProviderDao( (ProviderDao) SpringUtils.getBean("providerDao") );
setAppointmentDao( (OscarAppointmentDao) SpringUtils.getBean(OscarAppointmentDao.class) );
setIcd9Dao( (Icd9Dao) SpringUtils.getBean(Icd9Dao.class) );
setFormBPMHDao( (FormBPMHDao) SpringUtils.getBean(FormBPMHDao.class) );
setProfessionalSpecialistDao( (ProfessionalSpecialistDao) SpringUtils.getBean(ProfessionalSpecialistDao.class) );
setSpecialtyDao( (ContactSpecialtyDao) SpringUtils.getBean(ContactSpecialtyDao.class) );
setProContactDao( (ProfessionalContactDao) SpringUtils.getBean(ProfessionalContactDao.class) );
setDemographicContactDao( (DemographicContactDao) SpringUtils.getBean(DemographicContactDao.class) );
setClinicDao( (ClinicDAO) SpringUtils.getBean(ClinicDAO.class) );
}
示例3: checkLastPrescribed
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
private static boolean checkLastPrescribed(RxPrescriptionData.Prescription rx, int drugId) {
//make a another query to get the latest drug with same name but archived not equals one and arhived reason equals to deleted.
//check if drugId is greater than that compare id
//if yes, return true;
//if not, return false;
boolean lastPrescribed = true;
//need the max drugId, not using DIN because it doesn't work with customed drugs.
DrugDao dao = SpringUtils.getBean(DrugDao.class);
Integer lastId = dao.findLastNotArchivedId(rx.getBrandName(), rx.getGenericName(), rx.getDemographicNo());
if (lastId != null) {
int compareId = lastId.intValue();
MiscUtils.getLogger().debug("compareId: " + compareId);
if (drugId > compareId) {
lastPrescribed = true;
} else {
lastPrescribed = false;
}
} else {
lastPrescribed = true;
}
return lastPrescribed;
}
示例4: getSpecialInstructions
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public static String getSpecialInstructions() {
String retStr = "";
RxCodesData codesData = new RxCodesData();
String[] specArr = codesData.getSpecialInstructions();
List<String> specList = Arrays.asList(specArr);
// get all past record spec inst from drugs table
DrugDao dao = SpringUtils.getBean(DrugDao.class);
List<String> resultSpecInst = dao.findSpecialInstructions();
resultSpecInst.addAll(specList);
Set<String> specIntSet = new HashSet<String>(resultSpecInst);//remove duplicates
specArr = specIntSet.toArray(specArr);
for (int i = 0; i < specArr.length; i++) {
retStr += specArr[i];
if (i < specArr.length - 1) retStr += "*"; //use * as a delimiter
}
return retStr;
}
示例5: CreatePatient
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public CreatePatient(Integer demographicNo) {
if(context == null) {
context = new ClassPathXmlApplicationContext(Constants.Runtime.SPRING_APPLICATION_CONTEXT);
}
demographicDao = context.getBean(DemographicDao.class);
clinicDao = context.getBean(ClinicDao.class);
allergyDao = context.getBean(AllergyDao.class);
measurementDao = context.getBean(MeasurementDao.class);
measurementsExtDao = context.getBean(MeasurementsExtDao.class);
caseManagementIssueDao = context.getBean(CaseManagementIssueDao.class);
caseManagementIssueNotesDao = context.getBean(CaseManagementIssueNotesDao.class);
caseManagementNoteDao = context.getBean(CaseManagementNoteDao.class);
caseManagementNoteExtDao = context.getBean(CaseManagementNoteExtDao.class);
preventionDao = context.getBean(PreventionDao.class);
preventionExtDao = context.getBean(PreventionExtDao.class);
patientLabRoutingDao = context.getBean(PatientLabRoutingDao.class);
hl7TextInfoDao = context.getBean(Hl7TextInfoDao.class);
drugDao = context.getBean(DrugDao.class);
dxResearchDao = context.getBean(DxresearchDao.class);
patientModel = new PatientModel();
patientModel.setLoaded(loadPatient(demographicNo));
}
示例6: getPrescriptions
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public List<Drug> getPrescriptions(String demographic_no, boolean all) {
DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
if (all) {
return (drugDao.findByDemographicIdOrderByPosition(new Integer(demographic_no), null));
}
return (drugDao.getUniquePrescriptions(demographic_no));
}
示例7: getCustomPrescriptions
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
/**
* Only be used to get methadone or suboxone for custom rx modules
* @param demographciId
* @param rxName
* @return
*/
public List<Drug> getCustomPrescriptions(int demographciId, String rxName) {
if (rxName == null || (!rxName.toLowerCase().contains("methadone") && !rxName.toLowerCase().contains("suboxone")
&& !rxName.toLowerCase().contains("buprenorphine"))) {
return null;
}
DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
return drugDao.findCustomByDemographicIdOrderByPosition(demographciId, rxName);
}
示例8: getLastRxForCustomRx
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public Drug getLastRxForCustomRx(int demoNo, String rxName) {
if (rxName == null) {
return null;
}
DrugDao drugDao = (DrugDao) SpringUtils.getBean("drugDao");
return drugDao.getLastRxForCustomRx(demoNo, rxName);
}
示例9: getLastEndDateForCustomRx
import org.oscarehr.common.dao.DrugDao; //导入依赖的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;
}
示例10: getMeds
import org.oscarehr.common.dao.DrugDao; //导入依赖的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;
}
示例11: getPrescriptionsByPatient
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public Prescription[] getPrescriptionsByPatient(int demographicNo) {
List<Prescription> lst = new ArrayList<Prescription>();
DrugDao dao = SpringUtils.getBean(DrugDao.class);
for (Drug drug : dao.findByDemographicIdOrderByPosition(demographicNo, null)) {
Prescription p = toPrescription(drug, demographicNo);
lst.add(p);
}
return lst.toArray(new Prescription[lst.size()]);
}
示例12: getPrescriptionScriptsByPatientATC
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public Prescription[] getPrescriptionScriptsByPatientATC(int demographicNo, String atc) {
List<Prescription> lst = new ArrayList<Prescription>();
DrugDao dao = SpringUtils.getBean(DrugDao.class);
for (Drug drug : dao.findByDemographicIdAndAtc(demographicNo, atc))
lst.add(toPrescription(drug, demographicNo));
return lst.toArray(new Prescription[lst.size()]);
}
示例13: getPrescriptionScriptsByPatientRegionalIdentifier
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public Prescription[] getPrescriptionScriptsByPatientRegionalIdentifier(int demographicNo, String regionalIdentifier) {
List<Prescription> lst = new ArrayList<Prescription>();
DrugDao dao = SpringUtils.getBean(DrugDao.class);
for (Drug drug : dao.findByDemographicIdAndRegion(demographicNo, regionalIdentifier))
lst.add(toPrescription(drug, demographicNo));
return lst.toArray(new Prescription[lst.size()]);
}
示例14: getPrescriptionScriptsByPatient
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public Prescription[] getPrescriptionScriptsByPatient(int demographicNo) {
List<Prescription> lst = new ArrayList<Prescription>();
DrugDao dao = SpringUtils.getBean(DrugDao.class);
for (Object[] pair : dao.findDrugsAndPrescriptions(demographicNo)) {
Drug drug = (Drug) pair[0];
org.oscarehr.common.model.Prescription rx = (org.oscarehr.common.model.Prescription) pair[1];
MiscUtils.getLogger().debug("Looking at drug " + drug + " and rx " + rx);
lst.add(toPrescription(demographicNo, drug, rx));
}
return lst.toArray(new Prescription[lst.size()]);
}
示例15: getPrescriptionsByScriptNo
import org.oscarehr.common.dao.DrugDao; //导入依赖的package包/类
public List<Prescription> getPrescriptionsByScriptNo(int script_no, int demographicNo) {
List<Prescription> lst = new ArrayList<Prescription>();
DrugDao dao = SpringUtils.getBean(DrugDao.class);
for (Object[] pair : dao.findDrugsAndPrescriptionsByScriptNumber(script_no)) {
Drug drug = (Drug) pair[0];
org.oscarehr.common.model.Prescription rx = (org.oscarehr.common.model.Prescription) pair[1];
lst.add(toPrescription(demographicNo, drug, rx));
}
return lst;
}