|
@@ -5,7 +5,6 @@ import (
|
5
|
5
|
"XT_New/models"
|
6
|
6
|
"XT_New/service"
|
7
|
7
|
"XT_New/utils"
|
8
|
|
- "encoding/json"
|
9
|
8
|
"fmt"
|
10
|
9
|
"github.com/astaxie/beego"
|
11
|
10
|
"github.com/jinzhu/gorm"
|
|
@@ -52,6 +51,8 @@ func HisProjectRouters() {
|
52
|
51
|
beego.Router("/api/his/gettreatlist", &HisProjectApiController{}, "Get:GetTreatmentList")
|
53
|
52
|
beego.Router("/api/his/getpatientinformation", &HisProjectApiController{}, "Get:GetPatientInformation")
|
54
|
53
|
beego.Router("/api/hist/getallprojecteam", &HisProjectApiController{}, "Get:GetAllProjectTeam")
|
|
54
|
+ beego.Router("/api/his/getprojectlistbyid", &HisProjectApiController{}, "Get:GetProjectListById")
|
|
55
|
+ beego.Router("/api/his/gethispatienthistory", &HisProjectApiController{}, "Get:GetHisPatientHistory")
|
55
|
56
|
}
|
56
|
57
|
|
57
|
58
|
func (this *HisProjectApiController) SaveProject() {
|
|
@@ -768,13 +769,13 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
768
|
769
|
IsNeedCostOfProduction: cost_checked,
|
769
|
770
|
TreatmentCost: medicalExpense_float,
|
770
|
771
|
MedicalInsuranceNumber: medicalinsurancecard,
|
771
|
|
- Name: name,
|
772
|
|
- RegisterType: register,
|
773
|
|
- RegisterCost: registrationfees_float,
|
774
|
|
- BalanceAccountsType: settlementValue,
|
775
|
|
- Gender: sex,
|
776
|
|
- Total: totals_float,
|
777
|
|
- UserOrgId: orgId,
|
|
772
|
+ Name: name,
|
|
773
|
+ RegisterType: register,
|
|
774
|
+ RegisterCost: registrationfees_float,
|
|
775
|
+ BalanceAccountsType: settlementValue,
|
|
776
|
+ Gender: sex,
|
|
777
|
+ Total: totals_float,
|
|
778
|
+ UserOrgId: orgId,
|
778
|
779
|
}
|
779
|
780
|
err := service.CreateHisPatient(&patient)
|
780
|
781
|
if err != nil {
|
|
@@ -797,14 +798,14 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
797
|
798
|
IsNeedCostOfProduction: cost_checked,
|
798
|
799
|
TreatmentCost: medicalExpense_float,
|
799
|
800
|
MedicalInsuranceNumber: medicalinsurancecard,
|
800
|
|
- Name: name,
|
801
|
|
- RegisterType: register,
|
802
|
|
- RegisterCost: registrationfees_float,
|
803
|
|
- BalanceAccountsType: settlementValue,
|
804
|
|
- Gender: sex,
|
805
|
|
- Total: totals_float,
|
806
|
|
- UserOrgId: orgId,
|
807
|
|
- PatientId: bloodPatient.ID,
|
|
801
|
+ Name: name,
|
|
802
|
+ RegisterType: register,
|
|
803
|
+ RegisterCost: registrationfees_float,
|
|
804
|
+ BalanceAccountsType: settlementValue,
|
|
805
|
+ Gender: sex,
|
|
806
|
+ Total: totals_float,
|
|
807
|
+ UserOrgId: orgId,
|
|
808
|
+ PatientId: bloodPatient.ID,
|
808
|
809
|
}
|
809
|
810
|
err := service.CreateHisPatient(&patient)
|
810
|
811
|
if err != nil {
|
|
@@ -831,3 +832,42 @@ func (this *HisProjectApiController) GetAllProjectTeam() {
|
831
|
832
|
"team": team,
|
832
|
833
|
})
|
833
|
834
|
}
|
|
835
|
+
|
|
836
|
+func (this *HisProjectApiController) GetProjectListById() {
|
|
837
|
+
|
|
838
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
839
|
+ orgId := adminUserInfo.CurrentOrgId
|
|
840
|
+ project_id := this.GetString("project_id")
|
|
841
|
+ idStrs := strings.Split(project_id, ",")
|
|
842
|
+ project, err := service.GetProjectListById(orgId, idStrs)
|
|
843
|
+ if err != nil {
|
|
844
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
845
|
+ return
|
|
846
|
+ }
|
|
847
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
848
|
+ "project": project,
|
|
849
|
+ })
|
|
850
|
+}
|
|
851
|
+
|
|
852
|
+func (this *HisProjectApiController) GetHisPatientHistory() {
|
|
853
|
+ timeLayout := "2006-01-02"
|
|
854
|
+ loc, _ := time.LoadLocation("Local")
|
|
855
|
+ keyword := this.GetString("keyword")
|
|
856
|
+ start_time := this.GetString("start_time")
|
|
857
|
+ end_time := this.GetString("end_time")
|
|
858
|
+ register_type, _ := this.GetInt64("register_type")
|
|
859
|
+ limit, _ := this.GetInt64("limit")
|
|
860
|
+ page, _ := this.GetInt64("page")
|
|
861
|
+ fmt.Println(keyword, start_time, end_time, register_type, limit, page)
|
|
862
|
+ startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
863
|
+ endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
864
|
+ history, total, err := service.GetHisPatientHistory(keyword, startTime.Unix(), endTime.Unix(), register_type, limit, page)
|
|
865
|
+ if err != nil {
|
|
866
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
867
|
+ return
|
|
868
|
+ }
|
|
869
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
870
|
+ "history": history,
|
|
871
|
+ "total": total,
|
|
872
|
+ })
|
|
873
|
+}
|