|
@@ -100,6 +100,55 @@ func HisManagerApiRegistRouters() {
|
100
|
100
|
|
101
|
101
|
beego.Router("/api/batch/settleaccount", &HisApiController{}, "get:GetBatchSettleAccounts")
|
102
|
102
|
|
|
103
|
+ beego.Router("/api/monthhispatient", &HisApiController{}, "get:GetMonthHisPatient")
|
|
104
|
+
|
|
105
|
+}
|
|
106
|
+func (c *HisApiController) GetMonthHisPatient() {
|
|
107
|
+ record_date := c.GetString("record_date")
|
|
108
|
+ //order_status, _ := c.GetInt64("type")
|
|
109
|
+
|
|
110
|
+ timeLayout := "2006-01-02"
|
|
111
|
+ loc, _ := time.LoadLocation("Local")
|
|
112
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
113
|
+ if err != nil {
|
|
114
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
115
|
+ return
|
|
116
|
+ }
|
|
117
|
+ recordDateTime := theTime.Unix()
|
|
118
|
+ adminInfo := c.GetAdminUserInfo()
|
|
119
|
+ var tempPatients []service.NewTempPatients
|
|
120
|
+ //tempPatients, _ := service.GetAllChargeHisPatientList(adminInfo.CurrentOrgId, "", recordDateTime)
|
|
121
|
+ // 获取当前时间
|
|
122
|
+ now := time.Now()
|
|
123
|
+ // 获取本月的第一天
|
|
124
|
+ firstDay := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, now.Location())
|
|
125
|
+ // 获取下个月的第一天
|
|
126
|
+ nextMonth := firstDay.AddDate(0, 1, 0)
|
|
127
|
+ // 获取本月的最后一天
|
|
128
|
+ lastDay := nextMonth.Add(-time.Nanosecond)
|
|
129
|
+ tempPatients, _ = service.GetMonthNewAllUnChargeHisPatientList(adminInfo.CurrentOrgId, "", recordDateTime, firstDay.Unix(), lastDay.Unix())
|
|
130
|
+
|
|
131
|
+ chargePatients, _ := service.GetChargeHisPatientList(adminInfo.CurrentOrgId, recordDateTime)
|
|
132
|
+
|
|
133
|
+ var patients []service.NewTempPatients
|
|
134
|
+ var patients_two []service.NewTempPatients
|
|
135
|
+
|
|
136
|
+ for _, item := range tempPatients {
|
|
137
|
+ //过滤掉没挂号的和没开处方的
|
|
138
|
+ if len(item.HisPatient) > 0 && len(item.HisPrescription) > 0 {
|
|
139
|
+ patients = append(patients, item)
|
|
140
|
+ }
|
|
141
|
+ ////过滤掉没挂号的
|
|
142
|
+ //if len(item.HisPatient) > 0 {
|
|
143
|
+ // patients_two = append(patients_two, item)
|
|
144
|
+ //}
|
|
145
|
+ }
|
|
146
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
147
|
+ "list": patients,
|
|
148
|
+ "list_two": patients_two,
|
|
149
|
+ "chargePatients": chargePatients,
|
|
150
|
+ })
|
|
151
|
+
|
103
|
152
|
}
|
104
|
153
|
|
105
|
154
|
func (c *HisApiController) GetBatchSettleAccounts() {
|