Skip to content

Commit

Permalink
Adicionada melhoria na visualização do paciente (#396)
Browse files Browse the repository at this point in the history
Co-authored-by: Mateus Bittencourt <mateus.lbittencourt@gmail.com>
  • Loading branch information
laurogripa and Mat-Bit authored Oct 5, 2021
1 parent 69f613e commit 00b6b3b
Showing 1 changed file with 156 additions and 143 deletions.
299 changes: 156 additions & 143 deletions app/views/admin/patients/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,160 +46,173 @@
</div>
</div>

<div class="mt-4">
<h4>Grupos que pertence</h4>
<% if @patient.groups.any? -%>
<table class="table">
<thead>
<tr>
<th scope="col" width="1%">#</th>
<th scope="col">Grupo</th>
</tr>
</thead>
<tbody>
<% @patient.groups.admin_order.each do |group| -%>
<div class="card mt-4 mb-4">
<div class="card-header">
<h4>Grupos que pertence</h4>
</div>
<div class="card-body">
<% if @patient.groups.any? -%>
<table class="table">
<thead>
<tr>
<td>
<%= group.id %>
</td>
<td>
<%= group.name_with_parent %>
</td>
<th scope="col" width="1%">#</th>
<th scope="col">Grupo</th>
</tr>
<% end -%>
</tbody>
</table>
<% else -%>
<p>Não preencheu nenhum grupo.</p>
<% end -%>
</thead>
<tbody>
<% @patient.groups.admin_order.each do |group| -%>
<tr>
<td>
<%= group.id %>
</td>
<td>
<%= group.name_with_parent %>
</td>
</tr>
<% end -%>
</tbody>
</table>
<% else -%>
<p>Não preencheu nenhum grupo.</p>
<% end -%>
</div>
</div>

<h4>Agendamentos</h4>
<% if @patient.appointments.any? -%>
<p>Clique no # do agendamento para realizar procedimentos no mesmo.</p>
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Data agendada</th>
<th scope="col">Unidade</th>
<th scope="col">Check-in</th>
<th scope="col">Check-out</th>
<th scope="col">Dose</th>
<th scope="col">Vacina</th>
<th scope="col">Suspenso?</th>
<th scope="col">Criou dose #</th>
</tr>
</thead>
<tbody>

<% @patient.appointments.order(:start).each do |appointment| -%>
<tr>
<td>
<%= link_to appointment.id, admin_appointment_path(appointment) %>
</td>
<th scope="row">
<strong><%= l(appointment.start, format: :human) %></strong>
</th>
<td>
<%= appointment.ubs.name %>
</td>
<td>
<% if appointment.checked_in? -%>
<%= l(appointment.check_in, format: :human) %>
<% end -%>
</td>
<td>
<% if appointment.checked_out? -%>
<%= l(appointment.check_out, format: :human) %>
<% end -%>
</td>
<td>
<%= appointment.dose_sequence_number %>
</td>
<td>
<%= appointment.dose_vaccine&.name %>
</td>
<td>
<%= appointment.active ? "Não" : "Sim" %>
</td>
<td>
<% if appointment.dose -%>
<%= appointment.dose.id %>
<% end -%>
</td>
</tr>
<div class="card mt-4 mb-4">
<div class="card-header">
<h4>Agendamentos</h4>
</div>
<div class="card-body">
<% if @patient.appointments.any? -%>
<p>Clique no # do agendamento para realizar procedimentos no mesmo.</p>
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Data agendada</th>
<th scope="col">Unidade</th>
<th scope="col">Check-in</th>
<th scope="col">Check-out</th>
<th scope="col">Dose</th>
<th scope="col">Vacina</th>
<th scope="col">Suspenso?</th>
<th scope="col">Criou dose #</th>
</tr>
</thead>
<tbody>

<% @patient.appointments.order(:start).each do |appointment| -%>
<tr>
<td>
<%= link_to appointment.id, admin_appointment_path(appointment) %>
</td>
<th scope="row">
<strong><%= l(appointment.start, format: :human) %></strong>
</th>
<td>
<%= appointment.ubs.name %>
</td>
<td>
<% if appointment.checked_in? -%>
<%= l(appointment.check_in, format: :human) %>
<% end -%>
</td>
<td>
<% if appointment.checked_out? -%>
<%= l(appointment.check_out, format: :human) %>
<% end -%>
</td>
<td>
<%= appointment.dose_sequence_number %>
</td>
<td>
<%= appointment.dose_vaccine&.name %>
</td>
<td>
<%= appointment.active ? "Não" : "Sim" %>
</td>
<td>
<% if appointment.dose -%>
<%= appointment.dose.id %>
<% end -%>
</td>
</tr>
<% end -%>
</tbody>
</table>
<% else -%>
<p>Paciente sem nenhum agendamento.</p>
<% end -%>
</tbody>
</table>
<% else -%>
<p>Paciente sem nenhum agendamento.</p>
<% end -%>

<div class="row mt-4">
<div class="col-10">
<h1 class="h4">
Doses de vacinas
</h1>
</div>
</div>

<div class="col-2">
<%= link_to "Registrar dose", new_admin_appointment_path(patient_id: @patient.id), class: 'btn btn-success btn-block' %>
<div class="card mt-4 mb-4">
<div class="card-header">
<div class="row">
<div class="col-10">
<h1 class="h4">
Doses de vacinas
</h1>
</div>
<div class="col-2">
<%= link_to "Registrar dose", new_admin_appointment_path(patient_id: @patient.id), class: 'btn btn-success' %>
</div>
</div>
</div>
</div>

<div class="mb-5">
<% if @patient.doses.any? -%>
<p>
Caso deseje remover uma dose registrada incorretamente, vá no agendamento onde ocorreu a vacinação e clique para desfazer o check-out do mesmo.
</p>

<table class="table">
<thead>
<tr>
<th scope="col" width="1%">#</th>
<th scope="col">Data da aplicação</th>
<th scope="col">Unidade</th>
<th scope="col">Vacina</th>
<th scope="col">Dose</th>
<th scope="col">Agendamento #</th>
<th scope="col">Reforço #</th>
</tr>
</thead>
<tbody>

<% @patient.doses.order(:created_at).each do |dose| -%>
<div class="card-body mb-5">
<% if @patient.doses.any? -%>
<p>
Caso deseje remover uma dose registrada incorretamente, vá no agendamento onde ocorreu a vacinação e clique para desfazer o check-out do mesmo.
</p>

<table class="table">
<thead>
<tr>
<td>
<%= dose.id %>
</td>
<th scope="row">
<strong><%= l(dose.appointment.check_out, format: :human) %></strong>
</th>
<td>
<%= dose.appointment.ubs.name %>
</td>
<td>
<%= dose.vaccine.name %>
</td>
<td>
<%= dose.sequence_number %><sup>a</sup>
</td>
<td>
<%= link_to dose.appointment.id, admin_appointment_path(dose.appointment) %>
</td>
<td>
<% if dose.follow_up_appointment -%>
<%= link_to dose.follow_up_appointment.id, admin_appointment_path(dose.follow_up_appointment) %>
<% end -%>
</td>
<th scope="col" width="1%">#</th>
<th scope="col">Data da aplicação</th>
<th scope="col">Unidade</th>
<th scope="col">Vacina</th>
<th scope="col">Dose</th>
<th scope="col">Agendamento #</th>
<th scope="col">Reforço #</th>
</tr>
<% end -%>
</tbody>
</table>
<% else -%>
<p>Paciente sem nenhuma vacina.</p>
<% end -%>
</thead>
<tbody>

<% @patient.doses.order(:created_at).each do |dose| -%>
<tr>
<td>
<%= dose.id %>
</td>
<th scope="row">
<strong><%= l(dose.created_at, format: :human) %></strong>
</th>
<td>
<%= dose.appointment.ubs.name %>
</td>
<td>
<%= dose.vaccine.name %>
</td>
<td>
<%= dose.sequence_number %><sup>a</sup>
</td>
<td>
<%= link_to dose.appointment.id, admin_appointment_path(dose.appointment) %>
</td>
<td>
<% if dose.follow_up_appointment -%>
<%= link_to dose.follow_up_appointment.id, admin_appointment_path(dose.follow_up_appointment) %>
<% end -%>
</td>
</tr>
<% end -%>
</tbody>
</table>
<% else -%>
<p>Paciente sem nenhuma vacina.</p>
<% end -%>
</div>
</div>

<p>
Expand Down

0 comments on commit 00b6b3b

Please sign in to comment.