Database Mapping for the Database Manager

The Database Manager UI allows the user to display the patient, study, series, and instance information stored in the database.  The user can refine the search results by specifying search criteria (i.e. Patient ID, modality, Study ID, Accession Number, etc.).

There are two steps to making the Database Manager work properly with a custom database schema:

  1. Specify the column and column data for each display level
    1. Patient Level
    2. Study Level
    3. Series Level
    4. Image Level
  2. Assign the StorageDatabaseManager.PrepareSearch delegate to a custom search method that uses the new database schema.

Step 1: Specifying the column and column data for each display level

The Database Manager in the shipping version of the CSStorageServerManagerDemo is shown below.

 

 

Note the seven columns displayed for Patient Level.

For each level (Patient, Study, Series, Instance), different columns are displayed.  The table below summarizes the columns displayed for each level.  There are four configuration files that determine which columns are displayed (one for each display level).   If the configuration file does not already exist in the same directory as the CSStorageServerManagerDemo.exe, then a default version is generated the first time the database manager is displayed at that particular level.

Display Level

Columns Displayed

Configuration File

Patient Level

  • Patient ID
  • Last Name
  • First Name
  • Middle Name
  • Name Previx
  • Name Suffix
  • Birth Date
  • Sex
  • Ethnic Group
  • Comments

PatientLevel.xml

Study Level

  • Patient ID
  • Last Name
  • First Name
  • Birth Date
  • Sex
  • Study Instance UID
  • Study Date
  • Accession Number
  • Study ID
  • Refer. Dr. Last Name
  • Refer. Dr. First Name
  • Refer.Dr. Middle Name
  • Refer.Dr. Prefix
  • Refer.Dr. NameSuffix
  • Study Description
  • Admin.Diag. Desc
  • Patient Age
  • Patient Size
  • Patient Weight
  • Occupation
  • Add.Patient History
  • Interp Auth

StudiesLevel.xml

Series Level

  • Patient ID
  • Last Name
  • First Name
  • Birth Date
  • Sex
  • Study Instance UID
  • Study Date
  • Accession Number
  • StudyID
  • Refer. Dr. Last Name
  • Refer.Dr. First Name
  • Series Instance UID
  • Modality
  • Series Number
  • Series Date
  • Series Description
  • Institution Name

SeriesLevel.xml

Instance Level

  • Patient ID
  • Last Name
  • First Name
  • Birth Date
  • Sex
  • Study Instance UID
  • Study Date
  • Accession Number
  • Study ID
  • Refer. Dr. Last Name
  • Refer. Dr. First Name
  • Series Instance UID
  • Modality
  • Series Number
  • Series Date
  • Series Description
  • Institution Name
  • SOP Insatnce UID
  • Instance Number
  • Referenced File
  • Transfer Syntax
  • Station Name
  • Receive Date
  • AE Title

ImagesLevel.xml

The configuration files contain <mappingTable> elements that specify the columns to display.  The format of the <mappingTable> element is:

  <mappingTable>

    <ColumnName>PatientIdentification</ColumnName>

    <FriendlyName>Patient ID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

Mapping Table Element

Description

ColumnName

 

The column name of the DatabaseTable.  This corresponds to the <EntityKey> element value in the storage catalog file (MyCatolog.xml), which in turn identifies the DataTable name, and the actual DataTable.Column name.

 

FriendlyName

 

The name of column displayed in the Database Manager

 

Type

The type of the field

Visible

 

Set this to ‘true’ to show the column in the Database Manager.  Set to ‘false’ to hide the column.

For the tutorial database, the Database Manager Configuration files need to be modified as follows:

PatientLevel.xml

<?xml version="1.0" standalone="yes"?>

<NewDataSet>

  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">

      <xs:complexType>

        <xs:choice minOccurs="0" maxOccurs="unbounded">

          <xs:element name="mappingTable">

            <xs:complexType>

              <xs:sequence>

                <xs:element name="ColumnName" type="xs:string" minOccurs="0" />

                <xs:element name="FriendlyName" type="xs:string" minOccurs="0" />

                <xs:element name="Type" msdata:DataType="System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />

                <xs:element name="Visible" type="xs:boolean" minOccurs="0" />

              </xs:sequence>

            </xs:complexType>

          </xs:element>

        </xs:choice>

      </xs:complexType>

    </xs:element>

  </xs:schema>

  <mappingTable>

    <ColumnName>PatientIdentification</ColumnName>

    <FriendlyName>Patient ID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientName</ColumnName>

    <FriendlyName>Last Name</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientBirthDay</ColumnName>

    <FriendlyName>Birth Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientSex</ColumnName>

    <FriendlyName>Sex</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientComments</ColumnName>

    <FriendlyName>Comments</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

</NewDataSet

StudiesLevel.xml

<?xml version="1.0" standalone="yes"?>

<NewDataSet>

  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">

      <xs:complexType>

        <xs:choice minOccurs="0" maxOccurs="unbounded">

          <xs:element name="mappingTable">

            <xs:complexType>

              <xs:sequence>

                <xs:element name="ColumnName" type="xs:string" minOccurs="0" />

                <xs:element name="FriendlyName" type="xs:string" minOccurs="0" />

                <xs:element name="Type" msdata:DataType="System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />

                <xs:element name="Visible" type="xs:boolean" minOccurs="0" />

              </xs:sequence>

            </xs:complexType>

          </xs:element>

        </xs:choice>

      </xs:complexType>

    </xs:element>

  </xs:schema>

  <mappingTable>

    <ColumnName>PatientIdentification</ColumnName>

    <FriendlyName>Patient ID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientName</ColumnName>

    <FriendlyName>Last Name</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientBirthDay</ColumnName>

    <FriendlyName>Birth Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientSex</ColumnName>

    <FriendlyName>Sex</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyInstanceUID</ColumnName>

    <FriendlyName>Study Instance UID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyDate</ColumnName>

    <FriendlyName>Study Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyAccessionNumber</ColumnName>

    <FriendlyName>Accession Number</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyId</ColumnName>

    <FriendlyName>Study ID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyDescription</ColumnName>

    <FriendlyName>Study Description</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyReferringPhysiciansName</ColumnName>

    <FriendlyName>Referring Physician</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

</NewDataSet>

   

SeriesLevel.xml

<?xml version="1.0" standalone="yes"?>

<NewDataSet>

  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">

      <xs:complexType>

        <xs:choice minOccurs="0" maxOccurs="unbounded">

          <xs:element name="mappingTable">

            <xs:complexType>

              <xs:sequence>

                <xs:element name="ColumnName" type="xs:string" minOccurs="0" />

                <xs:element name="FriendlyName" type="xs:string" minOccurs="0" />

                <xs:element name="Type" msdata:DataType="System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />

                <xs:element name="Visible" type="xs:boolean" minOccurs="0" />

              </xs:sequence>

            </xs:complexType>

          </xs:element>

        </xs:choice>

      </xs:complexType>

    </xs:element>

  </xs:schema>

  <mappingTable>

    <ColumnName>PatientIdentification</ColumnName>

    <FriendlyName>Patient ID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientName</ColumnName>

    <FriendlyName>Last Name</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientBirthDay</ColumnName>

    <FriendlyName>Birth Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientSex</ColumnName>

    <FriendlyName>Sex</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyInstanceUID</ColumnName>

    <FriendlyName>Study Instance UID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyDate</ColumnName>

    <FriendlyName>Study Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyAccessionNumber</ColumnName>

    <FriendlyName>Accession Number</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyId</ColumnName>

    <FriendlyName>Study ID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyDescription</ColumnName>

    <FriendlyName>Study Description</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyReferringPhysiciansName</ColumnName>

    <FriendlyName>Referring Physician</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesSeriesInstanceUID</ColumnName>

    <FriendlyName>Series Instance UID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesModality</ColumnName>

    <FriendlyName>Modality</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesSeriesNumber</ColumnName>

    <FriendlyName>Series Number</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesSeriesDate</ColumnName>

    <FriendlyName>Series Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesSeriesDescription</ColumnName>

    <FriendlyName>Series Description</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

</NewDataSet>

ImagesLevel.xml

<?xml version="1.0" standalone="yes"?>

<NewDataSet>

  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">

      <xs:complexType>

        <xs:choice minOccurs="0" maxOccurs="unbounded">

          <xs:element name="mappingTable">

            <xs:complexType>

              <xs:sequence>

                <xs:element name="ColumnName" type="xs:string" minOccurs="0" />

                <xs:element name="FriendlyName" type="xs:string" minOccurs="0" />

                <xs:element name="Type" msdata:DataType="System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />

                <xs:element name="Visible" type="xs:boolean" minOccurs="0" />

              </xs:sequence>

            </xs:complexType>

          </xs:element>

        </xs:choice>

      </xs:complexType>

    </xs:element>

  </xs:schema>

  <mappingTable>

    <ColumnName>PatientIdentification</ColumnName>

    <FriendlyName>Patient ID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientName</ColumnName>

    <FriendlyName>Last Name</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientBirthDay</ColumnName>

    <FriendlyName>Birth Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>PatientSex</ColumnName>

    <FriendlyName>Sex</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyInstanceUID</ColumnName>

    <FriendlyName>Study Instance UID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyDate</ColumnName>

    <FriendlyName>Study Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyAccessionNumber</ColumnName>

    <FriendlyName>Accession Number</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyId</ColumnName>

    <FriendlyName>Study ID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyStudyDescription</ColumnName>

    <FriendlyName>Study Description</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>StudyReferringPhysiciansName</ColumnName>

    <FriendlyName>Referring Physician</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesSeriesInstanceUID</ColumnName>

    <FriendlyName>Series Instance UID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesModality</ColumnName>

    <FriendlyName>Modality</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesSeriesNumber</ColumnName>

    <FriendlyName>Series Number</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesSeriesDate</ColumnName>

    <FriendlyName>Series Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SeriesSeriesDescription</ColumnName>

    <FriendlyName>Series Description</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>SOPInstanceUID</ColumnName>

    <FriendlyName>SOP Instance UID</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>ImageImageNumber</ColumnName>

    <FriendlyName>Instance Number</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>ImageFilename</ColumnName>

    <FriendlyName>Referenced File</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>ImageLastStoreDate</ColumnName>

    <FriendlyName>Storage Date</FriendlyName>

    <Type>System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>ImageColumns</ColumnName>

    <FriendlyName>Columns</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>ImageRows</ColumnName>

    <FriendlyName>Rows</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

  <mappingTable>

    <ColumnName>ImageBitsAllocated</ColumnName>

    <FriendlyName>ImageBitsAllocated</FriendlyName>

    <Type>System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>

    <Visible>true</Visible>

  </mappingTable>

</NewDataSet>

Step 2: Assigning the StorageDatabaseManager.PrepareSearch delegate

The second step to making the Database Manager interact properly with the tutorial database is to define a custom MyPrepareSearch method and assign it to the StorageDatabaseManager.PrepareSearch delegate. After doing this, the search fields in the Database Manager (highlighted below) will properly refine any database manager search.

 The PrepareSearchDelegate is defined in Leadtools.Medical.Winforms.dll.  It has the following signature:

    public delegate void PrepareSearchDelegate(MatchingParameterCollection matchingCollection);

The MyPrepareSearch() method gets the search fields specified in the database manager by calling StorageDatabaseManager.GetDicomQueryParams().  This returns any query parameters specified. 

Next the MyPrepareSearch() method needs to create a MatchingParameterCollection that corresponds to the specified search. Note that the database manager search fields correspond to items contained in the patient, study, and series tables only.  There are no search fields that correspond to the image table.  Therefore MyPrepareSearch() only needs to add MyPatient, MyStudy, and MySeries objects to the MatchingParameterList. Below is the full source for the MyPrepareSearch() method:

MyPrepareSearch Method

private void MyPrepareSearch(MatchingParameterCollection matchingCollection)

      {

         DicomQueryParams q = __DbManager.GetDicomQueryParams();

 

         try

         {

            MatchingParameterList matchingList = new MatchingParameterList();

            MyPatient patient = new MyPatient();

            MyStudy study = new MyStudy();

            MySeries series = new MySeries();

 

            matchingList.Add(patient);

            matchingList.Add(study);

            matchingList.Add(series);

 

            matchingCollection.Add(matchingList);

            study.StudyAccessionNumber = q.AccessionNumber;

            patient.PatientIdentification = q.PatientId;

 

            if (!string.IsNullOrEmpty(q.PatientName.FamilyName))

               patient.PatientName = q.PatientName.FamilyName.TrimEnd('*') + "*";

 

            if (!string.IsNullOrEmpty(q.PatientName.GivenName))

               patient.PatientName = q.PatientName.GivenName.TrimEnd('*') + "*";

 

            if (!string.IsNullOrEmpty(q.Modalities))

               series.SeriesModality = q.Modalities.Replace(",", "\\"); ;

 

            if (!string.IsNullOrEmpty(q.SeriesDescription))

               series.SeriesSeriesDescription = q.SeriesDescription.TrimEnd('*') + "*";

 

            if (!string.IsNullOrEmpty(q.ReferringPhysiciansName.FamilyName))

               study.StudyReferringPhysiciansName = q.ReferringPhysiciansName.FamilyName.TrimEnd('*') + "*"; ;

 

            if (!string.IsNullOrEmpty(q.ReferringPhysiciansName.GivenName))

               study.StudyReferringPhysiciansName = q.ReferringPhysiciansName.GivenName.TrimEnd('*') + "*"; ;

 

            if (q.StudyFromChecked || q.StudyToChecked)

            {

               DateRange studyDateRange = new DateRange();

 

               if (q.StudyFromChecked)

               {

                  studyDateRange.StartDate = q.StudyFromDate;

               }

 

               if (q.StudyToChecked)

               {

                  studyDateRange.EndDate = q.StudyToDate;

               }

 

               study.StudyStudyDate = studyDateRange;

            }

 

            if (q.StorageDateChecked)

            {

               MyInstance instance = new MyInstance();

               DateRange dateRange = new DateRange();

               DateRangeFilter StorageDateRangeFilter = q.StorageDateRange;

               string startDate = StorageDateRangeFilter.DateRangeFrom;

               string endDate = StorageDateRangeFilter.DateRangeTo;

 

               if (StorageDateRangeFilter.SelectedDateFilter == DateRangeFilter.RangeFilterType.DateRange)

               {

                  if (!string.IsNullOrEmpty(startDate))

                  {

                     dateRange.StartDate = DateTime.Parse(startDate);

                  }

 

                  if (!string.IsNullOrEmpty(endDate))

                  {

                     dateRange.EndDate = DateTime.Parse(endDate);

                  }

               }

               else if (StorageDateRangeFilter.SelectedDateFilter == DateRangeFilter.RangeFilterType.Months)

               {

                  DateTime lastMonthsDate = DateTime.Now.SubtractMonths(Convert.ToInt32(StorageDateRangeFilter.LastMonths));

 

                  dateRange.StartDate = lastMonthsDate;

                  dateRange.EndDate = DateTime.Now;

               }

               else

               {

                  TimeSpan subtractionDays = new TimeSpan(Convert.ToInt32(StorageDateRangeFilter.LastDays),

                                                   DateTime.Now.Hour,

                                                   DateTime.Now.Minute,

                                                   DateTime.Now.Second,

                                                   DateTime.Now.Millisecond);

 

                  dateRange.StartDate = DateTime.Now.Subtract(subtractionDays);

                  dateRange.EndDate = DateTime.Now;

               }

 

               instance.ImageLastStoreDate = dateRange;

               matchingList.Add(instance);

            }

 

            study.StudyStudyId = q.StudyId;

         }

         catch (Exception exception)

         {

            throw exception;

         }

         finally

         {

            // do nothing ;

         }

      }

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.