public ReferralsRecordingVo save(ReferralsRecordingVo record) throws StaleObjectException { if(record == null) { throw new DomainRuntimeException("Invalid record"); } if(!record.isValidated()) { throw new CodingRuntimeException("Record not validated"); } DomainFactory factory = getDomainFactory(); ReferralsRecording domainRecord = ReferralsRecordingVoAssembler.extractReferralsRecording(factory, record); factory.save(domainRecord); return ReferralsRecordingVoAssembler.create(domainRecord); }
/** * saveReferralsRecording */ public ims.clinical.vo.ReferralsRecordingVo saveReferralsRecording(ims.clinical.vo.ReferralsRecordingVo referVo) throws ims.domain.exceptions.StaleObjectException { DomainFactory factory = getDomainFactory(); ReferralsRecording doRR = ReferralsRecordingVoAssembler.extractReferralsRecording(factory, referVo); factory.save(doRR); return ReferralsRecordingVoAssembler.create(doRR); }
public ReferralsRecordingVo get(ReferralsRecordingRefVo record) { if(record == null || record.getID_ReferralsRecording() == null) { throw new DomainRuntimeException("Invalid record"); } DomainFactory factory = getDomainFactory(); ReferralsRecording domainRecord = (ReferralsRecording)factory.getDomainObject (ReferralsRecording.class, record.getID_ReferralsRecording().intValue()); return ReferralsRecordingVoAssembler.create(domainRecord); }
/** * geStagingClassification */ public ims.clinical.vo.ReferralsRecordingVo getPrimaryPreecedingReferralRecording(ims.core.admin.vo.CareSpellRefVo csRefVo) { if(csRefVo == null) throw new RuntimeException("Cannot get ReferralsRecordingVo for null CareContextRefVo"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from ReferralsRecording rr "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (csRefVo != null) { hql.append(andStr + " rr.careSpell.id = :id_CareSpell"); markers.add("id_CareSpell"); values.add(csRefVo.getID_CareSpell()); andStr = " and "; } hql.append(andStr + " rr.primaryPreceeding = :pp_PRIMARY"); markers.add("pp_PRIMARY"); values.add(getDomLookup(PrimaryPreceeding.PRIMARY)); andStr = " and "; hql.append(andStr + " rr.referralCategory = :rc_PRECEEDEDEPISODE"); markers.add("rc_PRECEEDEDEPISODE"); values.add(getDomLookup(ReferralCategory.PRECEEDEDEPISODE)); andStr = " and "; if (markers.size() > 0) query += " where "; query += hql.toString(); List rrList = factory.find(query, markers, values); ReferralsRecordingVoCollection coll = ReferralsRecordingVoAssembler.createReferralsRecordingVoCollectionFromReferralsRecording(rrList); if(coll != null && coll.size() > 0) return coll.get(0); else return null; }
public ReferralsRecordingVo getReferralRecording(ReferralsRecordingRefVo rrRefVo) { return ReferralsRecordingVoAssembler.create((ReferralsRecording)getDomainFactory().getDomainObject(ReferralsRecording.class, rrRefVo.getID_ReferralsRecording())); }