public ims.clinical.vo.HospitalAtNightCutOffPointsConfigVo saveHospitalAtNight(ims.clinical.vo.HospitalAtNightCutOffPointsConfigVo hospitalConfig) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException { if (hospitalConfig == null) throw new CodingRuntimeException("Cannot save null hospitalConfig"); if (!hospitalConfig.isValidated()) throw new DomainRuntimeException("HospitalVo Not Validated."); try { DomainFactory factory = getDomainFactory(); HospitalAtNightCutOverPointsConfig domainHospital = HospitalAtNightCutOffPointsConfigVoAssembler.extractHospitalAtNightCutOverPointsConfig(factory, hospitalConfig); factory.save(domainHospital); return HospitalAtNightCutOffPointsConfigVoAssembler.create(domainHospital); } catch (UnqViolationUncheckedException e) { throw new UniqueKeyViolationException("Hospital already exists in the system.", e); } }
public void deleteHospitalConfig(HospitalAtNightCutOffPointsConfigVo hospitalConfig) throws ForeignKeyViolationException { if (hospitalConfig == null) throw new CodingRuntimeException("Cannot delete null hospitalConfig"); try { DomainFactory factory = getDomainFactory(); HospitalAtNightCutOverPointsConfig domainHospital = HospitalAtNightCutOffPointsConfigVoAssembler.extractHospitalAtNightCutOverPointsConfig(factory, hospitalConfig); factory.delete(domainHospital); } catch (ForeignKeyViolationException e) { throw new ForeignKeyViolationException("Hospital configuration is used in the system.", e); } }
public ims.clinical.vo.HospitalAtNightCutOffPointsConfigVoCollection listHospitalsConfig() { DomainFactory factory = getDomainFactory(); String query = "from HospitalAtNightCutOverPointsConfig as h1_1 order by UPPER(h1_1.hospital.name) asc "; return HospitalAtNightCutOffPointsConfigVoAssembler.createHospitalAtNightCutOffPointsConfigVoCollectionFromHospitalAtNightCutOverPointsConfig(factory.find(query)); }
public ims.clinical.vo.HospitalAtNightCutOffPointsConfigVo getHospitalConfig(ims.clinical.configuration.vo.HospitalAtNightCutOverPointsConfigRefVo hospitalConfigId) throws StaleObjectException { if (hospitalConfigId == null || hospitalConfigId.getID_HospitalAtNightCutOverPointsConfig() == null) throw new CodingRuntimeException("Cannot get HospitalAtNightCutOffPointsConfigBTVo on null Id."); DomainFactory factory = getDomainFactory(); HospitalAtNightCutOverPointsConfig domainHospital = (HospitalAtNightCutOverPointsConfig) factory.getDomainObject(HospitalAtNightCutOverPointsConfig.class, hospitalConfigId.getID_HospitalAtNightCutOverPointsConfig()); if (domainHospital == null) throw new StaleObjectException(domainHospital); return HospitalAtNightCutOffPointsConfigVoAssembler.create(domainHospital); }
public ims.clinical.vo.HospitalAtNightCutOffPointsConfigVoCollection listHospitalsConfig() { DomainFactory factory = getDomainFactory(); String query = "from HospitalAtNightCutOverPointsConfig as h1_1 order by h1_1.hospital.upperName asc "; //WDEV-20219 UPPER(h1_1.hospital.name) return HospitalAtNightCutOffPointsConfigVoAssembler.createHospitalAtNightCutOffPointsConfigVoCollectionFromHospitalAtNightCutOverPointsConfig(factory.find(query)); }