public GP getGPByTaxonomyType(String extId, TaxonomyType taxonomyType) { if (extId == null || taxonomyType == null) return null; DomainFactory factory = getDomainFactory(); //String hql = " from Gp g where g.localCode=:pasId"; String hql = " from Gp g " + " join g.codeMappings as cm" + " where cm.taxonomyName = :taxType " + " and cm.taxonomyCode = :extId "; List gpList = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomyType),extId}); if (gpList != null && gpList.size() > 0) { Gp gp = (Gp)gpList.get(0); return GPAssembler.create(gp); } return null; }
public GP saveGp(GP gp) throws StaleObjectException, UniqueKeyViolationException { if(!gp.isValidated()) throw new DomainRuntimeException("Gp Not Validated"); DomainFactory factory = getDomainFactory(); gp.getName().setUppers(); Gp doGp = GPAssembler.extractGp(factory, gp); Iterator it = doGp.getPractices().iterator(); while(it.hasNext()) { GpToPractice gpPract = (GpToPractice) it.next(); gpPract.setGp(doGp); } try { factory.save(doGp); } catch (UnqViolationUncheckedException e) { String dupMessage = Keywords.checkDuplicateTaxonomy(factory, doGp, "codeMappings", gp.getCodeMappings(), "getName"); if(dupMessage != null) throw new UniqueKeyViolationException(dupMessage); } return GPAssembler.create(doGp); }
public GP getGP(Integer id) { DomainFactory factory = getDomainFactory(); Gp doGP = (Gp) factory.getDomainObject(Gp.class, id); return GPAssembler.create(doGP); }
public GP getGpFull(GpRefVo gpRefVo) { if(gpRefVo == null) throw new CodingRuntimeException("Cannot get GP for null GpRefVo"); Gp doGp = (Gp)getDomainFactory().getDomainObject(Gp.class, gpRefVo.getID_Gp()); return GPAssembler.create(doGp); }
public GP getGPViaCareContext(CareContextRefVo careContext) { DomainFactory factory = getDomainFactory(); List lst = factory.find("select gp from CareContext as cc left join cc.episodeOfCare as eoc left join eoc.careSpell as cs left join cs.patient as p left join p.gp as gp where (cc.id = :idCareContext)", new String[]{"idCareContext"}, new Object[]{careContext.getID_CareContext()}); if (lst != null && lst.size() > 0) return GPAssembler.create((Gp) lst.get(0)); return null; }
public GP getPatientsGP(PatientRefVo patRefVo) { DomainFactory factory = getDomainFactory(); List lst = factory.find("select gp from Patient p where p.id = :patID", new String[]{"patID"}, new Object[]{patRefVo.getID_Patient()}); if (lst != null && lst.size() > 0) return GPAssembler.create((Gp) lst.get(0)); return null; }
public GP saveGp(GP gp) throws StaleObjectException, UniqueKeyViolationException { if(!gp.isValidated()) throw new DomainRuntimeException("Gp Not Validated"); DomainFactory factory = getDomainFactory(); gp.getName().setUppers(); Gp doGp = GPAssembler.extractGp(factory, gp); Iterator it = doGp.getPractices().iterator(); while(it.hasNext()) { GpToPractice gpPract = (GpToPractice) it.next(); gpPract.setGp(doGp); } try { factory.save(doGp); } catch (UnqViolationUncheckedException e) { String dupMessage = Keywords.checkDuplicateTaxonomy(factory, doGp, "codeMappings", gp.getCodeMappings(), "getName"); if(dupMessage != null) throw new UniqueKeyViolationException(dupMessage); } //WDEV-19576 GP Master File HL7 message GP assembledGp = GPAssembler.create(doGp); triggerGPMasterFileEvent(assembledGp); return assembledGp; }
public GP getPatientGp(GpShortVo gp) { DomainFactory factory = getDomainFactory(); ims.core.resource.people.domain.objects.Gp doGp = (ims.core.resource.people.domain.objects.Gp) factory.getDomainObject(ims.core.resource.people.domain.objects.Gp.class, gp.getID_Gp()); return GPAssembler.create(doGp); }