public DementiaVo getDementiaForPatient(PatientRefVo patient) { if (patient == null || patient.getID_Patient() == null) return null; String query = "SELECT dem FROM Dementia AS dem LEFT JOIN dem.patient AS pat LEFT JOIN dem.currentWorklistStatus AS curStatus LEFT JOIN curStatus.status AS status WHERE pat.id = :PAT_ID AND (dem.isRIE is null OR dem.isRIE = 0) AND status.id <> :EXCLUDED"; ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("PAT_ID"); paramValues.add(patient.getID_Patient()); paramNames.add("EXCLUDED"); paramValues.add(DementiaWorklistStatus.EXCLUDED.getID()); return DementiaVoAssembler.create((Dementia) getDomainFactory().findFirst(query, paramNames, paramValues)); }
public ims.clinical.vo.DementiaVo getDementia(ims.core.clinical.vo.DementiaRefVo dementiaRef) { if (dementiaRef == null || dementiaRef.getID_Dementia()== null) { throw new CodingRuntimeException("Cannot get DementiaVo on null Id "); } DomainFactory factory = getDomainFactory(); Dementia domainDementia = (Dementia) factory.getDomainObject(Dementia.class, dementiaRef.getID_Dementia()); return DementiaVoAssembler.create(domainDementia); }
public void saveDementia(ims.clinical.vo.DementiaVo dementiaToSave) throws ims.domain.exceptions.StaleObjectException { if (dementiaToSave == null ) { throw new CodingRuntimeException("Cannot get DementiaVo on null Id "); } DomainFactory factory = getDomainFactory(); Dementia domainDementia = DementiaVoAssembler.extractDementia(factory, dementiaToSave); factory.save(domainDementia); }
public DementiaVo getDementia(DementiaRefVo dementiaRef) { if (dementiaRef == null || dementiaRef.getID_Dementia()== null) { throw new CodingRuntimeException("Cannot get DementiaVo on null Id "); } DomainFactory factory = getDomainFactory(); Dementia domainDementia = (Dementia) factory.getDomainObject(Dementia.class, dementiaRef.getID_Dementia()); return DementiaVoAssembler.create(domainDementia); }
public ims.clinical.vo.DementiaVo saveDementia(ims.clinical.vo.DementiaVo dementiaToSave,FormName formName) throws ims.domain.exceptions.StaleObjectException { if (dementiaToSave == null ) { throw new CodingRuntimeException("Cannot get DementiaVo on null Id "); } //WDEV-16247 if (dementiaToSave.getID_DementiaIsNotNull() && dementiaToSave.getStepOneFindIsNotNull() && dementiaToSave.getStepOneFind().getID_DementiaFindIsNotNull() && (YesNo.YES.equals(dementiaToSave.getStepOneFind().getHasFormalDiagnosisOfDementia()) || (YesNo.NO.equals(dementiaToSave.getStepOneFind().getHasFormalDiagnosisOfDementia())&& YesNo.NO.equals(dementiaToSave.getStepOneFind().getDeliriumConfirmed()) && YesNo.NO.equals(dementiaToSave.getStepOneFind().getAwarenessQuestion()))) && (dementiaToSave.getStepTwoAssessIsNotNull() && dementiaToSave.getStepTwoAssess().getID_DementiaAssessAndInvestigateIsNotNull())) { String rieMessage = "THIS RECORD HAS BEEN MARKED AS RECORDED IN ERROR BY MAXIMS DEMENTIA - REASON : record is not relevant because of Edit to FIND record"; Integer patientId = dementiaToSave.getPatient().getID_Patient(); if (dementiaToSave.getStepTwoAssess().getStepTwoAssessNoteIsNotNull()) { markAsRie(dementiaToSave.getStepTwoAssess().getStepTwoAssessNote(), formName, patientId, null, null, rieMessage); } markAsRie(dementiaToSave.getStepTwoAssess(), formName, patientId, null, null, rieMessage); dementiaToSave.setStepTwoAssess(null); dementiaToSave.setAMTSScore(null); // dementiaToSave.setDeliriumConfirmed(null); // dementiaToSave.setDementiaConfirmed(null); dementiaToSave.setConfirmedPatientPutOnDementiaPathway(null); } String[] arrErrors = dementiaToSave.validate(); if( arrErrors != null) throw new DomainRuntimeException("Error saving voDementia - not validated correctly"); DomainFactory factory = getDomainFactory(); Dementia domainDementia = DementiaVoAssembler.extractDementia(factory, dementiaToSave); factory.save(domainDementia); return DementiaVoAssembler.create(domainDementia); }
public DementiaVo saveDementia(DementiaVo voDementia) throws DomainInterfaceException, StaleObjectException { if(voDementia == null) throw new CodingRuntimeException("DementiaVo is null"); if(!voDementia.isValidated()) throw new CodingRuntimeException("DementiaVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); Dementia doD = DementiaVoAssembler.extractDementia(factory, voDementia); factory.save(doD); return DementiaVoAssembler.create(doD); }
public void saveDementia(ims.clinical.vo.DementiaVo dementiaToSave) throws ims.domain.exceptions.StaleObjectException { if (dementiaToSave == null ) { throw new CodingRuntimeException("Cannot get DementiaAssessAndInvestigateVo on null Id "); } DomainFactory factory = getDomainFactory(); Dementia domainDementia = DementiaVoAssembler.extractDementia(factory, dementiaToSave); factory.save(domainDementia); }