private void editDocument() { if(form.getLocalContext().getSelectedDocumentIsNotNull()) { ServerDocumentVo document = form.getLocalContext().getSelectedDocument().getServerDocument(); if(document != null) { String fileName = document.getFileName(); String filePath = (getPdfStorePath() + fileName).replace("/", "\\"); if(FileType.DOC.equals(document.getFileType())) { String winPath = engine.getLocalSettings().getWordEditorPath(); if(winPath == null || winPath.length() == 0) { form.getLocalContext().setTryingToEditWhitoutPath(true); engine.open(form.getForms().Core.LocalSettingsDialog); return; } engine.runExternalApplication(winPath + " " + filePath); } } } }
private boolean validateNonFinalDocument(PatientDocumentVo selectedDocument) { if (selectedDocument == null) throw new CodingRuntimeException("Trying to validate null document"); String[] errors = selectedDocument.validate(); if (errors != null && errors.length > 0) { throw new CodingRuntimeException("The document is not valid. Posible data corruption"); } if (isDocumentFinal(selectedDocument) || !FileType.DOC.equals(selectedDocument.getServerDocument().getFileType())) { //This is a stale exception engine.showErrors(new String[] { ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue() }); form.getLocalContext().setSelectedDocument(null); form.getLocalContext().setOldSelectedDocument(null);//WDEV-13546 open(); return false; } return true; }
private void viewInstance() { if (form.getLocalContext().getSelectedDocumentIsNotNull()) { ServerDocumentVo document = form.getLocalContext().getSelectedDocument().getServerDocument(); if (document != null) { String fileName = document.getFileName(); String fullPath = getMaximsDocumentStorePath(); if (FileType.DOC.equals(document.getFileType())) { throw new CodingRuntimeException("Trying to view a draft document not allowed"); } fullPath += fileName; selectPatient(form.getLocalContext().getSelectedDocument().getPatient()); engine.open(form.getForms().Core.PatientDocumentView, new Object[] { fullPath.replace("/", "\\") }); } } }
private boolean validateNonFinalDocument(PatientDocumentVo selectedDocument) { if (selectedDocument == null) throw new CodingRuntimeException("Trying to validate null document"); String[] errors = selectedDocument.validate(); if (errors != null && errors.length > 0) { showError("The document is not valid. Posible data corruption"); return false; } if (isDocumentFinal(selectedDocument)) { throw new CodingRuntimeException("The document is not draft"); } if (!FileType.DOC.equals(selectedDocument.getServerDocument().getFileType())) { showError("The document is not the right type. Posible data corruption"); return false; } return true; }
private ServerDocumentVo populateServerDocument(String fileName) { DateTime date = new DateTime(); int year = date.getDate().getYear(); int month = date.getDate().getMonth(); int day = date.getDate().getDay(); String filePath = year + "/" + month + "/" + day + "/" + fileName; ServerDocumentVo document = new ServerDocumentVo(); document.setFileName(filePath); document.setFileType(FileType.PDF); return document; }
private ServerDocumentVo populateServerDocument(byte[] reportContent) { String fileName = generateName() + ".pdf"; engine.uploadFile(ConfigFlag.GEN.PDF_UPLOAD_URL.getValue(), reportContent, fileName, ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + "/");//WDEV-15470 String path = null; int year = new DateTime().getDate().getYear(); int month = new DateTime().getDate().getMonth(); int day = new DateTime().getDate().getDay(); if(fileName != null && fileName.length() > 0) path = year + "/" + month + "/" + day + "/" + fileName;//WDEV-15470 // Create Server document VO if uploads succeeds ServerDocumentVo document = new ServerDocumentVo(); document.setFileName(path); document.setFileType(FileType.PDF); return document; }
private void viewDocument() { if(form.getLocalContext().getSelectedDocumentIsNotNull()) { PatientDocumentVo selectedPatDocumentVo = form.getLocalContext().getSelectedDocument(); String fullPath = ""; boolean isDraft = selectedPatDocumentVo != null && isDraft(selectedPatDocumentVo.getCurrentDocumentStatus()); boolean showWarningMessage = ConfigFlag.UI.PATIENT_DOCUMENTS_VIEW_DRAFT_WARNING_MESSAGE.getValue() != null && ConfigFlag.UI.PATIENT_DOCUMENTS_VIEW_DRAFT_WARNING_MESSAGE.getValue().length() > 0 && isDraft; if (isDraft) { if(!loadSelectedDocument()) return; convertDraftPatientDoc(selectedPatDocumentVo); fullPath = EnvironmentConfig.getAplicationURL() + (ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue().endsWith("/") ? ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue().replace("/", "") : ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue()) + "/" + getBaseName(form.getLocalContext().getDraftPDFFileName()); } ServerDocumentVo document = form.getLocalContext().getSelectedDocument().getServerDocument(); if(document != null) { if (FileType.PDF.equals(document.getFileType())) { fullPath = getFullPath(document); } engine.open(form.getForms().Core.PatientDocumentView, new Object[] {fullPath.replace("/", "\\"),showWarningMessage},true,true);//WDEV-18651 //WDEV-1867 } } }
private boolean validateNonFinalDocument(PatientDocumentVo selectedDocument) { if (selectedDocument == null) throw new CodingRuntimeException("Trying to validate null document"); String[] errors = selectedDocument.validate(); if (errors != null && errors.length > 0) { throw new CodingRuntimeException("The document is not valid. Posible data corruption"); } if (isDocumentFinal(selectedDocument) || !FileType.DOC.equals(selectedDocument.getServerDocument().getFileType())) { //This is a stale exception engine.showErrors(new String[] { ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue() }); form.getLocalContext().setSelectedDocument(null); open(); return false; } return true; }
private ServerDocumentVo populateServerDocumentVo(String fileName) { if(fileName == null || fileName.length() == 0) return null; ServerDocumentVo vo = new ServerDocumentVo(); vo.setFileName(fileName); vo.setFileType(FileType.DOC); return vo; }
private void viewDocument() { if(form.getLocalContext().getSelectedDocumentIsNotNull()) { ServerDocumentVo document = form.getLocalContext().getSelectedDocument().getServerDocument(); if(document != null) { String fileName = document.getFileName(); String fullPath = getPdfStorePath(); if(FileType.DOC.equals(document.getFileType())) { String tempPdfFile = convertRtfToPdf(fileName); if(tempPdfFile == null) return; fullPath += tempPdfFile; form.getLocalContext().setFileToDelete(fullPath); } else if(FileType.PDF.equals(document.getFileType())) { fullPath += fileName; } engine.open(form.getForms().Core.PatientDocumentView, new Object[] {fullPath.replace("/", "\\")}); } } }
private ServerDocumentVo populateServetDocumentVo() { ServerDocumentVo vo = new ServerDocumentVo(); String filePath = form.getLocalContext().getFileName().substring(0, form.getLocalContext().getFileName().length()-3) + "pdf"; vo.setFileName(filePath); vo.setFileType(FileType.PDF); return vo; }
@SuppressWarnings("deprecation") private ServerDocumentVo populateServerDocumentVo(String fileName) { Date date = new Date(); int year = date.getYear(); int month = date.getMonth(); int day = date.getDay(); ServerDocumentVo vo = new ServerDocumentVo(); String filePath = year + "/" + month + "/" + day + "/" + fileName; vo.setFileName(filePath); vo.setFileType(FileType.PDF); return vo; }
private ServerDocumentVo populateServetDocumentVo() { ServerDocumentVo vo = new ServerDocumentVo(); DateTime startDate = new ims.framework.utils.DateTime(); filePath = startDate.getDate().getYear()+ "/" +startDate.getDate().getMonth() + "/" + startDate.getDate().getDay() + "/" + fileName; vo.setFileName(filePath); vo.setFileType(FileType.PDF); return vo; }
private ServerDocumentVo populateServetDocumentVo(String fileName) { DateTime date = new DateTime(); int year = date.getDate().getYear(); int month = date.getDate().getMonth(); int day = date.getDate().getDay(); ServerDocumentVo vo = new ServerDocumentVo(); String filePath = year + "/" + month + "/" + day + "/" + fileName; vo.setFileName(filePath); vo.setFileType(FileType.PDF); return vo; }
private ServerDocumentVo populateServerDocument() { ServerDocumentVo vo = new ServerDocumentVo(); DateTime startDate = new ims.framework.utils.DateTime(); filePath = startDate.getDate().getYear()+ "/" +startDate.getDate().getMonth() + "/" + startDate.getDate().getDay() + "/" + fileName; vo.setFileName(filePath); vo.setFileType(FileType.PDF); return vo; }