Skip to content

Commit e6a38e7

Browse files
committed
WIP
1 parent 516a327 commit e6a38e7

File tree

6 files changed

+21
-10
lines changed

6 files changed

+21
-10
lines changed

GaelO2/app/GaelO/Adapters/HttpClientAdapter.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use GuzzleHttp\Client;
88
use GuzzleHttp\Exception\RequestException;
99
use GuzzleHttp\Pool;
10+
use GuzzleHttp\Psr7\Request;
1011
use GuzzleHttp\Psr7\Response;
1112
use GuzzleHttp\Psr7\Utils;
1213
use Illuminate\Support\Facades\Log;
@@ -72,7 +73,7 @@ public function requestUploadArrayDicom(string $method, string $uri, array $file
7273
'headers' => ['content-type' => 'application/dicom', 'Accept' => 'application/json']
7374
];
7475

75-
$this->client->request($method, $this->address . $uri, $headers, $body);
76+
yield new Request($method, $this->address . $uri, $headers, $body);
7677
}
7778
};
7879

GaelO2/app/GaelO/Adapters/JobAdapter.php

+6
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44

55
use App\GaelO\Interfaces\Adapters\JobInterface;
66
use App\Jobs\JobQcReport;
7+
use App\Jobs\JobRadiomicsReport;
78

89
class JobAdapter implements JobInterface
910
{
1011
public function sendQcReportJob(int $visitId): void
1112
{
1213
JobQcReport::dispatch($visitId);
1314
}
15+
16+
public function sendRadiomicsReport(int $visitId): void
17+
{
18+
JobRadiomicsReport::dispatch($visitId);
19+
}
1420
}

GaelO2/app/GaelO/Interfaces/Adapters/JobInterface.php

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
interface JobInterface
66
{
77
public function sendQcReportJob(int $visitId) : void;
8+
public function sendRadiomicsReport(int $visitId) :void;
89
}

GaelO2/app/GaelO/Services/GaelOStudiesService/AbstractGaelOStudy.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
abstract class AbstractGaelOStudy
1212
{
13-
private MailServices $mailServices;
14-
private JobInterface $jobInterface;
13+
protected MailServices $mailServices;
14+
protected JobInterface $jobInterface;
1515
protected string $studyName;
1616

1717
public function __construct(MailServices $mailServices, JobInterface $jobInterface)

GaelO2/app/GaelO/Services/SpecificStudiesRules/TEST/TEST.php

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use App\GaelO\Services\GaelOStudiesService\AbstractGaelOStudy;
66
use App\GaelO\Services\GaelOStudiesService\DefaultVisitRules;
7+
use App\GaelO\Services\GaelOStudiesService\Events\AbstractGaelOStudyEvent;
8+
use App\GaelO\Services\GaelOStudiesService\Events\VisitUploadedEvent;
79

810
class TEST extends AbstractGaelOStudy {
911

@@ -79,6 +81,14 @@ public function getVisitRulesClass(string $visitGroupName, string $visitTypeName
7981

8082
}
8183

84+
public function onEventStudy(AbstractGaelOStudyEvent $studyEvent): void
85+
{
86+
parent::onEventStudy($studyEvent);
87+
if ($studyEvent instanceof VisitUploadedEvent) {
88+
$this->jobInterface->sendRadiomicsReport($studyEvent->getVisitId());
89+
}
90+
}
91+
8292
}
8393

8494

GaelO2/app/Jobs/JobRadiomicsReport.php

-7
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ public function handle(DicomStudyRepositoryInterface $dicomStudyRepositoryInterf
3737
$orthancIds = $this->getSeriesOrthancIds($dicomStudyEntity);
3838
$orthancSeriesIdPt = $orthancIds['orthancSeriesIdPt'];
3939
$orthancSeriesIdCt = $orthancIds['orthancSeriesIdCt'];
40-
//$idPT = $gaelOProcessingService->createSeriesFromOrthanc($orthancIds['orthancSeriesIdPt'], true, true);
41-
//$idCT = $gaelOProcessingService->createSeriesFromOrthanc($orthancIds['orthancSeriesIdCt']);
4240

4341
$downloadedFilePathPT = tempnam(ini_get('upload_tmp_dir'), 'TMP_Inference_');
4442
$orthancService->getZipStreamToFile([$orthancSeriesIdPt], fopen($downloadedFilePathPT, 'r+'));
@@ -112,11 +110,6 @@ private function getSeriesOrthancIds(array $dicomStudyEntity)
112110
}
113111
}
114112

115-
return [
116-
'orthancSeriesIdPt' => '40f008c4-18e01723-3bf8793d-5e1d2cfb-af1b3802',
117-
'orthancSeriesIdCt' => '8460a711-e055e4b2-1747def1-0db79fdf-f33d2944'
118-
];
119-
120113
return [
121114
'orthancSeriesIdPt' => $idPT,
122115
'orthancSeriesIdCt' => $idCT

0 commit comments

Comments
 (0)