private void open() { form.setMode(FormMode.VIEW); clearScreen(); updateMenuItems(); if(setUpBlankPMHChecklistGrid() == false) { form.btnNew().setVisible(false); form.btnUpdate().setVisible(false); return; } if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull()) { PatientPMHChecklistVo voPatientPMHChecklist = domain.getPatientPMHChecklist(form.getGlobalContext().Core.getCurrentCareContext()); PatientPastMedicalHistoryVo voPMH = domain.getPastMedicalHistory(form.getGlobalContext().Core.getPatientShort()); form.getLocalContext().setPastMedicalHistory(voPMH); if(voPatientPMHChecklist != null) { form.getLocalContext().setvoPatientPMHChecklist(voPatientPMHChecklist); form.btnNew().setVisible(false); form.btnUpdate().setVisible(true); populateScreenFromData(); } else { form.btnNew().setVisible(true); form.btnUpdate().setVisible(false); displayPastMedicalHistory(); } } }
protected void populateScreenFromData() { resetDiagnosisAndProcedures(); PatientPMHChecklistVo voPatientPMHChecklist = form.getLocalContext().getvoPatientPMHChecklist(); if(voPatientPMHChecklist == null) return; populateGridFromData(); }
public PatientPMHChecklistVo getPatientPMHChecklist(CareContextRefVo refVoCareContext) { if(refVoCareContext == null || refVoCareContext.getID_CareContext() == null) throw new DomainRuntimeException("Contact not provided for get call. "); DomainFactory factory = getDomainFactory(); java.util.List patientPMHChecklist = factory.find("from PatientPMHChecklist pmhlist where pmhlist.careContext.id = :contactId", new String[]{"contactId"}, new Object[]{refVoCareContext.getID_CareContext()}); if (patientPMHChecklist.size()>0) return PatientPMHChecklistVoAssembler.createPatientPMHChecklistVoCollectionFromPatientPMHChecklist(patientPMHChecklist).get(0); else return null; }
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException { if(validateScreenData() == false) return; populateDataFromScreen(); PatientPMHChecklistVo voPatientPMHChecklist = form.getLocalContext().getvoPatientPMHChecklist(); voPatientPMHChecklist.setPresComplaint("Demo"); //to satisfy validation ClinicalContactShortVo voClinContactShort = form.getGlobalContext().Core.getCurrentClinicalContact(); voPatientPMHChecklist.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voPatientPMHChecklist.setClinicalContact(voClinContactShort); String[] arrErrors = voPatientPMHChecklist.validate(); if(arrErrors != null) { engine.showErrors(arrErrors); return; } try { voPatientPMHChecklist = domain.savePatientPMHChecklist(voPatientPMHChecklist, form.getGlobalContext().Core.getPatientShort()); } catch(StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return; } catch (UniqueKeyViolationException ue) { engine.showMessage(ue.getMessage()); return; } form.getLocalContext().setvoPatientPMHChecklist(voPatientPMHChecklist); form.setMode(FormMode.VIEW); open(); }