Strangely we could do for so long without a dedicated OpenMRS Initializer domain for locations. Until now we were simply bringing in locations metadata through OpenMRS MDS packages. MDS packages are always a convenient fallback mechanism when the desired OpenMRS Initializer domain is not (yet) available.
It was on our to do list for some time to finally address the case of locations. It is now done, please check the README about it here.
Let us look at a sample use on a Bahmni distribution of one of our clients that supports a small community health clinic in Haiti. Starting from an existing default Bahmni setup we want to end up with just two locations:
- Clinic
- Community
'Clinic' is the login location for providers at the clinic itself, whereas 'Community' is an ad-hoc location for providers performing community surveys while offline using Bahmni Connect. We had to deal with the additional constraint that Bahmni default's OPD-1 location had been used to record data at the clinic already, so that one would have to become 'Clinic'.
This simple CSV configuration (committed here)
- Retires a set of default Bahmni locations that we don't intend to use and
- Renames two of the default Bahmni locations.
Let us go through this CSV config line by line and interpret the Initializer actions on each object. For those that are edited we have stated their name as it comes in the default state of the Bahmni database:
CSV line | Bahmni default name | OpenMRS Initializer actions |
---|---|---|
2 | OPD-1 | Renamed into 'Clinic', set as child of 'Jerusalem Clinic', tagged as 'Login Location' |
3 | Created, set as child of 'Jerusalem Clinic', tagged as 'Login Location' and 'Visit Location' | |
4 | Subcenter 1 (BAM) | Retired |
5 | Subcenter 2 (SEM) | Retired |
6 | Subcenter 3 (SIV) | Retired |
7 | Unknown Location | Retired |
8 | Ganiyari | Renamed as 'Jerusalem Clinic', tagged as 'Login Location' |
Here again OpenMRS Initializer provides a simple way to process some key metadata in a friendly and readable format, that is very much in line with all other domains that had been covered until now: concepts, drugs, person attribute types... etc.