public async Task <Response> Do(Request request)
        {
            /*var diagnose = await _client
             *         .Child("Patient")
             *         .Child(request.PatientID)
             *         .Child("MeasurementResult")
             *         .Child(request.MeasurementResultID)
             *         .OnceAsync<Domain.Models.MeasurementResults>();*/

            GetDoctor dr = new GetDoctor(_client);

            await _client
            .Child("Patient")
            .Child(request.UID)
            .Child("MeasurementResults")
            .Child(request.olcOrder)
            .Child("Diognasis").PutAsync(new Diognasis
            {
                Comments     = new List <Comments>(),
                Content      = request.Content,
                DoctorID     = request.Doctor,
                Emergancy    = request.Emergancy,
                Status       = request.Status,
                DecisionDate = request.DecisionDate,
                DecisionTime = request.DecisionTime,
            });


            return(new Response {
                Doctor = dr.Do(request.Doctor).Result.Email, IsMe = "true"
            });
        }
Example #2
0
        public async Task <Response> Do(Request request)
        {
            GetDoctor dr = new GetDoctor(_client);

            var diognasisUser = _client
                                .Child("Patient").OnceAsync <Domain.Models.Patient>().Result.FirstOrDefault(x => x.Key == request.UID).Object.MeasurementResults[int.Parse(request.olcOrder)].Diognasis;

            List <Comments> comments = new List <Comments>();

            if (diognasisUser.Comments != null)
            {
                comments = diognasisUser.Comments;
            }

            List <Comments> commentsList = new List <Comments>();

            for (int i = 0; i < comments.Count; i++)
            {
                commentsList.Add(comments[i]);
            }

            var diognasis = new Diognasis
            {
                Comments  = commentsList,
                Content   = request.Content,
                DoctorID  = request.Doctor,
                Emergancy = request.Emergancy,
                Status    = request.Status
            };

            await _client
            .Child("Patient")
            .Child(request.UID)
            .Child("MeasurementResults")
            .Child(request.olcOrder)
            .Child("Diognasis").PutAsync(diognasis);

            return(new Response {
                Doctor = dr.Do(request.Doctor).Result.Email, IsMe = "true"
            });
        }