public ims.ocrr.vo.OrderInvestigationLiteVoCollection listRejectedInvestigations(ims.RefMan.vo.CatsReferralRefVo catsRefVo) { ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); StringBuffer sb = new StringBuffer(); sb.append(" catsref.id = :idCats"); sb.append(" and invs.ordInvCurrentStatus.ordInvStatus = :id1"); markers.add("idCats"); values.add(catsRefVo.getID_CatsReferral()); markers.add("id1"); values.add(getDomLookup(OrderInvStatus.REJECTED)); String hql = "select invs from CatsReferral as catsref join catsref.investigationOrders as invOrd join invOrd.investigations as invs"; sb.append(" and catsref.isRIE is null"); hql += " where "; hql += sb.toString(); hql += " order by invs.orderDetails.systemInformation.creationDateTime"; List list = getDomainFactory().find(hql.toString(), markers, values); return OrderInvestigationLiteVoAssembler.createOrderInvestigationLiteVoCollectionFromOrderInvestigation(list); }
/** * Function used to update OrderInvestigationAppointment (with new Investigation - amended one) */ public void updateOrderInvestigationAppointment(OrderInvWithStatusApptVo orderInvestigationAppointment, OrderInvestigationLiteVo investigationToAmend) throws StaleObjectException { if (orderInvestigationAppointment == null) throw new CodingRuntimeException("Can not save null OderInvestigationAppointemnt"); if (orderInvestigationAppointment.isValidated() == false) throw new CodingRuntimeException("Can not save not validated OrderInvestigationAppointment"); if (investigationToAmend == null) throw new CodingRuntimeException("Can not save null OrderInvestigation"); // Get domain object to save OrderInvAppt domOrderInvestigationAppointment = OrderInvWithStatusApptVoAssembler.extractOrderInvAppt(getDomainFactory(), orderInvestigationAppointment); OrderInvestigation domOrderInvestigation = OrderInvestigationLiteVoAssembler.extractOrderInvestigation(getDomainFactory(), investigationToAmend); getDomainFactory().save(domOrderInvestigationAppointment); getDomainFactory().save(domOrderInvestigation); OCSExternalEvents impl = (OCSExternalEvents) getDomainImpl(OCSExternalEventsImpl.class); impl.generateOrderUpdateEvent(new Booking_AppointmentRefVo(domOrderInvestigationAppointment.getAppointment().getId(), domOrderInvestigationAppointment.getAppointment().getVersion()), new OrderInvestigationRefVo(domOrderInvestigationAppointment.getOrderInvestigation().getId(), domOrderInvestigationAppointment.getOrderInvestigation().getVersion())); return; }
public OrderInvestigationLiteVoCollection listResultedRadiologyInvForReferral(CatsReferralRefVo referralRef, ReferralCodingRefVo referralCodingRef) { if (referralRef == null) { throw new CodingRuntimeException("Cannot get Investigations on null ReferralID"); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select orderInvs from CatsReferral as catsRef left join catsRef.investigationOrders as invOrders left join invOrders.investigations as orderInvs left join orderInvs.investigation as investig left join investig.investigationIndex as invIndex left join orderInvs.resultDetails as rezultDet left join orderInvs.ordInvCurrentStatus.ordInvStatus as invStatus where catsRef.id = :catsRefId and invIndex.category.id = :investigationType and invStatus.id <> :cancelledStatus and rezultDet is not null "); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); markers.add("catsRefId"); values.add(referralRef.getID_CatsReferral()); markers.add("investigationType"); values.add(Category.CLINICALIMAGING.getID()); markers.add("cancelledStatus"); values.add(OrderInvStatus.CANCELLED.getID()); return OrderInvestigationLiteVoAssembler.createOrderInvestigationLiteVoCollectionFromOrderInvestigation(factory.find(hql.toString(), markers, values)).sort(); }
public ims.ocrr.vo.OrderInvestigationLiteVoCollection listRejectedInvestigations(ims.careuk.vo.CatsReferralRefVo catsRefVo) { ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); StringBuffer sb = new StringBuffer(); sb.append(" catsref.id = :idCats"); sb.append(" and invs.ordInvCurrentStatus.ordInvStatus = :id1"); markers.add("idCats"); values.add(catsRefVo.getID_CatsReferral()); markers.add("id1"); values.add(getDomLookup(OrderInvStatus.REJECTED)); String hql = "select invs from CatsReferral as catsref join catsref.investigationOrders as invOrd join invOrd.investigations as invs"; sb.append(" and catsref.isRIE is null"); hql += " where "; hql += sb.toString(); hql += " order by invs.orderDetails.systemInformation.creationDateTime"; List list = getDomainFactory().find(hql.toString(), markers, values); return OrderInvestigationLiteVoAssembler.createOrderInvestigationLiteVoCollectionFromOrderInvestigation(list); }
public OrderInvestigationLiteVo updateInvestigationStatus(OrderInvestigationForStatusChangeVo investigation) throws StaleObjectException { if (investigation == null) throw new CodingRuntimeException("Error - Can not update the status for a null investigation"); OrderInvestigation domInvestigation = OrderInvestigationForStatusChangeVoAssembler.extractOrderInvestigation(getDomainFactory(), investigation); getDomainFactory().save(domInvestigation); return OrderInvestigationLiteVoAssembler.create(domInvestigation); }
public OrderInvestigationLiteVo getOrderInvestigation(OrderInvestigationRefVo orderInvRef) { if(orderInvRef == null) return null; OrderInvestigation doOrderInv = (OrderInvestigation)getDomainFactory().getDomainObject(OrderInvestigation.class, orderInvRef.getID_OrderInvestigation()); return OrderInvestigationLiteVoAssembler.create(doOrderInv); }
public OrderInvestigationLiteVoCollection listResults(PatientRefVo patient) throws DomainInterfaceException { if (patient == null || !patient.getID_PatientIsNotNull()) return null; String query = "select ordInv from OcsOrderSession as orderSession left join orderSession.patient as patient left join orderSession.investigations as ordInv where patient.id =:PAT_ID order by ordInv.displayDateTime desc"; return OrderInvestigationLiteVoAssembler.createOrderInvestigationLiteVoCollectionFromOrderInvestigation(getDomainFactory().find(query, "PAT_ID", patient.getID_Patient(), ORD_INV_REQUESTED)); }
/** * listResults */ public ims.ocrr.vo.OrderInvestigationLiteVoCollection listResults(ims.RefMan.vo.CatsReferralRefVo referral) throws ims.domain.exceptions.DomainInterfaceException { if(referral == null || referral.getID_CatsReferral() == null) throw new CodingRuntimeException("referral or referral id is null in method listResults"); DomainFactory factory = getDomainFactory(); return OrderInvestigationLiteVoAssembler.createOrderInvestigationLiteVoCollectionFromOrderInvestigation(factory.find("select ordInv from CatsReferral catsRef join catsRef.investigationOrders as ord join ord.investigations ordInv where catsRef.id = '" + referral.getID_CatsReferral() + "' order by ordInv.displayDateTime desc")); }
/** * WDEV-13944 * Function used to list all results */ public OrderInvestigationLiteVoCollection listResults(PatientRefVo patient) throws DomainInterfaceException { if (patient == null || !patient.getID_PatientIsNotNull()) return null; String query = "SELECT ordInv FROM CatsReferral AS cats LEFT JOIN cats.investigationOrders AS ord LEFT JOIN ord.investigations AS ordInv LEFT JOIN cats.patient AS pat WHERE pat.id =:PAT_ID order by ordInv.displayDateTime desc"; return OrderInvestigationLiteVoAssembler.createOrderInvestigationLiteVoCollectionFromOrderInvestigation(getDomainFactory().find(query, "PAT_ID", patient.getID_Patient(), ORD_INV_REQUESTED)); }