java.lang.IllegalStateException: Configuration required: emr.atFacilityVisitType

Hi, I get the above error after opening a patient dashboard and clicking on Start Visit. Then the visits page does not load.

Full error log on Paste bin here

OpenMRS Version 2.2.0 Reference Application 2.9.0

Please assist.


1 Like

@dkayiwa kindly help me look into this, I upgraded successfully from 1.9.11, everything else seems to be working fine except the visits page. Thank you.

Which OpenMRS platform version are you running? What version of the emrapi module are you running?

Hi Daniel EMR API Module Version is 1.27.0 OpenMRS Version 2.2.0

Can you share the list of modules that you have and the version for each?

1 Like

Hi Daniel, here is the full list of all the modules I have and their versions

Atlas Module 2.2

Form Entry App Module 1.4.2

Metadata Sharing 1.5.0

Reporting 1.17.0

ID Generation 4.5.0

Allergy UI Module 1.8.1

EMR API Module 1.27.0

Registration App Module 1.13.0

HTML Form Entry UI Framework Integration Module 1.7.0

App Framework Module 2.13.0

Reporting REST 1.10.0

Reference Metadata Module

Metadata Mapping 1.3.4

Admin UI Module 1.2.4

Metadata Deploy 1.11.0

Reference Application Module 2.9.0

OpenMRS UI Framework 3.15.0

App UI Module 1.9.0

Reporting Compatibility 2.0.6

HTML Widgets 1.10.0

Serialization Xstream 0.2.14

Address Hierarchy 2.11.0

Registration Core Module 1.8.0

Attachments 2.1.0

Form Filter Module 1.3.0

Core Apps Module 1.21.0

Event Module 2.7.0

Provider Management Module 2.10.0

Chart Search Module 2.1.0

Calculation 1.2

Appointment Scheduling UI Module 1.7.0

Open Web Apps Module 1.10.0

HTML Form Entry 3.8.0

FHIR Module 1.18.0

UI Commons Module 2.6.1

htmlformflowsheet 1.3

Rest Web Services OMOD

Reporting UI Module 1.6.0

Appointment Scheduling Module 1.10.0

Legacy UI Module 1.5.0

Data Exchange Module 1.3.3

UI Library Module 2.0.6

Reference Demo Data Module 1.4.4 OpenMRS

Here is the link to my current test server: there is no patient information just test data, feel free to use however you may.


Does this still happen even after a restart?

Let’s try that

Not solved.

In the database table named “metadatamapping_metadata_term_mapping”, what values do you have for the row where the code is “emr.atFacilityVisitType”?

Hi Daniel, here is a select from my metadatamapping_metadata_term_mapping table:

    | code                                    | metadata_class                                 | metadata_uuid                        | name                            |
    | emr.extraPatientIdentifierTypes         | org.openmrs.module.metadatamapping.MetadataSet | 85e2a99c-f09e-4b90-a55c-8507034385f6 | emr.extraPatientIdentifierTypes |
    | emr.unknownLocation                     | org.openmrs.Location                           | NULL                                 | NULL                            |
    | emr.primaryIdentifierType               | org.openmrs.PatientIdentifierType              | 05a29f94-c0ed-11e2-94be-8c13b969e334 | NULL                            |
    | emr.atFacilityVisitType                 | org.openmrs.VisitType                          | NULL                                 | NULL                            |
    | emr.orderingProviderEncounterRole       | org.openmrs.EncounterRole                      | NULL                                 | NULL                            |
    | emr.checkInClerkEncounterRole           | org.openmrs.EncounterRole                      | NULL                                 | NULL                            |
    | emr.clinicianEncounterRole              | org.openmrs.EncounterRole                      | NULL                                 | NULL                            |
    | emr.checkInEncounterType                | org.openmrs.EncounterType                      | NULL                                 | NULL                            |
    | emr.consultEncounterType                | org.openmrs.EncounterType                      | NULL                                 | NULL                            |
    | emr.visitNoteEncounterType              | org.openmrs.EncounterType                      | NULL                                 | NULL                            |
    | emr.admissionEncounterType              | org.openmrs.EncounterType                      | NULL                                 | NULL                            |
    | emr.exitFromInpatientEncounterType      | org.openmrs.EncounterType                      | NULL                                 | NULL                            |
    | emr.transferWithinHospitalEncounterType | org.openmrs.EncounterType                      | NULL                                 | NULL                            |
    | emr.admissionForm                       | org.openmrs.Form                               | NULL                                 | NULL                            |
    | emr.exitFromInpatientForm               | org.openmrs.Form                               | NULL                                 | NULL                            |
    | emr.transferWithinHospitalForm          | org.openmrs.Form                               | NULL                                 | NULL                            |
    | emr.unknownProvider                     | org.openmrs.Provider                           | f9badd80-ab76-11e2-9e96-0800200c9a66 | NULL                            |

Hi Daniel, with this insight atleast I managed to resolve the Visits Page issue and it’s now working fine after running the following query:

update metadatamapping_metadata_term_mapping set metadata_uuid ='7b0f5697-27e3-40c4-8bae-f4049abfb4ed' where code='emr.atFacilityVisitType';

where the uuid being set is the uuid of Facility Visit visit type from the visit_type table as shown below

mysql> select name, uuid from visit_type;
| name                    | uuid                                 |
| Facility Visit          | 7b0f5697-27e3-40c4-8bae-f4049abfb4ed |
| Primary Care Outpatient | 3515b588-b1df-4110-991b-0d603686d8e6 |
| ANC                     | 5744b0e9-25dd-4c7c-b326-642e5ce77c93 |

Please advise if the rest of the table is in order or where I can get sample data for this table, just in case it’s gonna cause some issues later. Otherwise, thanks a lot.

It would be interesting to find out why that value was NULL. Did you do anything special?

Nothing special, but I guess scenarios can differ extensively when doing an upgrade, especially if upgrading from a database that has been in use for many years.

Do you have some sort of backup of the old database which you can use to see if you can reproduce this problem?

Yes I do. I can try reproduce the problem but on a different link since this one is shared among other team members.

I will be glad to know how it all goes. :slight_smile:

I have actually attempted another update from the same old database but this time I did not encounter this issue. The difference is that this time I updated the CEIL concept dictionary before running the updates. So I think the whole issue might have been caused by the underlying old concept dictionary.

Oh i see! Thanks @koyowe for trying again and updating us. :slight_smile:

1 Like