|
@@ -60,9 +60,9 @@ func HisManagerApiRegistRouters() {
|
60
|
60
|
beego.Router("/api/presettle/get", &HisApiController{}, "get:PreSettle")
|
61
|
61
|
|
62
|
62
|
beego.Router("/api/refund/post", &HisApiController{}, "post:Refund")
|
|
63
|
+ beego.Router("/api/refundnumber/post", &HisApiController{}, "post:RefundNumber")
|
63
|
64
|
|
64
|
65
|
beego.Router("/api/medicalinsurance/config", &HisApiController{}, "get:GetMedicalInsuranceConfig")
|
65
|
|
-
|
66
|
66
|
beego.Router("/api/doctor/list", &HisApiController{}, "get:GetAdminUsers")
|
67
|
67
|
|
68
|
68
|
//beego.Router("/api/medicalinsurance/config", &HisApiController{}, "get:GetMedicalInsuranceConfig")
|
|
@@ -3027,24 +3027,31 @@ func (c *HisApiController) GetUploadInfo() {
|
3027
|
3027
|
//退款
|
3028
|
3028
|
func (c *HisApiController) Refund() {
|
3029
|
3029
|
order_id, _ := c.GetInt64("order_id")
|
3030
|
|
- //number := c.GetString("number")
|
3031
|
|
-
|
3032
|
3030
|
order, _ := service.GetHisOrderByID(order_id)
|
3033
|
3031
|
adminUser := c.GetAdminUserInfo()
|
3034
|
|
- config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
|
3035
|
|
- if config.IsOpen == 1 { //对接了医保,走医保流程
|
3036
|
|
-
|
|
3032
|
+ err := service.UpdataOrderStatus(order_id, order.Number, adminUser.CurrentOrgId)
|
|
3033
|
+ if err == nil {
|
|
3034
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
3035
|
+ "msg": "退费成功",
|
|
3036
|
+ })
|
3037
|
3037
|
} else {
|
3038
|
|
- err := service.UpdataOrderStatus(order_id, order.Number, adminUser.CurrentOrgId)
|
3039
|
|
- if err == nil {
|
3040
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
3041
|
|
- "msg": "退费成功",
|
3042
|
|
- })
|
3043
|
|
- } else {
|
3044
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3045
|
|
- return
|
3046
|
|
- }
|
|
3038
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3039
|
+ return
|
|
3040
|
+ }
|
|
3041
|
+}
|
3047
|
3042
|
|
|
3043
|
+func (c *HisApiController) RefundNumber() {
|
|
3044
|
+ his_patient_id, _ := c.GetInt64("id")
|
|
3045
|
+ info, _ := service.GetNewHisPatientInfo(his_patient_id)
|
|
3046
|
+ info.Status = 0
|
|
3047
|
+ err := service.SaveHisPatient(info)
|
|
3048
|
+ if err == nil {
|
|
3049
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
3050
|
+ "msg": "退号成功",
|
|
3051
|
+ })
|
|
3052
|
+ } else {
|
|
3053
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3054
|
+ return
|
3048
|
3055
|
}
|
3049
|
3056
|
|
3050
|
3057
|
}
|
|
@@ -4307,6 +4314,14 @@ func (c *HisApiController) CreateHisPrescriptionTemplate() {
|
4307
|
4314
|
return
|
4308
|
4315
|
}
|
4309
|
4316
|
types := int64(items["type"].(float64))
|
|
4317
|
+
|
|
4318
|
+ if items["med_type"] == nil || reflect.TypeOf(items["med_type"]).String() != "float64" {
|
|
4319
|
+ utils.ErrorLog("med_type")
|
|
4320
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
4321
|
+ return
|
|
4322
|
+ }
|
|
4323
|
+ med_type := strconv.Itoa(int(items["med_type"].(float64)))
|
|
4324
|
+
|
4310
|
4325
|
ctime := time.Now().Unix()
|
4311
|
4326
|
prescription := &models.HisPrescriptionInfoTemplate{
|
4312
|
4327
|
PatientId: patient_id,
|
|
@@ -4318,6 +4333,7 @@ func (c *HisApiController) CreateHisPrescriptionTemplate() {
|
4318
|
4333
|
Creator: adminInfo.AdminUser.Id,
|
4319
|
4334
|
Status: 1,
|
4320
|
4335
|
PTemplateId: template.ID,
|
|
4336
|
+ MedType: med_type,
|
4321
|
4337
|
}
|
4322
|
4338
|
service.CreateHisPrescriptionInfoTemplate(prescription)
|
4323
|
4339
|
|
|
@@ -4610,6 +4626,7 @@ func (c *HisApiController) GetPrivateExpensesInfo() {
|
4610
|
4626
|
order_id, _ := c.GetInt64("id", 0)
|
4611
|
4627
|
his_patient_id, _ := c.GetInt64("his_patient_id", 0)
|
4612
|
4628
|
order, _ := service.GetHisOrderByID(order_id)
|
|
4629
|
+ role, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, c.GetAdminUserInfo().AdminUser.Id)
|
4613
|
4630
|
if order.ID == 0 {
|
4614
|
4631
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeOrderParamWrong)
|
4615
|
4632
|
return
|
|
@@ -4620,11 +4637,12 @@ func (c *HisApiController) GetPrivateExpensesInfo() {
|
4620
|
4637
|
order_info, _ := service.GetHisOrderDetailByNumber(order.Number, org_id)
|
4621
|
4638
|
patient, _ := service.GetPatientByID(org_id, order.PatientId)
|
4622
|
4639
|
c.ServeSuccessJSON(map[string]interface{}{
|
4623
|
|
- "order": order,
|
4624
|
|
- "order_info": order_info,
|
4625
|
|
- "patient": patient,
|
4626
|
|
- "admin_info": adminInfo,
|
4627
|
|
- "his": his,
|
|
4640
|
+ "order": order,
|
|
4641
|
+ "order_info": order_info,
|
|
4642
|
+ "patient": patient,
|
|
4643
|
+ "admin_info": adminInfo,
|
|
4644
|
+ "his": his,
|
|
4645
|
+ "current_admin": role,
|
4628
|
4646
|
})
|
4629
|
4647
|
|
4630
|
4648
|
}
|