private void print() { DocumentAndPatientWrapperVoCollection documents = new DocumentAndPatientWrapperVoCollection(); DocumentAndPatientWrapperVo record = new DocumentAndPatientWrapperVo(); record.setDocument(form.getLocalContext().getSelectedDocument()); PatientForDocumentWorklistVo patient = new PatientForDocumentWorklistVo(form.getGlobalContext().Core.getPatientShort().getID_Patient(), form.getGlobalContext().Core.getPatientShort().getVersion_Patient()); patient.setName(form.getGlobalContext().Core.getPatientShort().getName()); patient.setIdentifiers(form.getGlobalContext().Core.getPatientShort().getIdentifiers()); record.setPatient(patient); documents.add(record); engine.open(form.getForms().Core.MultiPrintDialog, new Object[] {documents}); }
private void batchPrintAndEmail(DocumentStatus status) { if (!areDocumentsSelected()) { engine.showMessage("Please select some documents first"); return; } DocumentAndPatientWrapperVoCollection docs = getSelectedDocsWithPatient(); PatientDocumentErrorVoCollection errors = lockDraftDocuments(docs, status); errors = email(docs, errors); errors = savePatientDocuments(docs, errors, false);// WDEV-15599 print(docs, errors); }
private void printInstance() { if (!form.getLocalContext().getSelectedDocumentIsNotNull()) return; if (!isDocumentFinal(form.getLocalContext().getSelectedDocument())) throw new CodingRuntimeException("Printing a draft document not allowed"); form.getLocalContext().setNotBatchPrint(true); DocumentAndPatientWrapperVoCollection documents = new DocumentAndPatientWrapperVoCollection(); DocumentAndPatientWrapperVo doc = new DocumentAndPatientWrapperVo(); doc.setDocument(form.getLocalContext().getSelectedDocument()); doc.setPatient(form.grdDocuments().getValue().getPatient()); documents.add(doc); //WDEV-12643 if(ConfigFlag.UI.CORRESPONDENCE_KEEP_PATIENT_SELECTED.getValue())//WDEV-13794 selectPatient(form.getLocalContext().getSelectedDocument().getPatient()); print(documents, null); }
private void printDocument() { DocumentAndPatientWrapperVoCollection documents = new DocumentAndPatientWrapperVoCollection(); DocumentAndPatientWrapperVo record = new DocumentAndPatientWrapperVo(); record.setDocument(form.getLocalContext().getSelectedDocument()); PatientForDocumentWorklistVo patient = new PatientForDocumentWorklistVo(form.getGlobalContext().Core.getPatientShort().getID_Patient(), form.getGlobalContext().Core.getPatientShort().getVersion_Patient()); patient.setName(form.getGlobalContext().Core.getPatientShort().getName()); patient.setIdentifiers(form.getGlobalContext().Core.getPatientShort().getIdentifiers()); record.setPatient(patient); documents.add(record); engine.open(form.getForms().Core.MultiPrintDialog, new Object[] {documents}); }
private void printAndLock() { if(form.getLocalContext().getSelectedDocument() == null) return; form.getLocalContext().getSelectedDocument().setCorrespondenceStatus(DocumentStatus.FINAL); if(savePatientDocument(form.getLocalContext().getSelectedDocument())) { open(); DocumentAndPatientWrapperVoCollection documents = new DocumentAndPatientWrapperVoCollection(); DocumentAndPatientWrapperVo record = new DocumentAndPatientWrapperVo(); record.setDocument(form.getLocalContext().getSelectedDocument()); PatientForDocumentWorklistVo patient = new PatientForDocumentWorklistVo(form.getGlobalContext().Core.getPatientShort().getID_Patient(), form.getGlobalContext().Core.getPatientShort().getVersion_Patient()); patient.setName(form.getGlobalContext().Core.getPatientShort().getName()); patient.setIdentifiers(form.getGlobalContext().Core.getPatientShort().getIdentifiers()); record.setPatient(patient); documents.add(record); engine.open(form.getForms().Core.MultiPrintDialog, new Object[] {documents}); } form.getLocalContext().setSelectedDocument(domain.getPatientDocument(form.getLocalContext().getSelectedDocument())); form.getGlobalContext().Core.setPatientCorrespondence(form.getLocalContext().getSelectedDocument()); form.grdDetails().setValue(domain.getPatientDocumentSearchListVo(form.getLocalContext().getSelectedDocument())); }
private void batchPrint(DocumentStatus status)// WDEV-14174 { form.getLocalContext().setNotBatchPrint(false); if (!areDocumentsSelected()) { engine.showMessage("Please select some documents first"); return; } DocumentAndPatientWrapperVoCollection docs = getSelectedDocsWithPatient(); PatientDocumentErrorVoCollection errors = lockDraftDocuments(docs, status);// WDEV-14174 print(docs, errors); }
private void print(DocumentAndPatientWrapperVoCollection docs, PatientDocumentErrorVoCollection errors) { form.getGlobalContext().Core.setPatientDocumentsErrors(errors); if ((docs == null || docs.size() == 0) && errors != null && errors.size() > 0)// WDEV-15599 { engine.open(form.getForms().Core.PatientDocumentErrors,new Object[]{errors}); return; } engine.open(form.getForms().Core.MultiPrintDialog, new Object[] {docs}); }
private void batchEmail(DocumentStatus status)// WDEV-14174 { if (!areDocumentsSelected()) { engine.showMessage("Please select some documents first"); return; } DocumentAndPatientWrapperVoCollection docs = getSelectedDocsWithPatient(); PatientDocumentErrorVoCollection errors = lockDraftDocuments(docs, status);// WDEV-14174 errors = email(docs, errors);// WDEV-14174 savePatientDocuments(docs, errors, true);// WDEV-14174, WDEV-15599 open(); }
private void batchChangeStatus() { if (!areDocumentsSelected()) { engine.showMessage("Please select some documents first"); return; } if (areNonReadyToSendDocumentsSelected()) { engine.showMessage("Please select only ready to send documents"); } DocumentAndPatientWrapperVoCollection selectedDocs = getSelectedDocsWithPatient(); PatientDocumentErrorVoCollection errors = new PatientDocumentErrorVoCollection(); for (int i = 0; i < selectedDocs.size(); i++) { errorS = null; if(selectedDocs.get(i) == null)// WDEV-13546 continue; if(Boolean.TRUE.equals(selectedDocs.get(i).getIsStale()))// WDEV-13546 { errorS ="Could not change status.\nThe document has been modified by another user"; errors.add(getDocumentError(selectedDocs.get(i))); } else if (changeStatus(DocumentStatus.COMPLETED, selectedDocs.get(i).getDocument(), false,true) == null && errorS !=null ) { errors.add(getDocumentError(selectedDocs.get(i))); } } if (errors.size() >0) { engine.open(form.getForms().Core.PatientDocumentErrors,new Object[]{errors}); } open(); }
private DocumentAndPatientWrapperVoCollection getSelectedDocsWithPatient() { DocumentAndPatientWrapperVoCollection result = new DocumentAndPatientWrapperVoCollection(); for (int i = 0; i < form.grdDocuments().getRows().size(); i++) { if (form.grdDocuments().getRows().get(i).getSelect()) { DocumentAndPatientWrapperVo record = new DocumentAndPatientWrapperVo(); record.setPatient(form.grdDocuments().getRows().get(i).getValue().getPatient()); record.setIsStale(false);// WDEV-13546 try { record.setDocument(domain.getPatientDocument(form.grdDocuments().getRows().get(i).getValue())); if(record.getDocumentIsNotNull() && form.grdDocuments().getRows().get(i).getValue() != null && form.grdDocuments().getRows().get(i).getValue().getID_PatientDocument().equals(record.getDocument().getID_PatientDocument()) && form.grdDocuments().getRows().get(i).getValue().getVersion_PatientDocument() != record.getDocument().getVersion_PatientDocument())// WDEV-13546 { if(isPatientDocumentReallyChanged(form.grdDocuments().getRows().get(i).getValue(), record.getDocument())) { record.setIsStale(true); } } } catch (StaleObjectException e) { record.setIsStale(true);// WDEV-13546 } result.add(record); } } return result; }
private void initialize(Object[] args) { form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT,true); if (args != null && args.length > 0) { if(args[0] instanceof DocumentAndPatientWrapperVoCollection) { DocumentAndPatientWrapperVoCollection documents = (DocumentAndPatientWrapperVoCollection) args[0]; populateGrid(documents); } } }
private void populateGrid(DocumentAndPatientWrapperVoCollection documents) { if (documents == null) return; for (int i = 0; i < documents.size(); i++) { newDocumentRow(documents.get(i)); } }
public PatientDocumentErrorVoCollection savePatientDocuments(DocumentAndPatientWrapperVoCollection documents) { if(documents == null || documents.size() == 0) return null; PatientDocumentErrorVoCollection errors = new PatientDocumentErrorVoCollection(); DomainFactory factory = getDomainFactory(); for(int i=0; i<documents.size(); i++) { PatientDocumentVo document = documents.get(i).getDocument(); if(document == null) continue; PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document); try { factory.save(doc); } catch (StaleObjectException e) { e.printStackTrace(); errors.add(createError(documents.get(i), "Could not save Number of Copies.")); } } return errors.size() > 0 ? errors : null; }