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

Difference between revisions of "MDHT Template Sub Project"

From HL7Wiki
Jump to navigation Jump to search
Line 44: Line 44:
 
* [http://wiki.hl7.org/images/3/30/MDHT-Pilot-IG.pdf Published PDF implementation guide]
 
* [http://wiki.hl7.org/images/3/30/MDHT-Pilot-IG.pdf Published PDF implementation guide]
 
* [http://www.cdatools.org/infocenter/topic/org.openhealthtools.mdht.uml.cda.pilot.doc/classes/TBResultsSection.html On-line published Eclipse Help format]
 
* [http://www.cdatools.org/infocenter/topic/org.openhealthtools.mdht.uml.cda.pilot.doc/classes/TBResultsSection.html On-line published Eclipse Help format]
 +
 +
We have received several requests for an alternative implementation guide format that is tailored to developers, and not to standards committees. They have asked for each template to list the complete aggregate list of all inherited elements and conformance rules. Thus, a developer does not need to "follow the breadcrumbs" of template conformance references.
 +
 +
An implementation guide formatted for developers is included here as PDF:
 +
* [http://wiki.hl7.org/images/3/30/MDHT-Pilot-IG-developer.pdf Published PDF implementation guide for developers]
  
 
=== Instance Validation ===
 
=== Instance Validation ===

Revision as of 02:32, 30 April 2010

Back to Structured Document Template Design Pilot

Overview

The goal of this pilot is to demonstrate how the Model-Driven Health Tools (MDHT) CDA Tools project can be used to design and implement CDA templates. This includes the generation of a published implementation guide and an EMF-based Java runtime API that supports programmatic production, consumption, and validation of CDA XML instances.

An example application developer scenario would be to use the generated Java library to create an EHR system adapter that exports CDA TB Progress Note instances for exchange with external entities, or receive TB Progress Note instances and load them into domain-specific Java objects that may be processed to display or import data into the EHR system, and to validate instance (imported or exported) for conformance to the implementation guide template rules.

Project Status

  • Milestone 1 -- February 26, 2010
    • Completed UML model of all pilot conformance rules
    • Generated implementation guide to PDF and Eclipse Help format (html)
    • Generated Java runtime classes for creating, consuming, and validating CDA instances based on the pilot templates. Wrote small test Java program to demonstrate use.
    • Total time to review requirements and complete these three steps: 2 hours
  • Milestone 2 -- March 26, 2010
    • Updated value set representation
    • Updated implementation guide publishing to include CDA base type hyperlinks
    • See example published guide below
  • Milestone 3 -- April 30, 2010
    • Completed example web application for validating CDA documents
    • Validated sample documents for this pilot and linked results to this page
  • Next steps:
    • Expand example Java program to illustrate embedding TB Progress Note in a small application
    • Collaborate with architectural integration analysis

Deliverables

Template Authoring

We created a UML class for each template and specified all conformance rules using property redefinitions, directed associations, and directly using OCL expressions (for only one rule).

TODO: screencam of end-to-end modeling, publishing, and validation

We have found that the most intuitive and efficient editor for template definitions is a spreadsheet-style table editor. This editor directly modifies the underlying UML model, but with a different interface from the typical class diagram.

MDHT TableEdior.jpg

We are working on integrating an open source UML class diagram editor provided by the Eclipse UML2Tools project, but it is not yet ready for end-users. When templates are created using the table editor, one or more class diagrams may be created as views of the model. For example,

MDHT-CDA-pilot-diagram.png

Implementation Guide Publishing

The UML model created with template definitions is automatically transformed to DITA XML (OASIS standard), which is then published to PDF and Eclipse Help HTML format using the open source DITA-OT toolkit.

We have received several requests for an alternative implementation guide format that is tailored to developers, and not to standards committees. They have asked for each template to list the complete aggregate list of all inherited elements and conformance rules. Thus, a developer does not need to "follow the breadcrumbs" of template conformance references.

An implementation guide formatted for developers is included here as PDF:

Instance Validation

The template conformance rules represented in UML are transformed to OCL as part of the automated code generation. The resulting Java classes encapsulate all validation rules and may be used to parse and validate a CDA document instance. We have created an example web application (deployed using Apache Tomcat) that may be used to validate CDA documents for implementation guides that we have modeled. This pilot project model is included in the example site.

You may click the following URL link to upload and validate the 7 sample documents for this project:

Validation results captured as PDF from browser:

Architectural Integration

Generate Java-based Runtime API

The UML template model is transformed and imported into EMF, which is used to produce Java source code that supports:

  • Programmatic creation of CDA documents based on this implementation guide and serialization to conformant CDA instances
  • Parsing CDA XML documents into the domain-specific Java classes for this guide, which can then be used to process the contents, e.g. to import the data into other EHR applications
  • Validate CDA documents for conformance with this guide's templates

A simple Java program was written that creates a partial CDA document for this guide. We will expand the example during the next project milestone.

This program produces the following CDA document:

<ClinicalDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
  <templateId root="2.16.840.1.113883.10.20.15.2.6.1.1.1.1.1.2.3"/>
  <recordTarget>
    <patientRole>
      <patient>
        <name><family>Doe</family><given>John</given><prefix>Dr.</prefix></name>
        <name><family>Doe</family><suffix>M.D.</suffix></name>
      </patient>
    </patientRole>
  </recordTarget>
  <component>
    <structuredBody>
      <component>
        <section>
          <templateId root="2.16.840.1.113883.10.20.1.14"/>
          <templateId root="2.16.840.1.113883.10.20.15.2.6"/>
          <code code="30954-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Relevant diagnostic tests and/or laboratory data"/>
          <title>Relevant diagnostic tests and/or laboratory data</title>
          <entry>
            <organizer classCode="BATTERY" moodCode="EVN">
              <templateId root="2.16.840.1.113883.10.20.1.32"/>
              <templateId root="2.16.840.1.113883.10.20.15.3.21"/>
              <code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
              <component>
                <observation classCode="OBS" moodCode="EVN">
                  <templateId root="2.16.840.1.113883.10.20.1.31"/>
                  <templateId root="2.16.840.1.113883.10.20.15.3.13"/>
                  <code code="645-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
                  <statusCode code="completed" codeSystem="2.16.840.1.113883.5.14" codeSystemName="ActStatus"/>
                </observation>
              </component>
            </organizer>
          </entry>
        </section>
      </component>
    </structuredBody>
  </component>
</ClinicalDocument>

Using the generated Java classes to validate this sample yields the following validation errors:

ERROR: Diagnosis of org.openhealthtools.mdht.uml.cda.pilot.impl.TuberculosisFollowUpProgressNoteImpl@1412e75{urn:hl7-org:v3#//@clinicalDocument}
ERROR: The required feature 'id' of 'org.openhealthtools.mdht.uml.cda.pilot.impl.TuberculosisFollowUpProgressNoteImpl@1412e75{urn:hl7-org:v3#//@clinicalDocument}' must be set
ERROR: The required feature 'code' of 'org.openhealthtools.mdht.uml.cda.pilot.impl.TuberculosisFollowUpProgressNoteImpl@1412e75{urn:hl7-org:v3#//@clinicalDocument}' must be set
ERROR: The required feature 'effectiveTime' of 'org.openhealthtools.mdht.uml.cda.pilot.impl.TuberculosisFollowUpProgressNoteImpl@1412e75{urn:hl7-org:v3#//@clinicalDocument}' must be set
ERROR: The required feature 'confidentialityCode' of 'org.openhealthtools.mdht.uml.cda.pilot.impl.TuberculosisFollowUpProgressNoteImpl@1412e75{urn:hl7-org:v3#//@clinicalDocument}' must be set
ERROR: The feature 'author' of 'org.openhealthtools.mdht.uml.cda.pilot.impl.TuberculosisFollowUpProgressNoteImpl@1412e75{urn:hl7-org:v3#//@clinicalDocument}' with 0 values must have at least 1 values
ERROR: The required feature 'custodian' of 'org.openhealthtools.mdht.uml.cda.pilot.impl.TuberculosisFollowUpProgressNoteImpl@1412e75{urn:hl7-org:v3#//@clinicalDocument}' must be set
ERROR: CCD Results Section SHALL contain [1..1] text
ERROR: TBPN TB Results Section SHALL contain [1..1] text
INFO: TBPN TB Results Section MAY contain [0..*] entry such that it, SHALL contain [1..1] @typeCode="DRIV" DRIV (is derived from), SHALL contain [1..1] TB Result Organizer (templateId: 2.16.840.1.113883.10.20.15.3.21)
INFO: TBPN TB Results Section MAY contain [0..*] entry such that it, SHALL contain [1..1] @typeCode="DRIV" DRIV (is derived from), SHALL contain [1..1] TB Result Observation (templateId: 2.16.840.1.113883.10.20.15.3.13)
ERROR: The required feature 'statusCode' of 'org.openhealthtools.mdht.uml.cda.pilot.impl.TBResultOrganizerImpl@1dfc8a0{urn:hl7-org:v3#//@clinicalDocument/@component/@structuredBody/@component.0/@section/@entry.0/@organizer}' must be set
ERROR: CCD Result Organizer SHALL satisfy: Contains one or more sources of information.
ERROR: CCD Result Organizer SHALL contain [1..*] id
ERROR: CCD Result Organizer SHALL contain [1..1] statusCode
ERROR: TBPN TB Result Organizer SHALL contain [1..1] code, which SHALL be selected from ValueSet 2.16.840.1.114222.4.11.3205 Lab Test Result Name (TB) DYNAMIC
WARNING: CCD Result Observation SHOULD satisfy: Contain one or more referenceRange to show the normal range of values for the observation result
ERROR: CCD Result Observation SHALL satisfy: Contains one or more sources of information.
ERROR: CCD Result Observation SHALL contain [1..*] id
WARNING: CCD Result Observation SHOULD contain [1..1] effectiveTime
INFO: CCD Result Observation MAY contain [0..1] methodCode
WARNING: CCD Result Observation SHOULD contain [0..*] interpretationCode
ERROR: CCD Result Observation SHALL contain [1..1] value