The MIRC Module

From MircWiki
Jump to navigation Jump to search


The MIRC module (MIRC.jar) contains the code of the CTP plugin that implements TFS, the RSNA Teaching File System. This article describes the theory of operation of the packages and files contained in the MIRC module. The intended audience for this article is software engineers extending or maintaining any of that software.

See Setting Up a MIRC Development Environment for information on obtaining and building the MIRC module. It will be helpful to get the source code and build it so you can reference the Javadocs as you go along.

1 Overview

The MIRC module contains many packages. In general, major system functions (as well as some minor ones) are encapsulated in their own packages, but because many functions interact, this principle is not universally maintained. Most system functions have classes and files that are contained in the jar file. Often, the files are XSL programs used for the generation of web pages or Javascript and CSS files referenced by the web pages. These files are served directly from the jar file without having to be installed on the disk. See The Util Module for a description of how the server serves files from the classpath.

2 The TFS-installer

The TFS-installer uses the same installer program as CTP. It includes a full installation of CTP, but it includes a different config.xml file snd additional libraries.

To prevent the loss of site-specific configuration information, the installer does not overwrite the config.xml file during an upgrade installation. The standard TFS config.xml file includes the MIRC plugin and pipelines for the File Service, the DICOM Service, and the TCE Service.

The additional libraries include the Apache XML libraries because the standard Java XML libraries don't support passing DOM objects as parameters to XSL transforms. This capability is used widely in TFS, but not CTP, so they are only included in the TFS installer.

3 The MIRC Plugin

All the code for TFS is included in the MIRC plugin, including all the servlets, the TFS-specific pipeline stages, and many XSL, Javascript, CSS, image, and files. The plugin is loaded when CTP loads the configuration, and it is started after the server is started but before any of the pipelines are started.

The root attribute of the MIRC plugin's configuration file element defines the root directory of all the TFS files. The default location is mircsite under the CTP directory, but it can be changed if it is desired to locate the teaching files on another drive or network system. Because the installer never overwrites any of the teaching file information, in most cases it is safe in the CTP directory tree.

When the plugin is started, it loads the MIRC configuration file. It then loads various databases and adds all the TFS servlets to the server. It also ensures that if the admin user exists, it has the author, publisher, and department roles. Finally, it rebuilds the RadLex index (if necessary), and starts several daemon threads to monitor the status of non-local libraries (LibraryMonitor), draft documents (DraftDocumentMonitor)), and the activity report submission process that sends information on the site to the RSNA (SummarySubmitter).

When CTP shuts down, the MIRC plugin receives a shutdown method call, which triggers the closing of all the databases.

4 The MIRC Configuration File

The MIRC plugin and the three TFS pipelines are configured in the config.xml file, but all the other configuration information for a TFS site is contained in the mirc.xml file, located in the root of the plugin (typically CTP/mircsite). The mirc.xml file contains all the configuration information for the site, all the local libraries it contains, all the non-local libraries it can query. the File Service, and the Case of the Day (if any). The file is parsed and managed by the mirc.MircConfig class. It is managed by the admin servlets for each of the major subsystems: QueryServiceAdmin, StorageServiceAdmin, and FileServiceAdmin.

This is an abbreviated listing of a mirc.xml file for a test site:

    date="2012.12.23 at 09:28:28 CST"
    sitename="JP's Teaching Files"
            <title>My MIRC Site</title>
            <title>CMH: Children's Memorial Hospital General Pediatric Cases</title>
        <title>20110902 DX CHEST STUDY</title>

These are the key attributes of the root element:

  • UI: the default UI of the system. Standard values are integrated and classic.
  • addresstype: the addressing mode of the system. Standard values are dynamic and static. For sites that operate in dynamic mode and have a numeric IP address, the siteurl attribute is updated with the actual IP address obtained from the operating system when the system starts. For sites that operate in static mode or have a non-numeric IP address, the siteurl attribute is not modified when the system starts.
  • date: the build date of the MIRC.jar file, obtained from the file's manifest when the system starts.
  • disclaimerurl: the URL of a web page to be displayed if the value of the popup attribute is notes.
  • downloadenb: whether to enable the DownloadService on the site. Typically, on the RSNA site has this service enabled.
  • email: the email address of the site admin. This is reported to the RSNA site as part of an Activity Summary report.
  • masthead: the name of the masthead file displayed in the classic UI. This file is loaded by the QueryService, and its context is query, so this file must be located in the CTP/mircsite/query directory. The default file is called manifest.jpg, and it is located in the MIRC.jar at query/masthead.jar. Unless a site has provided its own masthead, the default file is served from the jar.
  • mastheadheight: the vertical height of the masthead file.
  • mode: the mode in which to operate the site. Standard values are rad and vet, the latter for veterinary medicine. The choice affects the structure of the advanced query fields.
  • popup: the initial popup to display when a user first accesses the site. The standard values are help, notes, login, and none.
  • roles: a comma-separated list of user roles used by the site in addition to the standard roles.
  • rsnaVersion: the current MIRC version running on the RSNA site, obtained from the RSNA site when the local site starts. This is compared to the local version in the About TFS popup to determine whether to indicate that a newer version is available.
  • sharestats: whether to automatically submit Activity Summary reports to the RSNA site. Standard values are yes and no.
  • showptids: whether to display PHI in patient elements in MIRCdocuments. Standard values are yes and no.
  • showsitename: whether to overlay the sitename on the masthead in the classic UI. Standard values are yes and no.
  • siteid: the unique ID of the site, assigned automatically by the system. Its value is the system time in milliseconds when the system first starts. It is used by the RSNA TFS site to collate activity reports from the various sites in the field.
  • sitename: the name displayed on the query page.
  • siteurl: the URL of the site, including the protocol, the IP or domain name, and the port, but no path information.
  • timeout: the timeout in seconds for queries.
  • version>: the version of the MIRC.jar file, obtained from the file's manifest when the system starts.

5 The MIRC Base Servlet

6 Users, Roles, and Preferences

6.1 MircUserManagerServlet

6.2 PreferencesServlet

7 QueryService

7.1 QueryServiceAdmin

7.2 CaseNavigatorService

8 StorageService

8.1 StorageServiceAdmin

8.2 Support Services

8.2.1 AddImagesService

8.2.2 SortImagesService

8.2.3 CommentService

8.2.4 RevertService

8.2.5 PublishService

9 Conference Service

10 The Author Services

10.1 The Advanced Author Service

10.2 The Basic Author Service

10.3 The Submit Service

10.4 The Zip Service

10.5 Author Summary

11 The MIRC Pipelines

11.1 The File Service

11.2 The DICOM Service

11.3 The TCE Service

12 ResetSerice

13 DownloadService

14 Activity Report

15 RadLexSuggest

16 Utility Classes

16.1 MircDocument

16.2 RadLexIndex