Family Medical History / 家庭医疗档案

v1.5.1

Manage and query structured family medical records including profiles, visits, medications, chronic conditions, and vaccination histories stored as Markdown...

0· 124·0 current·0 all-time
bytbook@silent404

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for silent404/family-medical-history.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Family Medical History / 家庭医疗档案" (silent404/family-medical-history) from ClawHub.
Skill page: https://clawhub.ai/silent404/family-medical-history
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install family-medical-history

ClawHub CLI

Package manager switcher

npx clawhub@latest install family-medical-history
Security Scan
VirusTotalVirusTotal
Pending
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (local family EHR) match the included scripts: DB initialization, import from Markdown, querying, and optional Markdown sync. No unrelated binaries, env vars, or external services are requested.
Instruction Scope
Runtime instructions and scripts operate on local files (medical_records/ and medical_records.db) and use SQLite; they do not call external network endpoints or read environment credentials. Note: import_md.py will scan a user-specified directory of Markdown files for import, and sync_db.py will write Markdown and attachments back to the repository's medical_records/ tree — these actions will read/write potentially sensitive PII/PHI on the local filesystem and should be run only on directories you expect to process.
Install Mechanism
Instruction-only skill with bundled Python scripts; no installer, no external downloads, and no extraction of remote archives. Behavior occurs when the provided Python scripts are executed locally.
Credentials
No environment variables, credentials, or config paths are required. The scripts do not attempt to access unrelated credentials or services. All data access is local filesystem/SQLite.
Persistence & Privilege
always is false and the skill does not modify other skills or global agent settings. It creates/uses a local medical_records.db and Markdown files under medical_records/, which is expected for this purpose — be aware these files contain sensitive health/identity data and persist on disk.
Assessment
This skill appears coherent with its stated purpose: it initializes and manages a local SQLite database and can import/export Markdown records. Before running it, review/accept that it will create medical_records.db and write Markdown/attachments under a medical_records/ directory in the repository parent — these files will contain sensitive personal and health information. Only run the import scripts on directories you trust; do not point them at system or unknown directories. No network exfiltration or credential requests are present, but you should: (1) inspect the scripts yourself or run them in a controlled environment, (2) back up any existing data, (3) protect the created DB/markdown files with appropriate filesystem permissions or encryption, and (4) note minor code quality issues (e.g., a likely bug in get_family_summary) that may cause errors but not indicate malicious behavior.

Like a lobster shell, security has layers — review code before you run it.

latestvk974vxscr1qqdky5fstd4h18p18420n9
124downloads
0stars
8versions
Updated 3w ago
v1.5.1
MIT-0

Family Medical History Skill

A complete family EHR system. SQLite database is the single source of truth for all records. Markdown files are optional human-readable exports.

Database Setup (MANDATORY — First Time Only)

# Step 1: Initialize the database schema
python3 scripts/init_db.py

# Step 2: Verify
python3 scripts/query_db.py summary
# Expected: Members: 0 (empty database — ready for new records)

For NEW users: Start here. The database is empty and ready. You will insert all records directly into the DB. For existing Markdown users: Run python3 scripts/import_md.py ./medical_records to migrate, then continue using the DB.

Architecture

medical_records/
└── medical_records.db    # ← SINGLE SOURCE OF TRUTH (always use this)
    ├── members
    ├── allergies
    ├── medical_history
    ├── surgical_history
    ├── family_history
    ├── vaccinations
    ├── visits
    ├── medications
    ├── medication_tracking
    ├── exams
    ├── daily_vitals
    └── attachments

Markdown layer has been removed. The database is the only storage. Agents should query/write to SQLite, not to .md files.

Scripts

ScriptWhen to Use
scripts/init_db.pyFirst time only — create all tables
scripts/query_db.pyAny query (CLI or import as module)
scripts/sync_db.pyExport DB to Markdown (optional, for backup)

Database Schema Overview

-- Core tables
members           -- family member profiles
visits            -- every medical visit
medications       -- every prescription/treatment course
medication_tracking -- per-dose tracking for periodic treatments
exams             -- lab results, imaging reports
daily_vitals      -- BP, HR, temperature, glucose, etc.
allergies          -- allergy records
medical_history   -- past/ongoing conditions
vaccinations      -- vaccination records

-- Cross-reference tables
surgical_history  -- past surgeries
family_history   -- hereditary conditions
attachments      -- file references (scans, photos)

Core Workflows

Adding a New Family Member

from scripts.query_db import get_connection

conn = get_connection()
cur = conn.cursor()

cur.execute("""
    INSERT INTO members 
    (member_code, name, relationship, dob, gender, blood_type, rh_factor,
     emergency_contact_name, emergency_contact_phone, severe_allergies,
     current_conditions, current_medications)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""", (
    "bob",        # member_code (internal ID)
    "小明",            # name
    "女儿",             # relationship
    "2017-01-01",      # dob
    "女",               # gender
    "B",               # blood_type
    "阳性",            # rh_factor
    "父亲",            # emergency_contact_name
    "138-xxxx-xxxx",   # emergency_contact_phone (脱敏)
    "无",              # severe_allergies
    "无",              # current_conditions
    "无"               # current_medications
))

conn.commit()
conn.close()

Logging a New Visit

from scripts.query_db import get_connection

conn = get_connection()
cur = conn.cursor()

# Get member_id from member_code
member_row = cur.execute(
    "SELECT id FROM members WHERE member_code = ?", ("bob",)
).fetchone()
member_id = member_row[0]

cur.execute("""
    INSERT INTO visits
    (visit_id, member_id, visit_date, institution, department, doctor,
     visit_type, chief_complaint, present_illness, primary_diagnosis,
     secondary_diagnosis, status)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""", (
    "V-20260402-01",
    member_id,
    "2026-04-02",
    "儿科医院",
    "儿科",
    "赵大夫",
    "门诊",
    "早起咳嗽持续一个月余",
    "患儿每日晨起咳嗽,有痰,无发热,无鼻塞",
    "待明确(过敏性咳嗽?)",
    "扁桃体炎后遗症?",
    "open"
))

conn.commit()
conn.close()

Logging a Medication

from scripts.query_db import get_connection

conn = get_connection()
cur = conn.cursor()

# Get member_id
member_row = cur.execute(
    "SELECT id FROM members WHERE member_code = ?", ("bob",)
).fetchone()
member_id = member_row[0]

cur.execute("""
    INSERT INTO medications
    (medication_id, visit_id, member_id, drug_name, generic_name,
     spec, dosage, route, frequency, duration, start_date, status)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""", (
    "M-20260402-01",
    "V-20260402-01",   # link to visit
    member_id,
    "头孢克肟混悬剂",
    "Cefixime",
    "50mg/5ml",
    "见处方",
    "口服",
    "每日2次",
    "6天",
    "2026-04-02",
    "Current"
))

conn.commit()
conn.close()

Periodic Treatment Tracking (e.g., Ketoconazole Weekly)

from scripts.query_db import get_connection

conn = get_connection()
cur = conn.cursor()

# First, insert the medication record
cur.execute("""
    INSERT INTO medications
    (medication_id, member_id, drug_name, route, frequency, duration, start_date, status)
    VALUES (?, ?, ?, ?, ?, ?, ?, ?)
""", (
    "M-20260219-01", 2, "康王酮康唑洗剂", "外用", "每周1次", "8次", "2026-02-19", "Current"
))

# Then populate the tracking plan
planned_dates = [
    (1, "2026-02-19"), (2, "2026-02-26"), (3, "2026-03-05"),
    (4, "2026-03-12"), (5, "2026-03-19"), (6, "2026-03-26"),
    (7, "2026-04-02"), (8, "2026-04-09")
]

for dose_num, planned_date in planned_dates:
    cur.execute("""
        INSERT INTO medication_tracking
        (medication_id, dose_number, planned_date, status)
        VALUES (?, ?, ?, ?)
    """, ("M-20260219-01", dose_num, planned_date, "pending"))

conn.commit()
conn.close()

Checking if Periodic Treatment is Due Today

from scripts.query_db import get_next_dose, get_connection
from datetime import date

next_dose = get_next_dose("M-20260219-01")
today = date.today().isoformat()

if next_dose and next_dose['planned_date'] == today:
    print(f"今日({today})应执行第{next_dose['dose_number']}次")
    # Mark as completed after user confirms
elif next_dose and next_dose['planned_date'] < today:
    print(f"计划日期{next_dose['planned_date']}已过期,需补执行第{next_dose['dose_number']}次")
else:
    print("本次周期已完成")

Marking a Dose as Completed

from scripts.query_db import get_connection

conn = get_connection()
cur = conn.cursor()
cur.execute("""
    UPDATE medication_tracking
    SET actual_date = ?, status = 'completed'
    WHERE medication_id = ? AND dose_number = ?
""", ("2026-04-02", "M-20260219-01", 7))
conn.commit()
conn.close()

Answering Common Questions

"女儿现在在吃什么药?"

from scripts.query_db import get_member_current_medications

meds = get_member_current_medications("bob")
for m in meds:
    print(f"{m['drug_name']} | {m['dosage']} | {m['frequency']} | Started: {m['start_date']}")

"luna的酮康唑今天要用吗?"

from scripts.query_db import get_next_dose
from datetime import date

next_dose = get_next_dose("M-20260219-01")
if next_dose and next_dose['planned_date'] == date.today().isoformat():
    print("是,今天应使用第7次")
elif next_dose and next_dose['planned_date'] < date.today().isoformat():
    print(f"计划已过期(第{next_dose['dose_number']}次,{next_dose['planned_date']})")

"最近谁去过医院?"

from scripts.query_db import get_recent_visits

for member in ["bob", "luna"]:
    visits = get_recent_visits(member, days=30)
    for v in visits:
        print(f"{member} | {v['visit_date']} | {v['chief_complaint']}")

Templates Reference

  • Full SQL schema and table definitions: See references/schema.md
  • Markdown export templates (optional): See references/templates.md

Data Entry Rules

  1. Never fabricate: unknown = "待确认" / "待填写"
  2. Always link: every visit, medication, exam references its parent
  3. Use status: visits=open/closed/chronic; medications=Current/Discontinued; tracking=pending/completed/missed
  4. Periodic tracking: always use medication_tracking table for scheduled treatments
  5. Dual-write not needed: DB is the only source; Markdown sync is export-only

Comments

Loading comments...