public void should_SaveResponse()
        {
            // 1.Consent
            _encounterNew = new EncounterService(_encounterRepository, _formRepository).StartEncounter(_encounterNew);
            var currentQuestionId = _form.Questions.First(x => x.Rank == 1).Id;

            _obsService.Initialize(_encounterNew);
            _obsService.SaveResponse(_encounterNew.Id, _encounterNew.ClientId, currentQuestionId, TestDataHelpers._consentYes);

            var manifest = _obsService.Manifest;
            var obs      = manifest.ResponseStore.First(x => x.QuestionId == currentQuestionId);

            Assert.IsNotNull(obs);
            Assert.AreEqual(TestDataHelpers._consentYes, obs.Obs.ValueCoded);

            var states =
                _clientStateRepository.GetByClientId(_encounterNew.ClientId, _encounterNew.Id, LiveState.HtsConsented)
                .ToList();

            Assert.True(states.Count > 0);

            Assert.NotNull(states.FirstOrDefault(x => x.Status == LiveState.HtsConsented));
            foreach (var clientState in states)
            {
                Console.WriteLine($"  {clientState}");
            }
        }
        private void SaveChanges()
        {
            //nTODO : Save Enconter + Obs

            //readResponses

            if (!IsValidEncounterDate())
            {
                return;
            }

            var allowedQuestions = Questions.Where(x => x.QuestionTemplate.Allow).ToList();

            if (allowedQuestions.Count > 0)
            {
                foreach (var q in allowedQuestions)
                {
                    if (!ValidateResponse(q.QuestionTemplate))
                    {
                        return;
                    }
                }
            }

            _obsService.ClearEncounter(Encounter.Id);


            foreach (var q in allowedQuestions)
            {
                _obsService.SaveResponse(Encounter.Id, ClientDTO.Id, q.QuestionTemplate.Id,
                                         q.QuestionTemplate.GetResponse());
                //Manifest = _obsService.Manifest;
            }

            _obsService.MarkEncounterCompleted(Encounter.Id, UserId, true, ClientDTO.Id);
            _obsService.UpdateEncounterDate(Encounter.Id, BirthDate, GetVisitType());
            Manifest = _obsService.Manifest;
            Manifest.Encounter.EncounterDate = BirthDate;
            Manifest.Encounter.VisitType     = GetVisitType();
            Encounter = Manifest.Encounter;
            var encounterJson = JsonConvert.SerializeObject(Encounter);

            _settings.AddOrUpdateValue("client.encounter", encounterJson);

            var manifestJson = JsonConvert.SerializeObject(Manifest);

            _settings.AddOrUpdateValue("client.manifest", manifestJson);

            GoBack();
        }