Beispiel #1
0
        public virtual ActionResult Index(string operationNumber, int?institutionId = null, int?idQuestionnaire = null)
        {
            ForceUnlockRegister(operationNumber, Request.Path);
            var analysisResponse = _analysisService.GetAllModulesAnalysis(new AnalysisRequest
            {
                InstitutionId   = institutionId.Value,
                PaciId          = idQuestionnaire.Value,
                OperationNumber = operationNumber
            });

            ReportViewModel model = new ReportViewModel()
            {
                InstitutionId   = institutionId.Value,
                ModuleTabId     = "tabReport",
                IsEdit          = false,
                OperationNumber = operationNumber,
                TabId           = "tabReport"
            };

            if (!analysisResponse.IsValid)
            {
                model.ErrorMessage = analysisResponse.ErrorMessage;
            }
            else
            {
                model.OperationNumber     = operationNumber;
                model.PaciStage           = analysisResponse.PaciQuestionnaire.QuestionnaireStage;
                model.Modules             = analysisResponse.PaciQuestionnaire.Modules;
                model.InstitutionName     = analysisResponse.InstitutionName;
                model.InstitutionId       = analysisResponse.PaciQuestionnaire.InstitutionId;
                model.OperationIsComplete = analysisResponse.OperationIsComplete;
                model.QuestionnaireId     = idQuestionnaire.Value;
                model.IsAllEvaluated      = analysisResponse.IsAllEvaluated;
                model.CanEvaluate         = analysisResponse.PaciQuestionnaire.CanEvaluate;
                model.PaciIsComplete      = analysisResponse.PaciIsComplete;
            }

            model.Security = new SecurityViewModel()
            {
                PageName = SecurityAttributes.UIPA008READ,
                Security = GetFieldsSecurity(SecurityAttributes.UIPA008READ, operationNumber, IDBContext.Current.Permissions, model.QuestionnaireId)
                           .SecuredFields
                           .ToList()
            };

            return(View(model));
        }