Is there a way to migrate concepts and concept sets automatically from CSV files on server startup, e.g., when running ‘vagrant up’ for a Bahmni instance?
We are actively working on tackling this exact topic with the OpenMRS Initializer module. Please read through the README, in particular the Domain ‘concepts’ subsection.
This is work in progress though, but perhaps would you be willing to collaborate?
This is not specific to Bahmni, but we actually are developing this in the context of the metadata management of Bahmni instances.
Should I build the dev branch since there is no master branch?
Correct. The master branch will only be created upon the first release, hopefully around early July.
So you should expect this to be bumpy and changing until there is a master branch.
Could you please share a sample CSV file fully defining some concepts?
You can either look at test resources (here) or through a real work-in-progress configuration that we are working on (here).
You may keep an eye on both locations as this module is under active development and will keep changing in the next few weeks.
Does the current code work with OpenMRS 2.0 distributions?
See here: Core 1.11.8+
We are developing using Bahmni 0.88, so that’s Core 2.0.3 I believe.
However you may faces some issues with the metadatasharing domain with Core 2.1 because of TRUNK-5169. This is currently delaying our upgrade to Bahmni 0.89.
I ran into a couple of issues when building the dev branch using “mvn clean install”:
A compilation error in the AddressHierarchyMessagesLoadingTest.java class, I commented out that line for now:
[INFO] -------------------------------------------------------------
[ERROR] /Users/dddd/IdeaProjects/openmrs-module-initializer/api/src/test/java/org/openmrs/module/initializer/AddressHierarchyMessagesLoadingTest.java:[53,65] cannot find symbol
symbol: variable GLOBAL_PROP_I18N_SUPPORT
location: class org.openmrs.module.addresshierarchy.AddressHierarchyConstants
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Initializer … SUCCESS [ 0.569 s]
[INFO] Initializer API … FAILURE [ 2.686 s]
[INFO] Initializer OMOD … SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
The unit test AddressHierarchyMessagesLoadingTest.refreshCache_shouldLoadAddressHierarchyMessages() fails. I’ve commented out that test in my local version as well.
The reason why you are bumping onto those issues is because Initializer 1.0-SNAPSHOT depends on a SNAPSHOT version of Address Hierarchy that is assumed to hold the i18n support feature. However this hasn’t been merged into AH’s master branch yet.
The simple way out of this is to skip tests altogether.
A more complicated way would be to clone and build our fork of AH. That way the needed JARs will in your .m2 folder. You would have to clone and build the dev branch of our fork (here).
I also ran into runtime errors that I resolved by adding messages_fr.properties and messages_es.properties files to the …/api/src/main/resources folder.
Thanks @dsurrao, config.xml was still referencing those two files for ‘fr’ and ‘es’ locales even though we had removed them.
It is now solved and pushed in dev.