예제 #1
0
        public async Task <IList <Agenda> > GetAgendas()
        {
            var client  = new HMedHttpClient();
            var agendas = await client.GetAync <IList <Agenda> >(Apis.ApiAgenda);

            return(agendas.OrderBy(p => p.Horario).ToList());
        }
예제 #2
0
        public async Task <IList <Paciente> > GetPacientes()
        {
            var client    = new HMedHttpClient();
            var pacientes = await client.GetAync <IList <Paciente> >(Apis.ApiPaciente);

            return(pacientes.OrderBy(p => p.Nome).ToList());
        }
예제 #3
0
        public async Task <IList <Medicamento> > GetMedicaments(int idPaciente)
        {
            var client       = new HMedHttpClient();
            var medicamentos = await client.GetAync <IList <Medicamento> >(Apis.ApiMedicamento.Replace("[idPaciente]", idPaciente.ToString()));

            return(medicamentos);
        }
예제 #4
0
        public async Task <IList <Exame> > GetExames(int idPaciente)
        {
            var client = new HMedHttpClient();
            var exames = await client.GetAync <IList <Exame> >(Apis.ApiExame.Replace("[idPaciente]", idPaciente.ToString()));

            return(exames);
        }
        public async Task <IList <DocumentoEletronico> > GetDocuemntosEletronicos(int id)
        {
            var client     = new HMedHttpClient();
            var documentos = await client.GetAync <IList <DocumentoEletronico> >(Apis.ApiDocumento.Replace("[idPaciente]", id.ToString()));

            return(documentos);
        }
예제 #6
0
        public async Task <IList <Agenda> > GetAgendas(DateTime dia)
        {
            var dataFormatada = dia.ToString("dd-MM-yyyy");
            var client        = new HMedHttpClient();
            var agendas       = await client.GetAync <IList <Agenda> >(Apis.ApiAgendaFiltro.Replace("[data]", dataFormatada));

            return(agendas.OrderBy(p => p.Horario).ToList());
        }
예제 #7
0
        public ExamesViewModel(Exame exame)
        {
            Carregando = true;
            Exame      = exame;
            Task.Run(async() =>
            {
                var client   = new HMedHttpClient();
                var url      = Apis.ApiExameCaminhoArquivo.Replace("[idExame]", Exame.Id.ToString());
                var resposta = await client.GetAync <string>(url);

                PdfUrl = Device.RuntimePlatform != Device.Android ?
                         resposta :
                         "https://docs.google.com/viewer?url=" + resposta;

                //  if(Device.RuntimePlatform != Device.Android)
                Carregando = false;
                Change(nameof(PdfUrl));
                Change(nameof(Carregando));
                Change(nameof(Carregado));
            });
        }
예제 #8
0
        public DocumentoEletronicoViewModel(DocumentoEletronico documento)
        {
            Carregando = true;
            Documento  = documento;
            Task.Run(async() =>
            {
                var client   = new HMedHttpClient();
                var url      = Apis.ApiDocumentoCaminhoArquivo.Replace("[idDocumento]", Documento.Id.ToString());
                var resposta = await client.GetAync <string>(url);

                PdfUrl = Device.RuntimePlatform != Device.Android ?
                         resposta :
                         "https://docs.google.com/viewer?url=" + resposta;

                //    if (Device.RuntimePlatform != Device.Android)
                Carregando = false;
                Change(nameof(PdfUrl));
                Change(nameof(Carregando));
                Change(nameof(Carregado));
            });
        }
예제 #9
0
        public async Task <int?> GetCountAgendasAsync()
        {
            var client = new HMedHttpClient();

            return(await client.GetAync <int>(Apis.ApiAgendaCount));
        }
예제 #10
0
        public async Task <int?> GetCountPacienteAsync()
        {
            var client = new HMedHttpClient();

            return(await client.GetAync <int>(Apis.ApiPacienteCount));
        }