refactor: phase 1 inventory
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
[autorun]
|
||||
label=DICOM
|
||||
open=microd\mdicom.exe DICOMDIR
|
||||
icon=microd\mdicom.exe,0
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Animations target="all" framePerSecond="15" showAllFrame="true" loop="true"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Annotation color="#FFFF00" handleColor="#FF0000" textColor="#FFFFFF" width="1" useUserCalibrate="false" calibrateDataX="1" calibrateDataY="1" show="true"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Application showMaximazed="true" showSplash="true" showDefaultViewerDialog="false"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<ExportDicom target="image" imageSize="original" exportFrameToSeparateFiles="false" seperateFiles="false" videoSize="original" exportAnnotations="false"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<ExportImage target="image" imageFormat="jpg" exportFrame="true" createSubFolder="true" imageSize="original" exportAnnotations="true" exportOverlayType="all" jpeg_quality="75"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<ExportVideo target="image" imageFormat="wmv" framePerSecond="25" exportFrame="true" noCompression="false" seperateFiles="false" videoSize="original" exportAnnotations="true" exportOverlayType="all" quality="100"/>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Overlay>
|
||||
<entry group="0x0010" element="0x0010" position="topLeft" description="DCM_PatientName"/>
|
||||
<entry group="0x0010" element="0x0040" position="topLeft" description="DCM_PatientSex"/>
|
||||
<entry group="0x0010" element="0x0020" position="topLeft" description="DCM_PatientID"/>
|
||||
<entry group="0x0010" element="0x0030" position="topLeft" description="DCM_PatientBirthDate"/>
|
||||
<entry group="0x0008" element="0x0060" position="topLeft" description="DCM_Modality"/>
|
||||
<entry group="0x0008" element="0x0080" position="topRight" description="DCM_InstitutionName"/>
|
||||
<entry group="0x0008" element="0x1090" position="topRight" description="DCM_ManufacturerModelName"/>
|
||||
<entry group="0x0008" element="0x0090" position="topRight" description="DCM_ReferringPhysicianName"/>
|
||||
<entry group="0x0008" element="0x0020" position="topRight" description="DCM_StudyDate" group_if_missing="0x0008" element_if_missing="0x0021"/>
|
||||
<entry group="0x0008" element="0x0030" position="topRight" description="DCM_StudyTime" group_if_missing="0x0008" element_if_missing="0x0031"/>
|
||||
<entry group="0x0008" element="0x103e" position="bottomLeft" description="DCM_SeriesDescription"/>
|
||||
<entry group="0x0018" element="0x0050" position="bottomLeft" description="DCM_SliceThickness" text="ST"/>
|
||||
<entry group="0x0018" element="0x0080" position="bottomLeft" description="DCM_RepetitionTime" text="RT"/>
|
||||
<entry group="0x0018" element="0x0081" position="bottomLeft" description="DCM_EchoTime" text="ET"/>
|
||||
<entry viewElement="windowLength" position="bottomRight" description="Window Length" text="L:"/>
|
||||
<entry viewElement="windowWidth" position="bottomRight" description="Windows Width" text="W:"/>
|
||||
<entry viewElement="zoom" position="bottomRight" description="Zoom" text="Zoom:"/>
|
||||
</Overlay>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<StandardOverlay color="#FFFFFF" show="true" showPatientData= "true"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Print framePerPage="6" pageNumber="both" showHeader="true" showFooter="true" showAllFrame="true" showDicomTags="true" overlayType="all" showAnnotation="true" showDate="true" headerText="" footerText="www.microdicom.com" showDicomInfo="true" leftMargin="0.25" topMargin="0.25" rightMargin="0.25" bottomMargin="0.25"/>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<WINDOWLEVEL>
|
||||
<PRESET name="Skull" center="25" width="95"/>
|
||||
<PRESET name="Lung" center="-400" width="1600"/>
|
||||
<PRESET name="Abdomen" center="10" width="400"/>
|
||||
<PRESET name="Mediastinum" center="10" width="450"/>
|
||||
<PRESET name="Bone" center="300" width="2500"/>
|
||||
<PRESET name="Spine" center="20" width="300"/>
|
||||
<PRESET name="Postmyelo" center="200" width="1000"/>
|
||||
<PRESET name="Felsenbein" center="500" width="4000"/>
|
||||
</WINDOWLEVEL>
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
|
||||
When the MicroDicom viewer don't start with autorun.
|
||||
|
||||
Please open the viewer by double clicking the file 'run.bat' instead.
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
@echo off
|
||||
start /B microd\mdicom.exe /cd DICOMDIR
|
||||
@@ -1,73 +0,0 @@
|
||||
<?php
|
||||
|
||||
$accession_number = trim($_GET["accession_number"]);
|
||||
$dicomdir = "/tmp/".uniqid("dicomdir_");
|
||||
|
||||
if(strlen($accession_number)==0) {
|
||||
echo "Accession Number Error";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// $accession_number = "MR.180505.026";
|
||||
|
||||
header("Content-type: application/octet-stream");
|
||||
header('Content-Disposition: attachment; filename="'.$accession_number.'.iso"');
|
||||
|
||||
mkdir($dicomdir);
|
||||
mkdir("$dicomdir/DICOMDIR");
|
||||
|
||||
$cmd = "/bin/cp -r /var/www/html/microdicom/* ${dicomdir}/";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
|
||||
/*
|
||||
CR - Computed Radiography Image Storage
|
||||
CT - CT Image Storage
|
||||
MR - MRImageStorage
|
||||
US - Ultrasound Image Storage
|
||||
NM - Nuclear Medicine Image Storage
|
||||
PET - PET Image Storage
|
||||
SC - Secondary Capture Image Storage
|
||||
XA - XRay Angiographic Image Storage
|
||||
XRF - XRay Radiofluoroscopic Image Storage
|
||||
DX - Digital X-Ray Image Storage for Presentation
|
||||
MG - Digital Mammography X-Ray Image Storage for Presentation
|
||||
PR - Grayscale Softcopy Presentation State Storage
|
||||
KO - Key Object Selection Document Storage
|
||||
SR - Basic Text Structured Report Document Storage
|
||||
*/
|
||||
|
||||
$modalities["CR"] = 1;
|
||||
$modalities["CT"] = 1;
|
||||
$modalities["MR"] = 1;
|
||||
$modalities["US"] = 1;
|
||||
$modalities["NM"] = 1;
|
||||
$modalities["PET"] = 1;
|
||||
$modalities["SC"] = 1;
|
||||
$modalities["XA"] = 1;
|
||||
$modalities["XRF"] = 1;
|
||||
$modalities["DX"] = 1;
|
||||
$modalities["MG"] = 1;
|
||||
$modalities["PR"] = 1;
|
||||
$modalities["KO"] = 1;
|
||||
$modalities["SR"] = 1;
|
||||
|
||||
|
||||
|
||||
foreach($modalities as $cstore=>$v) {
|
||||
$cmd = "JAVA_HOME=/usr/lib/jvm/jdk1.8.0_144 LANG=en_US.iso-8859-1 /usr/local/dcm4che/dcm4che2/bin/dcmqr -L CDRECORD:10104 ABPACS@localhost:11112 -cmove CDRECORD -qAccessionNumber=${accession_number} -cstore $cstore -cstoredest $dicomdir/DICOMDIR";
|
||||
exec($cmd, $outputRes);
|
||||
}
|
||||
|
||||
$cmd = "/bin/rm -f ${accession_number}.iso";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
$cmd = "/usr/bin/genisoimage -iso-level 4 -r -allow-multidot -allow-lowercase -allow-leading-dots -V DICOM -o ${accession_number}.iso $dicomdir";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
$cmd = "/bin/rm -rf $dicomdir";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
readfile("${accession_number}.iso");
|
||||
unlink("${accession_number}.iso");
|
||||
exit(0);
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
|
||||
$accession_number = trim($_GET["accession_number"]);
|
||||
$dicomdir = "/tmp/".uniqid("dicomdir_");
|
||||
|
||||
if(strlen($accession_number)==0) {
|
||||
echo "Accession Number Error";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// $accession_number = "MR.180505.026";
|
||||
|
||||
//header("Content-type: application/octet-stream");
|
||||
//header('Content-Disposition: attachment; filename="'.$accession_number.'.iso"');
|
||||
|
||||
mkdir($dicomdir);
|
||||
mkdir("$dicomdir/DICOMDIR");
|
||||
|
||||
$cmd = "/bin/cp -r /var/www/html/microdicom/* ${dicomdir}/";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
|
||||
/*
|
||||
CR - Computed Radiography Image Storage
|
||||
CT - CT Image Storage
|
||||
MR - MRImageStorage
|
||||
US - Ultrasound Image Storage
|
||||
NM - Nuclear Medicine Image Storage
|
||||
PET - PET Image Storage
|
||||
SC - Secondary Capture Image Storage
|
||||
XA - XRay Angiographic Image Storage
|
||||
XRF - XRay Radiofluoroscopic Image Storage
|
||||
DX - Digital X-Ray Image Storage for Presentation
|
||||
MG - Digital Mammography X-Ray Image Storage for Presentation
|
||||
PR - Grayscale Softcopy Presentation State Storage
|
||||
KO - Key Object Selection Document Storage
|
||||
SR - Basic Text Structured Report Document Storage
|
||||
*/
|
||||
|
||||
$modalities["CR"] = 1;
|
||||
$modalities["CT"] = 1;
|
||||
$modalities["MR"] = 1;
|
||||
$modalities["US"] = 1;
|
||||
$modalities["NM"] = 1;
|
||||
$modalities["PET"] = 1;
|
||||
$modalities["SC"] = 1;
|
||||
$modalities["XA"] = 1;
|
||||
$modalities["XRF"] = 1;
|
||||
$modalities["DX"] = 1;
|
||||
$modalities["MG"] = 1;
|
||||
$modalities["PR"] = 1;
|
||||
$modalities["KO"] = 1;
|
||||
$modalities["SR"] = 1;
|
||||
|
||||
|
||||
|
||||
foreach($modalities as $cstore=>$v) {
|
||||
$cmd = "JAVA_HOME=/usr/lib/jvm/jdk1.8.0_144 LANG=en_US.iso-8859-1 /usr/local/dcm4che/dcm4che2/bin/dcmqr -L CDRECORD:10104 ABPACS@localhost:11112 -cmove CDRECORD -qAccessionNumber=${accession_number} -cstore $cstore -cstoredest $dicomdir/DICOMDIR";
|
||||
exec($cmd, $outputRes);
|
||||
}
|
||||
|
||||
//$cmd = "JAVA_HOME=/usr/lib/jvm/jdk1.7.0_80 LANG=en_US.iso-8859-1 /usr/local/dcm4che/dcm4che2/bin/dcmsend DCMSERVER@172.16.0.120:104 $dicomdir/DICOMDIR/";
|
||||
$cmd = "/usr/bin/dcmsend +sd +rd 172.16.0.120 104 $dicomdir/DICOMDIR";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
/*$cmd = "/bin/rm -f ${accession_number}.iso";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
$cmd = "/usr/bin/genisoimage -iso-level 4 -r -allow-multidot -allow-lowercase -allow-leading-dots -V DICOM -o ${accession_number}.iso $dicomdir";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
$cmd = "/bin/rm -rf $dicomdir";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
readfile("${accession_number}.iso");
|
||||
exit(0);*/
|
||||
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
umask(0000);
|
||||
set_time_limit(0);
|
||||
|
||||
$accession_number = trim($_GET["accession_number"]);
|
||||
if (strlen($accession_number) == 0) die("Accession Error");
|
||||
|
||||
$unique_id = md5(microtime() . $accession_number);
|
||||
//$base_dir = "/dicom_temp/iso_" . $unique_id;
|
||||
$base_dir = "/tmp/iso_" . $unique_id;
|
||||
$image_store = $base_dir . "/DICOMDIR";
|
||||
|
||||
if (!is_dir($image_store)) mkdir($image_store, 0777, true);
|
||||
|
||||
// 1. Download dari PACS
|
||||
$modalities = ["CR", "CT", "MR", "US", "NM", "PET", "SC", "XA", "XRF", "DX", "MG", "PR", "KO", "SR"];
|
||||
foreach ($modalities as $cstore) {
|
||||
$cmd = "JAVA_HOME=/usr/lib/jvm/jdk1.8.0_144 /usr/local/dcm4che/dcm4che2/bin/dcmqr -L CDRECORD:10104 ABPACS@localhost:11112 -cmove CDRECORD -qAccessionNumber=" . escapeshellarg($accession_number) . " -cstore $cstore -cstoredest " . escapeshellarg($image_store) . " 2>&1";
|
||||
exec($cmd);
|
||||
}
|
||||
|
||||
exec("sync");
|
||||
sleep(2);
|
||||
|
||||
// 2. KUNCI: Rename file menggunakan iterator agar tidak 'nyangkut'
|
||||
$i = 1;
|
||||
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($image_store, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);
|
||||
|
||||
foreach ($iterator as $file) {
|
||||
if ($file->isFile()) {
|
||||
// Ganti nama file menjadi angka sederhana 1.dcm, 2.dcm agar sistem tidak bingung
|
||||
$new_name = $image_store . "/" . $i . ".dcm";
|
||||
@rename($file->getRealPath(), $new_name);
|
||||
$i++;
|
||||
} else {
|
||||
// Hapus sub-folder kosong yang dibuat dcmqr
|
||||
@rmdir($file->getRealPath());
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Copy Viewer
|
||||
exec("/bin/cp -r /var/www/html/microdicom/* " . escapeshellarg($base_dir) . "/");
|
||||
|
||||
// 4. Buat ISO (Sekarang sangat lancar karena nama filenya simpel)
|
||||
$iso_name = "/dicom_temp/RESULT_" . $accession_number . "_" . $unique_id . ".iso";
|
||||
$cmd_iso = "/usr/bin/genisoimage -o " . escapeshellarg($iso_name) . " -V DICOM -R -J " . escapeshellarg($base_dir) . " 2>&1";
|
||||
exec($cmd_iso);
|
||||
|
||||
// 5. Kirim ke Browser
|
||||
if (file_exists($iso_name)) {
|
||||
while (ob_get_level()) ob_end_clean();
|
||||
header("Content-type: application/octet-stream");
|
||||
header('Content-Disposition: attachment; filename="' . $accession_number . '.iso"');
|
||||
header('Content-Length: ' . filesize($iso_name));
|
||||
readfile($iso_name);
|
||||
|
||||
// 6. CLEANUP (Wajib)
|
||||
@unlink($iso_name);
|
||||
|
||||
// Gunakan perintah ini untuk menghapus folder sesi ini secara total
|
||||
exec("rm -rf " . escapeshellarg($base_dir));
|
||||
|
||||
// OTOMATISASI PEMBERSIH SAMPAH:
|
||||
// Menghapus folder iso_... yang gagal hapus di masa lalu dan sudah lebih tua dari 15 menit
|
||||
exec("find /dicom_temp/ -maxdepth 1 -name 'iso_*' -type d -mmin +15 -exec rm -rf {} \;");
|
||||
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@@ -1,106 +0,0 @@
|
||||
<?php
|
||||
|
||||
include_once('class/database.php');
|
||||
|
||||
$db = new Database("localhost","root","12Digit","pacsdb_his",3306);
|
||||
$dbhis = new Database("192.168.2.7","remote","12Digit","rsabt201107",3306);
|
||||
|
||||
$list_accession_number = trim($_GET["accession_number"]);
|
||||
$as = explode(",",$list_accession_number);
|
||||
|
||||
$list_accession_number = implode("-",$as);
|
||||
|
||||
$first_accession_number = $as[0];
|
||||
|
||||
$sql = "SELECT MEDRECID,RegID FROM pacs_result_series WHERE AccessionNumber = '$first_accession_number' LIMIT 1";
|
||||
$result = $dbhis->query($sql);
|
||||
if($dbhis->getRowsNum($result)>0) {
|
||||
list($MEDRECID,$RegID)=$dbhis->fetchRow($result);
|
||||
$sql = "SELECT Nama FROM medrec WHERE MEDRECID = '$MEDRECID'";
|
||||
$result = $dbhis->query($sql);
|
||||
if($dbhis->getRowsNum($result)>0) {
|
||||
list($NamaPasien)=$dbhis->fetchRow($result);
|
||||
} else {
|
||||
echo "Accession Number Error";
|
||||
exit(0);
|
||||
}
|
||||
} else {
|
||||
echo "Accession Number Error";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$dicomdir = "/tmp/".uniqid("dicomdir_");
|
||||
|
||||
if(strlen($list_accession_number)==0) {
|
||||
echo "Accession Number Error";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// $accession_number = "MR.180505.026";
|
||||
|
||||
$filename_pasien = preg_replace( '/[^a-zA-Z0-9]+/', '', strtoupper($NamaPasien) );
|
||||
$filename = $filename_pasien."-".preg_replace( '/[^a-zA-Z0-9\-\.]+/', '', strtoupper($list_accession_number) );
|
||||
|
||||
header("Content-type: application/octet-stream");
|
||||
header('Content-Disposition: attachment; filename="'.$filename.'.iso"');
|
||||
|
||||
mkdir($dicomdir);
|
||||
mkdir("$dicomdir/DICOMDIR");
|
||||
|
||||
$cmd = "/bin/cp -r /var/www/html/microdicom/* ${dicomdir}/";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
|
||||
/*
|
||||
CR - Computed Radiography Image Storage
|
||||
CT - CT Image Storage
|
||||
MR - MRImageStorage
|
||||
US - Ultrasound Image Storage
|
||||
NM - Nuclear Medicine Image Storage
|
||||
PET - PET Image Storage
|
||||
SC - Secondary Capture Image Storage
|
||||
XA - XRay Angiographic Image Storage
|
||||
XRF - XRay Radiofluoroscopic Image Storage
|
||||
DX - Digital X-Ray Image Storage for Presentation
|
||||
MG - Digital Mammography X-Ray Image Storage for Presentation
|
||||
PR - Grayscale Softcopy Presentation State Storage
|
||||
KO - Key Object Selection Document Storage
|
||||
SR - Basic Text Structured Report Document Storage
|
||||
*/
|
||||
|
||||
$modalities["CR"] = 1;
|
||||
$modalities["CT"] = 1;
|
||||
$modalities["MR"] = 1;
|
||||
$modalities["US"] = 1;
|
||||
$modalities["NM"] = 1;
|
||||
$modalities["PET"] = 1;
|
||||
$modalities["SC"] = 1;
|
||||
$modalities["XA"] = 1;
|
||||
$modalities["XRF"] = 1;
|
||||
$modalities["DX"] = 1;
|
||||
$modalities["MG"] = 1;
|
||||
$modalities["PR"] = 1;
|
||||
$modalities["KO"] = 1;
|
||||
$modalities["SR"] = 1;
|
||||
|
||||
|
||||
|
||||
foreach($modalities as $cstore=>$v) {
|
||||
foreach($as as $accession_number) {
|
||||
$cmd = "JAVA_HOME=/usr/lib/jvm/jdk1.8.0_144 LANG=en_US.iso-8859-1 /usr/local/dcm4che/dcm4che2/bin/dcmqr -L CDRECORD:10104 ABPACS@localhost:11112 -cmove CDRECORD -qAccessionNumber=${accession_number} -cstore $cstore -cstoredest $dicomdir/DICOMDIR";
|
||||
exec($cmd, $outputRes);
|
||||
}
|
||||
}
|
||||
|
||||
$cmd = "/bin/rm -f ${filename}.iso";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
$cmd = "/usr/bin/genisoimage -iso-level 4 -r -allow-multidot -allow-lowercase -allow-leading-dots -V DICOM -o ${filename}.iso $dicomdir";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
$cmd = "/bin/rm -rf $dicomdir";
|
||||
exec($cmd, $outputRes);
|
||||
|
||||
readfile("${filename}.iso");
|
||||
unlink("${filename}.iso");
|
||||
exit(0);
|
||||
Binary file not shown.
Reference in New Issue
Block a user