private GeneralQuestionAnswerVoCollection getServiceQuestions(ServiceQuestionShortVoCollection serviceConfigQuestions, ServiceLiteVo voServiceLite) { GeneralQuestionAnswerVoCollection serviceQuestions = new GeneralQuestionAnswerVoCollection(); for (int i = 0; serviceConfigQuestions != null && i < serviceConfigQuestions.size(); i++) { ServiceQuestionShortVo serviceQuestionShortVo = serviceConfigQuestions.get(i); boolean askedForEveryInvestigation = serviceQuestionShortVo.getAskForInvestigationsIsNotNull() && serviceQuestionShortVo.getAskForInvestigations().booleanValue(); if(askedForEveryInvestigation == false && serviceQuestionShortVo.getService().equals(voServiceLite)) { GeneralQuestionAnswerVo voGQA = createNewServiceQuestion(serviceQuestionShortVo); if(voGQA != null) serviceQuestions.add(voGQA); } } return serviceQuestions; }
private void populateListControl(ServiceQuestionShortVoCollection voCollServiceQuestions) { for (int j = 0; voCollServiceQuestions != null && j < voCollServiceQuestions.size(); j++) { ServiceQuestionShortVo voServiceQuestion = voCollServiceQuestions.get(j); GenForm.grdDetailsRow row = form.grdDetails().getRows().newRow(); setServiceQuestion(row, voServiceQuestion); } }
/** * @param row * @param voServiceQuestionShortVo */ private void setServiceQuestion(GenForm.grdDetailsRow row, ServiceQuestionShortVo voServiceQuestion) { if (voServiceQuestion.getQuestionInformationIsNotNull()) { row.setcolQuestion(voServiceQuestion.getQuestionInformation().getText()); row.setcolAskForInvestigation(voServiceQuestion.getAskForInvestigationsIsNotNull()?voServiceQuestion.getAskForInvestigations().booleanValue():false); row.setcolMandatory(voServiceQuestion.getIsMandatoryIsNotNull() ? voServiceQuestion.getIsMandatory().booleanValue() : false); row.setTooltip(voServiceQuestion.getQuestionInformation().getTooltip()); } voServiceQuestion.setID_ServiceQuestion(null); row.setValue(voServiceQuestion); }
private ServiceQuestionShortVoCollection populateInstancesData() { ServiceQuestionShortVoCollection voCollServiceQuestions = new ServiceQuestionShortVoCollection(); for (int i = 0; i < form.grdDetails().getRows().size(); i++) { ServiceQuestionShortVo voServiceQShort = form.grdDetails().getRows().get(i).getValue(); voServiceQShort.setService(form.qmbService().getValue()); voServiceQShort.setAskForInvestigations(form.grdDetails().getRows().get(i).getcolAskForInvestigation()?Boolean.TRUE:Boolean.FALSE); voServiceQShort.setIsMandatory(new Boolean(form.grdDetails().getRows().get(i).getcolMandatory())); voCollServiceQuestions.add(voServiceQShort); } return voCollServiceQuestions; }
private boolean isSameService(ServiceQuestionShortVo voServiceQ, InvestigationOcsQuestionsVo voInvOcs) { if(voServiceQ == null || voInvOcs == null) return false; ServiceLiteVo serviceConfigVo = voServiceQ.getServiceIsNotNull() ? voServiceQ.getService() : null; ServiceLiteVo serviceInvestigationVo = voInvOcs.getProviderServiceIsNotNull() && voInvOcs.getProviderService().getLocationServiceIsNotNull() ? voInvOcs.getProviderService().getLocationService().getService() : null; // Check against the same service if (serviceConfigVo != null && serviceConfigVo.equals(serviceInvestigationVo)) return true; return false; }
private GeneralQuestionAnswerVo createNewServiceQuestion(ServiceQuestionShortVo serviceQuestionConfig) { if(serviceQuestionConfig == null) return null; if(isQuestionRelevant(serviceQuestionConfig.getQuestionInformation(), getAge(), getSex()) == false) return null; GeneralQuestionAnswerVo serviceQuestion = new GeneralQuestionAnswerVo(); serviceQuestion.setQuestion(serviceQuestionConfig.getQuestionInformation()); serviceQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection()); serviceQuestion.setWasMandatory(serviceQuestionConfig.getIsMandatory()); return serviceQuestion; }
private GeneralQuestionAnswerVoCollection getQuestionsToBeAskedInEveryInvestigation(Category category, CategoryQuestionShortVoCollection categoryConfigQuestions, ServiceQuestionShortVoCollection serviceConfigQuestions, InvestigationOcsQuestionsVo voInvOcs) { //Category Questions GeneralQuestionAnswerVoCollection voColl = new GeneralQuestionAnswerVoCollection(); for (int i = 0; categoryConfigQuestions != null && i < categoryConfigQuestions.size(); i++) { CategoryQuestionShortVo categoryQuestion = categoryConfigQuestions.get(i); if(categoryQuestion.getOCRRCategoryIsNotNull() && categoryQuestion.getOCRRCategory().equals(category)) { if(categoryQuestion.getAskForInvestigationsIsNotNull() && categoryQuestion.getAskForInvestigations().booleanValue()) { //WDEV-3332 if(isCategoryQuestionActive(categoryQuestion)) { GeneralQuestionAnswerVo voGCQ = createNewCategoryQuestion(categoryQuestion); if(voGCQ != null) voColl.add(voGCQ); } } } } //Service Questions Category investigationCategory = voInvOcs != null && voInvOcs.getInvestigationIndexIsNotNull() && voInvOcs.getInvestigationIndex().getCategoryIsNotNull()?voInvOcs.getInvestigationIndex().getCategory():null; if(investigationCategory != null && investigationCategory .equals(category)) { for (int j = 0; serviceConfigQuestions != null && j < serviceConfigQuestions.size(); j++) { ServiceQuestionShortVo voServiceQ = serviceConfigQuestions.get(j); if(voServiceQ.getAskForInvestigationsIsNotNull() && voServiceQ.getAskForInvestigations().booleanValue()) { if(isSameService(voServiceQ, voInvOcs)) { GeneralQuestionAnswerVo voGSQ = createNewServiceQuestion(voServiceQ); if(voGSQ != null) voColl.add(voGSQ); } } } } return voColl; }