private boolean loadEnvironmentalVisitsOfClinicalContact(EnvironmentalVisitShortVo voEnvirVisit) { ClinicalContactShortVo voClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact(); //A Clinical Contact can only have one Environmental Visit Record if(voClinicalContact != null && voClinicalContact.getID_ClinicalContact().equals(voEnvirVisit.getClinicalContact().getID_ClinicalContact())) { //this Clinical Contact has been selected from the patient summary loadCurrentClinicalContact(voEnvirVisit.getClinicalContact(), Color.Green); return true; } else { loadCurrentClinicalContact(voEnvirVisit.getClinicalContact(), null); } return false; }
private void isRecordEditable() { if(form.recbrEnvironment().getValue()!= null) { if(form.recbrEnvironment().getValue() instanceof ClinicalContactShortVo && form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull() && form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact().equals(((ClinicalContactRefVo) form.recbrEnvironment().getValue()).getID_ClinicalContact())) { displayButtonsForRecord(); } else if((form.recbrEnvironment().getValue() instanceof CareContextShortVo || form.recbrEnvironment().getValue() instanceof EnvironmentalVisitShortVo) && form.getGlobalContext().Core.getCurrentClinicalContact() == null) { //If the current Care Context is selected then there is always an option of many environment records. displayButtonsForRecord(); form.btnNew().setVisible(true); form.btnNew().setEnabled(true); } else hideButtons(); } }
private void loadEnvironmentalVisitsOfCareContext(EnvironmentalVisitShortVoCollection voEnvirVisitShortColl) { if(voEnvirVisitShortColl != null) { for(int i =0; i<voEnvirVisitShortColl.size(); i++) { EnvironmentalVisitShortVo voEnvironmentalVisit = voEnvirVisitShortColl.get(i); if(voEnvironmentalVisit.getClinicalContact() == null && voEnvironmentalVisit.getCareContext().getID_CareContext().equals(form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext())) { loadEnvironmentalVisitsForACareContext(voEnvironmentalVisit); } } } }
private void loadEnvironmentalVisitsForACareContext(EnvironmentalVisitShortVo voEnvirVisit) { //A care context can have a number of Environmental Visits if(form.getGlobalContext().Core.getCurrentClinicalContact() == null) form.recbrEnvironment().newRow(voEnvirVisit, "\t\t\t\t "+ voEnvirVisit.getAuthoringDateTime() + " - " + voEnvirVisit.getAuthoringCP().getMos().getName(), Color.Green); else form.recbrEnvironment().newRow(voEnvirVisit, "\t\t\t\t "+ voEnvirVisit.getAuthoringDateTime() + " - " + voEnvirVisit.getAuthoringCP().getMos().getName()); }
private void browseRecord() { form.getLocalContext().setvoEnvironmentalVisit(null); clearScreen(); if(form.recbrEnvironment().getValue() != null) { if(form.recbrEnvironment().getValue() instanceof ClinicalContactShortVo) form.getLocalContext().setvoEnvironmentalVisit(domain.getEnvironmentalVisitByClinicalContact((ClinicalContactRefVo) form.recbrEnvironment().getValue())); else if(form.recbrEnvironment().getValue() instanceof EnvironmentalVisitShortVo) form.getLocalContext().setvoEnvironmentalVisit(domain.getEnvironmentalVisit((EnvironmentalVisitShortVo) form.recbrEnvironment().getValue())); } populateScreenFromData(); isRecordEditable(); }