To make the FindXxxx methods properly query the tutorial database, you must customize the FillMatchingParameters() method so that it builds a MatchingParameterList consisting of your custom ICatalogEntity classes (MyPatient, MyStudy, MySeries, MyInstance) with the properties filled with the corresponding values from the QueryOptions properties. The following version of FillMatchingParameters() achieves this for the tutorial database schema:
public static void FillMatchingParameters(QueryOptions query, MatchingParameterList matchingList)
{
// if we have patient options then create a DB Patient object for matching and copy the values
if (
(query.PatientsOptions != null) &&
(!string.IsNullOrEmpty(query.PatientsOptions.PatientID) ||
!string.IsNullOrEmpty(query.PatientsOptions.PatientName))
)
{
MyPatient patient = new MyPatient();
patient.PatientIdentification =
(!string.IsNullOrEmpty(query.PatientsOptions.PatientID)) ? query.PatientsOptions.PatientID : null;
if (!string.IsNullOrEmpty(query.PatientsOptions.PatientName))
{
patient.PatientName = query.PatientsOptions.PatientName;
}
matchingList.Add(patient);
}
// if we have study options then create a DB study object for matching and copy the values
if ((query.StudiesOptions != null) && (
!string.IsNullOrEmpty(query.StudiesOptions.AccessionNumber) ||
!string.IsNullOrEmpty(query.StudiesOptions.ReferDoctorName) ||
!string.IsNullOrEmpty(query.StudiesOptions.StudyDateStart) ||
!string.IsNullOrEmpty(query.StudiesOptions.StudyDateEnd) ||
!string.IsNullOrEmpty(query.StudiesOptions.StudyID) ||
!string.IsNullOrEmpty(query.StudiesOptions.StudyInstanceUID) ||
(query.StudiesOptions.ModalitiesInStudy != null &&
query.StudiesOptions.ModalitiesInStudy.Length > 0)))
{
MyStudy study = new MyStudy();
study.StudyAccessionNumber =
(!string.IsNullOrEmpty(query.StudiesOptions.AccessionNumber)) ? query.StudiesOptions.AccessionNumber : null;
study.StudyStudyId =
(!string.IsNullOrEmpty(query.StudiesOptions.StudyID)) ? query.StudiesOptions.StudyID : null;
study.StudyStudyInstanceUID =
(!string.IsNullOrEmpty(query.StudiesOptions.StudyInstanceUID)) ? query.StudiesOptions.StudyInstanceUID : null;
if (!string.IsNullOrEmpty(query.StudiesOptions.ReferDoctorName))
{
study.StudyReferringPhysiciansName = query.StudiesOptions.ReferDoctorName;
}
if (!string.IsNullOrEmpty(query.StudiesOptions.StudyDateStart) || !string.IsNullOrEmpty(query.StudiesOptions.StudyDateEnd))
{
study.StudyStudyDate = new DateRange();
AddInsUtils.FillDateRangeInfo(query.StudiesOptions.StudyDateStart, query.StudiesOptions.StudyDateEnd, study.StudyStudyDate);
}
matchingList.Add(study);
if (query.StudiesOptions.ModalitiesInStudy != null && query.StudiesOptions.ModalitiesInStudy.Length > 0)
{
MySeries series = new MySeries();
series.SeriesModality = string.Join("\\", query.StudiesOptions.ModalitiesInStudy);
matchingList.Add(series);
}
}
// Series query options
if ((query.SeriesOptions != null) && (
!string.IsNullOrEmpty(query.SeriesOptions.SeriesInstanceUID) ||
!string.IsNullOrEmpty(query.SeriesOptions.SeriesNumber) ||
(null != query.SeriesOptions.Modality)))
{
MySeries series = new MySeries();
series.SeriesSeriesInstanceUID =
(!string.IsNullOrEmpty(query.SeriesOptions.SeriesInstanceUID)) ? query.SeriesOptions.SeriesInstanceUID : null;
series.SeriesSeriesNumber =
(!string.IsNullOrEmpty(query.SeriesOptions.SeriesNumber)) ? query.SeriesOptions.SeriesNumber : null;
if (!string.IsNullOrEmpty(query.SeriesOptions.Modality))
{
series.SeriesModality = query.SeriesOptions.Modality;
}
matchingList.Add(series);
}
// Instance query options
if ((null != query.InstancesOptions) && (
!string.IsNullOrEmpty(query.InstancesOptions.InstanceNumber) ||
!string.IsNullOrEmpty(query.InstancesOptions.SOPInstanceUID)))
{
MyInstance instance = new MyInstance();
instance.SOPInstanceUID =
(!string.IsNullOrEmpty(query.InstancesOptions.SOPInstanceUID)) ? query.InstancesOptions.SOPInstanceUID : null;
string sImageNumber =
(!string.IsNullOrEmpty(query.InstancesOptions.InstanceNumber)) ? query.InstancesOptions.InstanceNumber : null;
int nImageNumber = 0;
if (int.TryParse(sImageNumber, out nImageNumber))
{
instance.ImageImageNumber = nImageNumber;
}
matchingList.Add(instance);
}
}
Products |
Support |
Feedback: FillMatchingParameters Method |
Introduction |
Help Version 19.0.2017.6.21
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.