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

Difference between revisions of "ORM best practices"

From HL7Wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
==ER database==
 
==ER database==
 
This section discusses some of the best practices for those applications that map RIM objects to an E-R database structure. <br/>
 
This section discusses some of the best practices for those applications that map RIM objects to an E-R database structure. <br/>
'''Note to readers''': the reader is is assumed to be aware of the characteristics of the [http://en.wikipedia.org/wiki/Object_(computer_science) object data model], the [http://en.wikipedia.org/wiki/Entity-relationship_model entity-relationship (ER)] data model and the [http://en.wikipedia.org/wiki/Entity-attribute-value_model entity-attribute-value (EAV)] data model.  
+
'''Note to readers''': the reader is assumed to be aware of the characteristics of the [http://en.wikipedia.org/wiki/Object_(computer_science) object data model], the [http://en.wikipedia.org/wiki/Entity-relationship_model entity-relationship (ER)] data model and the [http://en.wikipedia.org/wiki/Entity-attribute-value_model entity-attribute-value (EAV)] data model.  
  
  
 
*See [[ORM]] for references.
 
*See [[ORM]] for references.
 +
 +
'''Introduction'''
 +
 +
The purpose of this white paper is to describe a process for transforming the Health Level Seven (HL7) Reference Information Model (RIM) into a Logical Data Model (LDM) and a Physical Data Model (PDM).  The HL7 RIM is a conceptual data model built and maintained by HL7 to be used as a source of the data content portion of HL7 standards.  Because it is a conceptual data model, the RIM is not well suited to be used as the design of a relational database schema.  The RIM contains abstract classes, complex datatypes, and generic business rules that need to be resolved and reconciled to form a LDM. This guide describes then how to generate a PDM from the LDM via Hibernate o-r mapping tool. The target databases are MySQL and Oracle.
  
 
==XML database==
 
==XML database==

Revision as of 21:15, 20 February 2010

This page documents a number of best practices when it comes to persisting RIM-based objects, and *O-CP/RP cell transitions.

ER database

This section discusses some of the best practices for those applications that map RIM objects to an E-R database structure.
Note to readers: the reader is assumed to be aware of the characteristics of the object data model, the entity-relationship (ER) data model and the entity-attribute-value (EAV) data model.


  • See ORM for references.

Introduction

The purpose of this white paper is to describe a process for transforming the Health Level Seven (HL7) Reference Information Model (RIM) into a Logical Data Model (LDM) and a Physical Data Model (PDM). The HL7 RIM is a conceptual data model built and maintained by HL7 to be used as a source of the data content portion of HL7 standards. Because it is a conceptual data model, the RIM is not well suited to be used as the design of a relational database schema. The RIM contains abstract classes, complex datatypes, and generic business rules that need to be resolved and reconciled to form a LDM. This guide describes then how to generate a PDM from the LDM via Hibernate o-r mapping tool. The target databases are MySQL and Oracle.

XML database

This section discusses some of the best practices for those applications that map RIM objects to a XML database.
Note to readers: the reader is assumed to have basic knowledge of XML Databases.

  • It has the advantage that full fidelity (of the XML) is maintained. The use of an XML database makes sense if one only has to support CDA, in which case the XML version has to persisted, even if the data contained therein is stored in a structured fashion.
  • It has the advantage that one doesn't need any joins (depending on how big of an XML snippet one persists, could be the entire message/CDA message type, or it could just be a series of derived XML snippets, e.g. the CDA part which identifies the Patient).
  • It has the disadvantage that XQuery is a standard unfamiliar to most, one implementation had to export data to ER-based Datamarts - these Datamarts where queried using SQL to do statistical/clinical analysis of the data.

Best practices:

  • If one received data according to different Message Types, the clone names used for classes will be different. To use XQuery, one has to transform the XML (as received) into an alternative representation which is based on names of RIM classes. This allows for XQuerying across all data received, regardless of the clone names used in any particular model. If persistence isn't limited to one single message type (e.g. the CDA R-MIM for some applications) the use of the RIM ITS should be seen as a necessity.