Difference between revisions of "MIRC Templates"

From MircWiki
Jump to navigation Jump to search
 
(40 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
 
The RSNA MIRC implementation uses XML files as templates for the automatic construction of MIRCdocuments by several of the services provided by a Storage Service:
 
The RSNA MIRC implementation uses XML files as templates for the automatic construction of MIRCdocuments by several of the services provided by a Storage Service:
*the Author Service
+
*the Advanced Author Service
 +
*the Basic Author Service
 +
*the ABR Author Service
 
*the DICOM Service
 
*the DICOM Service
 
*the TCE Service
 
*the TCE Service
 
*the Zip Service
 
*the Zip Service
  
Templates are MIRCdocument files, that is, they obey the MIRCdocument XML schema, extended to include elements that instruct the MIRC automatic document construction mechanism how to insert data from a file into the MIRCdocument. For detailed information on the template elements, see the [[The_MIRCdocument_Schema#Template_Elements|Template Elements]] section of [[The MIRCdocument Schema]].
+
Templates are MIRCdocument files; that is, they conform to the MIRCdocument XML schema, extended to include elements that instruct the MIRC automatic document construction mechanism how to insert data from a file into the MIRCdocument. For detailed information on the template elements, see the [[The_MIRCdocument_Schema#Template_Elements|Template Elements]] section of [[The MIRCdocument Schema]].
  
Because templates are XML files, it is critical that they be well-formed, or the system will reject them. For a brief introduction to XML, see  
+
Because templates are XML files, it is critical that they be well-formed, or the system will reject them. For a brief introduction to XML, see the [[XML Primer]].
  
==Author Service Templates==
+
==Advanced Author Service Templates==
The Author Service provides several templates to give users starting points when they create new MIRCdocuments. Author Service templates are generally simple skeletons of MIRCdocuments. Users add components (text, images, etc.) to a skeleton using the Author Service editor and then save the result as a new MIRCdocument.
+
The Advanced Author Service provides several templates to give users starting points when they create new MIRCdocuments. Advanced Author Service templates are generally simple skeletons of MIRCdocuments. Users add components (text, images, etc.) to a skeleton using the Advanced Author Service editor and then save the result as a new MIRCdocument.
  
 
The example below shows a simple Author Service template for an <b>mstf</b> MIRCdocument.
 
The example below shows a simple Author Service template for an <b>mstf</b> MIRCdocument.
Line 47: Line 49:
 
Text may be preloaded in any element in the template. For example, if you have a standard copyright that you want to appear on all documents, you can insert a <b>rights</b> element containing the standard text.
 
Text may be preloaded in any element in the template. For example, if you have a standard copyright that you want to appear on all documents, you can insert a <b>rights</b> element containing the standard text.
  
Author Service templates do not normally contain any of the special template elements which automatically insert data from files since they are not used by the automatic document generator.
+
Advanced Author Service templates do not normally contain any of the special template elements which automatically insert data from files since they are not used by the automatic document generator.
 +
 
 +
==Basic Author Service Templates==
 +
The Basic Author Service provides a single template for the creation of a new MIRCdocument from the contents of a form and any files which the user has attached. It is stored in the Storage Service's <b>newdoc</b> directory under the name <b>template.xml</b>.
 +
 
 +
The default template is shown below.
 +
 
 +
<pre>
 +
<?xml version="1.0" encoding="iso-8859-1"?>
 +
 
 +
<MIRCdocument display="mstf" first-tab="2">
 +
 
 +
    <title>Untitled</title>
 +
 
 +
    <author>
 +
        <name>Anonymous</name>
 +
        <affiliation/>
 +
        <contact/>
 +
    </author>
 +
 
 +
    <abstract><p>None.</p></abstract>
 +
 
 +
    <keywords/>
 +
 
 +
    <section heading="History">
 +
    </section>
 +
 
 +
    <image-section heading="Images">
 +
    <insert-megasave width="512"/>
 +
    </image-section>
 +
 
 +
    <section heading="Findings">
 +
    </section>
 +
 
 +
    <section heading="Notes">
 +
    </section>
 +
 
 +
    <section heading="Files">
 +
        <p>
 +
            <metadata-refs/>
 +
        </p>
 +
    </section>
 +
 
 +
    <document-type>radiologic teaching file</document-type>
 +
    <findings/>
 +
    <discussion/>
 +
    <differential-diagnosis/>
 +
    <diagnosis/>
 +
    <anatomy/>
 +
    <pathology/>
 +
    <organ-system/>
 +
    <modality/>
 +
    <category/>
 +
    <level/>
 +
 
 +
    <authorization>
 +
        <owner/>
 +
        <read/>
 +
        <update/>
 +
        <export/>
 +
    </authorization>
 +
 
 +
</MIRCdocument>
 +
</pre>
 +
 
 +
Notes:
 +
*Values from the submission form are automatically inserted into the <b>title</b>, <b>author</b>, <b>abstract</b>, and <b>authorization</b> elements.
 +
*The <b>section</b> elements generate places in the form for the creation of content by the user.
 +
*The order of the <b>section</b> and <b>image-section</b> elements determines their order in the created MIRCdocument.
 +
*You can add <b>section</b> elements with different <b>heading</b> attributes to include additional sections in the created MIRCdocument.
 +
*The <b>Notes</b> section is used to receive the contents of any text files that are submitted along with the form.
 +
*The <b>insert-megasave</b> element provides the insertion point for images.
 +
*The <b>metadata-refs</b> element provides the insertion point for non-image files.
 +
*Although you can remove the <b>Notes</b> and <b>Files</b> sections, doing so reduces the capability of the service to handle non-image files.
 +
*All the other elements are not filled in by the Basic Author Service, but are present in the created MIRCdocument so that they may be edited by the Advanced Author Service if necessary.
 +
 
 +
==ABR Author Service Templates==
 +
The ABR Author Service is similar to the Basic Author Service. Like the Basic Author Service, it uses a template, but it supports several special template elements which provide greater flexibility in the presentation of the page for entering contents for the MIRCdocument. The ABR Author Service supports multiple templates. All ABR templates are stored in the Storage Service's <b>abrdoc</b> directory. They must all have the extension ".xml". When the editor page is displayed, a select box is presented allowing the user to switch templates. The contents of the <b>title</b> element are used as the option in the select box, so it is advisable to give each template a meaningful name.
 +
 
 +
An illustrative example of an ABR template is shown below:
 +
 
 +
<pre>
 +
<?xml version="1.0" encoding="iso-8859-1"?>
 +
 
 +
<MIRCdocument display="page" background="light">
 +
 
 +
<title>Untitled</title>
 +
 
 +
<author>
 +
  <name>Anonymous</name>
 +
  <affiliation/>
 +
  <contact/>
 +
</author>
 +
 
 +
<abstract><p>None.</p></abstract>
 +
 
 +
<section heading="Exam">
 +
<p>
 +
<select name="exam">
 +
<option>MOC</option>
 +
<option>EOF</option>
 +
<option>CT</option>
 +
<option>Both</option>
 +
<option>General</option>
 +
</select>
 +
</p>
 +
</section>
 +
 
 +
<section heading="Category/Subspecialty">
 +
<p>
 +
<select name="cat">
 +
<option>GU</option>
 +
<option>GI</option>
 +
<option>CT</option>
 +
<option>VIR</option>
 +
<option>Etc.</option>
 +
</select>
 +
</p>
 +
</section>
 +
 
 +
<section heading="History">
 +
<textblock name="hist"/>
 +
</section>
 +
 
 +
<section heading="Modality">
 +
<p>
 +
<select name="modal">
 +
<option>Radiography</option>
 +
<option>Fluoroscopy</option>
 +
<option>CT</option>
 +
<option>MRI</option>
 +
<option>US</option>
 +
<option>NM/Scintigraphy</option>
 +
<option>Intervention Rx/Dx</option>
 +
<option>Angiography</option>
 +
<option>Multiple modality</option>
 +
</select>
 +
</p>
 +
</section>
 +
 
 +
<section heading="Anatomy">
 +
<textblock name="anat"/>
 +
</section>
 +
 
 +
<section heading="Pathology">
 +
<textblock name="path"/>
 +
</section>
 +
 
 +
<section heading="Primary Content">
 +
<p>
 +
<ul>
 +
<checkbox name="pc1">Anatomy</checkbox>
 +
<checkbox name="pc3">Pathology</checkbox>
 +
<checkbox name="pc4">Development</checkbox>
 +
<checkbox name="pc5">Physiology</checkbox>
 +
<checkbox name="pc6">Contrast/Drugs</checkbox>
 +
<checkbox name="pc7">Therapy</checkbox>
 +
<checkbox name="pc8">Indication/Appropriateness</checkbox>
 +
<checkbox name="pc9">Clinical</checkbox>
 +
<checkbox name="pc10">Technique/Instrumentation</checkbox>
 +
<checkbox name="pc11">Quality Assurance</checkbox>
 +
<checkbox name="pc12">Emergency/Trauma</checkbox>
 +
</ul>
 +
</p>
 +
</section>
 +
 
 +
<section heading="Pattern">
 +
<p>
 +
<ul>
 +
<checkbox name="pat1">pattern 1</checkbox>
 +
<checkbox name="pat3">pattern 2</checkbox>
 +
<checkbox name="pat4">pattern 3</checkbox>
 +
<checkbox name="pat5">pattern 4</checkbox>
 +
<checkbox name="pat6">pattern 5</checkbox>
 +
<checkbox name="pat7">pattern 6</checkbox>
 +
</ul>
 +
</p>
 +
</section>
 +
 
 +
<section heading="Difficulty">
 +
<p>
 +
<select name="diff">
 +
<option>Primary</option>
 +
<option>Intermediate</option>
 +
<option>Advanced</option>
 +
</select>
 +
</p>
 +
</section>
 +
 
 +
<section heading="Management">
 +
<textblock name="mgt"/>
 +
</section>
 +
 
 +
<section heading="Image Quality">
 +
<p>
 +
<select name="qual">
 +
<option>Artifact</option>
 +
<option>Noise</option>
 +
<option>Physics Applicability</option>
 +
</select>
 +
</p>
 +
</section>
 +
 
 +
<section heading="Diagnosis">
 +
<textblock name="diag"/>
 +
</section>
 +
 
 +
<section heading="Notes">
 +
</section>
 +
 
 +
<section heading="Files">
 +
  <p><metadata-refs/></p>
 +
</section>
 +
 
 +
<image-section heading="Images">
 +
<insert-megasave width="512"/>
 +
</image-section>
 +
 
 +
<authorization>
 +
  <owner/>
 +
  <read/>
 +
  <update/>
 +
  <export/>
 +
</authorization>
 +
 
 +
</MIRCdocument>
 +
</pre>
 +
 
 +
All the notes in the Basic Author Service section also apply to ABR templates.
 +
 
 +
The <b>select</b> element provides a select box with options defined by the <b>option</b> elements. It must appear in a paragraph (<b>p</b>) element. The <b>select</b> element must have a unique <b>name</b> attribute.
 +
 
 +
The <b>textblock</b> element provides a space for text input. It should <b>not</b> appear in a paragraph because the document generator automatically provides the paragraphs. The <b>textblock</b> element must have a unique <b>name</b> attribute.
 +
 
 +
The <b>checkbox</b> element provides a single labelled checkbox. It is designed to appear in a list (<b>ul</b> or <b>ol</b>). The <b>checkbox</b> element must have a unique <b>name</b> attribute. Only boxes which are checked appear in the generated MIRCdocument, and each generates its own list item (<b>li</b>).
 +
 
 +
All these elements can be combined in sections and even in paragraphs, if desired.
  
 
==Zip Service Templates==
 
==Zip Service Templates==
  
The Zip Service uses templates to construct MIRCdocuments and insert files into them. See the Zip Service User's Manual for an overview of its operation. The Zip Service has a default template which is stored in the Storage Service's <b>submit</b> directory under the name <b>template.xml</b>.
+
The Zip Service uses templates to construct MIRCdocuments and insert files into them. See the [[Zip Service User's Manual]] for an overview of its operation. The Zip Service has a default template which is stored in the Storage Service's <b>zip</b> directory under the name <b>template.xml</b>.
  
 
The default template is shown below.
 
The default template is shown below.
Line 129: Line 367:
 
are not actually modified by the Zip Service. They are shown in the template only as an indication of where you might include static text when creating special purpose templates. For example, if you were creating a template for a large number of MR cases, you could preload the <b>modality</b> element in a <b>template.xml</b> file that could be included in the root directory of the zip file, thus overriding the default template and causing all the created MIRCdocuments to be indexed as containing MR data.
 
are not actually modified by the Zip Service. They are shown in the template only as an indication of where you might include static text when creating special purpose templates. For example, if you were creating a template for a large number of MR cases, you could preload the <b>modality</b> element in a <b>template.xml</b> file that could be included in the root directory of the zip file, thus overriding the default template and causing all the created MIRCdocuments to be indexed as containing MR data.
  
Zip Service templates can also contain DICOM template elements. This is not typically done for documents being created for teaching files, so they are not shown in the template above. For some special purposes, however, you can use the <b>block</b> and <b>GxxxxEyyyy</b> elements to capture data from DICOM objects inserted into the MIRCdocument.
+
Zip Service templates can also contain DICOM template elements. This is not typically done for documents being created for teaching files, so they are not shown in the template above. For special purposes, however, you can use the <b>block</b> and <b>GxxxxEyyyy</b> elements to capture data from DICOM objects inserted into the MIRCdocument.
  
 
==DICOM Service Templates==
 
==DICOM Service Templates==
Line 258: Line 496:
 
</pre>
 
</pre>
  
It is also possible to use the <b>block</b> element to override the special table feature of DICOM elements. The following fragment shows an HTML <b>table</b> element that will contain one row from each DICOM object, with each row showing the Instance Number and the corresponding SOP Instance UID.
+
The <b>block</b> element can be used anywhere to preserve its contents for application to subsequent objects that are inserted into the MIRCdocument. The following fragment shows an HTML <b>table</b> element that will contain one row from each DICOM object, with each row showing the Instance Number and the corresponding SOP Instance UID.
 
<pre>
 
<pre>
 
<section heading="Instance Table">
 
<section heading="Instance Table">
Line 269: Line 507:
 
             <block>
 
             <block>
 
                 <tr>
 
                 <tr>
                     <td<g0020e0013 desc="Instance Number"/></td>
+
                     <td><g0020e0013 desc="Instance Number"/></td>
 
                     <td><g0008e0018 desc="SOP Instance UID"/></td>
 
                     <td><g0008e0018 desc="SOP Instance UID"/></td>
 
                 </tr>
 
                 </tr>
Line 278: Line 516:
 
</pre>
 
</pre>
  
Note that the reason that the DICOM elements do not generate complete rows themselves in this case is that they are not first-generation children of the <b>table</b> element.
+
Note that the reason the individual DICOM elements do not generate complete rows themselves in this case is that they are not first-generation children of the <b>table</b> element.
 +
 
 +
==Standard TCE Service Templates==
 +
The TCE Service processes DICOM transmissions received from an IHE TCE Export Manager. These files consist of a manifest, a set of instances, and possibly an Additional Teaching File Information (ATFI) object. All are DICOM objects. The manifest and the ATFI object are examples of DICOM Key Object Selection documents in the forms defined by IHE.
 +
 
 +
The TCE Service uses a template to create a MIRCdocument for each manifest received. The template is stored in the root directory of the library (typically, <b><tt>CTP/mircsite/storage/ss1</tt></b>) under the name <b>TCEServiceTemplate.xml</b>.
 +
 
 +
The standard TCE template is identical in contents to the default Zip Service template, although it is a separate file stored in a separate place.
 +
 
 +
Notes:
 +
*The <b>Notes</b> section is used to capture the Key Object Description text from the manifest. The full text is inserted in the section, but it is also parsed according to rules defined by MIRC. If the contents match the MIRC-defined rules, they used to update the text values of other elements as described in the [[TCE Service User's Manual]].
 +
*The ATFI object is also parsed, and its contents are used to update the text contents of other elements.
 +
 
 +
==Extended TCE Service Templates==
 +
The TCE Service also accepts transmissions of MIRCdocument XML template files via the HTTP protocol. These files are treated as both templates and manifests. To be accepted, the XML file must be a MIRCdocument XML file and contain a <b>manifest</b> element as described in [[The_MIRCdocument_Schema#manifest|The MIRCdocument Schema]].
 +
 
 +
After processing an XML manifest, the MIRCdocument generator removes the <b>manifest</b> element before saving the final document.
 +
 
 +
==Advanced Topics==
 +
The <b>a</b> and <b>iframe</b> elements from the MIRCdocument schema can be used to integrate a MIRCdocument with an environment outside the MIRC site itself. This section provides a few examples of their application in a use case in which an automatically generated MIRCdocument is to be integrated with the contents of a report broker.
 +
 
 +
In these examples, the systems are assumed to be in a secure environment which allows PHI to be preserved in DICOM objects and MIRCdocuments.
 +
 
 +
The report broker is assumed to provide access to a report through a URL containing a query string identifying the patient ID and the accession number of the study in the form:
 +
<pre>
 +
http://broker?ptid=1234&an=5678
 +
</pre>
 +
===<b>Linking to a Report</b>===
 +
Using the <b>a</b> element and its <b>href</b> child element, one could insert a link into a paragraph like this:
 +
<pre>
 +
<section heading="Report">
 +
    <p>
 +
        <a>
 +
            <href>
 +
                http://broker?ptid=<g0010e0020/>|an=<g0008e0050/>
 +
            </href>
 +
            View the report
 +
        </a>
 +
    </p>
 +
</section>
 +
</pre>
 +
When the document is generated in response to the receipt of a DICOM object, the <b>href</b> attribute is automatically constructed from the PatientID and AccessionNumber elements of the DICOM object.
 +
 
 +
In this example, the report is displayed in the same window when the link is clicked. All the HTML attributes of the <b>a</b> element are supported, so other target values can be set as desired.
 +
 
 +
Note the use of the pipe character (|) as the separator for the query parameters. Pipe characters are converted to ampersands when the document is rendered. This substitution is necessary in order to keep the template and the resulting MIRCdocument XML file well-formed.
 +
 
 +
===<b>Linking to a Report through a URL in a DICOM Element</b>===
 +
The previous example could also be coded using the special attribute syntax <b>if</b> the complete URL is available in a DICOM element. Assume that the element (0021,0040) contains the complete URL, perhaps constructed by the anonymizer in a TCE Export Manager. The following syntax could then be used:
 +
<pre>
 +
<section heading="Report">
 +
    <p>
 +
        <a href="@g0021e0040">View the report</a>
 +
    </p>
 +
</section>
 +
</pre>
 +
Note that this approach is limited in that no conversion of ampersands is done, so if the query string in the <b>href</b> attribute is required, use of the <b>href</b> <u>element</u> is necessary instead.
 +
 
 +
===<b>Embedding a Report</b>===
 +
Using the <b>iframe</b> element and its <b>src</b> child element, one could embed the whole page from the report broker into a paragraph like this:
 +
<pre>
 +
<section heading="Report">
 +
    <p>
 +
        <iframe frameborder="0"
 +
                height="100%" width="100%"
 +
                scrolling="no" >
 +
            <src>
 +
                http://broker?ptid=<g0010e0020/>|an=<g0008e0050/>
 +
            </src>
 +
            <a target="_blank">
 +
                <href>
 +
                    http://broker?ptid=<g0010e0020/>|an=<g0008e0050/>
 +
                </href>
 +
                View the report.
 +
            </a>
 +
        </iframe>
 +
    </p>
 +
</section>
 +
</pre>
 +
In this example, the report is displayed within the MIRCdocument in a section entitled "Report". If the document is displayed by a browser that does not support frames, the user will see a link to the report on the broker.
 +
 
 +
It is important to embed the <b>iframe</b> element in a paragraph (<b>p</b> element) to preserve it in case the document is edited in the Author Service.
  
==TCE Service Templates==
+
Note again the use of the pipe character (|) as the separator for the query parameters.

Latest revision as of 20:31, 5 December 2011

This article provides examples of MIRC templates for MIRC users and administrators to use as guides in constructing their own.

The RSNA MIRC implementation uses XML files as templates for the automatic construction of MIRCdocuments by several of the services provided by a Storage Service:

  • the Advanced Author Service
  • the Basic Author Service
  • the ABR Author Service
  • the DICOM Service
  • the TCE Service
  • the Zip Service

Templates are MIRCdocument files; that is, they conform to the MIRCdocument XML schema, extended to include elements that instruct the MIRC automatic document construction mechanism how to insert data from a file into the MIRCdocument. For detailed information on the template elements, see the Template Elements section of The MIRCdocument Schema.

Because templates are XML files, it is critical that they be well-formed, or the system will reject them. For a brief introduction to XML, see the XML Primer.

1 Advanced Author Service Templates

The Advanced Author Service provides several templates to give users starting points when they create new MIRCdocuments. Advanced Author Service templates are generally simple skeletons of MIRCdocuments. Users add components (text, images, etc.) to a skeleton using the Advanced Author Service editor and then save the result as a new MIRCdocument.

The example below shows a simple Author Service template for an mstf MIRCdocument.

<?xml version="1.0" encoding="UTF-8"?>
<MIRCdocument display="mstf">
    <title>Enter a title here</title>
    <section heading="History">
    	<p/>
    </section>
    <section heading="Findings">
    	<p/>
    </section>
    <section heading="Diagnosis">
    	<p/>
    </section>
    <section heading="DDx">
    	<p/>
    </section>
    <section heading="Discussion">
    	<p/>
    </section>
    <image-section heading="Images" image-pane-width="600"/>
    <document-type>Radiologic Teaching File</document-type>
    <publication-date/>
</MIRCdocument>

Note that no title, author, abstract, or keywords elements are included. The Author Service generates these elements automatically if they are missing in the template. The elements are not forbidden, however, so if you are constructing a template for a special purpose, you can preload these elements by placing them in the template.

Note also the HTML paragraph elements in the various section elements. These are not necessary because the user can insert them with buttons in the editor, but they are a convenience.

Text may be preloaded in any element in the template. For example, if you have a standard copyright that you want to appear on all documents, you can insert a rights element containing the standard text.

Advanced Author Service templates do not normally contain any of the special template elements which automatically insert data from files since they are not used by the automatic document generator.

2 Basic Author Service Templates

The Basic Author Service provides a single template for the creation of a new MIRCdocument from the contents of a form and any files which the user has attached. It is stored in the Storage Service's newdoc directory under the name template.xml.

The default template is shown below.

<?xml version="1.0" encoding="iso-8859-1"?>

<MIRCdocument display="mstf" first-tab="2">

    <title>Untitled</title>

    <author>
        <name>Anonymous</name>
        <affiliation/>
        <contact/>
    </author>

    <abstract><p>None.</p></abstract>

    <keywords/>

    <section heading="History">
    </section>

    <image-section heading="Images">
    <insert-megasave width="512"/>
    </image-section>

    <section heading="Findings">
    </section>

    <section heading="Notes">
    </section>

    <section heading="Files">
        <p>
            <metadata-refs/>
        </p>
    </section>

    <document-type>radiologic teaching file</document-type>
    <findings/>
    <discussion/>
    <differential-diagnosis/>
    <diagnosis/>
    <anatomy/>
    <pathology/>
    <organ-system/>
    <modality/>
    <category/>
    <level/>

    <authorization>
        <owner/>
        <read/>
        <update/>
        <export/>
    </authorization>

</MIRCdocument>

Notes:

  • Values from the submission form are automatically inserted into the title, author, abstract, and authorization elements.
  • The section elements generate places in the form for the creation of content by the user.
  • The order of the section and image-section elements determines their order in the created MIRCdocument.
  • You can add section elements with different heading attributes to include additional sections in the created MIRCdocument.
  • The Notes section is used to receive the contents of any text files that are submitted along with the form.
  • The insert-megasave element provides the insertion point for images.
  • The metadata-refs element provides the insertion point for non-image files.
  • Although you can remove the Notes and Files sections, doing so reduces the capability of the service to handle non-image files.
  • All the other elements are not filled in by the Basic Author Service, but are present in the created MIRCdocument so that they may be edited by the Advanced Author Service if necessary.

3 ABR Author Service Templates

The ABR Author Service is similar to the Basic Author Service. Like the Basic Author Service, it uses a template, but it supports several special template elements which provide greater flexibility in the presentation of the page for entering contents for the MIRCdocument. The ABR Author Service supports multiple templates. All ABR templates are stored in the Storage Service's abrdoc directory. They must all have the extension ".xml". When the editor page is displayed, a select box is presented allowing the user to switch templates. The contents of the title element are used as the option in the select box, so it is advisable to give each template a meaningful name.

An illustrative example of an ABR template is shown below:

<?xml version="1.0" encoding="iso-8859-1"?>

<MIRCdocument display="page" background="light">

 <title>Untitled</title>

 <author>
  <name>Anonymous</name>
  <affiliation/>
  <contact/>
 </author>

 <abstract><p>None.</p></abstract>

 <section heading="Exam">
 	<p>
 		<select name="exam">
 			<option>MOC</option>
 			<option>EOF</option>
 			<option>CT</option>
 			<option>Both</option>
 			<option>General</option>
 		</select>
 	</p>
 </section>

 <section heading="Category/Subspecialty">
 	<p>
 		<select name="cat">
 			<option>GU</option>
 			<option>GI</option>
 			<option>CT</option>
 			<option>VIR</option>
 			<option>Etc.</option>
 		</select>
 	</p>
 </section>

 <section heading="History">
 	<textblock name="hist"/>
 </section>

 <section heading="Modality">
 	<p>
 		<select name="modal">
 			<option>Radiography</option>
 			<option>Fluoroscopy</option>
 			<option>CT</option>
 			<option>MRI</option>
 			<option>US</option>
 			<option>NM/Scintigraphy</option>
 			<option>Intervention Rx/Dx</option>
 			<option>Angiography</option>
 			<option>Multiple modality</option>
 		</select>
 	</p>
 </section>

 <section heading="Anatomy">
 	<textblock name="anat"/>
 </section>

 <section heading="Pathology">
 	<textblock name="path"/>
 </section>

 <section heading="Primary Content">
 	<p>
 		<ul>
			<checkbox name="pc1">Anatomy</checkbox>
			<checkbox name="pc3">Pathology</checkbox>
			<checkbox name="pc4">Development</checkbox>
			<checkbox name="pc5">Physiology</checkbox>
			<checkbox name="pc6">Contrast/Drugs</checkbox>
			<checkbox name="pc7">Therapy</checkbox>
			<checkbox name="pc8">Indication/Appropriateness</checkbox>
			<checkbox name="pc9">Clinical</checkbox>
			<checkbox name="pc10">Technique/Instrumentation</checkbox>
			<checkbox name="pc11">Quality Assurance</checkbox>
			<checkbox name="pc12">Emergency/Trauma</checkbox>
 		</ul>
 	</p>
 </section>

 <section heading="Pattern">
 	<p>
 		<ul>
			<checkbox name="pat1">pattern 1</checkbox>
			<checkbox name="pat3">pattern 2</checkbox>
			<checkbox name="pat4">pattern 3</checkbox>
			<checkbox name="pat5">pattern 4</checkbox>
			<checkbox name="pat6">pattern 5</checkbox>
			<checkbox name="pat7">pattern 6</checkbox>
		</ul>
 	</p>
 </section>

 <section heading="Difficulty">
 	<p>
 		<select name="diff">
 			<option>Primary</option>
 			<option>Intermediate</option>
 			<option>Advanced</option>
 		</select>
 	</p>
 </section>

 <section heading="Management">
 	<textblock name="mgt"/>
 </section>

 <section heading="Image Quality">
 	<p>
 		<select name="qual">
 			<option>Artifact</option>
 			<option>Noise</option>
 			<option>Physics Applicability</option>
 		</select>
 	</p>
 </section>

 <section heading="Diagnosis">
 	<textblock name="diag"/>
 </section>

 <section heading="Notes">
 </section>

 <section heading="Files">
  <p><metadata-refs/></p>
 </section>

 <image-section heading="Images">
 <insert-megasave width="512"/>
 </image-section>

 <authorization>
  <owner/>
  <read/>
  <update/>
  <export/>
 </authorization>

</MIRCdocument>

All the notes in the Basic Author Service section also apply to ABR templates.

The select element provides a select box with options defined by the option elements. It must appear in a paragraph (p) element. The select element must have a unique name attribute.

The textblock element provides a space for text input. It should not appear in a paragraph because the document generator automatically provides the paragraphs. The textblock element must have a unique name attribute.

The checkbox element provides a single labelled checkbox. It is designed to appear in a list (ul or ol). The checkbox element must have a unique name attribute. Only boxes which are checked appear in the generated MIRCdocument, and each generates its own list item (li).

All these elements can be combined in sections and even in paragraphs, if desired.

4 Zip Service Templates

The Zip Service uses templates to construct MIRCdocuments and insert files into them. See the Zip Service User's Manual for an overview of its operation. The Zip Service has a default template which is stored in the Storage Service's zip directory under the name template.xml.

The default template is shown below.

<?xml version="1.0" encoding="iso-8859-1"?>
<MIRCdocument display="tab" first-tab="1">

    <title>Untitled</title>

    <author>
        <name>Anonymous</name>
        <affiliation/>
        <contact/>
    </author>

    <abstract><p>None.</p></abstract>

    <keywords/>

    <section heading="Notes">
    </section>

    <image-section heading="Images">
        <insert-megasave width="512"/>
    </image-section>

    <section heading="Files">
        <p>
            <metadata-refs/>
        </p>
    </section>

    <document-type>radiologic teaching file</document-type>
    <findings/>
    <discussion/>
    <differential-diagnosis/>
    <diagnosis/>
    <anatomy/>
    <pathology/>
    <organ-system/>
    <modality/>
    <category/>
    <level/>

    <authorization>
         <owner/>
         <read/>
         <update/>
         <export/>
    </authorization>

</MIRCdocument>

Notes:

  • All the elements that are to be included in the document must be present in the template.
  • Values from the submission form are automatically inserted into the author and authorization elements.
  • The abstract and keywords elements are filled in automatically from the path information in the zip file.
  • The Notes section is used to receive the contents of any text files that are encountered in the document's directory in the zip file.
  • The insert-megasave element provides the insertion point for images.
  • The metadata-refs element provides the insertion point for non-image files.

Note also that the elements:

    <findings/>
    <discussion/>
    <differential-diagnosis/>
    <diagnosis/>
    <anatomy/>
    <pathology/>
    <organ-system/>
    <modality/>
    <category/>
    <level/>

are not actually modified by the Zip Service. They are shown in the template only as an indication of where you might include static text when creating special purpose templates. For example, if you were creating a template for a large number of MR cases, you could preload the modality element in a template.xml file that could be included in the root directory of the zip file, thus overriding the default template and causing all the created MIRCdocuments to be indexed as containing MR data.

Zip Service templates can also contain DICOM template elements. This is not typically done for documents being created for teaching files, so they are not shown in the template above. For special purposes, however, you can use the block and GxxxxEyyyy elements to capture data from DICOM objects inserted into the MIRCdocument.

5 DICOM Service Templates

The DICOM Service is used for clinical trials and research dataset acquisition. It creates or updates MIRCdocuments whenever it receives a DICOM object. It creates one MIRCdocument for each study (e.g., one SOP Instance UID) and adds all the objects that it receives for the study into that MIRCdocument. The DICOM service uses a template that is stored in the Storage Service's trial directory under the name template.xml.

The standard template is shown below.

<?xml version="1.0" encoding="UTF-8"?>
<MIRCdocument display="tab" first-tab="4">

    <title>
        <g0010e0010 desc="Patient's Name"/> 
        <g0008e0060 desc="Modality"/> Study - <g0008e0020 desc="Study Date"/>
    </title>

    <author>
        <name><g0008e0080 desc="Institution Name"/></name>
        <contact><g0018e1030 desc="Protocol Name"/></contact>
    </author>

    <abstract>
        <p>
            Patient's Name: <g0010e0010 desc="Patient's Name"/><br/>
            Patient ID: <g0010e0020 desc="Patient ID"/><br/>
            Study Date: <g0008e0020 desc="Study Date"/><br/>
            <g0032e4000 desc="Study Comments"/>
        </p>
    </abstract>

    <section heading="Demographic Data">
        <p>
            <table border="1">
                <g0010e0010 desc="Patient's Name"/>
                <g0010e0020 desc="Patient ID"/>
                <g0010e1090 desc="Medical Record Locator"/>
                <g0010e0030 desc="Patient's Birth Date"/>
                <g0010e1010 desc="Patient's Age"/>
                <g0010e0040 desc="Patient's Sex"/>
                <g0008e0060 desc="Modality"/>
                <g0018e0015 desc="Body Part Examined"/>
                <g0008e0050 desc="Accession Number"/>
                <g0008e0020 desc="Study Date"/>
                <g0008e0030 desc="Study Time"/>
                <g0008e002A desc="Acquisition Datetime"/>
                <g0008e0022 desc="Acquisition Date"/>
                <g0008e0032 desc="Acquisition Time"/>
                <g0020e000D desc="Study Instance UID"/>
                <g0008e0018 desc="SOP Instance UID"/>
            </table>
        </p>
    </section>

    <section heading="Metadata References">
        <metadata-refs/>
    </section>

    <image-section heading="Images">
        <insert-megasave width="512"/>
    </image-section>

    <section heading="not visible" visible="no">
        <patient>
            <pt-name><g0010e0010 desc="Patient's Name"/></pt-name>
            <pt-id><g0010e0020 desc="Patient ID"/></pt-id>
            <pt-mrn><g0010e1090 desc="Medical Record Locator"/></pt-mrn>
            <pt-sex><g0010e0040 desc="Patient's Sex"/></pt-sex>
        </patient>
        <modality><g0008e0060 desc="Modality"/></modality>
        <anatomy><g0018e0015 desc="Body Part Examined"/></anatomy>
    </section>

    <document-type>research dataset</document-type>

    <authorization>
        <owner>admin</owner>
        <read/>
        <update/>
        <export/>
    </authorization>

</MIRCdocument>

Notes:

  • The title element is generated in the form: Perry^John MR Study - 20060101.
  • The author element is taken from the institution name and protocol in the first DICOM object received for the study.
  • The Demographic Data section uses a special feature of the DICOM element, described below, to generate table rows with row labels.
  • The insert-megasave element provides the insertion point for images.
  • The metadata-refs element provides the insertion point for non-image files.
  • The not visible section shows how data can be acquired into a MIRCdocument for indexing purposes without being displayed when the document is viewed.
  • Since the DICOM Service has no way to obtain the owner of document, the owner's username is preloaded in the template.
  • If predefined privileges for reading, updating, an exporting are known for the trial, they can be preloaded in the template.

Normally, a DICOM element simply extracts data from the element in the object and inserts it in the MIRCdocument as is seen in the title element in the template.

When DICOM elements are first-generation children of a table element, however, they automatically generate one row with two data elements, one containing the name of the DICOM element and one containing that element's data from the object. The name of the element is obtained from a table in the DICOM software library. If the element is not known to the software (for example, because it is a private element), the name is taken from the DICOM element's desc attribute.

When a DICOM element is encountered by the document generator, it is replaced by its value in the object. This means that the values come from the first object received for the study. If it is desired to capture data from all DICOM objects received, then the block template element must be used. The following fragment shows a section element that will contain a series of tables, one for each object received.

<section heading="Elements">
    <p>
        Institution Name: <g0008e0080/>
    </p>
    <block>
        <p>
            <table border="1">
                <g0010e0010 desc="Patient's Name"/>
                <g0010e0020 desc="Patient ID"/>
                <g0010e1090 desc="Medical Record Locator"/>
                <g0010e0030 desc="Patient's Birth Date"/>
                <g0010e1010 desc="Patient's Age"/>
                <g0010e0040 desc="Patient's Sex"/>
                <g0008e0060 desc="Modality"/>
                <g0018e0015 desc="Body Part Examined"/>
                <g0008e0050 desc="Accession Number"/>
                <g0008e0020 desc="Study Date"/>
                <g0008e0030 desc="Study Time"/>
                <g0008e002A desc="Acquisition Datetime"/>
                <g0008e0022 desc="Acquisition Date"/>
                <g0008e0032 desc="Acquisition Time"/>
                <g0020e000D desc="Study Instance UID"/>
                <g0008e0018 desc="SOP Instance UID"/>
            </table>
        </p>
    </block>
</section>

The block element can be used anywhere to preserve its contents for application to subsequent objects that are inserted into the MIRCdocument. The following fragment shows an HTML table element that will contain one row from each DICOM object, with each row showing the Instance Number and the corresponding SOP Instance UID.

<section heading="Instance Table">
    <p>
        <table border="1">
            <tr>
                <th>Instance Number</th>
                <th>SOP Instance UID</th>
            </tr>
            <block>
                <tr>
                    <td><g0020e0013 desc="Instance Number"/></td>
                    <td><g0008e0018 desc="SOP Instance UID"/></td>
                </tr>
            </block>
        </table>
    </p>
</section>

Note that the reason the individual DICOM elements do not generate complete rows themselves in this case is that they are not first-generation children of the table element.

6 Standard TCE Service Templates

The TCE Service processes DICOM transmissions received from an IHE TCE Export Manager. These files consist of a manifest, a set of instances, and possibly an Additional Teaching File Information (ATFI) object. All are DICOM objects. The manifest and the ATFI object are examples of DICOM Key Object Selection documents in the forms defined by IHE.

The TCE Service uses a template to create a MIRCdocument for each manifest received. The template is stored in the root directory of the library (typically, CTP/mircsite/storage/ss1) under the name TCEServiceTemplate.xml.

The standard TCE template is identical in contents to the default Zip Service template, although it is a separate file stored in a separate place.

Notes:

  • The Notes section is used to capture the Key Object Description text from the manifest. The full text is inserted in the section, but it is also parsed according to rules defined by MIRC. If the contents match the MIRC-defined rules, they used to update the text values of other elements as described in the TCE Service User's Manual.
  • The ATFI object is also parsed, and its contents are used to update the text contents of other elements.

7 Extended TCE Service Templates

The TCE Service also accepts transmissions of MIRCdocument XML template files via the HTTP protocol. These files are treated as both templates and manifests. To be accepted, the XML file must be a MIRCdocument XML file and contain a manifest element as described in The MIRCdocument Schema.

After processing an XML manifest, the MIRCdocument generator removes the manifest element before saving the final document.

8 Advanced Topics

The a and iframe elements from the MIRCdocument schema can be used to integrate a MIRCdocument with an environment outside the MIRC site itself. This section provides a few examples of their application in a use case in which an automatically generated MIRCdocument is to be integrated with the contents of a report broker.

In these examples, the systems are assumed to be in a secure environment which allows PHI to be preserved in DICOM objects and MIRCdocuments.

The report broker is assumed to provide access to a report through a URL containing a query string identifying the patient ID and the accession number of the study in the form:

http://broker?ptid=1234&an=5678

8.1 Linking to a Report

Using the a element and its href child element, one could insert a link into a paragraph like this:

<section heading="Report">
    <p>
        <a>
            <href>
                 http://broker?ptid=<g0010e0020/>|an=<g0008e0050/>
            </href>
            View the report
        </a>
    </p>
</section>

When the document is generated in response to the receipt of a DICOM object, the href attribute is automatically constructed from the PatientID and AccessionNumber elements of the DICOM object.

In this example, the report is displayed in the same window when the link is clicked. All the HTML attributes of the a element are supported, so other target values can be set as desired.

Note the use of the pipe character (|) as the separator for the query parameters. Pipe characters are converted to ampersands when the document is rendered. This substitution is necessary in order to keep the template and the resulting MIRCdocument XML file well-formed.

8.2 Linking to a Report through a URL in a DICOM Element

The previous example could also be coded using the special attribute syntax if the complete URL is available in a DICOM element. Assume that the element (0021,0040) contains the complete URL, perhaps constructed by the anonymizer in a TCE Export Manager. The following syntax could then be used:

<section heading="Report">
    <p>
        <a href="@g0021e0040">View the report</a>
    </p>
</section>

Note that this approach is limited in that no conversion of ampersands is done, so if the query string in the href attribute is required, use of the href element is necessary instead.

8.3 Embedding a Report

Using the iframe element and its src child element, one could embed the whole page from the report broker into a paragraph like this:

<section heading="Report">
    <p>
        <iframe frameborder="0" 
                height="100%" width="100%" 
                scrolling="no" >
            <src>
                http://broker?ptid=<g0010e0020/>|an=<g0008e0050/>
            </src>
            <a target="_blank">
                <href>
                    http://broker?ptid=<g0010e0020/>|an=<g0008e0050/>
                </href>
                View the report.
            </a>
        </iframe>
    </p>
</section>

In this example, the report is displayed within the MIRCdocument in a section entitled "Report". If the document is displayed by a browser that does not support frames, the user will see a link to the report on the broker.

It is important to embed the iframe element in a paragraph (p element) to preserve it in case the document is edited in the Author Service.

Note again the use of the pipe character (|) as the separator for the query parameters.