/** * save the patients family history for this contact */ public ims.clinical.vo.FamilyHistoryVo save(ims.clinical.vo.FamilyHistoryVo voFamilyHistory) throws ims.domain.exceptions.StaleObjectException { if(!voFamilyHistory.isValidated()) { throw new DomainRuntimeException("Family History Value Object has not been validated"); } DomainFactory factory = getDomainFactory(); PatientFamilyHistory famhistBo = FamilyHistoryVoAssembler.extractPatientFamilyHistory(factory,voFamilyHistory); factory.save(famhistBo); return FamilyHistoryVoAssembler.create(famhistBo); }
public FamilyHistoryVoCollection list(ClinicalContactShortVo voClinicalContact, PatientShort voPatientShort) { if(voPatientShort == null || voPatientShort.getID_Patient() == null) throw new DomainRuntimeException("Patient Filter not provided for list call. "); DomainFactory factory = getDomainFactory(); java.util.List famhistList = factory.find("select p1_1 from PatientFamilyHistory as p1_1 left join p1_1.clinicalContact as c1_1 left join c1_1.careContext as c2_1 left join c2_1.episodeOfCare as e1_1 left join e1_1.careSpell as c3_1 left join c3_1.patient as p2_1 left join p1_1.patient as p3_1 where( (c3_1.patient.id = :patientId or p1_1.patient.id = :patientId))", new String[]{"patientId"}, new Object[]{voPatientShort.getID_Patient()}); //wdev-18559 if ((famhistList != null) && (famhistList.size()>0)) return FamilyHistoryVoAssembler.createFamilyHistoryVoCollectionFromPatientFamilyHistory(famhistList).sort(); else return null; }