How to start

Hi Bert,

I have the need to clarify some of your assertions about my previous messages:

Pablo advises you to use a relational database.

That´s not true. I supposed David were working with relational, but he didn’t confirmed that.

openEHR persistence should be DBMS independent, so I’ll never advise to use relational over other thing without knowing requirements. DBMS option should depend on requirements. (e.g. how data will be used / consumed).

Also, there are different level of persistence needed: for local systems, shared/federated systems, mobile and cloud based. For local systems and some shared systems, I would recommend relational. Maybe also for mobile persistence on the device. For other kinds, I’ll suggest XML/JSON based DB. And for some applications, I would recommend EAV or path-value.
I know some of those are different from your solution, but that is not mean that are not suitable for a huge space of solutions. I don’t believe in one-fits-all solutions.

IMO, this doesn’t give David the answer he needs. Is good to give him options. Consider he’s on a learning process.

I don’t think that is suitable for a good working kernel,

I’m not talking about a kernel, I’m talking about persistence. One architect can put that layer on a kernel or as a service on the cloud, depends also on requirements.

because you cannot run path-based queries against it, but for a start it might work.

That’s not true. Anyone can run path based queries against any type of DBMS, relational included. You just need a query transformer as recommended by AQL articles.

OK, no hard feelings about that. I must have misunderstood. I apologize. One of the requirements is that it must be able to run path based queries. I did not advise a solution to David, I just said that a relational database could be good for starting, but would not be suitable for a full featured OpenEHR database. I recommended against a relational database. Service, cloud, in the end, it must go to a disk, that is the part I am talking about. You can leave this decision to others, cloud, architect, service-providers, but somewhere this decision must be made. Yes of course it is possible, but when talking about relational, it needs a layer which transforms from AQL to a Codd optimized database. In fact, it will be a transformation from AQL to SQL into a RDBMS schema. I don’t think it is even possible for a few programmers to write that. So that solution is for me out of the question. In your case, as you state it, you want the cloud to solve it, or somewhere else where the architect (whoever that may be) puts it. That is fine. I want to solve it myself, with the people I work with. I think that is where the money is. In the solving of the technical problems. That is what I am discussing. There is no need to interfere in that discussion if you don’t want to regard that as your problem. But if you do want to regard it as a situation you want to handle, then I am very pleased, if you explain/discuss how you are planning do it. Thanks in advance Bert

I am pretty good at Java development. But there are two many documents for a prototype. Can you send me a mapping text file and tell me all steps I should take to retrieve and save data into database? I have already downloaded openehr-aom, openehr-ap, openehr-dao, openehr-rm-core, openehr-rm-domain, adl-parser and adl-serializer packages. If you can give me a whole flow, that will be big helpful.

Thanks,

David

Hi!

Is there a tutorial book I can purchase or some examples? Step-by-step tutorial is best.

Skim through the document
http://www.openehr.org/releases/1.0.2/architecture/overview.pdf to get
an overview then go back to that and other documents for more detail
when needed. Also there are some videos at
http://www.openehr.org/resources/learning_centre if you prefer
watching over reading.

If you don't mind using alpha-versions of work in progress, then feel
free to do some openEHR hands-on experiments using
https://github.com/LiU-IMT/EEE described in the paper
http://www.biomedcentral.com/1472-6947/13/57 (Appendix B at
http://www.biomedcentral.com/1472-6947/13/57#sec9 is a very compact
openEHR intro, perhaps too compact.)

I hope the instructions at https://github.com/LiU-IMT/EEE/wiki/install
helps you get it up and running. Try running and modifying AQL queries
on the provided example content for example.

Best regards,
Erik Sundvall
Tel: +46-72-524 54 55
LiO: erik.sundvall@lio.se http://www.lio.se/Verksamheter/IT-centrum/
LiU: erik.sundvall@liu.se http://www.imt.liu.se/~erisu/

P.s. to list readers: I Hope to see many of you openEHR people at
Medinfo in Copenhagen soon!

Hi David, I already said this but I want to be clear: there are not fixed “steps” for implementing openEHR, it depends on requirements, technology and the methodology you use.

You should advice your boss, this is not something you can learn and implement in a month.

I think I also mentioned this before: for your first prototype you only need an archetype parser, i.e. adl_parser and ADL Workbench to extract paths.

Please read this email carefully, is long but it has info you can use to start doing something right away. I can clarify this if you have questions, but I’ll not repeat this in future emails or tell you to read previous messages. Don’t take me wrong, but at an early stage you have to go through these ideas a couple of times before asking further questions. I know you have pressure on your side, but this is not an API you can read the reference, ask a couple of questions, and start coding right away…

About mappings, those are system dependent and I can’t give you those. You just need to create something like this:

Mapping between a field on screen and a node on an archetype:
screen_a.field_a maps_to archetype_id.node_path

Mapping between a column on a database and a node on an archetype:
table_a.column_a maps_to archetype_id.node_path

Then, when you receive a data from screen_a on field_a, you know which archetype to load, and which node to get. You can use that node to validate data using constraints on the archetype. This is straight forward. I’ve been doing automatic data validation using archetypes for the last 4 years on EHRGen.
Then you can use the database binding to know where to put the data, so data store can be also automated using bindings. This means you don’t have to write routines for every piece of data that you want to store: you just write one generic routine to do that, and use the bindings. This is how EHRServer works.

This is key: the app logic might not know how data is persisted and where, is a generic algorithm that does all the magic, giving you more time to do interesting stuff instead of inserting data into a database. Also, if you have a client app, the client doesn’t know where and how the data is persisted, you just send the data and when you want to query, the data is magically there without making your client apps save ids or references to the data persisted in another component. These are good practices applied: SoC, low coupling and high cohesion, etc.

Another use of the UI-archetype binding is that you can generate the UI using archetypes :slight_smile:

In the openEHR course in spanish, I teach two methodologies of creating openEHR systems, one is using bindings, and the other is using metadata to autogenerate software elements (screens, database artifacts, maybe code generation for logic (data validation, data transformation, persistence, …), etc). For the last, archetypes are the kernel metadata, but you also need UI definitions, terminologies, process definitions, etc.

About saving and querying, I already mentioned that on previous messages: “Create tables, saves and retrieves the.same way you do with any other system. This is not black magic, is just data :)”.

There are strong opinions about this and some people doesn’t understand this yet, but this comment is key: is not mandatory to implement the complete information model at the persistence layer, at least not a 1-to-1 mapping. Your persistent model can be different to the information model, but there will be semantic links between them that makes both models compatible / semantically equivalent. That’s why you need some kind of mapping/binding if those models are not mapped 1-to-1 (persistence & openEHR IM).

What is mandatory is that your system (not your persistence layer alone) can receive and retrieve openEHR data using services.

If one developer chooses to implement the openEHR IM at the persistence layer, is just a design decision. I’ve made this decision in the past, and have a working implementation doing that (EHRGen https://code.google.com/p/open-ehr-gen-framework). Experience told me is a mess to implement the complete information model at the persistence layer using a relational model, but it has big advantages for data processing, e.g. executing path based queries is easy because queries are executed against the openEHR IM (and this can be done regardless of the DBMS you use, relational, document, key-value, object oriented, etc.).
But that model is also too complex to be handled in a relational DBMS (I’m talking about performance here), that’s why my new persistence implementations use a mix of XML and relational (EHRServer https://github.com/ppazos/cabolabs-ehrserver). This also use openEHR XML for commits and yes, it can handle path based queries over the relational DB.

BTW, both projects I mentioned are open source. If you want to learn how they work, just download, test and read the code :slight_smile: If you have any questions, I’m here to help.

Erik,

do you have content you want on that learning centre page? If so, let's put it up there.

- tom

(attachments)

oceanfullsmall.jpg
btnliprofileblue80x15.png

Hi!

do you have content you want on that learning centre page? If so, let’s put it up there.

Well, the appendix at http://www.biomedcentral.com/1472-6947/13/57#sec9 is our attempt to create a very compact openEHR intro, if you feel that it is useful, then feel free to link to it from the learning centre page or some other place.

The illustrations/figures created by us (and the text) are CC-BY licensed and can thus be freely reused in other contexts or translated provided that the source is attributed.

//Erik