How can i retrive current patient information using java code

71 views
Skip to first unread message

nihel turki

unread,
Dec 5, 2015, 3:34:11 AM12/5/15
to dcm4che
Hi,
How can i retrive current patient information using java code? i tried this code but it returned null for some informations.
 
               String   PatientName= eventManager.getSelectedSeries().getTagValue(TagW.PatientName);            //not null
               String   PatientBirthDate=eventManager.getSelectedSeries().getTagValue(TagW.PatientBirthDate);   //null value
               String     PatientID=eventManager.getSelectedSeries().getTagValue(TagW.PatientID);                             //null value
               String    PatientSex=eventManager.getSelectedSeries().getTagValue(TagW.PatientSex);                         //null value
               String   PatientAge=eventManager.getSelectedSeries().getTagValue(TagW.PatientAge);                             //null value
               String  InstitutionName=eventManager.getSelectedSeries().getTagValue(TagW.InstitutionName);          //not null
               String  StudyDescription=eventManager.getSelectedSeries().getTagValue(TagW.StudyDescription);        //not null
               String     StudyID=eventManager.getSelectedSeries().getTagValue(TagW.StudyID);                                //null value
               String   StudyDate=eventManager.getSelectedSeries().getTagValue(TagW.StudyDate);                              //null value
               String    SeriesNumber=eventManager.getSelectedSeries().getTagValue(TagW.SeriesNumber);                   //not null
               String   SeriesDescription=eventManager.getSelectedSeries().getTagValue(TagW.SeriesDescription);             //null value

Dimitri Pianeta

unread,
Dec 7, 2015, 8:15:09 AM12/7/15
to dcm4che

You use dcm4che2 or dcm4che3 for reading metadata for patient information.


nihel turki

unread,
Dec 7, 2015, 10:03:26 AM12/7/15
to dcm4che
I'm not using dcm4che. I'm just  getting  DICOM Image from Conquest DICOM server and i found a solution using this code:

             DataExplorerView dicomView = org.weasis.core.ui.docking.UIManager.getExplorerplugin(DicomExplorer.NAME);
              DicomModel model = (DicomModel) dicomView.getDataExplorerModel();
             MediaSeries<org.weasis.dicom.codec.DicomImageElement> s = eventManager.getSelectedSeries(); 
             MediaSeriesGroup patient= model.getParent(s, DicomModel.patient);
             MediaSeriesGroup study= model.getParent(s,DicomModel.study);

             
                  String infoPatient="";
                  infoPatient+=patient.getTagValue(TagW.PatientName)+"*";
                  Date PatientBirthDate=(Date) patient.getTagValue(TagW.PatientBirthDate);
                  infoPatient+=PatientBirthDate.getDate()+" "+PatientBirthDate.getMonth()+" "+PatientBirthDate.getYear()+"*";
                  infoPatient+=patient.getTagValue(TagW.PatientID)+"*";
                  infoPatient+=patient.getTagValue(TagW.PatientSex)+"*";
                  infoPatient+=patient.getTagValue(TagW.PatientAge)+"*";
                  JOptionPane.showMessageDialog(metaButton, infoPatient); 
                  
                  String infoStudy="";
                  infoStudy+=s.getTagValue(TagW.InstitutionName)+"*";
                  infoStudy+=s.getTagValue(TagW.StudyDescription)+"*";
                  infoStudy+=study.getTagValue(TagW.StudyID)+"*";
                  Date StudyDate=(Date)study.getTagValue(TagW.StudyDate);
                  infoPatient+=StudyDate.getDate()+" "+StudyDate.getMonth()+" "+StudyDate.getYear()+"*";
                  JOptionPane.showMessageDialog(metaButton,  infoStudy); 
                  
                  String infoSerie="";
                  infoSerie+=s.getTagValue(TagW.SeriesNumber)+"*";
                  infoSerie+=s.getTagValue(TagW.SeriesDescription)+"*";  

Thanks for replying.

Dimitri Pianeta

unread,
Dec 7, 2015, 11:41:39 AM12/7/15
to dcm4che
Seeing in source weavis here  and the class ModalityView.
I  will find in the code source as image demo of sofware.
Good luck,
screen10_1.jpg
Reply all
Reply to author
Forward
0 new messages