This wiki has undergone a migration to Confluence found Here
<meta name="googlebot" content="noindex">

Difference between revisions of "Self Displaying CDA"

From HL7Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
This project will describe how to embed a display stylesheet in a CDA document to make it possible to display in a web browser.
 
This project will describe how to embed a display stylesheet in a CDA document to make it possible to display in a web browser.
; Project Scope Statement : [http://www.hl7.org/special/Committees/projman/searchableProjectIndex.cfm?action=edit&ProjectNumber=711 #711 in Project Insight]
+
; Project Scope Statement &#x3A; [http ://www.hl7.org/special/Committees/projman/searchableProjectIndex.cfm?action=edit&ProjectNumber=711 #711 in Project Insight]
 +
==Scope==
 +
''See the Project Scope Statement Above''
 +
 
 +
=== Who should read this specification ===
 +
Browser developers and creators of CDA documents who wish these documents to be easily viewed in a web browser.
 +
== Conformance ==
 +
A Self Displaying CDA document that conforms to all the SHALL requirements of this guide SHALL include a
 +
 
 +
<templateId root='TBD'/>
 +
 
 +
element under the <ClinicalDocument> element.
 +
 
 +
<ClinicalDocument ... >
 +
  <templateId root='TBD.1'/>
 +
  ...
 +
 
 +
A Self Displaying CDA document that conforms to all the SHALL requirements and SHOULD requirements of this guide SHOULD include a
 +
<templateId root='TBD.1'/>
 +
element under the <ClinicalDocument> element in addition to the previous <templateId> element.
 +
 
 +
<ClinicalDocument ... >
 +
  <templateId root='TBD'/>
 +
  <templateId root='TBD.1'/>
 +
  ...
 +
 
 +
== Stylesheet Processing Instruction ==
 +
A self-displaying CDA document SHALL include an XML declaration. 
 +
The XML declaration need not be for a specific XML version or character encoding.
 +
 
 +
The presense of an XML declaration is required to avoid putting the displaying browser in QUIRKS mode.  This specification does not require a specific version of XML or character encoding to be used.
 +
 
 +
<?xml version='1.0' encoding='UTF-8'?>
 +
 
 +
A self-displaying CDA document SHALL include the following stylesheet processing instruction after the XML declaration and before the <ClinicalDocument> element of the CDA.
 +
 
 +
<?xml version='1.0' encoding='UTF-8'?>
 +
<?xml-stylesheet type='text/css' href='#css'?>
 +
<ClinicalDocument ...>
 +
 
 +
? Should the href be fixed by this specification?  Advantage &#x3A;  One way to handle it, and it can be simple, and selected to avoid confusion with other possible ID attributes.  #css may not work.  It might need to be less likely to have been used, like #hl7-org-cda-css.  If not fixed by this specification, it should be recommended...
 +
 
 +
The first section of the CDA Document shall contain an <observationMedia> element containing a <value> element that SHALL contain the following content :
 +
<pre>
 +
<observationMedia classCode="OBS" moodCode="EVN">
 +
  <value mediaType="text/css" representation="TXT" xml :id='css'>
 +
      // THIS IS STILL VERY MUCH DRAFT
 +
      paragraph, addr, text { display &#x3A; block; }
 +
      ClinicalDocument { display &#x3A; block; }
 +
      #css            { display &#x3A; none; }
 +
      entry            { display &#x3A; none; }
 +
      name            { display &#x3A; block; }
 +
      section>text    { display &#x3A; block; }
 +
      table            { display &#x3A; block; /* table; */border-spacing &#x3A; 2px; }
 +
      tr              { display &#x3A; block; /* table-row;*/ vertical-align &#x3A; inherit }
 +
      thead            { display &#x3A; block; /* table-header-group; */ vertical-align &#x3A; middle  }
 +
      tbody            { display &#x3A; block; /* table-row-group; */ vertical-align &#x3A; middle  }
 +
      tfoot            { display &#x3A; block; /* table-footer-group; */ vertical-align &#x3A; middle  }
 +
      col              { display &#x3A; table-column; }
 +
      colgroup        { display &#x3A; table-column-group; }
 +
      td              { display &#x3A; inline-block; /* table-cell; */ vertical-align &#x3A; inherit; }
 +
      th              { display &#x3A; inline-block; /* table-cell; */ font-weight &#x3A; bolder; text-align &#x3A; center; vertical-align &#x3A; inherit }
 +
      table>caption    { display &#x3A; block; /* table-caption; */ text-align &#x3A; center; }
 +
     
 +
      structuredBody  { margin &#x3A; 8px; display &#x3A; block; }
 +
     
 +
      ClinicalDocument>title { font-size &#x3A; 2em; margin &#x3A; .67em 0 }
 +
      structuredBody>component>section>title { font-size &#x3A; 1.5em; margin &#x3A; .75em 0; }
 +
      structuredBody>component>section>component>section>title { font-size &#x3A; 1.17em; margin &#x3A; .83em 0 }
 +
      structuredBody>component>section>component>section>component>section title { margin &#x3A; 1.12em 0 }
 +
      structuredBody>component>section>component>section>component>section>component>section>title { font-size &#x3A; .83em; margin &#x3A; 1.5em 0 }
 +
      structuredBody>component>section>component>section>component>section>component>section>component>section>title { font-size &#x3A; .75em; margin &#x3A; 1.67em 0 }
 +
      title          { padding-top &#x3A; 10px; font-weight &#x3A; bolder; display &#x3A; block;  }
 +
 
 +
      addr            { font-style &#x3A; italic }
 +
      sub            { font-size &#x3A; .83em; vertical-align &#x3A; sub }
 +
      sup            { font-size &#x3A; .83em; vertical-align &#x3A; super }
 +
 
 +
      list            { margin &#x3A; 1.12em 0; margin-left &#x3A; 40px;  display &#x3A; block;  }
 +
      list [listType="ordered"] { margin &#x3A; 1.12em 0; margin-left &#x3A; 40px;  display &#x3A; block;  list-style-type &#x3A; decimal; }
 +
      list [listType="unordered"] { margin &#x3A; 1.12em 0; margin-left &#x3A; 40px;  display &#x3A; block;  list-style-type &#x3A; decimal; }
 +
      item            { display &#x3A; list-item; }
 +
      list>list      { margin-top &#x3A; 0; margin-bottom &#x3A; 0 }
 +
      br :before      { content &#x3A; "\A"; white-space &#x3A; pre-line }
 +
      streetAddressLine :before,
 +
      city :before
 +
      country :before  { content &#x3A; "\A"; white-space &#x3A; pre-line }
 +
      center          { text-align &#x3A; center }
 +
      :link,  :visited { text-decoration &#x3A; underline }
 +
      :focus          { outline &#x3A; thin dotted invert }
 +
  </value>
 +
</observationMedia>
 +
</pre>
 +
?  What can be changed?  Is it all fixed?  What is extensible?  How are things measured?  Some thoughts &#x3A;  Measurements are based relative font sizes, so that fonts can size up/down for ease of reading.
 +
 
 +
Two choices for tables :
 +
1. A Self-Displaying CDA document SHOULD NOT contain tables.
 +
2. A Self-Displaying CDA document MAY contain tables.  Tables SHOULD be aligned using monospaced font and padding characters.
 +
One of these is needed for broad browser support.
 +
 
 +
A Self-Displayinbg CDA SHALL NOT contain nested tables, or tables where columns or rows have been spanned.
 +
Due to limited support in browsers for XML tables, nested tables or tables with column or row-spanning will not be accurately displayed and could result in misinterpretation, with potential patient safety consequences.
 +
 
 +
A Self-Displaying CDA SHALL NOT use renderMultimedia elements.
 +
There is presently no way to indicate that renderMultimedia elements reference content that can be displayed using CSS.
 +
? The above could be caveated by appending "that are required to be displayed to understand the content", but I don't think that works as guidance.
 +
 
 +
A Self-Displaying CDA SHOULD include a preface in the content attribute for the ClinicalDocument stylesheet that explains what the limitations are to the viewer of the document using that stylesheet.
 +
 
 +
A Self-Displaying CDA MAY use StyleCodes not defined by the CDA standard.  If it does, these SHOULD be noted as limitations.

Revision as of 06:57, 18 November 2010

This project will describe how to embed a display stylesheet in a CDA document to make it possible to display in a web browser.

Project Scope Statement : [http 
//www.hl7.org/special/Committees/projman/searchableProjectIndex.cfm?action=edit&ProjectNumber=711 #711 in Project Insight]

Scope

See the Project Scope Statement Above

Who should read this specification

Browser developers and creators of CDA documents who wish these documents to be easily viewed in a web browser.

Conformance

A Self Displaying CDA document that conforms to all the SHALL requirements of this guide SHALL include a

<templateId root='TBD'/> 

element under the <ClinicalDocument> element.

<ClinicalDocument ... >
 <templateId root='TBD.1'/> 
  ...

A Self Displaying CDA document that conforms to all the SHALL requirements and SHOULD requirements of this guide SHOULD include a

<templateId root='TBD.1'/> 

element under the <ClinicalDocument> element in addition to the previous <templateId> element.

<ClinicalDocument ... >
 <templateId root='TBD'/> 
 <templateId root='TBD.1'/> 
  ...

Stylesheet Processing Instruction

A self-displaying CDA document SHALL include an XML declaration. The XML declaration need not be for a specific XML version or character encoding.

The presense of an XML declaration is required to avoid putting the displaying browser in QUIRKS mode. This specification does not require a specific version of XML or character encoding to be used.

<?xml version='1.0' encoding='UTF-8'?>

A self-displaying CDA document SHALL include the following stylesheet processing instruction after the XML declaration and before the <ClinicalDocument> element of the CDA.

<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet type='text/css' href='#css'?>
<ClinicalDocument ...>

? Should the href be fixed by this specification? Advantage : One way to handle it, and it can be simple, and selected to avoid confusion with other possible ID attributes. #css may not work. It might need to be less likely to have been used, like #hl7-org-cda-css. If not fixed by this specification, it should be recommended...

The first section of the CDA Document shall contain an <observationMedia> element containing a <value> element that SHALL contain the following content :

 <observationMedia classCode="OBS" moodCode="EVN">
  <value mediaType="text/css" representation="TXT" xml :id='css'>
      // THIS IS STILL VERY MUCH DRAFT
      paragraph, addr, text { display : block; }
      ClinicalDocument { display : block; }
      #css             { display : none; }
      entry            { display : none; }
      name             { display : block; }
      section>text     { display : block; }
      table            { display : block; /* table; */border-spacing : 2px; }
      tr               { display : block; /* table-row;*/ vertical-align : inherit }
      thead            { display : block; /* table-header-group; */ vertical-align : middle  }
      tbody            { display : block; /* table-row-group; */ vertical-align : middle  }
      tfoot            { display : block; /* table-footer-group; */ vertical-align : middle  }
      col              { display : table-column; }
      colgroup         { display : table-column-group; }
      td               { display : inline-block; /* table-cell; */ vertical-align : inherit; }
      th               { display : inline-block; /* table-cell; */ font-weight : bolder; text-align : center; vertical-align : inherit }
      table>caption    { display : block; /* table-caption; */ text-align : center; }
      
      structuredBody   { margin : 8px; display : block; }
      
      ClinicalDocument>title { font-size : 2em; margin : .67em 0 }
      structuredBody>component>section>title { font-size : 1.5em; margin : .75em 0; }
      structuredBody>component>section>component>section>title { font-size : 1.17em; margin : .83em 0 }
      structuredBody>component>section>component>section>component>section title { margin : 1.12em 0 } 
      structuredBody>component>section>component>section>component>section>component>section>title { font-size : .83em; margin : 1.5em 0 }
      structuredBody>component>section>component>section>component>section>component>section>component>section>title { font-size : .75em; margin : 1.67em 0 }
      title           { padding-top : 10px; font-weight : bolder; display : block;  }
   
      addr            { font-style : italic }
      sub             { font-size : .83em; vertical-align : sub }
      sup             { font-size : .83em; vertical-align : super }

      list            { margin : 1.12em 0; margin-left : 40px;  display : block;  }
      list [listType="ordered"] { margin : 1.12em 0; margin-left : 40px;  display : block;  list-style-type : decimal; }
      list [listType="unordered"] { margin : 1.12em 0; margin-left : 40px;  display : block;  list-style-type : decimal; }
      item             { display : list-item; }
      list>list       { margin-top : 0; margin-bottom : 0 }
      br :before       { content : "\A"; white-space : pre-line }
      streetAddressLine :before, 
      city :before
      country :before  { content : "\A"; white-space : pre-line }
      center          { text-align : center }
       :link,  :visited { text-decoration : underline }
       :focus          { outline : thin dotted invert }
  </value>
 </observationMedia>

? What can be changed? Is it all fixed? What is extensible? How are things measured? Some thoughts : Measurements are based relative font sizes, so that fonts can size up/down for ease of reading.

Two choices for tables : 1. A Self-Displaying CDA document SHOULD NOT contain tables. 2. A Self-Displaying CDA document MAY contain tables. Tables SHOULD be aligned using monospaced font and padding characters. One of these is needed for broad browser support.

A Self-Displayinbg CDA SHALL NOT contain nested tables, or tables where columns or rows have been spanned. Due to limited support in browsers for XML tables, nested tables or tables with column or row-spanning will not be accurately displayed and could result in misinterpretation, with potential patient safety consequences.

A Self-Displaying CDA SHALL NOT use renderMultimedia elements. There is presently no way to indicate that renderMultimedia elements reference content that can be displayed using CSS. ? The above could be caveated by appending "that are required to be displayed to understand the content", but I don't think that works as guidance.

A Self-Displaying CDA SHOULD include a preface in the content attribute for the ClinicalDocument stylesheet that explains what the limitations are to the viewer of the document using that stylesheet.

A Self-Displaying CDA MAY use StyleCodes not defined by the CDA standard. If it does, these SHOULD be noted as limitations.