|
@@ -78,6 +78,9 @@ func HisProjectRouters() {
|
78
|
78
|
beego.Router("/api/hispatient/getchargeprint", &HisProjectApiController{}, "Get:GetChargePrint")
|
79
|
79
|
beego.Router("/api/hispatient/gettodayschedulepatient", &HisProjectApiController{}, "Get:GetTodaySchedulePatient")
|
80
|
80
|
beego.Router("/api/hispatient/gethispatientdetail", &HisProjectApiController{}, "Get:GetHisPatientDetail")
|
|
81
|
+
|
|
82
|
+ beego.Router("/api/hispatient/getalldepartmentlist", &HisProjectApiController{}, "Get:GetAllDepartmentList")
|
|
83
|
+ beego.Router("/api/hispatient/getprescription", &HisProjectApiController{}, "Get:GetPrescription")
|
81
|
84
|
}
|
82
|
85
|
|
83
|
86
|
func (this *HisProjectApiController) SaveProject() {
|
|
@@ -776,7 +779,8 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
776
|
779
|
recordDateStr := time.Now().Format("2006-01-02")
|
777
|
780
|
recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
778
|
781
|
nowtime := recordDate.Unix()
|
779
|
|
-
|
|
782
|
+ phone := this.GetString("phone")
|
|
783
|
+ social_type, _ := this.GetInt64("social_type")
|
780
|
784
|
bloodPatient, errcode := service.GetBloodPatientByIdCard(idcard, orgId)
|
781
|
785
|
if errcode == gorm.ErrRecordNotFound {
|
782
|
786
|
patient := models.XtHisPatient{
|
|
@@ -803,13 +807,15 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
803
|
807
|
RecordDate: nowtime,
|
804
|
808
|
IsReturn: 1,
|
805
|
809
|
Ctime: time.Now().Unix(),
|
|
810
|
+ Phone: phone,
|
|
811
|
+ SocialType: social_type,
|
806
|
812
|
}
|
807
|
813
|
err := service.CreateHisPatient(&patient)
|
808
|
814
|
lastPatient, err := service.GetLastPatient(orgId)
|
809
|
815
|
timeStr := time.Now().Format("2006-01-02")
|
810
|
816
|
timeArr := strings.Split(timeStr, "-")
|
811
|
817
|
var str = timeArr[0] + timeArr[1] + timeArr[2] + strconv.FormatInt(lastPatient.ID, 10)
|
812
|
|
- fmt.Println("str--------", str)
|
|
818
|
+
|
813
|
819
|
hisPatient := models.HisPatient{
|
814
|
820
|
Number: str,
|
815
|
821
|
}
|
|
@@ -844,6 +850,8 @@ func (this *HisProjectApiController) SaveHisPatient() {
|
844
|
850
|
UserOrgId: orgId,
|
845
|
851
|
PatientId: bloodPatient.ID,
|
846
|
852
|
Ctime: time.Now().Unix(),
|
|
853
|
+ Phone: phone,
|
|
854
|
+ SocialType: social_type,
|
847
|
855
|
}
|
848
|
856
|
err := service.CreateHisPatient(&patient)
|
849
|
857
|
if err != nil {
|
|
@@ -1363,3 +1371,36 @@ func (this *HisProjectApiController) GetHisPatientDetail() {
|
1363
|
1371
|
"hisPatient": hisPatient,
|
1364
|
1372
|
})
|
1365
|
1373
|
}
|
|
1374
|
+
|
|
1375
|
+func (this *HisProjectApiController) GetAllDepartmentList() {
|
|
1376
|
+
|
|
1377
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1378
|
+ orgId := adminUserInfo.CurrentOrgId
|
|
1379
|
+ departMent, err := service.GetAllDepartMent(orgId)
|
|
1380
|
+ if err != nil {
|
|
1381
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1382
|
+ return
|
|
1383
|
+ }
|
|
1384
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1385
|
+ "departMent": departMent,
|
|
1386
|
+ })
|
|
1387
|
+}
|
|
1388
|
+
|
|
1389
|
+func (this *HisProjectApiController) GetPrescription() {
|
|
1390
|
+
|
|
1391
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
1392
|
+ fmt.Println("patient_id", patient_id)
|
|
1393
|
+ timeStr := time.Now().Format("2006-01-02")
|
|
1394
|
+ timeLayout := "2006-01-02 15:04:05"
|
|
1395
|
+ fmt.Println("timeStr:", timeStr)
|
|
1396
|
+ timeStringToTime, _ := utils.ParseTimeStringToTime(timeLayout, timeStr+" 00:00:00")
|
|
1397
|
+ timenow := timeStringToTime.Unix()
|
|
1398
|
+ list, err := service.GetPrescriptionByPatientId(patient_id, timenow)
|
|
1399
|
+ if err != nil {
|
|
1400
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1401
|
+ return
|
|
1402
|
+ }
|
|
1403
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1404
|
+ "list": list,
|
|
1405
|
+ })
|
|
1406
|
+}
|