public PasEventShortVo getLatestPasEvent(PatientRefVo patient) { if (patient == null) return null; StringBuilder query = new StringBuilder("SELECT pasEv FROM PASEvent AS pasEv LEFT JOIN pasEv.patient AS pat WHERE "); query.append(" pat.id = :PATIENT_ID ORDER BY pasEv.systemInformation.creationDateTime DESC"); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("PATIENT_ID"); paramValues.add(patient.getID_Patient()); return PasEventShortVoAssembler.create((PASEvent) getDomainFactory().findFirst(query.toString(), paramNames, paramValues)); }
private boolean populateCodingGrid(Boolean bShowMessage, PasEventShortVo voPasEvent, BookingAppointmentOutpatientCodingVo appointment) { boolean bReturnValue = true; ReferralCodingVo voRC = null; if (voPasEvent != null) voRC = domain.getReferralCoding(null, voPasEvent); else if (appointment != null) voRC = domain.getReferralCodingForAppointment(appointment); if (((voRC != null && form.getLocalContext().getCurrentRCVoIsNotNull() && form.getLocalContext().getCurrentRCVo().getVersion_ReferralCoding() != voRC.getVersion_ReferralCoding()) || (voRC != null && form.getLocalContext().getCurrentRCVo() == null)) && bShowMessage) { engine.showMessage("The Referral Coding record has been changed by another user. Please review and edit again."); bReturnValue = false; } else if (voRC != null && form.getLocalContext().getCurrentRCVoIsNotNull() && form.getLocalContext().getCurrentRCVo().getVersion_ReferralCoding() == voRC.getVersion_ReferralCoding() && bShowMessage) { form.getLocalContext().setCurrentRCVo(voRC); return true; } form.getLocalContext().setCurrentRCVo(voRC); populateRCGrid(voRC); return bReturnValue; }
private PasEventShortVo getPASEvent() { if(form.txtWorkflowID().getValue() == null || form.txtWorkflowID().getValue().trim().length() == 0) return null; PasEventShortVo pasEvent = new PasEventShortVo(); pasEvent.setEventDateTime(form.dtimCtxStart().getValue()); pasEvent.setPasEventId(form.txtWorkflowID().getValue()); pasEvent.setPatient(form.getGlobalContext().Core.getPatientShort()); pasEvent.setEventType(PasEventType.INPATIENT); pasEvent.setSpecialty(form.cmbConSpecialty().getValue()); return pasEvent; }
public PasEventVo savePASEvent(PasEventShortVo pasEvent) throws ims.domain.exceptions.StaleObjectException { if(pasEvent == null) throw new DomainRuntimeException("Invalid PAS event"); if(!pasEvent.isValidated()) throw new DomainRuntimeException("PAS event was not validated"); DomainFactory factory = getDomainFactory(); PASEvent domainObject = PasEventShortVoAssembler.extractPASEvent(factory, pasEvent); factory.save(domainObject); return PasEventVoAssembler.create(domainObject); }
private boolean fillCodingGrid(Boolean bShowMessage, PasEventShortVo voPasEvent) { boolean bReturnValue = true; if(voPasEvent != null) bReturnValue = populateGridFromPASEvent(bShowMessage, voPasEvent); else if( ! ConfigFlag.UI.LINK_REFERRAL_CODING_TO_PAS_EVENT.getValue()) bReturnValue = populateGridFromCatsReferral(bShowMessage); if (!bReturnValue) form.setMode(FormMode.VIEW); return bReturnValue; }
private boolean populateGridFromPASEvent(Boolean bShowMessage, PasEventShortVo voPasEvent) { boolean bReturnValue = true; ReferralCodingVo voRC = domain.getReferralCoding(null, voPasEvent); if ( ((voRC != null && form.getLocalContext().getCurrentRCVoIsNotNull() && form.getLocalContext().getCurrentRCVo().getVersion_ReferralCoding() != voRC.getVersion_ReferralCoding() ) || (voRC != null && form.getLocalContext().getCurrentRCVo() == null)) && bShowMessage) { engine.showMessage("The Referral Coding record has been changed by another user. Please review and edit again."); bReturnValue = false; } else if (voRC != null && form.getLocalContext().getCurrentRCVoIsNotNull() && form.getLocalContext().getCurrentRCVo().getVersion_ReferralCoding() == voRC.getVersion_ReferralCoding() && bShowMessage) { form.getLocalContext().setCurrentRCVo(voRC); return true; } form.grdCoding().getRows().clear(); form.getLocalContext().setCurrentRCVo(voRC); populateRCGrid(voRC); return bReturnValue; }
private boolean fillCodingGrid(Boolean bShowMessage, PasEventShortVo voPasEvent) { boolean bReturnValue = true; if (!ConfigFlag.UI.LINK_REFERRAL_CODING_TO_PAS_EVENT.getValue()) bReturnValue = populateGridFromCatsReferral(bShowMessage); else bReturnValue = populateCodingGrid(bShowMessage, voPasEvent, null); if (!bReturnValue) form.setMode(FormMode.VIEW); return bReturnValue; }
private void setInitialView() { form.btnOrder().setEnabled(false); form.lyrDetails().tabGenDetails().setHeaderVisible(false); form.lyrDetails().tabRadDetails().setHeaderVisible(false); form.lyrDetails().tabPathDetails().setHeaderVisible(false); if (form.getLocalContext().getOcsOrder() == null || form.getLocalContext().getOcsOrder().getID_OcsOrderSession() == null) { // WDEV-12841 // Get latest PasEvent for patient PasEventShortVo pasEvent = domain.getLatestPasEvent(form.getGlobalContext().Core.getPatientShort()); if (pasEvent != null && pasEvent.getEpisodeFinancialClass() != null) form.lyrDetails().tabGenDetails().cmbOrderCategory().setValue(pasEvent.getEpisodeFinancialClass()); } if (!form.getGlobalContext().OCRR.getOrderAwaitingAuthorisationIsNotNull()) { prePopulatePatientLocationAndClinician(); } bindOrderPriority(form.getGlobalContext().OCRR.getMyOrderComponents()); // WDEV-4758 if (!ConfigFlag.DOM.CREATE_ORDERS_WITH_CARECONTEXT_ONLY.getValue()) { form.lyrDetails().tabGenDetails().lblPasEpisodeID().setVisible(false); form.lyrDetails().tabGenDetails().txtPasEpisodeID().setVisible(false); } else { form.lyrDetails().tabGenDetails().txtPasEpisodeID().setEnabled(false); } // WDEV-6693 if (!ConfigFlag.UI.ALLOW_CLINICALNOTES_WHEN_ORDERING.getValue()) { form.lyrDetails().tabClinicalNotes().txtAdditionalNotes().setVisible(false); form.lyrDetails().tabClinicalNotes().lblAdditional().setVisible(false); } }
private void setInitialView() { form.btnOrder().setEnabled(false); form.lyrDetails().tabGenDetails().setHeaderVisible(false); form.lyrDetails().tabRadDetails().setHeaderVisible(false); form.lyrDetails().tabPathDetails().setHeaderVisible(false); if (form.getLocalContext().getOcsOrder() == null || form.getLocalContext().getOcsOrder().getID_OcsOrderSession() == null) { /** * @author George Josan * WDEV-20203 * Default on the Order Category depending on the flag value to Patient Financial Class or to default chosen value */ if (DEFAULT_ORDER_CATEGORY_PATIENT_FINANCIAL.equals(ConfigFlag.UI.DEFAULT_ORDER_CATEGORY.getValue())) { // WDEV-12841 // Get latest PasEvent for patient PasEventShortVo pasEvent = domain.getLatestPasEvent(form.getGlobalContext().Core.getPatientShort()); if (pasEvent != null && pasEvent.getEpisodeFinancialClass() != null) form.lyrDetails().tabGenDetails().cmbOrderCategory().setValue(pasEvent.getEpisodeFinancialClass()); } else if (DEFAULT_ORDER_CATEGORY_SELECTED_DEFAULT.equals(ConfigFlag.UI.DEFAULT_ORDER_CATEGORY.getValue())) { defaultcmbOrderCategoryLookupValue(); } } if (!form.getGlobalContext().OCRR.getOrderAwaitingAuthorisationIsNotNull()) { prePopulatePatientLocationAndClinician(); } bindOrderPriority(form.getGlobalContext().OCRR.getMyOrderComponents()); // WDEV-4758 if (!ConfigFlag.DOM.CREATE_ORDERS_WITH_CARECONTEXT_ONLY.getValue()) { form.lyrDetails().tabGenDetails().lblPasEpisodeID().setVisible(false); form.lyrDetails().tabGenDetails().txtPasEpisodeID().setVisible(false); } else { form.lyrDetails().tabGenDetails().txtPasEpisodeID().setEnabled(false); } // WDEV-6693 if (!ConfigFlag.UI.ALLOW_CLINICALNOTES_WHEN_ORDERING.getValue()) { form.lyrDetails().tabClinicalNotes().txtAdditionalNotes().setVisible(false); form.lyrDetails().tabClinicalNotes().lblAdditional().setVisible(false); } }