CALM XML Document Specification


 
Overview

CALM uses an XML document format to persist its internal representation of the layout of a clinical assessment, including the scores, questions of the assessment, the layout of the form elements to input assessment data and the associations of the form fields and logical field groups with
the corresponding clinical assessment definition in the clinical database. The general structure of an CALM XML document is as follows

<caslayout type="document">
  <document name="sars2.xml">
     <description>A Clinical assessment layout description file</description>
      <page number="1">
         ...
      </page>
        ...
     <page number="n">
     </page>
  </document>
 <assessment name="Simpson Angus Rating Scale">
    <scores>
        ....
    </scores>
    <mandatory-fields>
       ...
    </mandatory-fields>
   <items>
     ....
   </items>
 </assessment>
 <bindings>
     <assessment-binding id="" name="assoc-assessment">
         ...
     </assessment-binding>
     <score-binding id="" name="Overall">
           ...
      </score-binding>
          ....
      <mandatory-binding id="" name="Date">
         ...
      </mandatory-binding>
         ... 
 </bindings>
 <logical-groups>
    <group id='1'>
        ...
     </group>
        ...
 <logical-groups>  
</caslayout>

In the following sections, each tag and children will be explained.

1. Document Declaration (<document>)

A document consists of multiple pages of forms for user input. Each form (<page>) usually corresponds to a single page in the paper form.

Attributes

1.1 Page Declaration

Each page contains a single <container> object holding the form elements and other containers for complex layouts.
Attributes


1.2 Display Component Declaration

A display component corresponds to form input element or static text in a form.  Each display component occupies a rectangular region of the size minus margins of the container cell it is in. Thus there can be only one display component per container cell. (A container is divided by an potentially irregular grid into cells for the display components).  Like a container , a display component has margins of 3 pixels in each side, which means that the actual width and height of a display component is 6 pixels shorter than its cell's width and height, respectively. The x and y
coordinates of a display component are absolute, not relative to the container the component is in. The common properties of a display component are
In addition each type of display component have properties unique to them (Unless explicitly stated every property is required).

1.2.1 Text Display Component

A text display component corresponds to static text (with possible styles like bold, italic, underline via embedded html tags and/or CSS style).

An example text display component in XML is as follows

<object class="caslayout.ui.TextDisplayComponent">
     <property name="x" value="361" />
     <property name="y" value="223" />
     <property name="height" value="56" />
     <property name="width" value="289" />
     <property name="id" value="C136" />
     <property name="name" value="" />
     <property name="parent" ref-id="2608483" />
     <property name="text" value="&lt;b&gt;Source&lt;/b&gt;" />
     <property name="justification" value="Left" />
 </object>

1.2.2 Checkbox Display component

A checkbox display component corresponds to a checkbox form element. An example checkbox display component is as follows

<object class="caslayout.ui.CheckBoxDisplayComponent">
      <property name="x" value="650" />
       <property name="y" value="223" />
       <property name="height" value="56" />
       <property name="width" value="526" />
       <property name="id" value="C131" />
       <property name="name" value="" />
       <property name="parent" ref-id="2608483" />
       <property name="text" value="Proband" />
       <property name="justification" value="Left" />
</object>

1.2.3 Radio Button Display component

A radio button display component corresponds to a radio button form element. An example radio button display component is as follows

<object class="caslayout.ui.RadioButtonDisplayComponent">
          <property name="x" value="1045" />
          <property name="y" value="52" />
          <property name="height" value="23" />
          <property name="width" value="23" />
          <property name="id" value="C21" />
          <property name="name" value="" />
          <property name="parent" ref-id="8820986" />
          <property name="text" value="0" />
          <property name="value" value="Normal" />
          <property name="justification" value="Center" />
</object>

1.2.4 Text Field Display Component

A text field display component corresponds to a text input field in a form.

An example text field display component in XML is as follows

<object class="caslayout.ui.TextFieldDisplayComponent">
      <property name="x" value="652" />
      <property name="y" value="508" />
      <property name="height" value="107" />
      <property name="width" value="528" />
      <property name="id" value="C137" />
      <property name="name" value="" />
      <property name="parent" ref-id="32032133" />
      <property name="fieldLength" value="10" />
      <property name="maxFieldLength" value="10" />
      <property name="justification" value="Left" />
 </object>

1.2.5 Text Area Display Component

A text area display component corresponds to a textarea input field in a web form.

An example text area display component in XML is as follows

  <object class="caslayout.ui.TextAreaDisplayComponent">
          <property name="x" value="888" />
          <property name="y" value="6" />
          <property name="height" value="224" />
          <property name="width" value="294" />
          <property name="id" value="C42" />
          <property name="name" value="" />
          <property name="parent" ref-id="30776636" />
          <property name="numCols" value="20" />
          <property name="numRows" value="3" />
          <property name="justification" value="Left" />
  </object>

1.2.6 Dropdown Display Component

A dropdown display component corresponds to a textarea input field in a web form.

1.2.6.1 Options section

Each dropdown component needs to have a <options> section containinng zero or more <option> tags. Each option has two attributes.
An example dropdown display component in XML is as follows

               <object class="caslayout.ui.DropdownDisplayComponent">
                    <property name="x" value="593" />
                    <property name="y" value="248" />
                    <property name="height" value="12" />
                    <property name="width" value="586" />
                    <property name="id" value="C2193" />
                    <property name="name" value="" />
                    <property name="parent" ref-id="14891765" />
                    <options>
                      <option label="unknown relationship" value="unknown relationship" />
                      <option label="self" value="self" />
                      <option label="mother" value="mother" />
                      <option label="father" value="father" />
                      <option label="mother-in-law" value="mother-in-law" />
                      <option label="father-in-law" value="father-in-law" />
                      <option label="sister" value="sister" />
                      <option label="brother" value="brother" />
                      <option label="sister-in-law" value="sister-in-law" />
                      <option label="brother-in-law" value="brother-in-law" />
                      <option label="daughter" value="daughter" />
                      <option label="son" value="son" />
                      <option label="daughter-in-law" value="daughter-in-law" />
                      <option label="son-in-law" value="son-in-law" />
                      <option label="aunt" value="aunt" />
                      <option label="uncle" value="uncle" />
                      <option label="niece" value="niece" />
                      <option label="nephew" value="nephew" />
                      <option label="colleague" value="colleague" />
                      <option label="roommate" value="roommate" />
                    </options>
                    <property name="justification" value="Center" />
                  </object>

1.2.7 Button Display Component

A button display component corresponds to a submit button in a HTML form. Only 'Next', 'Previous' and 'Submit', 'Add' and 'Skip' buttons can be defined.
Every multi-screen (multi-form) assessment requires navigation buttons ('Previous' and/or 'Next'). Currently only a single 'Submit' button is
supported. It can appear in multiple form screens to submit what is populated so far.
Optional properties only for a 'Skip' button
An example text field display component in XML is as follows

<object class="caslayout.ui.ButtonDisplayComponent">
        <property name="x" value="1004" />
        <property name="y" value="829" />
        <property name="height" value="71" />
        <property name="width" value="176" />
        <property name="id" value="C150" />
        <property name="name" value="" />
        <property name="parent" ref-id="32032133" />
        <property name="label" value="Next" />
        <property name="action" value="Next" />
        <property name="justification" value="Center" />
 </object>

1.3 Container Declaration

A container is a rectangular area which contains zero or more display components and/or other containers.  Each container is uniquely identified by an id , each container has a layout object describing how the contained objects  should be laid out on the CALM screen.  Each container has a list of components for the display components and/or other containers contained by it.Each container has margins (as defined by a java.awt.Insets object )
Attributes
Each container (and each display component object) has the following properties defined

Properties

Below, is a simplified declaration of a container in XML

<container class="caslayout.ui.CAPanel" isGroup="false" id="17023643">
        <property name="x" value="0" />
        ...
        <layout-man id="15607307" class="caslayout.ui.CAGridLayout" name="layoutMan">
        ...
        </layout-man>
        <insets class="java.awt.Insets">
        ...
         </insets>
        <collection name="components" type="list" class="java.util.ArrayList" size="1">
        ...
        </collection>
 </container>

1.3.1 Layout Manager Declaration

A layout manager object is responsible for the laying out of the components contained by a container. It defines the cells where the child components reside. There are two mechanisms available to create tailored layouts, which are a colum span, row span based grouping of cells into a one cell and percentage based resizing of the columns and rows. You should use percentage based method, since it is more intuitive and robust one. Each layout manager specifies the number of columns and rows of the inital grid. Because of the column/row merges each row may have different number of apparent cells.

Attributes

Properties

1.3.1.1 GridCellInfo Declaration (<grid-cell-info>)

A GridCellInfo is helper holding the state for the constraints of each grid cell in a layout manager. A GriDCellInfo always has a layout manager as parent and always contained within a layout manager object. Each GridCellInfo contains a collection ( generic data structure to hold multiple objects) for the visible rows of the layout. Because of the possible merging of the columns, each row may have apparently different number of columns. In percentage based layouts (the recommended layout model), the rows and columns cannot merged. However, columns can have 0%
widths, resulting in apparent decrease in the number of columns in an individual row.

Attributes
Properties

1.3.1.1.1 Declaration of the grid cell constraints (<collection>)

The cell constraints per row are contained in a Collection object. Each row <entry> contains an <array> data structure holding CellConstraint objects. Since percentage based cell constraining is the recommeded way, the <array> will contain cell constraints of type caslayout.ui.PercentCellConstraint for non-zero percent width colums. Hence each row entry can have have an array which is not the same size as the original (maxCols) number of columns.

1.3.1.1.1.1 PercentCellConstraint Object Declaration (<object>)

A PercentCellConstraint Object is a simple object (has attributes and properties and no complex objects). It defines the grid location and size of a cell in percentages.

Attributes
Properties

1.3.2 Margin (Insets) Declaration (<insets>)

Each container has an margin object.
Attributes
Properties

1.3.3 Components collection  for the container object (<collection>)

The components contained in a container are represented via a Collection having the name 'components'.  Each <entry> in the components collection corresponds either to a single display component object or an another container.  Any zero width column is represented by a null in the CALM.  The <entry> index specifies where the entry is in the collection and indirectly where it is in the visualized container. The components
collection can be seen as a one dimensional representation of the layout grid, first the columns of the first row, then the second and so on.


2. Assessment Declaration (<assessment>)

The assessment declaration corresponds to the assessment metadata read from the BIRN HID database particularly from NC_ASSESSMENT,
NC_ASSESSMENTSCORE, NC_ASSESSMENTSCORECODE and NC_ASESSMENTITEM tables for the particular assessment the form fields are associated.

Attributes
The <assessment> tag has a <scores> tag encapsulating 0 or more <score> tags.

2.1 Score declaration (<score>)

A <score> tag represents a clinical assessment score complete with its score codes (enumerations).

Attributes
A score can have a limited number of possible values, which are represented by a series of <scorecode> tags encapsulated in a <scorecodes>
tag.

2.1.1 Score Parent declaration (<parent> )

Since scores can form hierarchies, some scores will have a parent as indicated by the <parent> tag

Attributes

2.1.2 Scorecode declaration (<scorecode>)

Attributes

2.2 Mandatory Fields declaration (<mandatory-fields>)


TBD

2.2.1 Field declaration (<field>)

Attributes

2.3 Assessment Items (Questions) declaration  (<items>)

This tag encapsulates zero or more <item> tags.

2.3.1 Assessment Item (Question) declaration  (<item>)

TBD

3. Bindings (Associations) Declaration (<bindings>)

3.1 Assessment binding (<assessment-binding>)

3.1.1 Left side of the assessment - document association (<left>)

Attributes

3.1.2 Right side of the assessment - document association (<right>)

Attributes

3.2  Score - form element(s) association (<score-binding>)

Attributes

3.2.1 Left side of the score - form element(s) association (<left>)

Attributes

3.2.2 Right side of the score - form element(s) association (<right>)

Attributes

3.2.3 Score Value Binding (<score-value-binding>)

Attributes

3.3  Score Code - form element Associations (<score-code-bindings>) (Optional )

Allows determination of the form element score code bindings (which score code is mapped to which display component).

3.3.1 Score code - form element association (<sc-binding>)

Attributes

3.4  Mandatory field - form element Association (<mandatory-binding>)

Attributes

3.4.1 Left side of the mandatory field - form element association (<left>)

Attributes

3.4.2 Right side of the mandatory field - form element association (<right>)

Attributes

3.4.3 Value Binding (<value-binding>)

Attributes
TBD

4. Logical Groups Declaration (<logical-groups>)

Holds a list of grouped display components (like check boxes or radio buttons ) mapping to a single score.  Each logical group is represented by a
<group> XML tag.

4.1 Logical Group  Declaration (<group>)

Attributes
Contains one or more <display-comp> XMLtags

4.1.1 Display component reference Declaration (<display-comp>)

Attributes

5. Data Structure Representations in XML

5.1 Array

An array is a collection of data items , all of the same type, in which each item's position is uniqely designated by an integer.  Each array XML
definition contains a definite number (as defined by the length attribute) of <object> definitions of the same type

Attributes

5.2 Collection

A collection is a data structure groups together several pontentially different things. XML definition of a collection consists of a number of <entry> objects corresponding to the non-null objects in the collection. A container can have null elements, the size attribute contains also the null objects.

Attributes

5.2.1 Entry

An entry corresponds to a thing inside a collection. An entry encapsulates any type of object, including other data structures.

Attributes

 $Id: calm_document_spec.html,v 1.6 2004/12/08 02:31:47 bozyurt Exp $