Sign in
RadiAnt DICOM Viewer - Discussion Forum
query "Patient Name + DOB" in the PACS search panel

Dec 17, 2017 09:17 AM
by Tommy
I wonder if it's possible to hack the PACS search panel .xml in order to set up a custom field made up of Patient Name and Date of birth in the same line.

let's say I wanna search JOHN^DOE born the 27th march 1955...
actually I can only search the namne JOHN^DOE and the query results contain all the patients with that name, even those wha have a different DOB.
Dec 19, 2017 05:20 PM
by RadiAnt
No, this is not possible in the PACS search window.
You could only run such search via command line parameters.
Apr 6, 2020 01:49 PM
by Tommy
could you please provide a syntax example of such a command-line query?
Apr 7, 2020 10:03 AM
by RadiAnt
Something like this should do the trick:

radiantviewer.exe -pstv 00100030 "19550327" -pstv 00100010 "JOHN^DOE"
Apr 7, 2020 11:58 AM
by Guest
Ok, I already know the -ptsv argument...

it let's you download and display from PACS the cases you wanna see.

my questiuon was a little bit different...

I don't wanna download and display cases using the command line (I already know how to do it and I have a macro for that)

I want to know if there's a similar argument and syntax to just query the database and get results without donwnloading images.

in my scenario I'd query the database searching for a certain patient name and DOB, in order to get the full list of studies he/she has done in the past.


Apr 7, 2020 01:23 PM
by RadiAnt
Currently there is no such option to just run a specific query without downloading the studies. We'll think about it.
Apr 7, 2020 01:53 PM
by Guest
that would be a bless...

as I told you, I wrote a macro to link my medical reports to the images using commandline

basically in our report database the filenames follow this simple syntax:

SURNAME^NAME_DOB_EXAMDATE_MODALITY

so when I open the file:
DOE^JOHN_011076_200719_rad.odt

the macro extracts the patient's name and exam date from the filename and launches RadiAnt to search and load in the viewer the corresponding images.


if a commandline query argument would exist I could extract patient name and DOB from a report and then do an automatic query inside the PACS looking for previous studies.




here's the code, it's written in StarBASIC (comments are in italian but the code is pretty straightforward) and manipulates filenames strings in order to build a custom commandline .bat file for RadiAnt


Sub RadiAntLoad ' carica le immagini del referto su RadiAnt DICOM Viewer
' estra il filename corrente - es. "CICCIO^BELLO_010256_220712_rad.odt"
FileNameCorrente = URLDecode(thisFileName)
' indentifica la posizione del primo "_" es. 13
Dim PosizioneSeparatore as integer
PosizioneSeparatore = Instr (FileNameCorrente, "_")
' identifica la posizione finale del nome pz. che è un carattere prima del "_"
PosizioneNome = PosizioneSeparatore -1 ' es. 13-1 = 12
' estrae il nome pz. dal filename es. "CICCIO^BELLO"
NomePaziente = Left (FileNameCorrente, PosizioneNome)
' identifica la posizione finale della data di nascita del pz. che è 7 caratteri dopo il nome "_010256"
PosizioneNomeDataNascita = PosizioneNome +7
' estrae il nome pz. e data di nascita dal filename - es. "CICCIO^BELLO_010256_"
NomePazienteDataNascita = Left (FileNameCorrente, PosizioneNomeDataNascita)
' estrae la data di nascita del paziente - es. 010256
DataNascita = Mid (NomePazienteDataNascita, PosizioneSeparatore +1, 6)

' estrae la data d'esame con suffisso del tipo esame ed estensione - es. 220712_rad.odt
' e scompone la stringhe nelle corrispondenti sottostringe
DataEsameTipoEsameEstensione = Right (FileNameCorrente, 14)
DataEsame= Left (DataEsameTipoEsameEstensione, 6) ' es. 220712
TipoEsame= Mid (DataEsameTipoEsameEstensione, 7, 3) ' es. rad

' converte la data esame dal formato GGMMAA al formato AAAAMMGG richiesto dal PACS
GiornoEsame = Left (DataEsame, 2) '22
MeseEsame = Mid (DataEsame, 3, 2) '07
AnnoEsame = Right (DataEsame, 2) '12
DataEsamePACS = "20" + AnnoEsame + MeseEsame + GiornoEsame '20120722

' converte la data di nascita dal formato GGMMAA al formato AAAAMMGG richiesto dal PACS
GiornoNascita = Left (DataNascita, 2) '01
MeseNascita = Mid (DataNascita, 3, 2) '02
AnnoNascita = Right (DataNascita, 2) '56
' l'anno di nascita va formattato secondo il secolo 1900 o 2000
AnnoCorrente=year(now) mod 100 ' es. 20
'Se YY nascita > YY corrente, aggiungo 1900 altrimenti aggiungo 2000
AnnoNascitaPACS = Cstr(iif(val(AnnoNascita) > AnnoCorrente, 1900, 2000) +AnnoNascita)
'es. 56>20 = 1900+56 = 1956
'es. 06<20 = 2000+06 = 2006

DataNascitaPACS = AnnoNascitaPACS + AnnoNascita + MeseNascita + GiornoNascita '19560201

dim Load as string
Load = RadiAntExe + " -pstv 00100010 " + """" + NomePaziente + """" + " -pstv 00080020 " + """" + DataEsamePACS + """"


' crea un file .bat per eliminare i collegamenti (.lnk)
Dim FileNo as Integer
Dim Filename as String
Filename = "C:\ZB\REFERTI_TEMP\RadiAnt_Load.bat"
' apre il file (writing mode) e vi inserisce le istruzioni
FileNo = FreeFile
Open Filename For Output As #FileNo
Print #FileNo, Load
Close #FileNo
' esegue il file .bat
Dim oSvc as object
oSvc = createUnoService("com.sun.star.system.SystemShellExecute")
oSvc.execute(ConvertToUrl("C:\ZB\REFERTI_TEMP\RadiAnt_load.bat"), "", 0)
Wait 1000
' elimina il file .bat
Kill Filename

end sub







Apr 9, 2020 05:22 PM
by Tommy
previous post written by me
Apr 10, 2020 08:52 AM
by RadiAnt
Ok. It is possible that we add such option in one of the next beta versions.
Feb 7, 2021 10:27 AM
by Tommy
just a reminder
Feb 11, 2021 04:55 PM
by RadiAnt
Ok. But I'm not sure if it makes to the next beta...
Jan 27, 2023 09:32 AM
by Tommy
any news about querying database with patient name and DOB ?

what about a wildcard like "*"

i.e. JOHN^DOE*110376

which will search images about JOHN DOE born on the 11th march 1976
Feb 2, 2023 06:51 AM
by Tommy
sweet
Post reply
Author (first name or pseudonym):

Message:

Captcha image


Visitors can post messages on the forum without having to register. Please input your first name or pseudonym in the "Author" field. Do not publish any personally identifiable information (PII).

Please ensure you write your posts in English so that our international audience can understand and reply to your message.

The Administrator reserves the right to remove any messages that violate our forum rules; for example, those that are not related to the RadiAnt DICOM Viewer software, published in a language other than English, contravene regulations, etc.