public SummaryClinicalInformationVo getLatestSummaryClinicalInformation(PatientRefVo patient) { if (patient == null || patient.getID_Patient() == null) return null; String query = "SELECT summary FROM SummaryClinicalInformation AS summary LEFT JOIN summary.patient AS patient WHERE summary.isRIE is null AND patient.id = :ID_PATIENT ORDER BY summary.systemInformation.creationDateTime DESC"; return SummaryClinicalInformationVoAssembler.create((SummaryClinicalInformation) getDomainFactory().findFirst(query, "ID_PATIENT", patient.getID_Patient())); }
public SummaryClinicalInformationVo getSummaryClinicalInformation(SummaryClinicalInformationRefVo summary) { if (summary == null || summary.getID_SummaryClinicalInformation() == null) return null; return SummaryClinicalInformationVoAssembler.create((SummaryClinicalInformation) getDomainFactory().getDomainObject(SummaryClinicalInformation.class, summary.getID_SummaryClinicalInformation())); }
public SummaryClinicalInformationVo saveSummaryClinicalInformation(SummaryClinicalInformationVo summary) throws StaleObjectException { if (summary == null) throw new CodingRuntimeException("Can't save a null record."); if (!summary.isValidated()) throw new CodingRuntimeException("Record to save is not validated."); // Extract domain object to save SummaryClinicalInformation domSummary = SummaryClinicalInformationVoAssembler.extractSummaryClinicalInformation(getDomainFactory(), summary); getDomainFactory().save(domSummary); return SummaryClinicalInformationVoAssembler.create(domSummary); }