|
2 | 2 |
|
3 | 3 | # OpenMRS ESM Fast Data Entry App |
4 | 4 |
|
5 | | -The Fast Data Entry App is a module for the [OpenMRS](https://openmrs.org/) healthcare platform which allows for a natural workflow when entering many pre-recorded forms at a time. It is not meant for point-of-care workflows, but rather as a way to do retrospective data entry. |
| 5 | +The Fast Data Entry App is a module for the [OpenMRS](https://openmrs.org/) healthcare platform which allows for a natural workflow when entering many pre-recorded forms at a time. It is not meant for point-of-care workflows, but rather as a way to do retrospective data entry. For more detailed information, see the [FDE Wiki Documentation](https://openmrs.atlassian.net/wiki/spaces/docs/pages/150962486/Key+O3+Repositories#Fast-Data-Entry). |
6 | 6 |
|
7 | 7 | ## Overview |
8 | 8 | Currently the app consists of three main parts, a Forms Page to list available forms, Fast Data Entry which allows the rapid input of forms, and Group Sessions which enable recording information about a group session as well as individual forms for the session participants. |
@@ -39,6 +39,122 @@ This app also contains a Group Builder for quickly putting together a group of p |
39 | 39 |
|
40 | 40 | https://user-images.githubusercontent.com/5445264/190840219-ec032792-0479-4676-8312-24064edb6afc.mov |
41 | 41 |
|
| 42 | +### Pre-Filled Questions |
| 43 | + |
| 44 | +In many retrospective workflows, certain fields on a form may have the **same value across multiple patients** (e.g., *session date*, *facility name*, or *session type*). Rather than forcing the data clerk to re-enter these values repeatedly, the Fast Data Entry (FDE) app supports **pre-filled questions**. |
| 45 | + |
| 46 | +These are configured in the `specificQuestions` schema. The schema allows you to: |
| 47 | + |
| 48 | +* Identify **which forms** the question applies to. |
| 49 | +* Point to the **question ID** within the form schema. |
| 50 | +* Optionally define a **default answer**. |
| 51 | +* Optionally limit the set of **answer choices** (for coded inputs). |
| 52 | + |
| 53 | +#### Example Schema |
| 54 | + |
| 55 | +```json |
| 56 | +"specificQuestions": [ |
| 57 | + { |
| 58 | + "forms": [ |
| 59 | + "547c0814-eb78-3280-91a8-8d7c574e0301", |
| 60 | + "0f5d1e6c-8f8e-3d5c-ac50-f0db0c74d7d8" |
| 61 | + ], |
| 62 | + "questionId": "placeOfConsultation" |
| 63 | + }, |
| 64 | + { |
| 65 | + "forms": [ |
| 66 | + "547c0814-eb78-3280-91a8-8d7c574e0301", |
| 67 | + "0f5d1e6c-8f8e-3d5c-ac50-f0db0c74d7d8" |
| 68 | + ], |
| 69 | + "questionId": "practitionerAffiliation" |
| 70 | + }, |
| 71 | + { |
| 72 | + "forms": [ |
| 73 | + "547c0814-eb78-3280-91a8-8d7c574e0301", |
| 74 | + "0f5d1e6c-8f8e-3d5c-ac50-f0db0c74d7d8" |
| 75 | + ], |
| 76 | + "questionId": "typeOfSession", |
| 77 | + "defaultAnswer": "9bc5ecea-7c82-11e9-8f9e-2a86e4085a59", |
| 78 | + "answers": [ |
| 79 | + "9bc5ecea-7c82-11e9-8f9e-2a86e4085a59", |
| 80 | + "3a826502-6d4a-4e84-82e2-13deb0a5f958" |
| 81 | + ] |
| 82 | + }, |
| 83 | + { |
| 84 | + "forms": [ |
| 85 | + "547c0814-eb78-3280-91a8-8d7c574e0301", |
| 86 | + "0f5d1e6c-8f8e-3d5c-ac50-f0db0c74d7d8" |
| 87 | + ], |
| 88 | + "questionId": "sessionFormat" |
| 89 | + }, |
| 90 | + { |
| 91 | + "forms": [ |
| 92 | + "547c0814-eb78-3280-91a8-8d7c574e0301", |
| 93 | + "0f5d1e6c-8f8e-3d5c-ac50-f0db0c74d7d8" |
| 94 | + ], |
| 95 | + "questionId": "targetGroupProgramType" |
| 96 | + } |
| 97 | +] |
| 98 | +``` |
| 99 | + |
| 100 | +#### Schema Keys |
| 101 | + |
| 102 | +* **`forms`**: Array of form UUIDs. The pre-fill rule applies only to these forms. |
| 103 | +* **`questionId`**: The field identifier in the form schema to pre-fill. Must exist in the published form schema. |
| 104 | +* **`defaultAnswer`** *(optional)*: A concept UUID or value to use as the default answer. |
| 105 | +* **`answers`** *(optional, for coded inputs)*: Array of concept UUIDs to restrict the available answer options. |
| 106 | + |
| 107 | +#### Use Cases |
| 108 | + |
| 109 | +1. **Shared Values Across Patients** |
| 110 | + |
| 111 | + * *Example*: *“Date of Consultation”* is the same for all 20 patients in a session. Instead of retyping it 20 times, pre-fill once. |
| 112 | + |
| 113 | +2. **Default Answers** |
| 114 | + |
| 115 | + * *Example*: *“Type of Session”* defaults to *Counseling*. Users can override if necessary. |
| 116 | + |
| 117 | +3. **Restricting Options** (multi-select) |
| 118 | + |
| 119 | + * *Example*: A schema defines four session formats, but only two are relevant in this workflow. The `answers` array limits options to those two. |
| 120 | + |
| 121 | +4. **Multiple Forms, One Rule** |
| 122 | + |
| 123 | + * A single pre-fill definition can target the same field across multiple forms. |
| 124 | + |
| 125 | +#### Important Notes |
| 126 | + |
| 127 | +* Forms must be **published** before pre-filled values will display. |
| 128 | +* The `questionId` must **match an existing field** in the form schema. |
| 129 | +* Concepts used in `defaultAnswer` or `answers` must exist in the database; otherwise, the UI will show empty values |
| 130 | + |
| 131 | +## Integration with Form Engines |
| 132 | + |
| 133 | +Since all forms in OpenMRS are submitted via a form engine, **FDE** relies on one of two wrapper modules: |
| 134 | + |
| 135 | +- [Form Engine App](https://github.com/openmrs/openmrs-esm-patient-chart/tree/main/packages/esm-form-engine-app) |
| 136 | +- [Form Entry App](https://github.com/openmrs/openmrs-esm-patient-chart/tree/main/packages/esm-form-entry-app) |
| 137 | + |
| 138 | +⚠️ **Important**: The Fast Data Entry (FDE) feature is supported **only by JSON schema–based form engines** |
| 139 | +(e.g., the React Form Engine or the Angular Form Engine). |
| 140 | +A distribution can activate **only one wrapper module** at a time. |
| 141 | + |
| 142 | +👉 For example, the **O3 Reference Application** uses the **React Form Engine** |
| 143 | + |
| 144 | +#### Adopting a Form Engine with FDE |
| 145 | + |
| 146 | +1. **Add the wrapper module** (`Form Engine App` or `Form Entry App`) to the frontend modules in your distribution. |
| 147 | +2. **Do not add both wrappers** at the same time. They depend on the same OpenMRS extension framework resources (e.g., `extension-slots`), and will conflict. |
| 148 | +3. Once the wrapper is loaded, **FDE automatically integrates** with the form engine. |
| 149 | + |
| 150 | + |
| 151 | +#### Why This Works |
| 152 | + |
| 153 | +Because the form engines themselves have been extended to support FDE, the FDE module remains **generic and independent**. Its flexibility comes from the **OpenMRS extension system**, particularly: |
| 154 | + |
| 155 | +- **`form-widget-slot`** → provide an entry point for rendering forms. |
| 156 | +- **`ampath-form-action` event** → used by both form engines to synchronize form operations with FDE. |
| 157 | + |
42 | 158 |
|
43 | 159 | ## Running this code |
44 | 160 |
|
|
0 commit comments