24
Using ATL/EMFTVM for import/export of medical data 8-Oct-2014, Dennis Wagelaar

Using ATL/EMFTVM for import/export of medical data - #sda2014

Embed Size (px)

DESCRIPTION

Most data­centric software must deal with some form of import/export of their internal data model to an external data format. In many cases, this external data format is some sort of standard format, or otherwise dictated by external sources, and does not map one­-on-­one to the internal data model. This was also the case for CareConnect, HealthConnect/Corilus‘ latest Electronic Medical Record software. CareConnect must be able to import/export its data from/to SUMEHR, PMF, and GPSMF documents. On top of this comes that CareConnect’s internal data model consists of some 300 classes, which means there are a lot of mappings to define. To deal with the size and complexity of this scenario, we decided to use a specialised language: the ATL transformation language in combination with the EMF Transformation Virtual Machine: EMFTVM is a new runtime for ATL, which adds a number of performance­enhancing features that make it more suitable for use within a Java application. The declarative, rule­based nature of ATL allowed us to write more concise code as well as distribute the workload of writing the ATL transformation code over multiple developers. This significantly increased our ability to deal with complexity.

Citation preview

Page 1: Using ATL/EMFTVM for import/export of medical data - #sda2014

Using ATL/EMFTVM for import/export of medical data

8-Oct-2014, Dennis Wagelaar

Page 2: Using ATL/EMFTVM for import/export of medical data - #sda2014

2

Page 3: Using ATL/EMFTVM for import/export of medical data - #sda2014
Page 4: Using ATL/EMFTVM for import/export of medical data - #sda2014

Import/exporta common programming scenario

SuMEHR

GPSMF

PMF

Corilus XML

SuMEHR

GPSMF

PMF

Corilus XML

4

Page 5: Using ATL/EMFTVM for import/export of medical data - #sda2014

Corilus XML as pivot model

SuMEHR

GPSMF

PMF

Corilus XML

5

Page 6: Using ATL/EMFTVM for import/export of medical data - #sda2014

Corilus XML as pivot model

SuMEHR

GPSMF

PMF

Corilus XML

6

Page 7: Using ATL/EMFTVM for import/export of medical data - #sda2014

Import/exportsimplified

Corilus XML

Corilus XML

7

Page 8: Using ATL/EMFTVM for import/export of medical data - #sda2014

Why ATL?(ATL Transformation Language)

Domain-specific language for

transformationMore expressive than mapping frameworks

embedded in Java, e.g. Dozer

Less verbose for transformations than general-

purpose languages

Uses OCL standard for expressions

Uses EMF for data representation

Closely related to plain Java objects

Enriched with additional concepts, e.g. containment and associated properties

8

Page 9: Using ATL/EMFTVM for import/export of medical data - #sda2014

Why EMFTVM?(EMF Transformation Virtual Machine)

Enhanced for “online” use (performance)

Reuse pre-loaded transformations for multiple executions

JIT compiler translates to Java bytecode

Adaptive matching algorithm adds

performance

Improved modularity

Supports multiple rule inheritance across different modules

Supports module import across different source

languages

9

Page 10: Using ATL/EMFTVM for import/export of medical data - #sda2014

Why EMFTVM?(EMF Transformation Virtual Machine)

10https://wiki.eclipse.org/ATL/EMFTVM

Page 11: Using ATL/EMFTVM for import/export of medical data - #sda2014

EMF vs. POJOs

Uses Uses

EMF Models Plain Old Java Objects

(JPA)

11

Page 12: Using ATL/EMFTVM for import/export of medical data - #sda2014

EMF vs. POJOsThis is what we have...

(JPA)

Uses

Plain Old Java Objects

12

Page 13: Using ATL/EMFTVM for import/export of medical data - #sda2014

From POJOs to EMFMoDisco and EMiFy

Java Model Reverse Engineer Plain Old Java Objects

13

Page 14: Using ATL/EMFTVM for import/export of medical data - #sda2014

From POJOs to EMFMoDisco and EMiFy

Java Model

Ecore Model

EMiFy.atl

14

Page 15: Using ATL/EMFTVM for import/export of medical data - #sda2014

From POJOs to EMFMoDisco and EMiFy

Ecore Model

Generate Model

EMF Java Objects

15

Page 16: Using ATL/EMFTVM for import/export of medical data - #sda2014

From POJOs to EMFMoDisco and EMiFy

Java Model

Ecore Model

EMiFy.atl

Reverse Engineer

Generate Model

EMF Java Objects

16

Page 17: Using ATL/EMFTVM for import/export of medical data - #sda2014

Using ATL

17

Page 18: Using ATL/EMFTVM for import/export of medical data - #sda2014

Using ATL

18

Page 19: Using ATL/EMFTVM for import/export of medical data - #sda2014

Using ATLImplicit tracing

19

Page 20: Using ATL/EMFTVM for import/export of medical data - #sda2014

Using ATLImplicit tracing

20

Page 21: Using ATL/EMFTVM for import/export of medical data - #sda2014

Using ATLCollaboration

21

.NET developer Java developer

Java developerJava developer

Common: 178 lines of ATL codeImport: 7283 lines of ATL codeExport: 4617 lines of ATL code

4906 lines of Java import/export code

Page 22: Using ATL/EMFTVM for import/export of medical data - #sda2014

Runtime performance

22

03-10-2014 | 13:57:19,223 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.rs.ImportResource | Import partial document 50403-10-2014 | 13:57:19,307 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Start full import for ...03-10-2014 | 13:57:20,006 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Starting transformation...03-10-2014 | 13:57:21,099 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.emftvm.impl.AbstractEMFTVMTransformer | Timing data: Loading finished at 0,000036 seconds (duration: 0,000036 seconds) Matching finished at 0,285989 seconds (duration: 0,285953 seconds) Applying finished at 1,091511 seconds (duration: 0,805522 seconds) Post-applying finished at 1,091712 seconds (duration: 0,000201 seconds) Recursive stage finished at 1,091751 seconds (duration: 0,000039 seconds) Execution finished at 1,091915 seconds (duration: 0,000203 seconds)

03-10-2014 | 13:57:21,118 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 1 Patient instances03-10-2014 | 13:57:21,155 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 3 ExternalUser instances03-10-2014 | 13:57:21,156 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 1 HealthInsurance instances03-10-2014 | 13:57:21,161 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 138 Contact instances03-10-2014 | 13:57:21,282 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 33 Episode instances03-10-2014 | 13:57:21,316 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 33 HealthApproach instances03-10-2014 | 13:57:21,349 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 553 SubContact instances03-10-2014 | 13:57:21,925 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 2 ContactPerson instances03-10-2014 | 13:57:23,240 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 1 Vaccination instances03-10-2014 | 13:57:23,255 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 134 NormalMedicationEntry instances03-10-2014 | 13:57:23,649 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 4 MagistralMedicationEntry instances03-10-2014 | 13:57:23,673 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 138 FreeTextPosology instances03-10-2014 | 13:57:24,041 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 224 SOEPRule instances03-10-2014 | 13:57:24,473 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 78 Letter instances03-10-2014 | 13:57:25,416 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 30 LabResult instances03-10-2014 | 13:57:25,495 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 776 LabResultEntry instances03-10-2014 | 13:57:28,533 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 51 ParameterGroup instances03-10-2014 | 13:57:28,657 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 72 ParameterGroupEntry instances03-10-2014 | 13:57:28,992 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 3 SickLeave instances03-10-2014 | 13:57:29,023 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.services.impl.CorilusXMLImportServiceImpl | Processing 2 Note instances03-10-2014 | 13:57:33,992 | INFO | http-0.0.0.0-8080-4 | be.healthconnect.emr.server.rs.ImportResource | Finished import partial document 504 in 14.768414891

XML

load

ing

0,7 sec Tr

ansf

orm

ation

1,1 sec

Hib

erna

te st

orag

e

12,9 sec

Medium-large patient file (2277 record entries)

Page 23: Using ATL/EMFTVM for import/export of medical data - #sda2014

ConclusionWe tackled a complex and common programming scenario such as import/export

by breaking it up in three ways:

23

Use specialised language for translating between

domain model and pivot model

Use regular Java to handle file I/O and

database interaction

Use pivot model for import/

export => only support a single import/export

format

XML

Page 24: Using ATL/EMFTVM for import/export of medical data - #sda2014

24

Questions?

http://www.healthconnect.be/http://www.corilus.be/http://www.careconnect.be/

Questions

?