|
@@ -59,6 +59,7 @@ func HisProjectRouters() {
|
59
|
59
|
beego.Router("/api/patient/getpatientcasehistory", &HisProjectApiController{}, "Get:GetPatientcaseHistory")
|
60
|
60
|
beego.Router("/api/doctorworkstation/gettemplatedetail", &HisProjectApiController{}, "Get:GetTemplateDetail")
|
61
|
61
|
beego.Router("/api/doctorworkstation/updaterecordtemplate", &HisProjectApiController{}, "Get:UpdateRecordTemplate")
|
|
62
|
+ beego.Router("/api/hispatient/gehispatient", &HisProjectApiController{}, "Get:GetHisPatient")
|
62
|
63
|
}
|
63
|
64
|
|
64
|
65
|
func (this *HisProjectApiController) SaveProject() {
|
|
@@ -129,9 +130,7 @@ func (this *HisProjectApiController) SaveProject() {
|
129
|
130
|
}
|
130
|
131
|
//查询项目名称是否存在
|
131
|
132
|
_, errcode := service.GetHisProjectIsExist(project_name, orgId)
|
132
|
|
- fmt.Println("9999999999999", errcode)
|
133
|
133
|
if errcode == gorm.ErrRecordNotFound {
|
134
|
|
- fmt.Println("222")
|
135
|
134
|
err = service.CreateHisProject(&hisProject)
|
136
|
135
|
if err != nil {
|
137
|
136
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
@@ -160,7 +159,6 @@ func (this *HisProjectApiController) GetProjectList() {
|
160
|
159
|
|
161
|
160
|
keyword := this.GetString("keyword")
|
162
|
161
|
projecList, total, err := service.GetHisProjectList(orgId, limit, page, is_charge, is_start, keyword)
|
163
|
|
- fmt.Println("err", err)
|
164
|
162
|
if err != nil {
|
165
|
163
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
166
|
164
|
return
|
|
@@ -498,10 +496,8 @@ func (this *HisProjectApiController) GetBloodPatientList() {
|
498
|
496
|
|
499
|
497
|
adminUserInfo := this.GetAdminUserInfo()
|
500
|
498
|
orgId := adminUserInfo.CurrentOrgId
|
501
|
|
- fmt.Println("org", orgId)
|
502
|
499
|
timeStr := time.Now().Format("2006-01-02")
|
503
|
500
|
timeLayout := "2006-01-02 15:04:05"
|
504
|
|
- fmt.Println("timeStr:", timeStr)
|
505
|
501
|
timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
|
506
|
502
|
timenow := timeStringToTime.Unix()
|
507
|
503
|
|
|
@@ -528,7 +524,6 @@ func (this *HisProjectApiController) GetHisPrescription() {
|
528
|
524
|
id, _ := this.GetInt64("id")
|
529
|
525
|
timeStr := time.Now().Format("2006-01-02")
|
530
|
526
|
timeLayout := "2006-01-02 15:04:05"
|
531
|
|
- fmt.Println("timeStr:", timeStr)
|
532
|
527
|
timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
|
533
|
528
|
timenow := timeStringToTime.Unix()
|
534
|
529
|
prescriptionList, err := service.GetHisPrescriptionByPatientId(id, timenow)
|
|
@@ -549,14 +544,12 @@ func (this *HisProjectApiController) AdditionalCharge() {
|
549
|
544
|
fmt.Println(err)
|
550
|
545
|
his_patient_id := int64(dataBody["his_patient_id"].(float64))
|
551
|
546
|
patient_id := int64(dataBody["patient_id"].(float64))
|
552
|
|
- fmt.Println("patient_id2222222222", patient_id)
|
553
|
547
|
medicineData, _ := dataBody["medicineData"].([]interface{})
|
554
|
548
|
adminUserInfo := this.GetAdminUserInfo()
|
555
|
549
|
orgId := adminUserInfo.CurrentOrgId
|
556
|
550
|
admin_user_id := adminUserInfo.AdminUser.Id
|
557
|
551
|
timeStr := time.Now().Format("2006-01-02")
|
558
|
552
|
timeLayout := "2006-01-02 15:04:05"
|
559
|
|
- fmt.Println("timeStr:", timeStr)
|
560
|
553
|
timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
|
561
|
554
|
timenow := timeStringToTime.Unix()
|
562
|
555
|
for _, item := range medicineData {
|
|
@@ -594,7 +587,6 @@ func (this *HisProjectApiController) GetTreatmentList() {
|
594
|
587
|
patient_id, _ := this.GetInt64("patient_id")
|
595
|
588
|
timeStr := time.Now().Format("2006-01-02")
|
596
|
589
|
timeLayout := "2006-01-02 15:04:05"
|
597
|
|
- fmt.Println("timeStr:", timeStr)
|
598
|
590
|
timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
|
599
|
591
|
timenow := timeStringToTime.Unix()
|
600
|
592
|
treatmentList, err := service.GetTreatmentList(patient_id, timenow)
|
|
@@ -764,8 +756,7 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
764
|
756
|
adminUserInfo := this.GetAdminUserInfo()
|
765
|
757
|
orgId := adminUserInfo.CurrentOrgId
|
766
|
758
|
recordDateStr := time.Now().Format("2006-01-02")
|
767
|
|
- recordDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
768
|
|
- fmt.Println("parseDateErr", parseDateErr)
|
|
759
|
+ recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
769
|
760
|
nowtime := recordDate.Unix()
|
770
|
761
|
|
771
|
762
|
bloodPatient, errcode := service.GetBloodPatientByIdCard(idcard, orgId)
|
|
@@ -839,7 +830,6 @@ func (this *HisProjectApiController) GetAllProjectTeam() {
|
839
|
830
|
|
840
|
831
|
adminUserInfo := this.GetAdminUserInfo()
|
841
|
832
|
orgId := adminUserInfo.CurrentOrgId
|
842
|
|
- fmt.Println("aaa")
|
843
|
833
|
team, err := service.GetAllProjectTeam(orgId)
|
844
|
834
|
if err != nil {
|
845
|
835
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
@@ -875,7 +865,6 @@ func (this *HisProjectApiController) GetHisPatientHistory() {
|
875
|
865
|
register_type, _ := this.GetInt64("register_type")
|
876
|
866
|
limit, _ := this.GetInt64("limit")
|
877
|
867
|
page, _ := this.GetInt64("page")
|
878
|
|
- fmt.Println(keyword, start_time, end_time, register_type, limit, page)
|
879
|
868
|
startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
880
|
869
|
endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
881
|
870
|
adminUserInfo := this.GetAdminUserInfo()
|
|
@@ -902,8 +891,8 @@ func (this *HisProjectApiController) ChangePatient() {
|
902
|
891
|
id, _ := this.GetInt64("id")
|
903
|
892
|
//查询该患者今日是否已经就诊
|
904
|
893
|
recordDateStr := time.Now().Format("2006-01-02")
|
905
|
|
- recordDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
906
|
|
- fmt.Println("parseDateErr", parseDateErr)
|
|
894
|
+ recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
|
895
|
+
|
907
|
896
|
nowtime := recordDate.Unix()
|
908
|
897
|
adminUserInfo := this.GetAdminUserInfo()
|
909
|
898
|
orgId := adminUserInfo.CurrentOrgId
|
|
@@ -960,7 +949,6 @@ func (this *HisProjectApiController) GetTemplateDetail() {
|
960
|
949
|
func (this *HisProjectApiController) UpdateRecordTemplate() {
|
961
|
950
|
id, _ := this.GetInt64("id")
|
962
|
951
|
template_name := this.GetString("template_name")
|
963
|
|
- fmt.Println("template_name22222222222222", template_name)
|
964
|
952
|
template_remark := this.GetString("template_remark")
|
965
|
953
|
|
966
|
954
|
diagnostic := this.GetString("diagnostic")
|
|
@@ -994,3 +982,18 @@ func (this *HisProjectApiController) UpdateRecordTemplate() {
|
994
|
982
|
"templateDetail": historyTemplate,
|
995
|
983
|
})
|
996
|
984
|
}
|
|
985
|
+
|
|
986
|
+func (this *HisProjectApiController) GetHisPatient() {
|
|
987
|
+
|
|
988
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
989
|
+ orgId := adminUserInfo.CurrentOrgId
|
|
990
|
+ keyword := this.GetString("keyword")
|
|
991
|
+ patient, err := service.GetHistPatient(orgId, keyword)
|
|
992
|
+ if err != nil {
|
|
993
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
994
|
+ return
|
|
995
|
+ }
|
|
996
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
997
|
+ "patient": patient,
|
|
998
|
+ })
|
|
999
|
+}
|