/** * Function used to list stool scale assessments for given care context */ public StoolScaleVoCollection listStoolScaleAssessments(CareContextRefVo careContext) { if (careContext == null || !careContext.getID_CareContextIsNotNull()) return null; List ss = getDomainFactory().find("from StoolScale stool where stool.careContext.id = " + careContext.getID_CareContext().toString()); return StoolScaleVoAssembler.createStoolScaleVoCollectionFromStoolScale(ss); }
public StoolScaleVo saveStoolScaleAssessment(StoolScaleVo voStoolScale) throws StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException { // Ensure the Value Object was validated if (!voStoolScale.isValidated()) throw new DomainRuntimeException("This Stool Scale has not been validated"); DomainFactory factory = getDomainFactory(); ims.nursing.assessmenttools.domain.objects.StoolScale domStoolScale = StoolScaleVoAssembler.extractStoolScale(factory, voStoolScale); factory.save(domStoolScale); return StoolScaleVoAssembler.create(domStoolScale); }