Clinic Decision Support
Workflow
Every task follows a single general workflow:
- Parse the prompt for the target
case_id and task_id.
- Read
input/payloads/answer_template.json to understand the exact output
schema, required keys, enum values, and safety-check fields.
- Read
environment_access.md for the <TASK_ENV_BASE_URL> and allowed
endpoint list. Use the base URL and endpoint names verbatim.
- Fetch the case:
GET /api/cases/{case_id} and extract the linked
patient_id (may be a direct field or nested under subject.reference).
- Fetch the patient:
GET /api/patients/{patient_id}.
- Fetch supporting clinical data from the relevant endpoints listed in
environment_access.md. Typical sources: observations, imaging, allergies,
medications, problems, protocols, care-registry, and SDoH. See
references/api_reference.md for endpoint and
field details.
- Map the clinical facts to the template using only the allowed enum values.
See references/task_patterns.md for task-family
guidance.
- Populate
evidence_ids with the stable identifiers of every record used
to reach the clinical conclusions (case, observation, imaging, and protocol
identifiers).
- Populate
safety_checks by confirming each boolean assertion against the
fetched data. If a check asks "no X claim", verify that X is genuinely absent
from the record before setting true.
- Output only the JSON object — no markdown fences, no commentary, no
extra top-level keys.
Helper Script
scripts/fetch_case.py fetches a case and its linked
patient in one call. Run it as:
python scripts/fetch_case.py <base_url> <case_id>
It prints the combined case and patient JSON to stdout, resolving patient_id
from either a direct field or a FHIR subject.reference.
Clinical Mapping Rules
Enum Selection
Select only enum values whose clinical conditions are directly evidenced in the
fetched data. Do not guess or extrapolate beyond what the records show.
Observation Filtering
Filter observations by:
- Correct code (e.g.,
"K" for potassium, "SpO2", LOINC codes)
status equal to "final" — ignore "preliminary" and "corrected"
- Linked patient
- Applicable time window when specified
Allergy Awareness
Search allergy records for class keywords: penicillin, sulfonamide/sulfa,
macrolide, tetracycline. Map matches to the corresponding avoid_allergens
enum values in the template.
Evidence Identifiers
Include the case identifier itself plus every observation, imaging, and protocol
identifier that contributed evidence. Use stable, deterministic ordering within
each category.
Safety Checks
For boolean safety fields like no_penicillin_or_sulfa, no_false_loc,
no_normal_cxr_claim, confirm each condition by cross-referencing the relevant
allergy, observation, and imaging records. Set true only when the clinical
data unambiguously supports the claim.
Output Constraints
- Return exactly the JSON object conforming to the template.
- Use
null only where the template explicitly allows it.
- Use controlled enum strings, never free-text prose, for scored fields.
- Do not include markdown fences, comments, or extra top-level keys.
1---2name: clinic-decision-support-43description: Structured clinical decision-support for a synthetic clinic FHIR-like REST API. Use when the task prompt references a synthetic clinic case ID, a task environment base URL, and an answer_template.json payload — typically for protocol-bound assessments involving respiratory, head-injury, potassium replacement, care-management routing, or observation-window retrieval tasks.4metadata:5 source: https://skillmd.com/skills/prism-shadow/clinic-decision-support-46---78# Clinic Decision Support910## Workflow1112Every task follows a single general workflow:13141. **Parse the prompt** for the target `case_id` and `task_id`.152. **Read `input/payloads/answer_template.json`** to understand the exact output16 schema, required keys, enum values, and safety-check fields.173. **Read `environment_access.md`** for the `<TASK_ENV_BASE_URL>` and allowed18 endpoint list. Use the base URL and endpoint names verbatim.194. **Fetch the case**: `GET /api/cases/{case_id}` and extract the linked20 `patient_id` (may be a direct field or nested under `subject.reference`).215. **Fetch the patient**: `GET /api/patients/{patient_id}`.226. **Fetch supporting clinical data** from the relevant endpoints listed in23 `environment_access.md`. Typical sources: observations, imaging, allergies,24 medications, problems, protocols, care-registry, and SDoH. See25 [references/api_reference.md](references/api_reference.md) for endpoint and26 field details.277. **Map the clinical facts to the template** using only the allowed enum values.28 See [references/task_patterns.md](references/task_patterns.md) for task-family29 guidance.308. **Populate `evidence_ids`** with the stable identifiers of every record used31 to reach the clinical conclusions (case, observation, imaging, and protocol32 identifiers).339. **Populate `safety_checks`** by confirming each boolean assertion against the34 fetched data. If a check asks "no X claim", verify that X is genuinely absent35 from the record before setting `true`.3610. **Output only the JSON object** — no markdown fences, no commentary, no37 extra top-level keys.3839## Helper Script4041**[scripts/fetch_case.py](scripts/fetch_case.py)** fetches a case and its linked42patient in one call. Run it as:4344```bash45python scripts/fetch_case.py <base_url> <case_id>46```4748It prints the combined case and patient JSON to stdout, resolving `patient_id`49from either a direct field or a FHIR `subject.reference`.5051## Clinical Mapping Rules5253### Enum Selection5455Select only enum values whose clinical conditions are directly evidenced in the56fetched data. Do not guess or extrapolate beyond what the records show.5758### Observation Filtering5960Filter observations by:61- Correct code (e.g., `"K"` for potassium, `"SpO2"`, LOINC codes)62- `status` equal to `"final"` — ignore `"preliminary"` and `"corrected"`63- Linked patient64- Applicable time window when specified6566### Allergy Awareness6768Search allergy records for class keywords: penicillin, sulfonamide/sulfa,69macrolide, tetracycline. Map matches to the corresponding `avoid_allergens`70enum values in the template.7172### Evidence Identifiers7374Include the case identifier itself plus every observation, imaging, and protocol75identifier that contributed evidence. Use stable, deterministic ordering within76each category.7778### Safety Checks7980For boolean safety fields like `no_penicillin_or_sulfa`, `no_false_loc`,81`no_normal_cxr_claim`, confirm each condition by cross-referencing the relevant82allergy, observation, and imaging records. Set `true` only when the clinical83data unambiguously supports the claim.8485## Output Constraints8687- Return exactly the JSON object conforming to the template.88- Use `null` only where the template explicitly allows it.89- Use controlled enum strings, never free-text prose, for scored fields.90- Do not include markdown fences, comments, or extra top-level keys.