feat(mapping): 完成 PHIS 健康档案转换(T-212)

This commit is contained in:
ila
2026-07-16 00:53:16 +08:00
parent d385d6dd3b
commit 8a5550057c
20 changed files with 1078 additions and 124 deletions
+28 -10
View File
@@ -142,16 +142,25 @@ func TestHealthRecordCreateSerializesCreateFieldNames(t *testing.T) {
PersonName: "测试人员",
},
HealthRecord: HealthRecordCreateInfo{
CheckID: "CHK2026070700000001",
IDCard: "440000********1234",
PersonName: "测试人员",
SexCode: "1",
Birthday: "1970-01-01",
MobileNumber: "13900000000",
RegionCode: "441625000000",
ManaDoctorID: "doc-001",
ManaUnitID: "123456789",
AddressNumber: "101号",
CheckID: "CHK2026070700000001",
IDCard: "440000********1234",
PersonName: "测试人员",
SexCode: "1",
Birthday: "1970-01-01",
WorkPlace: "测试单位",
MobileNumber: "13900000000",
Contact: "测试联系人",
ContactPhone: "13800000000",
RegisteredPermanent: "1",
RegionCode: "441625000000",
Address: "测试现住址",
AddressNumber: "101号",
HomePlace: "测试户籍地址",
HomePlaceNumber: "202号",
CardType: "01",
ManaDoctorID: "doc-001",
ManaUnitID: "123456789",
IsFillSHHJ: "y",
},
PastHistory: &PastHistory{YWGMS: "0101"},
}
@@ -171,6 +180,15 @@ func TestHealthRecordCreateSerializesCreateFieldNames(t *testing.T) {
if healthRecord["addressNumber"] != "101号" {
t.Fatalf("addressNumber missing: %#v", healthRecord)
}
for key, want := range map[string]any{
"workPlace": "测试单位", "contact": "测试联系人", "contactPhone": "13800000000",
"registeredPermanent": "1", "address": "测试现住址", "homePlace": "测试户籍地址",
"homePlaceNumber": "202号", "cardType": "01", "isFillShhj": "y",
} {
if healthRecord[key] != want {
t.Fatalf("healthRecord[%s] = %#v, want %#v", key, healthRecord[key], want)
}
}
if _, ok := healthRecord["adressNumber"]; ok {
t.Fatalf("create request used response typo adressNumber: %#v", healthRecord)
}