Location Attribute errors in DHIS2 Reporting Module 2.0


(Sophie Kurschner) #1

Application Name: OpenMRS Version Number: 1.9.9

Question: Hi, we are trying to implement the DHIS Reporting Module. We are coming up against an immediate issues that we can’t figure out from the documentation.

When we we try to map the Location codes from DHIS2 as Location attributes in OpenMRS, we get the error:
could not insert: [org.openmrs.LocationAttribute]

We don’t get the error if we create a new location in OpenMRS, suggesting that this is conflict issue with prior existing Location Attributes.


(Daniel Kayiwa) #2

Do you mind sharing the full stack trace at pastebin.com?


(Kaweesi Joseph) #3

we have done that before without any issues. how are u persisting or managing the location attributes (codes) for each location? in our case we used metadatadeploy module


(Sophie Kurschner) #4

Here is the link to the full stack trace. Please let me know if you have issues accessing this.

<script src=“https://pastebin.com/embed_js/rCcs3cjp”></script>


(Sophie Kurschner) #5

Currently we are not using a module to manage or persist location attributes (codes) for each location. We are only using the core that OpenMRS provides.


(Daniel Kayiwa) #6

If i wanted to reproduce this locally, do you have a list of the steps?


(Sophie Kurschner) #7

Steps include:

  • add location
  • save location without a CODE
  • open created location and try to add CODE
  • save location
  • internal error results

*Error results when we want to modify old locations and add CODES to those.


(Daniel Kayiwa) #8

Are you able to reproduce that here? http://demo.openmrs.org


(Sophie Kurschner) #9

With what information do I log in?


(Daniel Kayiwa) #10

UserName: admin

Password: Admin123


(Sophie Kurschner) #11

We created a location attribute, name “CODE”. That worked fine.

Then, we created a new location, name “chuti estancia” without a Code. This also worked fine. However, when we added a Code, name “Solola” after saving everything except the Code was saved. We tried again with a different Code name (“Comalapa”) and Description (“location test”). When saving this, everything except the Code was saved again.

Please let us know if this has been a common issue. Thank you.


(Daniel Kayiwa) #12

Doesn’t this location have a saved CODE? https://demo.openmrs.org/openmrs/admin/locations/location.form?locationId=10


(Sophie Kurschner) #13

From the link you shared, there is no saved information. What do you mean?


(Daniel Kayiwa) #14

You probably checked after the demo server was reset. Can you reproduce it from here? https://uat-refapp.openmrs.org


(Sophie Kurschner) #15

We tried again and did not work. This is what we did:

We created a location attribute, name “CODE”. That worked fine. Then, we created a new location, name “tecpan” without a Code. This also worked fine. However, when we added a Code, name “chimaltenango” after saving everything except the Code was saved.


(Daniel Kayiwa) #16

Is that on uat-refapp.openmrs.org?


(Sophie Kurschner) #17

Yes that was on the link you sent.


(Daniel Kayiwa) #18

Can you take a look at this and tell me if it has the CODE named ‘chimaltenango’ https://uat-refapp.openmrs.org/openmrs/admin/locations/location.form?locationId=9


(Sophie Kurschner) #19

I think the session timed out, so we re-did the steps. I have attached screen shots of our steps:

![location%20-%20also%202nd%20step%20|690x811]

After adding the Code “Chimaltenango” to this location, we saved and returned to view this location. However, the Code “Chimaltenango” was no longer visible.

(upload://1LTD953bMMH060aUnB9Kb5pmEjm.png)

Between each of these steps Open said “Location saved” .


(Daniel Kayiwa) #20

I thought you were using the legacyui interface like the url i sent.