Files
HIS-GUI/docs/structure.md
2026-03-30 10:49:25 +08:00

3.5 KiB
Raw Permalink Blame History

his-project/
├── CMakeLists.txt             # 根构建配置
├── data/                      # 原始数据目录(评测时展示的文件)
│   ├── patients.txt           # 【存储JSON数组的文本文件】至少30条记录
│   ├── doctors.txt
│   ├── wards.txt              # 病房信息
│   └── medicines.txt          # 药品库
├── include/                   # 头文件目录 (.h / .hpp)
│   ├── models/                # 1. 纯数据实体层 (Entity)
│   │   ├── patient.h
│   │   ├── doctor.h
│   │   └── medicine.h
│   ├── utils/                 # 2. 底层工具与驱动层
│   │   ├── linked_list.hpp    # 【核心】全手写的泛型链表 template<T>
│   │   ├── file_manager.h     # 文件读写封装
│   │   └── e2hang_json.h      # 你的 C++20 JSON 解析库头文件
│   ├── core/                  # 3. 核心业务层 (his-core)
│   │   ├── his_context.h      # 全局上下文(持有所有内存链表的实例)
│   │   ├── patient_service.h  # 处理挂号、看诊等纯逻辑
│   │   └── report_service.h   # 报表统计算法
│   └── cli/                   # 4. 交互表现层 (his-cli)
│       ├── repl_shell.h       # 交互式命令行主循环
│       └── format_printer.h   # 负责把链表数据打印成漂亮的 ASCII 表格
├── src/                       # 源文件目录 (.cpp) => 源文件目录 (实现)
│    ├── main.cpp                  # 程序唯一入口:负责初始化、启动 REPL 和退出保存
│    ├── models/                   # 实体类方法实现
│    │   ├── patient.cpp           # 患者属性操作及 JSON 序列化实现
│    │   ├── doctor.cpp            # 医生属性操作
│    │   ├── ward.cpp              # 病房/床位逻辑实现
│    │   └── medicine.cpp          # 药品多名称匹配逻辑实现 
│    ├── core/                     # his-core核心业务实现 (无输入输出)
│    │   ├── his_context.cpp       # 全局单例:管理所有内存链表的加载与保存
│    │   ├── patient_service.cpp   # 实现挂号、诊疗记录、病历生成逻辑 [cite: 38]
│    │   ├── inpatient_service.cpp # 实现住院分配、床位流转逻辑 [cite: 38]
│    │   ├── pharmacy_service.cpp  # 实现处方发药、库存增减、入库逻辑 [cite: 38]
│    │   └── report_service.cpp    # 实现多维度报表统计与数据分析算法 
│    ├── utils/                    # 基础设施实现
│    │   ├── file_manager.cpp      # 处理 .txt 文件的物理读写
│    │   ├── input_sanitizer.cpp   # 【鲁棒性核心】针对“测试工程师”的输入清洗 
│    │   └── e2hang_json.cpp       # 你的 C++20 JSON 解析库实现
│    └── cli/                      # his-cli命令行交互实现
│        ├── repl_shell.cpp        # 交互式 Shell 主循环 (Read-Eval-Print Loop)
│        ├── command_parser.cpp    # 指令分发器:将输入映射到对应的 Service 函数
│        └── table_printer.cpp     # 美化工具:将结果格式化为 ASCII 表格输出
└── tests/                     # 测试用例目录(专门对付“测试工程师”)
    ├── test_linked_list.cpp   # 必须先确保链表绝对可靠
    └── test_core_logic.cpp    # 灌入异常数据测试业务层鲁棒性