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.

      panel
Code Block
<?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.

Code Block

"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

...

  1. http://localhost

...

  1. (or your site url) is a "Trusted Site".

    1. (In Infopath menu) Tools

...

    1. -> Options -

...

    1. > Internet Options

    2. Click on the Security tab

    3. Select "Trusted Sites"

    4. Click "Sites" button

    5. Add

...

    1. http://localhost

...

    1. (or your site url) if it is not there

    2. Click Ok

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

    1. (In Infopath menu) Tools -

...

    1. > Options -

...

    1. > 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

Code Block
http://localhost:8080/openmrs

to browse/view/open the web application, use the fixed IP you placed in the global property.

...

When opening an InfoPath document, it reports an error of this kind.

Code Block

FormEntry.xsd#/schema/complexType[121][@name = 'sample_concept_question_here_type']/sequence[1]/element[9][@name = 'unknown']
In the same scope elements with the same name, 'unknown', have to be the same type.

...

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_concept drug from concept_answer table in database. You can see the concepts in question by running this code:

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

Back up your database and run the following SQL script.

Code Block

# did you remember to backup the database?

# go into openmrs db
use openmrs;

# delete all tuples with the same concept_id and answer_concept by adding temp index
alter ignore table concept_answer add unique index tmp_uniq_idx (concept_id,answer_concept,answer_drug);     

   

# remove the temp index
drop index tmp_uniq_idx on concept_answer;     

When submitting an infopath form the message "form submitted successfully" appears but the data does not go into the database

...

This has something to do with a DTD change for how infopath marks insertion points for repeating tables. After upgrading from 1.4 to 1.6, we had to identify all the infopath forms in our system that contained repeating tables, and download the xsn, resave on the desktop with a new filename, and then re-upload.

...