Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This page is outdated and no longer receives updates!

Contents 

Table of Contents
maxLevel2

InfoPath Resources

Form Entry Use Cases

Complete Form Entry Use Case

  • Complete Login use case.

  • Select Form Entry use case.

  • Enter patient name in search box.

    • System will retrieve all patients matching the entered search term.

  • Select appropriate form.

    • A request for /openmrs/formDownloadServlet is sent to server. FormDownloadServlet handles request and generates an XML response that contains the form schema (xsd) along with information that will tell the browser to open InfoPath to display the form. Unless previously instructed, the browser will prompt you to Open or Save the document. The XML below helps the browser figure out what it needs to do with the response.

xml
Code Block
xml
<?xml version="1.0"?>
<?mso-infoPathSolution name="Demo Form" href="http://localhost:8080/openmrs/formentry/forms/DemoForm.xsn" solutionVersion="" productVersion="11.0.6357" PIVersion="1.0.0.0" ?>
<?mso-application progid="InfoPath.Document"?>
  • Select the "Open with InfoPath" option.

  • Enter data into the form. This may require stepping through several pages of a form.

  • Select Submit button on last page of form.

  • InfoPath POSTs a request containing your form data to the FormUploadServlet.

  • FormUploadServlet creates a FormEntryQueue record, sets its XML data field with XML form data from the post, and stores the FormEntryQueue in the database.

Process Form Entry Queue Use Case

  • Scheduler spawns a ProcessFormEntryQueueTask every X seconds.

  • ProcessFormEntryQueueTask delegates to FormEntryQueueProcessor.

  • FormEntryQueueProcessor iterates through the FormEntryQueue.

  • FormEntryQueueProcessor transforms XML data in FormEntryQueue using an XSLT associated with the given form.

  • FormEntryQueueProcessor creates and stores the HL7InQueue record.

Process HL7 Queue Use Case

  • Scheduler spawns a ProcessHL7InQueueTask every X seconds.

  • ProcessHL7InQueueTask calls HL7InQueueProcessor.

  • HL7InQueueProcessor iterates through the HL7InQueue

  • HL7InQueueProcessor processes all HL7InQueue records.

  • HL7InQueueProcessor creates an Encounter and Observations based on the HL7 messages in the queue.

Troubleshooting

If InfoPath is not behaving as expected (changes aren't being reflected, etc), the problem can often be solved by clearing the cache. You can run the following on the Windows command line or create a batch file.

none
Code Block
none
"C:\Program Files\Microsoft Office\OFFICE11\infopath.exe" /cache ClearAll

ClassCastException while trying to Download Schema

Problem

Panel

DEBUG 03.01 - (HibernateConceptDAO.java:getConceptNumeric:516) Getting CONCEPT_NUMERIC 856
WARN 03.01 - (StatefulPersistenceContext.java:narrowProxy:581) Narrowing proxy to class org.openmrs.ConceptNumeric - this operation breaks h1. ERROR 03.01 - (StandardWrapperValve.java:invoke:260) Servlet.service() for servlet formDownloadServlet threw exception
java.lang.ClassCastException: org.openmrs.Concept
at org.openmrs.api.db.hibernate.HibernateConceptDAO.getConceptNumeric(HibernateConceptDAO.java:519)
at org.openmrs.api.impl.ConceptServiceImpl.getConceptNumeric(ConceptServiceImpl.java:285)
at org.openmrs.formentry.FormSchemaBuilder.getSchema(FormSchemaBuilder.java:135)
at org.openmrs.formentry.FormDownloadServlet.doGet(FormDownloadServlet.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.openmrs.web.OpenmrsFilter.doFilter(OpenmrsFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)

...

Change your Internet Security settings:

  1. Make sure http://localhost(or your site url) is a "Trusted Site".

    1. (In Infopath menu) Tools -> Options -> Internet Options

    2. Click on the Security tab

    3. Select "Trusted Sites"

    4. Click "Sites" button

    5. Add http://localhost (or your site url) if it is not there

    6. Click Ok

  2. Make sure your "Trusted Sites" can do cross-site scripting

    1. (In Infopath menu) Tools -> Options -> Internet Options

    2. Click on the Security tab

    3. Select "Trusted Sites"

    4. Click "Custom Level"

    5. In Miscellaneous --> Access data sources across domains

    6. Check "Enable"

    7. Click Ok

Login required when searching from taskpane

...

In other words, if you have a fixed IP for the server in the formentry.infopath_server_url property, don't use

No Formatcode
nopaneltrue
http://localhost:8080/openmrs

...

Panel

You get this error in InfoPath when multiple elements in scope with the same name. This is likely due having duplicates in your concept answers. The solution is to remove all tuples with the same concept_id, answer_concept, and answer_drug from concept_answer table in database. You can see the concepts in question by running this code:

sql
Code Block
sql
select concept_id, answer_concept, answer_drug, count(*) as cnt from concept_answer group by concept_id, answer_concept, answer_drug having cnt > 1;

...