Dynasite - Zcore Form Rendering

Dynasite is the name for Zcore functionality that manages the creation and rendering of forms. Data about forms, fields, and enumerations is stored in the Admin schema of the database; however, in day-to-day use, forms are rendered from objects stored in memory. Upon application startup, these forms, a subset of a large object called DynaSiteObjects, are populated by a set of xml files. The system automatically generates these XML files (also upon startup) whenever new forms, fields, or enumerations have been created or modified. There is also a link in the form Admin section to generate these xml files upon demand.

The system does not access the database in order to render forms, although it is used for creating and editing forms. In most cases, the only data that needs to be stored in the database is patient data - the system scans the form-related XML files upon startup, loads the data into DynaSiteObjects, and renders the forms from memory.

How Dynasite interacts with the database

There is a one-to-one mapping between forms and database tables; same for form fields and database columns. The encounter table stores metadata for each record (what user created/modified the record, site id.) For example, the Patient Registration form persists its metadata (date/timestamp, user logged in, site, etc) to the encounter table, and its record data (fields in the form) in the patientregistration table. This method is a change from the old "bit bucket" schema, which used encounter_record and encounter_data to store patient records.

Diagram of encounter/patientregistration tables

Diagram of encounter/patientregistration tables

More ER Diagrams:

Accessing/updating the database is very simple: create a class in the dao package with insert/update/select methods, then call this method from your action. Zcore uses a very lightweight library (DbUtils) to facilitate JBDC connectivity.

The use of AJAX in Dynasite

The Zcore edit functionality as well as a few forms in the ZEPRS application (Create newborn, Ultrasound, and Partograph) use AJAX functionality for record storage, rather than the usual form/submit process. This AJAX functionality depends on a library called DWR (Direct Web Remoting). AJAX is used to provide the perception of near-instantaneous updates to data as well as streamline the data entry process.