From 35c03978a394965d8f9af97a05bfe71201dfa24e Mon Sep 17 00:00:00 2001 From: Dr Masroor Ehsan Date: Sat, 28 Dec 2024 23:34:04 +0600 Subject: [PATCH] wip --- .env.example | 4 +- app/Http/Controllers/PacsController.php | 11 ++--- app/Services/Pacs/PacsUrlGen.php | 35 ++++++++++++++ config/pacs.php | 13 ++++- resources/views/pacs/studies.blade.php | 64 ++++++++++++------------- 5 files changed, 86 insertions(+), 41 deletions(-) create mode 100644 app/Services/Pacs/PacsUrlGen.php diff --git a/.env.example b/.env.example index 2dd931d..3cd5c0b 100644 --- a/.env.example +++ b/.env.example @@ -65,6 +65,8 @@ AWS_USE_PATH_STYLE_ENDPOINT=false VITE_APP_NAME="${APP_NAME}" -PACS_API_ENDPOINT=http://27.147.241.214:8042/ +PACS_API_ENDPOINT=http://pacs.mylabctg.com:8042/ PACS_API_USERNAME= PACS_API_PASSWORD= +STONE_VIEWER_ENDPOINT=http://pacs.mylabctg.com:8042/ +OHIF_VIEWER_ENDPOINT=http://pacs.mylabctg.com:8042/ diff --git a/app/Http/Controllers/PacsController.php b/app/Http/Controllers/PacsController.php index 5088171..c3c1230 100644 --- a/app/Http/Controllers/PacsController.php +++ b/app/Http/Controllers/PacsController.php @@ -2,20 +2,17 @@ namespace App\Http\Controllers; +use App\Models\Study; use App\Services\Pacs\OrthancRestClient; use App\Services\Pacs\StudyImporter; -use Arr; class PacsController extends Controller { public function index() { - $studies = (new OrthancRestClient)->getStudies(); - //dd($studies[0]); - $study = array_pop($studies); - //dd(Arr::get($study, 'MainDicomTags.StudyDate')); - //dd(collect($study)->get('MainDicomTags.StudyDate')); - dd($study); + $studies = Study::where('is_active', true) + ->orderBy('study_date', 'desc') + ->paginate(15); return view('pacs.studies', compact('studies')); } diff --git a/app/Services/Pacs/PacsUrlGen.php b/app/Services/Pacs/PacsUrlGen.php new file mode 100644 index 0000000..bad9996 --- /dev/null +++ b/app/Services/Pacs/PacsUrlGen.php @@ -0,0 +1,35 @@ +setPath('/stone-webviewer/index.html'); + $url->setQuery(['study' => $study_uid]); + + return (string) $url; + } + + public static function ohifViewer(string $study_uid): string + { + $url = Url::createFromUrl(config('pacs.viewer.ohif.endpoint')); + $url->setPath('/ohif/viewer'); + $url->setQuery(['StudyInstanceUIDs' => $study_uid]); + + return (string) $url; + } + + public static function ohifViewerMpr(string $study_uid): string + { + $url = Url::createFromUrl(config('pacs.viewer.ohif.endpoint')); + $url->setPath('/ohif/viewer'); + $url->setQuery(['StudyInstanceUIDs' => $study_uid, 'hangingprotocolId' => 'mprAnd3DVolumeViewport']); + + return (string) $url; + } +} diff --git a/config/pacs.php b/config/pacs.php index 3a17e26..5616348 100644 --- a/config/pacs.php +++ b/config/pacs.php @@ -3,9 +3,20 @@ return [ 'api' => [ - 'endpoint' => env('PACS_API_ENDPOINT', 'http://27.147.241.214:8042/'), + 'endpoint' => env('PACS_API_ENDPOINT', 'http://pacs.mylabctg.com:8042/'), 'username' => env('PACS_API_USERNAME'), 'password' => env('PACS_API_PASSWORD'), ], + 'viewer' => [ + + 'stone' => [ + 'endpoint' => env('STONE_VIEWER_ENDPOINT', 'http://pacs.mylabctg.com:8042/'), + ], + + 'ohif' => [ + 'endpoint' => env('OHIF_VIEWER_ENDPOINT', 'http://pacs.mylabctg.com:8042/'), + ], + + ], ]; diff --git a/resources/views/pacs/studies.blade.php b/resources/views/pacs/studies.blade.php index 0c5d428..8ee283c 100644 --- a/resources/views/pacs/studies.blade.php +++ b/resources/views/pacs/studies.blade.php @@ -7,43 +7,43 @@
-
- +
+ +
+ - - - - - - - + + + + + + + + + + + @foreach($studies as $study) - - - - - - - - - + + + + + + + + + + + @endforeach +
IDPatient IDNameSexStudy DtUploadedInstitutionIDAccession NumberPatient IDPatient NamePatient SexPatient Birth DateStudy DateReceive DateInstitute Name
- {{ $study['ID'] }} - - {{ $study['PatientMainDicomTags']['PatientID'] }} - - {{ $study['PatientMainDicomTags']['PatientName'] }} - - {{ $study['PatientMainDicomTags']['PatientSex'] }} - - {{ $study['StudyDateTime'] }} - - {{ $study['ReceiveDateTime'] }} - - {{ $study['MainDicomTags']['InstitutionName'] }} -
{{ $study->id }}{{ $study->accession_number }}{{ $study->patient_id }}{{ $study->patient_name }}{{ $study->patient_sex }}{{ $study->patient_birthdate }}{{ $study->study_date }}{{ $study->receive_date }}{{ $study->institution_name }}
+ +
+ {!! $studies->links() !!} +
+