Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API summary header and qc too grep more info #4077

Merged
6 changes: 1 addition & 5 deletions htdocs/api/v0.0.2/candidates/visits/images/qc/QC.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ public function handleGET()
$factory = \NDB_Factory::singleton();
$DB = $factory->Database();
$QCStatus = $DB->pselectRow(
"SELECT QCStatus,
pf.Value as Selected FROM files f
"SELECT QCStatus, Selected FROM files f
cmadjar marked this conversation as resolved.
Show resolved Hide resolved
LEFT JOIN files_qcstatus fqc ON (f.FileID=fqc.FileID)
LEFT JOIN parameter_file pf ON (f.FileID=pf.FileID)
LEFT JOIN parameter_type pt
ON (pf.ParameterTypeID=pt.ParameterTypeID AND pt.Name='Selected')
WHERE f.File LIKE CONCAT('%', :FName)",
array('FName' => $this->Filename)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ public function handleGET()
"Length" => $this->getHeader("time:length"),
"StepSize" => $this->getHeader("time:step"),
];

$Manufacturer = $this->getHeader("study:manufacturer");
$Model = $this->getHeader("study:device_model");
$SoftwareVersion = $this->getHeader("study:software_version");
$SerialNumber = $this->getHeader("study:serial_no");
$FieldStrength = $this->getHeader("study:field_value");
cmadjar marked this conversation as resolved.
Show resolved Hide resolved

$this->JSON = [
'Meta' => [
'CandID' => $this->CandID,
Expand All @@ -108,7 +115,13 @@ public function handleGET()
"ZSpace" => $ZSpace,
"TimeDimension" => $TimeD,
],

'ScannerInfo' => [
"Manufacturer" => $Manufacturer,
"Model" => $Model,
"SoftwareVersion" => $SoftwareVersion,
"SerialNumber" => $SerialNumber,
"FieldStrength" => $FieldStrength,
cmadjar marked this conversation as resolved.
Show resolved Hide resolved
],
];
}

Expand Down
27 changes: 22 additions & 5 deletions htdocs/api/v0.0.3-dev/candidates/visits/images/qc/QC.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,12 @@ public function handleGET()
$factory = \NDB_Factory::singleton();
$DB = $factory->Database();
$QCStatus = $DB->pselectRow(
"SELECT QCStatus,
pf.Value as Selected FROM files f
"SELECT QCStatus, Selected FROM files f
LEFT JOIN files_qcstatus fqc ON (f.FileID=fqc.FileID)
LEFT JOIN parameter_file pf ON (f.FileID=pf.FileID)
LEFT JOIN parameter_type pt
ON (pf.ParameterTypeID=pt.ParameterTypeID AND pt.Name='Selected')
WHERE f.File LIKE CONCAT('%', :FName)",
array('FName' => $this->Filename)
);
$Caveats = $this->getImageCaveats();
cmadjar marked this conversation as resolved.
Show resolved Hide resolved
$this->JSON = [
'Meta' => [
'CandID' => $this->CandID,
Expand All @@ -81,9 +78,29 @@ public function handleGET()
],
'QC' => $QCStatus['QCStatus'],
'Selected' => $QCStatus['Selected'],
'Caveats' => $Caveats,
cmadjar marked this conversation as resolved.
Show resolved Hide resolved
];
}

/**
* Gets the list of Caveats for the file.
*
* @return an array with list of caveats for the file
cmadjar marked this conversation as resolved.
Show resolved Hide resolved
*/
function getImageCaveats()
cmadjar marked this conversation as resolved.
Show resolved Hide resolved
{
$factory = \NDB_Factory::singleton();
$DB = $factory->Database();
$rows = $DB->pselect(
"SELECT Severity, Header, Value, ValidRange, ValidRegex
FROM files f
LEFT JOIN mri_violations_log mvl ON (f.SeriesUID=mvl.SeriesUID)
WHERE f.File LIKE CONCAT('%', :FName)",
array('FName' => $this->Filename)
);
return $rows;
}

/**
* Calculates the ETag for the current QC status
*
Expand Down