|
@@ -745,6 +745,43 @@ func (c *CheckWeightApiController) GetPatientListForSchedules() {
|
745
|
745
|
})
|
746
|
746
|
}
|
747
|
747
|
|
|
748
|
+func (c *CheckWeightApiController) GetPatientListForSchedulesFind() {
|
|
749
|
+ patient_name := c.GetString("patient_name") //脉率
|
|
750
|
+ thisTime := time.Now()
|
|
751
|
+ scheduleDateStart := thisTime.Format("2006-01-02") + " 00:00:00"
|
|
752
|
+ timeLayout := "2006-01-02 15:04:05"
|
|
753
|
+ loc, _ := time.LoadLocation("Local")
|
|
754
|
+ theStartTime, _ := time.ParseInLocation(timeLayout, scheduleDateStart, loc)
|
|
755
|
+ syncTime := theStartTime.Unix()
|
|
756
|
+ adminUserInfo := c.GetMobileAdminUserInfo()
|
|
757
|
+ if len(patient_name) == 0 {
|
|
758
|
+ patientList, total, error := service.GetPatientListBySchedules(adminUserInfo.Org.Id, syncTime)
|
|
759
|
+ } else {
|
|
760
|
+ patientList, total, error := service.GetPatientListBySchedulesFind(adminUserInfo.Org.Id, syncTime,patient_name)
|
|
761
|
+ }
|
|
762
|
+ patientSchedule := make([]map[string]interface{},0)
|
|
763
|
+ for _, item := range patientList {
|
|
764
|
+ patientTemp := make(map[string]interface{})
|
|
765
|
+ patientTemp["patient_id"] = item.PatientId
|
|
766
|
+ patientTemp["patient_name"] = item.Patient.Name
|
|
767
|
+ patientTemp["schedule_type"] = item.ScheduleType
|
|
768
|
+ patientSchedule = append(patientSchedule, patientTemp)
|
|
769
|
+ }
|
|
770
|
+
|
|
771
|
+ if error != nil {
|
|
772
|
+ c.ErrorLog("获取病人列表失败:%v", error)
|
|
773
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
774
|
+ return
|
|
775
|
+ }
|
|
776
|
+ serviceTime := time.Now().Unix()
|
|
777
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
778
|
+ "patientlist": patientSchedule,
|
|
779
|
+ "total": total,
|
|
780
|
+ "servicetime": serviceTime,
|
|
781
|
+ })
|
|
782
|
+}
|
|
783
|
+
|
|
784
|
+
|
748
|
785
|
|
749
|
786
|
func (c *CheckWeightApiController) GetPatientListById() {
|
750
|
787
|
patientId, _ := c.GetInt64("patient_id", 0)
|