Upload
others
View
18
Download
0
Embed Size (px)
Citation preview
RELAX IT’S ONLY RESTFUL
How to build a RESTful Web service with Iguana
IGUANA USER CONFERENCE 2013
OVERVIEW
• Introduction to basic terms • Understand components and flow • RESTful web services • See it in action • How is it used in healthcare (FHIR) • Closing Arguments
IGUANA USER CONFERENCE 2013
WEB SERVER
IGUANA USER CONFERENCE 2013
WEB SERVICE
IGUANA USER CONFERENCE 2013
WHY WEB SERVICES
• INTEROPERABILITY • Easy to implement • Uses open/standardized protocols • Low cost
IGUANA USER CONFERENCE 2013
COMPONENTS
• Server • Client • Resource • Request • Response
IGUANA USER CONFERENCE 2013
FLOW OF A REQUEST
IGUANA USER CONFERENCE 2013
LANGUAGES USED
• Most common languages used – XML
• example
– JSON • example
IGUANA USER CONFERENCE 2013
HTTP PROTOCOL
• Hypertext Transfer Protocol • Ascii text • Methods specify desired result
– GET – POST – PUT – DELETE
• URL used to make requests
IGUANA USER CONFERENCE 2013
HTTP STRUCTURE
IGUANA USER CONFERENCE 2013
• Protocols • Host • Port • Path • Parameters • Fragment
HTTP REQUEST
• Uses GET or POST to request an action or resource • Structure has [method][URL][version] • [headers] • [body]
IGUANA USER CONFERENCE 2013
GET http://server.com/patient/240 HTTP/1.1 Host: hl7.org Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) Accept: text/html Accept-Language: fr-FR Date: Fri, 9 Aug 2013 21:12:00 EST
HTTP RESPONSE
• MIME returned • Response Format
– [version][status][reason] – [headers] – [body]
IGUANA USER CONFERENCE 2013
HTTP/1.1 200 OK Cache-Control: private Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 Date: Fri, 9 Aug 2013 21:12:00 EST Content-Length: 17151
EXAMPLE
• GET patient name from Database – Taken from demo channels
• http://wiki.interfaceware.com/1368.html
• POST to add patient – Form written in HTML (Dreamweaver)
IGUANA USER CONFERENCE 2013
RESTFUL INTERFACE
• Representational State Transfer • Leaves an open design and applies
constraints • Stateless Client-Server • Uses HTTP • Uses API for structure
IGUANA USER CONFERENCE 2013
WHAT ELSE CAN YOU DO!
• Web services connect everything you love on the internet – Social media – Quick pricing for flights and hotels
• Iguana has its own API for monitoring – Use GET to request status – Use POST to change a status
IGUANA USER CONFERENCE 2013
HEALTHCARE RELATED
• Healthcare has some bad communication practices
• Web services help make sharing easier – Quicker implementation – Less network traffic – Higher ROI
IGUANA USER CONFERENCE 2013
FHIR
• Fast Healthcare Interoperability Resources(FHIR)
• First major attempt to move to web services
• Not perfect but a start • Uses GET and PUT
– GET gives you patient information – PUT allows you to add new information in
• Based off of HL7’s RIM IGUANA USER CONFERENCE 2013
AUTHENTICATION
• Tokens • Keys • OAuth2 • SSL
IGUANA USER CONFERENCE 2013
ADDITIONAL RESOURCES
• RESTful WEB SERVICES • Roy Fieldings Paper on designing of network based architectures REST • http://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf • Good Restful API design Manual • http://info.apigee.com/Portals/62317/docs/web%20api.pdf
• WEB SERVICES BASICS • http://www.w3schools.com/webservices/ws_platform.asp
• MONITOR IGUANA WITH WEB API • 1. This one has the simple code in the translator for checking the status of the channel • http://wiki.interfaceware.com/190.html • 2. This gives you the details on the web URL options and stopping and starting channels • http://www.interfaceware.com/manual/starting_and_stopping_channels_using_a_web_url.html
• SIMPLE EXAMPLE • Calling a newsfeed with web services
http://wiki.interfaceware.com/148.html
IGUANA USER CONFERENCE 2013
QUESTIONS AND ANSWERS
• Yee haw
IGUANA USER CONFERENCE 2013