public ims.emergency.vo.EDTransferVo saveEDTransfer(EDTransferVo record, EDPartialAdmissionVo partialadmis) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException { if(record == null) throw new CodingRuntimeException("Cannot save a null EDTransfer record."); DomainFactory factory = getDomainFactory(); EDTransfer doEDTransfer = EDTransferVoAssembler.extractEDTransfer(factory, record); factory.save(doEDTransfer); if( partialadmis != null ) { partialadmis.setAllocatedStatus(AllocationStatus.CANCELLED_ADMISSION); EDPartialAdmission doEDPartialAdmission = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, partialadmis); factory.save(doEDPartialAdmission); } return EDTransferVoAssembler.create(doEDTransfer); }
public EDTransferVoCollection getAllTransfersForTheSelectedAttendance(Integer careContextID) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); if (careContextID == null) { throw new CodingRuntimeException("CareContextID cannot be null"); } StringBuffer hql = new StringBuffer(); hql.append(" select transfers from EDTransfer as transfers left join transfers.attendance as contextID where contextID.id = :contextID order by transfers.systemInformation.creationDateTime desc"); markers.add("contextID"); values.add(careContextID); return EDTransferVoAssembler.createEDTransferVoCollectionFromEDTransfer(factory.find(hql.toString(), markers, values)); }
public EDTransferVo getUncompletedTransferByCareContext(Integer careContextID) { if (careContextID == null) { throw new CodingRuntimeException("Cannot get SeenByHCPVoCollection on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select transfers from EDTransfer as transfers where transfers.attendance.id = :attID and transfers.acceptedDateTime is null and (transfers.notAccepted is null or transfers.notAccepted = 0) order by transfers.referredDateTime desc "); List<?> list = factory.find(hql.toString(), new String[] { "attID" }, new Object[] { careContextID }); if (list!=null && list.size()>0) return EDTransferVoAssembler.create((EDTransfer) list.get(0)); return null; }
private EDTransferVo assembleEDtransfer(EDTransfer item) { if(item != null) { //DomainFactory factory = getDomainFactory(); //return EDTransferVoAssembler.create((EDTransfer) factory.getDomainObject(EDTransfer.class, item.getId())); return EDTransferVoAssembler.create(item); } return null; }
public ims.emergency.vo.EDTransferVo getEDTransferVo(ims.emergency.vo.EDTransferRefVo edTransferRef) { if(edTransferRef == null || edTransferRef.getID_EDTransfer() == null) throw new CodingRuntimeException("Cannnot get EDTransferRefVo for a null Id."); return EDTransferVoAssembler.create((EDTransfer) getDomainFactory().getDomainObject(EDTransfer.class, edTransferRef.getID_EDTransfer())); }
public ims.emergency.vo.EDTransferVo get(ims.emergency.vo.EDTransferRefVo transfer) { if(transfer == null || transfer.getID_EDTransfer() == null) return null; EDTransfer doEdTransfer = (EDTransfer) getDomainFactory().getDomainObject(EDTransfer.class, transfer.getID_EDTransfer()); return EDTransferVoAssembler.create(doEdTransfer); }
public EDTransferVoCollection listTransfers(CareContextRefVo careContext) { if(careContext == null || careContext.getID_CareContext() == null) return null; String query = "select edt from EDTransfer as edt left join edt.attendance as cc where cc.id = :CareContextId order by edt.systemInformation.creationDateTime desc"; List<?> list = getDomainFactory().find(query, new String[] {"CareContextId"}, new Object[] {careContext.getID_CareContext()}); return EDTransferVoAssembler.createEDTransferVoCollectionFromEDTransfer(list); }
public ims.emergency.vo.EDTransferVo saveEDTransfer(EDTransferVo record, TrackingForTransferVo trackingRecord, EDTransferVo previousRecord, ReferralToSpecialtyTeamVo referralToSpecialty) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException { if(record == null && trackingRecord == null) throw new CodingRuntimeException("Cannot save a null EDTransfer / Tracking / Partial Admission record."); DomainFactory factory = getDomainFactory(); EDTransfer doEDTransfer = null; if (referralToSpecialty!=null) { ReferralToSpecTeam domainReferralToSpecialtyToBeSaved = ReferralToSpecialtyTeamVoAssembler.extractReferralToSpecTeam(factory, referralToSpecialty); factory.save(domainReferralToSpecialtyToBeSaved); trackingRecord.setCurrentReferral(null); Tracking doTracking = TrackingForTransferVoAssembler.extractTracking(factory, trackingRecord); factory.save(doTracking); trackingRecord = TrackingForTransferVoAssembler.create(doTracking); trackingRecord.validate(); } if (previousRecord != null) { EDTransfer prevRecord = EDTransferVoAssembler.extractEDTransfer(factory, previousRecord); prevRecord.setNotAccepted(true); factory.save(prevRecord); } if (trackingRecord != null ) { if (!trackingRecord.isValidated()) throw new DomainRuntimeException("TrackingForTransferVo Not Validated."); Tracking trackingForTransfer =TrackingForTransferVoAssembler.extractTracking(factory, trackingRecord); factory.save(trackingForTransfer); TrackingForTransferVo tracking = TrackingForTransferVoAssembler.create(trackingForTransfer); if(tracking != null) return tracking.getCurrentTransferRecord(); } if (record != null ) { if (!record.isValidated()) throw new DomainRuntimeException("EDTransferVo Not Validated."); doEDTransfer = EDTransferVoAssembler.extractEDTransfer(factory, record); factory.save(doEDTransfer); return EDTransferVoAssembler.create(doEDTransfer); } return null; }
public ims.emergency.vo.EDTransferVo save(ims.emergency.vo.EDTransferVo transfer) throws ims.domain.exceptions.StaleObjectException { if(transfer == null) throw new CodingRuntimeException("Cannot save a null EDTransferVo."); if(!transfer.isValidated()) throw new CodingRuntimeException("EDTransferVo is not validated."); DomainFactory factory = getDomainFactory(); EDTransfer doTransfer = EDTransferVoAssembler.extractEDTransfer(factory, transfer); factory.save(doTransfer); return EDTransferVoAssembler.create(doTransfer); }