|
@@ -337,17 +337,28 @@ func (c *HisApiController) GetSettleList() {
|
337
|
337
|
struct4101.CustomStruct = tempFunPays
|
338
|
338
|
|
339
|
339
|
var tempOpspdiseinfos []service.OpspdiseinfoStruct
|
340
|
|
- var tempOpspdiseinfo service.OpspdiseinfoStruct
|
341
|
340
|
var tempOpspdiseinfo2 service.OpspdiseinfoStruct
|
342
|
|
- sickConfig, _ := service.FindDiagnoseById(his.Diagnosis)
|
343
|
|
- sickConfigTwo, _ := service.FindSickById(his.SickType)
|
344
|
|
- tempOpspdiseinfo.DiagCode = sickConfig.CountryCode
|
345
|
|
- tempOpspdiseinfo.DiagName = sickConfig.CountryContentName
|
346
|
|
- tempOpspdiseinfo.MaindiagFlag = "1"
|
347
|
|
- tempOpspdiseinfo.OprnOprtCode = ""
|
348
|
|
- tempOpspdiseinfo.OprnOprtName = ""
|
|
341
|
+ //sickConfig, _ := service.FindDiagnoseById(his.Diagnosis)
|
|
342
|
+
|
|
343
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
|
344
|
+ var config []*models.HisXtDiagnoseConfig
|
|
345
|
+ for _, item := range diagnosis_ids {
|
|
346
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
347
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
348
|
+ config = append(config, diagnosisConfig)
|
|
349
|
+ }
|
349
|
350
|
|
350
|
|
- tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo)
|
|
351
|
+ for _, item := range config {
|
|
352
|
+ var tempOpspdiseinfo service.OpspdiseinfoStruct
|
|
353
|
+ tempOpspdiseinfo.DiagCode = item.CountryCode
|
|
354
|
+ tempOpspdiseinfo.DiagName = item.CountryContentName
|
|
355
|
+ tempOpspdiseinfo.MaindiagFlag = "1"
|
|
356
|
+ tempOpspdiseinfo.OprnOprtCode = ""
|
|
357
|
+ tempOpspdiseinfo.OprnOprtName = ""
|
|
358
|
+ tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo)
|
|
359
|
+ }
|
|
360
|
+
|
|
361
|
+ sickConfigTwo, _ := service.FindSickById(his.SickType)
|
351
|
362
|
tempOpspdiseinfo2.DiagCode = sickConfigTwo.CountryCode
|
352
|
363
|
tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
|
353
|
364
|
tempOpspdiseinfo2.MaindiagFlag = "2"
|
|
@@ -1810,7 +1821,7 @@ func (c *HisApiController) GetUploadInfo() {
|
1810
|
1821
|
fapiao_code := c.GetString("fapiao_code")
|
1811
|
1822
|
fapiao_number := c.GetString("fapiao_number")
|
1812
|
1823
|
|
1813
|
|
- diagnosis_id, _ := c.GetInt64("diagnosis")
|
|
1824
|
+ diagnosis_id := c.GetString("diagnosis")
|
1814
|
1825
|
sick_type, _ := c.GetInt64("sick_type")
|
1815
|
1826
|
reg_type, _ := c.GetInt64("p_type")
|
1816
|
1827
|
|
|
@@ -1865,33 +1876,31 @@ func (c *HisApiController) GetUploadInfo() {
|
1865
|
1876
|
miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
1866
|
1877
|
department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
1867
|
1878
|
|
1868
|
|
- diagnosisConfig, _ := service.FindDiagnoseById(diagnosis_id)
|
1869
|
|
- sickConfig, _ := service.FindSickById(sick_type)
|
|
1879
|
+ diagnosis_ids := strings.Split(diagnosis_id, ",")
|
1870
|
1880
|
|
|
1881
|
+ var config []*models.HisXtDiagnoseConfig
|
|
1882
|
+ for _, item := range diagnosis_ids {
|
|
1883
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
1884
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
1885
|
+ config = append(config, diagnosisConfig)
|
|
1886
|
+ }
|
|
1887
|
+
|
|
1888
|
+ sickConfig, _ := service.FindSickById(sick_type)
|
1871
|
1889
|
if tempOrder.ID == 0 {
|
|
1890
|
+ var result string
|
|
1891
|
+ if miConfig.InsuplcAdmdvs == "440781" { //
|
|
1892
|
+ result = service.Gdyb2203A(his.PsnNo, his.Number, patientPrescription.Doctor, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), patientPrescription.DoctorId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.CountryCode, sickConfig.ClassName, roles.UserName, config)
|
|
1893
|
+ } else {
|
|
1894
|
+ result = service.Gdyb2203(his.PsnNo, his.Number, patientPrescription.Doctor, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), patientPrescription.DoctorId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.CountryCode, sickConfig.ClassName, roles.UserName, config)
|
1872
|
1895
|
|
1873
|
|
- api2 := "http://127.0.0.1:9532/" + "gdyb/four?psn_no=" + his.PsnNo +
|
1874
|
|
- "&mdtrt_id=" + his.Number + "&doctor=" + patientPrescription.Doctor + "&department=" + department.Name +
|
1875
|
|
- "&diag=" + diagnosisConfig.ClassName + "&org_name=" + miConfig.OrgName + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&doctor_id=" + strconv.FormatInt(patientPrescription.DoctorId, 10) + "&fixmedins_code=" + miConfig.Code + "&diag_code=" + diagnosisConfig.CountryCode +
|
1876
|
|
- "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&sick_code=" + sickConfig.CountryCode + "&sick_name=" + sickConfig.ClassName + "&dept=" + roles.UserName
|
1877
|
|
- resp2, requestErr2 := http.Get(api2)
|
1878
|
|
- if requestErr2 != nil {
|
1879
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
1880
|
|
- return
|
1881
|
|
- }
|
1882
|
|
- body2, ioErr2 := ioutil.ReadAll(resp2.Body)
|
1883
|
|
- if ioErr2 != nil {
|
1884
|
|
- utils.ErrorLog("接口返回数据读取失败: %v", ioErr2)
|
1885
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
1886
|
|
- return
|
1887
|
1896
|
}
|
|
1897
|
+
|
1888
|
1898
|
var respJSON2 map[string]interface{}
|
1889
|
|
- if err := json.Unmarshal([]byte(string(body2)), &respJSON2); err != nil {
|
|
1899
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
|
1890
|
1900
|
utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
1891
|
1901
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
1892
|
1902
|
return
|
1893
|
1903
|
}
|
1894
|
|
- respJSON2 = respJSON2["data"].(map[string]interface{})["pre"].(map[string]interface{})
|
1895
|
1904
|
userJSONBytes2, _ := json.Marshal(respJSON2)
|
1896
|
1905
|
|
1897
|
1906
|
var res2 ResultSix
|
|
@@ -1920,7 +1929,7 @@ func (c *HisApiController) GetUploadInfo() {
|
1920
|
1929
|
return
|
1921
|
1930
|
|
1922
|
1931
|
} else {
|
1923
|
|
- his.Diagnosis = diagnosisConfig.ID
|
|
1932
|
+ his.Diagnosis = diagnosis_id
|
1924
|
1933
|
his.SickType = sickConfig.ID
|
1925
|
1934
|
his.PType = fmt.Sprintf("%d", reg_type)
|
1926
|
1935
|
service.UpdateHisPatientThree(&his)
|
|
@@ -2047,6 +2056,7 @@ func (c *HisApiController) GetUploadInfo() {
|
2047
|
2056
|
FaPiaoNumber: fapiao_number,
|
2048
|
2057
|
FaPiaoCode: fapiao_code,
|
2049
|
2058
|
PType: 2,
|
|
2059
|
+ Diagnosis: diagnosis_id,
|
2050
|
2060
|
}
|
2051
|
2061
|
err = service.CreateOrder(order)
|
2052
|
2062
|
if err != nil {
|
|
@@ -2456,6 +2466,7 @@ func (c *HisApiController) GetUploadInfo() {
|
2456
|
2466
|
order.Creator = order.Creator
|
2457
|
2467
|
order.Modify = roles.AdminUserId
|
2458
|
2468
|
order.RequestLog = src_resquest
|
|
2469
|
+ order.Diagnosis = diagnosis_id
|
2459
|
2470
|
setlDetail, _ := json.Marshal(res.Output.Setldetail)
|
2460
|
2471
|
detailStr := string(setlDetail)
|
2461
|
2472
|
order.SetlDetail = detailStr
|
|
@@ -3010,7 +3021,7 @@ func (c *HisApiController) GetPreUploadInfo() {
|
3010
|
3021
|
settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
|
3011
|
3022
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
3012
|
3023
|
|
3013
|
|
- diagnosis_id, _ := c.GetInt64("diagnosis")
|
|
3024
|
+ diagnosis_id := c.GetString("diagnosis")
|
3014
|
3025
|
sick_type, _ := c.GetInt64("sick_type")
|
3015
|
3026
|
reg_type, _ := c.GetInt64("p_type")
|
3016
|
3027
|
|
|
@@ -3024,7 +3035,16 @@ func (c *HisApiController) GetPreUploadInfo() {
|
3024
|
3035
|
recordDateTime := theTime.Unix()
|
3025
|
3036
|
adminUser := c.GetAdminUserInfo()
|
3026
|
3037
|
|
3027
|
|
- diagnosisConfig, _ := service.FindDiagnoseById(diagnosis_id)
|
|
3038
|
+ diagnosis_ids := strings.Split(diagnosis_id, ",")
|
|
3039
|
+
|
|
3040
|
+ var config []*models.HisXtDiagnoseConfig
|
|
3041
|
+ for _, item := range diagnosis_ids {
|
|
3042
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
3043
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
3044
|
+ config = append(config, diagnosisConfig)
|
|
3045
|
+ }
|
|
3046
|
+ //diagnosisConfig, _ := service.FindDiagnoseById(diagnosis_id)
|
|
3047
|
+
|
3028
|
3048
|
sickConfig, _ := service.FindSickById(sick_type)
|
3029
|
3049
|
|
3030
|
3050
|
var prescriptions []*models.HisPrescription
|
|
@@ -3045,28 +3065,20 @@ func (c *HisApiController) GetPreUploadInfo() {
|
3045
|
3065
|
department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
|
3046
|
3066
|
strconv.FormatInt(his.PatientId, 10)
|
3047
|
3067
|
|
3048
|
|
- api2 := "http://127.0.0.1:9532/" + "gdyb/four?psn_no=" + his.PsnNo +
|
3049
|
|
- "&mdtrt_id=" + his.Number + "&doctor=" + patientPrescription.Doctor + "&department=" + department.Name +
|
3050
|
|
- "&diag=" + diagnosisConfig.ClassName + "&org_name=" + miConfig.OrgName + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&doctor_id=" + strconv.FormatInt(patientPrescription.DoctorId, 10) + "&fixmedins_code=" + miConfig.Code + "&diag_code=" + diagnosisConfig.CountryCode +
|
3051
|
|
- "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&sick_code=" + sickConfig.CountryCode + "&sick_name=" + sickConfig.ClassName + "&dept=" + roles.UserName
|
3052
|
|
- resp2, requestErr2 := http.Get(api2)
|
3053
|
|
- if requestErr2 != nil {
|
3054
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3055
|
|
- return
|
3056
|
|
- }
|
3057
|
|
- body2, ioErr2 := ioutil.ReadAll(resp2.Body)
|
3058
|
|
- if ioErr2 != nil {
|
3059
|
|
- utils.ErrorLog("接口返回数据读取失败: %v", ioErr2)
|
3060
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3061
|
|
- return
|
|
3068
|
+ var result string
|
|
3069
|
+ if miConfig.InsuplcAdmdvs == "440781" { //
|
|
3070
|
+ result = service.Gdyb2203A(his.PsnNo, his.Number, patientPrescription.Doctor, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), patientPrescription.DoctorId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.CountryCode, sickConfig.ClassName, roles.UserName, config)
|
|
3071
|
+ } else {
|
|
3072
|
+ result = service.Gdyb2203(his.PsnNo, his.Number, patientPrescription.Doctor, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), patientPrescription.DoctorId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.CountryCode, sickConfig.ClassName, roles.UserName, config)
|
|
3073
|
+
|
3062
|
3074
|
}
|
|
3075
|
+
|
3063
|
3076
|
var respJSON2 map[string]interface{}
|
3064
|
|
- if err := json.Unmarshal([]byte(string(body2)), &respJSON2); err != nil {
|
|
3077
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
|
3065
|
3078
|
utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
3066
|
3079
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3067
|
3080
|
return
|
3068
|
3081
|
}
|
3069
|
|
- respJSON2 = respJSON2["data"].(map[string]interface{})["pre"].(map[string]interface{})
|
3070
|
3082
|
userJSONBytes2, _ := json.Marshal(respJSON2)
|
3071
|
3083
|
|
3072
|
3084
|
var res2 ResultSix
|
|
@@ -3095,6 +3107,10 @@ func (c *HisApiController) GetPreUploadInfo() {
|
3095
|
3107
|
return
|
3096
|
3108
|
|
3097
|
3109
|
} else {
|
|
3110
|
+ his.Diagnosis = diagnosis_id
|
|
3111
|
+ his.SickType = sickConfig.ID
|
|
3112
|
+ his.PType = fmt.Sprintf("%d", reg_type)
|
|
3113
|
+ service.UpdateHisPatientThree(&his)
|
3098
|
3114
|
|
3099
|
3115
|
data := make(map[string]interface{})
|
3100
|
3116
|
if settle_accounts_type == 1 { //日结
|
|
@@ -3199,7 +3215,9 @@ func (c *HisApiController) GetPreUploadInfo() {
|
3199
|
3215
|
Creator: roles.AdminUserId,
|
3200
|
3216
|
Modify: roles.AdminUserId,
|
3201
|
3217
|
PType: 2,
|
|
3218
|
+ Diagnosis: diagnosis_id,
|
3202
|
3219
|
}
|
|
3220
|
+
|
3203
|
3221
|
err = service.CreateOrder(order)
|
3204
|
3222
|
if err != nil {
|
3205
|
3223
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreatePreOrderException)
|
|
@@ -4384,7 +4402,22 @@ func (c *HisApiController) GetSettleAccounts() {
|
4384
|
4402
|
orderInfos, _ := service.GetHisOrderInfoByNumber(order.Number)
|
4385
|
4403
|
orderInfos_two, _ := service.GetHisOrderInfoByNumberTwo(order.Number)
|
4386
|
4404
|
orderInfos = append(orderInfos, orderInfos_two...)
|
4387
|
|
- diagnosisConfig, _ := service.FindDiagnoseById(his.Diagnosis)
|
|
4405
|
+ //diagnosisConfig, _ := service.FindDiagnoseById(his.Diagnosis)
|
|
4406
|
+
|
|
4407
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
|
4408
|
+
|
|
4409
|
+ //var config []*models.HisXtDiagnoseConfig
|
|
4410
|
+ var name string
|
|
4411
|
+ for _, item := range diagnosis_ids {
|
|
4412
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
4413
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
4414
|
+ if len(name) == 0 {
|
|
4415
|
+ name = diagnosisConfig.ClassName
|
|
4416
|
+
|
|
4417
|
+ } else {
|
|
4418
|
+ name = name + "," + diagnosisConfig.ClassName
|
|
4419
|
+ }
|
|
4420
|
+ }
|
4388
|
4421
|
|
4389
|
4422
|
var bedCostTotal float64 = 0 //床位总费
|
4390
|
4423
|
var bedCostSelfTotal float64 = 0 //床位自费
|
|
@@ -4528,7 +4561,7 @@ func (c *HisApiController) GetSettleAccounts() {
|
4528
|
4561
|
|
4529
|
4562
|
if res.Infcode == 0 {
|
4530
|
4563
|
c.ServeSuccessJSON(map[string]interface{}{
|
4531
|
|
- "diagnosis": diagnosisConfig.CountryContentName,
|
|
4564
|
+ "diagnosis": name,
|
4532
|
4565
|
"order_infos": orderInfos,
|
4533
|
4566
|
"number": order.MdtrtId,
|
4534
|
4567
|
"date": order.SettleAccountsDate,
|