public ims.nursing.vo.CarePlanEvaluationNote saveEvaluationNote(ims.nursing.vo.CarePlanEvaluationNote evaluationNoteVo) throws StaleObjectException { if(evaluationNoteVo == null) throw new CodingRuntimeException("Mandatory arguments not supplied to saveEvaluationNote method"); if (!evaluationNoteVo.isValidated()) throw new DomainRuntimeException("Evaluation Note has not been validated"); DomainFactory factory = getDomainFactory(); CarePlanEvaluationNote domCarePlanEval = CarePlanEvaluationNoteAssembler.extractCarePlanEvaluationNote(factory,evaluationNoteVo); factory.save(domCarePlanEval); return CarePlanEvaluationNoteAssembler.create(domCarePlanEval); }
public CarePlanEvaluationNoteCollection listEvaluationNotesforCarePlanAndByDateRange(CarePlanRefVo carePlanRefVo, Date dateFrom, Date dateTo, Boolean activeOnly) { if (carePlanRefVo != null && carePlanRefVo.getID_CarePlan() == null || dateFrom == null || dateTo == null) throw new CodingRuntimeException("Mandatory arguments not supplied to listClinicalNotesForCarePlanAndDateRange method"); String hql = "from ims.nursing.careplans.domain.objects.CarePlanEvaluationNote cpen where cpen.carePlan.id = :idCarePlan and (cpen.recordedDateTime >= :startDate and cpen.recordedDateTime < :endDate ) "; if(activeOnly == true) hql += "and cpen.active = true"; List notes = getDomainFactory().find(hql, new String[]{"idCarePlan", "startDate", "endDate"},new Object[]{carePlanRefVo.getID_CarePlan(), dateFrom.getDate(), dateTo.copy().addDay(1).getDate()}); return CarePlanEvaluationNoteAssembler.createCarePlanEvaluationNoteCollectionFromCarePlanEvaluationNote(notes); }
public void saveEvaluationNote(CarePlanEvaluationNote voNote) throws StaleObjectException { if (voNote == null) throw new CodingRuntimeException("voNote is null in method saveEvaluationNote"); if (!voNote.isValidated()) throw new CodingRuntimeException("voNote has not been validated in method saveEvaluationNote"); ims.nursing.careplans.domain.objects.CarePlanEvaluationNote doNote = CarePlanEvaluationNoteAssembler.extractCarePlanEvaluationNote(getDomainFactory(), voNote); getDomainFactory().save(doNote); }