feat(mapping): 完成 PHIS 健康档案转换(T-212)
This commit is contained in:
+34
-20
@@ -117,26 +117,40 @@ type HealthRecordBaseInfo struct {
|
||||
}
|
||||
|
||||
type HealthRecordCreateInfo struct {
|
||||
CheckID string `json:"checkId,omitempty"`
|
||||
IDCard string `json:"idCard,omitempty"`
|
||||
PersonName string `json:"personName,omitempty"`
|
||||
SexCode string `json:"sexCode,omitempty"`
|
||||
Birthday string `json:"birthday,omitempty"`
|
||||
PhrID string `json:"phrId,omitempty"`
|
||||
MobileNumber string `json:"mobileNumber,omitempty"`
|
||||
RegionCode string `json:"regionCode,omitempty"`
|
||||
ManaDoctorID string `json:"manaDoctorId,omitempty"`
|
||||
ManaUnitID string `json:"manaUnitId,omitempty"`
|
||||
CreateUser string `json:"createUser,omitempty"`
|
||||
CreateUnit string `json:"createUnit,omitempty"`
|
||||
NationCode string `json:"nationCode,omitempty"`
|
||||
EducationCode string `json:"educationCode,omitempty"`
|
||||
WorkCode string `json:"workCode,omitempty"`
|
||||
MaritalStatusCode string `json:"maritalStatusCode,omitempty"`
|
||||
BloodTypeCode string `json:"bloodTypeCode,omitempty"`
|
||||
RhBloodCode string `json:"rhBloodCode,omitempty"`
|
||||
InsuranceCode string `json:"insuranceCode,omitempty"`
|
||||
AddressNumber string `json:"addressNumber,omitempty"`
|
||||
CheckID string `json:"checkId,omitempty"`
|
||||
IDCard string `json:"idCard,omitempty"`
|
||||
PersonName string `json:"personName,omitempty"`
|
||||
SexCode string `json:"sexCode,omitempty"`
|
||||
Birthday string `json:"birthday,omitempty"`
|
||||
WorkPlace string `json:"workPlace,omitempty"`
|
||||
PhrID string `json:"phrId,omitempty"`
|
||||
MobileNumber string `json:"mobileNumber,omitempty"`
|
||||
PhoneNumber string `json:"phoneNumber,omitempty"`
|
||||
Contact string `json:"contact,omitempty"`
|
||||
ContactPhone string `json:"contactPhone,omitempty"`
|
||||
RegisteredPermanent string `json:"registeredPermanent,omitempty"`
|
||||
RegionCode string `json:"regionCode,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
AddressCode string `json:"addressCode,omitempty"`
|
||||
AddressNumber string `json:"addressNumber,omitempty"`
|
||||
HomePlace string `json:"homePlace,omitempty"`
|
||||
HomePlaceCode string `json:"homePlaceCode,omitempty"`
|
||||
HomePlaceNumber string `json:"homePlaceNumber,omitempty"`
|
||||
CardType string `json:"cardType,omitempty"`
|
||||
ManaDoctorID string `json:"manaDoctorId,omitempty"`
|
||||
ManaUnitID string `json:"manaUnitId,omitempty"`
|
||||
CreateUser string `json:"createUser,omitempty"`
|
||||
CreateUnit string `json:"createUnit,omitempty"`
|
||||
NationCode string `json:"nationCode,omitempty"`
|
||||
EducationCode string `json:"educationCode,omitempty"`
|
||||
WorkCode string `json:"workCode,omitempty"`
|
||||
MaritalStatusCode string `json:"maritalStatusCode,omitempty"`
|
||||
BloodTypeCode string `json:"bloodTypeCode,omitempty"`
|
||||
RhBloodCode string `json:"rhBloodCode,omitempty"`
|
||||
InsuranceCode string `json:"insuranceCode,omitempty"`
|
||||
InsuranceType string `json:"insuranceType,omitempty"`
|
||||
IsFillSHHJ string `json:"isFillShhj,omitempty"`
|
||||
CreateDate string `json:"createDate,omitempty"`
|
||||
}
|
||||
|
||||
type HealthRecordSaveResult struct {
|
||||
|
||||
+28
-10
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user