Best approach for having Patient ID card in OpenMRS 2x and RefApp 2x

Could anyone please suggest me the best approach of having patient ID card in OpenMRS 2x? Also be able to print the card.

There is a ID Cards Module (@hilz041, @dkayiwa) available but I am not sure if I can use it in RefApp 2.5.

Regards, HPardess

If you are not sure, then try it out and see if it works! :slight_smile:

Unfortunately, there isnā€™t a good way to do this out of the box, that I am aware of. As a work-around, you could create a report with HTML design template, to specify the layout of the report. See instructions hereā€¦ https://wiki.openmrs.org/display/docs/How+to+create+a+Patient+Clinical+Summary+using+Reporting+Module

@arbaughj do you have some time to create a reporting module dataset with the fields to be displayed at qa-refapp.openmrs.org? I can have a PDF renderer that can be printed.

@dkayiwa, Iā€™m looking forward to a PDF renderer, or a way to launch a report for the patient from their dashboard!

Iā€™ve created an example data set called ā€œID Cardā€ atā€¦ http://qa-refapp.openmrs.org/openmrs/module/reporting/datasets/sqlDataSetEditor.form?uuid=bdea0ef5-07f6-4506-b41e-f43fb48db227

@arbaughj do you mind completing this by creating a report that uses this dataset? One that i can preview?

@dkayiwa, your wish is granted! See the ID Card Report atā€¦ http://qa-refapp.openmrs.org/openmrs/module/reporting/reports/reportEditor.form?uuid=0deca109-73ea-4cb1-9bda-7805e516c278#

@arbaughj are you looking for something along the lines of when you click ā€œPatient Summaryā€ under ā€œGeneral Actionsā€ from a dashboard like this? http://qa-refapp.openmrs.org/openmrs/coreapps/clinicianfacing/patient.page?patientId=d9bdd3bc-3e43-49e5-93db-cccf9982593c

1 Like

Yes, exactly! Thatā€™s beautiful. I knew that it was supposed to be worked on soon. Will that be a feature in the next release of Ref. App? Is it documented somewhere how to configure it, how to design the PDF template, etc.

This is not part of the reference application. It is just a module at https://wiki.openmrs.org/display/docs/XReports+Module

After creating the appropriate reporting module report, the PDF template can be designed at: http://qa-refapp.openmrs.org/openmrs/module/xreports/reportDesigner.form?reportId=5&refApp=true

Which you can get to from either this: http://qa-refapp.openmrs.org/openmrs/module/reporting/reports/manageReportDesigns.form

Or this: http://qa-refapp.openmrs.org/openmrs/xreports/reports.page

1 Like

Thank you so much.

I tried to create the Data Set Definitions (SQL Dataset). but i can not edit or add new parameter.

I am using

  • OpenMRS 2.0.4.1
  • Java 8
  • Tomcat 9 (also tried in Tomcat 7)

If you are using the exact sql that James provides, take a look at this page: http://qa-refapp.openmrs.org/openmrs/module/reporting/reports/reportEditor.form?uuid=0deca109-73ea-4cb1-9bda-7805e516c278#

On clicking ā€œEdit Mappingā€ ensure that you have the same as you see on the above link for: person: parameter: person

@dkayiwa: all model views (dialogues) are empty. I get same error message of 400.

It works fine when i run it with jetty server from eclipse but i get this error when i deploy the war file to tomcat.

Check for the error in the tomcat logs.

@dkayiwa: when i click on edit or add button, only one line of log text is added to localhost_access_log.2017-03-02.

0:0:0:0:0:0:0:1 - - [02/Mar/2017:16:19:18 +0430] ā€œGET null nullā€ 400 -

Other log files are updated.

Without looking at the full contents of the logs, i cannot tell what is going on. May be someone else. :slight_smile:

here is the full log text of catalina.2017-03-02.log 02-Mar-2017 08:01:45.053 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.0.M17 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 10 2017 20:59:20 UTC 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.0.0 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jre1.8.0_121 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_121-b13 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Program Files\Apache Software Foundation\Tomcat 9.0 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 9.0 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 9.0 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\logging.properties 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: exit 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms128m 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m 02-Mar-2017 08:01:45.085 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\wamp64\bin\php\php5.6.25;C:\ProgramData\ComposerSetup\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_121\bin;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;. 02-Mar-2017 08:01:45.959 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [ā€œhttp-nio-8080ā€] 02-Mar-2017 08:01:46.568 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 02-Mar-2017 08:01:46.584 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [ā€œajp-nio-8009ā€] 02-Mar-2017 08:01:46.584 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 02-Mar-2017 08:01:46.584 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 3233 ms 02-Mar-2017 08:01:46.646 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina 02-Mar-2017 08:01:46.646 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.0.M17 02-Mar-2017 08:01:46.724 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\openmrs.war 02-Mar-2017 08:01:46.771 WARNING [localhost-startStop-1] org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context} Setting property ā€˜antiJARLockingā€™ to ā€˜trueā€™ did not find a matching property. 02-Mar-2017 08:02:08.817 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 02-Mar-2017 08:18:55.208 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\openmrs.war has finished in 1,028,468 ms 02-Mar-2017 08:18:55.224 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\docs 02-Mar-2017 08:18:55.755 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\docs has finished in 531 ms 02-Mar-2017 08:18:55.817 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager 02-Mar-2017 08:18:56.536 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager has finished in 719 ms 02-Mar-2017 08:18:56.536 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\ROOT 02-Mar-2017 08:18:56.692 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\ROOT has finished in 156 ms 02-Mar-2017 08:18:56.724 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080] 02-Mar-2017 08:18:56.833 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009] 02-Mar-2017 08:18:56.849 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1030279 ms 02-Mar-2017 08:22:46.434 INFO [http-nio-8080-exec-4] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:458) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:377) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:767) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1347) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)

Can you just zip the entire logs folder and attach it here?

Ahhhhā€¦ it was an issue with tomcat version.

java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

Because there is | and ā€˜{ā€˜, ā€˜}ā€™ character or some other character which is not supported in URL query string by newer versions of Tomcat. Therefore, it throws above exception.

The URL had the pipe ā€œ|ā€ character in query string which is causes this issue in new versions of tomcat.

I used Tomcat 9.0.0.M17, tomcat 8.5.11 and tomcat 7.0.75 , i faced same URL encoding issue. I used the lower version of tomcat (Tomcat 8.5.6) and now it is working fine.

Please share it with other developers to take care of this strict URL validation issue in newer versions of Tomcat.

Thank you, HPardess

1 Like

Very useful feedback! Thank you so much @hpardess for sharing the solution. Keep up the great spirit! :slight_smile: