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()); }
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()); }
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); }
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); }
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()); }
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)); }); }
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)); }); }
public async Task <int?> GetCountAgendasAsync() { var client = new HMedHttpClient(); return(await client.GetAync <int>(Apis.ApiAgendaCount)); }
public async Task <int?> GetCountPacienteAsync() { var client = new HMedHttpClient(); return(await client.GetAync <int>(Apis.ApiPacienteCount)); }