/** * 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 PatientImageVo getPatientImage(Integer patientID) { DomainFactory factory = getDomainFactory(); return PatientImageVoAssembler.create((ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patientID)); }