Page 1 of 1

Bacic PHP help needed, to shut up a Madonn...I mean Doctor.

Posted: Wed Aug 02, 2006 10:56 pm
by Farwest
After logging into PacsOne the users are taken to home.php, which has the Patient ID and the Study ID columns, clicking on the patient ID just takes us to another page to click another link (study ID) and that takes us to where we need to be. It seems like it an un-needed step. It is the same thing in browse.php, you click on the Patient ID to go to a page to click on another link to get to the patient data (from browse.php to study.php to get to series.php).
We need the Patient ID but don’t need the Study ID however it would be nice to have the study ID link attached to the patient ID on the browse page.
I tried this today, changing line 183
printf("\t<td>%s<a href='study.php?patientId=%s'>%s</a></font></td>\n",
To
printf("\t<td>%s<a href='series.php?patientId=%s&studyId=%s'>%s</a></font></td>\n",
Of course this didn’t work.
So I basically have;
if (strcasecmp($key, "Patient ID") == 0) {
$value = strlen($field)? $field : "(Blank)";
printf("\t<td>%s<a href='series.php?patientId=%s&studyId=%s'>%s</a></font></td>\n",
$MYFONT, urlencode($field), $value);


Any help with this would be great.
Thanks in advance

Posted: Wed Aug 02, 2006 11:11 pm
by Farwest
I found it easier on my users to just log in and be taken to browse.php instead of home.php ( I know I know but I guess that one extra click was a huge deal).
Any way now I just need the Patient ID link to take me to //localhost/PacsOne/series.php?patientId=%s&studyId=%s

I really have no clue what im doing here.

Posted: Thu Aug 03, 2006 1:56 am
by pacsone
The Home page shows all accessible studies received today, while the Browse page shows all accessible patients in the database.

So if you browse from the Home page, you will navigate through a Study->Series->Instances hierarchy. If you browse from the Browse page, you will navigate through the Patient->Study->Series->Instances hierarchy.

The Patient ID link on the Home page is necessary, because a patient may have multiple studies and not all of them may be listed on the Home page, so clicking on the Patient ID link will let you see all studies of that particular patient.

Posted: Thu Aug 03, 2006 2:35 am
by Farwest
Im not to worried about duplicate patient names because I already have two patients with the same name and because the Patient ID's are not the same they dont seem to conflict.
Even if the same patient has multiple studies they will always have different Patient ID's. for each study.
Am I wrong in my thinking that this would alow me to get away with skipping study.php?
Thanks for the response.

Posted: Thu Aug 03, 2006 2:40 am
by pacsone
There are more information displayed by "study.php", such as Accession Number, Study Date/Time, Description, etc, so skipping that page may not be a good idea for all users.

Posted: Thu Aug 03, 2006 3:14 am
by Farwest
Sorry I wasn't a bit more clear, perhaps I posted this in the wrong place,
I don't want this to be a change you make in the downloadable version of PacsOne.
This is a change I want to make on my system, to ease the use for our users.
I apologize for the confusion, I am just looking for some basic PHP support for my PacsOne configuration.
I don't suspect any sane person would want to make some of the PHP changes I have made.

Posted: Thu Aug 03, 2006 11:53 am
by pacsone
There is a side effect if you make any customizations to the original PacsOne distrubutions, as you will need to keep track of the source code version changes yourself for any modified/customized files, since we do not keep track of customized files.

So the next time you upgrade to a newer version of PacsOne Server, you will need to resort to your revision control system and re-apply the same customizations to the newer version of the modified files.

Posted: Thu Aug 03, 2006 1:50 pm
by Farwest
Agreed, in fact I did have to do quite a bit of work to get the last update installed.
I have been keeping a log of changes and there effects ever since.

As for the PHP changes, I’m sure that I changed the link correctly,
The old link

printf("\t<td>%s<a href='study.php?patientId=%s'>%s</a></font></td>\n",

Was changed to

printf("\t<td>%s<a href='series.php?patientId=%s&studyId=%s'>%s</a></font></td>\n",

The problem seems to be that the code does not know where to find the study id.
I need the patient ID to stay, I just need the link to be directed to the study.php page with the patients , “patient ID and study ID” so the series numbers will show.

Any ideas on what I’m doing wrong? Perhaps im missing a line that will tell the link where to get the study ID from?
Any help would be great.
Thanks Again.

Posted: Thu Aug 03, 2006 2:41 pm
by pacsone
Farwest wrote: printf("\t<td>%s<a href='series.php?patientId=%s&studyId=%s'>%s</a></font></td>\n",
What variables are you using for the 3 %s in the above printf() line?

Posted: Thu Aug 03, 2006 3:43 pm
by Farwest
What variables are you using for the 3 %s in the above printf() line?
As you can see Im lost, I dont need the "sex" row so I tried to replace it with the "Study ID", I thought that might help me understand my link problem, It made my understanding worse.

Please note; I changed the link back so the system would work.

$columns["Patient ID"] = $patientId;
$columns["Patient Name"] = $row["firstname"] . " ";
if ($row["middlename"])
$columns["Patient Name"] .= $row["middlename"] . " ";
$columns["Patient Name"] .= $row["lastname"];
$columns["Birth Date"] = $row["birthdate"];
$columns["Study ID"] = $row["studyId"];
$columns["Age"] = $row["age"];
foreach ($columns as $key => $field) {
if (isset($field))
{
if (strcasecmp($key, "Patient ID") == 0) {
$value = strlen($field)? $field : "(Blank)";
printf("\t<td>%s<a href='series.php?patientId=%s&studyId=%s'>%s</a></font></td>\n",
$MYFONT, urlencode($field), $value);
}
else
printf("\t<td>%s%s</font></td>\n", $MYFONT, $field);
}
else
printf("\t<td>%sN/A</font></td>\n", $MYFONT);
}
print "<td>$MYFONT<a href='patient.php?patientId=$urlId'>Patient Report</a></font></td>\n";
if ($duplicates) {
if ($modifyAccess)
print "\t<td>$MYFONT<a href='resolveDup.php?duplicate=$urlId'>Resolve</a></font></td>\n";
else
print "\t<td>$MYFONT" . "Resolve</font></td>\n";
}
print "</tr>\n";
}
print "</table>\n";

Posted: Fri Aug 04, 2006 10:46 am
by pacsone
You will not be able to goto the Series list from this Browse page directly, because a patient may have multiple studies. So you will need to select a particular study first (that's what the Study page is for) before you can jump into the series list.