|
@@ -76,6 +76,9 @@ func HisProjectRouters() {
|
76
|
76
|
beego.Router("/api/hispatient/getchargeprint", &HisProjectApiController{}, "Get:GetChargePrint")
|
77
|
77
|
beego.Router("/api/hispatient/gettodayschedulepatient", &HisProjectApiController{}, "Get:GetTodaySchedulePatient")
|
78
|
78
|
beego.Router("/api/hispatient/gethispatientdetail", &HisProjectApiController{}, "Get:GetHisPatientDetail")
|
|
79
|
+
|
|
80
|
+ beego.Router("/api/hispatient/getalldepartmentlist", &HisProjectApiController{}, "Get:GetAllDepartmentList")
|
|
81
|
+ beego.Router("/api/hispatient/getprescription", &HisProjectApiController{}, "Get:GetPrescription")
|
79
|
82
|
}
|
80
|
83
|
|
81
|
84
|
func (this *HisProjectApiController) SaveProject() {
|
|
@@ -729,7 +732,8 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
729
|
732
|
recordDateStr := time.Now().Format("2006-01-02")
|
730
|
733
|
recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
731
|
734
|
nowtime := recordDate.Unix()
|
732
|
|
-
|
|
735
|
+ phone := this.GetString("phone")
|
|
736
|
+ social_type, _ := this.GetInt64("social_type")
|
733
|
737
|
bloodPatient, errcode := service.GetBloodPatientByIdCard(idcard, orgId)
|
734
|
738
|
if errcode == gorm.ErrRecordNotFound {
|
735
|
739
|
patient := models.XtHisPatient{
|
|
@@ -756,13 +760,15 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
756
|
760
|
RecordDate: nowtime,
|
757
|
761
|
IsReturn: 1,
|
758
|
762
|
Ctime: time.Now().Unix(),
|
|
763
|
+ Phone: phone,
|
|
764
|
+ SocialType: social_type,
|
759
|
765
|
}
|
760
|
766
|
err := service.CreateHisPatient(&patient)
|
761
|
767
|
lastPatient, err := service.GetLastPatient(orgId)
|
762
|
768
|
timeStr := time.Now().Format("2006-01-02")
|
763
|
769
|
timeArr := strings.Split(timeStr, "-")
|
764
|
770
|
var str = timeArr[0] + timeArr[1] + timeArr[2] + strconv.FormatInt(lastPatient.ID, 10)
|
765
|
|
- fmt.Println("str--------", str)
|
|
771
|
+
|
766
|
772
|
hisPatient := models.HisPatient{
|
767
|
773
|
Number: str,
|
768
|
774
|
}
|
|
@@ -797,6 +803,8 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
797
|
803
|
UserOrgId: orgId,
|
798
|
804
|
PatientId: bloodPatient.ID,
|
799
|
805
|
Ctime: time.Now().Unix(),
|
|
806
|
+ Phone: phone,
|
|
807
|
+ SocialType: social_type,
|
800
|
808
|
}
|
801
|
809
|
err := service.CreateHisPatient(&patient)
|
802
|
810
|
if err != nil {
|
|
@@ -1316,3 +1324,36 @@ func (this *HisProjectApiController) GetHisPatientDetail() {
|
1316
|
1324
|
"hisPatient": hisPatient,
|
1317
|
1325
|
})
|
1318
|
1326
|
}
|
|
1327
|
+
|
|
1328
|
+func (this *HisProjectApiController) GetAllDepartmentList() {
|
|
1329
|
+
|
|
1330
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1331
|
+ orgId := adminUserInfo.CurrentOrgId
|
|
1332
|
+ departMent, err := service.GetAllDepartMent(orgId)
|
|
1333
|
+ if err != nil {
|
|
1334
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1335
|
+ return
|
|
1336
|
+ }
|
|
1337
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1338
|
+ "departMent": departMent,
|
|
1339
|
+ })
|
|
1340
|
+}
|
|
1341
|
+
|
|
1342
|
+func (this *HisProjectApiController) GetPrescription() {
|
|
1343
|
+
|
|
1344
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
1345
|
+ fmt.Println("patient_id", patient_id)
|
|
1346
|
+ timeStr := time.Now().Format("2006-01-02")
|
|
1347
|
+ timeLayout := "2006-01-02 15:04:05"
|
|
1348
|
+ fmt.Println("timeStr:", timeStr)
|
|
1349
|
+ timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
|
|
1350
|
+ timenow := timeStringToTime.Unix()
|
|
1351
|
+ list, err := service.GetPrescriptionByPatientId(patient_id, timenow)
|
|
1352
|
+ if err != nil {
|
|
1353
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1354
|
+ return
|
|
1355
|
+ }
|
|
1356
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1357
|
+ "list": list,
|
|
1358
|
+ })
|
|
1359
|
+}
|