new openEHR-based framework

Hi,

I have send this same email to the last 21090 discussion, and Ian ask me if I can send it again in another thread, here it is.
Just yto give some context, this was written in response to Koray who asks for real-world implementations, and who is studying the complexity/time of building openEHR-based systems.

I should clarify that the framework is the core of the system, but not the whole system. The whole trauma application has also DICOM integration, external MPI integration via IHE PDQ, the “generate CDA feature” (we leave this on the framework too, but is not a part of the core), and the calculation of quality of care indicators.

Ian ask me if I can publish the archetypes we use, archetypes, (our own) templates, the code, etc, are all here: http://code.google.com/p/open-ehr-gen-framework/source/browse/#svn/trunk/open-ehr-gen

Cheers,
Pablo.

Hi Pablo,

I was about to ask you to make a proper announcement on the list. Ian
beat me on this :wink:

Thanks for the excellent work and commitment to the open source
community!! I will send you some specific questions later on.

Cheers,
Rong

Hi, I think I must add some context to this email.

Architecture: http://www.slideshare.net/pablitox/open-ehrgen-un-framework-para-crear-historias-clnicas-electrnicas, page 18

  • GuiGen:

  • is a GUI generator based on archetypes, our own XML templates (with GUI directives), i18n config files, and RM structures.

  • the GUI is all HTML (the framework is for building web ehr apps)

  • the GUI is generated in real time (we also thought an offline generation of static GUI can be better to reach good performance, but the real time generation could help on testing things more quickly).

  • the GuiGen can handle structured data and multiple occurrences of archetype nodes.

  • here are some screenshots: https://docs.google.com/leaf?id=0B27lX-sxkymfYzI5YzBjMWEtZGI5My00NGNiLThmNmQtOGNhZmE0ZWEwNDll&hl=en

  • here you can find the templates: http://code.google.com/p/open-ehr-gen-framework/source/browse/#svn/trunk/open-ehr-gen/templates/hce/trauma

  • and the referenced archetypes: http://code.google.com/p/open-ehr-gen-framework/source/browse/#svn/trunk/open-ehr-gen/archetypes/ehr- Data Binder:

  • this component creates RM structures from plain data from user’s input, archetypes, templates and terminology.

  • in the process of creating the structures, it also validates data against archetypes constraints.

  • it creates structured data from plain data, and create multiple instances for archetype nodes with multiple occurrences.

  • it doesn’t handle the whole datatype package, but it supports the more common datatypes like text, coded text, quantities, count, ordinal, dates, boolean, and a few more.

  • all the binding and validation is done on the fly.- CKM integration:

  • we have our local CKM in file system

  • ArchetypeManager and TemplateManager load archetypes and templates on demand, and cache them on memory.- RM:

  • we implement our groovy based openEHR RM in order to get automatic persistence capabilities from Grails framework.- CDR:

  • our clinical data repository is just a MySQL dbms, with an autogeneratd schema from the groovy RM with Grails framework

Technology: http://www.slideshare.net/pablitox/open-ehrgen-un-framework-para-crear-historias-clnicas-electrnicas, page 21

  • Java technology
  • Grails framework to build our Opeh EHR-Gen Framework with MVC+Services, and a great ORM for persistence
  • it uses the Groovy PL (is a dynamic, java-based, PL)

We want to add some features, like plugin support in order to add functionality to the apps created with the framework, like PIX-PDQ integration, DICOM query-retrieve integration (we have developed some hardcoded integration with both), etc.

I hope this can serve to better understanding of our project.

Hi Pablo

Wow, I am soooo impressed! Your project artfully - in a way I couldn’t ever have done it, after all I am a MD and poor programmer - combines three of my (past) projects and interests:

  • With one other person I programmed a PHP framework that generates clinical forms based on a proprietary (no archetyypes) form definition language (http://www.ncbi.nlm.nih.gov/pubmed/17911755)
  • I have had a look at Grails a while ago and liked it for its clean implementation of the MVC pattern and the conciseness of groovy without loosing the possibility to whatever Java offers (any java code can be used). I created a simple application (gift registry for my own wedding), but would have never dreamed of being able to implement the whole RM with groovy.
  • I have been involved in archetyping for several years

Did I understand correctly that you have domain classes for most RM classes that get persisted via Grails ORM mechanism? Thus, it uses a generic stable schema (as long as the RM does not change) and binds the generated RM structure that is created in memory from templates/archetypes/user input to it. This design is opposed to persisting the variable generated RM structures directly via ORM.

I think this could become a big step for the openEHR community. This will make it possible to author a template/archetypes and create an small clinical application from it relatively quickly.
I think we should discuss how we can get the maximum leverage out of this great work and to make it accessible to as many interested as possible: e.g. translation, tutorials (setup etc), background info, online demonstrator,…

Thank you Pablo for sharing this!

Cheers, Thilo

Hey Pablo

Thanks for your reply. I have more questions (see inline), partly because I don’t speak Spanish.

We have some things in common. I have a small project called miniClin, in wich I defined CDA templates based in the CDA structure, and ideas borrowed from openEHR archetypes (like node codes, paths and node occurrences). I’ve developed a small proof of concept PHP/MySQL app that worked fine (with limitations), and I use the Yupp PHP Framework to build this app (Yupp is an MVC/ORM framework with some ideas borrowed from Grails framework, I developed). Now miniClin is just a paper (sorry, spanish only). In miniClin, the GUI is generated from these CDA templates, the data binder create CDA documents in memory from the template and the data, and a seralizer create the CDA XML file on disk from the memory structure (this project has a lot in common with the EHR-Gen Framework).

Some links:

Amazing that you can do all this work in parallel!

What made you create a MVC/ORM framework (YUPP) similar to Grails instead of just using Grails (as you did in your open-EHR-Gen framework). What are the benefits besides that you don’t need a servlet container to run it?

Do you have a link to such a CDA template (enhanced with some openEHR ideas) somewhere?

How do o-EHR-Gen and miniclin compare regarding their uses? When do you use one when the other? Is miniclin - as its name suggests - aimed at smaller, more at hoc clinical form based applications?

Yes, the DB schema is autogenerated from the domain model classes, so the schema is very generic and doesn’t change if you add new archetypes or templates to your app. This generic approach obviously has a side effect on performace, but is also a boost on development time.

How long do load and save operations take?

Our big goal is to build a tools chain, so anyone can define some archetypes, add them in a template, deploy the archetypes and templates into the Open EHR-Gen Framework, and you will have a complete application for clinical recording. Over this application, anyone can build their own plugins, so you can add integration with other systems, conversion to/from other information models, etc.

Sounds fantastic. An exactly what the openEHR community needs to be able to easily demonstrate archetypes in action.

How much adaption would it involve get the open-EHR-gen framework running on my computer with another template?

I didn’t say this before, but this project could never be done without the re-use of Rong’s work. The base of all are the AOM implementaion and the ADL-parser from the java-ref-impl. You can see what libs we reuse here: http://code.google.com/p/open-ehr-gen-framework/source/browse/#svn/trunk/open-ehr-gen/lib

I know about Rong’s monumental contributions towards openEHR.

I will keep in touch
-Thilo

Hi Thilo,

What made you create a MVC/ORM framework (YUPP) similar to Grails instead of just using Grails (as you did in your open-EHR-Gen framework). What are the benefits besides that you don’t need a servlet container to run it?

I started to work with PHP about 9 years ago. In 2004 I developed a small CMS (SWP-CMS) . In order to make a better CMS I thought a small framework could help. So I started the Yupp project. In 2007 I started to work with Grails, and I borrowed some ideas from there, some ideas from Seam (another Java MVC framework), and some PHP framewokrs like Cake, Zend, etc. The idea was to create something with the best of the state of the art in MVC frameworks.

Do you have a link to such a CDA template (enhanced with some openEHR ideas) somewhere?

Now I just have some proof of concept templates. I send you one attached. The idea is to complete the template definition and to build the XSD to validate the template structure.

How do o-EHR-Gen and miniclin compare regarding their uses? When do you use one when the other? Is miniclin - as its name suggests - aimed at smaller, more at hoc clinical form based applications?

The idea behind miniClin is to create a minimal EHR with CDA support. This system could run in any system with Apache and PHP (MySQL is optional because you can persist directly to CDA XML files. The objective of the EHR-Gen is a framework to build a complete EHR system based on openEHR archetypes.

Yes, the DB schema is autogenerated from the domain model classes, so the schema is very generic and doesn’t change if you add new archetypes or templates to your app. This generic approach obviously has a side effect on performace, but is also a boost on development time.

How long do load and save operations take?

To generate an empty form from archetypes it takes 2-3 seconds.
To generate an edit form (equal to the empty form but with data loaded from the DB) it takes 5-10 secs.
To bind data from input and save the RM structures on the DB it takes 7-15 secs.

Obviously, these times depend on the complexity of the archetypes.

Our big goal is to build a tools chain, so anyone can define some archetypes, add them in a template, deploy the archetypes and templates into the Open EHR-Gen Framework, and you will have a complete application for clinical recording. Over this application, anyone can build their own plugins, so you can add integration with other systems, conversion to/from other information models, etc.

Sounds fantastic. An exactly what the openEHR community needs to be able to easily demonstrate archetypes in action.

How much adaption would it involve get the open-EHR-gen framework running on my computer with another template?

You need to build your templates, and add them to the config file (http://code.google.com/p/open-ehr-gen-framework/source/browse/trunk/open-ehr-gen/grails-app/conf/Config.groovy). There you’ll see a mapping like this:

templates {
    hce {
        trauma {
            INGRESO = ['triage']
            ADMISION = ['prehospitalario', 'contexto_del_evento']
            ANAMNESIS = ['resumen_clinico']
            EVALUACION_PRIMARIA = [
                                   'via_aerea',
                                   'columna_vertebral',
                                   'ventilacion',
                                   'estado_circulatorio',
                                   'disfuncion_neurologica'
                                  ]
            PARACLINICA = ['pedido_imagenes', 'pedido_laboratorio']
            EVALUACION_SECUNDARIA = ['exposicion_corporal_total']
            DIAGNOSTICO = ['diagnosticos']
            COMUNES = ['movimiento_paciente']
        }
        emergencia {
            ACCIONES = ['adm_sust']
            DIAGNOSTICO = ['diagnosticos']
        }
        ambulatorio {
            
        }
        quirurgica {
            
        }
    }
}

This mapping has all the clinical processes in your EHR, here you can see the trauma process, with all it’s stages and all the records in each stage. Each record is a template (you can see the template names here; http://code.google.com/p/open-ehr-gen-framework/source/browse/#svn/trunk/open-ehr-gen/templates/hce/trauma)

So in trauma.EVALUACION_PRIMARIA stage (primary evaluation), you have the air way, breathing, circulation and disability records (the ABCD). Here (https://docs.google.com/leaf?id=0B27lX-sxkymfNGQ5MmU5ZjctMGU3ZC00ODdjLWE0ZWMtNDQ4MmQxMGYzYzRl&sort=name&layout=list&pid=0B27lX-sxkymfYzI5YzBjMWEtZGI5My00NGNiLThmNmQtOGNhZmE0ZWEwNDll&cindex=1) you can find the generated GUI for the EVALUACION_PRIMARIA-via_aerea template (this is primary evaluation-airway). You can see some tabs in the top that let you go to the other records in this primary evaluation stage.

If you change something on the config template mapping, the app will instantly show the changes without restarting the app, because all (gui, bind, save, etc) is generated on the fly. May be you’ll have to clean the ArchetypeManager and TemplateManager caches.

I hope this can help you.
If you have any questions, please contact me.

Cheers,
Pablo.

(attachments)

resumen_clinico2.xml (4.1 KB)

Hi Pablo

thank you very much for your detailed reply.

Great to have such a experienced web developer in the openEHR community.

The current performance would make it cumbersome to use it in a productive environment, but it will be great as a prototyping and demonstrating tool. Clinicians can judge the value/completeness of archetypes and templates much better, if they see them as a working GUI. Your framework seems to be very suited for that.

I will try to get a small template running locally on my computer sometime this week. I will report my experience back to the list. Maybe this helps to decide how the community can leverage your work.

@all: Is anybody else interested in this?

A couple of questions to start (Cave: Will possibly bug you with more questions in the process):

  • Does it matter what version of grails I use?
  • Can I use the in-memory DB HSQLDB for testing? Or should I set it up with MySQL.
  • By looking at your proprietary templates it seems you determine a root archetype (usually of type SECTION) and the included archetypes (each is either fully included → ‘includeAll=“true”’ or only a subset → specified by one or several paths). Is this generally correct?

Cheers
-thilo

2010/11/30 pablo pazos <pazospablo@hotmail.com>

Hi Thilo,

The current performance would make it cumbersome to use it in a productive environment, but it will be great as a prototyping and demonstrating tool. Clinicians can judge the value/completeness of archetypes and templates much better, if they see them as a working GUI. Your framework seems to be very suited for that.

In fact I used the framework to show the archetype concept, something like “archetypes in action”.

I will try to get a small template running locally on my computer sometime this week. I will report my experience back to the list. Maybe this helps to decide how the community can leverage your work.

Great! let me know if you need some help.

A couple of questions to start (Cave: Will possibly bug you with more questions in the process):

  • Does it matter what version of grails I use?

Now it works only on Grails 1.1.1, you can read the installation page on the wiki:
http://translate.google.com/translate?js=n&prev=_t&hl=es&ie=UTF-8&layout=2&eotf=1&sl=es&tl=en&u=http%3A%2F%2Fcode.google.com%2Fp%2Fopen-ehr-gen-framework%2Fwiki%2FInstalacion

You can use google traductor to translate the spanish pages and docs.

  • Can I use the in-memory DB HSQLDB for testing? Or should I set it up with MySQL.

Yes, you can use HSQLDB, you can configure it in grails-app/conf/DataSource.groovy: http://code.google.com/p/open-ehr-gen-framework/source/browse/trunk/open-ehr-gen/grails-app/conf/DataSource.groovy, just uncomment this 2 lines:

// dbCreate = "create-drop" // one of 'create', 'create-drop', 'update'
// url = "jdbc:hsqldb:mem:devDB"

and comment the MySQL config.

  • By looking at your proprietary templates it seems you determine a root archetype (usually of type SECTION) and the included archetypes (each is either fully included → ‘includeAll=“true”’ or only a subset → specified by one or several paths). Is this generally correct?

Yes, it’s correct. All the template roots are SECTION or ENTRY, and each EHR domain have only one COMPOSITION that record all the data for all it’s templates. You can see in Config.groovy we have a trauma domain, an emergency domain, etc. We want to improve that to define multiple COMPOSITION templates to one domain.

Cheers,
Pablo.

Hi Pablo

thanks for your answers. Good tip with Google translation, hadn’t thought of it…

I have your app running on my machine now. I can see the login screen. The hardest bit was to convince my macbook to use jdk 1.6 :)… Otherwise a breeze. I like grails!

Could you please tell me a login and password I can use to get into your great application.

Thanks a lot
-thilo

Hi Thilo,

Having done a load of Slovenian->English translations using Google
Docs, I would suggest the following approach.

1. Split the original doc into reasonable size chunks - Google chokes
above a certain limit and save as ? MS Word docs or equivalent
2. Upload to Google Docs and open the file
3. Ignore any offer from Google to 'translate this page' , if you have
aotmatic trnslation turned on.
4. In Google Docs, Choose Tools->Translate from the top menu.
5. Create the translated doc as a copy and then download to your system.

The translation quality is not too bad, although fairly amusing on
occasion!! Most of the formatting is retained although Word numberings
tend to get lost.

Ian
Dr Ian McNicoll
office / fax +44(0)1536 414994
mobile +44 (0)775 209 7859
skype ianmcnicoll
ian.mcnicoll@oceaninformatics.com

Clinical analyst, Ocean Informatics
openEHR Clinical Knowledge Editor www.openehr.org/knowledge
Honorary Senior Research Associate, CHIME, UCL
BCS Primary Health Care SG Group www.phcsg.org

Never mind Pablo

After using my grey matter a bit it came to me that credentials must be in the bootstrap file et voila… found it. For anybody interested: this file can be found in grails-app/conf/BootStrap.groovy

Tomorrow I will try to load my own little template.

Cheers
-thilo

Hi Ian, it works without copying and pasting chunks. I just uploaded a doc, look for the “Tools > Translate Document” on the menu, and here is the translated “template sintax and config”:

https://docs.google.com/document/pub?id=17-vZ8OElOuWRLTsOXpzOJksW25lw0asQaSq1ZWDr7AU

Warning: the automatic translation may break some of the sintax, I have to check it more carefuly. Here is the docs in spanish for gudance: http://code.google.com/p/open-ehr-gen-framework/downloads/list

Thanks Pablo,

I was dealing with some monster requirements documents which were
perhaps atypical.

Ian

Dr Ian McNicoll
office / fax +44(0)1536 414994
mobile +44 (0)775 209 7859
skype ianmcnicoll
ian.mcnicoll@oceaninformatics.com

Clinical analyst, Ocean Informatics
openEHR Clinical Knowledge Editor www.openehr.org/knowledge
Honorary Senior Research Associate, CHIME, UCL
BCS Primary Health Care SG Group www.phcsg.org

Hi everyone!

We are happy to announce the release of a improved version of the Open EHR-Gen Framework, available here: http://code.google.com/p/open-ehr-gen-framework/
Now we’re updating the docs for this new version.

Congratulations Pablo,

Would it be possible to get some headline points for this release?

Ian

Dr Ian McNicoll
office +44 (0)1536 414994
fax +44 (0)1536 516317
mobile +44 (0)775 209 7859
skype ianmcnicoll
ian.mcnicoll@oceaninformatics.com

Clinical analyst, Ocean Informatics, UK
openEHR Clinical Knowledge Editor www.openehr.org/knowledge
Honorary Senior Research Associate, CHIME, UCL
BCS Primary Health Care www.phcsg.org

Hi everyone!

Attached are some screenshots of the new version of the OpenEHR-Gen Framework.

In the previous email are some key changes from the previous version of the framework (I thought I send it to the list but I send it only to Ian).

Pablo,

the list does not allow attachments, especially large ones, can you provide URLs to the screenshots instead?

thanks

  • thomas

Hi Thomas,

I’ve uploaded the screenshots here: http://www.subirfacil.com/files/1BIEYWYQ/capturas_openehr-gen.zip

Thank you.