skip unstable studies

This commit is contained in:
Dr Masroor Ehsan 2025-01-23 14:52:52 +06:00
parent a8667bd41d
commit 25729d169b

View File

@ -132,6 +132,12 @@ public function getStudyDescription(mixed $orthanc_src): ?string
public function transformData(mixed $orthanc_src): array
{
$stable_study = (bool) data_get($orthanc_src, 'IsStable', false);
if (! $stable_study) {
// do not process unstable studies. wait for next sync when the study becomes stable
return [];
}
$orthanc_uuid = strtolower($orthanc_src['ID']);
$dicom_tags = $this->getStudyDicomTags($orthanc_uuid);
$routing = DicomStudyRouter::matchStudy($dicom_tags);
@ -171,12 +177,9 @@ public function transformData(mixed $orthanc_src): array
'study_description' => $descr,
];
if ((bool) data_get($orthanc_src, 'IsStable', false)) {
$study['study_status'] = StudyLevelStatus::Unassigned->value;
} else {
$study['study_status'] = StudyLevelStatus::Pending->value;
}
$study['study_status'] = $stable_study
? StudyLevelStatus::Unassigned->value
: StudyLevelStatus::Pending->value;
$study['patient_birthdate'] = null;
$dob = data_get($orthanc_src, 'PatientMainDicomTags.PatientBirthDate');
if (filled($dob)) {