Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
233 changes: 0 additions & 233 deletions architecture-goals.md

This file was deleted.

108 changes: 103 additions & 5 deletions packages/web/src/ROBINS-I/checklist-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,32 @@ export const INFORMATION_SOURCES = [
'Journal article(s)',
'Study protocol',
'Statistical analysis plan (SAP)',
'Non-commercial registry record (e.g. ClinicalTrials.gov)',
'Company-owned registry record',
'Non-commercial registry record (e.g. ClinicalTrials.gov record)',
'Company-owned registry record (e.g. GSK Clinical Study Register record)',
'Grey literature (e.g. unpublished thesis)',
'Conference abstract(s)',
'Regulatory document (e.g. CSR, approval package)',
'Regulatory document (e.g. Clinical Study Report, Drug Approval Package)',
'Individual participant data',
'Research ethics application',
'Grant database summary (e.g. NIH RePORTER)',
'Grant database summary (e.g. NIH RePORTER, Research Councils UK Gateway to Research)',
'Personal communication with investigator',
'Personal communication with sponsor',
'Other',
];

// Section D: Information sources
export const SECTION_D = {
title: 'Part D: Information Sources',
description:
'Which of the following sources have you obtained to help you inform your risk of bias judgements (tick as many as apply)?',
otherField: {
id: 'otherSpecify',
label: 'Please specify any additional sources not listed above',
placeholder: 'e.g., Additional data sources, correspondence, supplementary materials...',
type: 'textarea',
stateKey: 'otherSpecify',
},
};

// Checklist type definition
export const CHECKLIST_TYPES = {
ROBINS_I: {
Expand All @@ -88,6 +101,50 @@ export const CHECKLIST_TYPES = {
},
};

// Planning Stage: List confounding factors
export const PLANNING_SECTION = {
title: 'The ROBINS-I V2 Tool',
subtitle: 'At planning stage: list confounding factors',
p1: {
id: 'p1',
label: 'P1',
text: 'List the important confounding factors relevant to all or most studies on this topic. Specify whether these are particular to specific intervention-outcome combinations.',
placeholder:
'e.g., Age, baseline disease severity, comorbidities, concomitant medications, socioeconomic status...',
type: 'textarea',
stateKey: 'confoundingFactors',
},
};

// Section A: Specify the result being assessed for risk of bias
export const SECTION_A = {
a1: {
id: 'a1',
label: 'A1',
text: 'Specify the numerical result being assessed',
placeholder: 'e.g., OR = 1.5 (95% CI: 1.2-1.9)',
type: 'textarea',
stateKey: 'numericalResult',
},
a2: {
id: 'a2',
label: 'A2',
text: 'Provide further details about this result (for example, location in the study report, reason it was chosen)',
optional: true,
placeholder: 'e.g., Table 3, primary outcome analysis',
type: 'textarea',
stateKey: 'furtherDetails',
},
a3: {
id: 'a3',
label: 'A3',
text: 'Specify the outcome to which this result relates',
placeholder: 'e.g., All-cause mortality at 12 months',
type: 'textarea',
stateKey: 'outcome',
},
};
Comment on lines +119 to +146
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistency: Missing stateKey properties in SECTION_A.

Unlike SECTION_C (lines 170-193) which includes stateKey for each field, SECTION_A lacks this property. This forces SectionA.jsx to maintain a separate fieldToStateKey mapping (lines 13-17 in SectionA.jsx), creating duplication and potential for errors.

For consistency with SECTION_C and to eliminate the hardcoded mapping in SectionA.jsx, add stateKey to each field:

 export const SECTION_A = {
   a1: {
     id: 'a1',
     label: 'A1',
     text: 'Specify the numerical result being assessed',
     placeholder: 'e.g., OR = 1.5 (95% CI: 1.2-1.9)',
     type: 'textarea',
+    stateKey: 'numericalResult',
   },
   a2: {
     id: 'a2',
     label: 'A2',
     text: 'Provide further details about this result (for example, location in the study report, reason it was chosen)',
     optional: true,
     placeholder: 'e.g., Table 3, primary outcome analysis',
     type: 'textarea',
+    stateKey: 'furtherDetails',
   },
   a3: {
     id: 'a3',
     label: 'A3',
     text: 'Specify the outcome to which this result relates',
     placeholder: 'e.g., All-cause mortality at 12 months',
     type: 'textarea',
+    stateKey: 'outcome',
   },
 };

Then update SectionA.jsx to remove the hardcoded mapping (see comment in SectionA.jsx review).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Section A: Specify the result being assessed for risk of bias
export const SECTION_A = {
a1: {
id: 'a1',
label: 'A1',
text: 'Specify the numerical result being assessed',
placeholder: 'e.g., OR = 1.5 (95% CI: 1.2-1.9)',
type: 'textarea',
},
a2: {
id: 'a2',
label: 'A2',
text: 'Provide further details about this result (for example, location in the study report, reason it was chosen)',
optional: true,
placeholder: 'e.g., Table 3, primary outcome analysis',
type: 'textarea',
},
a3: {
id: 'a3',
label: 'A3',
text: 'Specify the outcome to which this result relates',
placeholder: 'e.g., All-cause mortality at 12 months',
type: 'textarea',
},
};
// Section A: Specify the result being assessed for risk of bias
export const SECTION_A = {
a1: {
id: 'a1',
label: 'A1',
text: 'Specify the numerical result being assessed',
placeholder: 'e.g., OR = 1.5 (95% CI: 1.2-1.9)',
type: 'textarea',
stateKey: 'numericalResult',
},
a2: {
id: 'a2',
label: 'A2',
text: 'Provide further details about this result (for example, location in the study report, reason it was chosen)',
optional: true,
placeholder: 'e.g., Table 3, primary outcome analysis',
type: 'textarea',
stateKey: 'furtherDetails',
},
a3: {
id: 'a3',
label: 'A3',
text: 'Specify the outcome to which this result relates',
placeholder: 'e.g., All-cause mortality at 12 months',
type: 'textarea',
stateKey: 'outcome',
},
};
🤖 Prompt for AI Agents
In packages/web/src/ROBINS-I/checklist-map.js around lines 119 to 143, SECTION_A
entries are missing stateKey properties (unlike SECTION_C), causing SectionA.jsx
to maintain a separate hardcoded field-to-state mapping; add a stateKey to each
a1, a2, and a3 entry (matching the keys used in component state) so the map
includes { id, label, text, placeholder, type, stateKey } and then remove the
hardcoded fieldToStateKey mapping from SectionA.jsx so the component reads
stateKey directly from the checklist map.


// Section B: Decide whether to proceed with a risk-of-bias assessment
export const SECTION_B = {
b1: {
Expand All @@ -109,6 +166,47 @@ export const SECTION_B = {
},
};

// Section C: Specify the (hypothetical) target randomized trial specific to the study
export const SECTION_C = {
description:
"The target randomized trial is either explicitly described by the primary study investigators or implied by the study's design and analysis.",
c1: {
id: 'c1',
label: 'C1',
text: 'Specify the participants and eligibility criteria',
placeholder: 'e.g., Adults aged 18+ with type 2 diabetes, no prior cardiovascular disease',
type: 'textarea',
stateKey: 'participants',
},
c2: {
id: 'c2',
label: 'C2',
text: 'Specify the intervention strategy',
placeholder: 'e.g., Initiation of metformin 500mg twice daily',
type: 'textarea',
stateKey: 'interventionStrategy',
},
c3: {
id: 'c3',
label: 'C3',
text: 'Specify the comparator strategy',
placeholder: 'e.g., Initiation of sulfonylurea therapy',
type: 'textarea',
stateKey: 'comparatorStrategy',
},
c4: {
id: 'c4',
label: 'C4',
text: 'Did the analysis account for switches during follow-up between the intervention strategies being compared, or for other protocol deviations during follow-up?',
type: 'radio',
stateKey: 'isPerProtocol',
options: [
{ value: false, label: 'No (the analysis is estimating the intention-to-treat effect)' },
{ value: true, label: 'Yes (the analysis is estimating the per-protocol effect)' },
],
},
};

// Domain 1A: Bias due to confounding (Intention-to-Treat Effect)
export const DOMAIN_1A = {
id: 'domain1a',
Expand Down
Loading