Skip to content

fix LDL explainer text formatting#38

Open
lukaskollmer wants to merge 3 commits into
mainfrom
lukas/ldl-dashboard-explainer
Open

fix LDL explainer text formatting#38
lukaskollmer wants to merge 3 commits into
mainfrom
lukas/ldl-dashboard-explainer

Conversation

@lukaskollmer

Copy link
Copy Markdown
Collaborator

♻️ Current situation & Problem

issue: the LDL explainer text currently renders the list of ranges/scores/etc as a single paragraph, which doesn't exactly look pretty.

⚙️ Release Notes

  • reworked formatting of the in-text LDL scoring explainer

📚 Documentation

n/a

✅ Testing

n/a

Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The English and Spanish LDL explanations were reformatted into Markdown tables, preserving thresholds, scores, and descriptions; the Spanish text also received a typo correction. The English and Spanish blood pressure explanations were converted to tables listing category thresholds and added a note for differing systolic and diastolic categories. The study definition revision increased from 41 to 42.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: reformatting the LDL explainer text.
Description check ✅ Passed The description is clearly related to the LDL explainer formatting changes in this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids`+en-US.md:
- Around line 11-19: Make the LDL units explicit for every range in the tables
at
Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+en-US.md
lines 11-19 and
Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+es-US.md
lines 11-19 by adding mg/dL to the Range column header and removing it from
individual cells, or by including mg/dL consistently in every range; apply the
same approach in both language files.
- Around line 10-12: Add a blank line between the introductory paragraph and the
Markdown table in BloodLipids+en-US.md at lines 10-12, and apply the equivalent
spacing change in BloodLipids+es-US.md at lines 10-12.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9654c2a3-51e8-4572-9ca4-242a87c2f511

📥 Commits

Reviewing files that changed from the base of the PR and between e54d5b3 and cbb925d.

📒 Files selected for processing (2)
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+en-US.md
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+es-US.md

Comment on lines +10 to +12
Our scoring system helps you see your risk at a glance:
| Range | Score | What it means |
| :--------: | :---: | :--------------------------------------------------------------- |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add a blank line before each Markdown table.

The table currently follows the introductory paragraph directly, triggering markdownlint MD058 and risking inconsistent rendering across Markdown processors.

Proposed fix
 Our scoring system helps you see your risk at a glance:
+
 | Range      | Score | What it means                                                    |

Apply the equivalent blank line in the Spanish resource.

📝 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
Our scoring system helps you see your risk at a glance:
| Range | Score | What it means |
| :--------: | :---: | :--------------------------------------------------------------- |
Our scoring system helps you see your risk at a glance:
| Range | Score | What it means |
| :--------: | :---: | :--------------------------------------------------------------- |
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 11-11: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)

📍 Affects 2 files
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+en-US.md#L10-L12 (this comment)
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+es-US.md#L10-L12
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids`+en-US.md
around lines 10 - 12, Add a blank line between the introductory paragraph and
the Markdown table in BloodLipids+en-US.md at lines 10-12, and apply the
equivalent spacing change in BloodLipids+es-US.md at lines 10-12.

Source: Linters/SAST tools

Comment on lines +11 to +19
| Range | Score | What it means |
| :--------: | :---: | :--------------------------------------------------------------- |
| <55 mg/dL | 100 | Excellent; maximal protection, especially for high-risk patients |
| 55–69 | 90 | Very good; ideal for heart disease patients |
| 70–99 | 80 | Optimal for most adults |
| 100–129 | 60 | Slightly above ideal; risk starts to rise |
| 130–159 | 40 | High risk; consider lifestyle changes or medication |
| 160–189 | 20 | Very high risk |
| ≥190 mg/dL | 0 | Severe risk; urgent action needed |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the LDL units explicit for every range.

Only the first and last rows include mg/dL; readers may interpret the middle ranges as unitless. Put the unit in the column header and remove it from individual cells, or include it consistently in every range.

🧰 Tools
🪛 LanguageTool

[style] ~14-~14: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...-risk patients | | 55–69 | 90 | Very good; ideal for heart disease patients ...

(EN_WEAK_ADJECTIVE)

🪛 markdownlint-cli2 (0.23.0)

[warning] 11-11: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)

📍 Affects 2 files
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+en-US.md#L11-L19 (this comment)
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+es-US.md#L11-L19
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids`+en-US.md
around lines 11 - 19, Make the LDL units explicit for every range in the tables
at
Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+en-US.md
lines 11-19 and
Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodLipids+es-US.md
lines 11-19 by adding mg/dL to the Range column header and removing it from
individual cells, or by including mg/dL consistently in every range; apply the
same approach in both language files.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+en-US.md (1)

2-19: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use the source that actually defines these blood pressure categories.

The listed numbers match the AHA/ACC 2017 hypertension guideline thresholds, while the linked WHO fact sheet generally defines hypertension as ≥140/90 mmHg and does not define “Elevated”, “Hyportension stage 1”, or “Hypertension stage 2” with these exact ranges. Update both BloodPressure+en-US.md and BloodPressure+es-US.md to cite AHA/ACC (or another source that clearly defines these categories) instead of the WHO hypertension page.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure`+en-US.md
around lines 2 - 19, The blood pressure category thresholds cite an incompatible
WHO source. Update the links in BloodPressure+en-US.md lines 2-19 and
BloodPressure+es-US.md lines 2-21 to cite the AHA/ACC 2017 guideline, or another
authoritative source that explicitly defines the listed Normal, Elevated,
Hypertension stage 1, and Hypertension stage 2 ranges; leave the category
content unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure`+en-US.md:
- Around line 12-19: Clarify the blood-pressure category rules in both locale
documents: update
Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+en-US.md
(lines 12-19) and
Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+es-US.md
(lines 14-21) to state that Normal and Elevated require both systolic and
diastolic thresholds, while Hypertension stage 1 and stage 2 apply when either
threshold is met.

---

Outside diff comments:
In
`@Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure`+en-US.md:
- Around line 2-19: The blood pressure category thresholds cite an incompatible
WHO source. Update the links in BloodPressure+en-US.md lines 2-19 and
BloodPressure+es-US.md lines 2-21 to cite the AHA/ACC 2017 guideline, or another
authoritative source that explicitly defines the listed Normal, Elevated,
Hypertension stage 1, and Hypertension stage 2 ranges; leave the category
content unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 043246b9-bd7c-4a86-8c0d-ffb80c3696fd

📥 Commits

Reviewing files that changed from the base of the PR and between cbb925d and fb722ef.

📒 Files selected for processing (2)
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+en-US.md
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+es-US.md

Comment on lines +12 to +19
| Category | Systolic (mmHg) | Diastolic (mmHg) |
| :------------------- | :-------------: | :--------------: |
| Normal | <120 | <80 |
| Elevated | 120–129 | <80 |
| Hypertension stage 1 | 130–139 | 80–89 |
| Hypertension stage 2 | ≥140 | ≥90 |

_If your two numbers fall into different categories, the higher category applies._

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
git ls-files | rg 'BloodPressure\+.*(en-US|es-US)\.md$' || true

echo
echo "== en-US file =="
file_en="$(git ls-files | rg 'Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure\+en-US\.md$' | head -n1 || true)"
if [ -n "${file_en:-}" ]; then
  cat -n "$file_en"
fi

echo
echo "== es-US file =="
file_es="$(git ls-files | rg 'Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure\+es-US\.md$' | head -n1 || true)"
if [ -n "${file_es:-}" ]; then
  cat -n "$file_es"
fi

echo
echo "== nearby blood pressure explainer files =="
git ls-files 'Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure*.md' | sort

echo
echo "== search for blood pressure threshold sources/wording in repo =="
rg -n --hidden -i 'Blood Pressure|hypertension|120–129|stage 1|stage 2|WHO|AHA|ACC|higher category|se aplica la categoría' Sources || true

Repository: SchmiedmayerLab/MyHeartCounts-StudyDefinitions

Length of output: 44844


🌐 Web query:

AHA ACC blood pressure categories normal elevated stage 1 stage 2 higher number applies table

💡 Result:

The American Heart Association (AHA) and American College of Cardiology (ACC) classify blood pressure for adults into four distinct categories based on average office blood pressure readings [1][2]. When systolic (the top number) and diastolic (the bottom number) readings fall into two different categories, the higher category is used for classification [3][4]. Blood Pressure Categories Category | Systolic (mm Hg) | | Diastolic (mm Hg) --- | --- | --- | --- Normal | Less than 120 | and | Less than 80 Elevated | 120–129 | and | Less than 80 Stage 1 Hypertension | 130–139 | or | 80–89 Stage 2 Hypertension | 140 or higher | or | 90 or higher In addition to these categories, severe hypertension and hypertensive emergency are defined as a systolic pressure higher than 180 mm Hg and/or a diastolic pressure higher than 120 mm Hg [5][6]. If a patient presents with these readings and symptoms such as chest pain, shortness of breath, back pain, numbness, weakness, vision changes, or difficulty speaking, immediate medical attention is required [5][7]. Clinical guidelines emphasize that individuals with readings in two different categories should always be designated to the higher, more serious category [3][4]. Hypertension treatment decisions are based not only on these category assignments but also on the patient's overall cardiovascular risk profile, including comorbidities and target organ damage [1][8].

Citations:


Clarify the logical operator for each blood-pressure category in both locales.

Normal and elevated categories require both systolic and diastolic thresholds; stage 1 and 2 apply when either threshold is met. State this rule explicitly in Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+en-US.md and the equivalent Spanish text in Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+es-US.md.

📍 Affects 2 files
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+en-US.md#L12-L19 (this comment)
  • Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+es-US.md#L14-L21
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure`+en-US.md
around lines 12 - 19, Clarify the blood-pressure category rules in both locale
documents: update
Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+en-US.md
(lines 12-19) and
Sources/MHCStudyDefinitionExporter/Resources/hhdExplainer/BloodPressure+es-US.md
(lines 14-21) to state that Normal and Elevated require both systolic and
diastolic thresholds, while Hypertension stage 1 and stage 2 apply when either
threshold is met.

@PSchmiedmayer PSchmiedmayer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good to merge; Coderabbit comments might be considered if you want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

2 participants