| @@ -0,0 +1,40 @@ | ||
| #!/usr/bin/php | ||
| <?php | ||
| /** | ||
| * | ||
| * sSSs .S S. .S_sSSs .S sSSs | ||
| * d%%SP .SS SS. .SS~YS%%b .SS d%%SP | ||
| * d%S' S%S S%S S%S `S%b S%S d%S' | ||
| * S%S S%S S%S S%S S%S S%S S%| | ||
| * S&S S%S SSSS%S S%S d* S S&S S&S | ||
| * S&S S&S SSS&S S&S .S* S S&S Y&Ss | ||
| * S&S S&S S&S S&S_sdSSS S&S `S&&S | ||
| * S&S S&S S&S S&S~YSY%b S&S `S*S | ||
| * S*b S*S S*S S*S `S%b S*S l*S | ||
| * S*S. S*S S*S S*S S%S S*S .S*P | ||
| * SSSbs S*S S*S S*S S&S S*S sSS*S | ||
| * YSSP SSS S*S S*S SSS S*S YSS' | ||
| * SP SP SP | ||
| * Y Y Y | ||
| * | ||
| * R E L O A D E D | ||
| * | ||
| * (c) 2012 Fetal-Neonatal Neuroimaging & Developmental Science Center | ||
| * Boston Children's Hospital | ||
| * | ||
| * http://childrenshospital.org/FNNDSC/ | ||
| * dev@babyMRI.org | ||
| * | ||
| */ | ||
| // we define a valid entry point | ||
| if(!defined('__CHRIS_ENTRY_POINT__')) define('__CHRIS_ENTRY_POINT__', 666); | ||
| // include the configuration | ||
| $configurationPath = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'config.inc.php'; | ||
| if(!defined('CHRIS_CONFIG_PARSED')) require_once($configurationPath); | ||
|
|
||
| // build full storescp command | ||
| $processincoming = joinPaths(CHRIS_CONTROLLER_FOLDER, 'pacs_process.php'); | ||
| $executeonreceive = '-xcr \''.$processincoming.' -d ' . CHRIS_SESSIONPATH . ' -t #p -f #f -a #a -c #c\''; | ||
| $command = '/usr/bin/storescp -id -aet ' . CHRIS_AETITLE . ' -od ' . CHRIS_INCOMINGDATA . ' -pm ' . $executeonreceive . ' -ss RX -tos 120'; | ||
| exec($command); | ||
| ?> |
| @@ -0,0 +1,54 @@ | ||
| <?php | ||
| /** | ||
| * | ||
| * sSSs .S S. .S_sSSs .S sSSs | ||
| * d%%SP .SS SS. .SS~YS%%b .SS d%%SP | ||
| * d%S' S%S S%S S%S `S%b S%S d%S' | ||
| * S%S S%S S%S S%S S%S S%S S%| | ||
| * S&S S%S SSSS%S S%S d* S S&S S&S | ||
| * S&S S&S SSS&S S&S .S* S S&S Y&Ss | ||
| * S&S S&S S&S S&S_sdSSS S&S `S&&S | ||
| * S&S S&S S&S S&S~YSY%b S&S `S*S | ||
| * S*b S*S S*S S*S `S%b S*S l*S | ||
| * S*S. S*S S*S S*S S%S S*S .S*P | ||
| * SSSbs S*S S*S S*S S&S S*S sSS*S | ||
| * YSSP SSS S*S S*S SSS S*S YSS' | ||
| * SP SP SP | ||
| * Y Y Y | ||
| * | ||
| * R E L O A D E D | ||
| * | ||
| * (c) 2012 Fetal-Neonatal Neuroimaging & Developmental Science Center | ||
| * Boston Children's Hospital | ||
| * | ||
| * http://childrenshospital.org/FNNDSC/ | ||
| * dev@babyMRI.org | ||
| * | ||
| */ | ||
| define('__CHRIS_ENTRY_POINT__', 666); | ||
|
|
||
| // include the configuration | ||
| require_once ('../config.inc.php'); | ||
| require_once 'pacs.class.php'; | ||
|
|
||
| $pacs = new PACS($_POST['SERVER_IP'], $_POST['SERVER_POR'], $_POST['USER_AET']); | ||
|
|
||
| if($_POST['PACS_LEV'] == 'STUDY'){ | ||
| $pacs->addParameter('StudyDate', $_POST['PACS_DAT']); | ||
| $pacs->addParameter('AccessionNumber', $_POST['PACS_ACC_NUM']); | ||
| $pacs->addParameter('RetrieveAETitle', $_POST['USER_AET']); | ||
| $pacs->addParameter('ModalitiesInStudy', $_POST['PACS_MOD']); | ||
| $pacs->addParameter('StudyDescription', $_POST['PACS_STU_DES']); | ||
| $pacs->addParameter('PatientName', $_POST['PACS_NAM']); | ||
| $pacs->addParameter('PatientID', $_POST['PACS_MRN']); | ||
| $pacs->addParameter('PatientBirthDate', ''); | ||
| $pacs->addParameter('StudyInstanceUID', $_POST['PACS_STU_UID']); | ||
| echo json_encode($pacs->moveStudy()); | ||
| } | ||
| else{ | ||
| $pacs->addParameter('StudyInstanceUID', $_POST['PACS_STU_UID']); | ||
| // SERIESInstanceUID shouldnt be empty... | ||
| $pacs->addParameter('SeriesInstanceUID', ''); | ||
| echo json_encode($pacs->moveSeries()); | ||
| } | ||
| ?> |
| @@ -0,0 +1,36 @@ | ||
| <?php | ||
| /** | ||
| * | ||
| * sSSs .S S. .S_sSSs .S sSSs | ||
| * d%%SP .SS SS. .SS~YS%%b .SS d%%SP | ||
| * d%S' S%S S%S S%S `S%b S%S d%S' | ||
| * S%S S%S S%S S%S S%S S%S S%| | ||
| * S&S S%S SSSS%S S%S d* S S&S S&S | ||
| * S&S S&S SSS&S S&S .S* S S&S Y&Ss | ||
| * S&S S&S S&S S&S_sdSSS S&S `S&&S | ||
| * S&S S&S S&S S&S~YSY%b S&S `S*S | ||
| * S*b S*S S*S S*S `S%b S*S l*S | ||
| * S*S. S*S S*S S*S S%S S*S .S*P | ||
| * SSSbs S*S S*S S*S S&S S*S sSS*S | ||
| * YSSP SSS S*S S*S SSS S*S YSS' | ||
| * SP SP SP | ||
| * Y Y Y | ||
| * | ||
| * R E L O A D E D | ||
| * | ||
| * (c) 2012 Fetal-Neonatal Neuroimaging & Developmental Science Center | ||
| * Boston Children's Hospital | ||
| * | ||
| * http://childrenshospital.org/FNNDSC/ | ||
| * dev@babyMRI.org | ||
| * | ||
| */ | ||
| define('__CHRIS_ENTRY_POINT__', 666); | ||
|
|
||
| // include the configuration | ||
| require_once ('../config.inc.php'); | ||
| require_once 'pacs.class.php'; | ||
|
|
||
| $pacs_query = new PACS($_POST['SERVER_IP'], $_POST['SERVER_POR']); | ||
| echo json_encode($pacs_query->ping()); | ||
| ?> |
| @@ -0,0 +1,55 @@ | ||
| <?php | ||
| /** | ||
| * | ||
| * sSSs .S S. .S_sSSs .S sSSs | ||
| * d%%SP .SS SS. .SS~YS%%b .SS d%%SP | ||
| * d%S' S%S S%S S%S `S%b S%S d%S' | ||
| * S%S S%S S%S S%S S%S S%S S%| | ||
| * S&S S%S SSSS%S S%S d* S S&S S&S | ||
| * S&S S&S SSS&S S&S .S* S S&S Y&Ss | ||
| * S&S S&S S&S S&S_sdSSS S&S `S&&S | ||
| * S&S S&S S&S S&S~YSY%b S&S `S*S | ||
| * S*b S*S S*S S*S `S%b S*S l*S | ||
| * S*S. S*S S*S S*S S%S S*S .S*P | ||
| * SSSbs S*S S*S S*S S&S S*S sSS*S | ||
| * YSSP SSS S*S S*S SSS S*S YSS' | ||
| * SP SP SP | ||
| * Y Y Y | ||
| * | ||
| * R E L O A D E D | ||
| * | ||
| * (c) 2012 Fetal-Neonatal Neuroimaging & Developmental Science Center | ||
| * Boston Children's Hospital | ||
| * | ||
| * http://childrenshospital.org/FNNDSC/ | ||
| * dev@babyMRI.org | ||
| * | ||
| */ | ||
| define('__CHRIS_ENTRY_POINT__', 666); | ||
|
|
||
| // include the configuration | ||
| require_once ('../config.inc.php'); | ||
| require_once 'pacs.class.php'; | ||
|
|
||
| $pacs = new PACS($_POST['SERVER_IP'], $_POST['SERVER_POR'], $_POST['USER_AET']); | ||
|
|
||
| if($_POST['PACS_LEV'] == 'STUDY'){ | ||
| $pacs->addParameter('StudyDate', $_POST['PACS_DAT']); | ||
| $pacs->addParameter('AccessionNumber', $_POST['PACS_ACC_NUM']); | ||
| $pacs->addParameter('RetrieveAETitle', $_POST['USER_AET']); | ||
| $pacs->addParameter('ModalitiesInStudy', $_POST['PACS_MOD']); | ||
| $pacs->addParameter('StudyDescription', $_POST['PACS_STU_DES']); | ||
| $pacs->addParameter('PatientName', $_POST['PACS_NAM']); | ||
| $pacs->addParameter('PatientID', $_POST['PACS_MRN']); | ||
| $pacs->addParameter('PatientBirthDate', ''); | ||
| $pacs->addParameter('StudyInstanceUID', $_POST['PACS_STU_UID']); | ||
| echo json_encode($pacs->queryStudy()); | ||
| } | ||
| else{ | ||
| $pacs->addParameter('RetrieveAETitle', ''); | ||
| $pacs->addParameter('StudyInstanceUID', $_POST['PACS_STU_UID']); | ||
| $pacs->addParameter('SeriesInstanceUID', ''); | ||
| $pacs->addParameter('NumberOfSeriesRelatedInstances', ''); | ||
| echo json_encode($pacs->querySeries()); | ||
| } | ||
| ?> |
| @@ -0,0 +1,298 @@ | ||
| <?php | ||
| /** | ||
| * | ||
| * sSSs .S S. .S_sSSs .S sSSs | ||
| * d%%SP .SS SS. .SS~YS%%b .SS d%%SP | ||
| * d%S' S%S S%S S%S `S%b S%S d%S' | ||
| * S%S S%S S%S S%S S%S S%S S%| | ||
| * S&S S%S SSSS%S S%S d* S S&S S&S | ||
| * S&S S&S SSS&S S&S .S* S S&S Y&Ss | ||
| * S&S S&S S&S S&S_sdSSS S&S `S&&S | ||
| * S&S S&S S&S S&S~YSY%b S&S `S*S | ||
| * S*b S*S S*S S*S `S%b S*S l*S | ||
| * S*S. S*S S*S S*S S%S S*S .S*P | ||
| * SSSbs S*S S*S S*S S&S S*S sSS*S | ||
| * YSSP SSS S*S S*S SSS S*S YSS' | ||
| * SP SP SP | ||
| * Y Y Y | ||
| * | ||
| * R E L O A D E D | ||
| * | ||
| * (c) 2012 Fetal-Neonatal Neuroimaging & Developmental Science Center | ||
| * Boston Children's Hospital | ||
| * | ||
| * http://childrenshospital.org/FNNDSC/ | ||
| * dev@babyMRI.org | ||
| * | ||
| */ | ||
| // we define a valid entry point | ||
| if(!defined('__CHRIS_ENTRY_POINT__')) define('__CHRIS_ENTRY_POINT__', 666); | ||
|
|
||
| // include the configuration | ||
| if(!defined('CHRIS_CONFIG_PARSED')) require_once('../../config.inc.php'); | ||
|
|
||
| // include the simpletest framework | ||
| require_once (SIMPLETEST); | ||
|
|
||
| // include the controller classes | ||
| require_once (joinPaths(CHRIS_CONTROLLER_FOLDER, 'pacs.class.php')); | ||
|
|
||
| class TestPACSClass extends UnitTestCase { | ||
|
|
||
| /** | ||
| * Test the ping method | ||
| */ | ||
|
|
||
| //! [testPing()] | ||
| public function testPing() { | ||
| // ping a valid host (CHB) | ||
| $server_ip = '134.174.12.21'; | ||
| $server_port = 104; | ||
|
|
||
| $pacs_ping = new PACS($server_ip, $server_port); | ||
| $result = $pacs_ping->ping(); | ||
|
|
||
|
|
||
| // should return 1 on success | ||
| $this->assertTrue($result == 1); | ||
|
|
||
| // ping unvalid host | ||
| $server_port = 10; | ||
| $pacs_ping2 = new PACS($server_ip, $server_port); | ||
| $result2 = $pacs_ping2->ping(); | ||
|
|
||
| // should return 0 on failure | ||
| $this->assertTrue($result2 == 0); | ||
| } | ||
|
|
||
| //! [testPing()] | ||
|
|
||
| /** | ||
| * Test the addParameter method | ||
| */ | ||
|
|
||
| //! [testAddParameter()] | ||
| public function testAddParameter() { | ||
| $server_ip = '134.174.12.21'; | ||
| $server_port = 104; | ||
|
|
||
| // we add not enough parameter (no user AE Title) | ||
| $pacs_not_enough = new PACS($server_ip, $server_port); | ||
| $pacs_not_enough->addParameter('PatientID', 4562009); | ||
| $result_not_enough = $pacs_not_enough->queryStudy(); | ||
|
|
||
| // should return null | ||
| $this->assertTrue($result_not_enough == null); | ||
|
|
||
| // we add enough parameter: AE Title and Query Retrieve Level | ||
| $user_aetitle = 'FNNDSC-CHRIS'; | ||
| $pacs_enough = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_enough->addParameter('PatientID', 4562009); | ||
| $result_enough = $pacs_enough->queryStudy(); | ||
|
|
||
| // should return an array containing a 'PatientID' array | ||
| $this->assertTrue(gettype($result_enough['PatientID']) == 'array'); | ||
|
|
||
| // we add unknown parameters | ||
| $pacs_fake = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_fake->addParameter('PatientID', 4562009); | ||
| $pacs_fake->addParameter('FakeParameter','IAmAFakeParameter'); | ||
| $result_fake = $pacs_fake->queryStudy(); | ||
|
|
||
| // should return null | ||
| $this->assertTrue($result_fake == null); | ||
| } | ||
|
|
||
| //! [testAddParameter()] | ||
|
|
||
| /** | ||
| * Test the queryStudy method | ||
| */ | ||
|
|
||
| //! [testQueryStudy()] | ||
| public function testQueryStudy() { | ||
| // query on MRN | ||
| $server_ip = '134.174.12.21'; | ||
| $server_port = 104; | ||
| $user_aetitle = 'FNNDSC-CHRIS'; | ||
| $pacs_mrn = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_mrn->addParameter('PatientID', 4562009); | ||
| $result_mrn = $pacs_mrn->queryStudy(); | ||
|
|
||
| // should return 4 results | ||
| $this->assertTrue(count($result_mrn['PatientID']) == 4); | ||
|
|
||
| // query on name | ||
| $pacs_name = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_name->addParameter('PatientName', 'RONDO^RAJON'); | ||
| $result_name = $pacs_name->queryStudy(); | ||
|
|
||
| // should return 1 result | ||
| $this->assertTrue(count($result_name['PatientName']) == 1); | ||
|
|
||
| // query on MRN and name | ||
| $pacs_mrn_name = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_mrn_name->addParameter('PatientID', 4562009); | ||
| $pacs_mrn_name->addParameter('PatientName', 'RONDO^RAJON'); | ||
| $result_mrn_name = $pacs_mrn_name->queryStudy(); | ||
|
|
||
| // MRN should take over, 4 results should be returned then | ||
| $this->assertTrue(count($result_mrn_name['PatientID']) == 4); | ||
|
|
||
| // we add unknown parameters | ||
| $pacs_fake = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_fake->addParameter('PatientID', 4562009); | ||
| $pacs_fake->addParameter('FakeParameter','IAmAFakeParameter'); | ||
| $result_fake = $pacs_fake->queryStudy(); | ||
|
|
||
| // should return null | ||
| $this->assertTrue($result_fake == null); | ||
|
|
||
| // we add not enough parameter (no user AE Title) | ||
| $pacs_not_enough = new PACS($server_ip, $server_port); | ||
| $pacs_not_enough->addParameter('PatientID', 4562009); | ||
| $result_not_enough = $pacs_not_enough->queryStudy(); | ||
|
|
||
| // should return null | ||
| $this->assertTrue($result_not_enough == null); | ||
| } | ||
|
|
||
| //! [testQueryStudy()] | ||
|
|
||
| /** | ||
| * Test the querySeries method | ||
| */ | ||
|
|
||
| //! [testQuerySeries()] | ||
| public function testQuerySeries() { | ||
| // query in StudyInstanceUID | ||
| $server_ip = '134.174.12.21'; | ||
| $server_port = 104; | ||
| $user_aetitle = 'FNNDSC-CHRIS'; | ||
| $pacs_siiud = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_siiud->addParameter('StudyInstanceUID', '1.2.840.113845.11.1000000001785349915.20120409172607.5904669'); | ||
| $result_siiud = $pacs_siiud->querySeries(); | ||
|
|
||
| // should return 34 results | ||
| $this->assertTrue(count($result_siiud['StudyInstanceUID']) == 34); | ||
|
|
||
| // query on unknown parameter | ||
| $pacs_fake = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_fake->addParameter('FakeParameter','IAmAFakeParameter'); | ||
| $result_fake = $pacs_fake->querySeries(); | ||
|
|
||
| // should return an empty array | ||
| $this->assertTrue($result_fake == null); | ||
|
|
||
| // we add not enough parameter (no user AE Title) | ||
| $pacs_not_enough = new PACS($server_ip, $server_port); | ||
| $pacs_not_enough->addParameter('PatientID', 4562009); | ||
| $result_not_enough = $pacs_not_enough->querySeries(); | ||
|
|
||
| // should return null | ||
| $this->assertTrue($result_not_enough == null); | ||
| } | ||
|
|
||
| //! [testQuerySeries()] | ||
|
|
||
| /** | ||
| * Test the queryImage method | ||
| */ | ||
|
|
||
| //! [testQueryImage()] | ||
| public function testQueryImage() { | ||
| } | ||
|
|
||
| //! [testQueryImage()] | ||
|
|
||
| /** | ||
| * Test the moveStudy method | ||
| */ | ||
|
|
||
| //! [testMoveStudy()] | ||
| public function testMoveStudy() { | ||
| // move on MRN + Study Date | ||
| $server_ip = '134.174.12.21'; | ||
| $server_port = 104; | ||
| $user_aetitle = 'FNNDSC-CHRIS'; | ||
| $pacs_mrn = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_mrn->addParameter('PatientID', 4562009); | ||
| $pacs_mrn->addParameter('StudyDate', 20120508); | ||
| $result_mrn = $pacs_mrn->moveStudy(); | ||
|
|
||
| // should return null (no error message) | ||
| $this->assertTrue($result_mrn == null); | ||
|
|
||
| // we add unknown parameters | ||
| $pacs_fake = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_fake->addParameter('PatientID', 4562009); | ||
| $pacs_fake->addParameter('FakeParameter','IAmAFakeParameter'); | ||
| $result_fake = $pacs_fake->moveStudy(); | ||
|
|
||
| // should return error message | ||
| $this->assertTrue($result_fake != null); | ||
|
|
||
| // we add not enough parameter (no user AE Title) | ||
| $pacs_not_enough = new PACS($server_ip, $server_port); | ||
| $pacs_not_enough->addParameter('PatientID', 4562009); | ||
| $result_not_enough = $pacs_not_enough->moveStudy(); | ||
|
|
||
| // should return error message | ||
| $this->assertTrue($result_not_enough != null); | ||
| } | ||
|
|
||
| //! [testMoveStudy()] | ||
|
|
||
| /** | ||
| * Test the moveSeries method | ||
| */ | ||
|
|
||
| //! [testMoveSeries()] | ||
| public function testMoveSeries() { | ||
| // move on MRN + Study Date | ||
| $server_ip = '134.174.12.21'; | ||
| $server_port = 104; | ||
| $user_aetitle = 'FNNDSC-CHRIS'; | ||
| $pacs = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs->addParameter('StudyInstanceUID', '1.2.840.113845.11.1000000001785349915.20120508133531.5943861'); | ||
| $pacs->addParameter('SeriesInstanceUID', '1.2.840.113619.2.256.896737926219.1336498845.3088'); | ||
| $result = $pacs->moveSeries(); | ||
|
|
||
| // should return null (no error message) | ||
| $this->assertTrue($result == null); | ||
|
|
||
| // missing StudyInstanceUID | ||
| $server_ip = '134.174.12.21'; | ||
| $server_port = 104; | ||
| $user_aetitle = 'FNNDSC-CHRIS'; | ||
| $pacs_miss_study = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_miss_study->addParameter('SeriesInstanceUID', '1.2.840.113619.2.256.896737926219.1336498845.3088'); | ||
| $result_miss_study = $pacs_miss_study->moveSeries(); | ||
|
|
||
| // should return an error message | ||
| $this->assertTrue($result_miss_study != null); | ||
|
|
||
| // missing SeriesInstanceUID | ||
| $server_ip = '134.174.12.21'; | ||
| $server_port = 104; | ||
| $user_aetitle = 'FNNDSC-CHRIS'; | ||
| $pacs_miss_series = new PACS($server_ip, $server_port, $user_aetitle); | ||
| $pacs_miss_series->addParameter('StudyInstanceUID', '1.2.840.113845.11.1000000001785349915.20120508133531.5943861'); | ||
| $result_miss_series = $pacs_miss_series->moveSeries(); | ||
|
|
||
| // should return an error message | ||
| $this->assertTrue($result_miss_series != null); | ||
|
|
||
| // missing AE Title | ||
| $pacs_missing_aetitle = new PACS($server_ip, $server_port); | ||
| $pacs_missing_aetitle->addParameter('StudyInstanceUID', '1.2.840.113845.11.1000000001785349915.20120508133531.5943861'); | ||
| $pacs_missing_aetitle->addParameter('SeriesInstanceUID', '1.2.840.113619.2.256.896737926219.1336498845.3088'); | ||
| $result_missing_aetitle = $pacs_missing_aetitle->moveSeries(); | ||
|
|
||
| // should return null (no error message) | ||
| $this->assertTrue($result_missing_aetitle != null); | ||
| } | ||
|
|
||
| //! [testMoveSeries()] | ||
| } | ||
| ?> |
| @@ -0,0 +1,13 @@ | ||
| #slideshow #slidesContainer { | ||
| margin: 0 auto; | ||
| width: 100%; | ||
| height: 300px; | ||
| overflow: auto; /* allow scrollbar */ | ||
| position: relative; | ||
| } | ||
|
|
||
| .slide { | ||
| margin: 0 auto; | ||
| width: 100%; /* reduce by 20 pixels to avoid horizontal scroll */ | ||
| height: 300px; | ||
| } |
| @@ -0,0 +1,228 @@ | ||
| /* Formating function for row details */ | ||
| function fnFormatDetails(oTable, data) { | ||
| var numberOfResults = data.StudyInstanceUID.length; | ||
| var i = 0; | ||
| var content = '<table id="seriesResults" class="table table-bordered"><thead><tr><th>UID</th><th># files</th></tr></thead><tbody>'; | ||
| for (i = 0; i < numberOfResults; ++i) { | ||
| content += '<tr class="parent pacsStudyRows" value="' | ||
| + data.SeriesInstanceUID[i] + '">'; | ||
| content += '<td>' + data.SeriesInstanceUID[i] + '</td>'; | ||
| content += '<td>' + data.NumberOfSeriesRelatedInstances[i] + ' files</td>'; | ||
| content += '</tr>'; | ||
| } | ||
| content += '</body></table>'; | ||
| return content; | ||
| } | ||
| function fnInitTable(tableName, nbColumn, icon) { | ||
| /* | ||
| * Insert a 'details' column to the table | ||
| */ | ||
| var nCloneTh = document.createElement('th'); | ||
| var nCloneTd = document.createElement('td'); | ||
| nCloneTd.innerHTML = '<i class="' + icon + '"></i>'; | ||
| nCloneTd.className = "center"; | ||
| $('#' + tableName + 'Results thead tr').each(function() { | ||
| this.insertBefore(nCloneTh, this.childNodes[0]); | ||
| }); | ||
| $('#' + tableName + 'Results tbody tr').each(function() { | ||
| this.insertBefore(nCloneTd.cloneNode(true), this.childNodes[0]); | ||
| }); | ||
| /* | ||
| * Insert a 'download' column to the table | ||
| */ | ||
| var nCloneTh = document.createElement('th'); | ||
| var nCloneTd = document.createElement('td'); | ||
| nCloneTd.innerHTML = '<i class="icon-circle-arrow-down download' + tableName | ||
| + '"></i>'; | ||
| nCloneTd.className = "center"; | ||
| $('#' + tableName + 'Results thead tr').each(function() { | ||
| this.insertBefore(nCloneTh, this.childNodes[nbColumn]); | ||
| }); | ||
| $('#' + tableName + 'Results tbody tr').each(function() { | ||
| this.insertBefore(nCloneTd.cloneNode(true), this.childNodes[nbColumn]); | ||
| }); | ||
| /* | ||
| * Initialse DataTables, with no sorting on the 'details' column | ||
| */ | ||
| var oTable = $('#' + tableName + 'Results').dataTable({ | ||
| "aoColumnDefs" : [ { | ||
| "bSortable" : false, | ||
| "aTargets" : [ 0, nbColumn ] | ||
| } ], | ||
| "aaSorting" : [ [ 1, 'asc' ] ], | ||
| "sDom" : '<"slide"rtf>', | ||
| "sScrollY" : "200px", | ||
| "bPaginate" : false, | ||
| "bScrollCollapse" : true | ||
| }); | ||
| return oTable; | ||
| } | ||
| /* Formating function for row details */ | ||
| $(document) | ||
| .ready( | ||
| function() { | ||
| $(".pacsRetrieve").click(function(event) { | ||
| $.ajax({ | ||
| type : "POST", | ||
| url : "controller/pacs_move.php", | ||
| dataType : "json", | ||
| data : { | ||
| USER_AET : $("#USER_AET").val(), | ||
| SERVER_IP : $("#SERVER_IP").val(), | ||
| SERVER_POR : $("#SERVER_POR").val(), | ||
| PACS_LEV : 'STUDY', | ||
| PACS_STU_UID : '', | ||
| PACS_MRN : $("#PACS_MRN").val(), | ||
| PACS_NAM : $("#PACS_NAM").val(), | ||
| PACS_MOD : $("#PACS_MOD").val(), | ||
| PACS_DAT : $("#PACS_DAT").val(), | ||
| PACS_STU_DES : $("#PACS_STU_DES").val(), | ||
| PACS_ACC_NUM : $("#PACS_ACC_NUM").val() | ||
| }, | ||
| success : function(data) { | ||
| } | ||
| }); | ||
| }); | ||
| $(".pacsQuery") | ||
| .click( | ||
| function(event) { | ||
| $ | ||
| .ajax({ | ||
| type : "POST", | ||
| url : "controller/pacs_query.php", | ||
| dataType : "json", | ||
| data : { | ||
| USER_AET : $("#USER_AET").val(), | ||
| SERVER_IP : $("#SERVER_IP").val(), | ||
| SERVER_POR : $("#SERVER_POR").val(), | ||
| PACS_LEV : 'STUDY', | ||
| PACS_STU_UID : '', | ||
| PACS_MRN : $("#PACS_MRN").val(), | ||
| PACS_NAM : $("#PACS_NAM").val(), | ||
| PACS_MOD : $("#PACS_MOD").val(), | ||
| PACS_DAT : $("#PACS_DAT").val(), | ||
| PACS_STU_DES : $("#PACS_STU_DES").val(), | ||
| PACS_ACC_NUM : $("#PACS_ACC_NUM").val() | ||
| }, | ||
| success : function(data) { | ||
| var numberOfResults = data.PatientID.length; | ||
| var i = 0; | ||
| var content = '<table id="studyResults" class="table table-bordered"><thead><tr><th>PatientName</th><th>DateOfBirth</th><th>StudyDescription</th><th>StudyDate</th><th>Modality</th></tr></thead><tbody>'; | ||
| for (i = 0; i < numberOfResults; ++i) { | ||
| content += '<tr class="parent pacsStudyRows" value="' | ||
| + data.StudyInstanceUID[i] + '">'; | ||
| content += '<td>' + data.PatientName[i] + '</td>'; | ||
| content += '<td>' + data.PatientBirthDate[i] | ||
| + '</td>'; | ||
| content += '<td>' + data.StudyDescription[i] | ||
| + '</td>'; | ||
| content += '<td>' + data.StudyDate[i] + '</td>'; | ||
| content += '<td>' + data.ModalitiesInStudy[i] | ||
| + '</td>'; | ||
| content += '</tr>'; | ||
| } | ||
| content += '</tbody></table>'; | ||
| $('#studylist').html(content); | ||
| var oTable = fnInitTable('study', 6, | ||
| 'icon-chevron-right'); | ||
| $('#slideInner').animate({ | ||
| 'marginLeft' : 0 | ||
| }); | ||
| /* | ||
| * Add event listener for opening and closing | ||
| * details Note that the indicator for showing which | ||
| * row is open is not controlled by DataTables, | ||
| * rather it is done here | ||
| */ | ||
| $(".downloadstudy").click(function(event) { | ||
| alert('PACS STUDY PULL TRIGERED!'); | ||
| }); | ||
| $('.icon-chevron-right') | ||
| .click( | ||
| function() { | ||
| var nTr = $(this).parents('tr')[0]; | ||
| var studyUID = nTr.getAttribute('value'); | ||
| $ | ||
| .ajax({ | ||
| type : "POST", | ||
| url : "controller/pacs_query.php", | ||
| dataType : "json", | ||
| data : { | ||
| USER_AET : $("#USER_AET").val(), | ||
| SERVER_IP : $("#SERVER_IP").val(), | ||
| SERVER_POR : $("#SERVER_POR") | ||
| .val(), | ||
| PACS_LEV : 'SERIES', | ||
| PACS_STU_UID : studyUID | ||
| }, | ||
| success : function(data) { | ||
| $('#serieslist') | ||
| .html( | ||
| fnFormatDetails(oTable, | ||
| data)); | ||
| var oTable = fnInitTable( | ||
| 'series', 3, | ||
| 'icon-chevron-left'); | ||
| $('#slideInner').animate( | ||
| { | ||
| 'marginLeft' : -$( | ||
| "#slideshow").width() | ||
| }); | ||
| $(".icon-chevron-left").click( | ||
| function(event) { | ||
| $('#slideInner').animate({ | ||
| 'marginLeft' : 0 | ||
| }); | ||
| }); | ||
| $(".downloadseries") | ||
| .click( | ||
| function(event) { | ||
| alert('PACS SERIES PULL TRIGERED!'); | ||
| }); | ||
| } | ||
| }); | ||
| }); | ||
| } | ||
| }); | ||
| }); | ||
| $(".pacsPing").click(function(event) { | ||
| $.ajax({ | ||
| type : "POST", | ||
| url : "controller/pacs_ping.php", | ||
| dataType : "json", | ||
| data : { | ||
| USER_AET : $("#USER_AET").val(), | ||
| SERVER_IP : $("#SERVER_IP").val(), | ||
| SERVER_POR : $("#SERVER_POR").val() | ||
| }, | ||
| success : function(data) { | ||
| $('#pacsping').html(data); | ||
| } | ||
| }); | ||
| }); | ||
| $(".pacsAdanced").click(function(event) { | ||
| if ($(".pacsadvanced").is(":visible")) { | ||
| $(".pacsadvanced").hide(); | ||
| } else { | ||
| $(".pacsadvanced").show(); | ||
| } | ||
| }); | ||
| $(".pacsadvanced").hide(); | ||
| // pacs stuff | ||
| var currentPosition = 0; | ||
| var slideWidth = $("#slideshow").width(); | ||
| var slides = $('.slide'); | ||
| var numberOfSlides = slides.length; | ||
| // Remove scrollbar in JS | ||
| $('#slidesContainer').css('overflow', 'hidden'); | ||
| // Wrap all .slides with #slideInner div | ||
| slides.wrapAll('<div id="slideInner"></div>') | ||
| // Float left to display horizontally, readjust .slides | ||
| // width | ||
| .css({ | ||
| 'float' : 'left', | ||
| 'width' : slideWidth | ||
| }); | ||
| // Set #slideInner width equal to total width of all slides | ||
| $('#slideInner').css('width', slideWidth * numberOfSlides); | ||
| }); |
| @@ -0,0 +1,66 @@ | ||
| <div class="tabbable"> | ||
| <!-- Only required for left/right tabs --> | ||
| <ul class="nav nav-tabs"> | ||
| <li class="active"><a href="#tab1" data-toggle="tab">PACS | ||
| Search</a></li> | ||
| <li><a href="#tab2" data-toggle="tab">PACS Settings</a></li> | ||
| </ul> | ||
| <div class="tab-content"> | ||
| <div class="tab-pane active" id="tab1"> | ||
| <div> | ||
| Patient ID: <input id='PACS_MRN' type="text" value='4562009' /> | ||
| </div> | ||
| <div> | ||
| Study Date: <input id='PACS_DAT' type="text" value='' /> | ||
| </div> | ||
| <div id="pacsadvancedcontainer"> | ||
| <input class='btn btn-primary pacsAdanced' type="button" | ||
| value="Advanced"> | ||
| <div class="pacsadvanced"> | ||
| <div> | ||
| Study Description: <input id='PACS_STU_DES' type="text" value='' /> | ||
| </div> | ||
| <div> | ||
| Accession Number: <input id='PACS_ACC_NUM' type="text" value='' /> | ||
| </div> | ||
| <div> | ||
| Study Modality: <input id='PACS_MOD' type="text" value='' /> | ||
| </div> | ||
| <div> | ||
| Patient Name: <input id='PACS_NAM' type="text" value='' /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <input class='btn btn-primary pacsQuery' type="button" value="Query"> | ||
| <input class='btn btn-primary pacsRetrieve' type="button" | ||
| value="Retrieve"> | ||
| <!-- Results of the PACS pull --> | ||
| <div class="row-fluid"> | ||
|
|
||
| <div id='pacscontainer' class="span12"> | ||
| <div id="slideshow"> | ||
| <div id="slidesContainer"> | ||
| <div id='studylist' class="slide"></div> | ||
| <div id='serieslist' class="slide"></div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="tab-pane" id="tab2"> | ||
| <div> | ||
| AET: <input id='USER_AET' type="text" value='FNNDSC-CHRIS'> | ||
| </div> | ||
| <div> | ||
| Server IP/hotname: <input id='SERVER_IP' type="text" | ||
| value='134.174.12.21' /> | ||
| </div> | ||
| <div> | ||
| Port: <input id='SERVER_POR' type="text" value='104' /> | ||
| </div> | ||
| <input class='btn btn-primary pacsPing' type="button" value="Ping"> | ||
| <div id='pacsping'></div> | ||
| </div> | ||
| </div> | ||
| </div> |