Difference between revisions of "The MIRCquery Schema"

From MircWiki
Jump to navigation Jump to search
Line 84: Line 84:
For that reason, storage services should not test the Content-Type using something like:
For that reason, storage services should not test the Content-Type using something like:
if (contentType.equals(“text/xml”)) { … }
if (contentType.equals(“text/xml”)) { … }

Revision as of 12:05, 7 July 2006

This article describes technical requirements for participation in the MIRC community as a storage service. Additional information is provided in The MIRCqueryresult Schema and The MIRCdocument Schema.

The intended audience for this article is the system administrator or developer of a teaching file system who is implementing a MIRC storage service to make the system’s teaching files available to the MIRC community.

1 Overview

MIRC may be defined as a collection of web sites that share a common query mechanism.

The two key components involved in the query process are:

  • Query Service: a web site that is accessed by a MIRC user with a web browser. The query service provides web pages that allow a user to define search criteria and select sites in the MIRC community to be searched. It queries the selected sites, organizes the query results into a web page or pages, and sends the pages to the browser.
  • Storage Service: a web site that stores information of interest to MIRC users. In response to a query received from a query service, it identifies all the information it stores which meets the search criteria, constructs a query response containing an abstract of the information to allow a user to determine whether the information is of interest, and sends the response to the query service. It also serves the information directly to a MIRC user in response to a request from the user.

The query service and storage service are independent. A MIRC site may include a query service or a storage service, or both.

2 MIRC Query

A MIRC query is an XML object in the form defined by the MIRCquery schema. It is passed from a query site to a storage service via an HTTP POST of content type text/xml.

The following is an example of a MIRCquery:

<MIRCquery firstresult=”…” maxresults=”…” queryUID=”…” unknown=”…”>
    <title> . . . </title>
    <author>    . . .    </author>
    <abstract> . . . </abstract>
    <keywords> . . . </keywords>
    <history> . . . </history>
    <findings> . . . </findings>
    <diagnosis> . . . </diagnosis>
    <differential-diagnosis> . . . </differential-diagnosis>
    <discussion> . . . </discussion>
    <pathology> . . . </pathology>
    <anatomy> . . . </anatomy>
    <organ-system> . . . </organ-system>
    <code coding-system=”…”> . . . </code>
    <modality> . . . </modality>
            <years> . . . </years>
            <months> . . . </months>
            <weeks> . . . </weeks>
            <days> . . . </days>
        <pt-sex> . . . </pt-sex>
        <pt-race> . . . </pt-race>
        <pt-species> . . . </pt-species>    <!—-veterinary-->
        <pt-breed> . . . </pt-breed>        <!--veterinary-->
        <format> . . . </format>
        <compression> . . . </compression>
        <modality> . . . </modality>
        <anatomy> . . . </anatomy>
        <pathology> . . . </pathology>
    <document-type> . . . </document-type>
    <category> . . . </category>
    <level> . . . </level>
    <access> . . . </access>
    <language code=”…”> . . . </language>
    … free text search field …

3 Query Rules

There may be at most one child element of each type in a MIRCquery. Complex searches within an element type are done using the boolean syntax described below.

The RSNA query and storage services implement the following search rules:

  • If text appears in any MIRCquery child element or attribute, it is a required match for a corresponding element in a document to be listed in the search results.
  • All child elements appearing within a MIRCquery are required matches, e.g., a matching document is one that matches all query fields.
  • Child elements that are not included in a MIRCquery are not required matches. Thus, an empty MIRCquery (<MIRCquery/>) is a match to all documents in the storage service.
  • Text is not case-sensitive.
  • A free-text search, matching text anywhere in a document, is done by placing the search text in the text value of the <MIRCquery> element.
  • Search text containing separate words with no intervening operator characters results in a logical AND of all the words, but not necessarily in order.
  • Search text can be constructed with a logical OR using the “|” character.
  • Search text can be constrained to appear in order by placing it in quotes within the search string.
  • Complex combinations of logical AND and logical OR operations can be created using the parenthesis operator, ( … ).

Note that the first bullet above implies that if text appears in a MIRCquery element or attribute that is not supported by a site’s software implementation, the site must return zero matches.

4 Notes and Suggestions for Implementers

4.1 Content Type

To provide the most efficient support for all languages, query services and storage services should transmit their MIRCquery and MIRCqueryresult contents in UTF-8. Some MIRC query service implementations, in order to convert to UTF-8, transmit a content type of:

text/xml; charset=utf-8

For that reason, storage services should not test the Content-Type using something like:

if (contentType.equals(“text/xml”)) { … }

but instead:

if (contentType.indexOf(“text/xml”) != -1) { … }

4.2 The Abstract

The contents of the abstract element should be brief – less than 10 lines of text – in order to keep the complete set of query results short enough to allow the user to look through the results and select the desired document. The RSNA query service imposes a 1000-character limit on the length of the abstract. Abstracts that exceed the limit are truncated, and any embedded element tags (e.g. HTML) are suppressed to ensure that the result remains well-formed.

If the document is not in HTML format, its format can be noted in the abstract to assist the user in deciding whether the document is of interest.