V3 Software Implementation Full source: www.ringholm.com/download/ implementation_mechanics.ppt Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. René Spronk M.Sc. FHL7 Trainer / Senior Consultant Ringholm bv Haarlem, the Netherlands Tel. Fax: +31 (0)318 589 789 +31 (0)318 548 090 eMail: Web: Rene.Spronk@Ringholm.com http://www.Ringholm.com HL7/IHE roles: •Co-chair of the international HL7 RIMBAA Working Group •Co-chair of various Committees, HL7 Germany, HL7 Netherlands •Contributor to the IHE Laboratory Technical Framework •HL7 Fellow, 2011 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 2 Key Objectives Understand some architectural approaches and techniques for v3 Implementation Discuss some technologies and tools available to implement v3 specifications Show some of the ‘best practices’ collected by the HL7 RIMBAA Workgroup HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Overall Agenda Introduction XML Serialization In memory object processing Persistence Mapping v2 to v3 (optional) Implementation Tools User Interfaces (optional) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 4 01/01/2011 An Introduction HL7 v3 Implementation – an introduction Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Agenda – Introduction section HL7 v3 modeling/HDF – bottom up MIF and the origins of schema Conformance/validation principles RIMBAA Technology Matrix HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 6 An introduction HL7 v3 modeling / HDF -bottom upSlide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XML example XML ITS DT R1 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 8 HL7 v3: Model Refinement ITS (serialization format of instances) R-MIM / SIM Serializable Model Refinement of D-MIM / DIM Domain Model Clinical Pharmacy Documents Refinement of RIM Stable model, Domain agnostic HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. RIM 9 RIM – Abstract Data Model HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 10 Notes Core of all information models: Data Type specification Behavioral (dynamic) model: Interactions, initial/response exchanges between 2 applications Service layer, contractual issues, -work in progress in HL7 v3- HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 11 An introduction MIF – Model Interchange Format Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. MIF The Model Interchange Format (MIF) a set of XML formats used to support the storage and exchange of HL7 version 3 artefacts the pre-publication format of HL7 v3 artefacts used by tooling. the formal definition of the HL7 metamodel. MIF can be transformed into derived forms such as UML/XMI, OWL, or XML schema. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 13 MIF documents: Requirements-analysis related structures. Static model related structures. Dynamic model related structures. Infrastructure related structures: including data types, and vocabulary Structures related to testing Conformance-related HL7 structures Publication related structures HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 14 Derived forms HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 15 MIF: How Is It Defined? (1) MIF 2.1 - June 13, 2008 A set of XML schemas (+ Schematron): mif-COMPLETE mif-model-package mif-model-static-derived mif-model-interface mif-model-static-flat mif-model-conformance mif-model-static-serialized mif-model-staticBase mif-model-vocabulary mif-core-changes mif-model-requirements mif-model-datatype mif-model-testing mif-model-dynamic mif-model-publication mif-model-documentation mif-model-annotationLibrary mif-core-staticBase mif-model-crossReference mif-core-base Stable xhtml1-strict mif-core-patterns Beta Draft Core Static Dynamic xhtml-lat1.ent xml mif-core-enumerations Vocabulary Data type xhtml-special.ent xhtml-symbol.ent Interface Mark-up Other HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 16 MIF: How Is It Defined? (2) The XML schemas define the MIF language constructs as types, with the meaning of the types explained informally in annotations: HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 17 Why MIF instead of UML? MIF is a single unified metamodel that spans all HL7 artifacts. The metamodel is maintained and under the sole control of HL7. The metamodel represents all HL7 artifacts in a consistent fashion. There will always be a "newer" and "better" technology out there, but there is currently no alternative metamodel representation that covers all of HL7's metamodel. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 18 An introduction ITSs and the origins of HL7 Schema Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. ITS – Implementable Technology Specification An ITS specifies how instances of HL7 SIMs should be ‘transmitted’ Serialization, deserialization, encoding syntax The most commonly used ITS is the “XML ITS” Alternatives: RIM serialization ITS (“RIM ITS”), Green CDA HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 20 MIF transform to XML based ITS schemas Repository MIF MIF MIF XSLT R-MIM Pubs HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XSLT XML Schemas MIF Example: E_NonPersonLivingSubject Other attributes HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 22 MIF Header HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 23 MIF classes/associations (snippet) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 24 MIF v. XML-based ITS XML provides a syntax only An XML based ITS defines the set of valid XML instances for a given message type no schema can do this Download informative schemas with the v3 Ballot Package Normative Edition schemas as a reference HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Generated XML-Schema for BirthPlace (snippet, XML ITS 1.1) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XML ITS 26 An introduction Conformance and Validation Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. A “Valid” v3 instance.. Complies with the requirements as defined by the HL7 v3 information model Conformance indicator, cardinality, vocabulary Complies with additional (“contractual”) requirements Template definitions, business rules HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 28 Attribute/Association Conformance Levels Conformance indicator: Optional: MAY be present, MAY be processed, allows for nullFlavors Required*: SHOULD be present, SHALL be supported by sender/receiver, SHALL be sent if known, allows nullFlavors Mandatory yes/no: Mandatory*: SHALL be present, SHALL be processed/supported by sender/receiver, no nullFlavors HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 29 Vocabulary: Value Sets Attribute is linked to Concept Domain The concept domain is (UV Realm) represented by a value set. The value set is based on a coding system. Person name: EN [0..*] administrativeGenderCode: CE CWE <= AdministrativeGender … AdministrativeGender (Concept Domain) The gender of a person used for administrative purposes (as opposed to clinical gender) IAGC Release 2 (Coding System) (Value Set – Universal Realm) OID 2.16.840.1.113883.19.11.1 OID 2.16.840.1.113883.19.1 M, F, UN M, F, UN, X, B HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 30 R-MIM (SIM).. and a Template (LIM) Notes: • Template model must be a valid constraint on the R-MIM -- An instance would not be able to conform to both if the above doesn’t hold true • Reminder: Clone names of classes carry no semantics (they are irrelevant) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 31 Constraint Language To express additional constraints OCL, ADL, Gello No solution has been formally adopted Typical (OCL) example: The Person object should have either an id or a name context Person inv: id.hasContent or name.hasContent HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 32 Example: „Valid“ CDA Document 1. Validates against the published XML Schema 2. Validates against the abstract CDA model specification 3. XML Schema based validation tool Use a MIF (specification of the abstract model) based validation tool, includes conformance and vocabulary validation Validates against requirements / templates as specified in implementation guides Mostly: a XML Schematron based validation tool; could be MIF/OCL based HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 33 An introduction RIMBAA Technology Matrix Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. RIM - Abstract Data Model HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 35 The RIM is “abstract” The same “instance” of information can be shared via different information interoperability paradigms E.g. lab results can be shared via (electronic) documents (v3 Clinical Document Architecture) via V3 lab messages via Web Services with v3 payloads ..or they can be imported In a RIM Based Application (RIMBAA) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Use of V3 artefacts Persistence Layer Other RIM Application Object Layer Interoperability Paradigms User Interfaces Messages RIM-based Documents Other Other RIM-based RIMBAA Services HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. RIMBAA Technology Matrix RIM Application Constrained specific Information Model Model RIM (generic) Model Persistent Object Serialized Representation Representation Representation RP RO RS CP CO CS AP AO AS HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Overall Agenda Introduction XML Serialization In memory object processing Persistence Mapping v2 to v3 (optional) Implementation Tools User Interfaces (optional) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 39 01/01/2011 XML Serialization About the HL7 v3 XML Schema Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Two XML-based ITSs XML ITS 1.1 Has been in use since the beginnings of HL7 v3 Based on serialization of an R-MIM (SIM) XML elements names based on clone/business names for classes as used in the R-MIM Separate schema for each and every R-MIM (SIM) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. RIM ITS New (2010) Based on serialization of the RIM XML element names based on the RIM core class names. One single schema for all RIM-based models; 50 classes. XML ITS example <component typeCode="COMP"> <commonObservationEvent classCode="OBS" moodCode="EVN” <templateId root='2.16.840.1.113883.10.20.1.24'/> <code code="8302-2" codeSystem="2.16.840.1.113883.6.1" displayName="Lichaamslengte“> <statusCode code="completed"/> <effectiveTime value="200907011346" /> <value xsi:type="PQ" value="90" unit="cm" /> <subject typeCode="SBJ" contextControlCode="OP"> <patient classCode="PAT"> <patientPerson classCode="PSN“ determinerCode="INSTANCE"> <name>ROELOFSEN, TOM</name> HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. RIM ITS example <rim-graph xmlns="urn:hl7-org:v3-rim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="0226" xmlns:sbad=“urn:oid:2.16.840.1.113883.10.20.1.24” > <outboundRelationship xsi:type="ActRelationship" assocName="subject" cloneName="Subject2" contextControlCode="AN" typeCode="SUBJ" contextConductionInd="false"> <target xsi:type="SubstanceAdministration" classCode="SBADM" moodCode="RQO“ templates=“sbad:root” > <id root=""/> <code code="DRUG" codeSystem=""/> <participation xsi:type="Participation" contextControlCode="OP" typeCode="DIR"> <role xsi:type="Role" assocName="medication" cloneName="Medication" classCode="ADMM"> <player xsi:type="ManufacturedMaterial“ assocName="administerableMedicine" classCode="MMAT" determinerCode="KIND"> <code code="" codeSystem="?"/> HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. ITSs - RIMBAA Technology Matrix RIM Application Constrained specific Information Model Model RIM (generic) Model Persistent Object Serialized Representation Representation Representation RP RO RS CP CO CS AP AO AS HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Note: RIM ITS Note: XML ITS Using HL7 v3 Schemas HL7 produces informative XML Schema Definitions (XSD) for all v3 messages There are no normative XML schema (current workitem) normative schema are being discussed Things to understand An XML document that satisfies Schema validation is not necessarily a valid HL7 v3 Message/Document HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XML ITS Schema - Abstract Models In v3, Element Names are derived from the permitted structural codes XML ITS No meaning is lost if you strip all element names from HL7v3 XML <Foo classCode=“PSN”>..</Foo> is the semantic equivalent of <Person classCode=“PSN”>..</Person> However, most XML tools are useless if you strip all element names from a document. First generation implementations will use XML element names, later systems will be driven off the structural vocabulary (classCode, moodCode, typeCode.. ) Model Driven Architectures / Code Generation HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XML Schema what are schemas bad at No ambiguous content models allowed No conditional constraints HL7 uses short ISO dates (without validation) Code list validation cannot have an element that may either have a nullFlavour, or a set of attributes Date+Time types are a mess Problem for model-XML mapping (requires use of clone class names in XML instances) Only for small (enumerated) code lists Friendly messages when validation fails HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XML Serialization Serialization/Deserialization (using XML techniques) Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Parsing and Validation Using XML Techniques Serialized Message to Application Object Streaming API SAX, XmlReader for efficient parsing of XML instances Stripping out of those parts one needs only, skipping all other content DOM, XPath Total control on XML processing In memory object which represents all of the XML contents HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Parsing and Validation Using XML Techniques Pros • Many commercial and open source tools support XML technologies HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Cons • Performance impact with heavy processing/large message sizes • Every tool seems to have a different interpretation of the XML specifications Normalization Implementation Specific HL7 Rules Information Model HL7 HL7 v3 Message Extended Validation Clinical Repository Message Parsing Application Rules HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Schema Validation HL7 v3 Schema Transformation Using XML Techniques Serialized Message to/from other serialized model: XSLT 1.1, XSLT 2.0, EXSLT Every platform has multiple implementations of XSLT for XML transformations • Saxon, .NET Framework, JAXP… Cascade XSLT transformations to simplify and flatten the instances XQuery XML Query Language for procedural XML processing Several XQuery implementations are avaliable, refer to W3C XQuery home page (over 50 listed) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Serialization Using a template set message ={ <patientPerson> <id root="2.16.578.1.34.1000.1" extension=“$PAT_ID"/> <name use="L"> <given> $PAT_FIRSTNAME</given> <given> $PAT_MIDDLE</given> <family> $PAT_FAMILY</family> </name> <administrativeGenderCode code=“$PAT_GENDER" codeSystem="2.16.840.1.113883.5.1"/> <birthTime value=“$PAT_BIRTHDATE"/> </patientPerson> } Simply fill in the blanks to create message Use XPATH for inbound models Ignorant of V3 data model and XML HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Serialization Using a template Use only when variability is low, when a few messages/documents need to be supported Beware of exceptions: nullFlavor instead of code Variable has no value: <name></name> is valid XML, but it isn’t valid in a V3 XML instance (1) <Act code=“” codeSystem=“1.2.3”/> isn’t valid in a V3 XML instance HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XML Serialization XML Based conformance/validation Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Parsing and Validation Using XML Techniques XML Schema Validation HL7 provides informative schemas for first-pass message validation Not sufficient for full validation Schematron, RELAX NG Better than XSD as validating messages, but still not widely used no HL7-provided schematron (although could be generated from MIF) May be provided by the author of an implementation guide Validating Stylesheet Produces “human readable” errors HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Schematron is a … Rules-based validation language A way to test XML documents A way to specify and test assertions about patterns in XML documents A cool report generator HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Reasons to Use Schematron Business/operating rules that other constraint languages can’t enforce Different requirements for different stages of the document lifecycle Local or temporary constraints (not in base schema) Unusual (but not illegal) variation No schema Ad hoc querying and discovery HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. A Short Example Schematron ...in a CDA instance <typeId extension="POCD_HD000040" root="2.16.840.1.113883.1.3"/> Schematron <rule context="hl7:typeId"> <assert role="error“ test="@extension='POCD_HD000040'"> ClinicalDocument.typeId (2.16.840.1.113883.2.4.6.10.35.3) @extension SHALL have value POCD_HD000040 static </assert> <assert role="error" test="@root='2.16.840.1.113883.1.3'"> ClinicalDocument.typeId (2.16.840.1.113883.2.4.6.10.35.3) @root SHALL have value 2.16.840.1.113883.1.3 static </assert> </rule> HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Schematron – Example (v3 Messages) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 60 Overall Agenda Introduction XML Serialization In memory object processing Persistence Mapping v2 to v3 (optional) Implementation Tools User Interfaces (optional) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 61 01/01/2011 In-memory object processing Class Generators Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Model Driven Software Development (MDD) Model Generate Image credits: Johan den Haan, Mendix.nl HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. MDD - Application Generation Generic Software Components -Terminology -Data types Software application RIM Persistence Database HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 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) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Class-Based Parsing Using Coding Techniques Pros Cons • Don’t have to learn XML, XSD, XSLT, XQuery… • Use OO frameworks • Faster processing • Harder to build loosely coupled systems • Somewhat harder to maintain • Bottom-up approach might create some level of duplication in generated classes HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 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) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Code Generation MIF Based Code Generation 68 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 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 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. MIF v. Derived model MIF 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 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Derived (e.g. UML, Schema) Derived (lossy) specification of v3 model Cross-industry tools for code generation 70 Target Model MIF Terminology server API + data Vocab MIF Reusable components CMET MIF Datatypes Custom code Wrapper MIFs HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. code Serialization Target Model DSL XML encoding/decoding Programming Components Code generation Model transform 71 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 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 72 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) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 73 Code Generation Schema Based Code Generation 74 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 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 (inmemory, not on serialized format): Templates are expressed in MIF, there is no Schema version. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 75 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 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XML ITS The HL7v3 Schema’s XML ITS Example: QUPA_IN101102UV01 Get Person Demographics Query MCCI_MT000300UV01 COCT_MT040203UV01 COCT_MT150003UV03 COCT_MT030203UV02 MFMI_MT700711 COCT_MT090300UV01 COCT_MT150000UV02 • COCT_MT150003UV03 COCT_MT070000UV01 • COCT_MT150000UV02 • COCT_MT710000UV01 COCT_MT090003 COCT_MT070000UV01 COCT_MT710000UV01 COCT_MT150003UV03 COCT_MT070000UV01 • COCT_MT710000UV01 COCT_MT090100 COCT_MT070000UV01 COCT_MT710000UV01 COCT_MT150003UV03 ..and: voc, datatypes, infrastructureRoot MCAI_MT900001 QUPA_MT101102_V01 QUPA_MT101101_V01 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Slide courtesy of: Marc de Graauw Remove ‘includes’ from v3 Schema’s Schema’s should be readable tools can solve this but they make you dependent on the tool Therefore: flatten the Schema’s XML ITS 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 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XML ITS SOAP ANY Transmission Wrapper ANY Control Wrapper ANY Payload Data Slide courtesy of: Marc de Graauw HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. XML ITS The XML ITS HL7v3 Schema’s Not very readable Generated from database Fix them with XSLT or other: without Schema editor not practically feasible 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 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. RIM ITS RIM ITS Schema 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) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 81 Example use-case: E-Novation RP Database 1. 2. 3. RO CO CS Message 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 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Example use-case: JAXB Marshaller.marshal(payload) 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) <<POJO>> <<DOM>> Payload Payload Marshaller.marshal(controlAct) <<POJO>> ControlAct Any ControlAct Marshaller.marshal(message) <<POJO>> Message Any HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. <<DOM>> <<DOM>> Message Example use-case: JAXB HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. E-Novation example: message object HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Overall Agenda Introduction XML Serialization In memory object processing Persistence Mapping v2 to v3 (optional) Implementation Tools User Interfaces (optional) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 86 01/01/2011 Persistence Overview Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Database models (Relational) RIM RIM or RIM-based model: Conceptual Data Model LDM Logical Data Model •Not DBMS specific, no tables, no keys ORM – Object Relational Mapping PDM Physical Data Model •DBMS specific, tables, keys HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 88 Conceptual Data model - RIM Enormous flexibility, at the cost of a very abstract structure. Low number of tables makes enforcement of data integrity rules very difficult making it necessary to rely on stored procedures and application logic to enforce rules. less programming work, easier to learn, easier to add new functionality. More data in each table, need to tune queries. Main use-case: If you're creating a data store for ad-hoc queries, mining and exploration of all sorts of data from all sorts of different sources HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 89 Persistence Persisting Data Types Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Data Types At a lower level, the data types are complex to support. Complex data types Abstract data types Helper classes, or UDTs Specialize; or use helper classes Collection data types Helper classes HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 91 Normalization – Helper Classes HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 92 Data Type expansion – Helper Classes HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 93 Watch for “Table Explosion”.. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 94 CV with R1/R2 relations HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 95 Example: RIM persistence OntoReason / MD Anderson HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 96 Overall Agenda Introduction XML Serialization In memory object processing Persistence Mapping v2 to v3 (optional) Implementation Tools User Interfaces (optional) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 97 01/01/2011 HL7 version 3 Mapping v2 to v3 (optional) Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Representation of „Reality“ in a standard Dynamic: a subset of all „business cycle trigger events“ Static: a subset of the objects and attributes which play a role HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 99 Migration scenario Extensively document the HL7 v2 messages Identify the corresponding HL7 v3 interactions Create a mapping Syntax Semantic: Granularity, Vocabulary Dynamic model (trigger events) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 100 Key Step: Version 2 Message Profiles proprietary, ad-hoc documentatio n Version 2 Implementati on Site Interfa ce Info Vendor Interfa ce Info Messag e Profilin g (Analys is) Version 2 Message Profile („Version 3 Ready“) Registrati on OID v2.x Message Structure HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Version 3 Implementati on Applicatio n Role Use Case Model Vendor Scenario Dynamic Definition Interactio n Model Static Definition Message 101 „Granularity“ of v3 The dynamic model in v3 is different than in v2: Trigger Events occur at different points in the business process. v3 v2.x: Multiple v3 trigger events map to a v2 event The static v3 models are „more granular“ than v2.x v3 v2.x: details get lost v2.x v3: missing information – if filled by defaults: significant risk of faulty interpretation HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 102 Concepts Does v3 contain the same concepts as v2 ? The RIM supports all administrative, financial and clinical concepts as present in v2. Therefore v3 is from a functional perspective fully backwards compatible with v2. There is however not a guaranteed 1-to-1 mapping between fields or datatypes in v2 and classes/attributes in v3. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 103 Migration scenario - revisited Avoid using mapping as a migration scenario If you have to rely on a translation: Best practice recommendation 1. 2. 3. Extensively document the HL7 v2 messages Identify the corresponding HL7 v3 interactions Create a mapping (syntax, semantic) Kludge: (as a vendor) extend HL7 v2 messages with Z-segments [missing data & additional granularity] to allow for a translation to v3. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 104 Overall Agenda Introduction XML Serialization In memory object processing Persistence Mapping v2 to v3 (optional) Implementation Tools User Interfaces (optional) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 105 01/01/2011 HL7 version 3 Implementation Tools Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Implementation Tools (Nov.2011) Tools that directly suport the software development process: Tools that support software developers: MIF based class/code generators (e.g. MDHT. Everest, JavaSIG) MIF based database schema generator (e.g. MGRID)) MIF based UI generators ISO Datatypes library CTS products (e.g. Mayo Clinic's LexEVS , Apelon DTS) Mapping tools (e.g. Open Mapping Software) Testing tools (e.g. Instance Editor, MDHT) Code Documentation Generators Tools that are used by analysts/providers: Model (static/dynamic/UIs/..) Driven application development tools (e.g. PHI Technology) Model Driven Documentation generators (e.g. PHI Technology) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 107 OHT (Open Health Tools) To assemble and/or develop a comprehensive harmonized tool suite to enable the definition, development and deployment of interoperable Electronic Health Records. http://www.openhealthtools.org/ 108 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. HL7 version 3 Tools: MDHT www.cdatools.org Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. MDHT (part of OHT) Management/definition of templates Generating Java code from CDA (CDA only) model inclusive of templates Generation of documentation .net version – seeking cooperation 110 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. MDHT Inputs & Outputs Add Custom Validations & Constraints Java API (Source Code) Domain Model MDHT Validation Code Generation Implementation Guide(s) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Constraints – DSL for Templating HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 112 CDA Template Models MDHT are currently working on implementations of the following CDA-based document types: Continuity of Care Document (CCD) IHE Content Profiles HITSP C32 Patient Summary Public Health Case Report (PHCR) IHE Lab Report Document HITSP C74 Personal Health Monitoring Report Essential Hypertension HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. MDHT Architecture CDA Includes • CDA Support • CDA Templates • HITSP & IHE models HL7 Core Includes V3 datatype support, MIF-> UML support, HDF Terminology Services Includes support for terminology sets Custom Tools Includes • UML Table Editor • New Project Wizards • New CDA templates • Property Editors MDHT DITA Document generation EMF Eclipse Modeling Framewo rk Includes EMF Core, EMF.Edit, EMF.Codegen & Validation Framework HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Mode l to Mode l Transfor mation Includes Domain Model to implemen tation models. Includes generation of DITA xml files Document Publishing Includes generating documents using DITA-OT JAVA Classes Includes generating Java source code for models and the constraints Validation Suite Includes testing instances of CDA and nonCDA models. HL7 version 3 Tools: Everest http://everest.marc-hi.ca/ Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. MARC-Hi Everest Framework Mohawk College (a Canadian university) has created a .net API-generator based on MIF (supports all of v3). Java port planned for Q2 2012. D HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 116 From MIF to Code Optimize r MIF 2.1.x GPM R HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. RES T/JS ON .js C# .DLL HTML .HTM Jav a .JAR XSL /XS D .XSL / .XSD COR Repo. MARC-Hi Everest – From MIF to Instance Data Types Generated DLL Vocabulary RMIM Classes Formatters Application Code XML ITS 1.x Data Type R1 Create GPMR MIF v2 No ITS? <PRPA_IN101 2.. <id root=“” XML ITS1.0 with DT R1 D HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. UV Support NE2008 (since GPMR 0.9.x) NE2009 / NE2010 *_HD*.*mif files should be removed HTML renderer works on Patched MIF files in quirks mode Missing Several CMET definitions in DEFN IFC file Templating issue with several Interactions CDAr2 (NE2010) (since GPMR 1.1.x) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Milestones Q4 2011 – jEverest CTP (Community Tech. Preview) Formatters RMIM Structures GPMR Patches Q1 2012 – Release Candidate 3 Everest .NET: jEverest : CDA Support Datatypes R2 Support Connectors Q2 2012 – Release of Everest 1.0 jEverest + Everest + GPMR Bundles Documentation for jEverest HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. HL7 version 3 Tools: Instance Editor http://hl7book.net/index.php?title=Eclipse_Instance_Editor Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Instance Editor Instance Editor (mostly used for CDA) This tool provides context aware editing and interactive validation for CDA documents. The tool includes the best available validation for the data types. XML editor look-and-feel 122 HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Eclipse CDA Editor tool HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 123 Undetected error. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 124 Overall Agenda Introduction XML Serialization In memory object processing Persistence Mapping v2 to v3 (optional) Implementation Tools User Interfaces (optional) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 125 01/01/2011 HL7 version 3 User Interfaces Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. User Interfaces There are two (extreme) options: Run time: Dynamically (at run time) generate the UI based on a CIM/LIM-like definition need to do some pre-formatting, otherwise the generated layout may be quite nonsensical for the human user Development time: Define the UI first; bind elements in the UI to RO/CO/AO classes/attributes. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 127 User Interface - Development UI integration with templates (LIM): commonality is one of the key reasons for using RIM start with the generic controls, make them work, bolt them together, less generic as you go up the data stack. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 128 Each Observation pattern will have a UI ● ● ● ● ● ● BL will have a label and a Yes, No answer PQ will have a label and a number input field with a unit behind it CD with a valueset of <4 will have a label and list of items as radio buttons CD with a valueset of >=4 and <32 will have a list CD with a valueset of >1000 will have a Google Search etc. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. MS CUI Clinical Noting in Forms Guidance HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Model Driven User Interfaces Person name: EN [0..*] administrativeGenderCode: CE … (Value Set – Universal Realm) •HL7 version 3 has an elaborate terminology model. •Based on HL7 (and ISO) data types M, F, UN Person Demographics IAGC Release 2 (Coding System) OID 2.16.840.1.113883.19.1 M, F, UN, X, B CE data type: (code, codeSystem) OR (nullFlavor) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Sex: Male Female Undifferentiated Unknown Example: UMCG HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 132 Example: UMCG HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 133 Example: UMCG HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 134 HL7 version 3 Summary Slide contents published under the Creative Commons / Attribute-Share Alike license Source: www.ringholm.com/download/implementation_mechanics.ppt HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. Recommendations Never rely solely on XML schema MIF based code generation should be used for any non-trivial projects At the least, use Schematron Tools like MDHT and Everest Don’t rely on a generic v2->v3 mapping Use RIM based persistence For use-cases which require its flexibility and ‘future-proofness’ HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 136 01/01/2011 Recommended reading (1/3) http://www.ringholm.com/docs/03060_en_HL7_MIF.htm (Whitepaper/video about MIF) http://www.ringholm.com/docs/03100_en.htm (The RIMBAA technology matrix) (v3 standard publication) // Foundation / Core Principles / Special topics on Implementation and Representation (v3 standard publication) // Foundation / Model Interchange Format http://wiki.hl7.org/index.php?title=XML_ITS , http://wiki.hl7.org/index.php?title=RIM_ITS, http://wiki.hl7.org/index.php?title=ITS http://en.wikipedia.org/wiki/Schematron (Wikipedia on Schematron) http://www.schematron.com/overview.html (Schematron overview) http://wiki.hl7.org/index.php?title=Migration_from_HL7_v2_to_HL7_v3 http://openmapsw.com/ (Open Mapping software toolkit) http://wiki.hl7.org/index.php?title=Software_Implementation_of_CDA (best Practices document: implementation of CDA) http://wiki.hl7.org/index.php?title=MIF_based_code_generation (MIF based code generation) HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 137 01/01/2011 Recommended reading (2/3) http://wiki.hl7.org/index.php?title=Schema_based_code_generation (Schema based code generation) http://www.healthintersections.com.au/?p=769 (Blog: everything you didn’t want to know about GTS) http://www.healthintersections.com.au/?p=707 (Blogpost: intervals [IVL_T] and boundary imprecision) http://www.healthintersections.com.au/?p=705 (Blogpost: what content can ED contain?) http://www.healthintersections.com.au/?p=592 (Blogpost: how do you put tablets into PQ.units ?) http://www.healthintersections.com.au/?p=257 (Blogpost: NullFlavor) http://www.hl7.tv/Data_Types.html (Video/presentation: Datatypes R2 - what’s changed?) (v3 standard publication) // Foundation / Core Principles / Types / Data Type Flavors (v3 standard publication) // Foundation / Refinement Constraint and Localization / Localization / Data Types Specialization Constraints HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 138 01/01/2011 Recommended Reading (3/3) http://wiki.hl7.org/index.php?title=RIM_Based_Persistence (work in progress, contains links to other pages) http://en.wikipedia.org/wiki/Object-relational_mapping (ORM resource) http://sourceforge.net/search/?q=object+AND+relational+AND+mapping (ORM resource) http://sharptoolbox.com/Category74089b0a-1105-4389-b1db-eedf27e20cfb.aspx (ORM resource) http://wiki.hl7.org/index.php?title=ORM_best_practices http://tl7.intelliware.ca/validateMessage.faces (TL7 message validator) http://www.openhealthtools.org/ http://www.cdatools.org (MDHT) http://everest.marc-hi.ca/ (MARC-HI Everest toolkit) http://hl7book.net/index.php?title=Eclipse_Instance_Editor (Instance Editor) http://support.phitechnology.it/wiki (PHI application development tools) See http://wiki.hl7.org/index.php?title=User_Interface_for_RIMBAA_Applications for discussion and references. HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. 139 01/01/2011 Any Questions ? Or: post your question/suggestions via •HL7 Wiki: http://bit.ly/d7tSsL •E-mail v3impl@ringholm.com •Twitter: @Ringholm HL7 and Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.