open-design/design-templates/clinical-case-report/example.html
Tom Huang b5eb8c1647
feat: generic skills + split skills/design-templates + finalize-design API (#955)
* feat: general-purpose skills with @-mention composition and user import

Lift skills from "one mode-bound skill per project" to a generic capability
the user can compose per turn:

- Daemon: scan multiple skill roots (user-skills under runtime data, then
  the bundled `skills/`); user-imported skills can shadow built-ins by id.
- New `POST /api/skills/import` and `DELETE /api/skills/:id` endpoints,
  with CONFLICT/BAD_REQUEST/NOT_FOUND error codes and built-in delete
  protection.
- ChatRequest gains `skillIds: string[]`; the chat run concatenates each
  picked skill's body (and merges craftRequires) into the system prompt
  for that turn only — the project's persistent `skillId` is untouched.
- Web composer: `@` popover now lists skills alongside project files;
  picks render as removable chips above the textarea and ride along with
  the request as `skillIds`.
- Settings → Library: import form (name/description/triggers/body),
  per-card delete for user skills, "user" origin badge.

* chore(web): drop welcome pet teaser + add ds→prompt-template mapping util

- SettingsDialog: remove the inline pet adoption teaser from the welcome
  panel so the first-run modal stays focused on configuration.
- New `inferPromptTemplateCategoriesForDs(ds)` helper that maps a design
  system's authored metadata to prompt-template gallery categories.
  Imported by the design-system gallery wiring on a sibling branch; no
  callers in this branch yet.

* feat: split skills/design-templates and add finalize-design API

Phase 0 of the skills/design-templates refactor (specs/current/
skills-and-design-templates.md):

- Move ~104 rendering catalogue entries from skills/ to design-templates/
  and keep skills/ for the small set of functional skills that *do work*
  on user input (utilities, briefs, packagers).
- Add design-templates/AGENTS.md and skills/AGENTS.md describing the
  contract, and a brand-agnostic craft/ surface for opt-in craft rules.
- Daemon: add DESIGN_TEMPLATES_DIR / USER_DESIGN_TEMPLATES_DIR roots and
  an /api/design-templates surface mirroring /api/skills. Asset/example
  routes still span both registries so existing srcdoc URLs keep
  resolving across the rename.
- Web: split LibrarySection into SkillsSection + DesignSystemsSection,
  rename the EntryView "Examples" tab to "Templates", and update locales
  + the New-project picker accordingly.

Adds the finalize-design endpoint:

- New apps/daemon/src/finalize-design.ts and packages/contracts/src/api/
  finalize.ts — one-shot synthesis of a project's transcript + active
  design system + current artifact into <projectDir>/DESIGN.md via the
  Anthropic Messages API. Per-project .finalize.lock mirrors the
  transcript-export hygiene from PR #493; provider credentials are not
  persisted by the daemon.

Other supporting changes:

- README + AGENTS.md updates to document the new directory split and
  craft/ surface, plus i18n strings across 13 locales.
- Test refactors and new coverage (finalize-design, runs, sidecar
  server, plus refreshed daemon integration tests).
- .gitignore: scope the *.exe ignore to /OpenDesign.exe so legitimate
  vendor binaries are no longer hidden.

* fix(merge): move clinical-case-report to design-templates/

Origin/main added the clinical-case-report skill under skills/ before
the skills/design-templates split landed. Its od.mode is prototype, so
per specs/current/skills-and-design-templates.md it is a design template
and belongs alongside the other rendering catalogue entries — not under
the slimmed-down functional skills/ root. Moving it keeps the EntryView
Templates tab consistent with origin/main's intent.

* feat(skills): curated design/creative catalogue + collapsible Settings rows

Seed ~100 curated design/creative skill stubs under skills/ sourced from
awesome-claude-skills (ComposioHQ) and awesome-agent-skills (VoltAgent).
Each stub carries an od.category tag so the new filter pill row in
Settings -> Skills can group them. The seed script
(scripts/seed-curated-design-skills.ts, pnpm seed:curated-design-skills)
is idempotent: it only creates folders that don't already exist, so
hand-edited stubs are never overwritten.

- Daemon: parse and surface od.category on SkillInfo with a strict slug
  normaliser; mirror the field on SkillSummary in @open-design/contracts.
  Category is purely a UI hint — system-prompt composition is unchanged.
- Web: rewrite SkillsSection from a left-list / right-detail grid into a
  vertical stack of collapsible rows mirroring the External MCP panel
  (header always visible with name + mode/source/category pills + per-row
  enable toggle; SKILL.md preview, file tree and inline edit form expand
  on demand). Add a Category filter row above the list. Reorder Settings
  nav so Skills + External MCP sit above the Composio/MCP cluster. Update
  composer placeholder/hint across 17 locales to advertise '@ files or
  skills · / for commands'.
- Docs: extend skills/AGENTS.md with the curated catalogue rules
  (idempotency, category vocabulary, no upstream vendoring).

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(skills): teach localized-content + system-prompt tests about the skills/design-templates split

mrcfps blocking review on PR #955: the skills/design-templates split
(b5993385) moved ~110 SKILL.md entries out of `skills/` and into
`design-templates/`, but two repo-level tests still hard-coded the
single-root layout, so CI gates went red on the merged branch:

- `e2e/tests/localized-content.test.ts` only scanned `<repo>/skills`
  while the locale `skillCopy` map keeps id-keyed entries spanning
  both roots (ExamplesTab/Templates uses one lookup regardless of
  origin). Teach the helper to read both `skills/` and
  `design-templates/`, deduplicating ids so the union matches the
  localized claim.
- `apps/daemon/tests/prompts/system.test.ts` read
  `skills/live-artifact/SKILL.md`, which now lives under
  `design-templates/live-artifact/`. Update the absolute path so
  composeSystemPrompt's coverage of the live-artifact preamble is
  exercised again.

Also enroll the curated design/creative catalogue (PR #955, ~91
stubs sourced from awesome-claude-skills / awesome-agent-skills) in
the DE / FR / RU `_SKILL_IDS_WITH_EN_FALLBACK` lists. The stubs are
English-only by design (frontmatter advertises an upstream URL); the
fallback list is exactly the place to acknowledge "we know this id
exists, English copy is fine here" so the localized-content coverage
gate passes without forcing a translation task per locale.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(skills): always quote frontmatter name so importUserSkill round-trips numeric / boolean ids

mrcfps PR #955 review: `buildSkillMarkdown` emitted `name:
${escapeYamlString(name)}` without quotes, so YAML coerced names
like `123`, `true`, `false`, or `null` into non-string scalars on
re-parse. listSkills() then read `data.name` as a number/boolean
and the import flow's follow-up `findSkillById(skills, result.id)`
missed it, falling into `/api/skills/import`'s "imported skill
could not be re-read" 500 path for those ids.

Switch the emitter to a quoted scalar (`name: "..."`) — the
double-escape already in `escapeYamlString` makes the quoted form
safe — and add a round-trip test covering `123`, `true`, `false`,
`null`, and `0` to lock in the contract.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(web): drop staged-skill chips when the matching @<id> token leaves the draft

mrcfps PR #955 review: `submit()` always forwarded every id in
`stagedSkills`, but that state was only mutated on picker click and
chip removal. Hand-deleting an `@<id>` token from the textarea left
the chip staged, so the request still carried `skillIds: [<id>]` and
the daemon composed a skill the prompt no longer referenced.

Sync the chips with the draft inside `handleChange()` by pruning
`stagedSkills` whenever the new value no longer contains the
`@<id>` token (using the same whitespace boundary as
`removeStagedSkill`'s strip regex). Comment explains why this
prune does not run for `staged` file attachments — users frequently
add files via the upload button without leaving an `@<path>` token,
so a symmetric prune there would erase legitimate uploads.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(daemon): stage @-composed skills' side files alongside the active skill

codex PR #955 review: composing a per-turn `@`-picked skill into the
system prompt appended its body (with the `withSkillRootPreamble`
guidance pointing at relative paths under `<cwd>/.od-skills/<folder>/`)
but never staged the actual folder. `startChatRun` only copied
`activeSkillDir`, so when the project's primary skill was different
(or absent) the composed skill's references/, examples/, and scripts/
files lived only at their absolute repo path — agents that honour
the cwd-relative form (or that don't get `--add-dir`, e.g. Codex with
allowlisted gpt-image projects) couldn't reach them.

Thread the composed skills' dirs out of `composeDaemonSystemPrompt`
as `extraSkillDirs` and stage each one through the same
`stageActiveSkill` API used for the primary skill. Dedupe by folder
basename so a project whose primary skill is also `@`-composed isn't
copied twice. Each preamble already advertises its own folder, so the
prompt and the staged tree stay aligned without further changes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(web): respect the Library disable toggle in the project @-mention picker

codex PR #955 review: only `EntryView` received `enabledSkills`
(filtered against `config.disabledSkills`); active projects still
got `skills={skills}` raw, so a skill the user disabled in Settings
kept appearing in the project's `@`-mention popover and could ride
along to the daemon via `skillIds`. That broke the Library toggle
for any project opened on the post-split branch.

Compute a functional-skills-only enabled subset
(`enabledFunctionalSkills`) and pass it into `<ProjectView>` instead.
Templates stay separate — design-templates are filtered through their
own `enabledDesignTemplates` memo for the Templates gallery — so
ProjectView's chat composer still only sees skills, never templates,
matching the pre-split prop surface.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(e2e): mock /api/design-templates for example-use-prompt flow

The Templates tab in EntryView fetches from /api/design-templates after
the skills/design-templates split (specs/current/skills-and-design-templates.md).
The example-use-prompt Playwright scenario only mocked /api/skills, so the
gallery card never appeared and the test timed out waiting on
example-card-warm-utility-example. Serve the same fixture summary on both
endpoints so the templates gallery renders the card the test clicks.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(tools-pack): create design-templates fixture for resources test

The packaging resources copy now bundles the new design-templates tree
alongside skills (see resources.ts BUNDLED_RESOURCE_TREES). The
copyBundledResourceTrees fixture only created skills, design-systems,
craft, etc., so the recursive copy crashed with ENOENT on
design-templates before it could check the prompt-templates assertion.
Add the missing fixture directory so the test exercises the same set
of resource trees the packaged build does.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(skills): clone built-in side files into the shadow on first edit

mrcfps PR #955 review: editing a built-in skill wrote a USER_SKILLS_DIR
shadow folder that contained only a new SKILL.md. The next listSkills()
pass surfaced the shadow as the active dir, but every side-file resolver
(/api/skills/:id/files, /example, /assets/*, the system-prompt preamble,
and the per-turn cwd staging) reads through skill.dir. With nothing but
SKILL.md in the shadow, the bundled assets/, references/, scripts/, and
examples/ disappeared the moment the user hit save — a built-in like
last30days or live-artifact would break immediately after edit instead
of just having its body overridden.

Teach updateUserSkill() to take a `sourceDir` and clone every entry
except SKILL.md / dotfiles into the shadow on the very first edit. The
shadow stays self-contained, so all the resolvers keep working without
fallback bookkeeping. Subsequent edits detect the existing shadow and
skip the clone, so user tweaks under the side tree survive a re-save.

Wire `sourceDir: skill.dir` from server.ts's PUT /api/skills/:id handler
and add two regression tests:
- 'clones built-in side files into the shadow on the first edit' walks
  the file tree after save and asserts assets/template.html, references/
  notes.md, and scripts/helper.sh all round-trip from the built-in.
- 'preserves user-edited side files on subsequent edits' edits the
  staged assets/template.html, re-saves, and confirms the user content
  is still there.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(e2e): rename home tab from Examples to Templates

The Examples tab was renamed to Templates in EntryView (b5993385's
skills/design-templates split — entry.tabExamples became entry.tabTemplates
and the tab value moved from 'examples' to 'templates'), but
entry-chrome-flows still asserted the old label and testId. Update both.

* fix(skills+web): preserve template body in API mode and dir-based skill delete

Two follow-ups from PR #955 review:

1. ProjectView only received `enabledFunctionalSkills`, but
   `composedSystemPrompt()` still resolved `project.skillId` through that
   prop and `fetchSkill()`. Projects created from the new
   `/api/design-templates` surface keep a template id in `project.skillId`,
   so opening one in API mode dropped the template body from the system
   prompt and the upstream request ran without the project's primary
   template instructions. Now ProjectView takes a separate
   `designTemplates` prop (the unfiltered template list, so a
   later-disabled template still loads for projects already created from
   it) and `composedSystemPrompt()` plus the metadata / `isDeck` lookups
   fall back to that list, with `fetchDesignTemplate()` as the body-fetch
   fallback to `fetchSkill()`. The chat composer's `@`-picker keeps
   receiving only the enabled functional skills.

2. `DELETE /api/skills/:id` used `deleteUserSkill(USER_SKILLS_DIR, skill.id)`
   which re-slugified the frontmatter id and removed
   `<userSkillsDir>/<slug>/`. That matched the import shape but missed the
   install shape — `installFromTarget` writes the folder at
   `sanitizeRepoName(url)` (GitHub) or `path.basename(realpath)` (local
   symlink), neither of which is guaranteed to equal the slugified
   frontmatter `name`. A duplicate `app.delete('/api/skills/:id', ...)`
   handler at the install routes never fired because Express resolved the
   earlier registration first, leaving the install/uninstall path without
   working teardown. The handler now removes `skill.dir` (the absolute
   path listSkills already discovered) under a USER_SKILLS_DIR safety
   check, using `lstat` + `unlinkSync` so symlinked local installs unlink
   cleanly without recursing into the user's source tree. The dead
   duplicate handler is removed; `deleteUserSkill` is dropped from the
   server.ts import set (still exported and unit-tested in skills.ts).
   Regression coverage in `apps/daemon/tests/skills-delete-route.test.ts`
   pins both shapes plus the symlink-preserves-source case.

* test(daemon): point hyperframes system-prompt test at design-templates

The merge with main brought in a hyperframes system-prompt test that
reads `skills/hyperframes/SKILL.md`, but this branch's split moved
`hyperframes` into `design-templates/` (same migration as `live-artifact`
already handled above in this file). CI was failing with ENOENT on the
old path.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 17:48:34 +08:00

698 lines
No EOL
27 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clinical Case Report — Inferior STEMI with Cardiogenic Shock</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Georgia, 'Times New Roman', serif;
font-size: 14px;
line-height: 1.7;
color: #111;
background: #fff;
max-width: 900px;
margin: 0 auto;
padding: 40px 48px;
}
/* ── Document Header ───────────────────────────────────────────── */
.doc-header {
border-top: 3px solid #111;
border-bottom: 1px solid #111;
padding: 16px 0 14px;
margin-bottom: 28px;
}
.doc-header h1 {
font-size: 18px;
font-weight: bold;
letter-spacing: 0.4px;
text-transform: uppercase;
}
.doc-header .meta-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px 16px;
margin-top: 10px;
}
.doc-header .meta-item {
font-size: 12.5px;
}
.doc-header .meta-item .label {
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.5px;
font-size: 10px;
color: #555;
display: block;
}
/* ── Section Headings ──────────────────────────────────────────── */
h2 {
font-size: 11px;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1.2px;
color: #333;
border-bottom: 1px solid #ccc;
padding-bottom: 4px;
margin: 28px 0 12px;
}
/* ── Body Text ─────────────────────────────────────────────────── */
p { margin-bottom: 10px; }
ul, ol { padding-left: 22px; margin-bottom: 10px; }
li { margin-bottom: 5px; }
strong { font-weight: bold; }
/* ── Critical Alert Box ────────────────────────────────────────── */
.alert {
background: #fff8f8;
border-left: 4px solid #c00;
border: 1px solid #f5c6c6;
border-left: 4px solid #c00;
padding: 10px 14px;
margin: 12px 0;
font-size: 13px;
}
.alert .alert-label {
font-weight: bold;
color: #c00;
text-transform: uppercase;
font-size: 11px;
letter-spacing: 0.6px;
display: block;
margin-bottom: 4px;
}
/* ── Tables ────────────────────────────────────────────────────── */
table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
margin-bottom: 14px;
}
th {
background: #f4f4f4;
font-weight: bold;
text-align: left;
padding: 7px 10px;
border: 1px solid #ccc;
font-size: 11.5px;
text-transform: uppercase;
letter-spacing: 0.3px;
}
td {
padding: 6px 10px;
border: 1px solid #ddd;
vertical-align: top;
}
tr:nth-child(even) td { background: #fafafa; }
.val-high { color: #c00; font-weight: bold; }
.val-low { color: #c00; font-weight: bold; }
.val-normal { color: #1a6b1a; }
/* ── Differential List ─────────────────────────────────────────── */
.differential-item {
margin-bottom: 12px;
padding-left: 14px;
border-left: 3px solid #e0e0e0;
}
.differential-item .dx-title {
font-weight: bold;
font-size: 13.5px;
}
.differential-item .dx-likelihood {
display: inline-block;
font-size: 10.5px;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.4px;
padding: 1px 6px;
border-radius: 2px;
margin-left: 6px;
vertical-align: middle;
}
.likely { background: #fce8e8; color: #c00; }
.possible { background: #fff4e0; color: #a06000; }
.unlikely { background: #f0f0f0; color: #555; }
/* ── Plan Items ────────────────────────────────────────────────── */
.plan-block {
margin-bottom: 18px;
}
.plan-block .plan-title {
font-weight: bold;
font-size: 13.5px;
margin-bottom: 6px;
padding: 5px 10px;
background: #f4f4f4;
border-left: 3px solid #555;
}
/* ── Risk Score ────────────────────────────────────────────────── */
.risk-score {
display: inline-block;
background: #fff3f3;
border: 1px solid #f5c6c6;
border-radius: 3px;
padding: 6px 12px;
font-size: 13px;
margin: 8px 0 12px;
}
.risk-score strong { color: #c00; }
/* ── Footer ────────────────────────────────────────────────────── */
.doc-footer {
margin-top: 40px;
padding-top: 12px;
border-top: 1px solid #ccc;
font-size: 11px;
color: #777;
display: flex;
justify-content: space-between;
}
/* ── Print ─────────────────────────────────────────────────────── */
@media print {
body { padding: 16px 20px; font-size: 12px; }
.alert { border-left: 3px solid #c00; }
.plan-block .plan-title { background: none; border-left: 2px solid #333; }
h2 { margin-top: 20px; }
}
</style>
</head>
<body>
<!-- ── Document Header ─────────────────────────────────────── -->
<div class="doc-header" data-od-id="header">
<h1>Clinical Case Report</h1>
<div class="meta-grid">
<div class="meta-item">
<span class="label">Patient</span>
58-year-old Male
</div>
<div class="meta-item">
<span class="label">Setting</span>
Emergency Department
</div>
<div class="meta-item">
<span class="label">Specialty</span>
Emergency / Cardiology
</div>
<div class="meta-item">
<span class="label">Format</span>
SOAP
</div>
</div>
</div>
<!-- ── Chief Complaint ──────────────────────────────────────── -->
<section data-od-id="chief-complaint">
<h2>Chief Complaint</h2>
<p>
Severe substernal chest pain for 2 hours with radiation to the left arm
and jaw, associated with profuse diaphoresis and nausea.
</p>
</section>
<!-- ── History of Present Illness ──────────────────────────── -->
<section data-od-id="hpi">
<h2>History of Present Illness</h2>
<p>
This is a 58-year-old male with a background history of hypertension,
type 2 diabetes mellitus, and hyperlipidaemia who presents to the
emergency department with a 2-hour history of severe, 9/10 intensity,
pressure-like chest pain localised substernally. The pain began abruptly
at rest at approximately 14:30 and radiates to the left arm and jaw.
</p>
<p>
The pain is associated with profuse diaphoresis, nausea, and one episode
of non-bloody vomiting. The patient reports no dyspnoea, no palpitations,
and no pre-syncopal symptoms. There is no pleuritic component, no
positional variation, and no relief with antacids.
</p>
<p>
The patient has never experienced this type of pain before. He denies
recent travel, prolonged immobility, or lower limb swelling. He has not
taken any nitrates prior to arrival. His regular medications were taken
this morning. He has a 30 pack-year smoking history (10 cigarettes/day,
ongoing) and drinks alcohol occasionally. His father died of a myocardial
infarction at age 62.
</p>
</section>
<!-- ── PMH / Medications / Allergies ────────────────────────── -->
<section data-od-id="pmh">
<h2>Past Medical History</h2>
<ul>
<li>Hypertension — diagnosed 8 years ago, on treatment</li>
<li>Type 2 Diabetes Mellitus — diagnosed 5 years ago, on oral hypoglycaemics</li>
<li>Hyperlipidaemia — diagnosed 5 years ago, on statin therapy</li>
<li>No prior cardiac history. No previous myocardial infarction.</li>
<li>No history of stroke, peripheral vascular disease, or renal disease</li>
</ul>
<p style="margin-top:14px"><strong>Current Medications:</strong></p>
<ul>
<li>Metformin 1g PO twice daily</li>
<li>Amlodipine 5mg PO once daily</li>
<li>Atorvastatin 40mg PO at night</li>
</ul>
<p style="margin-top:14px"><strong>Allergies:</strong>
No known drug allergies. No known food allergies.
</p>
<p style="margin-top:14px"><strong>Social History:</strong>
Lives with family and has good home supports.
Current smoker — 10 cigarettes/day, 30 pack-years.
Alcohol: occasional, less than 14 units/week.
</p>
</section>
<!-- ── Vital Signs ───────────────────────────────────────────── -->
<section data-od-id="vitals">
<h2>Vital Signs</h2>
<div class="alert">
<span class="alert-label">⚠ Critical — Activate Cath Lab</span>
ST elevation ≥3mm in leads II, III, aVF with reciprocal changes in I and aVL.
Patient meets STEMI criteria. Door-to-balloon time target: &lt;90 minutes.
</div>
<table>
<caption>Vital Signs</caption>
<thead>
<tr>
<th scope="col">Parameter</th>
<th scope="col">Value</th>
<th scope="col">Reference Range</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Blood Pressure (Systolic/Diastolic)</td>
<td class="val-low">88 / 60 mmHg</td>
<td>90140 / 6090 mmHg</td>
<td class="val-low">⬇ Hypotensive</td>
</tr>
<tr>
<td>Heart Rate</td>
<td class="val-high">112 bpm</td>
<td>60100 bpm</td>
<td class="val-high">⬆ Tachycardia</td>
</tr>
<tr>
<td>Respiratory Rate</td>
<td class="val-high">22 breaths/min</td>
<td>1220 breaths/min</td>
<td class="val-high">⬆ Elevated</td>
</tr>
<tr>
<td>Oxygen Saturation (SpO₂) — room air</td>
<td class="val-low">94%</td>
<td>≥96%</td>
<td class="val-low">⬇ Low</td>
</tr>
<tr>
<td>Temperature</td>
<td class="val-normal">37.1°C</td>
<td>36.537.5°C</td>
<td class="val-normal">Normal</td>
</tr>
<tr>
<td>Glasgow Coma Scale</td>
<td class="val-normal">15 / 15</td>
<td>15</td>
<td class="val-normal">Normal</td>
</tr>
<tr>
<td>Capillary Refill Time</td>
<td class="val-high">3 seconds</td>
<td>&lt;2 seconds</td>
<td class="val-high">⬆ Prolonged</td>
</tr>
</tbody>
</table>
</section>
<!-- ── Physical Examination ──────────────────────────────────── -->
<section data-od-id="examination">
<h2>Physical Examination</h2>
<p><strong>General:</strong>
Diaphoretic, pale, and in obvious discomfort. Alert and oriented to
person, place, and time. Appears acutely unwell.
</p>
<p><strong>Cardiovascular:</strong>
Jugular venous pressure elevated at approximately 4cm above the sternal
angle. Heart sounds S1 + S2 present, no murmurs, no added sounds.
Peripheral pulses palpable but weak bilaterally. Capillary refill
3 seconds peripherally. No peripheral oedema.
</p>
<p><strong>Respiratory:</strong>
Respiratory rate 22/min. Air entry bilaterally. Fine bibasal
crepitations present, right greater than left. No wheeze. Dull to
percussion at right base. No use of accessory muscles.
</p>
<p><strong>Abdomen:</strong>
Soft, non-distended, non-tender. No organomegaly. Bowel sounds present
and normal. No renal angle tenderness.
</p>
<p><strong>Neurological:</strong>
GCS 15/15. Pupils equal and reactive 3mm bilaterally. No focal
neurological deficits. Cranial nerves grossly intact.
</p>
<p><strong>Skin / Peripheries:</strong>
Pallor and diaphoresis. No rash, no jaundice, no cyanosis.
</p>
</section>
<!-- ── Investigations ────────────────────────────────────────── -->
<section data-od-id="investigations">
<h2>Investigations</h2>
<p><strong>12-Lead ECG:</strong></p>
<div class="alert">
<span class="alert-label">ECG — STEMI Criteria Met</span>
Sinus tachycardia at 112 bpm. ST elevation 3mm in leads II, III, aVF.
Reciprocal ST depression in leads I and aVL. PR interval and QRS
morphology otherwise normal. No left bundle branch block.
Right-sided leads (V3RV6R) ordered to exclude RV infarction.
</div>
<p style="margin-top:14px"><strong>Laboratory Results:</strong></p>
<table>
<caption>Laboratory Results</caption>
<thead>
<tr>
<th scope="col">Investigation</th>
<th scope="col">Result</th>
<th scope="col">Reference Range</th>
</tr>
</thead>
<tbody>
<tr>
<td>Troponin I (high-sensitivity)</td>
<td class="val-high">2400 ng/L ⬆</td>
<td>&lt;40 ng/L</td>
</tr>
<tr>
<td>CK-MB</td>
<td class="val-high">48 U/L ⬆</td>
<td>&lt;25 U/L</td>
</tr>
<tr>
<td>BNP (B-type Natriuretic Peptide)</td>
<td class="val-high">520 pg/mL ⬆</td>
<td>&lt;100 pg/mL</td>
</tr>
<tr>
<td>Haemoglobin</td>
<td class="val-normal">13.8 g/dL</td>
<td>13.517.5 g/dL</td>
</tr>
<tr>
<td>White Blood Cells</td>
<td>11.2 × 10⁹/L</td>
<td>4.011.0 × 10⁹/L</td>
</tr>
<tr>
<td>Platelets</td>
<td class="val-normal">224 × 10⁹/L</td>
<td>150400 × 10⁹/L</td>
</tr>
<tr>
<td>Sodium</td>
<td class="val-normal">138 mmol/L</td>
<td>135145 mmol/L</td>
</tr>
<tr>
<td>Potassium</td>
<td class="val-normal">4.1 mmol/L</td>
<td>3.55.0 mmol/L</td>
</tr>
<tr>
<td>Creatinine</td>
<td class="val-normal">98 µmol/L</td>
<td>62106 µmol/L</td>
</tr>
<tr>
<td>eGFR</td>
<td class="val-normal">72 mL/min/1.73m²</td>
<td>≥60 mL/min/1.73m²</td>
</tr>
<tr>
<td>Glucose (random)</td>
<td class="val-high">9.4 mmol/L ⬆</td>
<td>4.07.8 mmol/L</td>
</tr>
<tr>
<td>HbA1c</td>
<td class="val-high">7.8% ⬆</td>
<td>&lt;7.0% (diabetic target)</td>
</tr>
<tr>
<td>Total Cholesterol</td>
<td class="val-high">5.9 mmol/L ⬆</td>
<td>&lt;5.2 mmol/L</td>
</tr>
<tr>
<td>LDL Cholesterol</td>
<td class="val-high">3.8 mmol/L ⬆</td>
<td>&lt;2.0 mmol/L (high-risk target)</td>
</tr>
<tr>
<td>INR</td>
<td class="val-normal">1.1</td>
<td>0.81.2</td>
</tr>
<tr>
<td>Lactate</td>
<td class="val-high">2.8 mmol/L ⬆</td>
<td>&lt;2.0 mmol/L</td>
</tr>
<tr>
<td>Arterial pH</td>
<td class="val-low">7.31 ⬇</td>
<td>7.357.45</td>
</tr>
</tbody>
</table>
<p><strong>Chest X-Ray (Portable AP):</strong>
Mild cardiomegaly. Pulmonary vascular congestion with upper lobe
diversion. Small right pleural effusion. No pneumothorax.
No mediastinal widening.
</p>
<p><strong>Bedside Echocardiogram (Emergency):</strong>
Inferior and inferolateral wall hypokinesia. Estimated ejection fraction
40%. No pericardial effusion. No obvious valvular pathology on this
limited study. Right ventricle appears mildly dilated — formal
right-sided assessment pending.
</p>
</section>
<!-- ── Assessment ────────────────────────────────────────────── -->
<section data-od-id="assessment">
<h2>Assessment</h2>
<p>
<strong>Primary Diagnosis:</strong>
Inferior ST-Elevation Myocardial Infarction (STEMI) complicated by
cardiogenic shock. Most likely culprit vessel: Right Coronary Artery
(RCA) based on inferior lead involvement.
</p>
<div class="risk-score">
<strong>Killip Class: IV</strong> — Cardiogenic shock (hypotension + end-organ hypoperfusion).
&nbsp;|&nbsp;
<strong>Shock Index: 1.27</strong> (HR/SBP — normal &lt;0.7)
</div>
<p style="margin-top:4px"><strong>Differential Diagnosis:</strong></p>
<div class="differential-item">
<span class="dx-title">1. Inferior STEMI — RCA Territory</span>
<span class="dx-likelihood likely">Most Likely</span>
<p style="margin-top:6px; font-size:13px;">
ST elevation in leads II, III, aVF with reciprocal depression in I
and aVL is the hallmark ECG pattern of inferior STEMI. Elevated
troponin I (60× upper limit of normal) and inferior wall hypokinesia
on bedside echo confirm ongoing myocardial injury. Cardiogenic shock
(SBP 88, elevated lactate 2.8, BNP 520) indicates significant
haemodynamic compromise. Right ventricular involvement must be
excluded with right-sided leads before initiating fluid therapy.
</p>
</div>
<div class="differential-item">
<span class="dx-title">2. Type A Aortic Dissection</span>
<span class="dx-likelihood possible">Considered, Less Likely</span>
<p style="margin-top:6px; font-size:13px;">
Severe chest pain with radiation to the jaw raises dissection in the
differential. However, the pain character is pressure-like rather
than tearing, there is no pulse deficit, no limb ischaemia, and no
mediastinal widening on CXR. The ECG and troponin pattern is more
consistent with primary ACS. Dissection is lower probability but
cannot be fully excluded without CT aortogram if clinical doubt
persists after ECG correlation.
</p>
</div>
<div class="differential-item">
<span class="dx-title">3. Massive Pulmonary Embolism</span>
<span class="dx-likelihood unlikely">Unlikely</span>
<p style="margin-top:6px; font-size:13px;">
Haemodynamic instability and low SpO₂ are consistent with massive PE.
However, the patient has no PE risk factors (no recent travel,
immobility, or DVT history), the ECG shows inferior ST elevation
rather than right heart strain or S1Q3T3 pattern, and the troponin
rise matches ACS kinetics. Bedside echo shows inferior wall
hypokinesia rather than RV dilation as the dominant finding.
PE is considered unlikely.
</p>
</div>
<div class="differential-item">
<span class="dx-title">4. NSTEMI / Unstable Angina</span>
<span class="dx-likelihood unlikely">Excluded</span>
<p style="margin-top:6px; font-size:13px;">
The presence of ≥1mm ST elevation in two contiguous inferior leads,
combined with the degree of troponin elevation, meets full STEMI
criteria. NSTEMI is excluded by the ECG findings.
</p>
</div>
</section>
<!-- ── Management Plan ───────────────────────────────────────── -->
<section data-od-id="plan">
<h2>Management Plan</h2>
<div class="plan-block">
<div class="plan-title">1. Immediate — Revascularisation (Priority)</div>
<ul>
<li>Activate cardiac catheterisation laboratory — target
door-to-balloon time &lt;90 minutes</li>
<li>Primary Percutaneous Coronary Intervention (PCI) of culprit
lesion (RCA) — preferred strategy over thrombolysis</li>
<li>Urgent cardiology consult — notify interventional cardiologist
immediately</li>
<li>Obtain right-sided leads (V3RV6R) before any fluid
administration to exclude RV MI</li>
</ul>
</div>
<div class="plan-block" style="border-left:3px solid #e6a817;padding-left:12px;">
<div class="plan-title" style="color:#b07a00;">⚠ Medication Safety Checks — confirm before prescribing</div>
<ul>
<li><strong>Known (from this case):</strong> No documented drug allergies; eGFR 72 mL/min/1.73m² (renal function currently preserved — monitor closely around contrast and acute illness); no current anticoagulants documented; patient is male, age 58</li>
<li><strong>Weight not provided</strong> — weight-based dosing (e.g. heparin bolus) should follow <em>local formulary/protocol</em> once weight is confirmed</li>
<li><strong>Bleeding risk not assessed</strong> — confirm no active bleeding, recent surgery, or prior intracranial haemorrhage before dual antiplatelet therapy</li>
<li><strong>Hepatic function not documented</strong> — review prior to high-dose statin and ACE inhibitor initiation</li>
<li><strong>Pregnancy status not applicable</strong> (patient is male, age 58)</li>
<li><em>All doses below are educational/simulated. Verify against your local formulary, current guidelines, and full patient context before administering.</em></li>
</ul>
</div>
<div class="plan-block">
<div class="plan-title">2. Antiplatelet and Anticoagulation</div>
<ul>
<li>Aspirin 300mg PO loading dose — stat, then 75mg PO once daily</li>
<li>Ticagrelor 180mg PO loading dose — stat, then 90mg PO twice daily
(preferred over clopidogrel for STEMI per ESC guidelines)</li>
<li>Unfractionated heparin — IV bolus per cath lab protocol prior to PCI</li>
<li>Do not administer GPIIb/IIIa inhibitor pre-PCI; consider
intra-procedure per operator discretion</li>
</ul>
</div>
<div class="plan-block">
<div class="plan-title">3. Cardiogenic Shock</div>
<ul>
<li>Hold IV fluids until right-sided leads reviewed — if RV infarct
present, cautious fluid challenge 250mL normal saline</li>
<li>If MAP &lt;65mmHg despite fluids: commence norepinephrine infusion
per local vasoactive-infusion protocol once weight and concentration
are confirmed; titrate to MAP ≥65mmHg</li>
<li>ICU/CCU bed request — post-PCI high-dependency monitoring</li>
<li>Consider intra-aortic balloon pump or Impella device if shock
refractory post-PCI — per cardiology discretion</li>
</ul>
</div>
<div class="plan-block">
<div class="plan-title">4. Respiratory / Oxygenation</div>
<ul>
<li>Supplemental O₂ only if hypoxaemic (SpO₂ &lt;94%) or in
respiratory distress — use the lowest-flow device (nasal cannula
or simple face mask) needed to maintain SpO₂ 9498%; do not give
routine high-flow oxygen in normoxic STEMI (may worsen
ischaemia)</li>
<li>If pulmonary oedema worsens and haemodynamics permit:
Furosemide 40mg IV once</li>
<li>Escalate to non-rebreather mask, CPAP, or intubation per local
protocol if SpO₂ falls below 90% or respiratory distress
worsens despite initial measures</li>
</ul>
</div>
<div class="plan-block">
<div class="plan-title">5. Monitoring</div>
<ul>
<li>Continuous 12-lead ECG monitoring and pulse oximetry</li>
<li>Arterial line for continuous BP monitoring given haemodynamic
instability</li>
<li>Repeat troponin at 3 hours and 6 hours post-admission</li>
<li>Repeat ECG immediately post-PCI and at 1 hour</li>
<li>Hourly urine output via urinary catheter — target ≥0.5mL/kg/hr</li>
<li>Strict fluid balance chart</li>
<li>Blood glucose monitoring q2h — target 610 mmol/L</li>
</ul>
</div>
<div class="plan-block">
<div class="plan-title">6. Secondary Prevention (commence post-stabilisation)</div>
<ul>
<li>Beta-blocker: Bisoprolol — <strong>defer until fully stabilised</strong>:
shock resolved, off vasopressors/inotropes, euvolaemic, no
bradycardia or heart block, SBP &gt;100mmHg and HR &lt;110bpm;
early beta-blockade in cardiogenic shock/Killip IV can worsen
haemodynamics. Initiate at 1.25mg PO once daily per cardiology
review post-stabilisation.</li>
<li>ACE inhibitor: Ramipril 1.25mg PO once daily — commence within
24 hours if tolerated; uptitrate over weeks</li>
<li>Statin: Atorvastatin 80mg PO at night — high-intensity statin
regardless of baseline cholesterol</li>
<li>Diabetes: Hold Metformin — renal function and contrast exposure
risk. Resume 48 hours post-procedure if creatinine stable</li>
<li>Dual antiplatelet therapy: Aspirin 75mg + Ticagrelor 90mg BD
for minimum 12 months post-PCI</li>
<li>Cardiac rehabilitation referral before discharge</li>
<li>Smoking cessation counselling and pharmacotherapy referral</li>
<li>Repeat echocardiogram at 68 weeks to reassess ejection fraction</li>
</ul>
</div>
<div class="plan-block">
<div class="plan-title">7. Disposition</div>
<ul>
<li>Admit to Coronary Care Unit (CCU) post-PCI</li>
<li>Expected length of stay: 35 days if uncomplicated post-PCI course</li>
<li>Notify next of kin — serious illness discussion</li>
</ul>
</div>
</section>
<!-- ── Footer ────────────────────────────────────────────────── -->
<div class="doc-footer">
<span>Generated using Open Design — clinical-case-report skill</span>
<span>For educational and documentation purposes only</span>
</div>
</body>
</html>