feat(osi): 优化人群分类查询接口(T-209)

This commit is contained in:
ila
2026-07-09 20:38:27 +08:00
parent ca16f61263
commit 561cd839e7
10 changed files with 108 additions and 16 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ var servicePaths = map[string]string{
ServiceIDJKDACreate: "/jkda/create",
ServiceIDJKDAFind: "/auto/jkda/find",
ServiceIDJKDAUpdate: "/jkda/update",
ServiceIDJKDAFindRqbj: "/jkda/findrqbj",
ServiceIDJKDAFindRqbj: "/auto/jkda/findrqbj",
ServiceIDGridAddress: "/auto/wgdzcx/query",
ServiceIDDoctors: "/auto/zryscx/query",
ServiceIDDrugs: "/auto/ypmlcx/query",
+2
View File
@@ -21,6 +21,8 @@ type FindRqbjQuery struct {
type PersonSignResult struct {
PersonSign string `json:"personSign"`
IDCard string `json:"idCard"`
PHRID string `json:"phrId"`
}
func (c *Client) CreateHealthRecord(ctx context.Context, req contract.HealthRecordCreate) (contract.HealthRecordSaveResult, Result, error) {
+5 -5
View File
@@ -172,29 +172,29 @@ func TestFindRqbjCallsJKDA00005AndDecodesPersonSign(t *testing.T) {
if err := json.NewDecoder(r.Body).Decode(&seenPayload); err != nil {
t.Fatalf("decode request: %v", err)
}
_, _ = w.Write([]byte(`{"code":"01","message":"操作成功","data":{"personSign":"PU,LAO"}}`))
_, _ = w.Write([]byte(`{"code":"01","message":"操作成功","data":{"personSign":"LAO","idCard":"440000********1234","phrId":"PHR001"}}`))
}))
defer server.Close()
client := newTestJKDAClient(t, server.URL)
personSign, result, err := client.FindRqbj(context.Background(), FindRqbjQuery{PHRID: "phr-001"})
personSign, result, err := client.FindRqbj(context.Background(), FindRqbjQuery{IDCard: "440000********1234"})
if err != nil {
t.Fatalf("FindRqbj: %v", err)
}
if !result.Success || result.Code != "01" {
t.Fatalf("result = %#v", result)
}
if seenPath != "/osi/api/jkda/findrqbj" {
if seenPath != "/osi/api/auto/jkda/findrqbj" {
t.Fatalf("path = %q", seenPath)
}
if seenPayload["serviceId"] != ServiceIDJKDAFindRqbj {
t.Fatalf("serviceId = %v", seenPayload["serviceId"])
}
baseInfo := seenPayload["uploadinfo"].(map[string]any)["baseInfo"].(map[string]any)
if baseInfo["phrid"] != "phr-001" {
if baseInfo["idCard"] != "440000********1234" {
t.Fatalf("baseInfo = %#v", baseInfo)
}
if personSign.PersonSign != "PU,LAO" {
if personSign.PersonSign != "LAO" || personSign.IDCard != "440000********1234" || personSign.PHRID != "PHR001" {
t.Fatalf("personSign = %#v", personSign)
}
}