2. ICW Developer ConferenceMay 5, 20092
Martin Krasser
Position
• Software architect and engineer
Focus
• Distributed systems
• Application integration
• Application security
• ...
Open source projects
• Open eHealth Integration Platform (Founder)
http://gforge.openehealth.org/gf/project/ipf
• Security Annotation Framework (Founder)
http://www.sourceforge.net/projects/safr
• Apache Camel (Contributor)
http://camel.apache.org
3. ICW Developer ConferenceMay 5, 20094
Agenda
Part 1
• IPF Introduction
• Programming IPF
• Demo
Part 2
• OSGi Support
• IPF Services
• Demos
Part 3
• Outlook
4. ICW Developer ConferenceMay 5, 20095
IPF Introduction (1/5)
Framework for implementing integration logic
• Healthcare domain
• General-purpose
Platform to deploy and run integration solutions
• OSGi-based with IPF services in service registry
• Embedded, standalone and distributed deployments
Based on Apache Camel
• Routing and mediation engine
• Enterprise Integration Patterns (EIPs)
• Domain-specific language (DSL)
5. ICW Developer ConferenceMay 5, 20096
IPF Introduction (2/5)
Project
• Hosted at the Open eHealth Foundation
• Open source under Apache License, Version 2
• Latest release – IPF 1.6.0 (April 2009)
• http://gforge.openehealth.org/gf/project/ipf/
- Subversion repository
- Release filesystem
- Issue tracker
- Mailing lists
• http://repo.openehealth.org
- Reference documentation
- Contribution guidelines
- Build server and build reports
- Maven and OSGi bundle repository
7. ICW Developer ConferenceMay 5, 20098
IPF Introduction (4/5)
Development
• Focus on programming (internal DSL)
• DSL is easy to extend
• Platform is easy to extend
• No graphical route designer
• ...
IPF applications @ ICW
• Medical Service Bus (MSB)
• IHE profiles (PIX, PDQ, XDS)
• Device connectivity server (DCS)
• LifeSensor adapter (LSA)
• IPF inside eHF
• ...
8. ICW Developer ConferenceMay 5, 20099
IPF Introduction (5/5)
Apache Camel
IPF Core
HL7 support
CDA support
IHE support Code mapping
Large message support
Event infrastructure
OSGisupport
Developmenttools
Flow management
Managementconsoles
System overview
Core processors
Performance
testsupportPart of presentation and demos
9. ICW Developer ConferenceMay 5, 200910
Programming with Camel
Overview
• Components Connectivity to external systems or resources
• Endpoints Send/receive messages to/from external systems
• Processors Transform, validate, filter, route, etc. messages
• Routes Endpoints connected by processors using DSL
Route example
HTTP
Endpoint
(inbound)
HTTP
Endpoint
(outbound)
XPath
Filter
from("jetty:http://0.0.0.0:8090/subscribers") // inbound HTTP endpoint
.filter().xpath("/person[@name='Martin']") // XPath filter
.to("http://localhost:8080/log"); // outbound HTTP endpoint
Camel DSL (Java)
10. ICW Developer ConferenceMay 5, 200911
Programming with IPF
Overview
• All Camel features available
• Dynamic language support (Groovy)
• DSL extension mechanism (Groovy meta-programming)
• Predefined DSL extensions (Contribution from modules)
Route example
?
HTTP
Endpoint
(inbound)
HTTP
Endpoint
(outbound)
HL7
Filter
HL7
Validator
from('jetty:http://0.0.0.0:8090/admissions') // inbound HTTP endpoint
.unmarshal().ghl7() // HL7 parser
.validate().ghl7() // HL7 validator
.filter {it.in.body.PID[8].value == 'F'} // HL7 filter
.to('http://localhost:8080/log') // outbound HTTP endpoint
IPF DSL (Groovy)
19. ICW Developer ConferenceMay 5, 200922
Enable flow management for example route
OSGi Service Registry
Demo
?
HTTP
Endpoint
(inbound)
HTTP
Endpoint
(outbound)
HL7
Filter
HL7
Validator
HL7
Transformer
Proxy
Processor
route
bundle
service
bundle
platform-camel-flow
bundle
Flow Manager
B E
Replay Strategy
Flow
Manager
D
20. ICW Developer ConferenceMay 5, 200923
Message Buffering for Delivery Failure Recovery
Compensate unavailability of destinations
• Automated redelivery of messages
• Number of redelivery attemps given by redelivery policy
Implemented with transacted JMS queue
• Transaction rolled back if destination unavailable
• Transaction rollback causes message redelivery
Manual replay of messages using flow manager
• When automated redelivery gives up
21. ICW Developer ConferenceMay 5, 200924
Add a message buffer to example route
OSGi Service Registry
Demo
?
HTTP
Endpoint
(inbound)
HTTP
Endpoint
(outbound)
HL7
Filter
HL7
Validator
HL7
Transformer
Proxy
Processor
route
bundle
service
bundle
platform-camel-flow
bundle
Flow Manager
B E
Replay Strategy
Flow
Manager
JMS Queue
camel-
activemq
JMS Component
Proxy
D
osgi-config-jms
bundle
22. ICW Developer ConferenceMay 5, 200925
Mapping Service
Mapping between codes from different code systems
• Often needed for HL7 message processing
• Gender codes, encounter type codes ...
Default mapping service
• Accessed via mapping DSL
• Configurable with mapping tables
23. ICW Developer ConferenceMay 5, 200926
Demo
mappings = {
gender (
F : 'W',
(ELSE) : { it }
)
}
// Extension to java.lang.String
assert 'F'.mapGender() == 'W'
// Extension to HL7 DSL
assert msg.PID[8].mapGender() == 'W'
Mapping definition Mapping service usage
Gender code mapping
24. ICW Developer ConferenceMay 5, 200927
Implement code mapping for example route
OSGi Service Registry
Demo
?
HTTP
Endpoint
(inbound)
HTTP
Endpoint
(outbound)
HL7
Filter
HL7
Validator
HL7
Transformer
Proxy
Processor
route
bundle
service
bundle
platform-camel-flow
bundle
Flow Manager
B E
Replay Strategy
Flow
Manager
JMS Queue
camel-
activemq
JMS Component
D
osgi-config-jms
bundle
Mapping
Service
Mapping
Definition
modules-hl7
bundle
Bidi
Mapping
Service
mapping
fragment
use via DSL
26. ICW Developer ConferenceMay 5, 200929
Agenda
Part 1
• IPF Introduction
• Programming IPF
• Demos
Part 2
• OSGi Support
• IPF Services
• Demos
Part 3
• Outlook
• Q&A
27. ICW Developer ConferenceMay 5, 200930
Outlook (1/4)
DSL for HL7v3 messages and CDA/CCD documents
// Create a CDA builder
CDABuilder builder = new CDABuilder()
// Create a new CDA document
def document = builder.build {
clinicalDocument {
id(root:'2.16.840.1.113883.19.4', extension:'c266')
code(
code:'11488-4',
codeSystem:'2.16.840.1.113883.6.1',
...
)
title('Good Health Clinic Consultation Note')
recordTarget {
...
}
...
}
...
}
// Write document XML to stdout
System.out << document
28. ICW Developer ConferenceMay 5, 200931
Outlook (2/4)
DSL for implementing IHE actor interfaces and transactions
from('ihe:xds.b:iti-41?port=8080')
.process { exchange ->
def document = exchange.in.body
// do further document processing here ...
}
// communicate with your document management system
.to('http://...')
// notify about availability of new document
.to('ihe:nav:iti-25:?to=martin@openehealth.org')
29. ICW Developer ConferenceMay 5, 200932
Outlook (3/4)
IPF as a Service
• Central operation of IPF runtime and applications
• High-availability and scalability are part of service
• IPF application deployment via IPF Eclipse plugins
• Research in progress on scalable data stores
• Experiments with IPF on Google AppEngine