This commit is contained in:
Dr Masroor Ehsan 2024-12-28 23:34:04 +06:00
parent 752af113b4
commit 35c03978a3
5 changed files with 86 additions and 41 deletions

View File

@ -65,6 +65,8 @@ AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}" 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_USERNAME=
PACS_API_PASSWORD= PACS_API_PASSWORD=
STONE_VIEWER_ENDPOINT=http://pacs.mylabctg.com:8042/
OHIF_VIEWER_ENDPOINT=http://pacs.mylabctg.com:8042/

View File

@ -2,20 +2,17 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\Study;
use App\Services\Pacs\OrthancRestClient; use App\Services\Pacs\OrthancRestClient;
use App\Services\Pacs\StudyImporter; use App\Services\Pacs\StudyImporter;
use Arr;
class PacsController extends Controller class PacsController extends Controller
{ {
public function index() public function index()
{ {
$studies = (new OrthancRestClient)->getStudies(); $studies = Study::where('is_active', true)
//dd($studies[0]); ->orderBy('study_date', 'desc')
$study = array_pop($studies); ->paginate(15);
//dd(Arr::get($study, 'MainDicomTags.StudyDate'));
//dd(collect($study)->get('MainDicomTags.StudyDate'));
dd($study);
return view('pacs.studies', compact('studies')); return view('pacs.studies', compact('studies'));
} }

View File

@ -0,0 +1,35 @@
<?php
namespace App\Services\Pacs;
use League\Url\Url;
final class PacsUrlGen
{
public static function stoneViewer(string $study_uid): string
{
$url = Url::createFromUrl(config('pacs.viewer.stone.endpoint'));
$url->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;
}
}

View File

@ -3,9 +3,20 @@
return [ return [
'api' => [ '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'), 'username' => env('PACS_API_USERNAME'),
'password' => env('PACS_API_PASSWORD'), '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/'),
],
],
]; ];

View File

@ -7,43 +7,43 @@
<div class="py-12"> <div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8"> <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg"> <div class="bg-white overflow-hidden shadow-xl sm:rounded-lg mb-4">
<table class="table">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr> <tr>
<th>ID</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
<th>Patient ID</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Accession Number</th>
<th>Name</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Patient ID</th>
<th>Sex</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Patient Name</th>
<th>Study Dt</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Patient Sex</th>
<th>Uploaded</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Patient Birth Date</th>
<th>Institution</th> <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Study Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Receive Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Institute Name</th>
</tr> </tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@foreach($studies as $study) @foreach($studies as $study)
<tr> <tr>
<td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->id }}</td>
<a href="{{ route('studies.show', [$study['ID']]) }}">{{ $study['ID'] }}</a> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->accession_number }}</td>
</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->patient_id }}</td>
<td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->patient_name }}</td>
{{ $study['PatientMainDicomTags']['PatientID'] }} <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->patient_sex }}</td>
</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->patient_birthdate }}</td>
<td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->study_date }}</td>
{{ $study['PatientMainDicomTags']['PatientName'] }} <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->receive_date }}</td>
</td> <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ $study->institution_name }}</td>
<td>
{{ $study['PatientMainDicomTags']['PatientSex'] }}
</td>
<td>
{{ $study['StudyDateTime'] }}
</td>
<td>
{{ $study['ReceiveDateTime'] }}
</td>
<td>
{{ $study['MainDicomTags']['InstitutionName'] }}
</td>
</tr> </tr>
@endforeach @endforeach
</tbody>
</table> </table>
<div class="mb-4 me-4">
{!! $studies->links() !!}
</div>
</div> </div>
</div> </div>
</div> </div>