Configuration required: Telephone Number error when registering patient


(prabhakar koppireddy) #1

Hi All,

I am working open MRs 2.x ,when i am trying to add patient data i got below exception .but patient data was added. here exception ,

UI Framework Error Root Error java.lang.IllegalStateException: Configuration required: Telephone Number at org.openmrs.module.emrapi.EmrApiProperties.getTelephoneAttributeType(EmrApiProperties.java:153) at org.openmrs.module.emrapi.patient.PatientDomainWrapper.getTelephoneNumber(PatientDomainWrapper.java:174) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at groovy.lang.MetaClassImpl$GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3468) at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:61) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:235) at SimpleTemplateScript30.run(SimpleTemplateScript30.groovy:13) at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.writeTo(SimpleTemplateEngine.java:165) at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.toString(SimpleTemplateEngine.java:177) at org.openmrs.ui.framework.fragment.GroovyFragmentView.render(GroovyFragmentView.java:46) at org.openmrs.ui.framework.fragment.FragmentFactory.processThisFragment(FragmentFactory.java:187) at org.openmrs.ui.framework.fragment.FragmentFactory.process(FragmentFactory.java:116) at org.openmrs.ui.framework.fragment.FragmentContext.includeFragment(FragmentContext.java:54) at org.openmrs.ui.framework.UiUtils.includeFragment(UiUtils.java:155) at sun.reflect.GeneratedMethodAccessor501.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:132) at SimpleTemplateScript27.run(SimpleTemplateScript27.groovy:159) at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.writeTo(SimpleTemplateEngine.java:165) at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.toString(SimpleTemplateEngine.java:177) at org.openmrs.ui.framework.fragment.GroovyFragmentView.render(GroovyFragmentView.java:46) at org.openmrs.ui.framework.fragment.FragmentFactory.processThisFragment(FragmentFactory.java:187) at org.openmrs.ui.framework.fragment.FragmentFactory.process(FragmentFactory.java:116) at org.openmrs.ui.framework.page.PageContext.includeFragment(PageContext.java:75) at org.openmrs.ui.framework.UiUtils.includeFragment(UiUtils.java:155) at sun.reflect.GeneratedMethodAccessor501.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:132) at SimpleTemplateScript24.run(SimpleTemplateScript24.groovy:23) at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.writeTo(SimpleTemplateEngine.java:165) at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.toString(SimpleTemplateEngine.java:177) at org.openmrs.ui.framework.page.GroovyPageView.render(GroovyPageView.java:43) at org.openmrs.ui.framework.page.PageFactory.processThisFragment(PageFactory.java:185) at org.openmrs.ui.framework.page.PageFactory.process(PageFactory.java:114) at org.openmrs.ui.framework.page.PageFactory.handle(PageFactory.java:84) at org.openmrs.module.uiframework.PageController.handlePath(PageController.java:110) at org.openmrs.module.uiframework.PageController.handleUrlWithDotPage(PageController.java:77) at sun.reflect.GeneratedMethodAccessor549.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:61) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:72) at org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:54) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:109) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:230) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)

Thanks, Prabhakar.K


Why can't I find primary concept for DiagnosisMetadata?
(Rafal Korytkowski) #2

Could you please check if referencemetadata module is running? Did you have any errors when starting up OpenMRS?

The issue is that a person attribute type defined in https://github.com/openmrs/openmrs-module-referencemetadata/blob/master/api/src/main/resources/Reference_Application_Person_Attribute_Types-1.zip was not installed properly. We need OpenMRS startup logs to determine why.

It is also possible that restarting your server will help as all metadata packages are reinstalled at each startup.


(prabhakar koppireddy) #3

Hey Thanks for quick response ,openmrs.txt (1.0 MB)

I have attached log files for you reference. kindly give me solution for resolving this issues.

Thanks, Prabhakar.K


(Rafal Korytkowski) #4

The issue is caused by:

WARN - ModuleUtil.refreshApplicationContext(879) |2015-08-05 18:16:25,909| Unable to invoke started() method on the module's activator
java.lang.RuntimeException: java.sql.SQLException: Incorrect string value: '\xE1\x8A\xA5\xE1\x8B\x88' for column 'name' at row 1
	at org.openmrs.module.dataexchange.DataImporter.importData(DataImporter.java:61)
	at org.openmrs.module.dataexchange.DataImporter$$FastClassByCGLIB$$572a80f.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:701)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:634)
	at org.openmrs.module.dataexchange.DataImporter$$EnhancerByCGLIB$$72cb4eac.importData(<generated>)
	at org.openmrs.module.referencemetadata.ReferenceMetadataActivator.installConcepts(ReferenceMetadataActivator.java:87)
	at org.openmrs.module.referencemetadata.ReferenceMetadataActivator.started(ReferenceMetadataActivator.java:56)
	at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:871)
	at org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:962)
	at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:616)
	at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:595)
	at org.openmrs.web.Listener.startOpenmrs(Listener.java:238)
	at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)

Could you please tell us the exact version of OpenMRS 2.x you are using? Please try the latest 2.2 release if you used something older than that.

In the future when reporting issues, please always provide as much details as you can. Include portions of logs you think may be relevant, stacktraces displayed by the UI, version of the distribution and any modules installed/upgraded manually. It is the bare minimum that we need to help you.


(Rafal Korytkowski) #5

The error implies that your database tables may not use the utf-8 encoding. Please see mysql documentation on how to fix that.


How do I fix a "Couldn't find primary concept for DiagnosisMetadata" error?
(prabhakar koppireddy) #6

Hi Raff,

Thanks for you Response ,

I took openMRS 1.11.3 war , I have downloaded from this link http://openmrs.org/download/ .And also i have downloaded modules from same link ,where i can see a button like Download OpenMRS 2.2 Modules & Data . For installing module i do like paste all modules in AppData folder and restated the server. so all modules are going to up and its creates tables related to modules in DB. Any thing wrong i did in installation.

**Sure Raff i will provide as much details if i got any issues. Thanks you for Suggestions :smiley:
Thanks, Prabhakar.K


Why can't I find primary concept for DiagnosisMetadata?
(Jeremy Ogembo) #7

Hi @raff,

Thanks for the headsup on utf-8 encoding. The problem seems to be the “create tables” option. When setting up openmrs for the first time, if this option is selected the tables are being created with the latin1 encoding. I tested using openmrs platform 1.11.6.

Hi @prabhakar, I also had the same problem you mentioned. Solution for me was to create another database, and when setting up openmrs for the first time, I did not include the “add demo data” option. After the setup, I stopped Tomcat, and used the query below to generate an sql file to change the encoding for all the tables that dint have utf-8 encoding. I got this from advise from stackoverflow: SELECT CONCAT( 'ALTER TABLE ', table_name, ' CHARACTER SET utf8 COLLATE utf8_general_ci; ', 'ALTER TABLE ', table_name, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ') FROM information_schema.TABLES AS T, information_schema.COLLATION_CHARACTER_SET_APPLICABILITYAS C WHERE C.collation_name = T.table_collation AND T.table_schema = 'name_of_your_database' AND (C.CHARACTER_SET_NAME != 'utf8' OR C.COLLATION_NAME not like 'utf8%')

Then copy paste the resulting output onto another tab and run. Remember to set foreign key checks to 0 before and set it to 1 after e.g:

  1. Run the query above:

  2. Right click on the Result set and select copy unquoted:

  3. Open a new tab and paste the result set:

  4. Add the SET foreign key check to the beginning and the end of the query and then ran:

  1. Finally, start Tomcat.

(Kevin Oyowe) #8

This issue has been solved by @darius here Getting a UI Framework Error when trying to register a new patient

You need to make sure there is a Person Attribute Type with the exact name of “Telephone Number”.

I did it by going to Advanced Administration page then changed the person attribute type “Phone Number” to “Telephone Number”. It worked.