public void setDBImage(AppDBImageVo image) { if (image == null) { form.imgDisplay().setValue(form.getImages().Core.NoPatientImage); return; } try { String sessionID = engine.getSessionId(); String encodedImage = image.getImageData(); String type = image.getImageType().getText(); decodeFromBase64(encodedImage, sessionID, type); } catch (IOException error) { engine.showMessage(error.getMessage()); } }
private AppImageVo getPatientImage(TrackingForClinicianWorklistAndTriageVo tracking) throws IOException { if (tracking == null || tracking.getPatient() == null) return null; String sessionID = engine.getSessionId(); AppDBImageVo dbImageVo = tracking.getPatient().getPhoto(); //Existing Patient with no image if (dbImageVo == null) { // NoPatientImage AppImageVo imageVo = new AppImageVo(); imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath()); return imageVo; } String encodedImage = dbImageVo.getImageData(); String type = dbImageVo.getImageType().getText(); return decodeFromBase64(encodedImage, sessionID, type); }
private AppImageVo getPatientImage(TrackingListForClinicianWorklistVo tracking) throws IOException { if (tracking == null || tracking.getPatient() == null) return null; String sessionID = engine.getSessionId(); AppDBImageVo dbImageVo = tracking.getPatient().getPhoto(); //Existing Patient with no image if (dbImageVo == null) { // NoPatientImage AppImageVo imageVo = new AppImageVo(); imageVo.setImagePath(engine.getRegisteredImage(102554).getImagePath()); return imageVo; } String encodedImage = dbImageVo.getImageData(); String type = dbImageVo.getImageType().getText(); return decodeFromBase64(encodedImage, sessionID, type); }
private void populateWoundImageControl(AppDBImageVo dbImageVo) { if (dbImageVo == null) { form.imgWoundImage().setValue(form.getImages().Core.NoPatientImage); return; } else { try { form.imgWoundImage().setVisible(true); String sessionID = engine.getSessionId(); String encodedImage = dbImageVo.getImageData(); String type = dbImageVo.getImageType().getText(); decodeFromBase64(encodedImage, sessionID, type); } catch (IOException error) { engine.showMessage(error.getMessage()); } } }
private AppImageVo getPatientImage(TrackingListForTriageVo tracking) throws IOException { if (tracking == null || tracking.getPatient() == null) return null; String sessionID = engine.getSessionId(); AppDBImageVo dbImageVo = tracking.getPatient().getPhoto(); //Existing Patient with no image if (dbImageVo == null) { // NoPatientImage AppImageVo imageVo = new AppImageVo(); imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath()); return imageVo; } String encodedImage = dbImageVo.getImageData(); String type = dbImageVo.getImageType().getText(); return decodeFromBase64(encodedImage, sessionID, type); }
private AppImageVo getPatientImage(TrackingForDisplayClinicianAndTriageWorklistVo tracking) throws IOException //WDEV-18001 { if (tracking == null || tracking.getPatient() == null) return null; String sessionID = engine.getSessionId(); AppDBImageVo dbImageVo = tracking.getPatient().getPhoto(); //Existing Patient with no image if (dbImageVo == null) { // NoPatientImage AppImageVo imageVo = new AppImageVo(); imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath()); return imageVo; } String encodedImage = dbImageVo.getImageData(); String type = dbImageVo.getImageType().getText(); return decodeFromBase64(encodedImage, sessionID, type); }
private AppImageVo getPatientImage(TrackingForPatientWhiteBoardVo tempVo) throws IOException { if (tempVo == null || tempVo.getPatient() == null) return null; String sessionID = engine.getSessionId(); AppDBImageVo dbImageVo = tempVo.getPatient().getPhoto(); //Existing Patient with no image if (dbImageVo == null) { // NoPatientImage AppImageVo imageVo = new AppImageVo(); imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath()); return imageVo; } String encodedImage = dbImageVo.getImageData(); String type = dbImageVo.getImageType().getText(); return decodeFromBase64(encodedImage, sessionID, type); }
/** * setValue */ public void setValue(ims.core.patient.vo.PatientRefVo value) { //New Patient if (value == null) { form.imgDisplay().setValue(form.getImages().Core.NoPatientImage); return; } //Existing Patient else { form.imgDisplay().setVisible(true); try { String sessionID = engine.getSessionId(); int patientID = value.getID_Patient(); PatientImageVo patientImage = domain.getPatientImage(patientID); AppDBImageVo dbImageVo = patientImage.getDBPhoto(); //Existing Patient with no image if (dbImageVo == null) { form.imgDisplay().setValue(form.getImages().Core.NoPatientImage); return; } String encodedImage = dbImageVo.getImageData(); String type = dbImageVo.getImageType().getText(); decodeFromBase64(encodedImage, sessionID, type); } catch (IOException error) { engine.showMessage(error.getMessage()); } } }
public void setDBImage(AppDBImageVo image) { form.ccDBImageDisplay().setDBImage(form.getGlobalContext().Core.getPatientImage()); }
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException { String imageFilename = form.getLocalContext().getSelectedFile(); if (imageFilename == null || imageFilename.equals("")) { engine.showMessage("Image cannot be saved with no file name specified"); return; } try { String uploadFileName = getBaseName(imageFilename); ByteArrayOutputStream baos = new ByteArrayOutputStream(); BufferedImage originalImage = ImageIO.read(new File(EnvironmentConfig.getBaseUri() + ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + "/" + uploadFileName)); baos = new ByteArrayOutputStream(); ImageIO.write(originalImage, "png", baos); byte[] content = baos.toByteArray(); String encodedResizeImage = encodeToBase64(content); AppDBImageVo dbImageVo = new AppDBImageVo(); dbImageVo.setImageData(encodedResizeImage); dbImageVo.setImageType(getImageType(getFileType())); PatientWoundAppDBImAndCommentVo tempVo = new PatientWoundAppDBImAndCommentVo(); tempVo.setWoundImage(dbImageVo); tempVo.setComment(form.txtComment().getValue()); form.getGlobalContext().Core.setPatientWoundAppDBImAndComment(tempVo); engine.close(DialogResult.OK); } catch (IOException err) { engine.showMessage(err.getMessage()); return; } }