© 2006 E.Novation LifeLine Networks B.V. 1 21-7-2017 Agenda • • • • • • Introductie Aanleiding Aanpak XML object mapping (XOM) Object-Relational mapping (ORM) Conclusie © 2007 E.Novation LifeLine Networks bv 2 21-7-2017 Introductie • Wolter Eldering Solutions Architect E.Novation LifeLine Networks www.enovation.nl • 10 jaar ervaring software development, waarvan het laatste jaar voornamelijk HL7v3 gerelateerde projecten • XIS-typegoedkeuring voor Adastra © 2007 E.Novation LifeLine Networks bv 3 21-7-2017 Aanleiding • Deelname aan VWS/NICTIZ “proof of concept” project • XIS-type goedkeuring voor Adastra waarneempakket – Communicatie HL7v3 • • • • MFMT_IN00210x QUPC_IN99000xNL & REPC_IN990003NL QUMT_IN020010 QUQI_IN000003 – Hoge beschikbaarheid – Korte responsetijden – Zeer korte doorlooptijd “proof of concept” © 2007 E.Novation LifeLine Networks bv 4 21-7-2017 Aanpak • Niet HL7v3 XML uitcoderen • Op basis van schema’s java code genereren • Grote reductie in bericht codeer fouten • Maximale support van java ontwikkelomgeving • Herbruikbaar in andere projecten © 2007 E.Novation LifeLine Networks bv HL7v3 Adastra LSP ZIM LSPconnect Adastra Data 5 Techniek Product/Tool Integratie Cloverleaf Webservices spring-ws XOM JAXB ORM Hibernate3 21-7-2017 XOM & ORM POJO HL7v3 deserialize Table persist POJO reconstitute © 2007 E.Novation LifeLine Networks bv Table HL7v3 serialize 6 21-7-2017 JAXB & Hibernate JAXB POJO HL7v3 deserialize Maatwerk POJO Table persist Hibernate © 2007 E.Novation LifeLine Networks bv 7 21-7-2017 JAXB • Met de JAXB xjc tool van alle .xsd (schema) files .java maken • Omdat .xsd ook XML is patchen met .xslt (stylesheet) • Resulteert in 581 .java files .xslt .xsd .xsd xslt © 2007 E.Novation LifeLine Networks bv .java xjc 8 21-7-2017 JAXB © 2007 E.Novation LifeLine Networks bv 9 21-7-2017 JAXB en HL7v3 schemas MCCI_MT000100 MCCI_MT000100 .xsd QUPC_IN990001NL .xsd QUQI_MT021001 .xsd QUMT_IN020010 .xsd .xsd QUPC_MT990001 .xsd QUMT_MT020020 .xsd © 2007 E.Novation LifeLine Networks bv QUQI_MT021001 .xsd 10 21-7-2017 JAXB Message Wrapper Type Wrapper Any ControlAct Type ControlAct Any Payload Type © 2007 E.Novation LifeLine Networks bv 11 Payload 21-7-2017 JAXB • Er is geen koppeling tussen – Payload – ControlAct – Message • In drie stappen van Object(en) naar DOM • Van DOM naar Object(en) in omgekeerde volgorde Marshaller.marshal(payload) <<POJO>> <<DOM>> Payload Payload Marshaller.marshal(controlAct) <<POJO>> ControlAct Any <<DOM>> ControlAct Marshaller.marshal(message) <<POJO>> Message Any © 2007 E.Novation LifeLine Networks bv 12 <<DOM>> Message 21-7-2017 © 2007 E.Novation LifeLine Networks bv 13 21-7-2017 JAXB & Hibernate JAXB POJO HL7v3 deserialize POJO Table persist Hibernate © 2007 E.Novation LifeLine Networks bv 14 21-7-2017 Hibernate • Krachtige mapping definities in XML Collection mapping Association mapping Component mapping Inheritance mapping • Brede database support Oracle, SQL-Server • Objecten kunnen “lazy” geladen worden • Hibernate houdt bij welke objecten zijn gewijzigd © 2007 E.Novation LifeLine Networks bv 15 21-7-2017 Hibernate Class Diagram Identified Objects InstanceIdentifier -root:String -extension:String Nam e IdentifiedObject 1..* -id:Long officialName legalName << interface >> EnteredData Prim aryCareProvision encounters Patient Encounter * * performers AssignedPerson author Activity MedicationAdm inistrationRequest * * * {ordered} dataEnterer author * address activities birthPlace * Address JournalEntry © 2007 E.Novation LifeLine Networks bv 16 Prescription ObservationDx MedicationSupportingInform ation 21-7-2017 Hibernate InstanceIdentifier Column Name Data Type Nullable ROOT VARCHAR2(250) No EXTENSION VARCHAR2(250) No OBJECTID NUMBER No Column Name Data Type Nullable ID NUMBER No INTERNALTYPEID NUMBER No ENCOUNTERID NUMBER No AUTHORID NUMBER Yes DATAENTERERID NUMBER Yes Column Name Data Type Nullable ID NUMBER No SEQUENCENUMBER NUMBER Yes ENTRYTIME TIMESTAMP(6) Yes SOEP CHAR(1) Yes TEXT VARCHAR2(4000) No Class Diagram Identified Objects 2 InstanceIdentifier IdentifiedObject -id:Long 1..* Activity JournalEntry © 2007 E.Novation LifeLine Networks bv -root:String -extension:String Activity JournalEntry 17 21-7-2017 Hibernate EffectiveTime Column Name Data Type ID NUMBER XSITYPE VARCHAR2(8) OPERATOR CHAR(1) PARENTID NUMBER WIDTHUNIT VARCHAR2(8) WIDTHVALUE NUMBER LOWVALUE VARCHAR2(26) LOWINCLUSIVE NUMBER(1,0) HIGHVALUE VARCHAR2(26) HIGHINCLUSIVE NUMBER(1,0) CENTERVALUE VARCHAR2(26) EVENTCODE VARCHAR2(32) PhysicalQuantity EVENTCODESYSTEM VARCHAR2(250) -value:Double -unit:String EVENTDISPLAYNAME VARCHAR2(250) INSTITUTIONSPECIFIED NUMBER(1) PERIODVALUE NUMBER PERIODUNIT VARCHAR2(8) ORDERBY NUMBER Class diagram EffectiveTime EffectiveTime { ordered} 1..* -id:Long -operator:String PeriodicInterval EventRelatedInterval Interval ParentheticSetExpression offset event CodedElem ent -code:String -codeSystem:String -displayName :String © 2007 E.Novation LifeLine Networks bv w idth 18 21-7-2017 © 2007 E.Novation LifeLine Networks bv 19 21-7-2017 Hibernate © 2007 E.Novation LifeLine Networks bv 20 21-7-2017 Conclusie • Goede tooling is essentieel • Hard XML coderen is te “low level” om HL7v3 te verwerken • Trend om meer declaratief programmeren • Meer fouten komen al compile-time en niet pas run-time tevoorschijn • Op basis van schemas (.xsd) java code genereren is een goed hulpmiddel, nog enige workarounds nodig © 2007 E.Novation LifeLine Networks bv 21 21-7-2017 Links • Java Architecture for XML Binding (JAXB) https://jaxb.dev.java.net/ • Hibernate http://www.hibernate.org/ Java Persistence with Hibernate ISBN: 1-932394-88-5 • Spring-WS http://static.springframework.org/spring-ws/site/ © 2007 E.Novation LifeLine Networks bv 22 21-7-2017 Vragen © 2007 E.Novation LifeLine Networks bv 23 21-7-2017