This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\AplicacaoCampanhaService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class AplicacaoCampanhaController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'aplicacao-campanha';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(AplicacaoCampanhaService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(AplicacaoCampanhaService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(AplicacaoCampanhaService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(AplicacaoCampanhaService::datatable())
|
||||
->filterColumn('imunizacao_campanha.periodo_de', function ($query, $keyword) {
|
||||
$query->whereRaw("DATE_FORMAT(imunizacao_campanha.periodo_de, '%d/%m/%Y') LIKE ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(imunizacao_campanha.periodo_de,9,2),
|
||||
SUBSTR(imunizacao_campanha.periodo_de,6,2),
|
||||
SUBSTR(imunizacao_campanha.periodo_de,1,4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->filterColumn('imunizacao_campanha.periodo_ate', function ($query, $keyword) {
|
||||
$query->whereRaw("DATE_FORMAT(imunizacao_campanha.periodo_ate, '%d/%m/%Y') LIKE ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(imunizacao_campanha.periodo_ate,9,2),
|
||||
SUBSTR(imunizacao_campanha.periodo_ate,6,2),
|
||||
SUBSTR(imunizacao_campanha.periodo_ate,1,4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(AplicacaoCampanhaService::list(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
55
api/app/Http/Controllers/Imunizacao/BaixaController.php
Normal file
55
api/app/Http/Controllers/Imunizacao/BaixaController.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\BaixaService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class BaixaController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'baixa';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(BaixaService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(BaixaService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(BaixaService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(BaixaService::datatable())
|
||||
->filterColumn('cadastro_infraestrutura.nome', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("COALESCE(cadastro_infraestrutura.nome, cadastro_unidade.nome_fantasia) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(BaixaService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function historico()
|
||||
{
|
||||
return response()->json(BaixaService::historico(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\CadastroCampanhaService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class CadastroCampanhaController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'cadastro-campanha';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(CadastroCampanhaService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CadastroCampanhaService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CadastroCampanhaService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CadastroCampanhaService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CadastroCampanhaService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CadastroCampanhaService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(CadastroCampanhaService::datatable())
|
||||
->filterColumn('imunizacao_campanha.periodo_de', function ($query, $keyword) {
|
||||
$query->whereRaw("DATE_FORMAT(imunizacao_campanha.periodo_de, '%d/%m/%Y') LIKE ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(imunizacao_campanha.periodo_de,9,2),
|
||||
SUBSTR(imunizacao_campanha.periodo_de,6,2),
|
||||
SUBSTR(imunizacao_campanha.periodo_de,1,4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->filterColumn('imunizacao_campanha.periodo_ate', function ($query, $keyword) {
|
||||
$query->whereRaw("DATE_FORMAT(imunizacao_campanha.periodo_ate, '%d/%m/%Y') LIKE ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(imunizacao_campanha.periodo_ate,9,2),
|
||||
SUBSTR(imunizacao_campanha.periodo_ate,6,2),
|
||||
SUBSTR(imunizacao_campanha.periodo_ate,1,4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
15
api/app/Http/Controllers/Imunizacao/ChamadaController.php
Normal file
15
api/app/Http/Controllers/Imunizacao/ChamadaController.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\ChamadaService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ChamadaController extends Controller
|
||||
{
|
||||
public function store()
|
||||
{
|
||||
return response()->json(ChamadaService::store(), Response::HTTP_CREATED);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\ConsultaEstoqueService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ConsultaEstoqueController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'consulta-estoque';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(ConsultaEstoqueService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(ConsultaEstoqueService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function getEstoque()
|
||||
{
|
||||
return response()->json(ConsultaEstoqueService::getEstoque(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function getUnidades()
|
||||
{
|
||||
return response()->json(ConsultaEstoqueService::getUnidades(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\DistribuicaoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class DistribuicaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'distribuicao';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(DistribuicaoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(DistribuicaoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
if ($request['tipo_movimentacao'] === 'estorno') {
|
||||
return $this->destroy($request);
|
||||
} else {
|
||||
return response()->json(DistribuicaoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(DistribuicaoService::destroy($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(DistribuicaoService::datatable())
|
||||
->filterColumn('imunizacao_entrada.data_entrada', function ($query, $keyword) {
|
||||
$query->whereRaw("DATE_FORMAT(imunizacao_entrada.data_entrada, '%d/%m/%Y') LIKE ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(imunizacao_entrada.data_entrada,9,2),
|
||||
SUBSTR(imunizacao_entrada.data_entrada,6,2),
|
||||
SUBSTR(imunizacao_entrada.data_entrada,1,4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->filterColumn('cadastro_infraestrutura_de.nome', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("COALESCE(cadastro_infraestrutura_de.nome, cadastro_unidade_de.nome_fantasia) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->filterColumn('cadastro_infraestrutura_para.nome', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("COALESCE(cadastro_infraestrutura_para.nome, cadastro_unidade_para.nome_fantasia) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(DistribuicaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
61
api/app/Http/Controllers/Imunizacao/EntradaController.php
Normal file
61
api/app/Http/Controllers/Imunizacao/EntradaController.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\EntradaService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class EntradaController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'entrada';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(EntradaService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(EntradaService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(EntradaService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(EntradaService::datatable())
|
||||
->filterColumn('imunizacao_entrada.data_entrada', function ($query, $keyword) {
|
||||
$query->whereRaw("DATE_FORMAT(imunizacao_entrada.data_entrada, '%d/%m/%Y') LIKE ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(imunizacao_entrada.data_entrada,9,2),
|
||||
SUBSTR(imunizacao_entrada.data_entrada,6,2),
|
||||
SUBSTR(imunizacao_entrada.data_entrada,1,4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->filterColumn('cadastro_infraestrutura.nome', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("COALESCE(cadastro_infraestrutura.nome, cadastro_unidade.nome_fantasia) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(EntradaService::list(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
58
api/app/Http/Controllers/Imunizacao/ExportacaoController.php
Normal file
58
api/app/Http/Controllers/Imunizacao/ExportacaoController.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\ExportacaoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ExportacaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'exportacao';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(ExportacaoService::datatable())
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(ExportacaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function download($id)
|
||||
{
|
||||
$response = ExportacaoService::download($id);
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'text/plain;charset=UTF-8',
|
||||
];
|
||||
|
||||
return response()->download($response['arquivo'], $response['nome'], $headers);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\FilaAtendimentoService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class FilaAtendimentoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'fila-atendimento';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FilaAtendimentoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function createEncaminhamento($filaId)
|
||||
{
|
||||
return response()->json(FilaAtendimentoService::createEncaminhamento($filaId), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FilaAtendimentoService::store(), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FilaAtendimentoService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FilaAtendimentoService::update($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(FilaAtendimentoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function listEncaminhamento()
|
||||
{
|
||||
return response()->json(FilaAtendimentoService::listEncaminhamento(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function autocompletePaciente()
|
||||
{
|
||||
return datatables()
|
||||
->of(FilaAtendimentoService::autocompletePaciente())
|
||||
->filterColumn('cadastro_cidadao.data_nascimento', function ($query, $keyword) {
|
||||
$query->whereRaw("DATE_FORMAT(cadastro_cidadao.data_nascimento, '%d/%m/%Y') like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->filterColumn('cadastro_paciente.prontuario', function ($query, $keyword) {
|
||||
$query->whereRaw("LPAD(cadastro_paciente.prontuario, 6, 0) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->toJson();
|
||||
}
|
||||
|
||||
public function evade($id)
|
||||
{
|
||||
FilaAtendimentoService::evade($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function forward($id)
|
||||
{
|
||||
FilaAtendimentoService::forward($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function sendBack($id)
|
||||
{
|
||||
FilaAtendimentoService::sendBack($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\ParametrizacaoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ParametrizacaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'parametrizacao';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ParametrizacaoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ParametrizacaoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(ParametrizacaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\RegistroVacinacaoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RegistroVacinacaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'registro-vacinacao';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(RegistroVacinacaoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RegistroVacinacaoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RegistroVacinacaoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RegistroVacinacaoService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RegistroVacinacaoService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RegistroVacinacaoService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(RegistroVacinacaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function getOcupacoes(Request $request)
|
||||
{
|
||||
return response()->json(RegistroVacinacaoService::getOcupacoes($request), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Services\Imunizacao\RelatorioConsolidadoAplicacaoService;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioConsolidadoAplicacaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'relatorio-consolidado-aplicacao';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(RelatorioConsolidadoAplicacaoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function getSalasVacinacao()
|
||||
{
|
||||
return response()->json(RelatorioConsolidadoAplicacaoService::getSalasVacinacao(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function getVacinas()
|
||||
{
|
||||
return response()->json(RelatorioConsolidadoAplicacaoService::getVacinas(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(RelatorioConsolidadoAplicacaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\RelatorioDeAplicacaoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioDeAplicacaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'relatorio-de-aplicacao';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(RelatorioDeAplicacaoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function search()
|
||||
{
|
||||
return response()->json(RelatorioDeAplicacaoService::search(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return RelatorioDeAplicacaoService::list();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Cadastro\VacinaService;
|
||||
use App\Services\Imunizacao\RelatorioFaltosoAprazamentoService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioFaltosoAprazamentoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'relatorio-faltoso-aprazamento';
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioFaltosoAprazamentoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(RelatorioFaltosoAprazamentoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function autocompleteVacina()
|
||||
{
|
||||
return datatables()
|
||||
->of(RelatorioFaltosoAprazamentoService::autocompleteVacina())
|
||||
->filterColumn('descricao', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw(VacinaService::getDescricaoRaw() . " like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\RelatorioPosicaoEstoqueService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioPosicaoEstoqueController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'relatorio-posicao-estoque';
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioPosicaoEstoqueService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return response()->json(RelatorioPosicaoEstoqueService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(RelatorioPosicaoEstoqueService::list(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
90
api/app/Http/Controllers/Imunizacao/RequisicaoController.php
Normal file
90
api/app/Http/Controllers/Imunizacao/RequisicaoController.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\RequisicaoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RequisicaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'requisicao';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(RequisicaoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RequisicaoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
if ($request['tipo_movimentacao'] === 'estorno') {
|
||||
return $this->destroy($request);
|
||||
} else {
|
||||
return response()->json(RequisicaoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RequisicaoService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RequisicaoService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RequisicaoService::destroy($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(RequisicaoService::datatable())
|
||||
->filterColumn('imunizacao_entrada.data_entrada', function ($query, $keyword) {
|
||||
$query->whereRaw("DATE_FORMAT(imunizacao_entrada.data_entrada, '%d/%m/%Y') LIKE ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(imunizacao_entrada.data_entrada,9,2),
|
||||
SUBSTR(imunizacao_entrada.data_entrada,6,2),
|
||||
SUBSTR(imunizacao_entrada.data_entrada,1,4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->filterColumn('cadastro_infraestrutura_de.nome', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("COALESCE(cadastro_infraestrutura_de.nome, cadastro_unidade_de.nome_fantasia) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->filterColumn('cadastro_infraestrutura_para.nome', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("COALESCE(cadastro_infraestrutura_para.nome, cadastro_unidade_para.nome_fantasia) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(RequisicaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\SalaVacinacaoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class SalaVacinacaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'sala-vacinacao';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SalaVacinacaoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SalaVacinacaoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SalaVacinacaoService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SalaVacinacaoService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(SalaVacinacaoService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(SalaVacinacaoService::datatable())
|
||||
->filterColumn('imunizacao_sala_vacinacao.responsavel', function ($query, $keyword) {
|
||||
$query->whereRaw("CASE WHEN imunizacao_sala_vacinacao.responsavel THEN 'Sim' ELSE 'Não' END LIKE ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->filterColumn('imunizacao_sala_vacinacao.permite_aplicacao', function ($query, $keyword) {
|
||||
$query->whereRaw("CASE WHEN imunizacao_sala_vacinacao.permite_aplicacao THEN 'Sim' ELSE 'Não' END LIKE ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->filterColumn('imunizacao_sala_vacinacao.cria_ficha_ab', function ($query, $keyword) {
|
||||
$query->whereRaw("CASE WHEN imunizacao_sala_vacinacao.cria_ficha_ab THEN 'Sim' ELSE 'Não' END LIKE ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->filterColumn('cadastro_infraestrutura.nome', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("COALESCE(cadastro_infraestrutura.nome, cadastro_unidade.nome_fantasia) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(SalaVacinacaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user