Category Question Structure¶
Overview¶
This document provides detailed documentation of the question structure for each annotation category in SyRF. Each category has unique rules about how questions are organized, what system questions exist, and where custom questions can be placed.
Related Documentation¶
- Annotation Questions Business Logic - Core business rules
- Formal Specification - Precise rules, referential integrity, cross-language validation
- Architecture Analysis - Where logic should live
- Question Hierarchy Diagrams - Visual representations
Note: For formal, precise rule definitions (including referential integrity for lookups), see the Formal Rule Specification section.
Category Visibility Context¶
CRITICAL: The availability of categories depends on the Stage.Extraction boolean setting:
stage.extraction |
Available Categories | Use Case |
|---|---|---|
false |
Study only (custom questions only) | Simple screening without structured data extraction |
true |
All categories (Study + unit-based categories) | Full data extraction with structured outcome capture |
Unit-Based Categories (require stage.extraction = true):
- Disease Model Induction - Define disease models with control/non-control indicator
- Treatment - Define treatments with control/non-control indicator
- Outcome Assessment - Define outcome measures with statistical metadata (these system questions feed into OutcomeData)
- Cohort - Group disease models, treatments, and outcomes via lookup questions
- Experiment - Group cohorts into experiments via lookup questions
OutcomeData Connection: When stage.extraction = true, the system questions in Outcome Assessment (Average Type, Error Type, Units, Greater Is Worse) and Cohort (Number of Animals) populate the OutcomeData entity. OutcomeData can only be entered once Experiments, Cohorts, and Outcomes are created and linked via the lookup questions. See OutcomeData for full details.
Implementation: See Stage Data Extraction Settings in the main README for code-level details of how Stage.Extraction controls question visibility.
Category Quick Reference¶
| Category | Label Question | Control Question | First-Level Custom ParentΒΉ | Has Lookups |
|---|---|---|---|---|
| Study | None | None | Root (null) | No |
| Disease Model Induction | Yes | Yes (Model Control) | Control Question | No |
| Treatment | Yes | Yes (Treatment Control) | Control Question | No |
| Outcome Assessment | Yes | No | Label Question | Yes (PDF) |
| Cohort | Yes | No | Label Question | Yes (3 lookups) |
| Experiment | Yes | No | Label Question | Yes (Cohorts) |
| Hidden | N/A | N/A | N/A | N/A |
ΒΉ Note: This column shows where first-level custom questions must parent. Nested custom questions (created via "Add Related" on an existing custom question) parent to their custom question parent instead, forming arbitrarily deep trees within each category.
Study Category¶
Overview¶
The Study category is the simplest - it has no unit concept, no label question, and no control question. Custom questions are created at the root level.
Structure¶
Study Category
ββββββββββββββ
[Root Level - No System Questions]
ββββββββββββββββββββββββββββββββββββββββββ
β Custom Question 1 β
β ββββββββββββββββββ β
β root: true β
β target: null β
β system: false β
β β
β βββββββββββββββββββββββββββββββββββββββ
β β Child Question 1.1 ββ
β β target.parentId: CustomQ1.Id ββ
β βββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββ
β Custom Question 2 β
β ββββββββββββββββββ β
β root: true β
β target: null β
ββββββββββββββββββββββββββββββββββββββββββ
Rules¶
| Rule | Enforcement |
|---|---|
| Custom questions at root level | Frontend only |
| Child questions parent to custom questions | Backend + Frontend |
| No system questions in this category | Definition |
Code Reference¶
// create-question.component.ts - Study case
: null; // Study category - root question, no parent required
Disease Model Induction Category¶
Overview¶
Disease Model Induction uses a unit-based structure with a Control Question. First-level custom questions must be children of the Control Question and specify whether they apply to control procedures (true) or non-control procedures (false). Nested custom questions can parent to other custom questions within the same category.
System Questions¶
| Question | GUID | Type | Purpose |
|---|---|---|---|
| Disease Model Label | bdb6e257-5a08-42ef-aad0-829668679b0e |
Label (textbox) | Creates named disease model instances |
| Model Control | b18aa936-a4c6-446b-ac98-88ac38930878 |
Boolean (checkbox) | Indicates if this is a control procedure |
Structure¶
Disease Model Induction Category
ββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Disease Model Label [SYSTEM] β
β βββββββββββββββββββββββββββββ β
β id: bdb6e257-5a08-42ef-aad0-829668679b0e β
β root: true β
β labelQuestion: true β
β controlType: textbox β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Model Control [SYSTEM] ββ
β β βββββββββββββββββββββ ββ
β β id: b18aa936-a4c6-446b-ac98-88ac38930878 ββ
β β target.parentId: diseaseModelInductionLabel ββ
β β questionType: boolean ββ
β β controlType: checkbox ββ
β β ββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ
β β β Custom Question (Control=true) β ββ
β β β βββββββββββββββββββββββββββββ β ββ
β β β target.parentId: modelControl GUID β ββ
β β β conditionalParentAnswers: β ββ
β β β conditionType: Boolean (0) β ββ
β β β targetParentBoolean: true β ββ
β β β β ββ
β β β Shows when: Model Control checkbox = checked β ββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ
β β ββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ
β β β Custom Question (Control=false) β ββ
β β β βββββββββββββββββββββββββββββ β ββ
β β β target.parentId: modelControl GUID β ββ
β β β conditionalParentAnswers: β ββ
β β β conditionType: Boolean (0) β ββ
β β β targetParentBoolean: false β ββ
β β β β ββ
β β β Shows when: Model Control checkbox = unchecked β ββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ
β β ββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ
β β β Custom Question (Control=null/both) β ββ
β β β βββββββββββββββββββββββββββββ β ββ
β β β target.parentId: modelControl GUID β ββ
β β β conditionalParentAnswers: null β ββ
β β β β ββ
β β β Shows always (regardless of control value) β ββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Rules¶
| Rule | Enforcement | Details |
|---|---|---|
| First-level custom questions must parent to Model Control | Frontend only | target.parentId = b18aa936-a4c6-446b-ac98-88ac38930878 |
| Nested custom questions parent to custom question | Frontend only | target.parentId = {customQuestionId} |
| Control parameter must be specified (first-level only) | Frontend only | conditionalParentAnswers set to true, false, or null |
| Cannot place custom questions under Label | Frontend only | Not allowed by UI |
Code Reference¶
// create-question.component.ts:389-393
: category === categories.modelInduction
? createTarget(
systemAnnotationQuestionGuids.modelControl,
this.data.control // Boolean: true, false, or undefined (both)
)
Treatment Category¶
Overview¶
Treatment is structurally identical to Disease Model Induction - uses a unit-based structure with a Control Question.
System Questions¶
| Question | GUID | Type | Purpose |
|---|---|---|---|
| Treatment Label | b02e3072-74f0-44e0-a468-f472b3b09991 |
Label (textbox) | Creates named treatment instances |
| Treatment Control | d04ec2d7-3e10-4847-9999-befe7ee4c454 |
Boolean (checkbox) | Indicates if this is a control procedure |
Structure¶
Treatment Category
ββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Treatment Label [SYSTEM] β
β βββββββββββββββββββββββββ β
β id: b02e3072-74f0-44e0-a468-f472b3b09991 β
β root: true β
β labelQuestion: true β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Treatment Control [SYSTEM] ββ
β β βββββββββββββββββββββββ ββ
β β id: d04ec2d7-3e10-4847-9999-befe7ee4c454 ββ
β β target.parentId: treatmentLabel ββ
β β questionType: boolean ββ
β β ββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ
β β β Custom Questions... β ββ
β β β (Same structure as Disease Model Induction) β ββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Rules¶
Same as Disease Model Induction, but with Treatment-specific GUIDs.
Outcome Assessment Category¶
Overview¶
Outcome Assessment uses a unit-based structure without a Control Question. It has several specialized system questions for outcome measurement metadata and a lookup for PDF graphs.
System Questions¶
| Question | GUID | Type | Parent | Purpose |
|---|---|---|---|---|
| Outcome Label | dbe2720c-2e08-4f47-bcd0-3fe4ae8b8c7f |
Label (textbox) | Root | Creates named outcome instances |
| Average Type | 3a287115-5000-4d3f-8c41-7c46fae9adcf |
Dropdown | Label | Mean vs Median selection |
| Error Type | 8dbea59f-54d2-4e41-87e7-fde9e73a72d5 |
Dropdown | Average Type | SD/SEM/IQR based on average |
| Greater Is Worse | 45351e04-47b2-4785-9a72-713284e917b8 |
Boolean (checkbox) | Label | Outcome directionality |
| Units | 66eb1736-a838-4692-a78b-96b0671a377c |
Textbox | Label | Measurement units |
| PDF Graphs | 016278e8-7e60-40d4-9568-d7fa42670c32 |
Lookup | Label | References PDF annotations |
Structure¶
Outcome Assessment Category
βββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Outcome Label [SYSTEM] β
β βββββββββββββββββββββββ β
β id: dbe2720c-2e08-4f47-bcd0-3fe4ae8b8c7f β
β root: true β
β labelQuestion: true β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Average Type [SYSTEM] ββ
β β βββββββββββββββββββββ ββ
β β id: 3a287115-5000-4d3f-8c41-7c46fae9adcf ββ
β β controlType: dropdown ββ
β β options: [Mean, Median] ββ
β β ββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β Error Type [SYSTEM] βββ
β β β ββββββββββββββββββ βββ
β β β id: 8dbea59f-54d2-4e41-87e7-fde9e73a72d5 βββ
β β β controlType: dropdown βββ
β β β options: [SD, SEM, IQR] with parent filters: βββ
β β β SD, SEM β shown when Average = Mean βββ
β β β IQR β shown when Average = Median βββ
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Greater Is Worse [SYSTEM] ββ
β β βββββββββββββββββββββββββ ββ
β β id: 45351e04-47b2-4785-9a72-713284e917b8 ββ
β β questionType: boolean ββ
β β controlType: checkbox ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Units [SYSTEM] ββ
β β βββββββββββββ ββ
β β id: 66eb1736-a838-4692-a78b-96b0671a377c ββ
β β controlType: textbox ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β PDF Graphs [SYSTEM - Hidden] ββ
β β ββββββββββββββββββββββββββ ββ
β β id: 016278e8-7e60-40d4-9568-d7fa42670c32 ββ
β β annotationLookup: true ββ
β β Looks up: PDF References from Hidden category ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β [Custom Questions] ββ
β β ββββββββββββββββββ ββ
β β target.parentId: outcomeAssessmentLabel ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Option Parent Filters¶
The Error Type question demonstrates option-level parent filtering:
// Error Type options with parentFilter
options: [
{
value: "SD",
parentFilter: {
filterType: OptionType.Option,
value: ["Mean"] // Only shown when Average Type = Mean
}
},
{
value: "SEM",
parentFilter: {
filterType: OptionType.Option,
value: ["Mean"] // Only shown when Average Type = Mean
}
},
{
value: "IQR",
parentFilter: {
filterType: OptionType.Option,
value: ["Median"] // Only shown when Average Type = Median
}
}
]
Rules¶
| Rule | Enforcement |
|---|---|
| First-level custom questions must parent to Outcome Label | Frontend only |
| Nested custom questions parent to custom question | Frontend only |
| No control parameter required | Definition |
Cohort Category¶
Overview¶
Cohort is a unit-based category that aggregates entities from other categories via lookup questions. It links disease models, treatments, and outcomes to form experimental cohorts.
System Questions¶
| Question | GUID | Type | Parent | Looks Up |
|---|---|---|---|---|
| Cohort Label | 62c852ad-3390-48a4-ac13-439bf6b6587f |
Label (textbox) | Root | - |
| Disease Models | ecb550a5-ed95-473f-84bf-262c9faa7541 |
Lookup (checklist) | Label | Disease Model Label annotations |
| Treatments | a3f2e5bb-3ade-4830-bb66-b5550a3cc85b |
Lookup (checklist) | Label | Treatment Label annotations |
| Outcomes | 12ecd826-85a4-499a-844c-bd35ea6624ad |
Lookup (checklist) | Label | Outcome Label annotations |
| Number of Animals | 83caa64f-86a1-4f6e-a278-ebbd25297677 |
Integer (textbox) | Label | - |
Structure¶
Cohort Category
βββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cohort Label [SYSTEM] β
β βββββββββββββββββββββ β
β id: 62c852ad-3390-48a4-ac13-439bf6b6587f β
β root: true β
β labelQuestion: true β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Disease Models [SYSTEM - Lookup] ββ
β β βββββββββββββββββββββββββββββββββ ββ
β β id: ecb550a5-ed95-473f-84bf-262c9faa7541 ββ
β β annotationLookup: true ββ
β β controlType: checklist ββ
β β multiple: true ββ
β β ββ
β β Looks up: All Disease Model Label annotations ββ
β β from current study ββ
β β ββ
β β emptyLookupText: "Empty - First Enter A Disease ββ
β β Model Induction Procedure" ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Treatments [SYSTEM - Lookup] ββ
β β βββββββββββββββββββββββββββ ββ
β β id: a3f2e5bb-3ade-4830-bb66-b5550a3cc85b ββ
β β annotationLookup: true ββ
β β controlType: checklist ββ
β β multiple: true ββ
β β ββ
β β Looks up: All Treatment Label annotations ββ
β β from current study ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Outcomes [SYSTEM - Lookup] ββ
β β βββββββββββββββββββββββββ ββ
β β id: 12ecd826-85a4-499a-844c-bd35ea6624ad ββ
β β annotationLookup: true ββ
β β controlType: checklist ββ
β β multiple: true ββ
β β ββ
β β Looks up: All Outcome Label annotations ββ
β β from current study ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Number of Animals [SYSTEM] ββ
β β ββββββββββββββββββββββββββ ββ
β β id: 83caa64f-86a1-4f6e-a278-ebbd25297677 ββ
β β questionType: integer ββ
β β controlType: textbox ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β [Custom Questions] ββ
β β ββββββββββββββββββ ββ
β β target.parentId: cohortLabel ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Lookup Resolution¶
// annotation-form.service.ts - How lookups resolve
getOptions(question: IAnnotationQuestion): AnnotationQuestionOption[] {
switch (question.id) {
case systemAnnotationQuestionGuids.cohortDiseaseModels:
// Returns all Disease Model label annotations
return getOptionsFor('diseaseModels');
case systemAnnotationQuestionGuids.cohortTreatments:
// Returns all Treatment label annotations
return getOptionsFor('treatments');
case systemAnnotationQuestionGuids.cohortOutcomes:
// Returns all Outcome label annotations
return getOptionsFor('outcomes');
}
}
Experiment Category¶
Overview¶
Experiment is the highest-level unit, aggregating cohorts. It creates experimental groupings that reference the cohorts defined in the Cohort category.
System Questions¶
| Question | GUID | Type | Parent | Looks Up |
|---|---|---|---|---|
| Experiment Label | 7c555b6e-1fb6-4036-9982-c09a5db82ace |
Label (textbox) | Root | - |
| Cohorts | e7a84ba2-4ef2-4a14-83cb-7decf469d1a2 |
Lookup (checklist) | Label | Cohort Label annotations |
Structure¶
Experiment Category
βββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Experiment Label [SYSTEM] β
β βββββββββββββββββββββββββ β
β id: 7c555b6e-1fb6-4036-9982-c09a5db82ace β
β root: true β
β labelQuestion: true β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Cohorts [SYSTEM - Lookup] ββ
β β βββββββββββββββββββββββββ ββ
β β id: e7a84ba2-4ef2-4a14-83cb-7decf469d1a2 ββ
β β annotationLookup: true ββ
β β controlType: checklist ββ
β β multiple: true ββ
β β ββ
β β Looks up: All Cohort Label annotations ββ
β β from current study ββ
β β ββ
β β emptyLookupText: "Empty - First Enter A Cohort" ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β [Custom Questions] ββ
β β ββββββββββββββββββ ββ
β β target.parentId: experimentLabel ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Hidden Category¶
Overview¶
The Hidden category contains system questions that should not be displayed in the UI but are used for internal linking purposes.
System Questions¶
| Question | GUID | Type | Purpose |
|---|---|---|---|
| PDF References | 7ee21ff9-e309-4387-8d30-719201497682 |
Label | Stores PDF page/graph references |
Structure¶
Hidden Category
βββββββββββββββ
[Not displayed in Question Designer]
[Used for system-level data tracking]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PDF References [SYSTEM] β
β βββββββββββββββββββββββ β
β id: 7ee21ff9-e309-4387-8d30-719201497682 β
β labelQuestion: true β
β β
β Purpose: Allows outcome assessments to reference β
β specific pages/graphs in uploaded PDFs β
β β
β Referenced by: Outcome Assessment > PDF Graphs lookup β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Data Flow Between Categories¶
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CATEGORY DATA FLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Disease Model Induction β
β ββββββββββββββββββββββ β
β [Creates labels] ββββββββββββββββββββββββββ β
β β β
β Treatment β β
β βββββββββ β β
β [Creates labels] ββββββββββββββββββββββββββΌβββββββββββΊ Cohort β
β β ββββββ β
β Outcome Assessment β [Aggregates β
β ββββββββββββββββββ β via lookups] β
β [Creates labels] ββββββββββββββββββββββββββ β β
β β β
β β β
β Hidden (PDF References) β β
β ββββββββββββββββββββββ β β
β [Creates labels] βββββββΊ Outcome Assessment β β
β (PDF Graphs lookup) β β
β β β
β βΌ β
β Experiment β
β ββββββββββ β
β [Aggregates β
β cohorts] β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Appendix: Complete GUID Reference¶
export enum systemAnnotationQuestionGuids {
// Label Questions (create named instances)
diseaseModelInductionLabel = 'bdb6e257-5a08-42ef-aad0-829668679b0e',
treatmentLabel = 'b02e3072-74f0-44e0-a468-f472b3b09991',
outcomeAssessmentLabel = 'dbe2720c-2e08-4f47-bcd0-3fe4ae8b8c7f',
cohortLabel = '62c852ad-3390-48a4-ac13-439bf6b6587f',
experimentLabel = '7c555b6e-1fb6-4036-9982-c09a5db82ace',
pdfReferences = '7ee21ff9-e309-4387-8d30-719201497682',
// Control Questions (is this a control procedure?)
treatmentControl = 'd04ec2d7-3e10-4847-9999-befe7ee4c454',
modelControl = 'b18aa936-a4c6-446b-ac98-88ac38930878',
// Lookup Questions (cross-reference other categories)
cohortDiseaseModels = 'ecb550a5-ed95-473f-84bf-262c9faa7541',
cohortTreatments = 'a3f2e5bb-3ade-4830-bb66-b5550a3cc85b',
cohortOutcomes = '12ecd826-85a4-499a-844c-bd35ea6624ad',
experimentCohorts = 'e7a84ba2-4ef2-4a14-83cb-7decf469d1a2',
outcomePdfGraphs = '016278e8-7e60-40d4-9568-d7fa42670c32',
// Outcome Assessment metadata
outcomeAverageType = '3a287115-5000-4d3f-8c41-7c46fae9adcf',
outcomeErrorType = '8dbea59f-54d2-4e41-87e7-fde9e73a72d5',
outcomeGreaterIsWorse = '45351e04-47b2-4785-9a72-713284e917b8',
outcomeUnits = '66eb1736-a838-4692-a78b-96b0671a377c',
// Cohort specific
cohortNumberOfAnimals = '83caa64f-86a1-4f6e-a278-ebbd25297677',
}