zzzyy-phs-cli

zzzyy-phs-cli: A CLI tool for Zhengzhou Traditional Chinese Medicine Hospital internet hospital, used to complete end-to-end processes such as SMS login, patient management, appointment registration and inspection/test report queries. Trigger scenarios include registration, appointment booking, login, adding a patient, binding a patient, and querying reports.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "zzzyy-phs-cli" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-89efd2e4c9549cb82cb2fac08a561e11aaa05206132cba2757d3b380dfaec81e. Verify the upstream source and version against https://skillhub.cn/skills/herenit/zzzyy-phs-cli before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

zzzyy-phs-cli: A CLI tool for Zhengzhou Traditional Chinese Medicine Hospital internet hospital, used to complete end-to-end processes such as SMS login, patient management, appointment registration and inspection/test report queries. Trigger scenarios include registration, appointment booking, login, adding a patient, binding a patient, and querying reports.

0 Downloads

Introduction source: third_party · herenit · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
python scripts/heren_zzzyy.py auth login
Software, accounts and paid services
python scripts/heren_zzzyy.py config show ```
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: "zzzyy-phs-cli"
description: 郑州市中医院互联网医院 CLI 工具,用于完成短信登录、就诊人管理、预约挂号和检查检验报告查询全流程。触发条件包括 挂号、预约挂号、登录、添加就诊人、绑定就诊人、查询报告等场景。

heren-zzzyy — 互联网医院 CLI 工具

CLI 工具,封装 phs 网关 API(互联网医院),支持 agent 驱动的流程:短信登录、就诊人管理、预约挂号、报告查询。

⚠️ 核心约束(必须遵守)

严禁自行组装 HTTP 请求

所有操作必须通过 python scripts/heren_zzzyy.py 执行。 严禁自行调用 API 端点。

✅ 正确做法: 仅使用本文档列出的 CLI 子命令。参数和顺序必须与本文档示例完全一致。

原因:API 涉及加密签名、Token 注入等多级封装,自行组装极易出错。

发送短信前必须显式确认

  • auth login(交互式自动发验证码)和 auth send-sms 执行前必须向用户显式确认。
  • 登录失败或验证码错误时,必须再次确认后才能重发,禁止自动重试。
  • 这是防止短信滥发的合规要求。

安装

pip install click requests pycryptodome

运行入口

python scripts/heren_zzzyy.py --version

所有子命令均通过此入口调用。

会话状态

所有状态持久化到 ~/.heren-zzzyy/session-zzzyy.json:

字段 说明
accessToken 登录 token
herenId 用户 ID
patientId 当前活跃就诊人 ID
patientName 当前活跃就诊人姓名
hosId 医院 ID 缓存
sysCode 系统医院编码(1001099)
apiSuffix API 路径后缀

支持的系统医院:

编码 医院名称 API 后缀
1001099 郑州中医院 =zzzyy07211327

使用流程

0. 系统医院

本工具已预配置为 郑州中医院(编码 1001099),API 后缀自动拼接。可通过以下命令查看当前配置:

python scripts/heren_zzzyy.py config show

命令分组

config — 系统配置

# 查看当前配置(环境、系统医院、登录状态等)
python scripts/heren_zzzyy.py config show

auth — 认证

# 交互式登录:提示输入手机号 → 自动发送验证码 → 提示输入验证码 → 登录
python scripts/heren_zzzyy.py auth login

# 也可直接传入手机号跳过第一步
python scripts/heren_zzzyy.py auth login --phone <phone>

# 仅发送验证码(不登录)
python scripts/heren_zzzyy.py auth send-sms <phone>

# 查看登录状态
python scripts/heren_zzzyy.py auth status

# 获取当前用户信息(需登录)
python scripts/heren_zzzyy.py auth user-info [--json]

# 退出登录
python scripts/heren_zzzyy.py auth logout

patient — 就诊人管理

# 查看已绑定的就诊人列表
python scripts/heren_zzzyy.py patient list [--json]

# 交互选择就诊人(只有一个则自动选中)
python scripts/heren_zzzyy.py patient choose [--json]

# 新增就诊人(建档)
python scripts/heren_zzzyy.py patient add --name "<姓名>" --id-no "<身份证号>" --phone "<手机号>" [--gender 1] [--cert-type 01] [--patient-type -1]

# 查档绑定(曾就诊的患者)
python scripts/heren_zzzyy.py patient add-by-treated --name "<姓名>" --id-no "<身份证号>" --phone "<手机号>" --gender 1 [--json]

# 设置活跃就诊人
python scripts/heren_zzzyy.py patient select <patientId> [--name "<姓名>"]

# 获取就诊人详情
python scripts/heren_zzzyy.py patient detail <patientId> [--json]
  • --gender: 1=男, 2=女(默认 1)
  • --cert-type: 01=身份证(默认), 02=护照等
  • --patient-type: -1=成人/儿童有身份证(默认), 0=新生儿, 1=军人

patient add 使用建档 API(addPat),适用于新增或已就诊患者。 若已绑定,则返回"证件号或就诊人已存在",直接用 patient select 即可。 若用户表示"之前在这家医院看过病",优先尝试查档绑定(add-by-treated)。

reg — 预约挂号

# 科室列表
python scripts/heren_zzzyy.py reg dept-list [--hos-id HOS001] [--json]

# 科室下医生列表
python scripts/heren_zzzyy.py reg doc-list <deptCode> [--hos-id HOS001] [--json]

# 查询号源(预约前必执行)
python scripts/heren_zzzyy.py reg number-source '<schedule_data_json>' [--hos-id HOS001] [--json]

# 预约挂号(需提供排班数据和号源数据)
python scripts/heren_zzzyy.py reg book <schId> [--patient-id PAT001] [--schedule-data JSON] [--number-source JSON] [--json]

# 取消挂号
python scripts/heren_zzzyy.py reg cancel <orderId> [--hos-order-id HO001] [--source 19] [--json]

# 我的挂号列表
python scripts/heren_zzzyy.py reg my-list [--patient-id PAT001] [--hos-id HOS001] [--page 1] [--json]

# 获取所有科室医生(保存到文件)
python scripts/heren_zzzyy.py reg all-doctors [--json]

预约挂号工作流:

  1. reg dept-list --json → 选择科室(deptCode)
  2. reg number-source '<schedule_data_json>' --json → 选择号源,获取 number_source 完整 JSON
  3. reg book <schId> --schedule-data '<schedule_data_json>' --number-source '<number_source_json>' --json

query — 报告查询

# 报告列表(--header-type: jy=检验, jc=检查, tj=体检)
python scripts/heren_zzzyy.py query reports [--patient-id PAT001] [--hos-id HOS001] [--header-type jy] [--json]

# 报告详情(--extend 从报告列表输出的 extend 字段取值传入)
python scripts/heren_zzzyy.py query report-detail <reportId> [--hos-id HOS001] [--patient-id PAT001] [--extend EXTEND] [--json]

hospital — 医院信息

# 医院列表(支持按名称搜索和定位)
python scripts/heren_zzzyy.py hospital list [--name "医院名"] [--type 1] [--hos-type TYPE] [--area-id AREA] [--gis-lng 120.1] [--gis-lat 30.1] [--json]
  • --type: 1=挂号预约
  • --gis-lng/--gis-lat: 经纬度,用于最近医院距离计算

典型工作流程

0. 系统医院

本工具已预配置为 郑州中医院(编码 1001099),无需手动选择。查看当前配置:

python scripts/heren_zzzyy.py config show

1. 登录与就诊人选择

1.1 登录(交互式)

# 交互式登录:提示输入手机号 → 自动发送验证码 → 提示输入验证码 → 登录
python scripts/heren_zzzyy.py auth login

# 也可直接传入手机号跳过第一步
python scripts/heren_zzzyy.py auth login --phone <phone>

也可以分两步执行:先 python scripts/heren_zzzyy.py auth send-sms <phone>,再 python scripts/heren_zzzyy.py auth login --phone <phone> --sms-code <code>

1.2 选择就诊人

# 查看已绑定的就诊人列表
python scripts/heren_zzzyy.py patient list --json

# 选择一个就诊人(设为 session 的 active patient)
python scripts/heren_zzzyy.py patient select <patientId> --name "姓名"

如果只有一个就诊人会自动选中。也可交互选择:

python scripts/heren_zzzyy.py patient choose --json

1.3 验证登录状态

python scripts/heren_zzzyy.py auth status

注意

  • 登录后 session 持久化到 ~/.heren-zzzyy/session-zzzyy.json,后续命令自动读取
  • patient select 设置的 patientId 会作为后续所有命令的默认就诊人
  • 如需切换就诊人,再次调用 patient select 即可

2. 添加就诊人

2.1 确认登录状态

python scripts/heren_zzzyy.py auth status

2.2 查看现有就诊人

python scripts/heren_zzzyy.py patient list --json

2.3 收集就诊人信息

字段 说明 示例
姓名 真实姓名 <姓名>
身份证号 18位身份证 <身份证号>
手机号 11位手机号 <手机号>
性别 1=男, 2=女 1
证件类型 01=身份证(默认), 02=护照 01

2.4 建档方式

  • 建档(patient add):新患者
  • 查档绑定(patient add-by-treated):曾就诊患者

建议先尝试查档绑定,若返回"未查询到相关档案信息"(999301),回退到建档。

2.5 建档

python scripts/heren_zzzyy.py patient add --name "<姓名>" --id-no "<身份证号>" --phone "<手机号>" --gender 1 --json

2.6 查档绑定

python scripts/heren_zzzyy.py patient add-by-treated --name "<姓名>" --id-no "<身份证号>" --phone "<手机号>" --gender 1 --json

2.7 错误处理

错误信息 含义 处理方式
"证件号或就诊人已存在" 已绑定 直接 patient select
"未查询到相关档案信息"(999301) 无历史记录 回退建档
"该身份证号已被其他用户绑定" 被占用 确认身份证号

2.8 设置新就诊人

python scripts/heren_zzzyy.py patient select <patientId> --name "<姓名>"

2.9 验证

python scripts/heren_zzzyy.py patient list --json
python scripts/heren_zzzyy.py patient detail <patientId> --json

3. 预约挂号

3.1 查询号源(必须)

python scripts/heren_zzzyy.py reg number-source '<schedule_data_json>' --json

3.2 预约挂号

python scripts/heren_zzzyy.py reg book <schId> --schedule-data '<schedule_data_json>' --number-source '<number_source_json>' --json

3.3 查看/取消

python scripts/heren_zzzyy.py reg my-list --json
python scripts/heren_zzzyy.py reg cancel <orderId> --json

4. 查询检验报告

4.1 报告列表

python scripts/heren_zzzyy.py query reports --header-type jy --json
python scripts/heren_zzzyy.py query reports --header-type jc --json
python scripts/heren_zzzyy.py query reports --header-type tj --json

4.2 报告详情

python scripts/heren_zzzyy.py query report-detail <reportId> --json

JSON 输出

所有数据命令支持 --json 参数:

python scripts/heren_zzzyy.py patient list --json
python scripts/heren_zzzyy.py reg dept-list --json

API 环境

环境 Base URL
prod https://netphs.eheren.com/gateway

Agent 注意事项

  • 需要就诊人的命令默认使用 session 中的活跃 patientId,可通过 --patient-id 覆盖
  • --json 适用于所有返回数据的命令
  • 认证状态跨调用持久化在 ~/.heren-zzzyy/session-zzzyy.json
  • 预约挂号必须提供 --schedule-data 和 --number-source

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供郑州市中医院互联网医院全流程 CLI 工具,涵盖登录、就诊人管理、预约挂号和报告查询
  • 解决用户实际就医痛点,实用价值高,受众明确
Trigger Precision90/100

Highlights

  • 触发条件清晰完整,覆盖挂号、登录、就诊人管理、报告查询等核心场景
Structure and Standards95/100

Areas to improve

  • 文档较长,部分命令参数较多 Reported severity: Minor

    文档内容详尽但篇幅较长,部分命令参数较多,可能影响快速查阅

    Recommendation: 建议增加快速参考表或命令速查章节,便于用户快速定位常用操作

Highlights

  • 结构完整,包含安装、运行入口、会话状态、命令分组、典型工作流程等
  • 有清晰的 Phase 划分和端到端示例,frontmatter 完整
Execution Reliability90/100

Highlights

  • 工具来源明确,参数说明详细,覆盖主要异常处理
  • 不可逆操作有显式确认机制,防止误操作
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 29
  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 46
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • netphs.eheren.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

python scripts/heren_zzzyy.py config show ```

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.