Hl7v3 and web services

1,083 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,083
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Hl7v3 and web services

  1. 1. www.marcdegraauw.com<br />Implementeren van HL7v3 Web Services<br />- Marc de Graauw -<br />
  2. 2. www.marcdegraauw.com<br />SOAP & WSDL<br />
  3. 3. www.marcdegraauw.com<br />SOAP & WSDL<br />Intro<br />WSDL & code generation<br />Dynamic response, “wrapped” style<br />Generic WSDL<br />Reliability issues<br />Wire signature<br />
  4. 4. Web Services<br />WSDL<br />historie<br />opsplitsen WSDL<br />IHE, OMG/HL7<br />
  5. 5. Historie XML<br />SGML<br />Standard Generalized Markup Language<br />IBM: back to the sixties...<br />Markup: structuur, niet processing<br />HTML: SGML spinoff<br />1998: XML<br />SGML voor het Web, zonder ballast<br />2000: SOAP 1.1, WSDL 1.0<br />2001: XML Schema<br />
  6. 6. SOAP<br />SOAP envelope<br />SOAP<br />Envelope, Header, Body<br />transport: HTTP POST<br /><ws:SecToken><br />Certificate<br /><ds:Signature><br />Sig value<br />Authenticatietoken<br />body<br />HL7v3 bericht<br />Prescription 1 <br />
  7. 7. www.marcdegraauw.com<br />Zorg<br />Informatie<br />Systeem<br />Zorg<br />Informatie<br />Makelaar<br />Zorg<br />Informatie<br />Systeem<br />Berichten<br />diensten<br />Zorg<br />Informatie<br />Systeem<br />Zorg<br />Informatie<br />Systeem<br />Patiënten<br />Verwijs<br />Index<br />Zorg<br />Informatie<br />Systeem<br />
  8. 8. www.marcdegraauw.com<br />HL7v3 Layered Model<br />HTTP, SSL<br />SOAP / XML<br />HL7 Transmission Wrapper<br />HL7 Query Control Wrapper<br />HL7 Medical Data<br />TCP<br />lower protocol layers<br />
  9. 9. www.marcdegraauw.com<br />AORTA Message Patronen<br />Queries (van GBZ aan ZIM)<br />asynchroon<br />synchroon<br />Andere berichten<br />met respons<br />zonder respons<br />
  10. 10. www.marcdegraauw.com<br />Query met synchroon antwoord<br />
  11. 11. www.marcdegraauw.com<br />Bericht zonder respons<br />
  12. 12. www.marcdegraauw.com<br />Bericht met asynchrone respons<br />
  13. 13. www.marcdegraauw.com<br />SOAP in one slide<br />Envelope, Headers, Body<br /><soap:Envelope ... namespaces ... ><br /> <soap:Header mustUnderstand = ‘1’><br /> ... headers ...<br /> </soap:Header><br /> <soap:Body><br /> ... payload ...<br /> </soap:Body><br /></soap:Envelope><br />HTTP Binding<br />POST / HTTP/1.1<br />bla bla...<br />SOAPAction: "urn:hl7-org:v3/QURX_AR990120NL“<br /><?xml version="1.0" encoding="utf-8"?><br /><soap:Envelope ... namespaces ... ><br />SOAP Encoding: legacy, forget it<br />
  14. 14. www.marcdegraauw.com<br />‘Real world’ complexity<br />HL7v3 XML Schema <include> stacks of 10 – 15 schemas<br />HL7v3 typing system (mapped onto XSD datatypes)<br />HL7v3 vocabulary<br />Layered ‘wrapper’ approach<br />SOAP (Transmission (Query (Medical Data)))<br />
  15. 15. www.marcdegraauw.com<br />WSDL in one slide<br />WSDL defines a web service<br />Which schemas are used?<br />Which messages are used & which schemas are involved?<br />Which operations are used & which messages go in and which go out?<br />How do operations assemble to make a web service (PortType, Service)?<br />Binding to SOAP and HTTP<br />
  16. 16. www.marcdegraauw.com<br />Medication Query Service<br />Medication Query PortType<br />Query<br />Schema<br />Binding<br />QueryResponse Operation<br />Query Message<br />Response Message<br />Response<br />Schema<br />Other Operation<br />Other PortType<br />Other PortType<br />
  17. 17. www.marcdegraauw.com<br />‘Real world’ complexity (cont.)<br />WSDL is a:<br />description of a web service<br />generate WSDL from code?<br />generate code from WSDL?<br />WSDL code generation<br />map XML to programming object<br /><birthdate>19610306</birthdate> <br />maps to: date<br /><name><first>Marc</first><last>de Graauw</last></name><br />maps to: struct of string, string<br /><gender>M</gender> <br />maps to: char(1) or: enum(‘M’, ‘F’) or: GenderType<br />map operations, HTTP Binding et cetera<br />
  18. 18. www.marcdegraauw.com<br />‘Real world’ complexity (cont.)<br />WSDL code generation:<br />reserved word clashes<br />creates object for each XML construct<br />15 schemas -> Gargantuan objects!<br />all of vocabulary.xsd<br />all objects in one module<br />“Out of the box” cCode generation: fine for <br />float FahrenheitToCelsius(float)<br />currency StockQuote(string)<br />
  19. 19. www.marcdegraauw.com<br />Dynamic response types<br />WSDL: operation with defined message types with defined Schemas<br />HL7v3 has attributes where content co-determines response Schema<br />
  20. 20. www.marcdegraauw.com<br />HLv3 responseModalityCode = “R”<br />Some <br />HL7v3 <br />Query<br />Schema<br />Some HL7v3 PortType<br />Binding<br />Some HL7v3 Query<br />Some HL7v3 Query<br />HL7v3 Query Response<br />HL7v3 <br />Query<br />Response<br />Schema<br />Dynamic response<br />
  21. 21. www.marcdegraauw.com<br />HLv3 responseModalityCode = “B”<br />Some <br />HL7v3 <br />Query<br />Schema<br />Some HL7v3 PortType<br />Binding<br />Some HL7v3 Query<br />Some HL7v3 Query<br />HL7v3 Response Batch<br />HL7v3 <br />Batch<br />Response<br />Schema<br />Dynamic response (cont.)<br />
  22. 22. www.marcdegraauw.com<br />Dynamic response (cont.)<br />More HL7v3 attributes (=XML elements)<br />acceptAckCode<br />responsePriority<br />continuationQuantity<br />content co-determines response Schema<br />Solutions:<br />multiple PortTypes = clutter, bad design<br /><choice> in Schema = undescriptive, hard to read<br />
  23. 23. www.marcdegraauw.com<br />Specific WSDL:<br />HL7v3<br />Medication <br />Query<br />Schema<br />HL7v3 Medication PortType<br />Binding<br />HL7v3 Medication <br />QueryResponse<br />Operation<br />HL7v3 Medication Query<br />HL7v3 Medication Response<br />HL7v3 <br />Medication <br />Response<br />Schema<br />Generic vs. specific WSDL<br />
  24. 24. www.marcdegraauw.com<br />Generic WSDL:<br />HL7v3<br />Message<br />Schema<br />HL7v3 Message PortType<br />Binding<br />HL7v3 Message<br />Operation<br />HL7v3 MessageOut<br />HL7v3 MessageIn<br />HL7v3<br />Message<br />Schema<br />Generic vs. specific WSDL<br />
  25. 25. www.marcdegraauw.com<br />Generic vs. specific WSDL<br />Generic WSDL uses generic Schemas<br />Possibly with Transmission Wrapper<br /><xs:schema targetNamespace="urn:hl7-org:v3"> <br /> <xs:element name="hl7Message"> <br /> <xs:complexType> <br /> <xs:sequence> <br /><xs:any/><br /> </xs:sequence> <br /> </xs:complexType> <br /> </xs:element> <br /></xs:schema><br />
  26. 26. www.marcdegraauw.com<br />HL7 Medical Application<br />HL7v3 <br />medical<br />content<br />HL7 Control Query Processing Application<br />HL7v3 <br />CQ Wrapper<br />& payload<br />HL7 Transmission Wrapper Adapter<br />HL7v3 <br />messages<br />HL7 web services Messaging Adapter<br />SOAP<br />messages<br />HTTP Client / Server<br />
  27. 27. www.marcdegraauw.com<br />Generic WSDL<br />Pro:<br />eases separation of layers<br />no problems with dynamic response<br />code generation is useful again<br />Con:<br />does not describe actual web service neatly<br />
  28. 28. www.marcdegraauw.com<br />Wire signatures<br />We chose to follow WS-I Basic Profile<br />sensible set of guidelines<br />not an additional standard<br />refinement of SOAP 1.1 / WSDL 1.0<br />R2710: operations MUST result in wire signatures that are different<br />R2710: wire signature = name of the child element of the soap:Body<br />
  29. 29. www.marcdegraauw.com<br />HL7v3 Medication PortType<br />Wire signatures<br />Continuation: continuationQuantity > 0<br />Cancel: continuationQuantity = 0<br />Binding<br />HL7v3 Medication <br />QueryContinuation<br />Operation<br />HL7v3 QueryContinuation<br />HL7v3 Med. Response<br />Binding<br />HL7v3 Medication <br />QueryCancel<br />Operation<br />HL7v3 QueryCancel<br />HL7v3 Accept Ack<br />
  30. 30. Waar raakt WSDL wire format<br />document / literal<br />element onder Body<br />Schema / XML payload in Body<br />SOAPAction header<br />Service location URI<br />
  31. 31. Basic Profile<br />2004: aanvullingen en correcties op SOAP/WSDL<br />veel tooling ondersteunt dit<br />belangrijk<br />
  32. 32. HL7 Web Services Profile<br />HL7 Web Services Profile DSTU 1<br />SOAP, WSDL, WS-I Basic Profile 1.0<br />naamgeving WSDL-componenten<br />gladstrijken oneffenheden HL7 – SOA<br />HL7 Web Services Profile DSTU 2<br />WS-Addressing, WS-Security, WS-ReliableMessaging<br />tamelijk dunne toevoegingen, veel nader in te vullen<br />Daarna: stilstand, DSTU 2 is verlopen<br />
  33. 33. Web Services en HL7<br />Abstract Transport Specification<br />ebXML Messaging<br />HL7/OMG<br />IHE<br />
  34. 34. Transport vs. SOA<br />HL7<br />RIM based model<br />serialisatie in XML<br />Transport<br />agnostic<br />MIME<br />ebXML<br />alles kan erin<br />Send XML / Receive XML<br />Send something / Receive something<br />Web server<br />XML in<br />Verstrekkingsbericht<br />Medicatiequery<br />XML uit<br />Accept ack<br />Medicatielijst<br />
  35. 35. Transport vs. SOA<br />SOA<br />Services<br />FindPatientsByTrait<br />DispenseMedication<br />Expliciete service<br />Namen van operations vastgelegd<br />Content model (schema) expliciet gemaakt<br />Blootstellen van services<br />Implementatie service is niet zichtbaar<br />Web server<br />Verstrekkingsbericht<br />Verstrekkings-<br />service<br />Accept ack<br />Medicatie-<br />service<br />Medicatiequery<br />Medicatielijst<br />
  36. 36. HL7<br />Transmission wrapper<br />Control Act Wrapper<br />
  37. 37. OMG/HL7<br />Retrieve, Locate, and Update (RLUS) Service<br />Entity Identification Service (EIS)<br />HL7 Wrappers dropped<br />
  38. 38. IHE<br />XCPD (Cross-Community Patient Discovery)<br />Patient Identifier Cross-Reference HL7 V3 (PIXV3) and Patient Demographic Query HL7 V3 (PDQV3)<br />Cross-Community Access (XCA)<br />ebXML Registry / Repository<br />MTOM <br />
  39. 39. ‘Design time’ versionering<br />Design time versionering gaat over versies van dingen die gebruikt worden bij het implementeren<br />Versies van:<br />documentatie (Aorta v6.0.0.0)<br />architectuur<br />implementatiehandleidingen<br />XML Schema<br />WSDL<br />Schematron<br />(gegenereerde) programmacode<br />database schema<br />Op basis van wat bouw je?<br />
  40. 40. ‘Run time’ versionering<br />Run time versionering gaat over versies van dingen die je tegenkomt in productie<br />Versies van:<br />XML instances en HL7 artefacten daarin (datgene wat een client stuurt)<br />Web Services endpoints (datgene waarnaar het verzonden wordt<br />De versie van een ingestuurde XML instance kun je potentieel herkennen door middel van:<br />HTTP Header: SOAPAction<br />SOAP Headers in de SOAP Envelope<br />Top element in SOAP Body == HL7 interactionId (b.v. QURX_IN990011NL)<br />HL7 namespace (urn:hl7-org:v3)<br />andere namespaces (b.v.: http://www.aortarelease.nl/805/)<br />profileId (<profileId root="2.16...11.1" extension="810"/>)<br />De versie van een Web Service is te herkennen aan de URI<br />Wat gebeurt er “on the wire”?<br />

×