@SuppressWarnings("unchecked") public WaterlowAssessmentVo getLastWaterlowForCurrentAdmission(CareContextRefVo careContextRef) { // check at episode of care level that owns the current care context String hql = "select w1_1 from Waterlow as w1_1 join w1_1.careContext as cc WHERE cc.id = :CCID and w1_1.isRIE is null" + " ORDER BY w1_1.dateTimeInitiated desc"; DomainFactory factory = getDomainFactory(); List list = factory.find(hql, new String[] {"CCID"}, new Object[] {careContextRef.getID_CareContext()}); if(list.size() == 0) return null; return WaterlowAssessmentVoAssembler.create((Waterlow) list.get(0)); }
/** * getRecord ==> Nursing.WaterlowAssessmentVo */ public ims.nursing.vo.WaterlowAssessmentVo getRecord(Integer recordId) throws ims.domain.exceptions.DomainInterfaceException { DomainFactory factory = getDomainFactory(); Waterlow domAssess = (Waterlow)factory.getDomainObject(Waterlow.class, recordId); return(WaterlowAssessmentVoAssembler.create(domAssess)); }
/** * true if it is Part Of SkinAssessment */ public Boolean isPartOfSkinAssessment(ims.nursing.vo.WaterlowAssessmentVo waterRecord) throws ims.domain.exceptions.DomainInterfaceException { DomainFactory factory = getDomainFactory(); Waterlow domWaterlow = WaterlowAssessmentVoAssembler.extractWaterlow(factory, waterRecord); java.util.List water = factory.find("from SkinComponent s where s.waterlow = :water", "water", domWaterlow); if(water == null || water.size() == 0) return Boolean.FALSE; return Boolean.TRUE; }
/** * list waterlow assessments */ public WaterlowAssessmentVoCollection listAssessments(Date dateFrom, Date dateTo, CareContextRefVo voCurrentCareContext, Integer idPatient) throws DomainInterfaceException { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(""); String query ="from Waterlow wa "; ArrayList<String> markers= new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String andStr = " "; hql.append(" wa.careContext.episodeOfCare.careSpell.patient.id = :patId"); markers.add("patId"); values.add(idPatient); if (dateFrom != null && dateTo != null) { hql.append(" and "); hql.append(" wa.dateTimeInitiated > :fromDate and wa.dateTimeInitiated < :toDate "); markers.add("fromDate"); markers.add("toDate"); values.add(dateFrom.addDay(-1).getDate()); values.add(dateTo.addDay(1).getDate()); } else if (dateFrom != null) { hql.append(" and "); hql.append(" wa.dateTimeInitiated > :fromDate "); markers.add("fromDate"); values.add(dateFrom.getDate()); } if(voCurrentCareContext != null && voCurrentCareContext.getID_CareContextIsNotNull()) { hql.append(" and "); hql.append(andStr + " wa.careContext.id = :rcc"); markers.add("rcc"); values.add(voCurrentCareContext.getID_CareContext()); } if (markers.size() > 0) query += " where "; query += hql.toString(); query += " order by wa.dateTimeInitiated"; return WaterlowAssessmentVoAssembler.createWaterlowAssessmentVoCollectionFromWaterlow(factory.find(query,markers,values)); }