GKTJ Patient Survey Report Generator
Overview
This skill generates patient-facing questionnaire analysis reports with a fixed structure, controlled wording, and .docx output. The repository is currently migrating from a lightweight direct renderer toward a template-driven patient report workflow with fixed .docx templates and Word native editable charts.
When to Use
- Uploaded attachment contains patient questionnaire data, especially
.xlsx,.csv, or copied survey tables. - Output must follow a fixed patient report structure rooted in:
引言/数据信息分析/反馈意见分析/附件. - Every question in chapter 2 needs a matching chart.
- The report must stay in patient viewpoint throughout.
- The user wants
.mdand.docxartifacts, not just chat output.
Do not use this skill for doctor reports, clinical trial manuscripts, or unstructured brainstorming.
Workflow
- Normalize inputs:
- Required:
品种,地区, questionnaire attachment. - Optional:
时间, custom execution note, custom output directory.
- Required:
- Parse the questionnaire data first.
- Use
scripts/parse_questionnaire.pyfor spreadsheet inputs. - Save structured output as
questionnaire.jsonbefore writing report sections.
- Use
- Derive one statement-style title per question.
- These titles are the chapter 2 dimension headings.
- Generate report content in this order:
引言2、数据信息分析question by question3.1 积极反馈3.2 待改进反馈4、附件-问卷题目内容- When drafting prose, use the patient expression modules in
references/expression-modules.md.
- Build a report payload JSON through a script, not by hand.
- AI should first write
report_content.mdorreport_content.jsonl. - Use
scripts/build_payload.pyto convert that draft plusquestionnaire.jsoninto a validreport_payload.json.
- AI should first write
- Render artifacts.
- Legacy path: use
scripts/render_report.pyto generate charts, markdown, docx, and a summary JSON. - Target path: fill a fixed
.docxtemplate and update template-native Word charts. - The template-driven rules live in
references/template-spec.md.
- Legacy path: use
- Verify before delivery.
- Chart count must equal chapter 2 question count.
- Attachment must preserve original question and option meaning.
- No absolute efficacy or safety claims.
Required Output Rules
- Patient viewpoint only. Do not rewrite as doctor judgement.
- Do not invent sample size, hospitals, institutions, or dates.
- If sample size or time is missing, use restrained wording and omit unsupported facts.
- In chapter 2, analyze percentage relationships; do not mechanically enumerate A/B/C/D and stop there.
- In chapter 2, each question should preferentially use one of these 3 analysis angles:
- analyze option percentages and give a conclusion plus feasible suggestion
- analyze the percentage of major options one by one and explain possible causes
- analyze the overall percentage structure and summarize the group-level pattern
- The model may randomly choose any one of the 3 angles question by question, but the chosen angle must still fit the actual data distribution.
- In chapter 2, always decide the pattern first, then write:
- overall recognition
- conditional recognition
- behavioural split
- pain-point attention
- Translate percentage structure into: patient experience, self-management behaviour, convenience, understanding, support needs.
- Do not turn patient questionnaire feedback into efficacy proof or clinical recommendation.
Section Rules
- Read
references/section-rules.mdbefore generating text. - Read
references/compliance-rules.mdbefore finalizing text. - Read
references/execution-rules.mdbefore building the report payload. - Read
references/expression-modules.mdbefore drafting narrative paragraphs.
Scripts
scripts/parse_questionnaire.py- Reads questionnaire spreadsheets and emits normalized JSON.
scripts/build_payload.py- Reads
questionnaire.jsonplus structured report content and emits a validatedreport_payload.json.
- Reads
scripts/render_report.py- Legacy renderer for the original lightweight flow.
- Generates markdown, PNG charts,
.docx, and a summary JSON. - This path is not the long-term solution for customer-template parity.
scripts/render_from_template.py- Loads the fixed patient
.docxtemplate and writes structured payload v2 text back into the template.
- Loads the fixed patient
scripts/update_word_charts.py- Updates pre-seeded Word native editable charts inside the rendered
.docx.
- Updates pre-seeded Word native editable charts inside the rendered
Expected File Flow
- Input:
- attachment spreadsheet
- Intermediate:
questionnaire.jsonreport_content.mdorreport_content.jsonlreport_payload.jsonorreport_payload.v2.json
- Output:
report_draft.mdreport_final.mdcharts/chart_XX.pngfor legacy flow onlyreport_rendered.docxfor template-driven flow问卷调研分析报告-{{品种}}-患者端-{{地区}}.docxreport_summary.json
Common Mistakes
- Writing in doctor viewpoint.
- Letting chapter 3 repeat chapter 2 item by item.
- Asking the model to handwrite a long
report_payload.jsonwith many Chinese paragraphs. - Turning patient feedback into “证明疗效” or “安全性确证”.
- Forgetting that every chapter 2 item needs one chart and only one chart.
- Extending the legacy direct renderer when the request is really about the template-driven workflow.
Final Delivery
Reply with:
- markdown final path
- docx path
- chapter completeness check
- chart count check
- chart style consistency check
- missing or uncertain data
- unresolved issues
Scan to join WeChat group