public Boolean isSameStatus(HospitalAtNightPatientDetailRefVo hospitalAtNightPatientDetailsId, HospitalAtNightPatientStatus status) { if(hospitalAtNightPatientDetailsId == null || hospitalAtNightPatientDetailsId.getID_HospitalAtNightPatientDetail() == null) throw new CodingRuntimeException("Cannot check the status for a null HospitalAtNightPatientDetailRefVo."); DomainFactory factory = getDomainFactory(); String query = "from HospitalAtNightPatientDetail as pd where pd.id = :HospId and pd.currentStatus.status.id = :Status"; List<?> list = factory.find(query, new String[] {"HospId", "Status"}, new Object[] {hospitalAtNightPatientDetailsId.getID_HospitalAtNightPatientDetail(), status.getID()}); if(list != null && list.size() > 0) return true; return false; }
public HospitalAtNightPatientDetailVo getHospitalAtNightPatientDetails(HospitalAtNightPatientDetailRefVo hospitalPatientDetails) { if(hospitalPatientDetails == null || hospitalPatientDetails.getID_HospitalAtNightPatientDetail() == null) throw new CodingRuntimeException("Cannot get HospitalAtNightPatientDetailVo on null Id."); return HospitalAtNightPatientDetailVoAssembler.create((HospitalAtNightPatientDetail) getDomainFactory().getDomainObject(HospitalAtNightPatientDetail.class, hospitalPatientDetails.getID_HospitalAtNightPatientDetail())); }