public PatientCurrentConcernVoCollection listPatientConcern(PatientShort patient, IMos voHcp, PatientConcernStatus patientConcernStatus) { if(patient == null) throw new CodingRuntimeException("Patient is mandatory in method listPatientConcern"); DomainFactory factory = getDomainFactory(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); StringBuffer condStr = new StringBuffer(); String hql = "from PatientConcern conc where conc.careContext.episodeOfCare.careSpell.patient.id = '" + patient.getID_Patient() + "'"; if(voHcp != null && voHcp.getIMosHcpId() != null) { condStr.append(" and conc.allocToTeamMember.id = :idHcp"); markers.add("idHcp"); values.add(voHcp.getIMosHcpId()); } if(patientConcernStatus != null) { condStr.append(" and conc.concernStatus = :status"); markers.add("status"); values.add(getDomLookup(patientConcernStatus)); } hql += condStr.toString(); return PatientCurrentConcernVoAssembler.createPatientCurrentConcernVoCollectionFromPatientConcern(factory.find(hql,markers,values)).sort(); }
public PatientCurrentConcernVo getConcern(PatientConcernRefVo concernId) { if(concernId == null || !concernId.getID_PatientConcernIsNotNull()) throw new CodingRuntimeException("Can not get PatientConcern on null Id."); return PatientCurrentConcernVoAssembler.create((PatientConcern) getDomainFactory().getDomainObject(PatientConcern.class, concernId.getID_PatientConcern())); }
public ims.core.vo.PatientCurrentConcernVo saveConcern(ims.core.vo.PatientCurrentConcernVo concern, ims.core.vo.PatientShort patient) throws StaleObjectException { if(!concern.isValidated()) { throw new DomainRuntimeException("PatientCurrentConcern Value Object Alert has not been validated"); } DomainFactory factory = getDomainFactory(); PatientConcern doConcern = PatientCurrentConcernVoAssembler.extractPatientConcern(factory,concern); factory.save(doConcern); return PatientCurrentConcernVoAssembler.create(doConcern); }