public DrugToxicologyVo getDrugToxicology(ims.core.admin.vo.CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get Urinalysis on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("from DrugToxicology as drugTox where drugTox.careContext.id = :careContextID "); List<?> list = factory.find(hql.toString(), new String[] { "careContextID" }, new Object[] { careContextRef.getID_CareContext() }); if (list == null || list.size() == 0) return null; return DrugToxicologyVoAssembler.create((DrugToxicology) list.get(0)); }
public DrugToxicologyVo save(DrugToxicologyVo drugToxicologyToSave) throws ims.domain.exceptions.StaleObjectException { if (drugToxicologyToSave == null) throw new CodingRuntimeException("Cannot save null DrugToxicology "); if (!drugToxicologyToSave.isValidated()) throw new DomainRuntimeException("DrugToxicology Not Validated."); DomainFactory factory = getDomainFactory(); DrugToxicology domainDrugToxicology = DrugToxicologyVoAssembler.extractDrugToxicology(factory, drugToxicologyToSave); factory.save(domainDrugToxicology); return DrugToxicologyVoAssembler.create(domainDrugToxicology); }
public DrugToxicologyVo getDrugToxicology(DrugToxicologyRefVo drugToxicologyRef) { if (drugToxicologyRef == null || drugToxicologyRef.getID_DrugToxicology() == null) { throw new CodingRuntimeException("Cannot get DrugToxicology on null Id "); } DomainFactory factory = getDomainFactory(); DrugToxicology domainDrugToxicology = (DrugToxicology) factory.getDomainObject(DrugToxicology.class, drugToxicologyRef.getID_DrugToxicology()); return DrugToxicologyVoAssembler.create(domainDrugToxicology); }