Files
chis_osi/contract/jktj.go
T
ilaandClaude Opus 4.8 f3c5e1bf8d feat(osi): 某人全部体检查询 JKTJ00002(T-306)
- osi.QueryHealthChecks(/auto/jktj/query,返回全部体检数组)
- contract.HealthCheckRecordSummary:驼峰 idCard(≠最近一次小写 idcard)、checkId 可空
- HTTP 端点 GET /api/health-check/all
- 单测含 null checkId 场景;实测端点已部署

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 22:14:39 +08:00

55 lines
3.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package contract
// 健康体检查询契约(JKTJ)。
//
// 体检记录字段极多(实测最近一次样本约 260 项,分 4 个 object 子节点 +
// 3 个 array 子节点,见 docs/04 §11)。查询场景只需定位/摘要字段即可,
// 完整内容由 osi.Result.Raw 原样保留;全量字段的强类型建模留到体检 create
// 任务(写入映射才真正需要每个字段),避免照单样本猜 null 字段类型。
//
// 注意与档案的两处差异:
// - 最近一次体检 data 是**单个对象**(档案 find 的 data 是数组)。
// - 体检身份证字段是小写 `idcard`(档案是 `idCard`)。
type HealthCheckSummary struct {
CheckID string `json:"checkId"` // 体检记录主键;各子节点用 healthCheck 外键指向它
HealthCheck string `json:"healthCheck"` // 冗余外键,值等于 checkId
IDCard string `json:"idcard"` // 体检用小写 idcard
PersonName string `json:"personName"`
CheckDate string `json:"checkDate"`
}
// HealthCheckRecordSummary 是 JKTJ00002(某人全部体检)数组里一条体检的定位字段。
// 完整体检内容(结构同 §11.3)由 osi.Result.Raw 保留,本结构只取定位/列举字段。
// ⚠ 身份证字段是驼峰 idCard(≠ 最近一次 HealthCheckSummary 的小写 idcard)。
type HealthCheckRecordSummary struct {
CheckID string `json:"checkId"` // 体检编号;历史记录为 null(→""),仅近年有值
CheckDate string `json:"checkDate"` // 体检日期,历史记录用它定位(checkId 可能缺)
IDCard string `json:"idCard"` // 注意驼峰
PersonName string `json:"personName"`
}
// HealthCheckPerson 是 JKTJLIST00002 已检/未检名单里的一行(人员 + 体检状态,非体检明细)。
// 字段名以实测样本为准(docx 多处有误,见 docs/04 §11.4)。字段稳定且均为字符串,故全部建模。
type HealthCheckPerson struct {
CheckType string `json:"checkType"` // 体检状态:0 已检 / 1 未检
IDCard string `json:"idCard"`
PersonName string `json:"personName"`
PhrID string `json:"phrId"` // 注意驼峰(docx 误写 phrid)
EMPIID string `json:"empiId"`
Age string `json:"age"`
Birthday string `json:"birthday"` // docx 误写 birthDay
SexCode string `json:"sexCode"`
SignFlag string `json:"signFlag"` // 签约:y 已签约 / n 未签约
Rqbj string `json:"rqbj"` // 人群标志(同 personSign 码表,多值逗号分隔)
RegionCode string `json:"regionCode"`
RegionCodeText string `json:"regionCodeText"`
ManaUnitID string `json:"manaUnitId"`
ManaUnitText string `json:"manaUnitText"`
ManaDoctorID string `json:"manaDoctorId"` // docx 误写 manadoctorId
ManaDoctorName string `json:"manaDocterName"` // 实测拼写就是 Docter
Address string `json:"address"`
MobileNumber string `json:"mobileNumber"`
Contact string `json:"contact"`
ContactPhone string `json:"contactPhone"`
}