|
@@ -67,6 +67,9 @@ func DoctorApiRegistRouters() {
|
67
|
67
|
beego.Router("/api/patient/deletefirstdisease", &DoctorsApiController{}, "Get:DeleteFirstDisease")
|
68
|
68
|
|
69
|
69
|
beego.Router("/api/schedule/new/long/advices", &DoctorsApiController{}, "Get:GetLongScheduleAdvicesList")
|
|
70
|
+
|
|
71
|
+ beego.Router("/api/schedule/getpatientbyname", &DoctorsApiController{}, "Get:GetPatientByName")
|
|
72
|
+ beego.Router("/api/schedule/getdocadvicebypatientid", &DoctorsApiController{}, "Get:GetDoctorAdviceByPatientId")
|
70
|
73
|
}
|
71
|
74
|
|
72
|
75
|
func (c *DoctorsApiController) ScheduleAdvices() {
|
|
@@ -825,7 +828,7 @@ func (this *DoctorsApiController) GetInitDateList() {
|
825
|
828
|
startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
826
|
829
|
end_time := this.GetString("end_time")
|
827
|
830
|
endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
828
|
|
- fmt.Println("endtime2323232233223232332", endTime)
|
|
831
|
+
|
829
|
832
|
prescription_list, _ := service.GetDialysisPrescriptionDataList(patient_id, startTime.Unix(), endTime.Unix())
|
830
|
833
|
befor_list, err := service.GetDialysisBeforInitDateList(patient_id, startTime.Unix(), endTime.Unix())
|
831
|
834
|
after_list, err := service.GetDialysisAssementAfter(patient_id, startTime.Unix(), endTime.Unix())
|
|
@@ -1244,10 +1247,10 @@ func (this *DoctorsApiController) GetHospitalSummaryList() {
|
1244
|
1247
|
orgId := this.GetAdminUserInfo().CurrentOrgId
|
1245
|
1248
|
patient_id, _ := this.GetInt64("patient_id")
|
1246
|
1249
|
start_time := this.GetString("start_time")
|
1247
|
|
- fmt.Println("start_tim232232323232323232323232332", start_time)
|
|
1250
|
+
|
1248
|
1251
|
dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
1249
|
1252
|
startime := dischargeTimes.Unix()
|
1250
|
|
- fmt.Println("startime1111111111111111111111", startime)
|
|
1253
|
+
|
1251
|
1254
|
end_time := this.GetString("end_time")
|
1252
|
1255
|
endTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
|
1253
|
1256
|
endtime := endTimes.Unix()
|
|
@@ -1671,3 +1674,59 @@ func (c *DoctorsApiController) GetLongScheduleAdvicesList() {
|
1671
|
1674
|
}
|
1672
|
1675
|
|
1673
|
1676
|
}
|
|
1677
|
+
|
|
1678
|
+func (c *DoctorsApiController) GetPatientByName() {
|
|
1679
|
+
|
|
1680
|
+ keyword := c.GetString("keyword")
|
|
1681
|
+ orgId := c.GetAdminUserInfo().CurrentOrgId
|
|
1682
|
+ patients, _ := service.GetPatientByName(keyword, orgId)
|
|
1683
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1684
|
+ "patients": patients,
|
|
1685
|
+ })
|
|
1686
|
+}
|
|
1687
|
+
|
|
1688
|
+func (c *DoctorsApiController) GetDoctorAdviceByPatientId() {
|
|
1689
|
+
|
|
1690
|
+ patient_id, _ := c.GetInt64("patient_id")
|
|
1691
|
+ limit, _ := c.GetInt64("limit")
|
|
1692
|
+ page, _ := c.GetInt64("page")
|
|
1693
|
+ start_time := c.GetString("start_time")
|
|
1694
|
+ orgId := c.GetAdminUserInfo().CurrentOrgId
|
|
1695
|
+ end_time := c.GetString("end_time")
|
|
1696
|
+
|
|
1697
|
+ fmt.Println("patient_id", patient_id)
|
|
1698
|
+ fmt.Println("startdateunix", start_time)
|
|
1699
|
+ fmt.Println("enddateunix", end_time)
|
|
1700
|
+ fmt.Println("limit", limit)
|
|
1701
|
+ fmt.Println("page", page)
|
|
1702
|
+
|
|
1703
|
+ timeLayout := "2006-01-02"
|
|
1704
|
+ loc, _ := time.LoadLocation("Local")
|
|
1705
|
+
|
|
1706
|
+ var startTimeUnix int64
|
|
1707
|
+ if len(start_time) > 0 {
|
|
1708
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
1709
|
+ if err != nil {
|
|
1710
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
1711
|
+ return
|
|
1712
|
+ }
|
|
1713
|
+ startTimeUnix = theTime.Unix()
|
|
1714
|
+ }
|
|
1715
|
+
|
|
1716
|
+ var endTimeUnix int64
|
|
1717
|
+ if len(end_time) > 0 {
|
|
1718
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
|
|
1719
|
+ if err != nil {
|
|
1720
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
1721
|
+ return
|
|
1722
|
+ }
|
|
1723
|
+ endTimeUnix = theTime.Unix()
|
|
1724
|
+ }
|
|
1725
|
+
|
|
1726
|
+ list, total, _ := service.GetDoctorAdviceByPatientId(patient_id, orgId, startTimeUnix, endTimeUnix, limit, page)
|
|
1727
|
+
|
|
1728
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1729
|
+ "list": list,
|
|
1730
|
+ "total": total,
|
|
1731
|
+ })
|
|
1732
|
+}
|