How to apply HTML Form Entry substitution on a test resource ?

Hello everyone,

I use the ‘VIEW mode’ of some forms to display some encounters in the Patient Dashboard.

I have created a JavaScript/jQuery function that handles the HFE forms when needed (for VIEW mode); it mostly does 2 things: show only non-empty observations and ensure good formatting.

For this script to work, it is assumed that:

  • the initial XML form is of a certain layout (for instance, <obs> are only wrapped into <fieldset>, <p> are containing only one <obs>…)
  • the XML form is always gonna be substituted by HFE in the same way (for instance, empty obs are in a span with emptyValue class, or have a value class and empty text…).

I would like to create a test to ensure that forms are always made “VIEW mode compatible” and that my script will work. To do so, I want to transform my XML form with HFE and save this output. Later on, I will test my script against this output.

How to apply (in a test environment) the HFE substitution on a resource ?

Take a look at the RegressionTestHelper in the HFE module (and the various tests that use it). It may provide what you need.

1 Like