/** * get MiniNutritionalAssessment Record */ public ims.nursing.vo.MiniNutritionalAssessment getRecord(Integer recordID) { DomainFactory factory = getDomainFactory(); ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment domAssess = (ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment)factory.getDomainObject(ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment.class, recordID); return(MiniNutritionalAssessmentAssembler.create(domAssess)); }
/** * check if Part of Eating Assessment */ public Boolean isPartOfEatingAssessment(MiniNutritionalAssessment mnaRecord) throws DomainInterfaceException { DomainFactory factory = getDomainFactory(); ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment domMna = MiniNutritionalAssessmentAssembler.extractMiniNutritionalAssessment(factory, mnaRecord); java.util.List mnas = factory.find("from EatingComponent E where E.miniNutritionalAssessment = :mna", "mna", domMna); if(mnas == null || mnas.size() == 0) return Boolean.FALSE; return Boolean.TRUE; }
/** * save MiniNutritionalAssessment Record */ public MiniNutritionalAssessment saveRecord(MiniNutritionalAssessment voMiniNutritionalAssessment) throws DomainInterfaceException, StaleObjectException { // Ensure the Value Object was validated if (!voMiniNutritionalAssessment.isValidated()) throw new DomainRuntimeException("This FallAssessment has not been validated"); DomainFactory factory = getDomainFactory(); ims.nursing.assessmenttools.domain.objects.MiniNutritionalAssessment domAssessment = MiniNutritionalAssessmentAssembler.extractMiniNutritionalAssessment(factory, voMiniNutritionalAssessment); factory.save(domAssessment); return MiniNutritionalAssessmentAssembler.create(domAssessment); }
public MiniNutritionalAssessmentCollection listAssessments(Date dateFrom,Date dateTo, CareContextLiteVo careContextref) throws DomainInterfaceException { DomainFactory factory = getDomainFactory(); String filter = " from MiniNutritionalAssessment mna "; StringBuffer filterString = new StringBuffer(); boolean conditionFound = false; ArrayList markerNames = new ArrayList(); ArrayList markerValues = new ArrayList(); if (dateFrom != null && dateTo != null) { filterString.append(" mna.dateTimeInitiated > :fromDate and mna.dateTimeInitiated < :toDate "); conditionFound = true; markerNames.add("fromDate"); markerNames.add("toDate"); markerValues.add(dateFrom.addDay(-1).getDate()); markerValues.add(dateTo.addDay(1).getDate()); } else if (dateFrom != null) { filterString.append(" mna.dateTimeInitiated > :fromDate "); conditionFound = true; markerNames.add("fromDate"); markerValues.add(dateFrom.addDay(-1).getDate()); } if (careContextref != null) { if (conditionFound) filterString.append(" and "); filterString.append(" mna.careContext.id = :careContext "); markerNames.add("careContext"); markerValues.add(careContextref.getID_CareContext()); } String[] names = new String[markerNames.size()]; markerNames.toArray(names); filter += " where "; filter += filterString.toString(); List procs = factory.find(filter, markerNames, markerValues); return MiniNutritionalAssessmentAssembler.createMiniNutritionalAssessmentCollectionFromMiniNutritionalAssessment(procs).sort(); }