protected void onGrdOutPatientSelectionChanged() throws PresentationLogicException { // Set form selecting the Patient as Outpatient List form.getGlobalContext().Core.setSelectingPatientForm(engine.getFormName()); OutPatientListVo outpatient = form.grdOutPatient().getValue(); if (outpatient != null && outpatient.getPasEvent() != null && outpatient.getPasEvent().getPatient() != null) { form.getGlobalContext().Core.setPatientShort(null); form.getGlobalContext().Core.setPatientToBeDisplayed(outpatient.getPasEvent().getPatient()); form.getGlobalContext().Core.setOutpatientAttendanceForOrder(outpatient); engine.open(ConfigFlag.UI.DEMOGRAPHICS_FORM.getValue()); } }
protected void onGrdOutPatientSelectionChanged() throws PresentationLogicException { // Set form selecting the Patient as Outpatient List form.getGlobalContext().Core.setSelectingPatientForm(engine.getFormName()); OutPatientListVo outpatient = form.grdOutPatient().getValue(); if (outpatient != null && outpatient.getPasEvent() != null && outpatient.getPasEvent().getPatient() != null) { form.getGlobalContext().Core.setPatientShort(outpatient.getPasEvent().getPatient()); form.getGlobalContext().Core.setPatientToBeDisplayed(outpatient.getPasEvent().getPatient()); form.getGlobalContext().Core.setOutpatientAttendanceForOrder(outpatient); // Update CareContext if one exists for the Pas Event form.getGlobalContext().Core.setCurrentCareContext(domain.getContextForPasEvent(outpatient.getPasEvent())); } updateControlsState(); if (Boolean.FALSE.equals(ConfigFlag.UI.OUTPAT_CREATE_CORRESPONDENCE_DETAILS.getValue())) { viewDemographics(); } }
private void populateSummaryNoteDynamicGrid() { form.lyrLetterCreate().tabTemplate().dyngrdSummaryNotes().getRows().clear(); for(int i=0; i<form.lyrLetterCreate().tabClinicList().grdPatient().getRows().size(); i++) { if(form.lyrLetterCreate().tabClinicList().grdPatient().getRows().get(i).getcolDocCreate()) { OutPatientListVo tempVo = form.lyrLetterCreate().tabClinicList().grdPatient().getRows().get(i).getValue(); if(tempVo.getPasEventIsNotNull() && tempVo.getPasEvent().getPatientIsNotNull()) { DynamicGridRow patientRow = form.lyrLetterCreate().tabTemplate().dyngrdSummaryNotes().getRows().newRow(); patientRow.setValue(tempVo); DynamicGridCell patientCell = patientRow.getCells().newCell(getColumnSummaryNotes(COLUMN_NAME), DynamicCellType.STRING); patientCell.setValue(tempVo.getPasEvent().getPatient().getName().getSurname()); PatientSummaryNoteByHcpShortVoCollection tempColl = domain.listSummaryNotes(tempVo.getPasEvent().getPatient()); DynamicGridCell summaryNoteCell = patientRow.getCells().newCell(getColumnSummaryNotes(COLUMN_SUMMARY), DynamicCellType.ENUMERATION); for(int j = 0; j < tempColl.size();j++) { if (tempColl.get(j) == null) continue; // Build string to be displayed StringBuilder displayText = new StringBuilder(); displayText.append(tempColl.get(j).getAuthoringInformation().getAuthoringHcpIsNotNull() ? tempColl.get(j).getAuthoringInformation().getAuthoringHcp().toString() : ""); displayText.append(" - " + tempColl.get(j).getAuthoringInformation().getAuthoringDateTime().toString()); if (tempColl.get(j).getSystemInformationIsNotNull() && tempColl.get(j).getSystemInformation().getLastupdateDateTime() != null) displayText.append(" - " + tempColl.get(j).getSystemInformation().getLastupdateDateTime().toString()); summaryNoteCell.getItems().newItem(tempColl.get(j), displayText.toString()); } } } } }
private void prePopulateTemplateTab() { form.lyrLetterCreate().tabTemplate().imbSearchTemplate().setAsDefaultButton();// WDEV-13750 for(int i=0; i<form.lyrLetterCreate().tabClinicList().grdPatient().getRows().size(); i++) { OutPatientListVo outpatient = form.lyrLetterCreate().tabClinicList().grdPatient().getRows().get(i).getValue(); if(outpatient == null) continue; if(outpatient.getPasEventIsNotNull() && outpatient.getPasEvent().getConsultantIsNotNull() && outpatient.getPasEvent().getSpecialtyIsNotNull()) { MedicWithMappingsLiteVo medic = outpatient.getPasEvent().getConsultant(); HcpLiteVo hcp = new HcpLiteVo(medic.getID_Hcp(), medic.getBoVersion()); hcp.setMos(medic.getMos()); if(form.lyrLetterCreate().tabTemplate().ccResponsible().getValue() == null) form.lyrLetterCreate().tabTemplate().ccResponsible().setValue(hcp); if(form.lyrLetterCreate().tabTemplate().cmbSpecialty().getValue() == null) form.lyrLetterCreate().tabTemplate().cmbSpecialty().setValue(outpatient.getPasEvent().getSpecialty()); break; } } form.lyrLetterCreate().tabTemplate().dteDocDate().setValue(form.lyrLetterCreate().tabClinicList().dteClinicDate().getValue()); //wdev-14320 if( ConfigFlag.DOM.CLINIC_LETTER_BATCH_CREATE_SUMMARY_NOTE_MODE.getValue().equals("Select")) populateSummaryNoteDynamicGrid(); }
private Boolean createAndSavePatientDocument(OutPatientListVo outPatientListVo, PatientDocumentErrorVoCollection errors) //WDEV-12640 { if(outPatientListVo == null || outPatientListVo.getPasEvent() == null || outPatientListVo.getPasEvent().getPatient() == null) return false; PatientShort patient = outPatientListVo.getPasEvent().getPatient(); CareContextMinVo careContext = domain.getCareContextByPasEvent(outPatientListVo.getPasEvent()); ClinicRefVo clinic = outPatientListVo.getClinic(); PatientDocumentVo patDoc = savePatientDocuments(patient, careContext, clinic, "DummyFileName", errors); if (patDoc == null) return false; String fileName = createReport(patient, careContext,patDoc, errors); if (fileName == null) { domain.deletePatientDocument(patDoc); return false; } patDoc.getServerDocument().setFileName(fileName); patDoc.validate(); try { domain.savePatientDocument(patDoc); } catch (StaleObjectException e) { domain.deletePatientDocument(patDoc); deleteFile(getWorkAreaPath() + fileName);//WDEV-13366 e.printStackTrace(); errors.add(createError(patient, careContext, "Could not be created")); return false; } return true; }
private void createNewDocument() { // Get selected value OutPatientListVo outpatient = form.grdOutPatient().getValue(); form.getGlobalContext().Core.setPatientShort(outpatient != null && outpatient.getPasEvent() != null && outpatient.getPasEvent().getPatient() != null ? outpatient.getPasEvent().getPatient() : null); engine.open(form.getForms().Core.PatientCorrespondenceTemplates); }
private void viewDemographics() { // Get selected value OutPatientListVo outpatient = form.grdOutPatient().getValue(); form.getGlobalContext().Core.setPatientShort(outpatient != null && outpatient.getPasEvent() != null && outpatient.getPasEvent().getPatient() != null ? outpatient.getPasEvent().getPatient() : null); engine.open(ConfigFlag.UI.DEMOGRAPHICS_FORM.getValue()); }
public int compare(Object ob1, Object ob2) { String rez1 = null; String rez2 = null; if(ob1 instanceof OutPatientListVo ) { OutPatientListVo ps1 = (OutPatientListVo)ob1; rez1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getPatient() != null && ps1.getPasEvent().getPatient().getDisplayId() != null) ? ps1.getPasEvent().getPatient().getDisplayId().getValue():null; } if(ob2 instanceof OutPatientListVo) { OutPatientListVo ps2 = (OutPatientListVo)ob2; rez2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getPatient() != null && ps2.getPasEvent().getPatient().getDisplayId() != null) ? ps2.getPasEvent().getPatient().getDisplayId().getValue():null; } if(rez1 != null && rez2 != null) return rez1.compareToIgnoreCase(rez2)*direction; if(rez1 != null && rez2 == null) return direction; if(rez2 != null && rez1 == null) return (-1)*direction; return 0; }
public int compare(Object ob1, Object ob2) { String rez1 = null; String rez2 = null; if(ob1 instanceof OutPatientListVo ) { OutPatientListVo ps1 = (OutPatientListVo)ob1; rez1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getPatient() != null && ps1.getPasEvent().getPatient().getName() != null && ps1.getPasEvent().getPatient().getName() != null) ? ps1.getPasEvent().getPatient().getName().getSurname():null; } if(ob2 instanceof OutPatientListVo) { OutPatientListVo ps2 = (OutPatientListVo)ob2; rez2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getPatient() != null && ps2.getPasEvent().getPatient().getName() != null && ps2.getPasEvent().getPatient().getName() != null) ? ps2.getPasEvent().getPatient().getName().getSurname():null; } if(rez1 != null && rez2 != null) return rez1.compareToIgnoreCase(rez2)*direction; if(rez1 != null && rez2 == null) return direction; if(rez2 != null && rez1 == null) return (-1)*direction; return 0; }
public int compare(Object ob1, Object ob2) { String rez1 = null; String rez2 = null; if(ob1 instanceof OutPatientListVo) { OutPatientListVo ps1 = (OutPatientListVo)ob1; rez1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getPatient() != null && ps1.getPasEvent().getPatient().getName() != null && ps1.getPasEvent().getPatient().getName() != null) ? ps1.getPasEvent().getPatient().getName().getForename():null; } if(ob2 instanceof OutPatientListVo) { OutPatientListVo ps2 = (OutPatientListVo)ob2; rez2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getPatient() != null && ps2.getPasEvent().getPatient().getName() != null && ps2.getPasEvent().getPatient().getName() != null) ? ps2.getPasEvent().getPatient().getName().getForename():null; } if(rez1 != null && rez2 != null) return rez1.compareToIgnoreCase(rez2)*direction; if(rez1 != null && rez2 == null) return direction; if(rez2 != null && rez1 == null) return (-1)*direction; return 0; }
public int compare(Object ob1, Object ob2) { String rez1 = null; String rez2 = null; if(ob1 instanceof OutPatientListVo) { OutPatientListVo ps1 = (OutPatientListVo)ob1; rez1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getPatient() != null && ps1.getPasEvent().getPatient().getSex() != null ) ? ps1.getPasEvent().getPatient().getSex().getText():null; } if(ob2 instanceof OutPatientListVo) { OutPatientListVo ps2 = (OutPatientListVo)ob2; rez2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getPatient() != null && ps2.getPasEvent().getPatient().getSex() != null ) ? ps2.getPasEvent().getPatient().getSex().getText():null; } if(rez1 != null && rez2 != null) return rez1.compareToIgnoreCase(rez2)*direction; if(rez1 != null && rez2 == null) return direction; if(rez2 != null && rez1 == null) return (-1)*direction; return 0; }
public int compare(Object ob1, Object ob2) { PartialDate rez1 = null; PartialDate rez2 = null; if(ob1 instanceof OutPatientListVo) { OutPatientListVo ps1 = (OutPatientListVo)ob1; rez1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getPatient() != null && ps1.getPasEvent().getPatient().getDob() != null ) ? ps1.getPasEvent().getPatient().getDob():null; } if(ob2 instanceof OutPatientListVo) { OutPatientListVo ps2 = (OutPatientListVo)ob2; rez2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getPatient() != null && ps2.getPasEvent().getPatient().getDob() != null ) ? ps2.getPasEvent().getPatient().getDob():null; } if(rez1 != null && rez2 != null) return rez1.compareTo(rez2)*direction; if(rez1 != null && rez2 == null) return direction; if(rez2 != null && rez1 == null) return (-1)*direction; return 0; }
public int compare(Object ob1, Object ob2) { Integer rez1 = null; Integer rez2 = null; if(ob1 instanceof OutPatientListVo) { OutPatientListVo ps1 = (OutPatientListVo)ob1; rez1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getPatient() != null && ps1.getPasEvent().getPatient().calculateAgeText() != null && ps1.getPasEvent().getPatient().calculateAgeText() != "-") ? Integer.parseInt(ps1.getPasEvent().getPatient().calculateAgeText()):null; } if(ob2 instanceof OutPatientListVo) { OutPatientListVo ps2 = (OutPatientListVo)ob2; rez2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getPatient() != null && ps2.getPasEvent().getPatient().calculateAgeText() != null && ps2.getPasEvent().getPatient().calculateAgeText() != "-") ? Integer.parseInt(ps2.getPasEvent().getPatient().calculateAgeText()):null; } if(rez1 != null && rez2 != null) return rez1.compareTo(rez2)*direction; if(rez1 != null && rez2 == null) return direction; if(rez2 != null && rez1 == null) return (-1)*direction; return 0; }
public int compare(Object ob1, Object ob2) { String rez1 = null; String rez2 = null; if(ob1 instanceof OutPatientListVo) { OutPatientListVo ps1 = (OutPatientListVo)ob1; rez1 = ps1.getClinic() != null ? ps1.getClinic().getClinicName():null; } if(ob2 instanceof OutPatientListVo) { OutPatientListVo ps2 = (OutPatientListVo)ob2; rez2 = ps2.getClinic() != null ? ps2.getClinic().getClinicName():null; } if(rez1 != null && rez2 != null) return rez1.compareToIgnoreCase(rez2)*direction; if(rez1 != null && rez2 == null) return direction; if(rez2 != null && rez1 == null) return (-1)*direction; return 0; }
public int compare(Object ob1, Object ob2) { String rez1 = null; String rez2 = null; if(ob1 instanceof OutPatientListVo) { OutPatientListVo ps1 = (OutPatientListVo)ob1; rez1 = (ps1.getPasEvent() != null && ps1.getPasEvent().getSpecialty() != null) ? ps1.getPasEvent().getSpecialty().getText():null; } if(ob2 instanceof OutPatientListVo) { OutPatientListVo ps2 = (OutPatientListVo)ob2; rez2 = (ps2.getPasEvent() != null && ps2.getPasEvent().getSpecialty() != null) ? ps2.getPasEvent().getSpecialty().getText():null; } if(rez1 != null && rez2 != null) return rez1.compareToIgnoreCase(rez2)*direction; if(rez1 != null && rez2 == null) return direction; if(rez2 != null && rez1 == null) return (-1)*direction; return 0; }
public int compare(Object ob1, Object ob2) { DateTime rez1 = null; DateTime rez2 = null; if(ob1 instanceof OutPatientListVo) { OutPatientListVo ps1 = (OutPatientListVo)ob1; rez1 = ps1.getAppointmentDateTime(); } if(ob2 instanceof OutPatientListVo) { OutPatientListVo ps2 = (OutPatientListVo)ob2; rez2 = ps2.getAppointmentDateTime(); } if(rez1 != null && rez2 != null) return rez1.compareTo(rez2)*direction; if(rez1 != null && rez2 == null) return direction; if(rez2 != null && rez1 == null) return (-1)*direction; return 0; }
private void populateList(OutPatientListVoCollection voOutPatColl) { if (voOutPatColl != null) { if (voOutPatColl.size() == 0) { engine.showMessage("No matching patients found."); return; } grdListRow row = null; for (int i = 0; i < voOutPatColl.size(); i++) { OutPatientListVo voOutPatient = voOutPatColl.get(i); if (voOutPatient != null && voOutPatient.getPasEventIsNotNull() && voOutPatient.getPasEvent().getPatientIsNotNull()) { row = form.grdList().getRows().newRow(); if (voOutPatient.getPasEvent().getPatient().getNameIsNotNull()) { row.setcolForename(voOutPatient.getPasEvent().getPatient().getName().getForename()); row.setcolSurname(voOutPatient.getPasEvent().getPatient().getName().getSurname()); } ims.core.vo.PatientId voPatId = voOutPatient.getPasEvent().getPatient().getDisplayId(); if (voPatId != null) row.setcolHospnum(voPatId.getValue()); if (voOutPatient.getPasEvent().getPatient().getDobIsNotNull()) row.setcolDob(voOutPatient.getPasEvent().getPatient().getDob().toString()); if (voOutPatient.getPasEvent().getPatient().getAgeIsNotNull()) row.setColAge(voOutPatient.getPasEvent().getPatient().getAge().toString()); else row.setColAge(voOutPatient.getPasEvent().getPatient().calculateAge().toString()); if (voOutPatient.getPasEvent().getPatient().getSexIsNotNull()) row.setcolSex(voOutPatient.getPasEvent().getPatient().getSex().getText()); if (voOutPatient.getClinicIsNotNull()) row.setcolClinic(voOutPatient.getClinic().getClinicName()); if (voOutPatient.getPasEvent() != null && voOutPatient.getPasEvent().getSpecialty() != null) row.setcolSpecialty(voOutPatient.getPasEvent().getSpecialty().getText()); if (voOutPatient.getAppointmentDateTimeIsNotNull()) row.setcolClinicDate(voOutPatient.getAppointmentDateTime().toString()); if (voOutPatient.getPasEvent().getPatient().getIsDead() != null && voOutPatient.getPasEvent().getPatient().getIsDead().booleanValue()) row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue()); row.setValue(voOutPatient.getPasEvent().getPatient()); } } } }
private void populateList(OutPatientListVoCollection voOutPatColl) { form.lyrLetterCreate().tabClinicList().grdPatient().getRows().clear(); if (voOutPatColl == null || voOutPatColl.size() == 0) { engine.showMessage("No results found for search criteria", "No records", MessageButtons.OK, MessageIcon.INFORMATION); //wdev-15816 return; } for (int i = 0; i < voOutPatColl.size(); i++) { OutPatientListVo voOutPatient = voOutPatColl.get(i); if (voOutPatient != null && voOutPatient.getPasEventIsNotNull() && voOutPatient.getPasEvent().getPatientIsNotNull()) { grdPatientRow row = form.lyrLetterCreate().tabClinicList().grdPatient().getRows().newRow(); if (voOutPatient.getPasEvent().getPatient().getNameIsNotNull()) { row.setcolForename(voOutPatient.getPasEvent().getPatient().getName().getForename()); row.setcolSurname(voOutPatient.getPasEvent().getPatient().getName().getSurname()); } ims.core.vo.PatientId voPatId = voOutPatient.getPasEvent().getPatient().getDisplayId(); if (voPatId != null) row.setcolHospnum(voPatId.getValue()); if (voOutPatient.getPasEvent().getPatient().getDobIsNotNull()) row.setcolDob(voOutPatient.getPasEvent().getPatient().getDob().toString()); if (voOutPatient.getClinicIsNotNull()) row.setcolClinic(voOutPatient.getClinic().getClinicName()); if (voOutPatient.getPasEvent() != null && voOutPatient.getPasEvent().getSpecialty() != null) row.setcolSpecialty(voOutPatient.getPasEvent().getSpecialty().getText()); if (voOutPatient.getAppointmentDateTimeIsNotNull()) row.setcolClinicDate(voOutPatient.getAppointmentDateTime().toString()); if (voOutPatient.getPasEvent().getPatient().getIsDead() != null && voOutPatient.getPasEvent().getPatient().getIsDead().booleanValue()) row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue()); row.setcolDocCreate(true); row.setValue(voOutPatient); } } }
private void populateOutPatientList(OutPatientListVoCollection outpatientAttendances) { clearOutPatientList(); if (outpatientAttendances == null || outpatientAttendances.size() == 0) { engine.showMessage("No matching patients found."); return; } storeSearchCriteria(); GenForm.grdOutPatientRow row = null; for (OutPatientListVo outpatient : outpatientAttendances) { if (outpatient != null && outpatient.getPasEventIsNotNull() && outpatient.getPasEvent().getPatientIsNotNull()) { PatientShort patient = outpatient.getPasEvent().getPatient(); row = form.grdOutPatient().getRows().newRow(); if (patient.getNameIsNotNull()) { row.setcolForename(patient.getName().getForename()); row.setcolSurname(patient.getName().getSurname()); } ims.core.vo.PatientId voPatId = patient.getDisplayId(); if (voPatId != null) row.setcolHospnum(voPatId.getValue()); //WDEV-16710 StringBuffer patientIdentifiers = new StringBuffer(); PatientIdCollection identifiers = patient.getIdentifiers(); if (identifiers != null) { for (int a = 0; a < identifiers.size(); a++) { patientIdentifiers.append("<b>" + identifiers.get(a).getType().toString() + ":</b> " + identifiers.get(a).getValue() + "<br>"); } } row.setTooltipForcolHospnum(patientIdentifiers.toString()); if (patient.getDobIsNotNull()) row.setcolDob(patient.getDob().toString()); if (patient.getAgeIsNotNull()) row.setColAge(patient.getAge().toString()); else { //WDEV-12716 Integer age = patient.calculateAge(); if (age != null) row.setColAge(age.toString()); } if (patient.getSexIsNotNull()) row.setcolSex(patient.getSex().getText()); if (outpatient.getClinicIsNotNull()) row.setcolClinic(outpatient.getClinic().getClinicName()); if (outpatient.getPasEvent() != null && outpatient.getPasEvent().getSpecialty() != null) row.setcolSpecialty(outpatient.getPasEvent().getSpecialty().getText()); if (outpatient.getAppointmentDateTimeIsNotNull()) row.setcolClinicDate(outpatient.getAppointmentDateTime().toString()); if (patient.getIsDead() != null && patient.getIsDead().booleanValue()) row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue()); row.setValue(outpatient); } } }
private void populateOutPatientList(OutPatientListVoCollection outpatientAttendances) { clearOutPatientList(); if (outpatientAttendances == null || outpatientAttendances.size() == 0) { return; } storeSearchCriteria(); GenForm.grdOutPatientRow row = null; for (OutPatientListVo outpatient : outpatientAttendances) { if (outpatient != null && outpatient.getPasEventIsNotNull() && outpatient.getPasEvent().getPatientIsNotNull()) { PatientShort patient = outpatient.getPasEvent().getPatient(); row = form.grdOutPatient().getRows().newRow(); if (patient.getNameIsNotNull()) { row.setcolForename(patient.getName().getForename()); row.setcolSurname(patient.getName().getSurname()); } ims.core.vo.PatientId voPatId = patient.getDisplayId(); if (voPatId != null) row.setcolHospnum(voPatId.getValue()); //WDEV-16710 StringBuffer patientIdentifiers = new StringBuffer(); PatientIdCollection identifiers = patient.getIdentifiers(); if (identifiers != null) { for (int a = 0; a < identifiers.size(); a++) { patientIdentifiers.append("<b>" + identifiers.get(a).getType().toString() + ":</b> " + identifiers.get(a).getValue() + "<br>"); } } row.setTooltipForcolHospnum(patientIdentifiers.toString()); if (patient.getDobIsNotNull()) row.setcolDob(patient.getDob().toString()); if (patient.getAgeIsNotNull()) row.setColAge(patient.getAge().toString()); else { //WDEV-12716 Integer age = patient.calculateAge(); if (age != null) row.setColAge(age.toString()); } if (patient.getSexIsNotNull()) row.setcolSex(patient.getSex().getText()); if (outpatient.getClinicIsNotNull()) row.setcolClinic(outpatient.getClinic().getClinicName()); if (outpatient.getPasEvent() != null && outpatient.getPasEvent().getSpecialty() != null) row.setcolSpecialty(outpatient.getPasEvent().getSpecialty().getText()); if (outpatient.getAppointmentDateTimeIsNotNull()) row.setcolClinicDate(outpatient.getAppointmentDateTime().toString()); if (patient.getIsDead() != null && patient.getIsDead().booleanValue()) row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue()); row.setValue(outpatient); } } }