public NutritionalRiskAssessmentVo getRecord(Integer recordId) throws DomainInterfaceException { DomainFactory factory = getDomainFactory(); NutritionalRiskAssessment domAssess = (NutritionalRiskAssessment)factory.getDomainObject(NutritionalRiskAssessment.class, recordId); return(NutritionalRiskAssessmentVoAssembler.create(domAssess)); }
public AssessmentHeaderInfo saveRecord(NutritionalRiskAssessmentVo nutritionalRiskRecord, AssessmentHeaderInfo assessment, AssessmentComponent component, VitalSignsVo vitalSign) throws StaleObjectException { // Ensure the Value Object was validated if (!nutritionalRiskRecord.isValidated()) throw new DomainRuntimeException("This Nutritional Risk Assessment has not been validated"); DomainFactory factory = getDomainFactory(); NutritionalRiskAssessment domAssessment = NutritionalRiskAssessmentVoAssembler.extractNutritionalRiskAssessment(factory, nutritionalRiskRecord); factory.save(domAssessment); if(vitalSign != null) saveVitalSign(vitalSign); if (assessment != null) { if(component != null && component instanceof NurAssessmentEatingVo) { NutritionalRiskAssessmentVo nutritionalRisk = NutritionalRiskAssessmentVoAssembler.create(domAssessment); nutritionalRisk.validate(); ((NurAssessmentEatingVo)component).setNutritionalRiskAssessment(nutritionalRisk); component.validate(); } assessment.validate(); return saveEatingComponent(assessment, component, null); } return null; // It otherwise expects assessment header }
public Boolean isPartOfEatingAssessment(NutritionalRiskAssessmentVo nutritionalRiskRecord) throws DomainInterfaceException { DomainFactory factory = getDomainFactory(); NutritionalRiskAssessment domNutritionalRisk = NutritionalRiskAssessmentVoAssembler.extractNutritionalRiskAssessment(factory, nutritionalRiskRecord); java.util.List water = factory.find("from NurEatingComponent n where n.nutritionalRiskAssessment = :nr", "nr", domNutritionalRisk); if(water == null || water.size() == 0) return Boolean.FALSE; return Boolean.TRUE; }