Skip to content

Commit

Permalink
[API] Added information on tarchive
Browse files Browse the repository at this point in the history
  • Loading branch information
spell00 committed Nov 4, 2020
1 parent 6376f72 commit 108121d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
17 changes: 15 additions & 2 deletions modules/api/php/models/projectdicomsrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ class ProjectDicomsRow implements \LORIS\Data\DataInstance
private $_dicomarchiveid;
private $_source;
private $_archive;

private $_processid;
private $_acquisitionprotocolid;
private $_tarchiveseriesid;
private $_processprotocolid;
/**
* Create a new ProjectDicomsRow
*
Expand All @@ -51,11 +54,16 @@ class ProjectDicomsRow implements \LORIS\Data\DataInstance
$this->_centerid = $row['CenterID'] ?? null;
$this->_centername = $row['Site'] ?? null;
$this->_tarname = $row['tarchiveid'] ?? null;
$this->_processid = $row['processid'] ?? null;
$this->_processprotocolid = $row['ProcessProtocolID'] ?? null;
$this->_tarchivesource = $row['TarchiveSource'] ?? null;
$this->_dicomarchiveid = $row['DicomArchiveID'] ?? null;
$this->_acquisitionprotocolid = $row['AcquisitionProtocolID'] ?? null;
$this->_source = $row['Source'] ?? null;
$this->_archive = $row['Archive'] ?? null;
$this->_inserttime = $row['InsertTime'] ?? null;
$this->_scantype = $row['ScanType'] ?? null;
$this->_tarchiveseriesid = $row['TarchiveSeriesID'] ?? null;
}

/**
Expand All @@ -66,15 +74,20 @@ class ProjectDicomsRow implements \LORIS\Data\DataInstance
public function toJSON() : string
{
$obj = [
'Candidate' => $this->_candid,
'PSCID' => $this->_pscid,
'AcquisitionProtocolID' => $this->_acquisitionprotocolid,
'ProcessProtocolID' => $this->_processprotocolid,
'Candidate' => $this->_candid,
'Visit' => $this->_visitlabel,
'Visit_date' => $this->_visitdate,
'Site' => $this->_centername,
'InsertTime' => $this->_inserttime,
'TarchiveSource' => $this->_tarchivesource,
'TarchiveID' => $this->_tarname,
'processid' => $this->_processid,
'Source' => $this->_source,
'Archive' => $this->_archive,
'TarchiveSeriesID' => $this->_tarchiveseriesid,
'DicomArchiveID' => $this->_dicomarchiveid
];
$filename = explode('/', $this->_archive)[1];
Expand Down
12 changes: 10 additions & 2 deletions modules/api/php/provisioners/projectdicomsrowprovisioner.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ class ProjectDicomsRowProvisioner extends DBRowProvisioner
t.TarchiveID as tarchiveid,
t.DicomArchiveID as DicomArchiveID,
t.ArchiveLocation as Archive,
t.SourceLocation as Source
t.SourceLocation as Source,
f.TarchiveSource as TarchiveSource,
f.AcquisitionProtocolID as AcquisitionProtocolID,
f.ProcessProtocolID as ProcessProtocolID,
ts.TarchiveSeriesID as TarchiveSeriesID
FROM
files f
LEFT JOIN session s
Expand All @@ -64,7 +68,11 @@ class ProjectDicomsRowProvisioner extends DBRowProvisioner
LEFT JOIN Project project
ON (c.RegistrationProjectID = project.ProjectID)
LEFT JOIN tarchive t
ON (s.ID = t.SessionID)
ON (f.TarchiveSource = t.TarchiveID)
LEFT JOIN tarchive_series ts
ON (ts.TarchiveID = t.TarchiveID)
LEFT JOIN server_processes sp
ON (sp.pid = f.ProcessProtocolID)
WHERE
c.Active = \'Y\' AND
s.Active = \'Y\' AND
Expand Down

0 comments on commit 108121d

Please sign in to comment.