Project-Form Settings

Project-Form Settings

The Project Forms panel at /admin/panels/project-forms configures the mapping between a DigitVA project-site pair and a specific ODK Central form. It also provides per-form SmartVA analysis settings and form type registration.

Per-Site ODK Form Mapping

Each project-site pair can be linked to one or more ODK forms; one ODK form belongs to only one project-site. Each mapping tells DigitVA which ODK Central project and form to sync submissions from for that site. Mappings are stored in the map_project_site_odk table.

Configuring a Form Mapping

To configure a mapping, open a site row in the panel and click Configure. The site table renders immediately from local database state, but the ODK project and form dropdowns are populated lazily from ODK Central only when you open a row for configuration.

When a site already has a mapping, the Editing form selector picks which mapping to edit. Choose + Add another form… to map an additional form, or Remove this form to delete the selected mapping.

Setting Description
ODK Project Select the ODK Central project from the live dropdown. This dropdown is populated by querying the assigned ODK Central connection.
ODK Form Select the specific XML form within that ODK project. Dropdown values come from live ODK Central data.
Form Type Select the VA form type from mas_form_types (for example, "WHO_2022_VA" or "WHO_2022_VA_SOCIAL"). This determines how fields are rendered during coding.
The ODK project and form dropdowns are fetched live from ODK Central when you open a configuration row. If the assigned ODK connection is in cooldown or experiencing failures, an inline error message appears instead of blocking the entire panel. The connection bar shows the assigned connection's current health state before you attempt live lookups.

Form Type Registration

Form types are registered in mas_form_types through the seed command or the Field Mapping admin panel. The default form type is WHO_2022_VA, which includes all 414 fields and 1196 choice mappings loaded from the Excel mapping spreadsheets.

If the Field Mapping panel shows "No form types registered yet", run:

docker compose exec minerva_app_service uv run flask seed run

This bootstraps the default form type without affecting existing users, languages, or submissions.

SmartVA Configuration Per Form

In the same configuration row, you can edit SmartVA execution settings for the project-site form. These settings control how SmartVA analyzes submissions from this form:

Setting Description Effect on Analysis
HIV Prevalence Whether the population has significant HIV prevalence. When enabled, SmartVA includes HIV-related cause-of-death tariffs in its scoring algorithm.
Malaria Endemic Whether the population is in a malaria-endemic region. When enabled, SmartVA includes malaria-related cause-of-death tariffs in its scoring algorithm.
HCE Enabled Whether Health Care Encounter data should be used. When enabled, SmartVA incorporates health care encounter information into the cause-of-death prediction.
Freetext Enabled Whether free-text narrative fields should be processed. When enabled, SmartVA uses open-ended narrative responses as additional input for cause-of-death classification.
Country Code The country code for the study population. Used by SmartVA to apply country-specific cause-of-death parameters and adjustments.
Changing SmartVA settings does not automatically regenerate results for existing submissions. New settings apply to the next SmartVA run. To regenerate results for existing submissions, trigger a SmartVA-only resync or a force-resync from the sync dashboard.

How SmartVA Settings Affect Analysis

SmartVA is an automated cause-of-death classification tool that processes VA data in batches. It produces a ranked list of likely causes of death for each submission based on the configured parameters. The SmartVA pipeline runs inside the Celery worker as a Python subprocess using the vendored SmartVA-Analyze v3.0.0 package.

Key analysis behaviors:

  • Submissions are classified into age groups (neonate, child, adult) based on age at death.
  • Cause-of-death tariffs are scored per age group using the WHO VA 2022 questionnaire fields.
  • At least 80% of form headers must match the Id#### pattern for SmartVA to recognize the form as a WHO questionnaire. Extra non-standard columns are filtered out during input preparation.
  • Results are stored as an active projection in va_smartva_results and linked to the submission's current active payload version.

Saving a Mapping

When you save a form mapping, DigitVA immediately ensures the runtime va_forms row exists so that SmartVA settings can be persisted even before the first sync run. This means:

  • The mapping is recorded in map_project_site_odk.
  • A compatibility va_forms row is created if it does not already exist.
  • The next sync run will begin downloading submissions for this mapping.

Connection Health in the Panel

The connection bar at the top of the Project Forms panel shows the assigned ODK connection's current state, including:

  • Whether cooldown is active and when it expires.
  • Recent retryable failure count.
  • Recent failure message.

This helps operators understand why live ODK dropdown fetches may be failing before attempting further lookups.

Related Help Topics