public AdmissionType getAdmissionTypeFromInpatientEpisode(PASEventRefVo pasEventRef) { if(pasEventRef == null || pasEventRef.getID_PASEvent()==null) throw new CodingRuntimeException("Cannot get PasEvent value on null pasEventRef."); StringBuffer hql = new StringBuffer("select inpEpisode from InpatientEpisode as inpEpisode left join inpEpisode.pasEvent as pasEvent where pasEvent.id= :pasEventID "); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"pasEventID"}, new Object[] {pasEventRef.getID_PASEvent()}); if (list!=null && list.size()>0) { return (InpatientEpisodeVoAssembler.create((InpatientEpisode) list.get(0))).getAdmissionType(); } return null; }
public AdmissionType getAdmissionTypeFromDischargedEpisode(PASEventRefVo pasEventRef) { if(pasEventRef == null || pasEventRef.getID_PASEvent()==null) throw new CodingRuntimeException("Cannot get PasEvent value on null pasEventRef."); StringBuffer hql = new StringBuffer("select dischEpisode from DischargedEpisode as dischEpisode left join dischEpisode.pasEvent as pasEvent where pasEvent.id= :pasEventID "); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"pasEventID"}, new Object[] {pasEventRef.getID_PASEvent()}); if (list!=null && list.size()>0) { return (DischargedEpisodeVoAssembler.create((DischargedEpisode) list.get(0))).getAdmissionType(); } return null; }