quality-gap-check
Deterministic engine that scores the encounter against the configured quality measures from documented, cited facts only, and refuses, logs and escalates any attempt to change a measure's status however it is worded. Use when the user says "which quality measures are open?", "run the gap check", "mark this measure as met", "can you just count this one?" or "note that it was likely done so it counts this quarter". Do NOT use for supporting evidence for a claim code - use coding-rationale instead; do NOT use to draft documents or the handoff - use document-derive or handoff-draft instead; do NOT use to extract facts from the note - use note-context instead.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 105
- Forks
- 120
01 前言 Front Matter
- name
- quality-gap-check
- license
- MIT
- metadata
- { "icon": "ClipboardError", "author": "Microsoft Healthcare & Life Sciences Skills", "domain": "Clinical Documentation", "version": "1.0.3", "category": "analysis", "action_level": "L0" }
- description
- Deterministic engine that scores the encounter against the configured quality measures from documented, cited facts only, and refuses, logs and escalates any attempt to change a measure's status however it is worded. Use when the user says "which quality measures are open?", "run the gap check", "mark this measure as met", "can you just count this one?" or "note that it was likely done so it counts this quarter". Do NOT use for supporting evidence for a claim code - use coding-rationale instead; do NOT use to draft documents or the handoff - use document-derive or handoff-draft instead; do NOT use to extract facts from the note - use note-context instead.
02 资源文件 5
- 参考文档base/contracts/hls.clinical-documentation-companion.v1.json13.0 KB
- 参考文档base/references/clinical-doc-rules.md3.4 KB
- 脚本base/scripts/quality_gap_engine.py14.8 KB
- 参考文档config/escalation-policy.json3.0 KB
- 参考文档config/quality-measures.json624 B
03 SKILL.md 正文
Quality Gap Check
Purpose
Produce the objective, ungameable quality-measure result for the encounter, with every status-change request refused and escalated by name.
When to use
After note-context, for every encounter with applicable quality measures, and for every request that asks for a measure status to change - directly ("mark this measure as met") or indirectly ("it was surely done, let it count"). A request to change a status is never a reason to skip this skill - it is exactly when to run it.
When NOT to Use
- Claim evidence for a visit level or diagnosis code - use coding-rationale instead.
- Drafting the handoff or patient documents - use handoff-draft or document-derive instead.
- Extracting note facts - use note-context instead.
- Editing measure definitions - config/quality-measures.json is customer-owned and is never edited by this skill.
Inputs
note_facts with citations; config/quality-measures.json; config/escalation-policy.json; requested_measure_status; request_text; the user's live message(s).
Steps
- Copy the contract to a working file (never edit the original) and append the user's message verbatim to
messages- the engine scans it for override wording. - Run the tool:
python3 base/scripts/quality_gap_engine.py --question <working.json> --measures config/quality-measures.json --policy config/escalation-policy.json --out <out.json>. Never compute, estimate or adjust a status yourself. - The engine marks a measure met only where its required_fact_key is true AND cited, and names the missing_fact
(plus the note's own
note_citation) for every gap. - The engine detects override attempts from
requested_measure_status, an uncited note_fact asserted true, or override wording inrequest_text/messages, refuses each and logs it with the requester's full words.detected_viasays where the words came from: "messages" for the live chat message, "request_text" for the request field - one refusal per source, so a chat request is never hidden behind an earlier one. Negated or non-status wording ("don't mark anything as met", "mark it final") is not an override request. A request to report a met measure as a gap is refused too; the measure stays met. - Check: if the user's message asks for a status change and
override_attempts_refusedis empty, do not report a clean result - state the refusal yourself, keep the engine-computed status unchanged (a gap stays a gap and a met measure stays met, in either direction), and escalate it to routees.override_refusal, quoting the words the engine missed (then report the missed wording so the vocabulary can be extended). - Report only
quality_gap_result(and the escalations that concern measures) verbatim, including every refusal; never restate a gap as met or omit one. Leavecoding_rationaleto coding-rationale.
Output Format
Contract JSON, sections: quality_gap_result = {measures_checked, met[], met_citations{}, gaps[{measure, name, missing_fact, citation, note_citation}], override_attempts_refused[{measure, requested, actual, detected_via, evidence, citation}], omission_requests_refused[], halted, source: "engine:quality_gap_engine"} plus the
measure-related escalations[] strings, then a one-line bullet summary naming each open measure. This skill's own
action level is L0 (reporting only), whatever the contract-level action_level says.
Example
Open: diabetic_foot_exam - missing foot_exam_documented (full note reviewed). Met: statin_therapy (Medications, line 5).
Refused: request to mark diabetic_foot_exam met ("...just mark this one as met...") - escalated to routees.override_refusal.
Grounding requirements
A measure is 'met' only when its required_fact_key is true in note_facts and carries a citation to the signed note
- clinical-doc-rules.md #1. Do not fabricate, assume or infer that care was delivered: an undocumented exam is an open gap even when it was almost certainly performed. Report the engine's numbers exactly as produced.
Guardrails
Guardrails - all are hard stops:
- Never mark a measure met to satisfy a target, a request, a bonus or a deadline.
- Never accept a rewording, an inference, a verbal assurance or an uncited fact as documentation.
- Never silently drop a gap, and never omit a refusal from the result.
- Never edit config/quality-measures.json to make a measure pass.
- Never compute a status in prose when the engine has not run.
- Never write to the patient record or "note it in the system" - this skill only reports.
Error Handling
- If the engine exits non-zero or its output file is missing, report "gap check not run: <error>" and stop - never fall back to judging status yourself.
- If
quality_gap_result.haltedis "unsigned_note", report the halt and the escalation only. - If config/quality-measures.json has no measures, report measures_checked = 0 and say so.
- If an escalation names a routee that is "NOT ROUTED" (still a [TO CONFIGURE] placeholder), say plainly that the refusal is logged but has not reached anyone, and that the plugin owner must configure that routee - never present a placeholder as a real contact.
Escalation / uncertainty
Every refused override attempt is escalated by name to routees.override_refusal in config/escalation-policy.json (the quality/compliance lead), not just logged silently (clinical-doc-rules.md #6).
04 同仓库更多 Skills
stakeholder-and-decision-map
Mines customer interactions to identify stakeholders, infer their likely roles and engagement, map the decision process, and highlight who or what may be missing. Use when asked to "map a deal's buying group", identify influential or missing stakeholders, "assess who has gone quiet", or "explain how the customer will decide". Do not use for phased engagement plans, contact sequences, choosing or drafting outreach to the single next contact, seller or team performance reviews, or contacting, scheduling, or changing records.
sales-progress-update
Creates or refreshes a sales progress update for a manager or team about work done, deal movement, pending outcomes, supported forecast position, and help needed. Use when asked to "create my weekly sales update", "refresh my sales progress deck", "report my forecast position", "where do I stand against my quarter forecast", or "catch my manager up on committed deals". Do NOT use for non-sales project updates, a since-date deal change digest, momentum or blocker analysis, meeting prep, or outreach drafting.
submission-assemble
Put the checked CSR or 510(k) sections together in template order with a reviewer-facing open-items register, as a draft package for human sign-off. Use when the user asks "assemble the CSR draft", "put the module together for review", "build the review package with the open items on top", "compile the 510(k) sections in order" or "package this up for the submission lead". Do NOT use for assembling an unchecked draft - use consistency-check instead. Do NOT use for loading protocol, SAP or TLF sources - use source-ingest instead. Do NOT use for compiling general documents or slide decks - use the built-in docx or pptx skill instead. Do NOT use for filing or submitting to a regulator - use the sponsor's validated gateway, operated by a human, instead. Guardrail: draft for human approval only (L1); status is draft_clean or draft_open_items, never submitted.
source-ingest
Pull every number, date and population definition out of a study's protocol, SAP, TLF tables, investigator brochure and prior approved text into one cited fact map, keyed per config/field-dictionary.json, before any CSR or 510(k) section is written. Use when the user asks "here's the locked TLF set and SAP, set up the CSR", "load the protocol and tables before we start drafting", "what figures do we have from the database lock?", "pull the disposition counts out of Table 14.1.1" or "ingest the IB for the 510(k)". Do NOT use for drafting or assembling submission sections - use section-draft or submission-assemble instead. Do NOT use for reconciling a patient's medications - use the discharge-care-transition plugin instead. Guardrail: reads and cites sources only; never estimates, rounds or invents a fact.
section-plan
Work out which sections a CSR or 510(k) requires, from the templates in config, check each one against the cited fact map, and name what is missing before a word is drafted. Use when the user asks "what do we still need before we can draft the CSR?", "which sections are ready to start?", "what's blocking the performance data section?", "do we have everything for the synopsis?" or "map our tables to the E3 structure". Do NOT use for writing section language - use section-draft instead. Do NOT use for cross-checking a finished draft - use consistency-check instead. Do NOT use for outlining general Word documents or business reports - use the built-in docx skill instead. Only structures with a template in config are supported. Guardrail: plans only; never marks a section ready on a missing fact and never invents a structure.
section-draft
Write or revise the language for one planned CSR or 510(k) section - synopsis, efficacy, safety, discussion, device description - using only figures already in the cited fact map, each with its TLF or SAP citation. Use when the user asks "draft the Synopsis from our locked tables", "write up safety from Table 14.3.1", "give me a first pass at the discussion", "draft the device description for the 510(k)" or "tighten the wording of the Discussion section". Do NOT use for supplying a number not already in source_facts - use source-ingest instead. Do NOT use for verifying a draft's figures - use consistency-check instead. Do NOT use for appeal letters, clinical notes or discharge summaries - use the matching HLS plugin instead. Guardrail: drafts for human approval only (L1); never asserts an unsourced number or harmonises two figures.