|
@@ -757,6 +757,9 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
757
|
757
|
totals_float, _ := strconv.ParseFloat(totals, 64)
|
758
|
758
|
adminUserInfo := this.GetAdminUserInfo()
|
759
|
759
|
orgId := adminUserInfo.CurrentOrgId
|
|
760
|
+ timeStr := time.Now().Format("2006-01-02")
|
|
761
|
+ fmt.Println("timeStr:", timeStr)
|
|
762
|
+ timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
|
760
|
763
|
|
761
|
764
|
bloodPatient, errcode := service.GetBloodPatientByIdCard(idcard, orgId)
|
762
|
765
|
if errcode == gorm.ErrRecordNotFound {
|
|
@@ -779,6 +782,8 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
779
|
782
|
Gender: sex,
|
780
|
783
|
Total: totals_float,
|
781
|
784
|
UserOrgId: orgId,
|
|
785
|
+ Status: 1,
|
|
786
|
+ RecordDate: timeStringToTime.Unix(),
|
782
|
787
|
}
|
783
|
788
|
err := service.CreateHisPatient(&patient)
|
784
|
789
|
if err != nil {
|
|
@@ -864,13 +869,17 @@ func (this *HisProjectApiController) GetHisPatientHistory() {
|
864
|
869
|
fmt.Println(keyword, start_time, end_time, register_type, limit, page)
|
865
|
870
|
startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
866
|
871
|
endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
867
|
|
- history, total, err := service.GetHisPatientHistory(keyword, startTime.Unix(), endTime.Unix(), register_type, limit, page)
|
|
872
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
873
|
+ orgId := adminUserInfo.CurrentOrgId
|
|
874
|
+ history, total, err := service.GetHisPatientHistory(keyword, startTime.Unix(), endTime.Unix(), register_type, limit, page, orgId)
|
|
875
|
+ department, err := service.GetAllDepartMent(orgId)
|
868
|
876
|
if err != nil {
|
869
|
877
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
870
|
878
|
return
|
871
|
879
|
}
|
872
|
880
|
this.ServeSuccessJSON(map[string]interface{}{
|
873
|
|
- "history": history,
|
874
|
|
- "total": total,
|
|
881
|
+ "history": history,
|
|
882
|
+ "total": total,
|
|
883
|
+ "department": department,
|
875
|
884
|
})
|
876
|
885
|
}
|