FormEntry Module Taskpane Widgets
The taskpane widgets are found in /web/module/taskpane in the FormEntry Module.
These are the taskpane pages defined. They are called via the scripting language in Infopath:
taskPaneNavigateTo('/concept.htm?className=Drug&nodePath=//orders/medication_orders');
A step by step example of how to configure a concept picker is at InfoPath Complex features for concepts, forms, fields and formentry.
concept.htm
A concept list/picker. If a concept is not found it gives the user the option of submitting a concept proposal.
;Parameters:
- className (allows multiple): Class of the concept
- nodePath: path to schema node to be filled in
- mode: Valid values: 'add' or 'remove'. Used in add/remove diagnosis boxes
- title: Spring message property id or just a title string to display
- createConceptList: true/false whether concepts are added to a list or subsequent concept selections overwrite the first
- includeDrugConcepts: true/false whether drug values are added as selectable options in the displayed search list
;Usage:taskPaneNavigateTo('/concept.htm?className=Drug&nodePath=//orders/medication_orders&includeDrugConcepts=true&title=medications.title&createConceptList=true');
redirect: diagnosis.htm
Calls concept.htm with classNames Diagnosis, Finding, Symptom, and Symptom/Finding. Will also pass through any variable named "queryString"
- Usage
selectNewDiagnosis();
selectResolvedDiagnosis();
concept.htm extra parameters
Create a list of concepts and allow DAs to assign metadata around them. (currently metadata can only be integer or string based)
Requires Form Entry Module v2.5
- Example: DAs can insert any number of problems to add and associate a "problem id" to each
- Create a concept ("SOME CONCEPT SET" in example) that is defined as a set and has two set members:
- PROBLEM ADDED
- PROBLEM ID - defined with MISC class and NUMERIC datatype
- In the schema design page for your form, add SOME CONCEPT SET to obs section
- Set the MAX of the SOME CONCEPT SET field to -1
- Download, save, and design (open) your xsn.
- Place the cursor where you want to put your table
- In the Insert menu, select "Repeating Table..."
- Highlight SOME CONCEPT SET from the obs section and click Next
- Highlight value in the PROBLEM ADDED section and click Add
- Highlight value in the PROBLEM ID section and click Add
- Click Finish
- Paint/format/design the newly created table as you like
- For continuity, you can copy the numbering label and delete button from the problem added/problem removed repeating tables. Place them in the same row as the two values.
- Double click on your delete button and then click Edit Form Code
- Place this jscript in the delete method:
- :
var node = eventObj.Source; #: var newProbs = node.parentNode.selectNodes("some_concept_set"); #: if (newProbs.length > 1) { #: deleteTableRow(eventObj); #: } #: else { #: var node = node.firstChild; #: while (node != null) { #: var valueNode = node.selectSingleNode("value"); #: if (valueNode != null) #: valueNode.text = ""; #: node = node.nextSibling; #: } #: }
- Save and close the script editor
- Add a button under the table for adding problems.
- Double click the button and select Edit Form Code.
- Place this jscript in the add problem method:
- :
taskPaneNavigateTo('/concept.htm?createConceptList=true&nodePath=//obs/some_concept_set/problem_added&extraNodePath=//obs/some_concept_set/problem_id&extraLabel=Problem Id');
- Save and close the script editor
- Save and close your xsn
- Upload the xsn to OpenMRS
See extparams.xsn as an example xsn for how to use the extra parameters in the concept taskpane widget. (The schema layout: extparams.gif)
conceptAnswer.htm
A concept list/picker displaying only the answers for the given conceptId.
;Parameters:
- nodePath (required): path to schema node to be filled in
- conceptId (required): Integer concept id to concept that has answers
- title (defaults to conceptAnswer.title): Spring message property id or just a title string to display
;Usage:taskPaneNavigateTo('/conceptAnswer.htm?conceptId=1054&nodePath=//patient.civil_status&title=Civil Status');
location.htm
A location list/picker.
If using another node:
- the node must be of type text and will receive data in the form #^Location Name.
- Be sure to add the /value at the end of the nodepath
;Parameters:
- nodePath (defaults to //encounter.location_id): path to schema node to be filled in
;Usage:
selectLocation();
or
taskPaneNavigateTo('/location.htm?nodePath=//obs/some_concept/value'));
user.htm
A user list/picker.
;Parameters:
- nodePath (defaults to //encounter.provider_id): path to schema node to be filled in
- title: Spring message property id or just a title string to display
- role: Optional role(s) to restrict the user search on
;Usage:;Global properties:To show only users with a role of "Nurse" and to place the value selected into the "//nurse.user_id" node in the schema and to title the taskpane with the message property "nurse.title":
taskPaneNavigateTo('/user.htm?role=Nurse&nodePath=//nurse.user_id&title=nurse.title');
To show only users with roles of any of "Nurse", "Doctor", or "Lab Technician", and place the selected user into "//somebody.user_id" in the schema and to title the page with "This will be the title":
taskPaneNavigateTo('/user.htm?role=Nurse&role=Doctor&role=Lab%20Technician&nodePath=//somebody.user_id&title=This%20will%20be%20the%20title');
- as of version 3.6.3 if you set the global property 'formentry.infopath_taskpane.showAllUsersOnLoad' to 'false' then the user picker will not automatically show all users when loaded. (Otherwise this behavior is invoked automatically after 250ms, which occasionally causes problems.)
redirect: provider.htm
Calls user.htm with role of "Provider" and title of "User.provider". Will also pass through any variable named "queryString"
- Usage
selectProvider();
redirect: clinician.htm
Calls user.htm with role of "Clinician" and title of "User.clinician". Will also pass through any variable named "queryString"
- Usage
selectClinician();
tribe.htm
A tribe list/picker.
;Parameters:
- nodePath (defaults to //tribe.tribe_id): path to schema node to be filled in
;Usage:taskPaneNavigateTo('/tribe.htm');
encounter.htm
An encounter selection widget that will allow a user to supply a
(Requires version 3.3 of formentry and openmrs 1.4 (or openmrs 1.3.1 and this patch))
- Examples
xsn: archive:Backfill-encounter.xsn
schema: archive:Backfill-encounter-schema.png
; Parameters: - nodePath (defaults to //encounter/encounter.encounter_id): the path to the node to store the selected encounter id
- originalDatetimeNodePath (optional): the node to store the selected datetime of the original backfilling encounter (used for verifying selection by the data assistant only)
- patientId (required) The internal database id of the patient that this form is being filled out for
- encounterTypeId (optional, multiple) EncounterTypeId of the encounter types to restrict the taskpane to
; Usage:var patientId = XDocument.DOM.selectSingleNode("//patient/patient.patient_id");
if (patientId)
patientId = patientId.text;
taskPaneNavigateTo("/encounter.htm?patientId=" + patientId + "&nodePath=//encounter/encounter.encounter_id&originalDatetimeNodePath=//encounter/encounter.original_encounter_datetime");
relationship.htm
A widget that lets an infopath user add relationships to the current patient.
(Requires version 3.3 of formentry and openmrs 1.4 (or openmrs 1.3.1 and this patch))
- Examples
xsn: archive:relationships.xsn
; Parameters: - patientId (required) The internal database id of the patient that this form is being filled out for
; Usage:var patientId = XDocument.DOM.selectSingleNode("//patient/patient.patient_id");
if (patientId)
patientId = patientId.text;
taskPaneNavigateTo("/relationship.htm?patientId=" + patientId);