private void populateScreenFromData(EnvironmentalVisitVo voEnvironmentalVisit) { if(voEnvironmentalVisit == null) return; form.qmbAuthoringHCP().clear(); if (voEnvironmentalVisit.getAuthoringCPIsNotNull()) { form.qmbAuthoringHCP().newRow(voEnvironmentalVisit.getAuthoringCP(), voEnvironmentalVisit.getAuthoringCP().toString()); form.qmbAuthoringHCP().setValue(voEnvironmentalVisit.getAuthoringCP()); } form.dtimAuthoringDateTime().setValue(voEnvironmentalVisit.getAuthoringDateTime()); form.cmbLocation().setValue(voEnvironmentalVisit.getLocation()); if(voEnvironmentalVisit.getHouseDetailsIsNotNull() && voEnvironmentalVisit.getHouseDetails().getAddressIsNotNull()) form.txtPlaceVisited().setValue(voEnvironmentalVisit.getHouseDetails().getAddress()); if(voEnvironmentalVisit.getVisitSummaryIsNotNull()) { form.txtProblems().setValue(voEnvironmentalVisit.getVisitSummary().getProblemsIdentified()); form.txtRecommendations().setValue(voEnvironmentalVisit.getVisitSummary().getRecommendations()); form.txtEquipment().setValue(voEnvironmentalVisit.getVisitSummary().getEquipment()); form.txtConclusions().setValue(voEnvironmentalVisit.getVisitSummary().getConclusions()); } }
private void populateScreenFromData(EnvironmentalVisitVo voEnvironmentalVisit) { if (voEnvironmentalVisit == null) return; form.getLocalContext().setvoEnvironmentalVisit(voEnvironmentalVisit); form.qmbAuthoringHCP().clear(); if (voEnvironmentalVisit.getAuthoringCPIsNotNull()) { form.qmbAuthoringHCP().newRow(voEnvironmentalVisit.getAuthoringCP(), voEnvironmentalVisit.getAuthoringCP().toString()); form.qmbAuthoringHCP().setValue(voEnvironmentalVisit.getAuthoringCP()); } form.dtimAuthoringDateTime().setValue(voEnvironmentalVisit.getAuthoringDateTime()); form.cmbVisitLocation().setValue(voEnvironmentalVisit.getLocation()); if (voEnvironmentalVisit.getHouseDetailsIsNotNull() && voEnvironmentalVisit.getHouseDetails().getAddressIsNotNull()) form.txtPlaceVisited().setValue(voEnvironmentalVisit.getHouseDetails().getAddress()); populateChildNodes(voEnvironmentalVisit.getRooms()); }
private boolean isRecordCurrent() { ClinicalContactShortVo voCurrentClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact(); EnvironmentalVisitVo voEnvironmentalVisit = form.getLocalContext().getvoEnvironmentalVisit(); // check if the record has a clinicalContact and the GC ClinicalContact // is not null, if they are equal then return true. // or if the ClinicalContact is null and the GC Clinical Contact is // null, then the current care context selected, return true. // else return false; if (voEnvironmentalVisit != null) { if ((voEnvironmentalVisit.getClinicalContactIsNotNull() && voCurrentClinicalContact != null && voCurrentClinicalContact.getID_ClinicalContact().equals(voEnvironmentalVisit.getClinicalContact().getID_ClinicalContact())) || (voEnvironmentalVisit.getClinicalContact() == null && voCurrentClinicalContact == null)) { return true; } } return false; }
private void populateUpperScreenControls(EnvironmentalVisitVo voEnvironmentalVisit) { form.qmbAuthoringHCP().clear(); if (voEnvironmentalVisit.getAuthoringCPIsNotNull()) { form.qmbAuthoringHCP().newRow(voEnvironmentalVisit.getAuthoringCP(), voEnvironmentalVisit.getAuthoringCP().toString()); form.qmbAuthoringHCP().setValue(voEnvironmentalVisit.getAuthoringCP()); } form.dtimAuthoringDateTime().setValue(voEnvironmentalVisit.getAuthoringDateTime()); if(voEnvironmentalVisit.getHouseDetailsIsNotNull()&& voEnvironmentalVisit.getHouseDetails().getAddressIsNotNull()) form.txtAddress().setValue(voEnvironmentalVisit.getHouseDetails().getAddress()); form.dteDateOfVisit().setValue(voEnvironmentalVisit.getVisitDate()); form.cmbLocation().setValue(voEnvironmentalVisit.getLocation()); form.txtOccupation().setValue(voEnvironmentalVisit.getOccupation()); form.txtJobRole().setValue(voEnvironmentalVisit.getJobRole()); form.cmbTherapistPresent().setValue(voEnvironmentalVisit.getTherapistPresent()); form.txtOthersPresent().setValue(voEnvironmentalVisit.getOthersPresent()); }
private void populateFoodAndDrinking(EnvironmentalVisitVo voEnvironmentalVisit) { VisitAssessmentComponentVo voVisitAssessment; //Populate Food and Drinking Facilities for (int i=0; i < voEnvironmentalVisit.getVisitAssessmentDetails().size();i++) { voVisitAssessment = voEnvironmentalVisit.getVisitAssessmentDetails().get(i); if(voVisitAssessment.getType().getId() == EnvironmentalHomeVisitComponentType.FOODANDDRINKINGFACILITIES.getId()) { form.txtFoodandDrink().setValue(voVisitAssessment.getDetails()); form.txtFoodShortTerm().setValue(voVisitAssessment.getShortTermPlan()); form.txtFoodLongTerm().setValue(voVisitAssessment.getLongTermPlan()); break; } } }
private void populateToiletAndChanging(EnvironmentalVisitVo voEnvironmentalVisit) { VisitAssessmentComponentVo voVisitAssessment; //Populate Toileting and Changing Facilities for (int i=0; i < voEnvironmentalVisit.getVisitAssessmentDetails().size();i++) { voVisitAssessment = voEnvironmentalVisit.getVisitAssessmentDetails().get(i); if(voVisitAssessment.getType().getId() == EnvironmentalHomeVisitComponentType.TOILETINGANDCHANGINGFACILITIES.getId()) { form.txtToiletingAndChanging().setValue(voVisitAssessment.getDetails()); form.txtToiletingShortTerm().setValue(voVisitAssessment.getShortTermPlan()); form.txtToiletingLongTerm().setValue(voVisitAssessment.getLongTermPlan()); break; } } }
private void populateInternalAccess(EnvironmentalVisitVo voEnvironmentalVisit) { VisitAssessmentComponentVo voVisitAssessment; //Populate Internal Access for (int i=0; i < voEnvironmentalVisit.getVisitAssessmentDetails().size();i++) { voVisitAssessment = voEnvironmentalVisit.getVisitAssessmentDetails().get(i); if(voVisitAssessment.getType().getId() == EnvironmentalHomeVisitComponentType.INTERNALACCESS.getId()) { form.txtInternalAccess().setValue(voVisitAssessment.getDetails()); form.txtInternalShortTerm().setValue(voVisitAssessment.getShortTermPlan()); form.txtInternalLongTerm().setValue(voVisitAssessment.getLongTermPlan()); break; } } }
private void populateExternalAccess(EnvironmentalVisitVo voEnvironmentalVisit) { VisitAssessmentComponentVo voVisitAssessment; //Populate External Access and Parking Details for (int i=0; i < voEnvironmentalVisit.getVisitAssessmentDetails().size();i++) { voVisitAssessment = voEnvironmentalVisit.getVisitAssessmentDetails().get(i); if(voVisitAssessment.getType().getId() == EnvironmentalHomeVisitComponentType.ENVIRONMENTALEXTERNALACCESSANDPARKING.getId()) { form.txtExternalAccessandParking().setValue(voVisitAssessment.getDetails()); form.txtExternalShortTerm().setValue(voVisitAssessment.getShortTermPlan()); form.txtExternalLongTerm().setValue(voVisitAssessment.getLongTermPlan()); break; } } }
public EnvironmentalVisitVo getEnvironmentalVisitByClinicalContact(ClinicalContactRefVo voClinicalContactRef) { if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null) throw new DomainRuntimeException("Contact not provided for get call. "); DomainFactory factory = getDomainFactory(); java.util.List environVisitList = factory.find("from EnvironmentalVisit environList where environList.clinicalContact.id = :contactId ", new String[]{"contactId"}, new Object[]{voClinicalContactRef.getID_ClinicalContact()}); EnvironmentalVisitVoCollection coll = null; if ((environVisitList != null) && (environVisitList.size()>0)) coll = EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(environVisitList); if(coll != null && coll.size()>0) return coll.get(0); return null; }
public EnvironmentalVisitVo saveEnvironmentalVisit(EnvironmentalVisitVo voEnvironmentalVisit) throws StaleObjectException, UniqueKeyViolationException { DomainFactory factory = getDomainFactory(); if (!voEnvironmentalVisit.isValidated()) { throw new DomainRuntimeException("This EnvironmentalVisitVo has not been validated"); } if(voEnvironmentalVisit.getID_EnvironmentalVisit() == null) { if(voEnvironmentalVisit.getCareContextIsNotNull()) { EnvironmentalVisitVoCollection coll = getEnvironmentalVisitVoByCareContext(voEnvironmentalVisit.getCareContext()); if(coll != null && coll.size()>0) throw new UniqueKeyViolationException("A Environmental Visit record already exists for this CareContext. "); } } EnvironmentalVisit domEnvironmentalVisit = EnvironmentalVisitVoAssembler.extractEnvironmentalVisit(factory, voEnvironmentalVisit); factory.save(domEnvironmentalVisit); return EnvironmentalVisitVoAssembler.create(domEnvironmentalVisit); }