Example #1
0
function GetClusterStats()
{
    //$statsoutput = explode("\n",shell_exec("ssh $pipeline_submithost qstat -f -u '*'"));
    $statsoutput = explode("\n", shell_exec("ssh compute01 qstat -f -u '*'"));
    PrintVariable($statsoutput);
    $hostname = $queue = "";
    $hostnames = $queues = null;
    foreach ($statsoutput as $line) {
        $line = trim($line);
        //echo $line;
        if (!strstr($line, '------')) {
            if (trim($line == "")) {
                break;
            }
            if (strstr($line, 'queuename')) {
                continue;
            }
            //echo "$line\n";
            if (strstr($line, '@')) {
                list($queuehost, $unk, $usage, $cpu, $arch) = preg_split('/\\s+/', $line);
                list($queue, $hostname) = explode('@', $queuehost);
                //echo "[$usage]\n";
                list($slotsres, $slotsused, $slotsavailable) = explode('/', $usage);
                //echo "Queue: [$queue], Host: [$hostname], [$slotsused] of [$slotsavailable], CPU: [$cpu]\n";
                $report[$hostname]['queues'][$queue] = null;
                $report[$hostname]['cpu'] = $cpu;
                $report[$hostname]['arch'] = $arch;
                $report[$hostname]['queues'][$queue]['slotsused'] = $slotsused;
                $report[$hostname]['queues'][$queue]['slotsavailable'] = $slotsavailable;
                if (!isset($hostnames) || !in_array($hostname, $hostnames)) {
                    $hostnames[] = $hostname;
                }
                if (!isset($queues) || !in_array($queue, $queues)) {
                    $queues[] = $queue;
                }
            } else {
                //echo "$line\n";
                $report[$hostname]['queues'][$queue]['jobs'][] = $line;
                $report[$hostname]['queues'][$queue]['slotsused'] = $slotsused;
                $report[$hostname]['queues'][$queue]['slotsavailable'] = $slotsavailable;
            }
        }
    }
    //print_r($hostnames);
    //print_r($queues);
    //print_r($report);
    sort($hostnames);
    sort($queues);
    return array($statsoutput, $report, $queues, $hostnames);
}
Example #2
0
	function RemoveGroupItem($itemid) {
		PrintVariable($itemid,'ItemID');
		
		foreach ($itemid as $item) {
			$sqlstring = "delete from group_data where subjectgroup_id = $item";
			//echo "$sqlstring<br>";
			$result = mysql_query($sqlstring) or die("Query failed: " . mysql_error() . "<br><i>$sqlstring</i><br>");
			?><div align="center"><span class="message">Item <?php 
echo $item;
?>
 deleted</span></div><?
		}
		return;
	}
Example #3
0
session_start();
?>

<html>
	<head>
		<link rel="icon" type="image/png" href="images/squirrel.png">
		<title>NiDB - Prescriptions</title>
	</head>

<body>
	<div id="wrapper">
<?php 
require "functions.php";
require "includes.php";
require "menu.php";
PrintVariable($_POST, 'POST');
/* ----- setup variables ----- */
$action = GetVariable("action");
$rxid = GetVariable("rxid");
$enrollmentid = GetVariable("enrollmentid");
$rxname = GetVariable('rx_name');
$rxdose = GetVariable('rx_dose');
$rxfreq = GetVariable('rx_freq');
$rxroute = GetVariable('rx_route');
$rxdatestart = GetVariable('rx_datestart');
$rxdateend = GetVariable('rx_dateend');
$rxrater = GetVariable('rx_rater');
/* determine action */
switch ($action) {
    case 'addrx':
        AddPrescription($enrollmentid, $rxname, $rxdose, $rxfreq, $rxroute, $rxdatestart, $rxdateend, $rxrater);
Example #4
0
	function DisplayMergeSubjects($mergeuids) {

		$i = 0;
		foreach ($mergeuids as $uid) {
			/* gather info for this uid and put into an array */
			$sqlstring = "select * from subjects where uid = '$uid'";
			$result = MySQLQuery($sqlstring, __FILE__, __LINE__);
			$row = mysql_fetch_array($result, MYSQL_ASSOC);
			$subjects[$i]['id'] = $row['subject_id'];
			$subjects[$i]['name'] = $row['name'];
			$subjects[$i]['dob'] = $row['birthdate'];
			$subjects[$i]['gender'] = $row['gender'];
			$subjects[$i]['ethnicity1'] = $row['ethnicity1'];
			$subjects[$i]['ethnicity2'] = $row['ethnicity2'];
			$subjects[$i]['handedness'] = $row['handedness'];
			$subjects[$i]['education'] = $row['education'];
			$subjects[$i]['phone1'] = $row['phone1'];
			$subjects[$i]['email'] = $row['email'];
			$subjects[$i]['maritalstatus'] = $row['maritalstatus'];
			$subjects[$i]['smokingstatus'] = $row['smokingstatus'];
			$subjects[$i]['uid'] = $row['uid'];
			$subjects[$i]['guid'] = $row['guid'];
			$subjects[$i]['cancontact'] = $row['cancontact'];
			
			/* get list of alternate subject UIDs */
			$altuids = GetAlternateUIDs($row['subject_id']);
			$subjects[$i]['altuid'] = implode2(',',$altuids);
			
			$i++;
		}
		
		PrintVariable($subjects);
		
		/* display one column for each subject with a radio button to "merge all studies into this subject" */
		?>
		<div style="border: 2px solid #870000; background-color: #FFFFBF; border-radius: 6px; padding: 5px; margin: 5px">
		<b>Leftmost UID is selected by default</b><bR>Select the UID you want to merge into and edit information in that column. Only the information in the selected column will be saved, and all other projects will be merged into that UID. All other UIDs will be deleted.
		</div>
		<br>
		<form action="subjects.php" method="post">
		<input type="hidden" name="action" value="mergesubjects">
		<table cellspacing="0" cellpadding="1">
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px black">UID</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						?>
							<td align="center" style="color: white; background-color: #0F4D92; font-weight: bold; border-right: 1px solid black"><input type="radio" name="selectedid" value="<?php 
echo $subjects[$i]['id'];
?>
" <? if ($i == 0) { echo "checked"; } ?>>&nbsp;<?php 
echo $subjects[$i]['uid'];
?>
</td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Name</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['name'] != $subjects[0]['name']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="name[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['name'];
?>
" required="required"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">DOB</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['dob'] != $subjects[0]['dob']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="dob[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['dob'];
?>
" required="required"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Sex</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['gender'] != $subjects[0]['gender']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="gender[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['gender'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Ethnicity 1</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['ethnicity1'] != $subjects[0]['ethnicity1']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="ethnicity1[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['ethnicity1'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Ethnicity 2</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['ethnicity2'] != $subjects[0]['ethnicity2']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="ethnicity2[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['ethnicity2'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Handedness</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['handedness'] != $subjects[0]['handedness']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="handedness[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['handedness'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Education</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['education'] != $subjects[0]['education']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="education[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['education'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Phone</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['phone1'] != $subjects[0]['phone1']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="phone1[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['phone1'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Email</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['email'] != $subjects[0]['email']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="email[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['email'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Marital Status</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['maritalstatus'] != $subjects[0]['maritalstatus']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="maritalstatus[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['maritalstatus'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Smoking Status</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['smokingstatus'] != $subjects[0]['smokingstatus']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="smokingstatus[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['smokingstatus'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">GUID</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['guid'] != $subjects[0]['guid']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="guid[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['guid'];
?>
"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray; white-space:nowrap;">Alternate UID 1</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['altuid'] != $subjects[0]['altuid']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="altuid[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['altuid'];
?>
" required="required"></td>
						<?
					}
				?>
			</tr>
			<tr>
				<td style="text-align: right; font-weight: bold; border-right: solid 2px gray">Can contact?</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
						if ($subjects[$i]['cancontact'] != $subjects[0]['cancontact']) { $bgcolor = "#FFFFBF"; } else { $bgcolor = ""; }
						?>
							<td bgcolor="<?php 
echo $bgcolor;
?>
" style="border-right: 1px solid gray"><input type="text" name="cancontact[<?php 
echo $subjects[$i]['id'];
?>
]" value="<?php 
echo $subjects[$i]['cancontact'];
?>
"></td>
						<?
					}
				?>
			</tr>
			
				<td style="text-align: right; vertical-align: top; font-weight: bold; border-right: solid 2px gray">Studies</td>
				<?
					for ($i=0;$i<count($subjects);$i++) {
					?>
						<td valign="top" style="border-right: 1px solid gray">
							<table cellspacing="0" cellpadding="0">
								<?
									$sqlstring = "select a.*, b.*, date(enroll_startdate) 'enroll_startdate', date(enroll_enddate) 'enroll_enddate' from enrollment a left join projects b on a.project_id = b.project_id where a.subject_id = " . $subjects[$i]['id'];
									$result = MySQLQuery($sqlstring, __FILE__, __LINE__);
									while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
										$enrollmentid = $row['enrollment_id'];
										//$enroll_startdate = $row['enroll_startdate'];
										//$enroll_enddate = $row['enroll_enddate'];
										$project_name = $row['project_name'];
										$costcenter = $row['project_costcenter'];
										//$project_enddate = $row['project_enddate'];
										
										if ($row['irb_consent'] != "") { $irb = "Y"; }
										else { $irb = "N"; }
								?>
								<tr>
									<td colspan="4" style="font-size:9pt; border-bottom: 1px solid gray; background-color:lightyellow"><b><?php 
echo $project_name;
?>
</b> (<?php 
echo $costcenter;
?>
)</td>
								</tr>
									<?
									$sqlstring = "select * from studies where enrollment_id = $enrollmentid";
									//$result2 = mysql_query($sqlstring) or die("Query failed: " . mysql_error() . "<br><i>$sqlstring</i><br>");
									$result2 = MySQLQuery($sqlstring, __FILE__, __LINE__);
									if (mysql_num_rows($result2) > 0) {
										while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
											$study_id = $row2['study_id'];
											$study_num = $row2['study_num'];
											$study_modality = $row2['study_modality'];
											$study_datetime = $row2['study_datetime'];
											$study_operator = $row2['study_operator'];
											$study_performingphysician = $row2['study_performingphysician'];
											$study_site = $row2['study_site'];
											$study_status = $row2['study_status'];
											
											?>
											<tr style="font-size: 8pt">
												<td style="border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; padding: 1px 5px"><?php 
echo $study_num;
?>
</td>
												<td style="border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; padding: 1px 5px"><?php 
echo $study_modality;
?>
</td>
												<td style="border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; padding: 1px 5px"><?php 
echo $study_datetime;
?>
</td>
												<td style="border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; padding: 1px 5px"><?php 
echo $study_site;
?>
</td>
											</tr>
											<?
										}
									}
									else {
										?>
										<tr>
											<td align="center">
												None
											</td>
										</tr>
										<?
									}
								}
								?>
							</table>
						</td>
					<?
					}
				?>
			</tr>
			<tr>
				<td colspan="<?php 
echo count($subjects) + 1;
?>
" align="center" style="border-top: 2px solid gray; border-bottom: 2px solid gray">
					<br>
					<input type="submit" value="Merge">
					<br><br>
				</td>
			</tr>
		</table>
		</form>
		<?
	}
Example #5
0
session_start();
?>

<html>
	<head>
		<link rel="icon" type="image/png" href="images/squirrel.png">
		<title>NiDB - Manage Instance</title>
	</head>

<body>
	<div id="wrapper">
<?php 
require "functions.php";
require "includes.php";
require "menu.php";
PrintVariable($_POST);
/* ----- setup variables ----- */
$action = GetVariable("action");
$id = GetVariable("instanceid");
$contactid = GetVariable("contactid");
$contactfullname = GetVariable("contactfullname");
$contacttitle = GetVariable("contacttitle");
$contactaddress1 = GetVariable("contactaddress1");
$contactaddress2 = GetVariable("contactaddress2");
$contactaddress3 = GetVariable("contactaddress3");
$contactcity = GetVariable("contactcity");
$contactstate = GetVariable("contactstate");
$contactcountry = GetVariable("contactcountry");
$contactphone1 = GetVariable("contactphone1");
$contactphone2 = GetVariable("contactphone2");
$contactphone3 = GetVariable("contactphone3");