private void viewPathologySelectedOrder() { if (form.grdPathology().getSelectedRow() != null && form.grdPathology().getValue() != null) { PathologyResultListShortVo result = (PathologyResultListShortVo) form.grdPathology().getSelectedRow().getValue().getOrderInvestigation(); if (result.getOrderDetails() != null) { form.getGlobalContext().OCRR.setResultDisplayDate(result.getDisplayDateTime().getDate()); form.getGlobalContext().OCRR.PathologyResults.setOrder(result.getOrderDetails()); if (AuthorisationOrderStatus.AWAITING_AUTHORISATION.equals(result.getOrderDetails().getAuthorisationOrderStatus())) { form.getGlobalContext().OCRR.setOrderAwaitingAuthorisation(result.getOrderDetails()); } engine.open(form.getForms().OCRR.OrderSummaryDialog, true); } } }
private void viewClinicalImagingSelectOrder() { form.getGlobalContext().OCRR.setCurrentPathRadResult(form.grdClinicalImaging().getValue()); RadiologyResultListVo result = (RadiologyResultListVo) form.grdClinicalImaging().getValue().getOrderInvestigation(); form.getGlobalContext().OCRR.PathologyResults.setOrder(result.getOrderDetails()); form.getGlobalContext().OCRR.setLastUpdatedPathRadResult(null); if (AuthorisationOrderStatus.AWAITING_AUTHORISATION.equals(result.getOrderDetails().getAuthorisationOrderStatus())) { form.getGlobalContext().OCRR.setOrderAwaitingAuthorisation(result.getOrderDetails()); } engine.open(form.getForms().OCRR.OrderSummaryDialog); }
private void viewSelectedOrder() { if (form.lyrMain().tabSearch().grdResults().getValue() != null) { PathologyResultListShortVo voPathologyResult = (PathologyResultListShortVo) form.lyrMain().tabSearch().grdResults().getValue().getOrderInvestigation(); if (voPathologyResult.getOrderDetailsIsNotNull()) { form.getGlobalContext().OCRR.setResultDisplayDate(getSelectedDisplayDateTime().getDate()); form.getGlobalContext().OCRR.PathologyResults.setOrder(voPathologyResult.getOrderDetails()); // WDEV-11097 if(AuthorisationOrderStatus.AWAITING_AUTHORISATION.equals(voPathologyResult.getOrderDetails().getAuthorisationOrderStatus())) { form.getGlobalContext().OCRR.setOrderAwaitingAuthorisation(voPathologyResult.getOrderDetails()); } engine.open(form.getForms().OCRR.OrderSummaryDialog, true); } } }
private void viewSelectedOrder() { form.getGlobalContext().OCRR.setCurrentPathRadResult(form.grdClinicalResults().getValue()); ClinicalResultListVo res = (ClinicalResultListVo) form.grdClinicalResults().getValue().getOrderInvestigation(); form.getGlobalContext().OCRR.PathologyResults.setOrder(res.getOrderDetails()); form.getGlobalContext().OCRR.setLastUpdatedPathRadResult(null); if (AuthorisationOrderStatus.AWAITING_AUTHORISATION.equals(res.getOrderDetails().getAuthorisationOrderStatus())) { form.getGlobalContext().OCRR.setOrderAwaitingAuthorisation(res.getOrderDetails()); } engine.open(form.getForms().OCRR.OrderSummaryDialog); }
private void viewSelectedOrder() { form.getGlobalContext().OCRR.setCurrentPathRadResult(form.grdClinicalImaging().getValue()); RadiologyResultListVo res = (RadiologyResultListVo)form.grdClinicalImaging().getValue().getOrderInvestigation(); form.getGlobalContext().OCRR.PathologyResults.setOrder(res.getOrderDetails()); form.getGlobalContext().OCRR.setLastUpdatedPathRadResult(null); //WDEV-11097 if(AuthorisationOrderStatus.AWAITING_AUTHORISATION.equals(res.getOrderDetails().getAuthorisationOrderStatus())) { form.getGlobalContext().OCRR.setOrderAwaitingAuthorisation(res.getOrderDetails()); } engine.open(form.getForms().OCRR.OrderSummaryDialog); }
private void setDefaults(OcsOrderSession doOcsOrder, ORDERSTATE state) { if (doOcsOrder == null || state == null) throw new CodingRuntimeException("Coding Error - Order or state is null"); if(state.equals(ORDERSTATE.CANCELLED)) doOcsOrder.setAuthorisationOrderStatus( getDomLookup(AuthorisationOrderStatus.CANCELLED)); else if(state.equals(ORDERSTATE.REQUESTING_AUTHORISATION)) doOcsOrder.setAuthorisationOrderStatus( getDomLookup(AuthorisationOrderStatus.AWAITING_AUTHORISATION)); else if(state.equals(ORDERSTATE.AUTHORISING)) doOcsOrder.setAuthorisationOrderStatus( getDomLookup(AuthorisationOrderStatus.AUTHORISED)); //defaults Iterator it = doOcsOrder.getInvestigations().iterator(); while (it.hasNext()) { OrderInvestigation doOrderInv = (OrderInvestigation) it.next(); if (OrderInvStatus.CANCEL_REQUEST.getID() != doOrderInv.getOrdInvCurrentStatus().getOrdInvStatus().getId()) //WDEV-16998 { doOrderInv.getOrdInvStatusHistory().add(doOrderInv.getOrdInvCurrentStatus()); doOrderInv.setDisplayTimeSupplied(Boolean.FALSE); // WDEV-3602 doOrderInv.setResponsibleClinician(doOcsOrder.getResponsibleClinician()); doOrderInv.setResponsibleGp(doOcsOrder.getResponsibleGp()); doOrderInv.setPatientClinic(doOcsOrder.getPatientClinic()); doOrderInv.setPatientLocation(doOcsOrder.getPatientLocation()); // WDEV-18165 set ParentLocation dependent on current location if (doOrderInv.getPatientLocation() != null) doOrderInv.setParentLocation(doOrderInv.getPatientLocation().getParentLocation()); else if (doOrderInv.getPatientClinic() != null) doOrderInv.setParentLocation(doOrderInv.getPatientClinic().getClinicLocation()); // If the OrderInvestigation locations are not set, then its outpatient department // so get the parent location from there. if (doOrderInv.getParentLocation() == null && doOcsOrder.getOutpatientDept() != null) doOrderInv.setParentLocation(doOcsOrder.getOutpatientDept().getParentLocation()); } } // doOcsOrder.getSpecimens() //WDEV-7493 for (Object iterable_element : doOcsOrder.getSpecimens()) { OrderSpecimen spec = (OrderSpecimen) iterable_element; String token = "Do not use:" + (Double.valueOf(Math.random()*10000).toString().substring(0,4)); spec.setPlacerOrdNum(token); } //End WDEV-7493 }
/** * list from OcsOrder where OrderAuthorisaton = AWAITING_AUTHORISATION */ public OcsOrderInvVoCollection listOrdersRequiringAuthorisation(Date dateFrom, Date dateTo, ClinicRefVo clinic, LocationRefVo location, HcpRefVo responsibleClinician) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList values = new ArrayList(); String hql = "from OcsOrderSession ocsOrder where ocsOrder.authorisationOrderStatus = :status "; markers.add("status"); values.add(getDomLookup(AuthorisationOrderStatus.AWAITING_AUTHORISATION)); StringBuffer condStr = new StringBuffer(); String andStr = " and "; if(dateFrom != null) { condStr.append(andStr + " ocsOrder.systemInformation.creationDateTime >= :dateFrom"); markers.add("dateFrom"); values.add(dateFrom.getDate()); } if(dateTo != null) { condStr.append(andStr + " ocsOrder.systemInformation.creationDateTime <= :dateTo"); markers.add("dateTo"); values.add(dateTo.addDay(1).getDate()); } if(clinic != null) { condStr.append(andStr + " ocsOrder.patientClinic.id = :clinicId"); markers.add("clinicId"); values.add(clinic.getID_Clinic()); } if(location != null) { condStr.append(andStr + " ocsOrder.patientLocation.id = :locationId"); markers.add("locationId"); values.add(location.getID_Location()); } if(responsibleClinician != null) { condStr.append(andStr + " ocsOrder.responsibleClinician.id = :hcpId"); markers.add("hcpId"); values.add(responsibleClinician.getID_Hcp()); } hql += condStr.toString(); return OcsOrderInvVoAssembler.createOcsOrderInvVoCollectionFromOcsOrderSession(factory.find(hql,markers,values)).sort();//WDEV-16232 }
/** * get a list of default investigations run for the Referral service and * automatically create an order and link the appt if supplied * * @param doCatsReferral * @param doNewAppt * @return an object array containing the OrderInvestigation and the Order */ public Object[] createOrder(CatsReferral doCatsReferral, Booking_Appointment doNewAppt) throws StaleObjectException { if (doCatsReferral == null) throw new CodingRuntimeException("doCatsReferral is null in method createOrder"); Set orderInvestigations = null; String invMapping = null; if (doCatsReferral.getReferralDetails() != null && doCatsReferral.getReferralDetails().getService() != null) { if (doCatsReferral.getReferralDetails().getService().getTaxonomyMap() != null) { Iterator itTax = doCatsReferral.getReferralDetails().getService().getTaxonomyMap().iterator(); while (itTax.hasNext()) { TaxonomyMap doTaxMap = (TaxonomyMap) itTax.next(); if (doTaxMap.getTaxonomyName().equals(getDomLookup(TaxonomyType.INVESTIGATION))) { invMapping = doTaxMap.getTaxonomyCode(); break; } } } } if (invMapping != null) { List invs = getDomainFactory().find("from Investigation inv where upper(inv.providerInvCode) = '" + invMapping.toUpperCase() + "'"); if (invs != null && invs.size() > 0) { OcsOrderSession doOcsOrder = new OcsOrderSession(); doOcsOrder.setPatient(doCatsReferral.getPatient()); doOcsOrder.setClinicalTrial(false); doOcsOrder.setAuthorisationOrderStatus(getDomLookup(AuthorisationOrderStatus.AUTHORISED)); if(doCatsReferral.getReferralDetails() != null) doOcsOrder.setResponsibleGp(doCatsReferral.getReferralDetails().getGPName()); orderInvestigations = createOrderInvestigations(invs, doNewAppt, doOcsOrder); doOcsOrder.setInvestigations(orderInvestigations); doOcsOrder.setWasProcessed(false); getDomainFactory().save(doOcsOrder); return new Object[]{(OrderInvestigation) orderInvestigations.iterator().next(), doOcsOrder}; } } return null; }
/** * get a list of default investigations run for the Referral service and * automatically create an order and link the appt if supplied * * @param doCatsReferral * @param doNewAppt * @return an object array containing the OrderInvestigation and the Order */ public Object[] createOrder(CatsReferral doCatsReferral, Booking_Appointment doNewAppt) throws StaleObjectException { if (doCatsReferral == null) throw new CodingRuntimeException("doCatsReferral is null in method createOrder"); Set orderInvestigations = null; String invMapping = null; if (doCatsReferral.getReferralDetails() != null && doCatsReferral.getReferralDetails().getService() != null) { if (doCatsReferral.getReferralDetails().getService().getTaxonomyMap() != null) { Iterator itTax = doCatsReferral.getReferralDetails().getService().getTaxonomyMap().iterator(); while (itTax.hasNext()) { NonUniqueTaxonomyMap doTaxMap = (NonUniqueTaxonomyMap) itTax.next(); // WDEV-20676 changed to non-unique if (doTaxMap.getTaxonomyName().equals(getDomLookup(TaxonomyType.INVESTIGATION))) { invMapping = doTaxMap.getTaxonomyCode(); break; } } } } if (invMapping != null) { List invs = getDomainFactory().find("from Investigation inv where upper(inv.providerInvCode) = '" + invMapping.toUpperCase() + "'"); if (invs != null && invs.size() > 0) { OcsOrderSession doOcsOrder = new OcsOrderSession(); doOcsOrder.setPatient(doCatsReferral.getPatient()); doOcsOrder.setClinicalTrial(false); doOcsOrder.setAuthorisationOrderStatus(getDomLookup(AuthorisationOrderStatus.AUTHORISED)); if(doCatsReferral.getReferralDetails() != null) doOcsOrder.setResponsibleGp(doCatsReferral.getReferralDetails().getGPName()); orderInvestigations = createOrderInvestigations(invs, doNewAppt, doOcsOrder); doOcsOrder.setInvestigations(orderInvestigations); doOcsOrder.setWasProcessed(false); getDomainFactory().save(doOcsOrder); return new Object[]{(OrderInvestigation) orderInvestigations.iterator().next(), doOcsOrder}; } } return null; }
/** * list from OcsOrder where OrderAuthorisaton = AWAITING_AUTHORISATION */ public OcsOrderInvVoCollection listOrdersRequiringAuthorisation(Date dateFrom, Date dateTo, ClinicRefVo clinic, LocationRefVo location, HcpRefVo responsibleClinician) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList values = new ArrayList(); String hql = "from OcsOrderSession ocsOrder where ocsOrder.authorisationOrderStatus = :status "; markers.add("status"); values.add(getDomLookup(AuthorisationOrderStatus.AWAITING_AUTHORISATION)); StringBuffer condStr = new StringBuffer(); String andStr = " and "; if(dateFrom != null) { condStr.append(andStr + " ocsOrder.systemInformation.creationDateTime >= :dateFrom"); markers.add("dateFrom"); values.add(dateFrom.getDate()); } if(dateTo != null) { condStr.append(andStr + " ocsOrder.systemInformation.creationDateTime <= :dateTo"); markers.add("dateTo"); Date toDate = (Date) dateTo.clone(); //WDEV-19389 values.add(toDate.addDay(1).getDate().clone()); } if(clinic != null) { condStr.append(andStr + " ocsOrder.patientClinic.id = :clinicId"); markers.add("clinicId"); values.add(clinic.getID_Clinic()); } if(location != null) { condStr.append(andStr + " ocsOrder.patientLocation.id = :locationId"); markers.add("locationId"); values.add(location.getID_Location()); } if(responsibleClinician != null) { condStr.append(andStr + " ocsOrder.responsibleClinician.id = :hcpId"); markers.add("hcpId"); values.add(responsibleClinician.getID_Hcp()); } hql += condStr.toString(); return OcsOrderInvVoAssembler.createOcsOrderInvVoCollectionFromOcsOrderSession(factory.find(hql,markers,values)).sort();//WDEV-16232 }