init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View File

@@ -0,0 +1,128 @@
<table>
<tr>
<td style="text-align: center" colspan="2">
<strong>{{$title}}</strong>
</td>
</tr>
<tr>
<td><strong>Período</strong></td>
<td><strong>Unidade</strong></td>
</tr>
<tr>
<td>De {{$inicio}} até {{$fim}}</td>
<td>{{$unidade}}</td>
</tr>
<tr>
<td><strong>Local de atendimento</strong></td>
<td><strong>Equipe</strong></td>
</tr>
<tr>
<td>{{$infraestrutura}}</td>
<td>{{$equipe}}</td>
</tr>
<tr>
<td><strong>Profissional</strong></td>
<td><strong>Visualizar por</strong></td>
</tr>
<tr>
<td>{{$usuario}}</td>
<td>{{ $tipo_visualizacao === 'equipe' ? 'Equipe' : 'Profissional' }}</td>
</tr>
</table>
<table>
<thead>
<tr>
@php
$totalColunas = 5;
if (is_null($unidade_id)) $totalColunas++;
if (is_null($equipe_id)) $totalColunas++;
if (is_null($usuario_id) && $tipo_visualizacao === 'usuario') $totalColunas++;
@endphp
<th style="text-align: center" colspan="{{ $totalColunas }}"><strong>Totalizadores</strong></th>
</tr>
<tr>
<th><strong>Programados</strong></th>
<th><strong>Espontâneos</strong></th>
<th><strong>Total</strong></th>
<th><strong>% Programados</strong></th>
<th><strong>% Espontâneos</strong></th>
@if(is_null($unidade_id))
<th><strong>Total de unidades</strong></th>
@endif
@if(is_null($equipe_id))
<th><strong>Total de equipes</strong></th>
@endif
@if(is_null($usuario_id) && $tipo_visualizacao === 'usuario')
<th><strong>Total de profissionais</strong></th>
@endif
</tr>
</thead>
<tbody>
<tr>
<td>{{ $totalizadores['total_programados'] }}</td>
<td>{{ $totalizadores['total_espontaneos'] }}</td>
<td>{{ $totalizadores['total'] }}</td>
<td>{{ $totalizadores['percentual_programados'] }}</td>
<td>{{ $totalizadores['percentual_espontaneos'] }}</td>
@if(is_null($unidade_id))
<td>{{ $totalizadores['total_unidades'] }}</td>
@endif
@if(is_null($equipe_id))
<td>{{ $totalizadores['total_equipes'] }}</td>
@endif
@if(is_null($usuario_id) && $tipo_visualizacao === 'usuario')
<td>{{ $totalizadores['total_profissionais'] }}</td>
@endif
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Local de atendimento</strong></th>
<th><strong>Equipe</strong></th>
@if ($tipo_visualizacao === 'usuario')
<th><strong>Profissional</strong></th>
@endif
<th><strong>Programados</strong></th>
<th><strong>% Programados</strong></th>
<th><strong>Espontâneos</strong></th>
<th><strong>% Espontâneos</strong></th>
<th><strong>Total</strong></th>
</tr>
</thead>
<tbody>
@foreach($itens as $item)
<tr>
<td>{{ $item->unidade_nome_fantasia }}</td>
<td>{{ $item->infraestrutura_nome }}</td>
<td>{{ $item->equipe_descricao }}</td>
@if ($tipo_visualizacao === 'usuario')
<td>{{ $item->usuario_nome }}</td>
@endif
<td>{{ $item->total_atendimento_demanda_programada }}</td>
<td>{{ $item->porcentagem_atendimento_demanda_programada }}%</td>
<td>{{ $item->total_atendimento_demanda_espontanea }}</td>
<td>{{ $item->porcentagem_atendimento_demanda_espontanea }}%</td>
<td>{{ $item->total_atendimento }}</td>
</tr>
@endforeach
</tbody>
</table>

View File

@@ -0,0 +1,92 @@
<table>
<tr>
<td style="text-align: center" colspan="2">
<strong>{{$title}}</strong>
</td>
</tr>
<tr>
<td><strong>Período</strong></td>
<td><strong>Unidade</strong></td>
</tr>
<tr>
<td>De {{$inicio}} até {{$fim}}</td>
<td>{{$unidade}}</td>
</tr>
<tr>
<td><strong>Local de atendimento</strong></td>
<td><strong>Profissional</strong></td>
</tr>
<tr>
<td>{{$infraestrutura}}</td>
<td>{{$usuario}}</td>
</tr>
<tr>
<td><strong>Turno</strong></td>
<td><strong>CBO</strong></td>
</tr>
<tr>
<td>{{$turno}}</td>
<td>{{$ocupacao}}</td>
</tr>
<tr>
<td><strong>Equipe</strong></td>
<td><strong>Modalidade</strong></td>
</tr>
<tr>
<td>{{$equipe}}</td>
<td>{{$modalidade}}</td>
</tr>
</table>
<table>
<thead>
<tr>
@foreach ($colunas as $coluna)
<th><strong>{{ $coluna['label'] }}</strong></th>
@endforeach
</tr>
</thead>
<tbody>
@foreach($itens['itens'] as $item)
<tr>
@foreach ($colunas as $coluna)
<td style="{{($item->quantidade_dias_cadastro_paciente_desatualizado > 0 || $item->avaliacao_elegibilidade === 'Não') ? 'background-color: #f8d7da;' : '' }}">{{ $item->{$coluna['key']} ?? '-' }}</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
<table>
<tr>
<td style="text-align: center" colspan="5">
<strong>Totais</strong>
</td>
</tr>
<tr>
<td><strong>Total de atendimentos</strong></td>
<td><strong>Total de pacientes atendidos</strong></td>
<td><strong>Total de atendimentos AD 1</strong></td>
<td><strong>Total de atendimentos AD 2</strong></td>
<td><strong>Total de atendimentos AD 3</strong></td>
</tr>
<tr>
<td>{{$itens['totalizadores']['total_atendimentos']}}</td>
<td>{{$itens['totalizadores']['total_pacientes_atendidos']}}</td>
<td>{{$itens['totalizadores']['total_modalidades']['AD_1']}}</td>
<td>{{$itens['totalizadores']['total_modalidades']['AD_2']}}</td>
<td>{{$itens['totalizadores']['total_modalidades']['AD_3']}}</td>
</tr>
</table>

View File

@@ -0,0 +1,113 @@
@php
$cols = $colunas ?? [];
$show = fn($key) => in_array($key, $cols);
$f = $filtros ?? [];
@endphp
<table>
<tr>
<td colspan="15" style="text-align:center"><strong>{{ $title }}</strong></td>
</tr>
<tr>
<td><strong>Período</strong></td>
<td><strong>PSE</strong></td>
<td><strong>Turno</strong></td>
<td><strong>Unidade</strong></td>
<td><strong>Local de Atendimento</strong></td>
</tr>
<tr>
<td>{{ $f['periodo'] ?? '' }}</td>
<td>{{ $f['pse'] ?? 'Todos' }}</td>
<td>{{ $f['turno'] ?? 'Todos' }}</td>
<td>{{ $f['unidade'] ?? 'Todos' }}</td>
<td>{{ $f['localAtendimento'] ?? 'Todos' }}</td>
</tr>
<tr>
<td><strong>Profissional</strong></td>
<td><strong>CBO</strong></td>
<td><strong>Equipe</strong></td>
<td><strong>Atividade</strong></td>
<td><strong>Paciente</strong></td>
</tr>
<tr>
<td>{{ $f['profissional'] ?? 'Todos' }}</td>
<td>{{ $f['cbo'] ?? 'Todos' }}</td>
<td>{{ $f['equipe'] ?? 'Todos' }}</td>
<td>{{ $f['atividade'] ?? 'Todos' }}</td>
<td>{{ $f['paciente'] ?? 'Todos' }}</td>
</tr>
<tr>
<td><strong>Público Alvo</strong></td>
<td><strong>Temas para Saúde</strong></td>
<td><strong>Práticas em Saúde</strong></td>
<td><strong>Procedimentos</strong></td>
<td><strong>INEP</strong></td>
</tr>
<tr>
<td>{{ $f['publicoAlvo'] ?? 'Todos' }}</td>
<td>{{ $f['temaSaude'] ?? 'Todos' }}</td>
<td>{{ $f['praticaSaude'] ?? 'Todos' }}</td>
<td>{{ $f['procedimentos'] ?? 'Todos' }}</td>
<td>{{ $f['inep'] ?? 'Todos' }}</td>
</tr>
</table>
<br>
<table>
<thead>
<tr>
<th>Data</th>
@if($show('unidade')) <th>Unidade</th> @endif
@if($show('profissional')) <th>Profissional</th> @endif
@if($show('cbo')) <th>CBO</th> @endif
@if($show('equipe')) <th>Equipe</th> @endif
@if($show('atividade')) <th>Atividade</th> @endif
@if($show('totalParticipantes')) <th>Participantes</th> @endif
@if($show('totalPessoasAvaliadas')) <th>Pessoas Avaliadas</th> @endif
@if($show('localAtendimento')) <th>Local de Atendimento</th> @endif
@if($show('cnes')) <th>CNES</th> @endif
@if($show('turno')) <th>Turno</th> @endif
@if($show('publicoAlvo')) <th>Público Alvo</th> @endif
@if($show('temaSaude')) <th>Temas para Saúde</th> @endif
@if($show('praticaSaude')) <th>Práticas em Saúde</th> @endif
@if($show('procedimentosVinculados')) <th>Procedimentos</th> @endif
</tr>
</thead>
<tbody>
@foreach ($itens as $item)
<tr>
<td>{{ \Carbon\Carbon::parse($item->data)->format('d/m/Y') }}</td>
@if($show('unidade')) <td>{{ $item->unidade }}</td> @endif
@if($show('profissional')) <td>{{ $item->profissional }}</td> @endif
@if($show('cbo')) <td>{{ $item->cbo }}</td> @endif
@if($show('equipe')) <td>{{ $item->equipe }}</td> @endif
@if($show('atividade')) <td>{{ $item->atividade }}</td> @endif
@if($show('totalParticipantes')) <td>{{ $item->total_participantes }}</td> @endif
@if($show('totalPessoasAvaliadas')) <td>{{ $item->total_pessoas_avaliadas }}</td> @endif
@if($show('localAtendimento')) <td>{{ $item->local_atendimento }}</td> @endif
@if($show('cnes')) <td>{{ $item->cnes }}</td> @endif
@if($show('turno')) <td>{{ $item->turno }}</td> @endif
@if($show('publicoAlvo')) <td>{{ $item->publico_alvo }}</td> @endif
@if($show('temaSaude')) <td>{{ $item->tema_saude }}</td> @endif
@if($show('praticaSaude')) <td>{{ $item->pratica_saude }}</td> @endif
@if($show('procedimentosVinculados')) <td>{{ $item->procedimentos_vinculados }}</td> @endif
</tr>
@endforeach
</tbody>
</table>
<br>
<table>
<tr>
<th>Total de Atividades</th>
<th>Total de Procedimentos</th>
<th>Total de Pessoas Avaliadas</th>
</tr>
<tr>
<td>{{ $totalizadores['total_atividades'] ?? 0 }}</td>
<td>{{ $totalizadores['total_procedimentos'] ?? 0 }}</td>
<td>{{ $totalizadores['total_pessoas_avaliadas'] ?? 0 }}</td>
</tr>
</table>

View File

@@ -0,0 +1,196 @@
<table>
<tr>
<td colspan="4" style="text-align: center">
<strong>{{ $title }}</strong>
</td>
</tr>
<tr>
<td><strong>Período</strong></td>
<td><strong>Unidade</strong></td>
<td><strong>Local de atendimento</strong></td>
<td><strong>Equipe</strong></td>
</tr>
<tr>
<td>
@if($quadrimestre)
Quadrimestre {{ $quadrimestre }}
@else
De {{ $inicio }} até {{ $fim }}
@endif
</td>
<td>{{ $unidade }}</td>
<td>{{ $infraestrutura }}</td>
<td>{{ $equipe }}</td>
</tr>
<tr>
<td><strong>Sexo</strong></td>
<td><strong>Paciente</strong></td>
<td><strong>Busca Ativa</strong></td>
<td><strong>Boas Práticas</strong></td>
</tr>
<tr>
@php
$feiInicial = collect([
isset($faixaEtariaInicial['anos']) ? $faixaEtariaInicial['anos'].'a' : null,
isset($faixaEtariaInicial['meses']) ? $faixaEtariaInicial['meses'].'m' : null,
isset($faixaEtariaInicial['dias']) ? $faixaEtariaInicial['dias'].'d' : null,
])->filter()->implode(' ');
$feiFinal = collect([
isset($faixaEtariaFinal['anos']) ? $faixaEtariaFinal['anos'].'a' : null,
isset($faixaEtariaFinal['meses']) ? $faixaEtariaFinal['meses'].'m' : null,
isset($faixaEtariaFinal['dias']) ? $faixaEtariaFinal['dias'].'d' : null,
])->filter()->implode(' ');
@endphp
<td>{{ $sexo }}</td>
<td>{{ $paciente }}</td>
<td>{{ $buscaAtiva ? 'Sim' : 'Não' }}</td>
<td>{{ implode(', ', $boasPraticasSelecionadas) }}</td>
</tr>
<tr>
<td><strong>Faixa Etária Inicial</strong></td>
<td><strong>Faixa Etária Final</strong></td>
</tr>
<tr>
<td>{{ $feiInicial ?: '-' }}</td>
<td>{{ $feiFinal ?: '-' }}</td>
</tr>
</table>
<br>
{{-- Totalizadores --}}
<table>
<thead>
<tr>
<th><strong>Pacientes</strong></th>
<th><strong>Equipes</strong></th>
<th><strong>Microáreas</strong></th>
<th><strong>Denominador (D)</strong></th>
<th><strong>Numerador (N)</strong></th>
<th><strong>Resultado (%)</strong></th>
@foreach($boasPraticasSelecionadas as $pratica)
<th><strong>% Boa Prática {{ $pratica }}</strong></th>
@endforeach
</tr>
</thead>
<tbody>
<tr>
<td>{{ $totalizadores['totalPacientes'] }}</td>
<td>{{ $totalizadores['totalEquipes'] }}</td>
<td>{{ $totalizadores['totalMicroareas'] }}</td>
<td>{{ $totalizadores['denominador'] }}</td>
<td>{{ $totalizadores['numerador'] }}</td>
<td>{{ $totalizadores['resultado'] }}%</td>
@foreach($boasPraticasSelecionadas as $pratica)
<td>{{ $totalizadores['boasPraticas'][$pratica]['percentual'] ?? '-' }}%</td>
@endforeach
</tr>
</tbody>
</table>
<br>
{{-- Resultado por Equipe --}}
@if(!empty($resultadoPorEquipe))
<table>
<thead>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Denominador (D)</strong></th>
<th><strong>Numerador (N)</strong></th>
<th><strong>Resultado (%)</strong></th>
<th><strong>Classificação</strong></th>
@foreach($boasPraticasSelecionadas as $pratica)
<th><strong>% Prática {{ $pratica }}</strong></th>
@endforeach
</tr>
</thead>
<tbody>
@foreach($resultadoPorEquipe as $item)
<tr>
<td>{{ $item['unidadeNomeFantasia'] }}</td>
<td>{{ $item['equipeDescricao'] }}</td>
<td>{{ $item['denominador'] }}</td>
<td>{{ $item['numerador'] }}</td>
<td>{{ $item['resultado'] }}%</td>
<td>{{ $item['classificacao'] }}</td>
@foreach($boasPraticasSelecionadas as $pratica)
<td>{{ $item['percentual' . $pratica] ?? '-' }}%</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
@endif
<br>
{{-- Busca Ativa --}}
@if(!empty($buscaAtivaDados))
<table>
<thead>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Paciente</strong></th>
<th><strong>Sexo</strong></th>
<th><strong>Idade</strong></th>
<th><strong>Usuário Responsável</strong></th>
@if(in_array('pacienteDataNascimento', $selectedColsBuscaAtiva))
<th><strong>Data de Nascimento</strong></th>
@endif
@if(in_array('pacienteTelefone', $selectedColsBuscaAtiva))
<th><strong>Telefone</strong></th>
@endif
@if(in_array('pacienteEndereco', $selectedColsBuscaAtiva))
<th><strong>Endereço</strong></th>
@endif
@if(in_array('areaMicroareaDomicilio', $selectedColsBuscaAtiva))
<th><strong>Area/Microarea do Domicilio</strong></th>
@endif
@foreach($boasPraticasSelecionadas as $pratica)
<th><strong>Prática {{ $pratica }}</strong></th>
@endforeach
<th><strong>Pontuação Total</strong></th>
</tr>
</thead>
<tbody>
@foreach($buscaAtivaDados as $pacienteItem)
<tr>
<td>{{ $pacienteItem['unidadeNomeFantasia'] }}</td>
<td>{{ $pacienteItem['equipeDescricao'] }}</td>
<td>{{ $pacienteItem['pacienteNome'] }}</td>
<td>{{ $pacienteItem['pacienteSexo'] }}</td>
<td>{{ $pacienteItem['idadeCompleta'] }}</td>
<td>{{ $pacienteItem['usuarioResponsavelNome'] }}</td>
@if(in_array('pacienteDataNascimento', $selectedColsBuscaAtiva))
<td>{{ $pacienteItem['pacienteDataNascimento'] }}</td>
@endif
@if(in_array('pacienteTelefone', $selectedColsBuscaAtiva))
<td>{{ $pacienteItem['pacienteTelefone'] }}</td>
@endif
@if(in_array('pacienteEndereco', $selectedColsBuscaAtiva))
<td>{{ $pacienteItem['pacienteEndereco'] }}</td>
@endif
@if(in_array('areaMicroareaDomicilio', $selectedColsBuscaAtiva))
<td>{{ $pacienteItem['areaMicroareaDomicilio'] }}</td>
@endif
@foreach($boasPraticasSelecionadas as $pratica)
@php $campo = 'indicador' . $pratica; @endphp
<td>
@if($pacienteItem[$campo] ?? false)
Sim
@elseif($pratica === 'D' && ($pacienteItem['areaTipoId'] ?? null) == 5)
N/C
@else
Não
@endif
</td>
@endforeach
<td>{{ $pacienteItem['pontuacaoTotal'] }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif

View File

@@ -0,0 +1,239 @@
<table>
<tr>
<td style="text-align: center" colspan="5">
<strong>{{$title}}</strong>
</td>
</tr>
<tr>
<td><strong>Período</strong></td>
<td><strong>Ano</strong></td>
<td><strong>Quadrimestre</strong></td>
<td colspan="2"><strong>Unidade</strong></td>
</tr>
<tr>
<td>De {{ $periodoDe }} até {{ $periodoAte }}</td>
<td>{{ $quadrimestreAno }}</td>
<td>{{ $quadrimestre }}</td>
<td colspan="2">{{ $unidade }}</td>
</tr>
<tr>
<td colspan="3"><strong>Equipe</strong></td>
<td><strong>Boas práticas</strong></td>
<td><strong>Busca ativa</strong></td>
</tr>
<tr>
<td colspan="3">{{ $equipe }}</td>
<td>{{ $boasPraticas }}</td>
<td>{{ $buscaAtiva }}</td>
</tr>
<tr>
<td><strong>Sexo</strong></td>
<td><strong>Idade mínima</strong></td>
<td><strong>Idade máxima</strong></td>
<td colspan="2"><strong>Paciente</strong></td>
</tr>
<tr>
<td>{{ $sexo }}</td>
<td>{{ $idadeMinima }}</td>
<td>{{ $idadeMaxima }}</td>
<td colspan="2">{{ $paciente }}</td>
</tr>
</table>
<table>
<thead>
<tr>
<th colspan="6" style="text-align: center"><strong>Totalizadores</strong></th>
</tr>
<tr>
<th><strong>Total de pacientes</strong></th>
<th><strong>Total de equipes</strong></th>
<th><strong>Total de microáreas</strong></th>
<th><strong>Denominador</strong></th>
<th><strong>Numerador</strong></th>
<th><strong>Resultado</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $totalizadores->total_pacientes }}</td>
<td>{{ $totalizadores->total_equipes }}</td>
<td>{{ $totalizadores->total_microareas }}</td>
<td>{{ $totalizadores->denominador }}</td>
<td>{{ $totalizadores->numerador }}</td>
<td>{{ $totalizadores->resultado }}%</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
@if($boasPraticasSelecionadas->contains('A'))<th><strong>Boa prática A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>Boa prática B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>Boa prática C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>Boa prática D</strong></th>@endif
@if($boasPraticasSelecionadas->contains('E'))<th><strong>Boa prática E</strong></th>@endif
@if($boasPraticasSelecionadas->contains('F'))<th><strong>Boa prática F</strong></th>@endif
@if($boasPraticasSelecionadas->contains('G'))<th><strong>Boa prática G</strong></th>@endif
@if($boasPraticasSelecionadas->contains('H'))<th><strong>Boa prática H</strong></th>@endif
@if($boasPraticasSelecionadas->contains('I'))<th><strong>Boa prática I</strong></th>@endif
@if($boasPraticasSelecionadas->contains('J'))<th><strong>Boa prática J</strong></th>@endif
@if($boasPraticasSelecionadas->contains('K'))<th><strong>Boa prática K</strong></th>@endif
</tr>
</thead>
<tbody>
<tr>
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $totalizadores->boa_pratica_a }}%</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $totalizadores->boa_pratica_b }}%</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td>{{ $totalizadores->boa_pratica_c }}%</td>@endif
@if($boasPraticasSelecionadas->contains('D'))<td>{{ $totalizadores->boa_pratica_d }}%</td>@endif
@if($boasPraticasSelecionadas->contains('E'))<td>{{ $totalizadores->boa_pratica_e }}%</td>@endif
@if($boasPraticasSelecionadas->contains('F'))<td>{{ $totalizadores->boa_pratica_f }}%</td>@endif
@if($boasPraticasSelecionadas->contains('G'))<td>{{ $totalizadores->boa_pratica_g }}%</td>@endif
@if($boasPraticasSelecionadas->contains('H'))<td>{{ $totalizadores->boa_pratica_h }}%</td>@endif
@if($boasPraticasSelecionadas->contains('I'))<td>{{ $totalizadores->boa_pratica_i }}%</td>@endif
@if($boasPraticasSelecionadas->contains('J'))<td>{{ $totalizadores->boa_pratica_j }}%</td>@endif
@if($boasPraticasSelecionadas->contains('K'))<td>{{ $totalizadores->boa_pratica_k }}%</td>@endif
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Denominador</strong></th>
<th><strong>Numerador</strong></th>
<th><strong>Resultado</strong></th>
<th><strong>Classificação</strong></th>
@if($boasPraticasSelecionadas->contains('A'))<th><strong>A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>D</strong></th>@endif
@if($boasPraticasSelecionadas->contains('E'))<th><strong>E</strong></th>@endif
@if($boasPraticasSelecionadas->contains('F'))<th><strong>F</strong></th>@endif
@if($boasPraticasSelecionadas->contains('G'))<th><strong>G</strong></th>@endif
@if($boasPraticasSelecionadas->contains('H'))<th><strong>H</strong></th>@endif
@if($boasPraticasSelecionadas->contains('I'))<th><strong>I</strong></th>@endif
@if($boasPraticasSelecionadas->contains('J'))<th><strong>J</strong></th>@endif
@if($boasPraticasSelecionadas->contains('K'))<th><strong>K</strong></th>@endif
</tr>
</thead>
<tbody>
@foreach ($equipes as $item)
<tr>
<td>{{ $item->unidade_nome_fantasia }}</td>
<td>{{ $item->equipe_descricao }}</td>
<td>{{ $item->denominador }}</td>
<td>{{ $item->numerador }}</td>
<td>{{ $item->resultado }}%</td>
<td>{{ $item->classificacao_resultado }}</td>
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $item->boa_pratica_a }}%</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $item->boa_pratica_b }}%</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td>{{ $item->boa_pratica_c }}%</td>@endif
@if($boasPraticasSelecionadas->contains('D'))<td>{{ $item->boa_pratica_d }}%</td>@endif
@if($boasPraticasSelecionadas->contains('E'))<td>{{ $item->boa_pratica_e }}%</td>@endif
@if($boasPraticasSelecionadas->contains('F'))<td>{{ $item->boa_pratica_f }}%</td>@endif
@if($boasPraticasSelecionadas->contains('G'))<td>{{ $item->boa_pratica_g }}%</td>@endif
@if($boasPraticasSelecionadas->contains('H'))<td>{{ $item->boa_pratica_h }}%</td>@endif
@if($boasPraticasSelecionadas->contains('I'))<td>{{ $item->boa_pratica_i }}%</td>@endif
@if($boasPraticasSelecionadas->contains('J'))<td>{{ $item->boa_pratica_j }}%</td>@endif
@if($boasPraticasSelecionadas->contains('K'))<td>{{ $item->boa_pratica_k }}%</td>@endif
</tr>
@endforeach
</tbody>
</table>
@if($isBuscaAtiva)
<table>
<thead>
<tr>
@php
$colspan = 8;
if($colunasPacientes->contains('data_nascimento')) $colspan++;
if($colunasPacientes->contains('telefone_principal')) $colspan++;
if($colunasPacientes->contains('endereco')) $colspan++;
if($colunasPacientes->contains('microarea_descricao')) $colspan++;
if($colunasPacientes->contains('area_microarea_domicilio')) $colspan++;
if($boasPraticasSelecionadas->contains('A')) $colspan++;
if($boasPraticasSelecionadas->contains('B')) $colspan++;
if($boasPraticasSelecionadas->contains('C')) $colspan++;
if($boasPraticasSelecionadas->contains('D')) $colspan++;
if($boasPraticasSelecionadas->contains('E')) $colspan++;
if($boasPraticasSelecionadas->contains('F')) $colspan++;
if($boasPraticasSelecionadas->contains('G')) $colspan++;
if($boasPraticasSelecionadas->contains('H')) $colspan++;
if($boasPraticasSelecionadas->contains('I')) $colspan++;
if($boasPraticasSelecionadas->contains('J')) $colspan++;
if($boasPraticasSelecionadas->contains('K')) $colspan++;
@endphp
<th colspan="{{ $colspan }}" style="text-align: center"><strong>Busca ativa por paciente</strong></th>
</tr>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Paciente</strong></th>
<th><strong>Sexo</strong></th>
<th><strong>Idade</strong></th>
<th><strong>Responsável pelo cadastro</strong></th>
@if($colunasPacientes->contains('data_nascimento'))<th><strong>Data de nascimento</strong></th>@endif
@if($colunasPacientes->contains('telefone_principal'))<th><strong>Telefone</strong></th>@endif
@if($colunasPacientes->contains('endereco'))<th><strong>Endereço</strong></th>@endif
@if($colunasPacientes->contains('microarea_descricao'))<th><strong>Microárea</strong></th>@endif
@if($colunasPacientes->contains('area_microarea_domicilio'))<th><strong>Área/Microárea do Domicílio</strong></th>@endif
@if($boasPraticasSelecionadas->contains('A'))<th><strong>A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>D</strong></th>@endif
@if($boasPraticasSelecionadas->contains('E'))<th><strong>E</strong></th>@endif
@if($boasPraticasSelecionadas->contains('F'))<th><strong>F</strong></th>@endif
@if($boasPraticasSelecionadas->contains('G'))<th><strong>G</strong></th>@endif
@if($boasPraticasSelecionadas->contains('H'))<th><strong>H</strong></th>@endif
@if($boasPraticasSelecionadas->contains('I'))<th><strong>I</strong></th>@endif
@if($boasPraticasSelecionadas->contains('J'))<th><strong>J</strong></th>@endif
@if($boasPraticasSelecionadas->contains('K'))<th><strong>K</strong></th>@endif
<th><strong>Pontuação total</strong></th>
</tr>
</thead>
<tbody>
@foreach ($pacientes as $item)
<tr>
<td>{{ $item->unidade_nome_fantasia }}</td>
<td>{{ $item->equipe_descricao }}</td>
<td>{{ $item->paciente_nome }}</td>
<td>{{ $item->sexo_descricao }}</td>
<td>{{ $item->idade }}</td>
<td>{{ $item->usuario_cadastro_nome }}</td>
@if($colunasPacientes->contains('data_nascimento'))<td>{{ $item->data_nascimento }}</td>@endif
@if($colunasPacientes->contains('telefone_principal'))<td>{{ $item->telefone_principal }}</td>@endif
@if($colunasPacientes->contains('endereco'))<td>{{ $item->endereco }}</td>@endif
@if($colunasPacientes->contains('microarea_descricao'))<td>{{ $item->microarea_descricao }}</td>@endif
@if($colunasPacientes->contains('area_microarea_domicilio'))<td>{{ $item->area_microarea_domicilio }}</td>@endif
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $item->boa_pratica_a ? 'x' : '' }}</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $item->boa_pratica_b ? 'x' : '' }}</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td>{{ $item->boa_pratica_c ? 'x' : '' }}</td>@endif
@if($boasPraticasSelecionadas->contains('D'))<td>{{ $item->boa_pratica_d ? 'x' : '' }}</td>@endif
@if($boasPraticasSelecionadas->contains('E'))<td>{{ $item->area_tipo_id == 5 && !$item->boa_pratica_e ? 'N/C' : ($item->boa_pratica_e ? 'x' : '') }}</td>@endif
@if($boasPraticasSelecionadas->contains('F'))<td>{{ $item->boa_pratica_f ? 'x' : '' }}</td>@endif
@if($boasPraticasSelecionadas->contains('G'))<td>{{ $item->boa_pratica_g ? 'x' : '' }}</td>@endif
@if($boasPraticasSelecionadas->contains('H'))<td>{{ $item->boa_pratica_h ? 'x' : '' }}</td>@endif
@if($boasPraticasSelecionadas->contains('I'))<td>{{ $item->boa_pratica_i ? 'x' : '' }}</td>@endif
@if($boasPraticasSelecionadas->contains('J'))<td>{{ $item->area_tipo_id == 5 && !$item->boa_pratica_j ? 'N/C' : ($item->boa_pratica_j ? 'x' : '') }}</td>@endif
@if($boasPraticasSelecionadas->contains('K'))<td>{{ $item->boa_pratica_k ? 'x' : '' }}</td>@endif
<td>{{ $item->pontuacao_total }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif

View File

@@ -0,0 +1,294 @@
<table>
<tr>
<td style="text-align: center" colspan="5">
<strong>{{$title}}</strong>
</td>
</tr>
<tr>
<td><strong>Período</strong></td>
<td><strong>Ano</strong></td>
<td><strong>Quadrimestre</strong></td>
<td colspan="2"><strong>Unidade</strong></td>
</tr>
<tr>
<td>
@if($periodoDe)
De {{ $periodoDe }} até {{ $periodoAte }}
@endif
</td>
<td>{{ $quadrimestreAno }}</td>
<td>{{ $quadrimestre }}</td>
<td colspan="2">{{ $unidade }}</td>
</tr>
<tr>
<td><strong>Equipe</strong></td>
<td colspan="2"><strong>Boas práticas</strong></td>
<td><strong>Sexo</strong></td>
<td><strong>Identidade de gênero</strong></td>
</tr>
<tr>
<td>{{ $equipe }}</td>
<td colspan="2">{{ $boasPraticas }}</td>
<td>{{ $sexo }}</td>
<td>{{ $identidadeGenero }}</td>
</tr>
<tr>
<td><strong>Faixa etária inicial</strong></td>
<td colspan="2"><strong>Faixa etária final</strong></td>
<td colspan="2"><strong>Paciente</strong></td>
<td><strong>Busca ativa</strong></td>
</tr>
<tr>
<td>
@isset($idadeMinimaAnos){{ $idadeMinimaAnos }} anos @endisset
@isset($idadeMinimaMeses){{ $idadeMinimaMeses }} meses @endisset
@isset($idadeMinimaDias){{ $idadeMinimaDias }} dias @endisset
</td>
<td colspan="2">
@isset($idadeMaximaAnos){{ $idadeMaximaAnos }} anos @endisset
@isset($idadeMaximaMeses){{ $idadeMaximaMeses }} meses @endisset
@isset($idadeMaximaDias){{ $idadeMaximaDias }} dias @endisset
</td>
<td colspan="2">{{ $paciente }}</td>
<td>{{ $buscaAtiva }}</td>
</tr>
<tr>
<td colspan="5"><strong>Fora de Área</strong></td>
</tr>
<tr>
<td colspan="5">{{ $foraArea }}</td>
</tr>
</table>
<table>
<thead>
<tr>
<th colspan="4" style="text-align: center"><strong>Totalizadores</strong></th>
</tr>
<tr>
<th><strong>Total de pacientes</strong></th>
<th><strong>Total de equipes</strong></th>
<th><strong>Total de microáreas</strong></th>
<th><strong>Resultado (%)</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $totalizadores->total_pacientes }}</td>
<td>{{ $totalizadores->total_equipes }}</td>
<td>{{ $totalizadores->total_microareas }}</td>
<td>{{ $totalizadores->resultado }}%</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
@if($boasPraticasSelecionadas->contains('A'))
<th><strong>Denominador da boa prática A</strong></th>
<th><strong>Numerador da boa prática A</strong></th>
@endif
@if($boasPraticasSelecionadas->contains('B'))
<th><strong>Denominador da boa prática B</strong></th>
<th><strong>Numerador da boa prática B</strong></th>
@endif
@if($boasPraticasSelecionadas->contains('C'))
<th><strong>Denominador da boa prática C</strong></th>
<th><strong>Numerador da boa prática C</strong></th>
@endif
@if($boasPraticasSelecionadas->contains('D'))
<th><strong>Denominador da boa prática D</strong></th>
<th><strong>Numerador da boa prática D</strong></th>
@endif
</tr>
<tr>
@if($boasPraticasSelecionadas->contains('A'))
<td>{{ $totalizadores->denominador_boa_pratica_a }}</td>
<td>{{ $totalizadores->numerador_boa_pratica_a }}</td>
@endif
@if($boasPraticasSelecionadas->contains('B'))
<td>{{ $totalizadores->denominador_boa_pratica_b }}</td>
<td>{{ $totalizadores->numerador_boa_pratica_b }}</td>
@endif
@if($boasPraticasSelecionadas->contains('C'))
<td>{{ $totalizadores->denominador_boa_pratica_c }}</td>
<td>{{ $totalizadores->numerador_boa_pratica_c }}</td>
@endif
@if($boasPraticasSelecionadas->contains('D'))
<td>{{ $totalizadores->denominador_boa_pratica_d }}</td>
<td>{{ $totalizadores->numerador_boa_pratica_d }}</td>
@endif
</tr>
<tr>
@if($boasPraticasSelecionadas->contains('A'))<th colspan="2"><strong>% Boa prática A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th colspan="2"><strong>% Boa prática B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th colspan="2"><strong>% Boa prática C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th colspan="2"><strong>% Boa prática D</strong></th>@endif
</tr>
<tr>
@if($boasPraticasSelecionadas->contains('A'))<td colspan="2">{{ $totalizadores->percentual_boa_pratica_a }}%</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td colspan="2">{{ $totalizadores->percentual_boa_pratica_b }}%</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td colspan="2">{{ $totalizadores->percentual_boa_pratica_c }}%</td>@endif
@if($boasPraticasSelecionadas->contains('D'))<td colspan="2">{{ $totalizadores->percentual_boa_pratica_d }}%</td>@endif
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
@if($boasPraticasSelecionadas->contains('A') && $colunasEquipes->contains('denominador_boa_pratica_a'))<th><strong>Denominador da boa prática A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('A') && $colunasEquipes->contains('numerador_boa_pratica_a'))<th><strong>Numerador da boa prática A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B') && $colunasEquipes->contains('denominador_boa_pratica_b'))<th><strong>Denominador da boa prática B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B') && $colunasEquipes->contains('numerador_boa_pratica_b'))<th><strong>Numerador da boa prática B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C') && $colunasEquipes->contains('denominador_boa_pratica_c'))<th><strong>Denominador da boa prática C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C') && $colunasEquipes->contains('numerador_boa_pratica_c'))<th><strong>Numerador da boa prática C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D') && $colunasEquipes->contains('denominador_boa_pratica_d'))<th><strong>Denominador da boa prática D</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D') && $colunasEquipes->contains('numerador_boa_pratica_d'))<th><strong>Numerador da boa prática D</strong></th>@endif
<th><strong>Resultado (%)</strong></th>
<th><strong>Classificação</strong></th>
@if($boasPraticasSelecionadas->contains('A'))<th><strong>% Boa prática A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>% Boa prática B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>% Boa prática C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>% Boa prática D</strong></th>@endif
</tr>
</thead>
<tbody>
@foreach ($equipes as $item)
<tr>
<td>{{ $item->unidade_nome_fantasia }}</td>
<td>{{ $item->equipe_descricao }}</td>
@if($boasPraticasSelecionadas->contains('A') && $colunasEquipes->contains('denominador_boa_pratica_a'))<td class="text-center">{{ $item->denominador_boa_pratica_a }}</td>@endif
@if($boasPraticasSelecionadas->contains('A') && $colunasEquipes->contains('numerador_boa_pratica_a'))<td class="text-center">{{ $item->numerador_boa_pratica_a }}</td>@endif
@if($boasPraticasSelecionadas->contains('B') && $colunasEquipes->contains('denominador_boa_pratica_b'))<td class="text-center">{{ $item->denominador_boa_pratica_b }}</td>@endif
@if($boasPraticasSelecionadas->contains('B') && $colunasEquipes->contains('numerador_boa_pratica_b'))<td class="text-center">{{ $item->numerador_boa_pratica_b }}</td>@endif
@if($boasPraticasSelecionadas->contains('C') && $colunasEquipes->contains('denominador_boa_pratica_c'))<td class="text-center">{{ $item->denominador_boa_pratica_c }}</td>@endif
@if($boasPraticasSelecionadas->contains('C') && $colunasEquipes->contains('numerador_boa_pratica_c'))<td class="text-center">{{ $item->numerador_boa_pratica_c }}</td>@endif
@if($boasPraticasSelecionadas->contains('D') && $colunasEquipes->contains('denominador_boa_pratica_d'))<td class="text-center">{{ $item->denominador_boa_pratica_d }}</td>@endif
@if($boasPraticasSelecionadas->contains('D') && $colunasEquipes->contains('numerador_boa_pratica_d'))<td class="text-center">{{ $item->numerador_boa_pratica_d }}</td>@endif
<td>{{ $item->resultado }}%</td>
<td>{{ $item->classificacao_resultado }}</td>
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $item->percentual_boa_pratica_a }}%</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $item->percentual_boa_pratica_b }}%</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td>{{ $item->percentual_boa_pratica_c }}%</td>@endif
@if($boasPraticasSelecionadas->contains('D'))<td>{{ $item->percentual_boa_pratica_d }}%</td>@endif
</tr>
@endforeach
</tbody>
</table>
@if($isBuscaAtiva)
<table>
<thead>
<tr>
@php
$colspan = 8;
if($colunasPacientes->contains('data_nascimento')) $colspan++;
if($colunasPacientes->contains('telefone_principal')) $colspan++;
if($colunasPacientes->contains('endereco')) $colspan++;
if($colunasPacientes->contains('area_microarea_domicilio')) $colspan++;
if($boasPraticasSelecionadas->contains('A')) $colspan++;
if($boasPraticasSelecionadas->contains('B')) $colspan++;
if($boasPraticasSelecionadas->contains('C')) $colspan++;
if($boasPraticasSelecionadas->contains('D')) $colspan++;
@endphp
<th colspan="{{ $colspan }}" style="text-align: center"><strong>Busca ativa por paciente</strong></th>
</tr>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Paciente</strong></th>
<th><strong>Sexo</strong></th>
<th><strong>Idade</strong></th>
<th><strong>Microárea</strong></th>
<th><strong>Responsável pelo cadastro</strong></th>
@if($colunasPacientes->contains('data_nascimento'))<th><strong>Data de nascimento</strong></th>@endif
@if($colunasPacientes->contains('telefone_principal'))<th><strong>Telefone</strong></th>@endif
@if($colunasPacientes->contains('endereco'))<th><strong>Endereço</strong></th>@endif
@if($colunasPacientes->contains('area_microarea_domicilio'))<th><strong>Área/Microárea do Domicílio</strong></th>@endif
@if($boasPraticasSelecionadas->contains('A'))<th><strong>A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>D</strong></th>@endif
<th><strong>Pontuação total</strong></th>
</tr>
</thead>
<tbody>
@foreach ($pacientes as $item)
<tr>
<td>{{ $item->unidade_nome_fantasia }}</td>
<td>{{ $item->equipe_descricao }}</td>
<td>{{ $item->paciente_nome }}</td>
<td>{{ $item->sexo_descricao }}</td>
<td>{{ $item->idade }}</td>
<td>{{ $item->microarea_descricao }}</td>
<td>{{ $item->usuario_cadastro_nome }}</td>
@if($colunasPacientes->contains('data_nascimento'))<td>{{ $item->data_nascimento }}</td>@endif
@if($colunasPacientes->contains('telefone_principal'))<td>{{ $item->telefone_principal }}</td>@endif
@if($colunasPacientes->contains('endereco'))<td>{{ $item->endereco }}</td>@endif
@if($colunasPacientes->contains('area_microarea_domicilio'))<td>{{ $item->area_microarea_domicilio }}</td>@endif
@if($boasPraticasSelecionadas->contains('A'))
<td>
@if($item->boa_pratica_a_aplica)
{{ $item->boa_pratica_a ? 'Sim' : 'Não' }}
@else
Não aplica
@endif
</td>
@endif
@if($boasPraticasSelecionadas->contains('B'))
<td>
@if($item->boa_pratica_b_aplica)
{{ $item->boa_pratica_b ? 'Sim' : 'Não' }}
@else
Não aplica
@endif
</td>
@endif
@if($boasPraticasSelecionadas->contains('C'))
<td>
@if($item->boa_pratica_c_aplica)
{{ $item->boa_pratica_c ? 'Sim' : 'Não' }}
@else
Não aplica
@endif
</td>
@endif
@if($boasPraticasSelecionadas->contains('D'))
<td>
@if($item->boa_pratica_d_aplica)
{{ $item->boa_pratica_d ? 'Sim' : 'Não' }}
@else
Não aplica
@endif
</td>
@endif
<td>{{ $item->pontuacao_total }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif

View File

@@ -0,0 +1,245 @@
<table>
<tr>
<td style="text-align: center" colspan="2">
<strong>{{$title}}</strong>
</td>
</tr>
<tr>
@if ($periodo['inicio'] && $periodo['fim'])
<td><strong>Período</strong></td>
@else
<td><strong>Ano/Quadrimestre</strong></td>
@endif
<td><strong>Unidade</strong></td>
</tr>
<tr>
@if ($periodo['inicio'] && $periodo['fim'])
<td>De {{$periodo['inicio']}} até {{$periodo['fim']}}</td>
@else
<td>{{$ano}}/{{$quadrimestre}}</td>
@endif
<td>{{$unidade}}</td>
</tr>
<tr>
<td><strong>Equipe</strong></td>
<td><strong>Sexo</strong></td>
</tr>
<tr>
<td>{{$equipe}}</td>
<td>{{$sexo}}</td>
</tr>
<tr>
<td><strong>Idade mínima (anos)</strong></td>
<td><strong>Idade máxima (anos)</strong></td>
</tr>
<tr>
<td>{{$idade_anos_minimo}}</td>
<td>{{$idade_anos_maximo}}</td>
</tr>
<tr>
<td colspan="2"><strong>Paciente</strong></td>
</tr>
<tr>
<td colspan="2">{{$paciente}}</td>
</tr>
<tr>
<td colspan="2"><strong>Fora de Área</strong></td>
</tr>
<tr>
<td colspan="2">{{$fora_area ? 'Sim' : 'Não'}}</td>
</tr>
</table>
<table>
<thead>
<tr>
<th style="text-align: center" colspan="2">
<strong>Totalizadores</strong>
</th>
</tr>
<tr>
<th><strong>Total de pacientes</strong></th>
<th><strong>Total de equipes</strong></th>
<th><strong>Total de microáreas</strong></th>
<th><strong>Denominador</strong></th>
<th><strong>Numerador</strong></th>
<th><strong>Resultado</strong></th>
<th><strong>% Boa prática A</strong></th>
<th><strong>% Boa prática B</strong></th>
<th><strong>% Boa prática C</strong></th>
<th><strong>% Boa prática D</strong></th>
<th><strong>% Boa prática E</strong></th>
<th><strong>% Boa prática F</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{$itens['totalizadores']['pacientes']}}</td>
<td>{{$itens['totalizadores']['equipes']}}</td>
<td>{{$itens['totalizadores']['microareas']}}</td>
<td>{{$itens['totalizadores']['denominador']}}</td>
<td>{{$itens['totalizadores']['numerador']}}</td>
<td>{{$itens['totalizadores']['resultado']}}%</td>
<td>{{$itens['totalizadores']['percentual_boas_praticas_a']}}%</td>
<td>{{$itens['totalizadores']['percentual_boas_praticas_b']}}%</td>
<td>{{$itens['totalizadores']['percentual_boas_praticas_c']}}%</td>
<td>{{$itens['totalizadores']['percentual_boas_praticas_d']}}%</td>
<td>{{$itens['totalizadores']['percentual_boas_praticas_e']}}%</td>
<td>{{$itens['totalizadores']['percentual_boas_praticas_f']}}%</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th style="text-align: center" colspan="2">
<strong>Resultado por equipe</strong>
</th>
</tr>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Denominador</strong></th>
<th><strong>Numerador</strong></th>
<th><strong>Resultado</strong></th>
<th><strong>Classificação</strong></th>
@if (in_array('A', $boas_praticas))
<th><strong>% Boa prática A</strong></th>
@endif
@if (in_array('B', $boas_praticas))
<th><strong>% Boa prática B</strong></th>
@endif
@if (in_array('C', $boas_praticas))
<th><strong>% Boa prática C</strong></th>
@endif
@if (in_array('D', $boas_praticas))
<th><strong>% Boa prática D</strong></th>
@endif
@if (in_array('E', $boas_praticas))
<th><strong>% Boa prática E</strong></th>
@endif
@if (in_array('F', $boas_praticas))
<th><strong>% Boa prática F</strong></th>
@endif
</tr>
</thead>
<tbody>
@foreach($itens['itens_agrupados'] as $item)
<tr>
<td>{{$item['unidade_nome_fantasia']}}</td>
<td>{{$item['equipe_descricao']}}</td>
<td>{{$item['denominador']}}</td>
<td>{{$item['numerador']}}</td>
<td>{{$item['resultado']}}%</td>
<td>{{$item['classificacao']}}</td>
@if (in_array('A', $boas_praticas))
<td>{{$item['percentual_boas_praticas_a']}}%</td>
@endif
@if (in_array('B', $boas_praticas))
<td>{{$item['percentual_boas_praticas_b']}}%</td>
@endif
@if (in_array('C', $boas_praticas))
<td>{{$item['percentual_boas_praticas_c']}}%</td>
@endif
@if (in_array('D', $boas_praticas))
<td>{{$item['percentual_boas_praticas_d']}}%</td>
@endif
@if (in_array('E', $boas_praticas))
<td>{{$item['percentual_boas_praticas_e']}}%</td>
@endif
@if (in_array('F', $boas_praticas))
<td>{{$item['percentual_boas_praticas_f']}}%</td>
@endif
</tr>
@endforeach
</tbody>
</table>
@if ($busca_ativa)
<table>
<thead>
<tr>
<th style="text-align: center" colspan="2">
<strong>Busca ativa por paciente</strong>
</th>
</tr>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Área/Microárea do Domicílio</strong></th>
<th><strong>Paciente</strong></th>
<th><strong>Sexo</strong></th>
<th><strong>Data de nascimento</strong></th>
<th><strong>Idade</strong></th>
@if (in_array('A', $boas_praticas))
<th><strong>Boa prática A</strong></th>
@endif
@if (in_array('B', $boas_praticas))
<th><strong>Boa prática B</strong></th>
@endif
@if (in_array('C', $boas_praticas))
<th><strong>Boa prática C</strong></th>
@endif
@if (in_array('D', $boas_praticas))
<th><strong>Boa prática D</strong></th>
@endif
@if (in_array('E', $boas_praticas))
<th><strong>Boa prática E</strong></th>
@endif
@if (in_array('F', $boas_praticas))
<th><strong>Boa prática F</strong></th>
@endif
<th><strong>Pontuação total</strong></th>
</tr>
</thead>
<tbody>
@foreach($itens['itens_desagrupados'] as $item)
<tr>
<td>{{$item['unidade_nome_fantasia']}}</td>
<td>{{$item['equipe_descricao']}}</td>
<td>{{$item['area_microarea_domicilio']}}</td>
<td>{{$item['paciente_nome']}}</td>
<td>{{$item['paciente_sexo_descricao']}}</td>
<td>{{$item['paciente_data_nascimento']}}</td>
<td>{{$item['paciente_idade']}}</td>
@if (in_array('A', $boas_praticas))
<td>{{$item['boa_pratica_a'] ? 'Sim' : 'Não'}}</td>
@endif
@if (in_array('B', $boas_praticas))
<td>{{$item['boa_pratica_b'] ? 'Sim' : 'Não'}}</td>
@endif
@if (in_array('C', $boas_praticas))
<td>{{$item['boa_pratica_c'] ? 'Sim' : 'Não'}}</td>
@endif
@if (in_array('D', $boas_praticas))
<td>{{$item['area_tipo_id'] == 5 && !$item['boa_pratica_d'] ? 'N/C' : ($item['boa_pratica_d'] ? 'Sim' : 'Não')}}</td>
@endif
@if (in_array('E', $boas_praticas))
<td>{{$item['boa_pratica_e'] ? 'Sim' : 'Não'}}</td>
@endif
@if (in_array('F', $boas_praticas))
<td>{{$item['boa_pratica_f'] ? 'Sim' : 'Não'}}</td>
@endif
<td>{{$item['pontuacao_total']}}</td>
</tr>
@endforeach
</tbody>
</table>
@endif

View File

@@ -0,0 +1,205 @@
<table>
<tr>
<td style="text-align: center" colspan="5">
<strong>{{$title}}</strong>
</td>
</tr>
<tr>
<td><strong>Período</strong></td>
<td><strong>Ano</strong></td>
<td><strong>Quadrimestre</strong></td>
<td colspan="2"><strong>Unidade</strong></td>
</tr>
<tr>
<td>De {{ $periodoDe }} até {{ $periodoAte }}</td>
<td>{{ $quadrimestreAno }}</td>
<td>{{ $quadrimestre }}</td>
<td colspan="2">{{ $unidade }}</td>
</tr>
<tr>
<td colspan="3"><strong>Equipe</strong></td>
<td><strong>Boas práticas</strong></td>
<td><strong>Busca ativa</strong></td>
</tr>
<tr>
<td colspan="3">{{ $equipe }}</td>
<td>{{ $boasPraticas }}</td>
<td>{{ $buscaAtiva }}</td>
</tr>
<tr>
<td><strong>Sexo</strong></td>
<td><strong>Idade mínima</strong></td>
<td><strong>Idade máxima</strong></td>
<td colspan="2"><strong>Paciente</strong></td>
</tr>
<tr>
<td>{{ $sexo }}</td>
<td>{{ $idadeMinima }}</td>
<td>{{ $idadeMaxima }}</td>
<td colspan="2">{{ $paciente }}</td>
</tr>
<tr>
<td colspan="5"><strong>Fora de Área</strong></td>
</tr>
<tr>
<td colspan="5">{{ $foraArea }}</td>
</tr>
</table>
<table>
<thead>
<tr>
<th colspan="6" style="text-align: center"><strong>Totalizadores</strong></th>
</tr>
<tr>
<th><strong>Total de pacientes</strong></th>
<th><strong>Total de equipes</strong></th>
<th><strong>Total de microáreas</strong></th>
<th><strong>Denominador</strong></th>
<th><strong>Numerador</strong></th>
<th><strong>Resultado</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $totalizadores->total_pacientes }}</td>
<td>{{ $totalizadores->total_equipes }}</td>
<td>{{ $totalizadores->total_microareas }}</td>
<td>{{ $totalizadores->denominador }}</td>
<td>{{ $totalizadores->numerador }}</td>
<td>{{ $totalizadores->resultado }}%</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
@if($boasPraticasSelecionadas->contains('A'))<th><strong>Boa prática A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>Boa prática B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>Boa prática C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>Boa prática D</strong></th>@endif
</tr>
</thead>
<tbody>
<tr>
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $totalizadores->boa_pratica_a }}%</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $totalizadores->boa_pratica_b }}%</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td>{{ $totalizadores->boa_pratica_c }}%</td>@endif
@if($boasPraticasSelecionadas->contains('D'))<td>{{ $totalizadores->boa_pratica_d }}%</td>@endif
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Denominador</strong></th>
<th><strong>Numerador</strong></th>
<th><strong>Resultado</strong></th>
<th><strong>Classificação</strong></th>
@if($boasPraticasSelecionadas->contains('A'))<th><strong>A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>D</strong></th>@endif
</tr>
</thead>
<tbody>
@foreach ($equipes as $item)
<tr>
<td>{{ $item->unidade_nome_fantasia }}</td>
<td>{{ $item->equipe_descricao }}</td>
<td>{{ $item->denominador }}</td>
<td>{{ $item->numerador }}</td>
<td>{{ $item->resultado }}%</td>
<td>{{ $item->classificacao_resultado }}</td>
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $item->boa_pratica_a }}%</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $item->boa_pratica_b }}%</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td>{{ $item->boa_pratica_c }}%</td>@endif
@if($boasPraticasSelecionadas->contains('D'))<td>{{ $item->boa_pratica_d }}%</td>@endif
</tr>
@endforeach
</tbody>
</table>
@if($isBuscaAtiva)
<table>
<thead>
<tr>
@php
$colspan = 8;
if($colunasPacientes->contains('data_nascimento')) $colspan++;
if($colunasPacientes->contains('telefone_principal')) $colspan++;
if($colunasPacientes->contains('endereco')) $colspan++;
if($colunasPacientes->contains('area_microarea_domicilio')) $colspan++;
if($boasPraticasSelecionadas->contains('A')) $colspan++;
if($boasPraticasSelecionadas->contains('B')) $colspan++;
if($boasPraticasSelecionadas->contains('C')) $colspan++;
if($boasPraticasSelecionadas->contains('D')) $colspan++;
@endphp
<th colspan="{{ $colspan }}" style="text-align: center"><strong>Busca ativa por paciente</strong></th>
</tr>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Paciente</strong></th>
<th><strong>Sexo</strong></th>
<th><strong>Idade</strong></th>
<th><strong>Microárea</strong></th>
<th><strong>Responsável pelo cadastro</strong></th>
@if($colunasPacientes->contains('data_nascimento'))<th><strong>Data de nascimento</strong></th>@endif
@if($colunasPacientes->contains('telefone_principal'))<th><strong>Telefone</strong></th>@endif
@if($colunasPacientes->contains('endereco'))<th><strong>Endereço</strong></th>@endif
@if($colunasPacientes->contains('area_microarea_domicilio'))<th><strong>Área/Microárea do Domicílio</strong></th>@endif
@if($boasPraticasSelecionadas->contains('A'))<th><strong>A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>D</strong></th>@endif
<th><strong>Pontuação total</strong></th>
</tr>
</thead>
<tbody>
@foreach ($pacientes as $item)
<tr>
<td>{{ $item->unidade_nome_fantasia }}</td>
<td>{{ $item->equipe_descricao }}</td>
<td>{{ $item->paciente_nome }}</td>
<td>{{ $item->sexo_descricao }}</td>
<td>{{ $item->idade }}</td>
<td>{{ $item->microarea_descricao }}</td>
<td>{{ $item->usuario_cadastro_nome }}</td>
@if($colunasPacientes->contains('data_nascimento'))<td>{{ $item->data_nascimento }}</td>@endif
@if($colunasPacientes->contains('telefone_principal'))<td>{{ $item->telefone_principal }}</td>@endif
@if($colunasPacientes->contains('endereco'))<td>{{ $item->endereco }}</td>@endif
@if($colunasPacientes->contains('area_microarea_domicilio'))<td>{{ $item->area_microarea_domicilio }}</td>@endif
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $item->boa_pratica_a ? 'Sim' : 'Não' }}</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $item->boa_pratica_b ? 'Sim' : 'Não' }}</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td>{{ $item->boa_pratica_c ? 'Sim' : 'Não' }}</td>@endif
@if($boasPraticasSelecionadas->contains('D'))
<td>
@if($item->is_equipe_eap)
Não condicionante
@else
{{ $item->boa_pratica_d ? 'Sim' : 'Não' }}
@endif
</td>
@endif
<td>{{ $item->pontuacao_total }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif

View File

@@ -0,0 +1,205 @@
<table>
<tr>
<td style="text-align: center" colspan="5">
<strong>{{$title}}</strong>
</td>
</tr>
<tr>
<td><strong>Período</strong></td>
<td><strong>Ano</strong></td>
<td><strong>Quadrimestre</strong></td>
<td colspan="2"><strong>Unidade</strong></td>
</tr>
<tr>
<td>De {{ $periodoDe }} até {{ $periodoAte }}</td>
<td>{{ $quadrimestreAno }}</td>
<td>{{ $quadrimestre }}</td>
<td colspan="2">{{ $unidade }}</td>
</tr>
<tr>
<td colspan="3"><strong>Equipe</strong></td>
<td><strong>Boas práticas</strong></td>
<td><strong>Busca ativa</strong></td>
</tr>
<tr>
<td colspan="3">{{ $equipe }}</td>
<td>{{ $boasPraticas }}</td>
<td>{{ $buscaAtiva }}</td>
</tr>
<tr>
<td><strong>Sexo</strong></td>
<td><strong>Idade mínima</strong></td>
<td><strong>Idade máxima</strong></td>
<td colspan="2"><strong>Paciente</strong></td>
</tr>
<tr>
<td>{{ $sexo }}</td>
<td>{{ $idadeMinima }}</td>
<td>{{ $idadeMaxima }}</td>
<td colspan="2">{{ $paciente }}</td>
</tr>
<tr>
<td colspan="5"><strong>Fora de Área</strong></td>
</tr>
<tr>
<td colspan="5">{{ $foraArea }}</td>
</tr>
</table>
<table>
<thead>
<tr>
<th colspan="6" style="text-align: center"><strong>Totalizadores</strong></th>
</tr>
<tr>
<th><strong>Total de pacientes</strong></th>
<th><strong>Total de equipes</strong></th>
<th><strong>Total de microáreas</strong></th>
<th><strong>Denominador (D)</strong></th>
<th><strong>Numerador (N)</strong></th>
<th><strong>Resultado (%)</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $totalizadores->total_pacientes }}</td>
<td>{{ $totalizadores->total_equipes }}</td>
<td>{{ $totalizadores->total_microareas }}</td>
<td>{{ $totalizadores->denominador }}</td>
<td>{{ $totalizadores->numerador }}</td>
<td>{{ $totalizadores->resultado }}%</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
@if($boasPraticasSelecionadas->contains('A'))<th><strong>% Boa prática A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>% Boa prática B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>% Boa prática C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>% Boa prática D</strong></th>@endif
</tr>
</thead>
<tbody>
<tr>
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $totalizadores->percentual_boa_pratica_a }}%</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $totalizadores->percentual_boa_pratica_b }}%</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td>{{ $totalizadores->percentual_boa_pratica_c }}%</td>@endif
@if($boasPraticasSelecionadas->contains('D'))<td>{{ $totalizadores->percentual_boa_pratica_d }}%</td>@endif
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Denominador (D)</strong></th>
<th><strong>Numerador (N)</strong></th>
<th><strong>Resultado (%)</strong></th>
<th><strong>Classificação</strong></th>
@if($boasPraticasSelecionadas->contains('A'))<th><strong>% Boa prática A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>% Boa prática B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>% Boa prática C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>% Boa prática D</strong></th>@endif
</tr>
</thead>
<tbody>
@foreach ($equipes as $item)
<tr>
<td>{{ $item->unidade_nome_fantasia }}</td>
<td>{{ $item->equipe_descricao }}</td>
<td>{{ $item->denominador }}</td>
<td>{{ $item->numerador }}</td>
<td>{{ $item->resultado }}%</td>
<td>{{ $item->classificacao_resultado }}</td>
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $item->percentual_boa_pratica_a }}%</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $item->percentual_boa_pratica_b }}%</td>@endif
@if($boasPraticasSelecionadas->contains('C'))<td>{{ $item->percentual_boa_pratica_c }}%</td>@endif
@if($boasPraticasSelecionadas->contains('D'))<td>{{ $item->percentual_boa_pratica_d }}%</td>@endif
</tr>
@endforeach
</tbody>
</table>
@if($isBuscaAtiva)
<table>
<thead>
<tr>
@php
$colspan = 8;
if($colunasPacientes->contains('data_nascimento')) $colspan++;
if($colunasPacientes->contains('telefone_principal')) $colspan++;
if($colunasPacientes->contains('endereco')) $colspan++;
if($colunasPacientes->contains('area_microarea_domicilio')) $colspan++;
if($boasPraticasSelecionadas->contains('A')) $colspan++;
if($boasPraticasSelecionadas->contains('B')) $colspan++;
if($boasPraticasSelecionadas->contains('C')) $colspan++;
if($boasPraticasSelecionadas->contains('D')) $colspan++;
@endphp
<th colspan="{{ $colspan }}" style="text-align: center"><strong>Busca ativa por paciente</strong></th>
</tr>
<tr>
<th><strong>Unidade</strong></th>
<th><strong>Equipe</strong></th>
<th><strong>Paciente</strong></th>
<th><strong>Sexo</strong></th>
<th><strong>Idade</strong></th>
<th><strong>Microárea</strong></th>
<th><strong>Responsável pelo cadastro</strong></th>
@if($colunasPacientes->contains('data_nascimento'))<th><strong>Data de nascimento</strong></th>@endif
@if($colunasPacientes->contains('telefone_principal'))<th><strong>Telefone</strong></th>@endif
@if($colunasPacientes->contains('endereco'))<th><strong>Endereço</strong></th>@endif
@if($colunasPacientes->contains('area_microarea_domicilio'))<th><strong>Área/Microárea do Domicílio</strong></th>@endif
@if($boasPraticasSelecionadas->contains('A'))<th><strong>A</strong></th>@endif
@if($boasPraticasSelecionadas->contains('B'))<th><strong>B</strong></th>@endif
@if($boasPraticasSelecionadas->contains('C'))<th><strong>C</strong></th>@endif
@if($boasPraticasSelecionadas->contains('D'))<th><strong>D</strong></th>@endif
<th><strong>Pontuação total</strong></th>
</tr>
</thead>
<tbody>
@foreach ($pacientes as $item)
<tr>
<td>{{ $item->unidade_nome_fantasia }}</td>
<td>{{ $item->equipe_descricao }}</td>
<td>{{ $item->paciente_nome }}</td>
<td>{{ $item->sexo_descricao }}</td>
<td>{{ $item->idade }}</td>
<td>{{ $item->microarea_descricao }}</td>
<td>{{ $item->usuario_cadastro_nome }}</td>
@if($colunasPacientes->contains('data_nascimento'))<td>{{ $item->data_nascimento }}</td>@endif
@if($colunasPacientes->contains('telefone_principal'))<td>{{ $item->telefone_principal }}</td>@endif
@if($colunasPacientes->contains('endereco'))<td>{{ $item->endereco }}</td>@endif
@if($colunasPacientes->contains('area_microarea_domicilio'))<td>{{ $item->area_microarea_domicilio }}</td>@endif
@if($boasPraticasSelecionadas->contains('A'))<td>{{ $item->boa_pratica_a ? 'Sim' : 'Não' }}</td>@endif
@if($boasPraticasSelecionadas->contains('B'))<td>{{ $item->boa_pratica_b ? 'Sim' : 'Não' }}</td>@endif
@if($boasPraticasSelecionadas->contains('C'))
<td>
@if($item->is_equipe_eap)
Não condicionante
@else
{{ $item->boa_pratica_c ? 'Sim' : 'Não' }}
@endif
</td>
@endif
@if($boasPraticasSelecionadas->contains('D'))<td>{{ $item->boa_pratica_d ? 'Sim' : 'Não' }}</td>@endif
<td>{{ $item->pontuacao_total }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif

View File

@@ -0,0 +1,104 @@
<style>
.table-relatorio>thead>tr>th,
.table-relatorio>tfoot>tr>th {
font-weight: bold;
text-align: center;
}
.col-min {
width: 1%;
}
.text-center {
text-align: center;
}
.linha-filtro {
margin-bottom: 10px;
}
fieldset {
margin-top: 20px;
}
</style>
<table>
<tr>
<td style="text-align: center" colspan="6">
<strong>{{ $title }}</strong>
</td>
</tr>
<tr>
<td>
<strong>Competência</strong>
</td>
<td>
<strong>Unidade</strong>
</td>
</tr>
<tr>
<td>
{{ $competencia }}
</td>
<td>
{{ $unidade }}
</td>
</tr>
<tr>
<td>
<strong>Local de atendimento</strong>
</td>
<td>
<strong>Profissional</strong>
</td>
</tr>
<tr>
<td>
{{ $infraestrutura }}
</td>
<td>
{{ $usuario }}
</td>
</tr>
<tr>
<td>
<strong>Ficha</strong>
</td>
</tr>
<tr>
<td>
{{ $ficha }}
</td>
</tr>
</table>
<table class="table table-relatorio">
<thead>
<tr>
@foreach ($colunas as $coluna)
<th class="{{ $coluna['class'] }}"><strong>{{ $coluna['label'] }}</strong> </th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($items as $item)
<tr>
@foreach ($colunas as $coluna)
<td>
{!! $item[$coluna['key']] ?? '-' !!}
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>

View File

@@ -0,0 +1,67 @@
<table>
<tr>
<td style="text-align: center" colspan="4">
<strong>{{ $title }}</strong>
</td>
</tr>
<tr>
<td><strong>Ano</strong></td>
<td><strong>Mês</strong></td>
<td><strong>Unidade</strong></td>
</tr>
<tr>
<td style="text-align: left;">{{ $ano }}</td>
<td>{{ $mes }}</td>
<td>{{ $unidade }}</td>
</tr>
<tr>
<td colspan="2"><strong>Local de atendimento</strong></td>
<td><strong>Equipe</strong></td>
</tr>
<tr>
<td colspan="2">{{ $infraestrutura }}</td>
<td>{{ $equipe }}</td>
</tr>
</table>
@foreach ($resultado as $key => $data)
<table class="table table-relatorio" style="{{ $key !== 'levantamento_quantitativo' ? 'margin-top: 15px;' : '' }}">
<thead>
<tr>
<th colspan="{{ isset($data['itens'][0]['percentual']) ? 3 : 2 }}" style="text-align: center"><strong>{{ $data['titulo'] }}</strong></th>
</tr>
<tr>
<th style="text-align: center"><strong>Quantitativo</strong></th>
<th style="text-align: center"><strong>Quantidade</strong></th>
@isset($data['itens'][0]['percentual'])
<th style="text-align: center"><strong>%</strong></th>
@endisset
</tr>
</thead>
<tbody>
@foreach ($data['itens'] as $item)
<tr>
<td>{{ $item['descricao'] }}</td>
<td style="text-align: center">{{ $item['quantidade'] }}</td>
@isset($item['percentual'])
<td style="text-align: center">{{ $item['percentual'] }}</td>
@endisset
</tr>
@endforeach
@isset($data['rodape'])
<tr>
<th colspan="{{ isset($data['itens'][0]['percentual']) ? 3 : 2 }}">{{ $data['rodape'] }}</th>
</tr>
@endisset
</tbody>
</table>
@endforeach

View File

@@ -0,0 +1,109 @@
<table>
<tr>
<td style="text-align: center" colspan="10">
<strong>{{$title}}</strong>
</td>
</tr>
<tr>
<td><strong>Período</strong></td>
<td><strong>Unidade</strong></td>
</tr>
<tr>
<td>De {{$periodo['inicio']}} até {{$periodo['fim']}}</td>
<td>{{$unidade}}</td>
</tr>
<tr>
<td><strong>Local de atendimento</strong></td>
<td><strong>Área</strong></td>
<td><strong>Microarea</strong></td>
</tr>
<tr>
<td>{{$infraestrutura}}</td>
<td>{{$area}}</td>
<td>{{$microarea}}</td>
</tr>
<tr>
<td><strong>Agente responsável</strong></td>
<td><strong>Paciente</strong></td>
</tr>
<tr>
<td>{{$usuario}}</td>
<td>{{$paciente}}</td>
</tr>
<tr>
<td><strong>Logradouro</strong></td>
<td><strong>Número do logradouro</strong></td>
<td><strong>Desfecho</strong></td>
</tr>
<tr>
<td>{{$domicilio}}</td>
<td>{{$endereco_numero}}</td>
<td>{{$desfecho}}</td>
</tr>
</table>
<table>
<thead>
<tr>
<th>Data</th>
<th>Paciente</th>
<th>Prontuário</th>
<th>Endereço completo</th>
<th>Agente responsável</th>
<th>Área</th>
<th>Microarea</th>
<th>Residentes</th>
<th>Responsável familiar</th>
<th>Desfecho</th>
</tr>
</thead>
<tbody>
@foreach($data['itens'] as $item)
<tr>
<td>{{ \Carbon\Carbon::parse($item->data)->format('d/m/Y') }}</td>
<td>{{$item->paciente_nome}}</td>
<td>{{$item->paciente_prontuario}}</td>
<td>{{$item->paciente_endereco}}</td>
<td>{{$item->usuario_nome}}</td>
<td>{{$item->area_descricao}}</td>
<td>{{$item->microarea_descricao}}</td>
<td>{{$item->residentes}}</td>
<td>{{$item->responsavel_familiar}}</td>
<td>{{$item->desfecho_descricao}}</td>
</tr>
@endforeach
</tbody>
</table>
<table>
<tr>
<td style="text-align: center" colspan="5">
<strong>Totais</strong>
</td>
</tr>
<tr>
<td><strong>Total de visitas realizadas</strong></td>
<td><strong>Total de ausências</strong></td>
<td><strong>Total de recusas</strong></td>
<td><strong>Total de visitas registradas</strong></td>
<td><strong>Total de pacientes atendidos</strong></td>
</tr>
<tr>
<td>{{$data['totalizadores']['quantidade_visitas_realizadas']}}</td>
<td>{{$data['totalizadores']['quantidade_ausencias']}}</td>
<td>{{$data['totalizadores']['quantidade_recusas']}}</td>
<td>{{$data['totalizadores']['quantidade_visitas_registradas']}}</td>
<td>{{$data['totalizadores']['quantidade_pacientes_atendidos']}}</td>
</tr>
</table>

View File

@@ -0,0 +1,101 @@
<table>
<tr>
<td style="text-align: center">
<strong>{{ $title }}</strong>
</td>
</tr>
<tr>
<td>
<strong>Data inicial:</strong>
</td>
<td>
<strong>Data final:</strong>
</td>
</tr>
<tr>
<td>
{{ $data_inicial }}
</td>
<td>
{{ $data_final }}
</td>
</tr>
<tr>
<td>
<strong>Unidade:</strong>
</td>
<td>
<strong>Equipe:</strong>
</td>
</tr>
<tr>
<td>
{{ $unidade }}
</td>
<td>
{{ $equipe }}
</td>
</tr>
</table>
<table>
<thead>
<tr>
<th>
<b>1ª Consulta Odontológica Programática</b>
</th>
<th>
<b>Escovação Dental Supervisionada</b>
</th>
<th>
<b>Tratamento Concluído</b>
</th>
<th>
<b>Urgência</b>
</th>
<th>
<b>Gestante</b>
</th>
<th>
<b>Instalação de Próteses Dentárias</b>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $primeira_consulta_odontologica }}</td>
<td>{{ $escovacao_dental_supervisionada }}</td>
<td>{{ $tratamento_concluido }}</td>
<td>{{ $urgencia }}</td>
<td>{{ $gestante }}</td>
<td>{{ $instalacao_proteses_dentarias }}</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>
<strong>Total</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<b>{{ $total_atendimentos_odontologicos }}</b>
</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,98 @@
<style>
.table-relatorio>thead>tr>th,
.table-relatorio>tfoot>tr>th {
text-align: center;
}
.col-min {
width: 1%;
}
.text-center {
text-align: center;
}
.linha-filtro {
margin-bottom: 10px;
}
fieldset {
margin-top: 20px;
}
</style>
<table>
<tr>
<td style="text-align: center" colspan="6">
<strong>{{ $title }}</strong>
</td>
</tr>
<tr>
<td>
<strong>Unidade</strong>
</td>
<td>
<strong>Domicílio</strong>
</td>
<td>
<strong>Área / INE</strong>
</td>
<td>
<strong>Microárea</strong>
</td>
</tr>
<tr>
<td>
{{ $unidade }}
</td>
<td>
{{ $domicilio }}
</td>
<td>
{{ $area }}
</td>
<td>
{{ $microarea }}
</td>
</tr>
</table>
<table>
<thead>
<tr>
@foreach ($colunas as $coluna)
<th>
<strong>{{ $coluna['label'] }}</strong>
</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($items as $item)
<tr>
@foreach ($colunas as $coluna)
<td>
@if ($coluna['key'] == 'data_nascimento')
{{ date('d/m/Y', strtotime($item->{$coluna['key']})) }}
@else
{{ $item->{$coluna['key']} ?? '-' }}
@endif
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
<table>
<tr>
<td><strong>Total de pacientes</strong></td>
<td>{{ count($items) }}</td>
</tr>
</table>

View File

@@ -0,0 +1,201 @@
<style>
.table-relatorio>thead>tr>th,
.table-relatorio>tfoot>tr>th {
font-weight: bold;
text-align: center;
}
.col-min {
width: 1%;
}
.text-center {
text-align: center;
}
.linha-filtro {
margin-bottom: 10px;
}
fieldset {
margin-top: 20px;
}
</style>
<table>
<tr>
<td style="text-align: center" colspan="6">
<strong>{{ $title }}</strong>
</td>
</tr>
<tr>
<td>
<strong>Unidade</strong>
</td>
<td>
<strong>Domicílio</strong>
</td>
<td>
<strong>Área / INE</strong>
</td>
<td>
<strong>Microárea</strong>
</td>
</tr>
<tr>
<td>
{{ $unidade }}
</td>
<td>
{{ $domicilio }}
</td>
<td>
{{ $area }}
</td>
<td>
{{ $microarea }}
</td>
</tr>
</table>
<table class="table table-relatorio">
<thead>
@if ($domicilio != 'Fora de área')
@php
$colspanMicroareas = count($colunas) - count(['unidade_nome', 'areas', 'pacientes_fora_area']);
if ($domicilio == 'Dentro de área') {
$colspanMicroareas++;
}
@endphp
<tr>
<th></th>
<th></th>
<th style="text-align: center" colspan="{{ $colspanMicroareas }}"><strong>Microáreas</strong></th>
@if ($domicilio == 'Todos' && $microarea == 'Todos')
<th></th>
@endif
</tr>
@endif
<tr>
@foreach ($colunas as $coluna)
<th class="{{ $coluna['class'] }}"><strong>{{ $coluna['label'] }}</strong> </th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($items['consulta'] as $item)
<tr>
@foreach ($colunas as $coluna)
{{-- Coluna de pacientes fora de área --}}
@if ($coluna['key'] == 'pacientes_fora_area')
<td> {{ $item[$coluna['key']]['total_fora_area'] ?? '0' }}</td>
{{-- Coluna de areas --}}
@elseif ($coluna['key'] == 'areas')
<td>
@foreach ($item['areas'] as $index => $itemArea)
@if ($index > 0 && $microarea == 'Todos')
<br />
@endif
{{-- Coluna de área quando tem area filtrada --}}
@if ($area == $itemArea['area_descricao'] && $microarea == 'Todos')
{{ $itemArea['area_descricao'] }}
@endif
{{-- Coluna de area quando tem microarea filtrada --}}
@if ($microarea != 'Todos')
@if (count($itemArea['microareas']) > 0)
@if ($index > 0)
<br />
@endif
@if ($area == $itemArea['area_descricao'])
{{ $itemArea['area_descricao'] }}
@elseif($area == 'Todos')
{{ $itemArea['area_descricao'] }}
@endif
@endif
@endif
{{-- Coluna de área por padrão --}}
@if ($area == 'Todos' && $microarea == 'Todos')
{{ $itemArea['area_descricao'] }}
@endif
@endforeach
</td>
{{-- Coluna de microareas --}}
@elseif ($coluna['key'] != 'unidade_nome')
<td>
@foreach ($item['areas'] as $index => $itemArea)
@if ($index > 0)
<br />
@endif
@if (
$coluna['key'] != 'total' &&
!$itemArea['microareas']->contains('microarea_descricao', $coluna['key']) &&
$microarea == 'Todos')
@if ($area == $itemArea['area_descricao'])
0
@elseif($area == 'Todos')
0
@endif
@endif
@foreach ($itemArea['microareas'] as $itemMicroarea)
@if ($area == $itemArea['area_descricao'] && $itemMicroarea['microarea_descricao'] == $coluna['key'])
{{ $itemMicroarea['microarea_total_pacientes'] }}
@elseif ($area === 'Todos' && $itemMicroarea['microarea_descricao'] == $coluna['key'] && $coluna['key'] !== 'total')
{{ $itemMicroarea['microarea_total_pacientes'] }}
@endif
@endforeach
{{-- Coluna de total --}}
@if ($coluna['key'] == 'total')
@if ($itemArea['area_descricao'] === $area)
{{ $itemArea['area_total_pacientes'] }}
@elseif ($area == 'Todos')
{{ $itemArea['area_total_pacientes'] }}
@endif
@endif
@endforeach
</td>
{{-- Demais colunas --}}
@else
<td>
{{ $item[$coluna['key']] ?? '-' }}
</td>
@endif
@endforeach
</tr>
@endforeach
</tbody>
</table>
<table>
<tr>
<td><strong>Unidade(s)</strong></td>
<td>{{ $totalizadores['unidades'] }}</td>
</tr>
<tr>
<td><strong>Dentro de área</strong></td>
<td>{{ $totalizadores['dentro_area'] }}</td>
</tr>
<tr>
<td><strong>Fora de área</strong></td>
<td>{{ $totalizadores['fora_area'] }}</td>
</tr>
<tr>
<td><strong>Dentro + Fora de área</strong></td>
<td>{{ $totalizadores['dentro_area'] + $totalizadores['fora_area'] }}</td>
</tr>
</table>

View File

@@ -0,0 +1,222 @@
<style>
.table-relatorio>thead>tr>th,
.table-relatorio>tfoot>tr>th {
text-align: center;
}
.col-min {
width: 1%;
}
.text-center {
text-align: center;
}
.linha-filtro {
margin-bottom: 10px;
}
fieldset {
margin-top: 20px;
}
</style>
<table>
<tr>
<td style="text-align: center" colspan="{{ $colunas->count() }}">
{{ $title }}
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>
<strong>Competência:</strong>
</td>
<td>
{{ $competencia }}
</td>
</tr>
<tr>
<td>
<strong>Unidade:</strong>
</td>
<td>
{{ $unidade }}
</td>
</tr>
<tr>
<td>
<strong>Profissional:</strong>
</td>
<td>
{{ $profissional }}
</td>
</tr>
<tr>
<td>
<strong>Local de atendimento:</strong>
</td>
<td>
{{ $localAtendimento }}
</td>
</tr>
<tr>
<td>
<strong>Prontuario:</strong>
</td>
<td>
{{ $prontuario }}
</td>
</tr>
<tr>
<td>
<strong>Idade:</strong>
</td>
<td>
{{ $idade }}
</td>
</tr>
<tr>
<td>
<strong>Sexo:</strong>
</td>
<td>
{{ $sexo }}
</td>
</tr>
<tr>
<td>
<strong>Hipertenso:</strong>
</td>
<td>
{{ $hipertenso }}
</td>
</tr>
<tr>
<td>
<strong>Condição avaliada:</strong>
</td>
<td>
{{ $condicaoAvaliada }}
</td>
</tr>
<tr>
<td>
<strong>Doença transmissível:</strong>
</td>
<td>
{{ $doencaTransmissivel }}
</td>
</tr>
<tr>
<td>
<strong>Rastreamento:</strong>
</td>
<td>
{{ $rastreamento }}
</td>
</tr>
<tr>
<td>
<strong>CIAP2:</strong>
</td>
<td>
{{ $ciap2 }}
</td>
</tr>
<tr>
<td>
<strong>CID10:</strong>
</td>
<td>
{{ $cid }}
</td>
</tr>
<tr>
<td>
<strong>Gestante:</strong>
</td>
<td>
{{ $gestante }}
</td>
</tr>
<tr>
<td>
<strong>Diabético:</strong>
</td>
<td>
{{ $diabetico }}
</td>
</tr>
<tr>
<td>
<strong>Vacina em dia:</strong>
</td>
<td>
{{ $vacinaEmDia }}
</td>
</tr>
<tr>
<td>
<strong>Aleitamento materno:</strong>
</td>
<td>
{{ $aleitamentoMaterno }}
</td>
</tr>
</table>
<table>
<thead>
<tr>
<td style="text-align: center" colspan="6">
TOTAIS
</td>
</tr>
<tr>
<th><strong>Registro(s)</strong></th>
<th><strong>Unidade(s)</strong></th>
<th><strong>Profissional(s)</strong></th>
<th><strong>Local(s) de atendimento</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $totalizadores['registros'] }}</td>
<td>{{ $totalizadores['unidades'] }}</td>
<td>{{ $totalizadores['profissionais'] }}</td>
<td>{{ $totalizadores['locaisAtendimento'] }}</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
@foreach ($colunas as $coluna)
<th>
<strong>{{ $coluna['label'] }}</strong>
</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($items as $item)
<tr>
@foreach ($colunas as $coluna)
<td>
@if ($coluna['key'] == 'condicao_avaliada')
{{ $item->condicaoAvaliada ?? '-' }}
@else
{{ $item->{$coluna['key']} ?? '-' }}
@endif
</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>

View File

@@ -0,0 +1,385 @@
<table>
<tr>
<td style="text-align: center" colspan="{{ count($params['selected_columns']) }}">
RELATÓRIO ESTATÍSTICO DE PACIENTES CADASTRADOS
</td>
</tr>
<tr>
<td colspan="{{ count($params['selected_columns']) }}">
Os paciente com saída do cadastro por motivo de óbito ou mudança de território não serão exibidos.
</td>
</tr>
<tr>
<td style="text-align: left" colspan="{{ count($params['selected_columns']) }}">
<strong>EQUIPE</strong>
</td>
</tr>
<tr>
<td>
<strong>Unidade:</strong>
</td>
<td>
<strong>Local de atendimento:</strong>
</td>
<td>
<strong>Local do domicílio:</strong>
</td>
</tr>
<tr>
<td>
{{ $params['unidade_label'] }}
</td>
<td>
{{ $params['local_atendimento_label'] }}
</td>
<td>
{{ $params['local_domicilio_label'] }}
</td>
</tr>
<tr>
<td>
<strong>Área da equipe</strong>
</td>
<td>
<strong>Micro área</strong>
</td>
<td>
<strong>Profissional</strong>
</td>
</tr>
<tr>
<td>
{{ $params['area_equipe_label'] }}
</td>
<td>
{{ $params['micro_area_label'] }}
</td>
<td class="col-4">
{{ $params['profissional_label'] }}
</td>
</tr>
<tr>
<td style="text-align: left" colspan="{{ count($params['selected_columns']) }}">
<strong>PACIENTE</strong>
</td>
</tr>
<tr>
<td>
<strong>Classificação:</strong>
</td>
<td>
<strong>Anos de:</strong>
</td>
<td>
<strong>Meses de:</strong>
</td>
<td>
<strong>Dias de:</strong>
</td>
<td>
<strong>Anos até:</strong>
</td>
<td>
<strong>Meses até:</strong>
</td>
<td>
<strong>Dias até:</strong>
</td>
<td>
<strong>Paciente:</strong>
</td>
</tr>
<tr>
<td>
{{ $params['classificacao_paciente_label'] }}
</td>
<td>
{{ $params['anos_de_label'] }}
</td>
<td>
{{ $params['meses_de_label'] }}
</td>
<td>
{{ $params['dias_de_label'] }}
</td>
<td>
{{ $params['anos_ate_label'] }}
</td>
<td>
{{ $params['meses_ate_label'] }}
</td>
<td>
{{ $params['dias_ate_label'] }}
</td>
<td>
{{ $params['paciente_label'] }}
</td>
</tr>
<tr>
<td style="text-align: left" colspan="{{ count($params['selected_columns']) }}">
<strong>CONDICIONALIDADES</strong>
</td>
</tr>
<tr>
<td>
<strong>Sexo:</strong>
</td>
<td>
<strong>Peso:</strong>
</td>
<td>
<strong>Gestante:</strong>
</td>
<td>
<strong>Hipertenso:</strong>
</td>
<td>
<strong>Diabético:</strong>
</td>
<td>
<strong>Hanseniase:</strong>
</td>
<td>
<strong>Tuberculose:</strong>
</td>
<td>
<strong>Fumante:</strong>
</td>
<td>
<strong>Alcool:</strong>
</td>
<td>
<strong>Drogas:</strong>
</td>
<td>
<strong>Tea:</strong>
</td>
</tr>
<tr>
<td>
{{ $params['condicionalidades_label']['sexo_label'] }}
</td>
<td>
{{ $params['condicionalidades_label']['peso_label'] }}
</td>
<td>
{{ $params['condicionalidades_label']['gestante_label'] }}
</td>
<td>
{{ $params['condicionalidades_label']['hipertenso_label'] }}
</td>
<td>
{{ $params['condicionalidades_label']['diabetico_label'] }}
</td>
<td>
{{ $params['condicionalidades_label']['hanseniase_label'] }}
</td>
<td>
{{ $params['condicionalidades_label']['tuberculose_label'] }}
</td>
<td>
{{ $params['condicionalidades_label']['fumante_label'] }}
</td>
<td class="col-1">
{{ $params['condicionalidades_label']['alcool_label'] }}
</td>
<td>
{{ $params['condicionalidades_label']['drogas_label'] }}
</td>
<td>
{{ $params['condicionalidades_label']['tea_label'] }}
</td>
</tr>
<tr>
<td style="text-align: left" colspan="{{ count($params['selected_columns']) }}">
<strong>OUTRAS DOENÇAS/TRATAMENTOS</strong>
</td>
</tr>
<tr>
<td>
<strong>Avc/Derrame:</strong>
</td>
<td>
<strong>Infarto:</strong>
</td>
<td>
<strong>Cancer:</strong>
</td>
<td>
<strong>Fibromialgia:</strong>
</td>
<td>
<strong>Internação:</strong>
</td>
<td class="col-1">
<strong>Doença cardíaca:</strong>
</td>
</tr>
<tr>
<td>
{{ $params['outras_doencas_label']['avc_label'] }}
</td>
<td>
{{ $params['outras_doencas_label']['infarto_label'] }}
</td>
<td>
{{ $params['outras_doencas_label']['cancer_label'] }}
</td>
<td class="col-1">
{{ $params['outras_doencas_label']['fibromialgia_label'] }}
</td>
<td>
{{ $params['outras_doencas_label']['internacao_label'] }}
</td>
<td class="col-1">
{{ $params['outras_doencas_label']['doenca_cardiaca_label'] }}
</td>
</tr>
<tr>
<td>
<strong>Doença renal:</strong>
</td>
<td>
<strong>Doença respiratória:</strong>
</td>
<td>
<strong>Tratamento psiquiátrico:</strong>
</td>
<td>
<strong>Plantas medicinais:</strong>
</td>
<td>
<strong>Práticas integrativas:</strong>
</td>
</tr>
<tr>
<td>
{{ $params['outras_doencas_label']['doenca_renal_label'] }}
</td>
<td>
{{ $params['outras_doencas_label']['doenca_respiratoria_label'] }}
</td>
<td>
{{ $params['outras_doencas_label']['tratamento_psicologico_label'] }}
</td>
<td>
{{ $params['outras_doencas_label']['plantas_medicinais_label'] }}
</td>
<td>
{{ $params['outras_doencas_label']['plantas_medicinais_label'] }}
</td>
<td>
{{ $params['outras_doencas_label']['praticas_integrativas_label'] }}
</td>
</tr>
<tr>
<td style="text-align: left" colspan="{{ count($params['selected_columns']) }}">
<strong>ATENÇÃO DOMICILIAR</strong>
</td>
</tr>
<tr>
<td>
<strong>Acamado:</strong>
</td>
<td>
<strong>Domiciliado:</strong>
</td>
</tr>
<tr>
<td>
{{ $params['atencao_domiciliar_label']['acamado_label'] }}
</td>
<td>
{{ $params['atencao_domiciliar_label']['domiciliado_label'] }}
</td>
</tr>
</table>
<table class="table">
<thead>
<tr>
@foreach($params['selected_columns'] as $coluna)
@if ($coluna['key'] !== 'todas')
<th>{{ $coluna['label'] }}</th>
@endif
@endforeach
</tr>
</thead>
<tbody>
@foreach ($relatorio['relatorio'] as $registros)
<tr>
@foreach($params['selected_columns'] as $coluna)
@if ($coluna['key'] !== 'todas')
<td>{{ $registros->{$coluna['key']} ?? '' }}</td>
@endif
@endforeach
</tr>
@endforeach
</tbody>
<br>
<tr>
<td>
<strong>
TOTALIZADORES:
</strong>
</td>
</tr>
<br>
<tr>
<td>
<strong>Total de pacientes:</strong> {{ $relatorio['total_pacientes'] }}<br>
</td>
</tr>
<tr>
<td>
<strong>Total de famílias:</strong> {{ $relatorio['total_familias'] }}<br>
</td>
</tr>
<tr>
<td>
<strong>Total por sexo:</strong>
</td>
@foreach ($relatorio['total_pacientes_por_sexo'] as $sexo => $total)
<td class="me-3">{{ ucfirst($sexo) }}: {{ $total }}</td>
@endforeach
</tr>
<tr>
<td>
<strong>Total por área:</strong>
</td>
@foreach ($relatorio['total_pacientes_por_area'] as $area => $total)
<td class="me-3">{{ ucfirst($area) }}: {{ $total }}</td>
@endforeach
</tr>
<tr>
<td>
<strong>Total por micro área:</strong>
</td>
@foreach ($relatorio['total_pacientes_por_micro_area'] as $micro => $total)
<td class="me-3">{{ ucfirst($micro) }}: {{ $total }}</td>
@endforeach
</tr>
</table>