Overview

Architecture summary, supported form types, and key source locations for the Lab Forms module

๐Ÿ‘ค Ritu Kataria๐Ÿ“… Updated: Mar 13, 2026๐Ÿท๏ธ feature

Backend Overview

For a user-facing overview of Lab Forms (what they are, form types, and how they work), see the Lab Forms Overview.

The Lab Forms module is a configurable form engine used across CrelioHealth's LIMS platform. It powers several form use-cases โ€” Consent, Ask-at-Order-Entry (AOE) and Additional Patient Info โ€” through a single, shared data model and API layer.

Architecture Summary

Terminology Mapping

User-facing termCode entityDescription
FormProcessThe main form container
SectionSubProcessA group of questions within a form
QuestionQuestionAn individual field/prompt
Question propertyQuestionAttributeValidation, options, skip logic metadata
Linked tests/profilesProcessLinkedInstancesWhich tests/profiles a form applies to
Captured answerQuestionValue / AdditionalPatientInfoStored response data

Key Source Locations

LayerPath
Modelsadmin/account/models/coc/
Viewsadmin/account/views/lab_forms/
Serializersadmin/account/serializers/custom/lab_form_*
URLsadmin/account/urls/coc_urls.py, admin/account/urls/patient_consent_urls.py
Helpersadmin/account/lab_form_helpers/
Constants/Utilsadmin/account/utils.py (PROCESS_TYPE_MODEL_META_MAPPER, email templates)

Supported Form Types

Defined in admin/account/models/coc/lab_form.py:

Form TypeDescription
aoeAsk at Order Entry โ€” captures clinical questions at the point of billing
consentPatient Consent โ€” collects communication preferences and legal consent
additional_patient_infoExtra patient demographic/clinical info

Instance-ID Dependent Form Types

aoe and consent support linking a Process to specific entity instances (tests, profiles and promotions) via ProcessLinkedInstances.

For instance-dependent process types such as Test, Profile, and Promotion question values are persisted at the lab report level. Since reports are generated per test, values are ultimately stored against each test's lab report ID.

This means:

  • If a profile is billed and AOE is configured at the profile level, AOE may be captured once in the UI, but values are saved separately for each test in that profile (against each corresponding report).
  • If the profile itself does not have direct AOE mapping, but specific tests inside the profile do, values are captured and stored only for those mapped tests against their respective report IDs.

The same persistence rule applies to Consent and Promotion process types: capture may appear centralized, but storage remains test/report scoped.

On this page