diff --git a/app/Http/Controllers/Dokter/DokterViewController.php b/app/Http/Controllers/Dokter/DokterViewController.php index acef75b..4d4fa90 100644 --- a/app/Http/Controllers/Dokter/DokterViewController.php +++ b/app/Http/Controllers/Dokter/DokterViewController.php @@ -7,16 +7,25 @@ use App\Http\Controllers\Controller; use App\Http\Controllers\Dokter\Partial\PartialController; use DB; +use Session; +use Redirect; class DokterViewController extends Controller { public function ViewDashboardDokter(Request $request) { - $getDataPD = PartialController::identitasPasien('pdnorec', $request->pdnorec); + $filter_identitas_pasien = (strlen($request->pdnorec) > 8) ? 'pdnorec' : 'nocm'; + $getDataPD = PartialController::identitasPasien($filter_identitas_pasien, $request->pdnorec); + + if(empty($getDataPD)){ + Session::flash('message', "Ops!, Data Tidak Ditemukan."); + return Redirect::back(); + } $dataReturn['pdnorec'] = $request->pdnorec; $dataReturn['pasien_identitas'] = $getDataPD[0]; + $dataReturn['type'] = $filter_identitas_pasien; $assets = ['chart', 'animation']; return view('dokter.dashboard-pasien')->with("data", $dataReturn); diff --git a/app/Http/Controllers/Dokter/EMR/CPPT/CpptController.php b/app/Http/Controllers/Dokter/EMR/CPPT/CpptController.php index 888c9f2..54eea2f 100644 --- a/app/Http/Controllers/Dokter/EMR/CPPT/CpptController.php +++ b/app/Http/Controllers/Dokter/EMR/CPPT/CpptController.php @@ -9,13 +9,21 @@ use App\Http\Controllers\Dokter\Partial\PartialController; use DB; use Auth; +use Session; +use Redirect; class CpptController extends Controller { public function viewSoapCPPT(Request $request) { - $getDataPD = PartialController::identitasPasien('pdnorec', $request->pdnorec); + $filter_identitas_pasien = (strlen($request->pdnorec) > 8) ? 'pdnorec' : 'nocm'; + $getDataPD = PartialController::identitasPasien($filter_identitas_pasien, $request->pdnorec); + + if(empty($getDataPD)){ + Session::flash('message', "Ops!, Data Tidak Ditemukan."); + return Redirect::back(); + } $dataHistoryCPPT = DB::connection('smart')->select(" select @@ -88,15 +96,21 @@ class CpptController extends Controller $dataReturn['pasien_identitas'] = $getDataPD[0]; $dataReturn['his_cppt'] = $dataHistoryCPPT; $dataReturn['his_resep'] = $dataHistoryResep; - $dataReturn['master_obat'] = $dataMasterObat; - + $dataReturn['master_obat'] = $dataMasterObat; + $dataReturn['type'] = $filter_identitas_pasien; + return view('dokter.emr.form.soap')->with("data", $dataReturn); } public function formSoapCPPT(Request $request) { - $getDataPD = PartialController::identitasPasien('pdnorec', $request->pdnorec); - + $filter_identitas_pasien = (strlen($request->pdnorec) > 8) ? 'pdnorec' : 'nocm'; + $getDataPD = PartialController::identitasPasien($filter_identitas_pasien, $request->pdnorec); + if(empty($getDataPD)){ + Session::flash('message', "Ops!, Data Tidak Ditemukan."); + return Redirect::back(); + } + if(isset($request->cpptnorec)){ $dataHistoryCPPT = DB::connection('smart')->select(" select @@ -137,34 +151,16 @@ class CpptController extends Controller $dataReturn['cpptnorec'] = (isset($request->cpptnorec) ? $request->cpptnorec : null); $dataReturn['pasien_identitas'] = $getDataPD[0]; $dataReturn['his_cppt'] = (isset($request->cpptnorec)) ? $dataHistoryCPPT[0] : []; + $dataReturn['type'] = $filter_identitas_pasien; return view('dokter.emr.form.soap-form')->with("data", $dataReturn); } public function simpanSoapCPPT(Request $request) - { - //dd($request->all()); - //dd(Auth::user()->smart_pk); - + { + $filter_identitas_pasien = (strlen($request->pdnorec) > 8) ? 'pdnorec' : 'nocm'; DB::connection('smart')->beginTransaction(); try { - $cppt_t = [ - 'norec' => $this->generateNorecSmartV1(), - 'kdprofile' => 0, - 'statusenabled' => 't', - 'tglinput' => date('Y-m-d H:i:s'), - 'isverifikasi' => true, - 'pasienfk' => $request->pasienfk, - 'pegawaifk' => 88, - 'noregistrasifk' => $request->noregistrasifk, - 'ruanganfk' => $request->ruanganfk, - 's' => $request->s, - 'o' => $request->o, - 'a' => $request->a, - 'p' => $request->p, - 'flag_' => 1, - ]; - DB::connection('smart')->table('cppt_t')->insert([ 'norec' => $this->generateNorecSmartV1(), 'kdprofile' => 0, @@ -172,7 +168,7 @@ class CpptController extends Controller 'tglinput' => date('Y-m-d H:i:s'), 'isverifikasi' => true, 'pasienfk' => $request->pasienfk, - 'pegawaifk' => 88, + 'pegawaifk' => Auth::user()->smart_pk, 'noregistrasifk' => $request->noregistrasifk, 'ruanganfk' => $request->ruanganfk, 's' => $request->s, @@ -183,7 +179,7 @@ class CpptController extends Controller ]); DB::connection('smart')->commit(); - return redirect()->route('dokter.emr.soap.view', ['pdnorec' => $request->pdnorec])->with('success','SOAP Berhasil Disimpan.'); + return redirect()->route('dokter.emr.soap.view', [$filter_identitas_pasien => $request->pdnorec])->with('success','SOAP Berhasil Disimpan.'); } catch (\Exception $e) { DB::connection('smart')->rollBack(); @@ -193,6 +189,7 @@ class CpptController extends Controller public function updateSoapCPPT(Request $request) { + $filter_identitas_pasien = (strlen($request->pdnorec) > 8) ? 'pdnorec' : 'nocm'; DB::connection('smart')->beginTransaction(); try { DB::connection('smart')->table('cppt_t')->where('norec', '=', $request->cpptnorec)->update([ @@ -203,7 +200,7 @@ class CpptController extends Controller ]); DB::connection('smart')->commit(); - return redirect()->route('dokter.emr.soap.view', ['pdnorec' => $request->pdnorec])->with('success','Edit SOAP Berhasil.'); + return redirect()->route('dokter.emr.soap.view', [$filter_identitas_pasien => $request->pdnorec])->with('success','Edit SOAP Berhasil.'); } catch (\Exception $e) { DB::connection('smart')->rollBack(); @@ -213,6 +210,7 @@ class CpptController extends Controller public function deleteSoapCPPT(Request $request) { + $filter_identitas_pasien = (strlen($request->pdnorec) > 8) ? 'pdnorec' : 'nocm'; DB::connection('smart')->beginTransaction(); try { DB::connection('smart')->table('cppt_t')->where('norec', '=', $request->cpptnorec)->update([ @@ -220,7 +218,7 @@ class CpptController extends Controller ]); DB::connection('smart')->commit(); - return redirect()->route('dokter.emr.soap.view', ['pdnorec' => $request->pdnorec])->with('success','Batal SOAP Berhasil.'); + return redirect()->route('dokter.emr.soap.view', [$filter_identitas_pasien => $request->pdnorec])->with('success','Batal SOAP Berhasil.'); } catch (\Exception $e) { DB::connection('smart')->rollBack(); diff --git a/app/Http/Controllers/Dokter/Order/PeresepanObatController.php b/app/Http/Controllers/Dokter/Order/PeresepanObatController.php index 68ce781..05e1a40 100644 --- a/app/Http/Controllers/Dokter/Order/PeresepanObatController.php +++ b/app/Http/Controllers/Dokter/Order/PeresepanObatController.php @@ -9,13 +9,24 @@ use App\Http\Controllers\Dokter\Partial\PartialController; use DB; use Auth; +use Session; +use Redirect; class PeresepanObatController extends Controller { public function viewPeresepanObat(Request $request) { - $getDataPD = PartialController::identitasPasien('pdnorec', $request->pdnorec); + $listNorecOrderan = []; + $returnData = []; + + $filter_identitas_pasien = (strlen($request->pdnorec) > 8) ? 'pdnorec' : 'nocm'; + $getDataPD = PartialController::identitasPasien($filter_identitas_pasien, $request->pdnorec); + + if(empty($getDataPD)){ + Session::flash('message', "Special message goes here"); + return Redirect::back(); + } $dataHistoryResep = DB::connection('smart')->select(" select t_resep_dokter.strukorderfk, @@ -42,8 +53,6 @@ class PeresepanObatController extends Controller ", array($getDataPD[0]->nocmfk)); if(!empty($dataHistoryResep)){ - $listNorecOrderan = []; - $returnData = []; foreach($dataHistoryResep as $key => $value){ array_push($listNorecOrderan, $value->strukorderfk); $dataRacikenke[$value->strukorderfk]['racikanke'][] = $value->racikanke; @@ -108,7 +117,8 @@ class PeresepanObatController extends Controller $dataReturn['pdnorec'] = $request->pdnorec; $dataReturn['pasien_identitas'] = $getDataPD[0]; $dataReturn['his_resep'] = $returnData; - $dataReturn['master_obat'] = $dataMasterObat; + $dataReturn['master_obat'] = $dataMasterObat; + $dataReturn['type'] = $filter_identitas_pasien; //dd($dataReturn); @@ -117,7 +127,12 @@ class PeresepanObatController extends Controller public function formPeresepanObat(Request $request) { - $getDataPD = PartialController::identitasPasien('pdnorec', $request->pdnorec); + $filter_identitas_pasien = (strlen($request->pdnorec) > 8) ? 'pdnorec' : 'nocm'; + $getDataPD = PartialController::identitasPasien($filter_identitas_pasien, $request->pdnorec); + if(empty($getDataPD)){ + Session::flash('message', "Ops!, Data Tidak Ditemukan."); + return Redirect::back(); + } $dataHistoryResep = DB::connection('smart')->select(" select @@ -158,7 +173,8 @@ class PeresepanObatController extends Controller $dataReturn['pdnorec'] = $request->pdnorec; $dataReturn['pasien_identitas'] = $getDataPD[0]; $dataReturn['his_resep'] = $dataHistoryResep; - $dataReturn['master_obat'] = $dataMasterObat; + $dataReturn['master_obat'] = $dataMasterObat; + $dataReturn['type'] = $filter_identitas_pasien; $assets = ['pro','select2']; return view('dokter.order.form.resep-form', compact('assets'))->with("data", $dataReturn); @@ -166,6 +182,7 @@ class PeresepanObatController extends Controller public function SimpanPeresepanObat(Request $request) { + $filter_identitas_pasien = (strlen($request->pdnorec) > 8) ? 'pdnorec' : 'nocm'; DB::connection('smart')->beginTransaction(); try { $now = date('Y-m-d H:i:s'); @@ -236,7 +253,7 @@ class PeresepanObatController extends Controller } DB::connection('smart')->commit(); - return redirect()->route('dokter.order.resep.view', ['pdnorec' => $request->pdnorec])->with('success','Resep Berhasil Disimpan.'); + return redirect()->route('dokter.order.resep.view', [$filter_identitas_pasien => $request->pdnorec])->with('success','Resep Berhasil Disimpan.'); } catch (\Exception $e) { DB::connection('smart')->rollBack(); diff --git a/app/Http/Controllers/Dokter/Partial/PartialController.php b/app/Http/Controllers/Dokter/Partial/PartialController.php index 06bf410..387d398 100644 --- a/app/Http/Controllers/Dokter/Partial/PartialController.php +++ b/app/Http/Controllers/Dokter/Partial/PartialController.php @@ -15,48 +15,67 @@ class PartialController extends Controller public static function identitasPasien($tipeFilter, $parameter) { - $getDataPD = DB::connection('smart')->select(" - select - pasiendaftar_t.norec as pd_norec, - pasien_m.id as nocmfk, - pasien_m.nocm, - pasien_m.namapasien, - jeniskelamin_m.jeniskelamin, - pasien_m.tgllahir, - DATE_PART('YEAR', AGE(NOW(), pasien_m.tgllahir)) as umur_as_year, - DATE_PART('MONTH', AGE(NOW(), pasien_m.tgllahir)) as umur_as_month, - DATE_PART('DAY', AGE(NOW(), pasien_m.tgllahir)) as umur_as_day, - pasiendaftar_t.noregistrasi, - pasiendaftar_t.tglregistrasi, - ruangan_m.id as id_ruangan, - ruangan_m.namaruangan, - pegawai_m.namalengkap, - kelompokpasien_m.kelompokpasien, - ( - select - antrianpasiendiperiksa_t.norec as apd_norec - from - antrianpasiendiperiksa_t - where - antrianpasiendiperiksa_t.noregistrasifk = pasiendaftar_t.norec - and antrianpasiendiperiksa_t.statusenabled is true - and antrianpasiendiperiksa_t.objectruanganfk = pasiendaftar_t.objectruanganlastfk - order by - antrianpasiendiperiksa_t.tglmasuk desc - limit 1 - - ) as apd_norec - from - pasiendaftar_t inner join - pasien_m on pasiendaftar_t.nocmfk = pasien_m.id inner join - jeniskelamin_m on pasien_m.objectjeniskelaminfk = jeniskelamin_m.id inner join - ruangan_m on pasiendaftar_t.objectruanganlastfk = ruangan_m.id inner join - pegawai_m on pasiendaftar_t.objectpegawaifk = pegawai_m.id inner join - kelompokpasien_m on pasiendaftar_t.objectkelompokpasienlastfk = kelompokpasien_m.id - where - pasiendaftar_t.norec = ? - ", array($parameter)); + if($tipeFilter === 'pdnorec'){ + $getDataPD = DB::connection('smart')->select(" + select + pasiendaftar_t.norec as pd_norec, + pasien_m.id as nocmfk, + pasien_m.nocm, + pasien_m.namapasien, + jeniskelamin_m.jeniskelamin, + pasien_m.tgllahir, + DATE_PART('YEAR', AGE(NOW(), pasien_m.tgllahir)) as umur_as_year, + DATE_PART('MONTH', AGE(NOW(), pasien_m.tgllahir)) as umur_as_month, + DATE_PART('DAY', AGE(NOW(), pasien_m.tgllahir)) as umur_as_day, + pasiendaftar_t.noregistrasi, + pasiendaftar_t.tglregistrasi, + ruangan_m.id as id_ruangan, + ruangan_m.namaruangan, + pegawai_m.namalengkap, + kelompokpasien_m.kelompokpasien, + ( + select + antrianpasiendiperiksa_t.norec as apd_norec + from + antrianpasiendiperiksa_t + where + antrianpasiendiperiksa_t.noregistrasifk = pasiendaftar_t.norec + and antrianpasiendiperiksa_t.statusenabled is true + and antrianpasiendiperiksa_t.objectruanganfk = pasiendaftar_t.objectruanganlastfk + order by + antrianpasiendiperiksa_t.tglmasuk desc + limit 1 + + ) as apd_norec + from + pasiendaftar_t inner join + pasien_m on pasiendaftar_t.nocmfk = pasien_m.id inner join + jeniskelamin_m on pasien_m.objectjeniskelaminfk = jeniskelamin_m.id inner join + ruangan_m on pasiendaftar_t.objectruanganlastfk = ruangan_m.id inner join + pegawai_m on pasiendaftar_t.objectpegawaifk = pegawai_m.id inner join + kelompokpasien_m on pasiendaftar_t.objectkelompokpasienlastfk = kelompokpasien_m.id + where + pasiendaftar_t.norec = ? + ", array($parameter)); + }elseif($tipeFilter === 'nocm'){ + $getDataPD = DB::connection('smart')->select(" + select + pasien_m.id as nocmfk, + pasien_m.nocm, + pasien_m.namapasien, + jeniskelamin_m.jeniskelamin, + pasien_m.tgllahir, + DATE_PART('YEAR', AGE(NOW(), pasien_m.tgllahir)) as umur_as_year, + DATE_PART('MONTH', AGE(NOW(), pasien_m.tgllahir)) as umur_as_month, + DATE_PART('DAY', AGE(NOW(), pasien_m.tgllahir)) as umur_as_day + from + pasien_m inner join + jeniskelamin_m on pasien_m.objectjeniskelaminfk = jeniskelamin_m.id + where + pasien_m.nocm = ? + ", array($parameter)); + } - return $getDataPD; + return (empty($getDataPD) ? [] : $getDataPD); } } diff --git a/app/Http/Controllers/Dokter/RiwayatPasienController.php b/app/Http/Controllers/Dokter/RiwayatPasienController.php new file mode 100644 index 0000000..8464dd7 --- /dev/null +++ b/app/Http/Controllers/Dokter/RiwayatPasienController.php @@ -0,0 +1,22 @@ +
-
+
- - + + @@ -37,49 +37,16 @@ -
-
-
-
No MR:No MR: {{ $data['pasien_identitas']->nocm }}
- - - - - - - - - - - - - - - - - - - - - - - - - -
No Registrasi:{{ $data['pasien_identitas']->noregistrasi }}
Poli Tujuan:{{ $data['pasien_identitas']->namaruangan }}
DPJP:{{ $data['pasien_identitas']->namalengkap }}
Tgl Layanan:{{ date('d-m-Y', strtotime( $data['pasien_identitas']->tglregistrasi )) }}
Jaminan:{{ $data['pasien_identitas']->kelompokpasien }}
-
-
-
diff --git a/resources/views/dokter/emr/form/soap.blade.php b/resources/views/dokter/emr/form/soap.blade.php index 6136cf1..f80af6d 100644 --- a/resources/views/dokter/emr/form/soap.blade.php +++ b/resources/views/dokter/emr/form/soap.blade.php @@ -1,13 +1,17 @@
-
+ @if($data['type'] == 'pdnorec') +
+ @elseif($data['type'] == 'nocm') +
+ @endif
- - + + @@ -37,13 +41,15 @@ + + @if($data['type'] == 'pdnorec')
No MR:No MR: {{ $data['pasien_identitas']->nocm }}
- - + + @@ -71,16 +77,17 @@ + @endif @@ -92,15 +99,17 @@
-

LIST SOAP PASIEN

+

{{ ($data['type'] == 'pdnorec') ? 'LIST SOAP PASIEN' : 'RIWAYAT SOAP PASIEN' }}

- @if(strtotime(date('d-m-Y', strtotime( $data['pasien_identitas']->tglregistrasi ))) == strtotime(date('d-m-Y')) ) - -
Tambah SOAP
-
- @else -
Tambah SOAP
+ @if($data['type'] == 'pdnorec') + @if(strtotime(date('d-m-Y', strtotime( $data['pasien_identitas']->tglregistrasi ))) == strtotime(date('d-m-Y')) ) + +
Tambah SOAP
+
+ @else +
Tambah SOAP
+ @endif @endif
@@ -127,28 +136,30 @@
- @foreach($data['his_cppt'] as $resultRow) - - - - - - - + + + + + + - - @endforeach + @endif + + + @endforeach + @else + + + + @endif +
No Registrasi.:No Registrasi.: {{ $data['pasien_identitas']->noregistrasi }}
{{ date('d-m-Y', strtotime( $resultRow->tglinput )) }} / {{ date('H:i', strtotime( $resultRow->tglinput)) }}{{ $resultRow->noregistrasi }}{{ $resultRow->namalengkap }}{{ $resultRow->namaruangan }}{{ $resultRow->keterangan }} - + @if(!empty($data['his_cppt'])) + @foreach($data['his_cppt'] as $resultRow) +
{{ date('d-m-Y', strtotime( $resultRow->tglinput )) }} / {{ date('H:i', strtotime( $resultRow->tglinput)) }}{{ $resultRow->noregistrasi }}{{ $resultRow->namalengkap }}{{ $resultRow->namaruangan }}{{ $resultRow->keterangan }} + - @if( Auth::user()->smart_pk == $resultRow->pegawaifk && strtotime(date('Y-m-d H:i:s')) <= strtotime(date('Y-m-d H:i:s', strtotime($resultRow->tglinput . ' +1 day'))) ) + @if( Auth::user()->smart_pk == $resultRow->pegawaifk && strtotime(date('Y-m-d H:i:s')) <= strtotime(date('Y-m-d H:i:s', strtotime($resultRow->tglinput . ' +1 day'))) ) + @if($data['type'] == 'pdnorec') Edit @@ -156,7 +167,9 @@ Hapus - @else + @endif + @else + @if($data['type'] == 'pdnorec') @@ -165,9 +178,18 @@ Hapus @endif -
+
~~~ Tidak Ada Riwayat SOAP ~~
+
diff --git a/resources/views/dokter/filter-histori-pasien.blade.php b/resources/views/dokter/filter-histori-pasien.blade.php new file mode 100644 index 0000000..8d8e5c4 --- /dev/null +++ b/resources/views/dokter/filter-histori-pasien.blade.php @@ -0,0 +1,33 @@ + +
+
+
+
+
+
+ @if (Session::has('message')) +
{{ Session::get('message') }}
+ @endif +
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/resources/views/dokter/order/form/resep.blade.php b/resources/views/dokter/order/form/resep.blade.php index 5d4d6e5..a992e24 100644 --- a/resources/views/dokter/order/form/resep.blade.php +++ b/resources/views/dokter/order/form/resep.blade.php @@ -1,13 +1,17 @@
-
+ @if($data['type'] == 'pdnorec') +
+ @elseif($data['type'] == 'nocm') +
+ @endif
- - + + @@ -37,13 +41,14 @@ + @if($data['type'] == 'pdnorec')
No MR:No MR: {{ $data['pasien_identitas']->nocm }}
- - + + @@ -71,16 +76,17 @@ + @endif @@ -91,15 +97,17 @@
-

Riwayat Peresepan Obat

+

{{ ($data['type'] == 'pdnorec') ? 'PERESEPAN OBAT' : 'RIWAYAT PERESEPAN OBAT' }}

- @if(strtotime(date('d-m-Y', strtotime( $data['pasien_identitas']->tglregistrasi ))) == strtotime(date('d-m-Y')) ) - -
Tambah Resep
-
- @else -
Tambah SOAP
+ @if($data['type'] == 'pdnorec') + @if(strtotime(date('d-m-Y', strtotime( $data['pasien_identitas']->tglregistrasi ))) == strtotime(date('d-m-Y')) ) + +
Tambah Resep
+
+ @else +
Tambah SOAP
+ @endif @endif
@@ -116,6 +124,7 @@
+ @if(!empty($data['his_resep'])) @foreach($data['his_resep'] as $resultRow) @@ -131,6 +140,13 @@ @endforeach + @else + + + + @endif
No Registrasi:No Registrasi: {{ $data['pasien_identitas']->noregistrasi }}
{{ date('d-m-Y', strtotime( $resultRow['tglorder'] )) }} / {{ date('H:i', strtotime( $resultRow['tglorder'])) }}
+
~~~ Tidak Ada Riwayat peresepan Obat ~~
+
diff --git a/resources/views/partials/dashboard/vertical-nav.blade.php b/resources/views/partials/dashboard/vertical-nav.blade.php index d3d6f0b..2c51097 100644 --- a/resources/views/partials/dashboard/vertical-nav.blade.php +++ b/resources/views/partials/dashboard/vertical-nav.blade.php @@ -7,6 +7,15 @@