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
(New page: Category:RIMBAA Issue This page documents a number of best practices when it comes to persisting RIM-based objects, and *O-CP/RP cell transitions. ==ER database== *See ORM for ref...)
 
Line 3: Line 3:
  
 
==ER database==
 
==ER database==
 +
Note to the reader: it is assumed that you, dear reader, are already aware of
 +
pros and cons of ''object'' data models vs ''entity-relationship (ER)'' and
 +
''entity-attribute-value (EAV)'' data models, for here you will go through a
 +
best practice implemented by people who already took a decision: RIM objects
 +
managed by applications are mapped to E-R database structures.
 +
 +
to be continued, piece by piece, in the next weeks...
 +
 +
 
*See [[ORM]] for references.
 
*See [[ORM]] for references.
  

Revision as of 18:14, 14 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

Note to the reader: it is assumed that you, dear reader, are already aware of
pros and cons of object data models vs entity-relationship (ER) and 
entity-attribute-value (EAV) data models, for here you will go through a 
best practice implemented by people who already took a decision: RIM objects 
managed by applications are mapped to E-R database structures.

to be continued, piece by piece, in the next weeks...


  • See ORM for references.

XML database

This section discusses some of the advantages/disadvantages of using a XML database (instead of a traditional ER database).

  • 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.