This Module provides the ability to automatically enroll patients in a program after a form is submitted. It also provides a mechanism to enroll all current patients in the database into one or more programs based on previous encounter types.
- Use at least OpenMRS 1.2
- Have some forms and encounter types in OpenMRS (see Administering_Formentry).
- Create at least one program if none exist. It is not necessary to have any workflow or states in the program. (see Administering Programs, workflows and states).
- In the Administration page, look for Programs and click on Manage Encounter Types to Programs.
- Select a program and encounter type and click the Add Encounter Type to Program button.
- A program with one or more encounter types will be listed.
- Whenever a form of this encounter type is submitted, the patient will be enrolled in this program.
- An asterisk * next to an encounter type means that the database needs to be updated to enroll current patients into this program that have previously used this encounter type. Click the Update button to do so.
- To delete an Encounter Type to Program, click on the red x next to the item. It will be removed from
h1. Release Notes
h5. Version 1.4
Fixed problem mentioned in [archive:ticket #627|http://dev.openmrs.org/ticket/627] so that PatientProgram creator is the person who enters the encounter form.
Workaround for [archive:ticket #627|http://dev.openmrs.org/ticket/627] to set PatientProgram creator to be the person who enters the encounter form.
This version sets the enrollment date as the encounter datetime instead of today's date. When using the Update button to enroll current patients, the enrollment date is the encounter datetime of a patient's first encounter of any encounter type mapped to the program being updated.
If you would like to change all current patient programs in your database to reflect the above behavior, here is an SQL query that will change all patient programs, including those that have been changed manually from the patient dashboard. May I say, use this SQL query at your own risk. In the future I may add the functionality of this script to the module. Please let me know of any comments or suggestions regarding this.
Versions 1.1 - 1.2
Have the features listed in the [Usage|http://openmrs.org/index.php?title=Form2Program_Module&action=submit#Usage] section on this page.
The following may or may not be built into this module:
- Automatically transition a patient workflow state based on an observation or an order.
- Use a scheduled task to handle transition of patient workflow states based on the absence of activity (e.g.: Loss of Follow-up).
The module adds the following table to the database. Primary key is a superkey of (program, encounter_type). No history of deleted tuples is retained.