query.keys = getQueryKeysforStudy( patient_id, bdisplay);
query.theRoot = gdcm::ePatientRootType;
query.theLevel = gdcm::eStudy;
- m_query = query;
+ m_query = getQueryPatient("",patient_id);
return query;
}
if(!bdisplay)
{
+ //Patient UID
+ keys.push_back(std::make_pair(gdcm::Tag (0x0010,0x0020), patient_id));
+
+ //Study UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000d), study_id));
// Study Instance UID
gdcm::Tag tagsid(0x0020,0x1209);
- keys.push_back(std::make_pair(tagsid, study_id));
+ // keys.push_back(std::make_pair(tagsid, study_id));
}
+ return keys;
+}
+
+void vvDicomServerQueryFactory::setQueryforImage(const std::string patient_id, const std::string study_id, const std::string series_id,const std::string image_id)
+{
+ vvQuery query;
+ query.theRoot = gdcm::ePatientRootType;
+ query.theLevel = gdcm::eImage;
+ query.keys = getQueryKeysforImage(patient_id, study_id, series_id, image_id);
+ m_query = query;
+}
+
+std::vector< std::pair<gdcm::Tag, std::string> > vvDicomServerQueryFactory::getQueryKeysforImage(const std::string patient_id, const std::string study_id, const std::string series_id,const std::string image_id)
+{
+
+ std::vector< std::pair<gdcm::Tag, std::string> > keys;
+
+ //Patient UID
+ keys.push_back(std::make_pair(gdcm::Tag (0x0010,0x0020), patient_id));
+
+ //Study UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000d), study_id));
+
+ //Series UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000e), series_id));
+
+ //SOP Instance UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x0018), image_id));
return keys;
}
\ No newline at end of file
vvQuery getQueryforSeries(const std::string patient_id, const std::string study_id, bool bdisplay);
vvQuery getQueryforStudy(const std::string patient_id, bool bdisplay);
vvQuery getQueryPatient(const std::string i_patname, const std::string i_patid);
-
+ void setQueryforImage(const std::string patient_id, const std::string study_id,const std::string series_id,const std::string image_id);
std::vector< std::pair<gdcm::Tag, std::string> > getQueryKeysforStudy(const std::string patient_id, bool bdisplay);
std::vector< std::pair<gdcm::Tag, std::string> > getPatientKeys(const std::string , const std::string );
std::vector< std::pair<gdcm::Tag, std::string> > getSeriesKeys(const std::string patient_id, const std::string study_id, bool bdisplay);
std::vector< std::pair<gdcm::Tag, std::string> > getQueryKeysforImages(const std::string patient_id, const std::string study_id, const std::string series_id,bool bdisplay);
+ std::vector< std::pair<gdcm::Tag, std::string> > getQueryKeysforImage(const std::string patient_id, const std::string study_id, const std::string series_id,const std::string image_id);
+
vvQuery getMoveQuery() { return m_query;}
Seriesmodel->setHorizontalHeaderLabels(Serieslist);
ui.seriesTreeView->setModel(Seriesmodel);
connect(ui.seriesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectImages(QModelIndex)));
-
+ connect(ui.imagesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectImage(QModelIndex)));
// Images Tree View
Imagesmodel = new QStandardItemModel(0,1,this);
QStringList Imageslist;
}
+void vvQPacsConnection::selectImage(const QModelIndex &index)
+{
+ std::string _image = Imagesmodel->data(index.sibling(index.row(),1)).toString().toStdString();
+ mQFactory.setQueryforImage(m_patient,m_study, m_series, _image);
+
+}
+
std::vector<gdcm::DataSet> vvQPacsConnection::findQuery(vvQuery i_query)
{
void selectStudies(const QModelIndex &index);
void selectSeries(const QModelIndex &index);
void selectImages(const QModelIndex &index);
+ void selectImage(const QModelIndex &index);
private slots:
void on_scanButton_clicked();
void on_clearButton_clicked();