private void refreshGroupCellData(AssessmentQuestionGroupVoCollection voColl) { for (int i = 0; i < form.lyrTabs().tabAssessments().dyngrdDetails().getRows().size(); i++) { DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().get(i); DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP)); Object value = cell.getValue(); cell.getItems().clear(); for (int j = 0; voColl != null && j < voColl.size(); j++) cell.getItems().newItem(voColl.get(j)); cell.setValue(value); if(value instanceof AssessmentQuestionVo) row.setValue(cell); } }
private void refreshGroupGrid() { form.lyrTabs().tabGroups().grdGroups().getRows().clear(); AssessmentQuestionGroupVoCollection voColl = form.getLocalContext().getHiddenGroups(); for (int i = 0; voColl != null && i < voColl.size(); i++) { AssessmentQuestionGroupVo voAssessQGroup = voColl.get(i); GenForm.lyrTabsLayer.tabGroupsContainer.grdGroupsRow row = form.lyrTabs().tabGroups().grdGroups().getRows().newRow(); row.setcolName(voAssessQGroup.getName()); row.setcolDescription(voAssessQGroup.getDescription()); row.setcolStatus(voAssessQGroup.getActiveStatus()); row.setcolScore(voAssessQGroup.getGroupScoreIsNotNull() ? voAssessQGroup.getGroupScore().toString() : ""); row.setValue(voAssessQGroup); } refreshGroupContextMenu(); }
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment, DPPQuestionGroupVoCollection dppQuestionGroupColl) { this.voDPPQuestionGroupColl = dppQuestionGroupColl; if(viewMode == MULTIPLE_GROUP_NO_FLAT) { populateMultipleGroupsNoFlat(assessment); } else if(viewMode == SINGLE_GROUP_FLAT) { populateSingleGroupFlat(assessment); } else if(viewMode == MULTIPLE_GROUP_FLAT) { populateMultipleGroupsFlat(assessment); } return contextHiddenGroups; }
private StructuredAssessmentsHelper getHelper(DynamicGrid dynGrid, UserAssessmentVo voUserAssessment) { int gridType = StructuredAssessmentsHelper.DPP_GRID; int viewMode = getViewMode(voUserAssessment); Image imageQuestion = form.getImages().Core.QuestionSmall; PreActiveActiveInactiveStatusCollection activeColl = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService()); PlanOfCareGroupingsCollection groupColl = ims.clinical.vo.lookups.LookupHelper.getPlanOfCareGroupings(domain.getLookupService()); boolean displayActive = false;//form.chkDisplayActive().getValue(); AssessmentQuestionGroupVoCollection contextHiddenGroups = null;//form.getLocalContext().getHiddenGroups(); return new StructuredAssessmentsHelper(dynGrid, engine, viewMode, gridType, imageQuestion, activeColl, groupColl, displayActive, contextHiddenGroups); }
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException { if (data.getAnswerGroups() == null) return new AssessmentQuestionGroupVoCollection(); checkDataIntegrity(data); AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection(); for (int x = 0; x < data.getAnswerGroups().size(); x++) { result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup()); } return result; }
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException { if (data.getAnswerGroups() == null) return; checkDataIntegrity(data); boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue(); boolean userCanAnswerToAllQuestion = checkUserRole(data.getUserAssessment());//wdev-3709 AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data); for (int x = 0; x < existingGroups.size(); x++) { if (existingGroups.get(x) != null) { AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x)); if (flatView) { for (int y = 0; y < existingQuestions.size(); y++) { addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y)), userCanAnswerToAllQuestion);//wdev- 3709 } } else { addGroupRow(existingGroups.get(x), existingQuestions, data, userCanAnswerToAllQuestion);//wdev-3709 } } } }
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException { if(data.getAnswerGroups() == null) return new AssessmentQuestionGroupVoCollection(); checkDataIntegrity(data); AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection(); for(int x = 0; x < data.getAnswerGroups().size(); x++) { result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup()); } return result; }
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException { if(data.getAnswerGroups() == null) return; checkDataIntegrity(data); boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue(); AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data); for(int x = 0; x < existingGroups.size(); x++) { if(existingGroups.get(x) != null) { AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x)); if(flatView) { for(int y = 0; y < existingQuestions.size(); y++) { addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y))); } } else { addGroupRow(existingGroups.get(x), existingQuestions, data); } } } }
public StructuredAssessmentsHelper(DynamicGrid dynGrid, UIEngine engine, int viewMode, int gridType, Image imgQuestionSmall, PreActiveActiveInactiveStatusCollection activeColl, PlanOfCareGroupingsCollection groupsColl, boolean displayActive, AssessmentQuestionGroupVoCollection contextHiddenGroups) { this.dynGrid = dynGrid; this.engine = engine; this.viewMode = viewMode; this.gridType = gridType; this.imgQuestion = imgQuestionSmall; this.activeColl = activeColl; this.groupsColl = groupsColl; this.displayActive = displayActive; this.contextHiddenGroups = contextHiddenGroups; }
private void populateSingleGroupFlat(UserAssessmentVo assessment, int viewMode) { AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection(); if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0) hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item form.getLocalContext().setHiddenGroups(hiddenGroups); if(assessment.getQuestionGroups().size() > 0) { for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++) { AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i); if(isNotActive(assessmentQuestionVo.getActiveStatus())) continue; if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus())) continue; DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().newRow(); createRowCells(row, viewMode); //engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService())); PreActiveActiveInactiveStatusCollection lookupColl = ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService()); DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_STATUS)); for (int j = 0; j < lookupColl.size(); j++) { PreActiveActiveInactiveStatus lkup = lookupColl.get(j); cell.getItems().newItem(lkup, lkup.getImage()); } cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)); cell.setReadOnly(true); cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : ""); cell.setTooltip(getQuestionTooltip(assessmentQuestionVo)); cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY)); cell.setValue(assessmentQuestionVo.getIsMandatory()); cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS)); cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers()); cell = row.getCells().get(getGridColumn(COLUMN_STATUS)); cell.setValue(assessmentQuestionVo.getActiveStatus()); if(isDpp()) { DynamicGridColumn colNonStandard = getGridColumn(COLUMN_NONSTANDARD); if(colNonStandard != null) { DynamicGridCell cellNonStandard = row.getCells().get(colNonStandard); if(cellNonStandard != null) { cellNonStandard.setValue(assessmentQuestionVo.getIsNonStandard()); } } } row.setValue(assessmentQuestionVo); // row tooltip no longer supported // row.setTooltip(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : ""); } } }
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment) { return populateGrid(assessment, null); }
public void addQuestionToGrid(AssessmentQuestionVo assessmentQuestionVo, AssessmentQuestionGroupVoCollection groupColl) { if(assessmentQuestionVo == null) return; DynamicGridRow row = null; switch (viewMode) { case MULTIPLE_GROUP_NO_FLAT : row = dynGrid.getSelectedRow(); if(row != null) row = row.getRows().newRow(); break; case MULTIPLE_GROUP_FLAT : case SINGLE_GROUP_FLAT : row = dynGrid.getRows().newRow(); break; default : break; } createRowCells(row); row.setValue(assessmentQuestionVo); row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : ""); row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setTooltip(getQuestionTooltip(assessmentQuestionVo)); row.getCells().get(getGridColumn(COLUMN_MANDATORY)).setValue(assessmentQuestionVo.getIsMandatory()); row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS)).setValue(assessmentQuestionVo.getAllowsMultipleAnswers()); engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), activeColl); row.getCells().get(getGridColumn(COLUMN_STATUS)).setValue(PreActiveActiveInactiveStatus.ACTIVE); if(viewMode == MULTIPLE_GROUP_FLAT) { DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP)); for(int i = 0; groupColl != null && i < groupColl.size(); i++) { cell.getItems().newItem(groupColl.get(i)); } } if(viewMode == MULTIPLE_GROUP_NO_FLAT) { row.setExpandedImage(imgQuestion); row.setCollapsedImage(imgQuestion); } }
private void populateSingleGroupFlat(UserAssessmentVo assessment) { AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection(); if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0) hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item //TODO - check if the calling context gets updated contextHiddenGroups = hiddenGroups; if(assessment.getQuestionGroups().size() > 0) { for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++) { AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i); if(isNotActive(assessmentQuestionVo.getActiveStatus())) continue; if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus())) continue; DynamicGridRow row = dynGrid.getRows().newRow(); createRowCells(row); DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)); cell.setReadOnly(true); cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : ""); cell.setTooltip(getQuestionTooltip(assessmentQuestionVo)); if(isDppGrid()) { cell = row.getCells().get(getGridColumn(COLUMN_DPPGROUP)); engine.populate(cell, groupsColl); cell.setValue(getDppQuestionGroup(assessmentQuestionVo, assessment)); } else { //engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService())); cell = row.getCells().get(getGridColumn(COLUMN_STATUS)); for (int j = 0; j < activeColl.size(); j++) { PreActiveActiveInactiveStatus lkup = activeColl.get(j); cell.getItems().newItem(lkup, lkup.getImage()); } cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY)); cell.setValue(assessmentQuestionVo.getIsMandatory()); cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS)); cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers()); cell = row.getCells().get(getGridColumn(COLUMN_STATUS)); cell.setValue(assessmentQuestionVo.getActiveStatus()); } row.setValue(assessmentQuestionVo); } } }