This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia\Livro;
|
||||
|
||||
use App\Enums\Cadastro\Material\LivroRegistro;
|
||||
use App\Enums\Cadastro\Material\LivroRegistroTipo;
|
||||
use App\Enums\Farmacia\LivroStatus;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Cadastro\Estabelecimento\CentroCusto;
|
||||
use App\Models\Farmacia\Livro;
|
||||
use App\Models\Intranet\Cliente;
|
||||
use App\Services\Farmacia\LivroService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class LivroController extends Controller
|
||||
{
|
||||
private static $TITLE = 'LIVRO DE ';
|
||||
private const TEMPLATE = 'farmacia.livro.livro';
|
||||
|
||||
public static function getTemplate($livro)
|
||||
{
|
||||
$municipio = Cliente::where('link', app('config')->get('database.default'))->first()->municipio->nome;
|
||||
$infraestruturaLogada = CentroCusto::findOrFail(auth()->payload()->get('centro_custo_id'))->infraestrutura;
|
||||
|
||||
$isTalidomida = $livro->livro_registro_id == LivroRegistro::TALIDOMIDA;
|
||||
|
||||
return [
|
||||
'isLivroTalidomida' => $isTalidomida,
|
||||
'isLivroTalidomidaABase' => $isTalidomida
|
||||
&& $livro->livro_registro_tipo_id == LivroRegistroTipo::A_BASE,
|
||||
'isLivroTalidomidaEspecifico' => $isTalidomida
|
||||
&& $livro->livro_registro_tipo_id == LivroRegistroTipo::ESPECIFICO,
|
||||
'numero' => $livro->numero,
|
||||
'abertoEm' => $livro->aberto_em->format('d/m/Y'),
|
||||
'livroRegistro' => $livro->livroRegistro->nome,
|
||||
'livroRegistroTipo' => $livro->livroRegistroTipo->nome ?? null,
|
||||
'quantidadePaginas' => $livro->quantidade_paginas,
|
||||
'registro' => $livro->registro,
|
||||
'firma' => "PREFEITURA MUNICIPAL DE {$municipio}",
|
||||
'farmacia' => $infraestruturaLogada->nome,
|
||||
'usuarioFarmaceutico' => $livro->usuarioFarmaceutico->cidadao->nome,
|
||||
'endereco' => $infraestruturaLogada->endereco->completo,
|
||||
'inscricaoEstadual' => $livro->inscricao_estadual,
|
||||
'autoridadeSanitaria' => $livro->autoridade_sanitaria,
|
||||
'paginas' => LivroService::getLivroCompletoImpressao($livro->id),
|
||||
];
|
||||
}
|
||||
|
||||
public function __invoke($id)
|
||||
{
|
||||
$livro = Livro::findOrFail($id);
|
||||
|
||||
if ($livro->livro_registro_id == LivroRegistro::TALIDOMIDA) {
|
||||
|
||||
self::$TITLE .= 'TALIDOMIDA';
|
||||
}
|
||||
else {
|
||||
|
||||
self::$TITLE .= 'PSICOTRÓPICOS';
|
||||
}
|
||||
|
||||
if ($livro->status_id === LivroStatus::ABERTO) {
|
||||
|
||||
self::$TITLE .= ' - PARCIAL';
|
||||
}
|
||||
|
||||
return Pdf1::generate(self::$TITLE, self::TEMPLATE, self::getTemplate($livro), 'landscape');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia\Livro;
|
||||
|
||||
use App\Enums\Cadastro\Material\LivroRegistro;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Cadastro\Estabelecimento\CentroCusto;
|
||||
use App\Models\Farmacia\Livro;
|
||||
use App\Models\Intranet\Cliente;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class TermoFechamentoController extends Controller
|
||||
{
|
||||
private const TITLE = 'TERMO DE FECHAMENTO';
|
||||
private const TEMPLATE = 'farmacia.livro.termo-fechamento';
|
||||
|
||||
public static function getTemplate($livroId)
|
||||
{
|
||||
$livro = Livro::findOrFail($livroId);
|
||||
$municipio = Cliente::where('link', app('config')->get('database.default'))->first()->municipio->nome;
|
||||
$infraestruturaLogada = CentroCusto::findOrFail(auth()->payload()->get('centro_custo_id'))->infraestrutura;
|
||||
|
||||
return [
|
||||
'isLivroTalidomida' => $livro->livro_registro_id == LivroRegistro::TALIDOMIDA,
|
||||
'numero' => $livro->numero,
|
||||
'fechadoEm' => $livro->fechado_em->format('d/m/Y'),
|
||||
'livroRegistro' => $livro->livroRegistro->nome,
|
||||
'livroRegistroTipo' => $livro->livroRegistroTipo->nome ?? null,
|
||||
'quantidadePaginas' => $livro->quantidade_paginas,
|
||||
'registro' => $livro->registro,
|
||||
'firma' => "PREFEITURA MUNICIPAL DE {$municipio}",
|
||||
'farmacia' => $infraestruturaLogada->nome,
|
||||
'usuarioFarmaceutico' => $livro->usuarioFarmaceutico->cidadao->nome,
|
||||
'endereco' => $infraestruturaLogada->endereco->completo,
|
||||
'inscricaoEstadual' => $livro->inscricao_estadual,
|
||||
'autoridadeSanitaria' => $livro->autoridade_sanitaria,
|
||||
];
|
||||
}
|
||||
|
||||
public function __invoke($livroId)
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate($livroId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Enums\Cadastro\SujeitoAtencao\PreferenciaNome;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Almoxarifado\SaidaItem;
|
||||
use App\Services\Farmacia\ReceitaService;
|
||||
use App\Utils\Exports\Pdf;
|
||||
use App\Utils\Exports\Template;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class ReceitaController extends Controller
|
||||
{
|
||||
private const TITLE_1 = 'RECIBO DE MEDICAMENTO';
|
||||
private const TITLE_2 = 'RECIBO DE ENTREGA REMÉDIO EM CASA';
|
||||
private const TEMPLATE_1 = 'farmacia.receita';
|
||||
private const TEMPLATE_2 = 'farmacia.receita-remedio-em-casa';
|
||||
private static $title = self::TITLE_1;
|
||||
private static $template = self::TEMPLATE_1;
|
||||
|
||||
public static function getTemplate($receitaId)
|
||||
{
|
||||
$params = request()->all();
|
||||
|
||||
$items = collect([]);
|
||||
|
||||
foreach(($params['items'] ?? []) as $item) {
|
||||
|
||||
if (is_numeric($item['id'])) {
|
||||
|
||||
$items->push($item);
|
||||
}
|
||||
}
|
||||
|
||||
$receita = ReceitaService::getReceitaDispensada($receitaId, $items);
|
||||
|
||||
$receita->data_nascimento_paciente =
|
||||
(new Carbon($receita->data_nascimento_paciente))->format('d/m/Y');
|
||||
|
||||
$receita->data_reimpressao = Carbon::now()->format('d/m/Y');
|
||||
|
||||
$receita->itens->map(function ($item) {
|
||||
|
||||
$item->vencimento_receita = $item->proxima_retirada
|
||||
? ReceitaService::getVencimentoReceita($item)->format('d/m/Y')
|
||||
: null;
|
||||
|
||||
$item->proxima_retirada = $item->proxima_retirada
|
||||
? (new Carbon($item->proxima_retirada))->format('d/m/Y')
|
||||
: null;
|
||||
|
||||
$lotes = collect();
|
||||
|
||||
SaidaItem::findOrFail($item->saida_item_id)->entradaItens
|
||||
->each(function ($entradaItem) use ($lotes) {
|
||||
|
||||
if ($entradaItem->lote != null) {
|
||||
|
||||
$lotes->push("{$entradaItem->lote} ({$entradaItem->validade_lote->format('d/m/Y')})");
|
||||
}
|
||||
});
|
||||
|
||||
$item->lotes = $lotes->all();
|
||||
});
|
||||
|
||||
if ($receita->is_remedio_em_casa) {
|
||||
|
||||
self::$title = self::TITLE_2;
|
||||
self::$template = self::TEMPLATE_2;
|
||||
|
||||
} else {
|
||||
|
||||
$dispensadoEm = Carbon::createFromFormat('d/m/Y H:i', $receita->dispensado_em);
|
||||
$receita->dispensado_em = $dispensadoEm->format('d/m/Y');
|
||||
$receita->hora_atendimento = $dispensadoEm->format('H:i');
|
||||
}
|
||||
|
||||
$data = [
|
||||
'receita' => $receita,
|
||||
'paciente' => [
|
||||
'nome' => $receita->nome_paciente,
|
||||
'nomeSocial' => $receita->nome_social_paciente,
|
||||
'prefereNomeSocial' => $receita->preferencia_nome_id === PreferenciaNome::NOME_SOCIAL
|
||||
]
|
||||
];
|
||||
|
||||
return Template::make(self::$title, self::$template)->withData($data)->getHtml();
|
||||
}
|
||||
|
||||
public function __invoke($receitaId)
|
||||
{
|
||||
return (new Pdf)->stream(self::getTemplate($receitaId), self::$title);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Farmacia\Receita;
|
||||
use App\Services\Farmacia\ReceitaService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
use App\Utils\MaskUtil;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ReceitaRemedioEmCasaController extends Controller
|
||||
{
|
||||
private const TITLE = 'RECIBO DE ENTREGA REMÉDIO EM CASA';
|
||||
private const TEMPLATE = 'farmacia.receita-remedio-em-casa';
|
||||
|
||||
public function __invoke($receitaId)
|
||||
{
|
||||
$receita = Receita::findOrFail($receitaId);
|
||||
|
||||
$entregas = collect();
|
||||
|
||||
$receita->itens->each(function ($item) use ($entregas) {
|
||||
|
||||
$saldo = $item->entregas()
|
||||
->where('pendente', true)
|
||||
->first(['quantidade'])
|
||||
->quantidade ?? 0;
|
||||
|
||||
$item->entregas()
|
||||
->where('pendente', false)
|
||||
->where('estornado', false)
|
||||
->get()
|
||||
->map(function ($entrega) use ($item, $saldo, $entregas) {
|
||||
|
||||
$entregas->push((object) [
|
||||
'data_hora_dispensacao' => new Carbon($entrega->dispensado_em),
|
||||
'material' => $item->material->descricao_completa,
|
||||
'lotes' => $entrega->saidaItem->entradaItens->map(fn ($entradaItem) => (object) [
|
||||
'lote' => $entradaItem->lote,
|
||||
'validade' => is_null($entradaItem->validade_lote)
|
||||
? null
|
||||
: $entradaItem->validade_lote->format('d/m/Y'),
|
||||
]),
|
||||
'posologia' => $item->posologia,
|
||||
'quantidade_entregue' => $entrega->saidaItem->quantidade,
|
||||
'validade_receita' => is_null($item->proxima_retirada)
|
||||
? null
|
||||
: ReceitaService::getVencimentoReceita((object) [
|
||||
'proxima_retirada' => $item->proxima_retirada->format('Y-m-d'),
|
||||
'saldo' => $saldo,
|
||||
'prescrito' => $item->prescrito,
|
||||
'intervalo_medida_tempo_id' => $item->intervalo_medida_tempo_id,
|
||||
'durante_tempo' => $item->durante_tempo,
|
||||
])->format('d/m/Y'),
|
||||
'data_proxima_entrega' => is_null($item->proxima_retirada)
|
||||
? null
|
||||
: $item->proxima_retirada->format('d/m/Y'),
|
||||
'observacao' => $item->observacao,
|
||||
'operador' => $item->createdLotacao->usuario->cidadao->nome,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
$entregas = $entregas->sortBy([
|
||||
['data_hora_dispensacao', 'desc'],
|
||||
['descricao', 'asc'],
|
||||
])->values();
|
||||
|
||||
$entregas->each(function ($entrega) {
|
||||
|
||||
$entrega->data_hora_dispensacao = $entrega->data_hora_dispensacao->format('d/m/Y H:i');
|
||||
});
|
||||
|
||||
$telefonesPaciente = collect();
|
||||
|
||||
if (!is_null($receita->paciente->cidadao->telefone_principal)) {
|
||||
|
||||
$telefonesPaciente->push(MaskUtil::getPhoneMasked($receita->paciente->cidadao->telefone_principal->numero));
|
||||
}
|
||||
|
||||
$receita->paciente->cidadao->telefones()
|
||||
->where('principal', false)
|
||||
->limit($telefonesPaciente->isEmpty() ? 3 : 2)
|
||||
->get()
|
||||
->each(fn ($t) => $telefonesPaciente->push(MaskUtil::getPhoneMasked($t->numero)));
|
||||
|
||||
$data = [
|
||||
'estabelecimento' => [
|
||||
'unidade' => $receita->createdCentroCusto->infraestrutura->unidade->nome_fantasia,
|
||||
'infraestrutura' => $receita->createdCentroCusto->infraestrutura->nome,
|
||||
'endereco' => "{$receita->createdCentroCusto->infraestrutura->endereco->completo} - "
|
||||
. MaskUtil::getCepMasked($receita->createdCentroCusto->infraestrutura->endereco->logradouro->cep),
|
||||
'telefone' => MaskUtil::getPhoneMasked($receita->createdCentroCusto->infraestrutura->telefone),
|
||||
],
|
||||
'paciente' => [
|
||||
'nome' => $receita->paciente->cidadao->nome,
|
||||
'nome_social' => $receita->paciente->cidadao->nome_social,
|
||||
'data_nascimento' => is_null($receita->paciente->cidadao->data_nascimento)
|
||||
? null
|
||||
: (new Carbon($receita->paciente->cidadao->data_nascimento))->format('d/m/Y'),
|
||||
'prontuario' => $receita->paciente->prontuario,
|
||||
'cns' => MaskUtil::getCnsMasked($receita->paciente->cidadao->cns),
|
||||
'endereco' => is_null($receita->paciente->cidadao->domicilio)
|
||||
? null
|
||||
: Str::upper("{$receita->paciente->cidadao->domicilio->endereco->completo} - "
|
||||
. MaskUtil::getCepMasked($receita->paciente->cidadao->domicilio->endereco->logradouro->cep)),
|
||||
'unidade_referencia' => $receita->paciente->unidade->nome_fantasia ?? null,
|
||||
'telefones' => $telefonesPaciente,
|
||||
],
|
||||
'receita' => [
|
||||
'entregas' => $entregas,
|
||||
'observacao' => $receita->observacao,
|
||||
],
|
||||
];
|
||||
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, $data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioAltoCustoDispensacaoService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioAltoCustoDispensacaoController extends Controller
|
||||
{
|
||||
private const TITLE = 'ALTO CUSTO - RELATÓRIO DE DISPENSAÇÃO';
|
||||
private const TEMPLATE = 'farmacia.relatorio-alto-custo-dispensacao';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioAltoCustoDispensacaoService::getPrintData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioAltoCustoEstatisticoCidService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioAltoCustoEstatisticoCidController extends Controller
|
||||
{
|
||||
private const TITLE = 'ALTO CUSTO - RELATÓRIO ESTATÍSTICO DE CID';
|
||||
private const TEMPLATE = 'farmacia.relatorio-alto-custo-estatistico-cid';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioAltoCustoEstatisticoCidService::getPrintExportData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioAltoCustoProcessoService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioAltoCustoProcessoController extends Controller
|
||||
{
|
||||
private const TITLE = 'ALTO CUSTO - RELATÓRIO DE PROCESSO';
|
||||
private const TEMPLATE = 'farmacia.relatorio-alto-custo-processo';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioAltoCustoProcessoService::getPrintExportData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate(), 'landscape');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioAltoCustoProcessoPacienteService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioAltoCustoProcessoPacienteController extends Controller
|
||||
{
|
||||
private const TITLE = 'ALTO CUSTO - RELATÓRIO DE PROCESSO POR PACIENTE';
|
||||
private const TEMPLATE = 'farmacia.relatorio-alto-custo-processo-paciente';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioAltoCustoProcessoPacienteService::getPrintExportData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioAltoCustoRetiradaPendenteService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioAltoCustoRetiradaPendenteController extends Controller
|
||||
{
|
||||
private const TITLE = 'ALTO CUSTO - RELATÓRIO DE RETIRADA PENDENTE';
|
||||
private const TEMPLATE = 'farmacia.relatorio-alto-custo-retirada-pendente';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioAltoCustoRetiradaPendenteService::getPrintExportData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioAtendimentoDiarioService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioAtendimentoDiarioController extends Controller
|
||||
{
|
||||
private const TITLE = 'RELATÓRIO DE ATENDIMENTO DE DIÁRIO';
|
||||
private const TEMPLATE = 'farmacia.relatorio-atendimento-diario';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioAtendimentoDiarioService::getPrintData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioDispensacaoService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioDispensacaoController extends Controller
|
||||
{
|
||||
private const TITLE = 'RELATÓRIO DE DISPENSAÇÃO';
|
||||
private const TEMPLATE = 'farmacia.relatorio-dispensacao';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioDispensacaoService::getPrintExportData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioDispensacaoPacienteService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioDispensacaoPacienteController extends Controller
|
||||
{
|
||||
private const TITLE = 'RELATÓRIO DE DISPENSAÇÃO POR PACIENTE';
|
||||
private const TEMPLATE = 'farmacia.relatorio-dispensacao-paciente';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioDispensacaoPacienteService::getPrintData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\Cadastro\Material\Material;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Services\Farmacia\RelatorioDispensacaoRemedioCasaService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioDispensacaoRemedioCasaController extends Controller
|
||||
{
|
||||
private const TITLE = 'RELATÓRIO DE DISPENSAÇÃO - REMÉDIO EM CASA';
|
||||
private const TEMPLATE = 'farmacia.relatorio-dispensacao-remedio-casa';
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
$itens = RelatorioDispensacaoRemedioCasaService::index();
|
||||
$unidade = Unidade::find(request()->unidade_id);
|
||||
$infraestrutura = Infraestrutura::find(request()->infraestrutura_id);
|
||||
$material = Material::find(request()->material_id);
|
||||
$paciente = Paciente::find(request()->paciente_id);
|
||||
|
||||
$data = [
|
||||
'periodo' => [
|
||||
'inicio' => request()->periodo['start'],
|
||||
'fim' => request()->periodo['end'],
|
||||
],
|
||||
'unidade' => $unidade->nome_fantasia ?? 'Todas',
|
||||
'infraestrutura' => $infraestrutura->nome ?? 'Todas',
|
||||
'material' => $material->descricao ?? 'Todos',
|
||||
'paciente' => $paciente->nome ?? 'Todos',
|
||||
'data' => $itens,
|
||||
'columns' => collect(request()->get('selected_columns')),
|
||||
];
|
||||
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, $data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioEstornoDispensacaoService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioEstornoDispensacaoController extends Controller
|
||||
{
|
||||
private const TITLE = 'RELATÓRIO DE ESTORNO DE DISPENSAÇÃO';
|
||||
private const TEMPLATE = 'farmacia.relatorio-estorno-dispensacao';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioEstornoDispensacaoService::getPrintData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioMovimentacaoPsicotropicoService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioMovimentacaoPsicotropicoController extends Controller
|
||||
{
|
||||
private const TITLE = 'RELATÓRIO DE MOVIMENTAÇÃO DE PSICOTRÓPICO';
|
||||
private const TEMPLATE = 'farmacia.relatorio-movimentacao-psicotropico';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioMovimentacaoPsicotropicoService::getPrintExportData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioPacienteAtendidoService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioPacienteAtendidoController extends Controller
|
||||
{
|
||||
private const TITLE = 'RELATÓRIO DE PACIENTE ATENDIDO';
|
||||
private const TEMPLATE = 'farmacia.relatorio-paciente-atendido';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioPacienteAtendidoService::getPrintData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Impressao\Farmacia;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Farmacia\RelatorioQuantitativoDispensacaoService;
|
||||
use App\Utils\Exports\Pdf1;
|
||||
|
||||
class RelatorioQuantitativoDispensacaoController extends Controller
|
||||
{
|
||||
private const TITLE = 'RELATÓRIO DE DISPENSAÇÃO';
|
||||
private const TEMPLATE = 'farmacia.relatorio-quantitativo-dispensacao';
|
||||
|
||||
public static function getTemplate()
|
||||
{
|
||||
return RelatorioQuantitativoDispensacaoService::getPrintExportData();
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return Pdf1::generate(self::TITLE, self::TEMPLATE, self::getTemplate());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user