Browse Source

体积小

XMLWAN 3 years ago
parent
commit
d7d00c246e

+ 53 - 0
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

@@ -50,6 +50,11 @@ func XcxApiControllersRegisterRouters() {
50 50
 	//获取机构医生护士的姓名
51 51
 	beego.Router("/xcx/api/mobile/getdoctorname", &XcxApiController{}, "Get:GetDoctorName")
52 52
 
53
+	//获取显示配置
54
+	beego.Router("/xcx/api/moible/getfieldconfig", &XcxApiController{}, "Get:GetFieldConfig")
55
+
56
+	//获取数据字典数据
57
+	beego.Router("/xcx/api/mobile/getdataconfig", &XcxApiController{}, "Get:GetDataConfig")
53 58
 }
54 59
 
55 60
 type XcxApiController struct {
@@ -634,3 +639,51 @@ func (this *XcxApiController) GetDoctorName() {
634 639
 		"user_name": user_name,
635 640
 	})
636 641
 }
642
+
643
+func (this *XcxApiController) GetFieldConfig() {
644
+
645
+	patient_id, _ := this.GetInt64("patient_id")
646
+	fmt.Println("patient_id", patient_id)
647
+	info, _ := service.GetXcxPatientInfo(patient_id)
648
+
649
+	//处方
650
+	prescripition_config, _ := service.GetPrescripionFieldConfig(info.UserOrgId)
651
+
652
+	//接诊评估
653
+	receive_treatement_config, _ := service.GetReceiveTreatmentAssess(info.UserOrgId)
654
+
655
+	//透前评估
656
+	dialysis_befor, _ := service.GetDialysisBefor(info.UserOrgId)
657
+
658
+	//透析上机
659
+	dialysis_order, _ := service.GetDialysisOrderConfig(info.UserOrgId)
660
+
661
+	//透析监测
662
+	monitor_record, _ := service.GetMonitorRecordConfig(info.UserOrgId)
663
+
664
+	//透后评估
665
+	dialysis_after, _ := service.GetDialysisAfeterConfig(info.UserOrgId)
666
+
667
+	treate_ment, _ := service.GetTreatMentConfig(info.UserOrgId)
668
+
669
+	this.ServeSuccessJSON(map[string]interface{}{
670
+		"prescripition_config":      prescripition_config,
671
+		"receive_treatement_config": receive_treatement_config,
672
+		"dialysis_befor":            dialysis_befor,
673
+		"dialysis_order":            dialysis_order,
674
+		"monitor_record":            monitor_record,
675
+		"dialysis_after":            dialysis_after,
676
+		"treate_ment":               treate_ment,
677
+	})
678
+}
679
+
680
+func (this *XcxApiController) GetDataConfig() {
681
+
682
+	patient_id, _ := this.GetInt64("patient_id")
683
+	fmt.Println("patient_id", patient_id)
684
+	info, _ := service.GetXcxPatientInfo(patient_id)
685
+	list, _ := service.GetDataConfig(info.UserOrgId)
686
+	this.ServeSuccessJSON(map[string]interface{}{
687
+		"list": list,
688
+	})
689
+}

+ 41 - 0
models/his_models.go View File

@@ -1472,3 +1472,44 @@ type XcxSgjUserAdminRole struct {
1472 1472
 func (XcxSgjUserAdminRole) TableName() string {
1473 1473
 	return "sgj_user_admin_role"
1474 1474
 }
1475
+
1476
+type XcxFiledConfig struct {
1477
+	ID          int64  `gorm:"column:id" json:"id" form:"id"`
1478
+	OrgId       int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
1479
+	Module      int64  `gorm:"column:module" json:"module" form:"module"`
1480
+	FiledName   string `gorm:"column:filed_name" json:"filed_name" form:"filed_name"`
1481
+	FiledNameCn string `gorm:"column:filed_name_cn" json:"filed_name_cn" form:"filed_name_cn"`
1482
+	IsShow      int64  `gorm:"column:is_show" json:"is_show" form:"is_show"`
1483
+	CreateTime  int64  `gorm:"column:create_time" json:"create_time" form:"create_time"`
1484
+	UpdateTime  int64  `gorm:"column:update_time" json:"update_time" form:"update_time"`
1485
+	SysModule   int64  `gorm:"column:sys_module" json:"sys_module" form:"sys_module"`
1486
+}
1487
+
1488
+func (XcxFiledConfig) TableName() string {
1489
+	return "xt_filed_config"
1490
+}
1491
+
1492
+type XcxDataConfig struct {
1493
+	ID             int64     `gorm:"column:id" json:"id" form:"id"`
1494
+	ParentId       int64     `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
1495
+	Module         string    `gorm:"column:module" json:"module" form:"module"`
1496
+	OrgId          int64     `gorm:"column:org_id" json:"org_id" form:"org_id"`
1497
+	Name           string    `gorm:"column:name" json:"name" form:"name"`
1498
+	FieldName      string    `gorm:"column:field_name" json:"field_name" form:"field_name"`
1499
+	Value          int64     `gorm:"column:value" json:"value" form:"value"`
1500
+	CreateTime     time.Time `gorm:"column:create_time" json:"create_time" form:"create_time"`
1501
+	UpdateTime     time.Time `gorm:"column:update_time" json:"update_time" form:"update_time"`
1502
+	CreateUserId   int64     `gorm:"column:create_user_id" json:"create_user_id" form:"create_user_id"`
1503
+	Status         int64     `gorm:"column:status" json:"status" form:"status"`
1504
+	Remark         string    `gorm:"column:remark" json:"remark" form:"remark"`
1505
+	DeleteIdSystem int64     `gorm:"column:delete_id_system" json:"delete_id_system" form:"delete_id_system"`
1506
+	Title          string    `gorm:"column:title" json:"title" form:"title"`
1507
+	Content        string    `gorm:"column:content" json:"content" form:"content"`
1508
+	Orders         int64     `gorm:"column:orders" json:"orders" form:"orders"`
1509
+	FieldType      int64     `gorm:"column:field_type" json:"field_type" form:"field_type"`
1510
+	Code           string    `gorm:"column:code" json:"code" form:"code"`
1511
+}
1512
+
1513
+func (XcxDataConfig) TableName() string {
1514
+	return "xt_data_config"
1515
+}

+ 45 - 0
service/xcx_mobile_api_service.go View File

@@ -505,3 +505,48 @@ func GetDoctorName(orgid int64) (role []*models.XcxSgjUserAdminRole, err error)
505 505
 	err = UserReadDB().Where("org_id = ? and status = 1", orgid).Find(&role).Error
506 506
 	return role, err
507 507
 }
508
+
509
+func GetPrescripionFieldConfig(orgid int64) (list []*models.XcxFiledConfig, err error) {
510
+
511
+	err = XTReadDB().Model(&list).Where("org_id = ? and module = 1 ", orgid).Find(&list).Error
512
+	return list, err
513
+}
514
+
515
+func GetReceiveTreatmentAssess(orgid int64) (list []*models.XcxFiledConfig, err error) {
516
+
517
+	err = XTReadDB().Model(&list).Where("org_id = ? and module = 2  ", orgid).Find(&list).Error
518
+	return list, err
519
+}
520
+
521
+func GetDialysisBefor(orgid int64) (list []*models.XcxFiledConfig, err error) {
522
+	err = XTReadDB().Model(&list).Where("org_id = ? and  module = 3", orgid).Find(&list).Error
523
+	return list, err
524
+}
525
+
526
+func GetDialysisOrderConfig(orgid int64) (list []*models.XcxFiledConfig, err error) {
527
+
528
+	err = XTReadDB().Model(&list).Where("org_id = ? and module = 7"+
529
+		"", orgid).Find(&list).Error
530
+	return list, err
531
+}
532
+
533
+func GetMonitorRecordConfig(orgid int64) (list []*models.XcxFiledConfig, err error) {
534
+	err = XTReadDB().Model(&list).Where("org_id = ? and module = 4", orgid).Find(&list).Error
535
+	return list, err
536
+}
537
+
538
+func GetDialysisAfeterConfig(orgid int64) (list []*models.XcxFiledConfig, err error) {
539
+	err = XTReadDB().Model(&list).Where("org_id = ? and module = 5", orgid).Find(&list).Error
540
+	return list, err
541
+}
542
+
543
+func GetTreatMentConfig(orgid int64) (list []*models.XcxFiledConfig, err error) {
544
+	err = XTReadDB().Model(&list).Where("org_id = ? and module = 6", orgid).Find(&list).Error
545
+	return list, err
546
+}
547
+
548
+func GetDataConfig(orgid int64) (list []*models.XcxDataConfig, err error) {
549
+
550
+	err = XTReadDB().Model(&list).Where("org_id = ? and org_id = 0 and status = 1", orgid).Find(&list).Error
551
+	return list, err
552
+}