1 / 52

HL7 version 3

HL7 version 3. In-memory object processing. Scope: object based onformance/validation testing, class generators, M2M transoformations. Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.de/download/HL7v3_implementation.zip. Agenda.

keene
Télécharger la présentation

HL7 version 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HL7 version 3 In-memory object processing Scope: object based onformance/validation testing, class generators, M2M transoformations Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.de/download/HL7v3_implementation.zip

  2. Agenda • Class generators • MDE principles • MIF/Schema based generators • M2M transformations • Model versioning • OO-based conformance/validation • Implementation experiences

  3. RIMBAA Technology Matrix Persistent Representation Object Representation Serialized Representation RIM (generic) Model RIM Constrained Information Model Application specific Model

  4. In-memory object processing Class Generators Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.de/download/implementation_mechanics.ppt

  5. Traditional Software Development Gather requirements Build Image credits: Johan den Haan, Mendix.nl

  6. Model Driven Software Development (MDD) Model Generate Image credits: Johan den Haan, Mendix.nl

  7. MDD - Application Generation Generic Software Components -Terminology -Data types Software application RIM Persistence Database

  8. MDD –Prescription Example • RIM based model for Prescription • Business workflow • Exchange Pattern Software application

  9. Class-based Parsing Class generators – XML Schema driven Every major development platform provides tools to generate classes from XML Schemas E.g. JAXB, .NET Framework/Mono (XSD.EXE), XML Beans… Class Generators – Model driven Model Driven Software development environments allow classes to be generated from (UML-) models E.g. MARC Everest API Generator (XML ITS/RIM ITS)

  10. Class-Based ParsingUsing Coding Techniques

  11. Model based code generation • Full (abstract) model specification is stored in a model repository (RoseTree) • Abstract model is expressed as a MIF (Model Interchange Format) file • MIF can be transformed to less expressive XML Schema • Code generation • MIF (to alternate model representation, e.g. UML) to code (e.g. MDHT) • XML Schema to code (e.g. JAXB xjc)

  12. Note: Automatic Code Generation Schema-based code generation CDA R-MIM XML ITS Schema HL7v3 Model Repository MIF-based code generation CDA R-MIM MIF Template MIF Template XML Schema

  13. Code Generation MIF Based Code Generation

  14. MIF Based Code Generator • Full (abstract) model specification is stored in a model repository (RoseTree) • Abstract model is expressed as a MIF file – including GELLO/OCL expressions and (DCM derived) Template definitions • Code (class) generation • MIF - the code generator has to be aware of the structure of the MIF • UML/EMF (derived from the MIF) - the code generator has to know UML/EMF, including the v3 specific extensions

  15. MIF v. Derived model MIF Derived (e.g. UML, Schema) Derived (lossy) specification of v3 model Cross-industry tools for code generation • Normative (full) specification of a v3 model, inclusive of documentation • Full validation support • No cross-industry tools for class generation • MIF based class generators are being created: MRC-HI Everest, OHT

  16. Programming Components Target Model DSL Target Model MIF code Terminology server API + data Vocab MIF Serialization Reusable components XML encoding/decoding CMET MIF Datatypes Custom code Wrapper MIFs Code generation Model transform

  17. Target Model / code • Target Model = payload/focal model • Based on MIF or DSL • Use either MIF or DSL, mixing the two doesn’t tend to work too well • Preserve all information during code generation, inclusive of all documentation

  18. Vocabulary / Term. Server API • The management of vocabulary definitions and terminology services. • CTS API, Terminology Server (persisting vocabulary is the subject of an upcoming module)

  19. Reusable Components • Common model components: • E.g. CMETs, message wrappers • Generate code for [universal] CMETs • All other CMET flavors (e.g. [identified], [identified-confirmable]) can be processed by the generated code.

  20. Data Types – custom code • Custom library with support for v3 data types • Mostly: ISO data types, patched to support data types R1 as well • Relationship with Terminology Server (C* data types) • Needs custom coding: data types MIF is abstract. • Mohawk (.net) and OHT (Java) contain such libraries • Or use datatypes.xsd as the basis for development

  21. Serialization – XML En/DeCoding • Serialization engine • Serialize RIM structures according to HL7 rules • XML En/DeCoding • Encoding of a serialized graph • Rules as specified by the ITS (e.g. XML ITS, RIM ITS)

  22. Code Generation Schema Based Code Generation

  23. Schema based code generation • Advantage: wide availability of tools • Serious disadvantage: XMl schema language isn’t powerful enough to express all model requirements • Disadvantage when validating templates (in-memory, not on serialized format): Templates are expressed in MIF, there is no Schema version.

  24. Schema's serve multiple masters • Schema’s serve more than one purpose • design • validation • contract • code generation • those purposes often need different Schema’s • For code generation: + simplicity, readability - reuseability, composability Slide courtesy of: Marc de Graauw

  25. The HL7v3 Schema’s XML ITS XML ITS Example: QUPA_IN101102UV01 Get Person Demographics Query • MCCI_MT000300UV01 • COCT_MT040203UV01 • COCT_MT150003UV03 • COCT_MT030203UV02 • MFMI_MT700711 • COCT_MT090300UV01 • COCT_MT150000UV02 • COCT_MT070000UV01 • COCT_MT710000UV01 • COCT_MT150003UV03 • COCT_MT070000UV01 • COCT_MT710000UV01 • COCT_MT090100 • COCT_MT150000UV02 • COCT_MT070000UV01 • COCT_MT710000UV01 • COCT_MT150003UV03 • COCT_MT070000UV01 • COCT_MT710000UV01 • COCT_MT090003 • COCT_MT150003UV03 • MCAI_MT900001 • QUPA_MT101102_V01 • QUPA_MT101101_V01 ..and: voc, datatypes, infrastructureRoot Slide courtesy of: Marc de Graauw

  26. Remove ‘includes’ from v3 Schema’s XML ITS • Schema’s should be readable • tools can solve this • but they make you dependent on the tool • Therefore: flatten the Schema’s • remove all includes • put included schema’s where they belong • For readability: make the Schema resemble the instance • Readable Schema’s generate readable code! Slide courtesy of: Marc de Graauw

  27. Datatype schema transformation XML ITS • Constrain data type definitions in XSD (data type flavors used by realm or an implementation) • Transform HL7 datatypes to XSD datatypes • e.g. TS: datetime, CS,ST: string • With a lot of HL7 datatypes, nothing happens except translation to XSD datatypes. • Some mappings (e.g. TS to datetime) have issues associated with them. • Mostly gets rid of nullFlavour support • Do this in the source, generates much more readable code Slide courtesy of: Marc de Graauw

  28. Creative Commons Attribute-Share Alike Data Type schema Transformation XML ITS <xs:complexType name="QUPA_IN101102MdG.MCCI_MT000300UV01.Message"> <xs:sequence> <xs:element name="id" type="II"/> <xs:element name="creationTime" type="xs:date"/> <xs:element name="securityText" type="xs:string" minOccurs="0"/> <xs:element name="versionCode" type="xs:string" minOccurs="0"/> <xs:element name="interactionId" type="II"/> <xs:element name="profileId" type="II" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="processingCode" type="xs:string"/> <xs:element name="processingModeCode" type="xs:string"/> <xs:element name="acceptAckCode" type="xs:string"/> <xs:element name="attachmentText" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="receiver" type="MCCI_MT000300UV01.Receiver" maxOccurs="unbounded"/> <xs:element name="sender" type="MCCI_MT000300UV01.Sender"/> </xs:sequence> </xs:complexType> <xs:complexType name="II"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="root" type="oid" use="optional"> </xs:attribute> <xs:attribute name="extension" type="xs:string" use="optional"> </xs:attribute> <xs:attribute name="assigningAuthorityName" type="xs:string" use="optional"> </xs:attribute> <xs:attribute name="displayable" type="xs:boolean" use="optional"> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> TS ST CS CS CS CS ED

  29. VB Code XML ITS Partial Public Class QUPA_IN101102MdGMCCI_MT000300UV01Message Private idField As II Private creationTimeField As Date Private securityTextField As String Private versionCodeField As String Private interactionIdField As II Private profileIdField() As II Private processingCodeField As String Private processingModeCodeField As String Private acceptAckCodeField As String Private attachmentTextField() As String Private receiverField() As MCCI_MT000300UV01Receiver Private senderField As MCCI_MT000300UV01Sender ''' Public Property id() As II Get Return Me.idField End Get Set Me.idField = value End Set End Property ''' <System.Xml.Serialization. XmlElementAttribute(DataType:="date")> _ Public Property creationTime() As Date Get Return Me.creationTimeField End Get Set Me.creationTimeField = value End Set End Property • VB code generated for the example query interaction decreased in size from 540 kb to 164 kb – with the exact same functionality • [Marc de Graauw, BC CA project].

  30. XML ITS HL7 Medical Application HL7v3 Medical Content HL7 Control Query Processing Application HL7v3 Acts HL7 Transmission Wrapper Adapter HL7v3 Messages HL7 web services Messaging Adapter SOAP Messages HTTP Client / Server Slide courtesy of: Marc de Graauw

  31. The HL7v3 Schema’s XML ITS • layer the Schema’s • anonimyze with xs:any • <xs:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/> • SOAP Headers, soap:Body anon • HL7 Transmission Wrapper, Act anon • HL7 Act Wrapper, medical payload anon Slide courtesy of: Marc de Graauw

  32. XML ITS SOAP Transmission Wrapper Control Wrapper Payload Data Slide courtesy of: Marc de Graauw

  33. XML ITS SOAP ANY Transmission Wrapper ANY Control Wrapper ANY Payload Data Slide courtesy of: Marc de Graauw

  34. The XML ITS HL7v3 Schema’s XML ITS • Not very readable • without Schema editor not practically feasible • Generated from database • Fix them with XSLT or other: • Flatten the Schema’s • Remove unneeded datatype hierarchies • Layer the Schema’s • Replace all CMET flavors by a generic CMET flavor • Makes the Schema’s much more readable • Generates simpler code Slide (modified) courtesy of: Marc de Graauw

  35. Code re-use: Post code generation XML ITS .. .. .. Interaction Schema #1 .. Interaction Schema #2 . . Virtual frontend Interaction Schema #n

  36. RIM ITS Schema RIM ITS • Essentially 1 core schema with 50 classes • Generated classes will process any RIM ITS instance • Content validation to be done within application, not at the XML level • Additional MIF based code generation probably required • Processing of RIM-based object trees almost always requires knowledge of the structure of templates (SIM, LIM)

  37. In-memory object processing Implementation Experiences Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.de/download/implementation_mechanics.ppt

  38. Use-case: E-Novation • Serialized messages mapped to in-memory message objects (JAXB, code generation) • Application (business-) objects mapped to relational database (Hibernate ORM) • Custom code: mapping of message objects to application objects

  39. Use-case: E-Novation JAXB • There is no direct link between • Payload • ControlAct • Message • From Object(s) to DOM in 3 separate steps • From DOM to Object in 3 steps (in reverse order)

  40. Use-case: E-Novation JAXB

  41. E-Novation example: message object

  42. Use-case: JavaSIG • RIM based objects at core of application • Direct (MIF-based) mapping to/from serialized messages • Direct mapping to relational database See http://aurora.regenstrief.org/javasig for source code

  43. Use-case: JavaSIG MIF based • The direct transition from RO to CS (CS uses the XML ITS) is the most complex part of the API and at every step it is guided by the parsed MIF file. • <Person>..</Person> may have been sent, with defaults omitted. Only by looking at the MIF does one know this equates to <Person classCode=“PSN”>..</Person> and how to map it to a RIM class.

  44. Example Usage • National Cancer Registry HL7 v3 SDK • DRV Bund (Germany – amongst other things a hospital group) • Use RIMBAA Java API and JBoss to create & parse CDA documents. • PHI Technology toolset (Austrian HIS vendor) • Use RIMBAA Java API and JBoss

  45. Use-case: Philips Research • Object model of MIF was generated from the MIF schemas, including read and write methods. • MIF files are read as instances of the MIF model and mapped to object models. • Applications are built using C# classes generated from the object models.

  46. Philips Research: MIF usage Object models generated from MIF:

  47. Use-case: phi-Solution Design Process Choose or Create RMIM Bind RMIM to Process Design FORMs Solution MODEL is READY Bind FORMs to Process Bind FORMs to RMIM Generate & Deploy Onto PHI RE RUN Build a “SOLUTION” to collect patient data (family name, given name, ...).

  48. phi Designer Architecture ECLIPSE PHI JET TEMPLATE PHI DESIGNER PHI Eclipse Plug-ins MIF File (RIM) RIM GMF JET Template OHF JET EMITTER GEF EMF PHI Solution Model XML From OPEN MODEL to RE

  49. phi RE Architecture

  50. MARC Everest Framework • Mohawk College (a Canadian university) has created a .net API-generator based on MIF. • Available on their website: http://everest.marc-hi.ca/

More Related