public async Task <IActionResult> Create([FromBody] GuidFieldViewModel model)
        {
            await _service.CreatePatientAsync(new PatientProfile()
            {
                Id = model.Id
            });

            return(Ok());
        }
Example #2
0
        public async Task <IActionResult> CreatePatientProfile()
        {
            var token = this.GetAccessTokenFromCookies();
            var email = this.GetUserEmailFromHttpContext();

            var         user           = _userManager.FindByEmailAsync(email, token).Result;
            PatientInfo newPatientInfo = new PatientInfo()
            {
                Id = Guid.NewGuid(),
                CurrentActivityState = new SleepActivityState(),
                CurrentHealthState   = new NormalHealthState()
            };
            await _watchmanPatientService.CreatePatientAsync(newPatientInfo, token);

            await _userHealthService.AddPatientToUserAsync(user.Id, newPatientInfo.Id, token);

            return(RedirectToAction("PatientProfile"));
        }