How to link openEHR with ERP?

right now I can make my first template (Medication order) and simple app for insert data to EHRbase.

For further step I want the app to send drug code and quantity to finance service.
From my understanding this have to work separately from openEHR right? But I also want the order ID insert to OpenEHR metadata So I can have a primary key between finance service and openehr service.
But I don’t know how to do that

Could you help me out?

Roughly speaking: do it outside of openEHR.

WARNING: subjective take ahead: If software engineering agrees on one thing, it’s that downstream artefacts and concepts are better not referenced from upstream ones. It applies to openEHR as well. I.e. if there’s something in an ERP related to some data in a composition, then the ERP data would ideally have a reference to openEHR composition id etc, and not that openEHR composition has some data pointing at an ERP. Think about it, what if users of openEHR models start piling ERP, GUI, CDS etc data directly into the archetypes? One project’s metadata for ERP won’t match the other, so it’ll only grow to be a headache for the person who does not have any need for an ERP at all etc.

Real life, production implementations of openEHR tend to have satellite databases of sorts, connecting/associating openEHR data with non-openEHR data, to avoid the issues I mentioned above. There are some implementations pushing various metadata into the models, but that’s a design approach I’d personally avoid as much as possible.

Finally, are you able to share why you’d need the ERP related metadata in your archetypes? What’s your clinical requirement for that?

1 Like

Actually I m doing POC for the new HIS.
I’m quite new here so not really know where to start or what do other softwares do to operate business logic with openehr data.

Whether or not it is a good idea is another question - it depends (see Seref’s answer), but concretely you can use the DV_IDENTIFIER data type in a normal ENTRY (most likely an ADMIN_ENTRY) that is committed either later on or at the same time as the order, depending on when you obtain it. It could even go in as a data point in the INSTRUCTION if you have a routine need to do that.

There is a specific Order Identifier in the Medication order archetype for this purpose but it should generally be populated with an external prescription identifier not with an internal database key.