|
@@ -80,6 +80,11 @@ func HisProjectRouters() {
|
80
|
80
|
beego.Router("/api/hispatient/getalldepartmentlist", &HisProjectApiController{}, "Get:GetAllDepartmentList")
|
81
|
81
|
beego.Router("/api/hispatient/getprescription", &HisProjectApiController{}, "Get:GetPrescription")
|
82
|
82
|
beego.Router("/api/histpatient/getpatientdetail", &HisProjectApiController{}, "Get:GetPatientDetail")
|
|
83
|
+ beego.Router("/api/hispatient/savemaintemplate", &HisProjectApiController{}, "Get:SaveMainTemplate")
|
|
84
|
+ beego.Router("/api/hispatient/getmedicaltemplatelist", &HisProjectApiController{}, "Get:GetMedicalTempalteList")
|
|
85
|
+ beego.Router("/api/hispatient/getmaintemplatebyid", &HisProjectApiController{}, "Get:GetMainTemplateById")
|
|
86
|
+ beego.Router("/api/hispatient/updatemaintemplate", &HisProjectApiController{}, "Get:UpdateMainTemplate")
|
|
87
|
+ beego.Router("/api/hispatient/deletemaintemplate", &HisProjectApiController{}, "Get:DeleteMainTemplate")
|
83
|
88
|
}
|
84
|
89
|
|
85
|
90
|
func (this *HisProjectApiController) SaveProject() {
|
|
@@ -932,8 +937,8 @@ func (this *HisProjectApiController) ChangePatient() {
|
932
|
937
|
func (this *HisProjectApiController) GetPatientcaseHistory() {
|
933
|
938
|
|
934
|
939
|
patient_id, _ := this.GetInt64("patient_id")
|
935
|
|
- patient, _ := service.GetBloodPatientInfoById(patient_id)
|
936
|
|
- history, err := service.GetPatientCaseHistory(patient_id)
|
|
940
|
+ patient, err := service.GetBloodPatientInfoById(patient_id)
|
|
941
|
+ history, _ := service.GetPatientCaseHistory(patient_id)
|
937
|
942
|
hispatient, _ := service.GetHisPatientById(patient_id)
|
938
|
943
|
|
939
|
944
|
if err != nil {
|
|
@@ -972,6 +977,8 @@ func (this *HisProjectApiController) UpdateRecordTemplate() {
|
972
|
977
|
past_history := this.GetString("past_history")
|
973
|
978
|
personal_history := this.GetString("personal_history")
|
974
|
979
|
family_history := this.GetString("family_history")
|
|
980
|
+ doctor_advice := this.GetString("doctor_advice")
|
|
981
|
+ remark := this.GetString("remark")
|
975
|
982
|
adminUserInfo := this.GetAdminUserInfo()
|
976
|
983
|
creater := adminUserInfo.AdminUser.Id
|
977
|
984
|
historyTemplate := models.HisCaseHistoryTemplate{
|
|
@@ -987,6 +994,8 @@ func (this *HisProjectApiController) UpdateRecordTemplate() {
|
987
|
994
|
TemplateName: template_name,
|
988
|
995
|
TemplateRemark: template_remark,
|
989
|
996
|
Modifier: creater,
|
|
997
|
+ DoctorAdvice: doctor_advice,
|
|
998
|
+ Remark: remark,
|
990
|
999
|
}
|
991
|
1000
|
err := service.UpdateCaseHistoryTemplate(&historyTemplate, id)
|
992
|
1001
|
if err != nil {
|
|
@@ -1403,3 +1412,109 @@ func (this *HisProjectApiController) GetPatientDetail() {
|
1403
|
1412
|
"patient": patient,
|
1404
|
1413
|
})
|
1405
|
1414
|
}
|
|
1415
|
+
|
|
1416
|
+func (this *HisProjectApiController) SaveMainTemplate() {
|
|
1417
|
+
|
|
1418
|
+ title := this.GetString("title")
|
|
1419
|
+ content := this.GetString("content")
|
|
1420
|
+ remark := this.GetString("remark")
|
|
1421
|
+ template_id, _ := this.GetInt64("template_id")
|
|
1422
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1423
|
+ orgId := adminUserInfo.CurrentOrgId
|
|
1424
|
+ template := models.XtHisMedicalTemplate{
|
|
1425
|
+ Title: title,
|
|
1426
|
+ Content: content,
|
|
1427
|
+ Remark: remark,
|
|
1428
|
+ UserOrgId: orgId,
|
|
1429
|
+ TemplateId: template_id,
|
|
1430
|
+ Status: 1,
|
|
1431
|
+ Ctime: time.Now().Unix(),
|
|
1432
|
+ }
|
|
1433
|
+ err := service.CreateHisMedicalTemplate(&template)
|
|
1434
|
+ if err != nil {
|
|
1435
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1436
|
+ return
|
|
1437
|
+ }
|
|
1438
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1439
|
+ "template": template,
|
|
1440
|
+ })
|
|
1441
|
+}
|
|
1442
|
+
|
|
1443
|
+func (this *HisProjectApiController) GetMedicalTempalteList() {
|
|
1444
|
+
|
|
1445
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1446
|
+ orgId := adminUserInfo.CurrentOrgId
|
|
1447
|
+ list, err := service.GetMedicalTemplateList(orgId)
|
|
1448
|
+ listOne, err := service.GetMedicalTemplateListOne(orgId)
|
|
1449
|
+ listTwo, err := service.GetMedicalTemplateListTwo(orgId)
|
|
1450
|
+ listThree, err := service.GetMedicalTemplateListThree(orgId)
|
|
1451
|
+ listFour, err := service.GetMedicalTemplateListFour(orgId)
|
|
1452
|
+ listFive, err := service.GetMedicalTemplateListFive(orgId)
|
|
1453
|
+ listSix, err := service.GetMedicalTemplateListSix(orgId)
|
|
1454
|
+ listSeven, err := service.GetMedicalTemplateListSeven(orgId)
|
|
1455
|
+ if err != nil {
|
|
1456
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1457
|
+ return
|
|
1458
|
+ }
|
|
1459
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1460
|
+ "list": list,
|
|
1461
|
+ "listOne": listOne,
|
|
1462
|
+ "listTwo": listTwo,
|
|
1463
|
+ "listThree": listThree,
|
|
1464
|
+ "listFour": listFour,
|
|
1465
|
+ "listFive": listFive,
|
|
1466
|
+ "listSix": listSix,
|
|
1467
|
+ "listSeven": listSeven,
|
|
1468
|
+ })
|
|
1469
|
+}
|
|
1470
|
+
|
|
1471
|
+func (this *HisProjectApiController) GetMainTemplateById() {
|
|
1472
|
+
|
|
1473
|
+ id, _ := this.GetInt64("id")
|
|
1474
|
+ template, err := service.GetMainTemplateById(id)
|
|
1475
|
+ if err != nil {
|
|
1476
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1477
|
+ return
|
|
1478
|
+ }
|
|
1479
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1480
|
+ "template": template,
|
|
1481
|
+ })
|
|
1482
|
+}
|
|
1483
|
+
|
|
1484
|
+func (this *HisProjectApiController) UpdateMainTemplate() {
|
|
1485
|
+
|
|
1486
|
+ title := this.GetString("title")
|
|
1487
|
+ content := this.GetString("content")
|
|
1488
|
+ remark := this.GetString("remark")
|
|
1489
|
+ id, _ := this.GetInt64("id")
|
|
1490
|
+
|
|
1491
|
+ template := models.XtHisMedicalTemplate{
|
|
1492
|
+ Title: title,
|
|
1493
|
+ Content: content,
|
|
1494
|
+ Remark: remark,
|
|
1495
|
+ }
|
|
1496
|
+
|
|
1497
|
+ err := service.UpdateMainTemplate(&template, id)
|
|
1498
|
+ if err != nil {
|
|
1499
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1500
|
+ return
|
|
1501
|
+ }
|
|
1502
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1503
|
+ "template": template,
|
|
1504
|
+ })
|
|
1505
|
+}
|
|
1506
|
+
|
|
1507
|
+func (this *HisProjectApiController) DeleteMainTemplate() {
|
|
1508
|
+
|
|
1509
|
+ id, _ := this.GetInt64("id")
|
|
1510
|
+ err := service.DeleteMainTemplateById(id)
|
|
1511
|
+ if err != nil {
|
|
1512
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
|
|
1513
|
+ return
|
|
1514
|
+ }
|
|
1515
|
+ returnData := make(map[string]interface{}, 0)
|
|
1516
|
+ returnData["msg"] = "ok"
|
|
1517
|
+ this.ServeSuccessJSON(returnData)
|
|
1518
|
+ return
|
|
1519
|
+
|
|
1520
|
+}
|