425 lines
24 KiB
PHP
425 lines
24 KiB
PHP
@extends('impressoes.layout-receita.impressao', [
|
|
'paraAssinar' => !$exibirAssinatura,
|
|
'receita' => collect($receitas)->first() ?? []
|
|
])
|
|
|
|
@section('conteudo')
|
|
@foreach($receitas as $receita)
|
|
|
|
@php
|
|
$listaMedicamentosApresentados = [];
|
|
$temMedicamentoComRecomendacaoEmImpressaoNormal = false;
|
|
|
|
foreach ($receita['medicamentos'] as $medicamento) {
|
|
$conteudo = strip_tags($medicamento['recomendacoes']);
|
|
|
|
if(
|
|
!$medicamento["removerImpressao"] &&
|
|
!$medicamento['imprimirSeparado'] &&
|
|
($conteudo && strlen($conteudo) > 0)
|
|
) {
|
|
$temMedicamentoComRecomendacaoEmImpressaoNormal = true;
|
|
}
|
|
|
|
}
|
|
@endphp
|
|
|
|
@foreach($receita['medicamentos'] as $medicamento)
|
|
@if(!$medicamento["removerImpressao"] && !in_array($medicamento["nome"], $listaMedicamentosApresentados))
|
|
@if(!$medicamento['removerImpressao'] && $medicamento['imprimirSeparado'])
|
|
<div class="page">
|
|
|
|
<div class="row" style="padding-bottom: 2px">
|
|
|
|
<div class="cell col-5 font-small" style="padding-right:15px">
|
|
|
|
<div class="font-small border-bottom">
|
|
<strong>Medicamentos</strong>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="cell col-5 font-small" style="padding-left:15px">
|
|
|
|
<div class="font-small border-bottom">
|
|
<strong>Medicamentos</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@php $counter = 1; @endphp
|
|
@php
|
|
$linhaEndereco = strlen($receita['paciente']['endereco']) > 65 ? 1 : 0;
|
|
$linhaNome = strlen($receita['paciente']['nome']) > 70 ? 1 : 0;
|
|
$linhaUnidadeEndereco = strlen($receita['unidade']['endereco']) > 65 ? 1 : 0;
|
|
$linhaProfissionalNome = strlen($receita['profissional']['nome']) > 70 ? 1 : 0;
|
|
$totalLinhas = $linhaEndereco + $linhaNome + $linhaProfissionalNome+ $linhaUnidadeEndereco
|
|
@endphp
|
|
@php $primeiraFolha = true; @endphp
|
|
@php
|
|
$conteudo = strip_tags($medicamento['recomendacoes']);
|
|
$totalCaracteres = $conteudo ? strlen($conteudo) :1 ;
|
|
$linhas = ceil($totalCaracteres / 90);
|
|
$linhasMedicamentoNome = strlen($medicamento['nome']) > 72 ? 1 : 0;
|
|
$totalLinhas = $totalLinhas + $linhas + $linhasMedicamentoNome + 2;
|
|
@endphp
|
|
|
|
<div class="row">
|
|
|
|
<div class="cell col-5 font-small" style="padding-right:15px">
|
|
|
|
<div class="medicamento">
|
|
<table class="card">
|
|
<tbody>
|
|
|
|
@if($medicamento['usoContinuo'] || $medicamento['doseUnica'])
|
|
<tr class="card-top">
|
|
<td style="border-bottom: 1px solid #000; padding: 5px" >
|
|
<strong>{{ sprintf('%02d', $counter) }} - {{ $medicamento['nome'] }}</strong>
|
|
</td>
|
|
|
|
<td class="text-right" style="border-bottom: 1px solid #000;">
|
|
@if($medicamento['usoContinuo'])
|
|
uso contínuo
|
|
@elseif($medicamento['doseUnica'])
|
|
dose única
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@else
|
|
<tr class="card-top">
|
|
<td style="border-bottom: 1px solid #000; padding: 5px" colspan="2">
|
|
<strong>{{ sprintf('%02d', $counter) }} - {{ $medicamento['nome'] }}</strong>
|
|
</td>
|
|
</tr>
|
|
@endif
|
|
<tr class="card-middle">
|
|
<td style="padding-top: 5px;">
|
|
{{ $medicamento['posologia'] }}
|
|
@if($medicamento['duracao'])
|
|
durante
|
|
{{ $medicamento['duracao'] }}
|
|
{{ $medicamento['duracaoMedida'] }}
|
|
@endif
|
|
</td>
|
|
|
|
<td class="text-right" style="padding-top: 5px;">
|
|
<strong>Via: </strong>
|
|
{{ $medicamento['viaAdministracao'] }}
|
|
</td>
|
|
</tr>
|
|
<tr class="card-bottom">
|
|
<td colspan="2">
|
|
@if(!$medicamento['livre'])
|
|
<strong>Recomendações:</strong> {!! $medicamento['recomendacoes'] !!}
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="cell col-5 font-small" style="padding-left:15px">
|
|
|
|
<div class="medicamento">
|
|
<table class="card">
|
|
<tbody>
|
|
|
|
@if($medicamento['usoContinuo'] || $medicamento['doseUnica'])
|
|
<tr class="card-top">
|
|
<td style="border-bottom: 1px solid #000; padding: 5px" >
|
|
<strong>{{ sprintf('%02d', $counter) }} - {{ $medicamento['nome'] }}</strong>
|
|
</td>
|
|
|
|
<td class="text-right" style="border-bottom: 1px solid #000;">
|
|
@if($medicamento['usoContinuo'])
|
|
uso contínuo
|
|
@elseif($medicamento['doseUnica'])
|
|
dose única
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@else
|
|
<tr class="card-top">
|
|
<td style="border-bottom: 1px solid #000; padding: 5px" colspan="2">
|
|
<strong>{{ sprintf('%02d', $counter) }} - {{ $medicamento['nome'] }}</strong>
|
|
</td>
|
|
</tr>
|
|
@endif
|
|
<tr class="card-middle">
|
|
<td style="padding-top: 5px;">
|
|
{{ $medicamento['posologia'] }}
|
|
@if($medicamento['duracao'])
|
|
durante
|
|
{{ $medicamento['duracao'] }}
|
|
{{ $medicamento['duracaoMedida'] }}
|
|
@endif
|
|
</td>
|
|
|
|
<td class="text-right" style="padding-top: 5px;">
|
|
<strong>Via: </strong>
|
|
{{ $medicamento['viaAdministracao'] }}
|
|
</td>
|
|
</tr>
|
|
<tr class="card-bottom">
|
|
<td colspan="2">
|
|
@if(!$medicamento['livre'])
|
|
<strong>Recomendações:</strong> {!! $medicamento['recomendacoes'] !!}
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if ($primeiraFolha && $totalLinhas > 10 || !$primeiraFolha && $totalLinhas > 16 || $loop->last)
|
|
<div class="row">
|
|
|
|
<div class="cell col-5 font-small" style="padding-right:15px">
|
|
|
|
<div class="font-small mt-8px">
|
|
<div class="font-small mt-8px text-right">
|
|
{{ $_data['cliente']['municipio']['nome'] }} - {{ $_data['cliente']['municipio']['estado']['uf'] }}, {{ $receita['dataCadastro']['porExtenso'] }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="cell col-5 font-small" style="padding-left:15px">
|
|
|
|
<div class="font-small mt-8px">
|
|
<div class="font-small mt-8px text-right">
|
|
{{ $_data['cliente']['municipio']['nome'] }} - {{ $_data['cliente']['municipio']['estado']['uf'] }}, {{ $receita['dataCadastro']['porExtenso'] }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@php $totalLinhas = 0 @endphp
|
|
@php $primeiraFolha = false @endphp
|
|
@endif
|
|
|
|
@php $counter++ @endphp
|
|
</div>
|
|
@else
|
|
<div class="page">
|
|
|
|
<div class="row" style="padding-bottom: 2px">
|
|
|
|
<div class="cell col-5 font-small" style="padding-right:15px">
|
|
|
|
<div class="font-small border-bottom">
|
|
<strong>Medicamentos</strong>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="cell col-5 font-small" style="padding-left:15px">
|
|
|
|
<div class="font-small border-bottom">
|
|
<strong>Medicamentos</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@php $counter = 0; @endphp
|
|
@php
|
|
$linhaEndereco = strlen($receita['paciente']['endereco']) > 65 ? 1 : 0;
|
|
$linhaNome = strlen($receita['paciente']['nome']) > 70 ? 1 : 0;
|
|
$linhaUnidadeEndereco = strlen($receita['unidade']['endereco']) > 65 ? 1 : 0;
|
|
$linhaProfissionalNome = strlen($receita['profissional']['nome']) > 70 ? 1 : 0;
|
|
$totalLinhas = $linhaEndereco + $linhaNome + $linhaProfissionalNome+ $linhaUnidadeEndereco
|
|
@endphp
|
|
@php $primeiraFolha = true; @endphp
|
|
@foreach($receita['medicamentos'] as $medicamento)
|
|
@if(!$medicamento['removerImpressao'] && !$medicamento['imprimirSeparado'])
|
|
@php
|
|
$conteudo = strip_tags($medicamento['recomendacoes']);
|
|
$totalCaracteres = $conteudo ? strlen($conteudo) :1 ;
|
|
$linhas = ceil($totalCaracteres / 90);
|
|
$linhasMedicamentoNome = strlen($medicamento['nome']) > 72 ? 1 : 0;
|
|
$totalLinhas = $totalLinhas + $linhas + $linhasMedicamentoNome;
|
|
$medicamentosPorPagina = ($counter % 4 == 0);
|
|
@endphp
|
|
|
|
@if($medicamentosPorPagina && $counter > 0)
|
|
|
|
<div class="row" style="page-break-before: always; padding-bottom: 2px">
|
|
|
|
<div class="cell col-5 font-small" style="padding-right:15px">
|
|
|
|
<div class="font-small border-bottom mt-8px">
|
|
<strong>Medicamentos</strong>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="cell col-5 font-small" style="padding-left:15px">
|
|
|
|
<div class="font-small border-bottom mt-8px">
|
|
<strong>Medicamentos</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="row">
|
|
|
|
<div class="cell col-5 font-small" style="padding-right:15px">
|
|
|
|
<div class="medicamento">
|
|
<table class="card">
|
|
<tbody>
|
|
|
|
@if($medicamento['usoContinuo'] || $medicamento['doseUnica'])
|
|
<tr class="card-top">
|
|
<td style="border-bottom: 1px solid #000; padding: 5px" >
|
|
<strong>{{ sprintf('%02d', $counter + 1) }} - {{ $medicamento['nome'] }}</strong>
|
|
</td>
|
|
|
|
<td class="text-right" style="border-bottom: 1px solid #000;">
|
|
@if($medicamento['usoContinuo'])
|
|
uso contínuo
|
|
@elseif($medicamento['doseUnica'])
|
|
dose única
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@else
|
|
<tr class="card-top">
|
|
<td style="border-bottom: 1px solid #000; padding: 5px" colspan="2">
|
|
<strong>{{ sprintf('%02d', $counter + 1) }} - {{ $medicamento['nome'] }}</strong>
|
|
</td>
|
|
</tr>
|
|
@endif
|
|
<tr class="card-middle">
|
|
<td style="padding-top: 5px;">
|
|
{{ $medicamento['posologia'] }}
|
|
@if($medicamento['duracao'])
|
|
durante
|
|
{{ $medicamento['duracao'] }}
|
|
{{ $medicamento['duracaoMedida'] }}
|
|
@endif
|
|
</td>
|
|
|
|
<td class="text-right" style="padding-top: 5px;">
|
|
<strong>Via: </strong>
|
|
{{ $medicamento['viaAdministracao'] }}
|
|
</td>
|
|
</tr>
|
|
<tr class="card-bottom">
|
|
<td colspan="2">
|
|
@if(!$medicamento['livre'])
|
|
<strong>Recomendações:</strong> {!! $medicamento['recomendacoes'] !!}
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="cell col-5 font-small" style="padding-left:15px">
|
|
|
|
<div class="medicamento">
|
|
<table class="card">
|
|
<tbody>
|
|
|
|
@if($medicamento['usoContinuo'] || $medicamento['doseUnica'])
|
|
<tr class="card-top">
|
|
<td style="border-bottom: 1px solid #000; padding: 5px" >
|
|
<strong>{{ sprintf('%02d', $counter + 1) }} - {{ $medicamento['nome'] }}</strong>
|
|
</td>
|
|
|
|
<td class="text-right" style="border-bottom: 1px solid #000;">
|
|
@if($medicamento['usoContinuo'])
|
|
uso contínuo
|
|
@elseif($medicamento['doseUnica'])
|
|
dose única
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@else
|
|
<tr class="card-top">
|
|
<td style="border-bottom: 1px solid #000; padding: 5px" colspan="2">
|
|
<strong>{{ sprintf('%02d', $counter + 1) }} - {{ $medicamento['nome'] }}</strong>
|
|
</td>
|
|
</tr>
|
|
@endif
|
|
<tr class="card-middle">
|
|
<td style="padding-top: 5px;">
|
|
{{ $medicamento['posologia'] }}
|
|
@if($medicamento['duracao'])
|
|
durante
|
|
{{ $medicamento['duracao'] }}
|
|
{{ $medicamento['duracaoMedida'] }}
|
|
@endif
|
|
</td>
|
|
|
|
<td class="text-right" style="padding-top: 5px;">
|
|
<strong>Via: </strong>
|
|
{{ $medicamento['viaAdministracao'] }}
|
|
</td>
|
|
</tr>
|
|
<tr class="card-bottom">
|
|
<td colspan="2">
|
|
@if(!$medicamento['livre'])
|
|
<strong>Recomendações:</strong> {!! $medicamento['recomendacoes'] !!}
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@php
|
|
if ($primeiraFolha && $totalLinhas > 10 || !$primeiraFolha && $totalLinhas > 16 || $loop->last) {
|
|
$totalLinhas = 0;
|
|
$primeiraFolha = false;
|
|
}
|
|
|
|
$counter++;
|
|
$listaMedicamentosApresentados[] = $medicamento["nome"];
|
|
@endphp
|
|
@endif
|
|
@endforeach
|
|
|
|
</div>
|
|
@endif
|
|
@endif
|
|
@endforeach
|
|
@endforeach
|
|
|
|
<style>
|
|
.medicamento {
|
|
border: 1px solid #000;
|
|
border-radius: 5px;
|
|
margin-top: 3px;
|
|
font-size: 10px !important;
|
|
}
|
|
.card td {
|
|
padding: 0px 5px;
|
|
}
|
|
.card-top td { padding-top: 0px;}
|
|
.card-bottom td {
|
|
padding-bottom: 0px;
|
|
}
|
|
.mt-8px {
|
|
margin-top: 8px;
|
|
}
|
|
.mt-12px {
|
|
margin-top: 12px;
|
|
}
|
|
.fieldset {
|
|
padding: 0px 5px 2px !important;
|
|
}
|
|
.data {
|
|
height: 22px !important;
|
|
}
|
|
.manual-line {
|
|
height: 18px !important;
|
|
border-bottom: 1px solid #000000 !important;
|
|
}
|
|
</style>
|
|
@endsection |