Beispiel #1
0
 /// <summary>
 /// Updates existing session.
 /// </summary>
 /// <param name="customerId"></param>
 /// <param name="patientId"></param>
 /// <param name="defaultSessionId"></param>
 /// <param name="defaultSessionDto"></param>
 /// <param name="token"></param>
 /// <returns></returns>
 public async Task UpdateDefaultSession(int customerId, Guid patientId, Guid defaultSessionId,
                                        DefaultSessionDto defaultSessionDto, string token)
 {
     await
     this.patientsDataProvider.UpdateDefaultSession(customerId, patientId, defaultSessionId,
                                                    defaultSessionDto, token);
 }
Beispiel #2
0
        /// <summary>
        /// Updates existing default session.
        /// </summary>
        /// <param name="customerId"></param>
        /// <param name="patientId"></param>
        /// <param name="defaultSessionId"></param>
        /// <param name="defaultSessionDto"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public async Task UpdateDefaultSession(int customerId, Guid patientId,
                                               Guid defaultSessionId, DefaultSessionDto defaultSessionDto, string token)
        {
            string endpointUrl = string.Format("/api/{0}/patient/{1}/default-sessions/{2}", customerId, patientId,
                                               defaultSessionId);

            await this.apiClient.SendRequestAsync(endpointUrl, defaultSessionDto, Method.PUT, null, token);
        }
Beispiel #3
0
        /// <summary>
        /// Creates new default session for specified patient.
        /// </summary>
        /// <param name="customerId"></param>
        /// <param name="patientId"></param>
        /// <param name="defaultSessionDto"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public async Task <PostResponseDto <Guid> > CreateDefaultSession(int customerId, Guid patientId, DefaultSessionDto defaultSessionDto, string token)
        {
            string endpointUrl = string.Format("/api/{0}/patient/{1}/default-sessions", customerId, patientId);

            return(await
                   this.apiClient.SendRequestAsync <PostResponseDto <Guid> >(endpointUrl, defaultSessionDto,
                                                                             Method.POST, null, token));
        }
Beispiel #4
0
        /// <summary>
        /// Removes existing default sessions and creates new.
        /// </summary>
        /// <param name="customerId"></param>
        /// <param name="patientId"></param>
        /// <param name="defaultSessionDto"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public async Task <PostResponseDto <Guid> > CreateDefaultSession(int customerId, Guid patientId, DefaultSessionDto defaultSessionDto, string token)
        {
            var existingDefaultSessions =
                await this.patientsDataProvider.GetDefaultSessions(customerId, patientId, null, token);

            foreach (var session in existingDefaultSessions.Results)
            {
                await this.patientsDataProvider.DeleteDefaultSession(customerId, patientId, session.Id, token);
            }

            return(await this.patientsDataProvider.CreateDefaultSession(customerId, patientId, defaultSessionDto, token));
        }