protected void onFormOpen() throws ims.framework.exceptions.FormOpenException { populateSearchCombos(); if (form.getGlobalContext().Correspondence.getPatientListSearchCriteriaIsNotNull()) { displayPatientSearchCriteria(); populatePatientGrid(); } else { // default to InPatient List view form.getLocalContext().setpatientListType(PatientListType.INPATIENTLIST); } hideAllButtons(); updateSearchControlsState(true); }
private void displayOutpatientSearchCriteria(PatientListsFilterVo voFilter) { form.getLocalContext().setpatientListType(PatientListType.OUTPATIENTLIST); if (voFilter.getConsultantsIsNotNull() && voFilter.getConsultants().size() == 1) form.lyrPatientLists().tabOutpatientList().cmbOPConsultant().setValue(voFilter.getConsultants().get(0)); if (voFilter.getSpecialtiesIsNotNull() && voFilter.getSpecialties().size() == 1) form.lyrPatientLists().tabOutpatientList().cmbOPSpecialty().setValue(voFilter.getSpecialties().get(0)); if (voFilter.getClinicsIsNotNull() && voFilter.getClinics().size() == 1) form.lyrPatientLists().tabOutpatientList().cmbOPClinic().setValue(voFilter.getClinics().get(0)); if (voFilter.getDateIsNotNull()) form.lyrPatientLists().tabOutpatientList().dteOPClinicDate().setValue(voFilter.getDate()); if (voFilter.getDocumentStatusIsNotNull()) form.lyrPatientLists().tabOutpatientList().cmbOPDocumentStatus().setValue(voFilter.getDocumentStatus()); }
private void displayInpatientSearchCriteria(PatientListsFilterVo voFilter) { form.getLocalContext().setpatientListType(PatientListType.INPATIENTLIST); if (voFilter.getConsultantsIsNotNull() && voFilter.getConsultants().size() == 1) form.lyrPatientLists().tabInpatientList().qmbIPConsultant().setValue(voFilter.getConsultants().get(0)); if (voFilter.getSpecialtiesIsNotNull() && voFilter.getSpecialties().size() == 1) form.lyrPatientLists().tabInpatientList().cmbIPSpecialty().setValue(voFilter.getSpecialties().get(0)); if (voFilter.getWardIsNotNull()) form.lyrPatientLists().tabInpatientList().cmbWard().setValue(voFilter.getWard()); if (voFilter.getDateIsNotNull()) form.lyrPatientLists().tabInpatientList().dteIPDischDate().setValue(voFilter.getDate()); if (voFilter.getDocumentStatusIsNotNull()) form.lyrPatientLists().tabInpatientList().cmbIPDocStatus().setValue(voFilter.getDocumentStatus()); }
protected void onlyrPatientListsTabChanged(LayerBridge tab) { form.getGlobalContext().Core.setPatientShort(null); engine.setPatientInfo("Please enter Patient ID or Surname and/or Forename"); form.getLocalContext().setpreviousScreens(0); form.getLocalContext().setfirstRecordFromGrid(null); form.getLocalContext().setlastRecordFromGrid(null); if (tab.equals(form.lyrPatientLists().tabInpatientList())) { form.getLocalContext().setpatientListType(PatientListType.INPATIENTLIST); form.lyrPatientLists().tabInpatientList().imbIPSearch().setAsDefaultButton(); clearScreen(PatientListType.INPATIENTLIST); } else if (tab.equals(form.lyrPatientLists().tabOutpatientList())) { form.getLocalContext().setpatientListType(PatientListType.OUTPATIENTLIST); form.lyrPatientLists().tabOutpatientList().imbOPSearch().setAsDefaultButton(); clearScreen(PatientListType.OUTPATIENTLIST); } }
protected void onImbIPClearClick() throws PresentationLogicException { clearScreen(PatientListType.INPATIENTLIST); // WDEV-2757 form.getGlobalContext().Core.setPatientShort(null); form.getLocalContext().setpreviousScreens(0); form.getLocalContext().setfirstRecordFromGrid(null); form.getLocalContext().setlastRecordFromGrid(null); showHideButtons(false, false, true, form.lyrPatientLists().tabInpatientList().btn1(), form.lyrPatientLists().tabInpatientList().btn2()); engine.setPatientInfo("Please enter Patient ID or Surname and/or Forename"); form.lyrPatientLists().tabInpatientList().lblIPTotal().setValue("Total : " + form.lyrPatientLists().tabInpatientList().grdIPList().getRows().size()); }
protected void onImbOPClearClick() throws PresentationLogicException { clearScreen(PatientListType.OUTPATIENTLIST); // WDEV-2757 form.getGlobalContext().Core.setPatientShort(null); engine.setPatientInfo("Please enter Patient ID or Surname and/or Forename"); form.lyrPatientLists().tabOutpatientList().lblOPTotal().setValue("Total : " + form.lyrPatientLists().tabOutpatientList().grdOPList().getRows().size()); }
/** * */ private void clearScreen(PatientListType patientListType) { if (patientListType.equals(PatientListType.INPATIENTLIST)) { form.lyrPatientLists().tabInpatientList().cmbIPDocStatus().setValue(null); form.lyrPatientLists().tabInpatientList().cmbIPSpecialty().setValue(null); form.lyrPatientLists().tabInpatientList().cmbWard().setValue(null); form.lyrPatientLists().tabInpatientList().dteIPDischDate().setValue(null); form.lyrPatientLists().tabInpatientList().dteIPDischEndDate().setValue(null); form.lyrPatientLists().tabInpatientList().qmbIPConsultant().setValue(null); form.lyrPatientLists().tabInpatientList().grdIPList().getRows().clear(); form.lyrPatientLists().tabInpatientList().lblIPTotal().setValue("Total : 0"); } else if (patientListType.equals(PatientListType.OUTPATIENTLIST)) { form.lyrPatientLists().tabOutpatientList().cmbOPDocumentStatus().setValue(null); form.lyrPatientLists().tabOutpatientList().cmbOPSpecialty().setValue(null); form.lyrPatientLists().tabOutpatientList().cmbOPClinic().setValue(null); form.lyrPatientLists().tabOutpatientList().dteOPClinicDate().setValue(null); form.lyrPatientLists().tabOutpatientList().dteOPClinicEndDate().setValue(null); form.lyrPatientLists().tabOutpatientList().cmbOPConsultant().setValue(null); form.lyrPatientLists().tabOutpatientList().grdOPList().getRows().clear(); form.lyrPatientLists().tabOutpatientList().lblOPTotal().setValue("Total : 0"); } hideAllButtons(); form.getGlobalContext().Correspondence.setPatientListSearchCriteria(null); }
private void selectionChanged(PatientListType patientListType) { setContextVariablesForSelection(patientListType); updateControlsState(); if (form.isReadOnly()) engine.showMessage("Read only form"); }
protected void onGrdInPatientsSelectionChanged() throws PresentationLogicException { selectionChanged(PatientListType.INPATIENTLIST); }
protected void onGrdOutPatientsSelectionChanged() throws PresentationLogicException { selectionChanged(PatientListType.OUTPATIENTLIST); }
/** * */ private void setContextVariablesForSelection(PatientListType patientListType) { clearContextVariables(); PatientListRowVo voInpatientListRow = null, voOutPatientListRow = null; PatientShort voPatientShort = null; PasContactVo voPasContact = null; PASEventRefVo voRefPasEvent = null; if (patientListType.equals(PatientListType.INPATIENTLIST)) { if (form.lyrPatientLists().tabInpatientList().grdIPList().getSelectedRowIndex() >= 0 && form.lyrPatientLists().tabInpatientList().grdIPList().getRows().get(form.lyrPatientLists().tabInpatientList().grdIPList().getSelectedRowIndex()).getValue() != null) { voInpatientListRow = form.lyrPatientLists().tabInpatientList().grdIPList().getSelectedRow().getValue(); voPasContact = voInpatientListRow.getPasContact(); voPatientShort = voInpatientListRow.getPasContact().getPatient(); voRefPasEvent = voInpatientListRow.getPasEvent(); } } else if (patientListType.equals(PatientListType.OUTPATIENTLIST)) { if (form.lyrPatientLists().tabOutpatientList().grdOPList().getSelectedRowIndex() >= 0 && form.lyrPatientLists().tabOutpatientList().grdOPList().getRows().get(form.lyrPatientLists().tabOutpatientList().grdOPList().getSelectedRowIndex()).getValue() != null) { voOutPatientListRow = form.lyrPatientLists().tabOutpatientList().grdOPList().getSelectedRow().getValue(); voPasContact = voOutPatientListRow.getPasContact(); voPatientShort = voOutPatientListRow.getPasContact().getPatient(); voRefPasEvent = voOutPatientListRow.getPasEvent(); } } Patient voPatient = setPatientContext(voPatientShort); if (voRefPasEvent == null && voPasContact != null) { voRefPasEvent = getOrCreatePasEventForPasContact(voPasContact, voPatient, patientListType); if (patientListType.equals(PatientListType.INPATIENTLIST)) { voInpatientListRow.setPasContact(voPasContact); voInpatientListRow.setPasEvent(voRefPasEvent); form.lyrPatientLists().tabInpatientList().grdIPList().setValue(voInpatientListRow); } else { voOutPatientListRow.setPasContact(voPasContact); voOutPatientListRow.setPasEvent(voRefPasEvent); form.lyrPatientLists().tabOutpatientList().grdOPList().setValue(voOutPatientListRow); } form.getGlobalContext().Core.setPasEvent(voRefPasEvent); } else form.getGlobalContext().Core.setPasEvent(voRefPasEvent); // LOGGER.warn("Start: domain.getCorrespondenceDetailsByPasEvent :" + getDateTime()); form.getLocalContext().setSelectedCorrespondenceInstance(domain.getCorrespondenceDetailsByPasEvent(voRefPasEvent)); // LOGGER.warn("End: domain.getCorrespondenceDetailsByPasEvent :" + getDateTime()); form.getGlobalContext().Correspondence.setCorrespondenceDetails(form.getLocalContext().getSelectedCorrespondenceInstance()); // LOGGER.warn("End: setContextVariablesForSelection :" + getDateTime()); }
private boolean setContextVariables() { clearContextVariables(); if (form.grdAttendences().getSelectedRowIndex() >=0) { PatientShort voPatientShort = new PatientShort(); voPatientShort = form.getGlobalContext().Core.getPatientShort(); PasContactVo voPasContact = new PasContactVo(); voPasContact = form.grdAttendences().getRows().get(form.grdAttendences().getSelectedRowIndex()).getValue(); if (voPatientShort != null && voPasContact != null) { Patient voPatient; try { voPatient = domain.getPatient(voPatientShort); } catch (StaleObjectException e) { //Try a second time. Only then fail. try { voPatient = domain.getPatient(voPatientShort); } catch (StaleObjectException e1) { engine.showMessage("Failed to retrieve Patient due to StaleObjectException"); return false; } } if (voPatient.getIsDead()!= null && voPatient.getIsDead().booleanValue()) { engine.setPatientInfo(voPatient.getPatientInfo(), ConfigFlag.UI.RIP_INFO_COLOUR.getValue()); } else { engine.setPatientInfo(voPatient.getPatientInfo()); } //This is required to ensure the Patient in the global context //has an internal hibernate assigned id. form.getGlobalContext().Core.setPatientShort(voPatient); voPasContact.setPatient(voPatient); PatientListType patientListType = null; if (voPasContact.getContactType().equalsIgnoreCase("INPATIENT")) patientListType = PatientListType.INPATIENTLIST; else patientListType = PatientListType.OUTPATIENTLIST; form.getGlobalContext().Core.setPasEvent(getOrCreatePasEventForPasContact(voPasContact,patientListType)); } } return true; }
private PASEventRefVo getOrCreatePasEventForPasContact(PasContactVo voPasContact, PatientListType patientListType) { if (voPasContact == null) throw new CodingRuntimeException("Pas Contact not supplied"); PasEventVo voPasEvent = null; DateTime eventDateTime = null; if (patientListType.equals(PatientListType.INPATIENTLIST)) { eventDateTime = voPasContact.getDischargeDateTime(); } else if (patientListType.equals(PatientListType.OUTPATIENTLIST)) { eventDateTime = voPasContact.getAppointmentDateTime(); } voPasEvent = domain.getPasEvent(voPasContact.getPatient(),voPasContact.getContactNumber()); if (voPasEvent != null) { CorrespondenceDetailsVo voDocumentDetails = domain.getCorrespondenceDetailsByPasEvent(voPasEvent); if (voDocumentDetails != null) { form.getGlobalContext().Correspondence.setCorrespondenceDetails(voDocumentDetails); form.getGlobalContext().Correspondence.setDocDetailIdReportSeed(voDocumentDetails.getID_CorrespondenceDetails()); } } else { try { try { voPasEvent = domain.createPasEvent(eventDateTime,form.getGlobalContext().Core.getPatientShort(),voPasContact); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return null; } } catch (UniqueKeyViolationException ue) { engine.showMessage(ue.getMessage()); return null; } voPasEvent.setEventDateTime(eventDateTime); // TODO Save a Pas Event (Using PASContactVO - Use impl methods in ADT or create new one } return voPasEvent; }