<?xml version="1.0" encoding="US-ASCII"?>
<!--
============================================================
============================================================
HL7 Document Patient Record Architecture 
Level One Architectural DTD. 
Drafted by the Kona Editorial Group (KEG), a group chartered by the HL7
SGML/XML SIG

Requires Header declarations version 0.01


This draft document is a work in progress. It represents the deliberations
of the Kona Editorial Group (a working group of the HL7 SGML/XML Special
Interest Group) as of the date it was issued. 
The KEG has reached consensus on this draft, but other
requirements of a full Level One architectural DTD are under development and
will be posted as an Open Issues document on the SIG listserv.
We are issuing this document to solicit comments on our progress.
This document has not yet been subjected to close review by the entire HL7
SGML/XML SIG nor by HL7 at large.

The XML approach in this document will not necessarily follow the same style
being proposed for HL7 Version 3.0. While there are no purposeful
differences at this point, the V3-XML project is a moving target. Efforts
will be made to explicitly list identified differences in subsequent
versions of this draft.

Comments may be sent to HL7 SGML listserv.

This is a draft document and may be updated or replaced at any time.

============================================================
============================================================
-->

<!--
============================================================
============================================================
Change Log

Each change must reference:
  the version number
  the date of the change
  the author 
============================================================
============================================================
Version 0.01:1999/1/20:harding
Changed list type so list list.type attribute defaults to 
'unordered' instead of implied.

Version 0.01:1999/1/19:dolin
Added an entity reference to import the Header DTD:
<!ENTITY % hd SYSTEM "Header.dtd">
%hd;

Version 0.01:1999/1/11:dolin
Changed content model of list to add an optional list title followed by one or more
items. Content model of list.title is %content;
Added optional attribute "list.type" to list element to specify whether list is meant 
to be ordered or unordered.
Changed content model of item to (%content; | %internal.structures;)*.

Version 0.01:1999/1/6:harding
Added ignore attribute to local.markup to provide hint for
receiver regarding processing.

Version 0.01:1998/12/22:dolin
Removed arch.bridge. Use local.markup. Will add arch.bridge 
if an appropriate use case is found.

Version 0.01:1998/12/3:harding
Changed heading comment to that supplied by Liora

Version 0.01:1998/12/3:harding
Removed link from healthcare.code and added an attribute
(original.text) to permit linking to associated text 
wherever it occurs in the document.

Version 0.01:1998/11/30:harding
Added 'version' attribute to LevelOne element.

Version 0.01:1998/11/30:harding
Added 'html-like' link to the link declartion

Version 0.01:1998/11/30:harding
Some elements will be the same across all levels. These elements are those
found in the entity 'content'. Added comment to indicating these elements
are shared by all levels.

-->

<![IGNORE[

<!-
============================================================
============================================================
SGML Architecture Syntax

Uses constructs not available in XML.

Use this syntax in your DTD to enable processing using this
meta-dtd. 

For further details refer to: 
ISO 10744 
Structuring XML Documents by David Megginson (ISBN 0-13-642299-3)
  www.megginson.com/XAF
============================================================
============================================================
-->

<!-- Architectural Base Description -->
<?IS10744 ArcBase LevelOne>

<!-- Architectural Notation Declaration -->
<!NOTATION LevelOne PUBLIC
     "-//HL7 KEG//NOTATION AFDR ARCBASE HL7 Document architecture LevelOne//EN">

<!-- Architecture Support Attribute Declaration -->
<!ATTLIST #NOTATION LevelOne 
     ArcDtd CDATA #FIXED "LevelOne.dtd">

<!-- Architecture Entity Declaration -->
<!NOTATION SGML PUBLIC
     "ISO 8879:1986//NOTATION Standard Generalized Markup Language//EN">
<!ENTITY LevelOne.dtd PUBLIC
     "-//HL7 KEG//DTD LevelOne//EN" CDATA SGML>

]]>

<![IGNORE[
<!-
============================================================
============================================================
XML Architecture Syntax

Use this syntax in your DTD to enable processing using this
meta-dtd. 

For further details refer to: 
ISO 10744 
Structuring XML Documents by David Megginson (ISBN 0-13-642299-3)
  www.megginson.com/XAF

============================================================
============================================================
-->

<?IS10744:arch name="LevelOne"
     public-id="-//HL7 KEG//NOTATION AFDR ARCBASE HL7 Document architecture LevelOne//EN"
     dtd-system-id="LevelOne.dtd"?>

]]>

<!--
============================================================
============================================================
The following system id must be changed to point to the
location of the Header file on your system.
============================================================
============================================================
-->

<!ENTITY % hd SYSTEM "Header.dtd">
%hd;

<!--
============================================================
============================================================
Shared Entities 

Content elements provide context. These elements are used
at all levels.

Internal.structures provide shared structural elements.

============================================================
============================================================
-->

<!ENTITY % content 
  " #PCDATA 
  | local.markup 
  | healthcare.code
  | link
">

<!ENTITY % internal.structures
  " paragraph 
  | list 
  | table
">

<!--
============================================================
============================================================
Level One Root

This is only mixed case element or attribute. 
All the rest are lower case.

Contains a header followed by a body.

The header elements are defined in another entity to allow
Re-use for other levels.
============================================================
============================================================
-->

<!ELEMENT LevelOne (header, body) >
<!ATTLIST LevelOne
  version CDATA #FIXED "0.01"
>

<!ELEMENT body (section+) >
<!ATTLIST body 
  %common-atts;
>


<!--
============================================================
============================================================
Body Components (Section)

A section may contain a section.title.
internal structures and nested sections may be intermixed.

The healthcare.code in the section.title is NOT to be used to 
identify the section. Section identification is part of Level 2.
============================================================
============================================================
-->

<!ELEMENT section 
  ( section.title?, 
    (%internal.structures; | section)*
  )
>
<!ATTLIST section
  %common-atts;
>

<!ELEMENT section.title 
  ( %content;
  )*
>
<!ATTLIST section.title
  %common-atts;
>

<!--
============================================================
============================================================
Content Entity Elements
============================================================
============================================================
-->

<!-- 
***********************************
Healthcare.code

Healthcare.code should be used to derive 
medically-related in line items such as 
coded vocabularies. 
Cannot contain another healthcare.code.

identifier -  The code, that uniquely 
  identifies the item being 
  referenced by the text attribute.

preferred.name - The preferred name of 
  the item identified by the identifier 
  attribute, as determined by the coding 
  system.

name.of.coding.system - Identifiesthe party 
  responsible for creating the code in the 
  identifier attribute.

local.coding.system - Indicates if 
  name.of.coding.system is a local name or 
  a unique identifier defined by HL7.

instance.id - An id assigned to the particular 
  instance of the code by the originating 
  institution. (A particular patient may have 
  several episodes of bronchitis. Each episode 
  would potentially use the healthcare.code, 
  with all attributes being the same except 
  that the instance.id will be different for
  each episode.)

original.text - Space delimited list of IDs used
  to indicate text within the document relevant 
  to the healthcare.code.
***********************************
-->

<!ELEMENT healthcare.code 
  ( #PCDATA 
  | local.markup 
  )*
>

<!ATTLIST healthcare.code
  %common-atts;
  identifier CDATA #REQUIRED
  preferred.name CDATA #IMPLIED
  name.of.coding.system CDATA #REQUIRED
  coding.system.version CDATA #IMPLIED
  local.coding.system (Y|N) #REQUIRED
  instance.id CDATA #IMPLIED
  original.text IDREFS #IMPLIED
>

<!-- 
***********************************
Local.markup

Local.markup is similar to healthcare.code 
except that it is not medically related 
and doesn't have an implied data dictionary 
or look up table. 

Examples would include foreign terms, 
footnotes, emphasis, bold, italic, subscript,
superscript, items for 
internal workflow issues, etc. 

The default action for the receiver is to
ignore the local.markup and its contents.
This is reflected by having the ignore 
attribute default to 'all'. If the sender
choses to replace the default with the
value of 'markup' they are informing the
receiver that they think the content
enclosed in the markup may be useful.
But there is no requirement that the
receiver do anything with the markup
and content.

Descriptor describes the local markup.
Render may give indication of how the 
origin would render the content.

***********************************
-->

<!ELEMENT local.markup (%content;)* >
<!ATTLIST local.markup
  ignore (all | markup) "all"
  descriptor CDATA #IMPLIED
  render CDATA #IMPLIED
  %common-atts;
>

<!-- 
***********************************
Link

The current declaration provides for the simple link
mechanism found in HTML. This declaration will change
when more detailed link requirements have been 
obtained. These future changes will maintain compatiblity
with the current declaration (html.link will remain).

name    named link end
href    URL for linked resource 
rel     forward link types 
rev     reverse link types 
title   advisory title string 
***********************************
-->

<!ELEMENT link (html.link) >

<!ELEMENT html.link  (#PCDATA) >
<!ATTLIST html.link
  name    CDATA   #IMPLIED    
  href    CDATA   #IMPLIED   
  rel     CDATA   #IMPLIED 
  rev     CDATA   #IMPLIED  
  title   CDATA   #IMPLIED  
  %common-atts;
>

<!--
============================================================
============================================================
Internal Structures Entity Elements 
============================================================
============================================================
-->

<!-- 
***********************************
Paragraph
***********************************
-->

<!ELEMENT paragraph (%content;)* >
<!ATTLIST paragraph
  %common-atts;
>

<!-- 
***********************************
List

***********************************
-->

<!ELEMENT list (list.title?, item+)>
<!ATTLIST list 
  %common-atts;
  list.type (ordered | unordered) "unordered" 
>

<!ELEMENT list.title (%content;)*>
<!ATTLIST list.title %common-atts;>

<!ELEMENT item (%content; | %internal.structures;)*>
<!ATTLIST item %common-atts;>


<!-- 
============================================================
============================================================
Table

This table model represents one proposed model for Level One tables. The
KEG has not reached consensus on table model requirements or syntax, so
this model should not be taken as an indication of future table markup.

Captures the structural aspects of 
multi-dimensional tables and the 
content relationships. A table is 
made of fields which can contain 
cells. 

Fields and cells share common
attributes (t.global).

For more details see 
www.infoauto.com/articles/sgml/table.htm.
============================================================
============================================================
-->
 
<!--
=============================
t.global
 
ci (contained in) is the id of the 
containing element. A table item 
(field or cell) is contained in only 
one field. A cell must be contained 
in a field. This value captures the 
structure of the table.
 
do (depends on) captures the content 
relationships of the table. If the 
element is a field, do (depends on) 
is a space delimited list indicating 
the fields which the values in this 
field depend on to uniquely distinguish 
themselves from other values in this field. 
If the element is a cell, do (depends on) 
is a space delimited list indicating the 
cells in other fields which this cell 
depends on to uniquely distinguish the 
cell from other cells in its containing 
field.
 
t.id uniquely names each item.
=============================
-->
 
<!ENTITY % t.global
  "ci IDREF  #REQUIRED
   do IDREFS #REQUIRED
   t.id NMTOKEN #REQUIRED
">
 
<!--
=============================
Table
 
table.title labels the table.
A table is made of fields.
=============================
-->
 
<!ELEMENT table (table.title?, field+)>
<!ATTLIST table %t.global;>

<!ELEMENT table.title (%content;)*>
 
<!--
=============================
Field
 
Field.title labels of a set of 
values.
Type indicates the form of the 
information in the field.
Type may be used to direct 
formatting and alignment of
cells in the field.
=============================
-->
 
<!ELEMENT field (field.title, (field*|cell*))>
<!ATTLIST field
  %t.global;
  type ( char
       | date
       | dollar
       | signed-int
       | unsigned-int
       | scientific
       | real
       | formula
       | function
       ) "char"
>

<!ELEMENT field.title (%content;)*>
 
<!--
=============================
Cell
=============================
-->
 
<!ELEMENT cell (%content; | paragraph | list)* >
<!ATTLIST cell %t.global; >
 

