Explorar el Código

Merge branch '20201014_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20201014_xt_api_new_branch

csx hace 4 años
padre
commit
aaa6578ad8

+ 7 - 1
controllers/dialysis_api_controller.go Ver fichero

@@ -243,6 +243,7 @@ func (c *DialysisApiController) PostPrescription() {
243 243
 	//push_the_protamine := c.GetString("push_the_protamine")
244 244
 	//fmt.Println("下机前推注鱼精蛋白",push_the_protamine)
245 245
 	// var prescription_doctor int64
246
+	blood := c.GetString("blood")
246 247
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
247 248
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
248 249
 
@@ -321,6 +322,7 @@ func (c *DialysisApiController) PostPrescription() {
321 322
 		PreImpulse:                 preImpules,
322 323
 		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
323 324
 		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
325
+		Blood:                      blood,
324 326
 	}
325 327
 
326 328
 	if appRole.UserType == 2 || appRole.UserType == 1 {
@@ -486,7 +488,7 @@ func (c *DialysisApiController) PostSoulution() {
486 488
 
487 489
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
488 490
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
489
-
491
+	blood := c.GetString("blood")
490 492
 	var prescription_doctor int64
491 493
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentAppId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
492 494
 
@@ -576,6 +578,7 @@ func (c *DialysisApiController) PostSoulution() {
576 578
 
577 579
 		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
578 580
 		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
581
+		Blood:                     blood,
579 582
 	}
580 583
 
581 584
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(patient, recordDate.Unix(), adminUserInfo.CurrentOrgId)
@@ -1011,6 +1014,7 @@ func (c *DialysisApiController) PostAssessmentAfterDislysis() {
1011 1014
 	assessment.SupineDiastolicBloodPressure = data.SupineDiastolicBloodPressure
1012 1015
 	assessment.DiastolicPressure = data.DiastolicPressure
1013 1016
 	assessment.AdditionalWeight = data.AdditionalWeight
1017
+	assessment.OtherComplication = data.OtherComplication
1014 1018
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1015 1019
 
1016 1020
 	if assessment.ID > 0 {
@@ -1135,6 +1139,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1135 1139
 	edema := c.GetString("edema")
1136 1140
 	urine_volume, _ := c.GetFloat("urine_volume", 0)
1137 1141
 	special_treatment := c.GetString("special_treatment")
1142
+	catheter_maintenance := c.GetString("catheter_maintenance")
1138 1143
 	assessmentBeforeDislysis := models.PredialysisEvaluation{
1139 1144
 		DialysisCount:                  dialysis_count,
1140 1145
 		EmergencyTreatment:             emergency_treatment,
@@ -1191,6 +1196,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
1191 1196
 		Edema:                          edema,
1192 1197
 		UrineVolume:                    urine_volume,
1193 1198
 		SpecialTreatment:               special_treatment,
1199
+		CatheterMaintenance:            catheter_maintenance,
1194 1200
 	}
1195 1201
 
1196 1202
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)

+ 99 - 47
controllers/his_api_controller.go Ver fichero

@@ -9,6 +9,7 @@ import (
9 9
 	"encoding/json"
10 10
 	"fmt"
11 11
 	"github.com/astaxie/beego"
12
+	"github.com/jinzhu/gorm"
12 13
 	"io/ioutil"
13 14
 	"math/rand"
14 15
 	"net/http"
@@ -39,10 +40,10 @@ func HisManagerApiRegistRouters() {
39 40
 
40 41
 	beego.Router("/api/doctorworkstation/casehistory/list", &HisApiController{}, "get:GetHisPatientCaseHistoryList")
41 42
 	beego.Router("/api/doctorworkstation/casehistory/get", &HisApiController{}, "get:GetHisPatientCaseHistory")
42
-	beego.Router("/api/doctorworkstation/casehistory/create", &HisApiController{}, "post:CreateHisPatientCaseHistory")
43
-	beego.Router("/api/doctorworkstation/casehistorytemplate/create", &HisApiController{}, "post:CreateCaseHistoryTemplate")
43
+	beego.Router("/api/doctorworkstation/casehistory/create", &HisApiController{}, "get:CreateHisPatientCaseHistory")
44
+	beego.Router("/api/doctorworkstation/casehistorytemplate/create", &HisApiController{}, "get:CreateCaseHistoryTemplate")
44 45
 	beego.Router("/api/doctorworkstation/casehistorytemplate/get", &HisApiController{}, "get:GetCaseHistoryTemplate")
45
-	beego.Router("/api/doctorworkstation/printcasehistory/get", &HisApiController{}, "get:GetPrintHisPatientCaseHistory")
46
+	//beego.Router("/api/doctorworkstation/printcasehistory/get", &HisApiController{}, "get:GetPrintHisPatientCaseHistory")
46 47
 
47 48
 	beego.Router("/api/hisorder/list", &HisApiController{}, "get:GetHisOrderList")
48 49
 
@@ -468,25 +469,50 @@ func (c *HisApiController) CreateHisAdditionalCharge() {
468 469
 }
469 470
 
470 471
 func (c *HisApiController) CreateHisPatientCaseHistory() {
471
-	diagnostic := c.GetString("diagnostic")
472
-	temperature, _ := c.GetFloat("temperature")
473
-	blood_sugar, _ := c.GetFloat("blood_sugar")
474
-	pulse, _ := c.GetFloat("pulse")
475
-	sbp, _ := c.GetFloat("sbp")
476
-	dbp, _ := c.GetFloat("dbp")
477
-	blood_fat, _ := c.GetFloat("blood_fat")
478
-	height, _ := c.GetFloat("height")
479
-	sick_type, _ := c.GetInt64("sick_type")
480
-	symptom := c.GetString("symptom")
481
-	sick_date := c.GetString("sick_date")
482
-	is_infect, _ := c.GetInt64("is_infect")
472
+
473
+	blood_fat := c.GetString("blood_fat")
474
+	bloodfatfloat, _ := strconv.ParseFloat(blood_fat, 64)
475
+	fmt.Println("33333333", bloodfatfloat)
476
+	blood_sugar := c.GetString("blood_sugar")
477
+	bloodsugarfloat, _ := strconv.ParseFloat(blood_sugar, 64)
478
+	fmt.Println(bloodsugarfloat)
483 479
 	chief_conplaint := c.GetString("chief_conplaint")
480
+
481
+	dbp := c.GetString("dbp")
482
+	dbpfloat, _ := strconv.ParseFloat(dbp, 64)
483
+	delivery_way, _ := c.GetInt64("delivery_way")
484
+	diagnostic := c.GetString("diagnostic")
485
+	fmt.Println("diagnostic", diagnostic)
486
+	family_history := c.GetString("family_history")
487
+	fmt.Println(family_history)
488
+	height := c.GetString("height")
484 489
 	history_of_present_illness := c.GetString("history_of_present_illness")
490
+	is_infect, _ := c.GetInt64("is_infect")
491
+	fmt.Println("is", is_infect)
485 492
 	past_history := c.GetString("past_history")
493
+	patient_id, _ := c.GetInt64("patient_id")
494
+	his_patient_id, _ := c.GetInt64("his_patient_id")
495
+	fmt.Println("patient_id", patient_id)
486 496
 	personal_history := c.GetString("personal_history")
487
-	family_history := c.GetString("family_history")
497
+	pulse := c.GetString("pulse")
498
+	pulsefloat, _ := strconv.ParseFloat(pulse, 64)
499
+	sbp := c.GetString("sbp")
500
+	sbpfloat, _ := strconv.ParseFloat(sbp, 64)
501
+	heightfloat, _ := strconv.ParseFloat(height, 64)
502
+	sicktype := c.GetString("sick_type")
503
+	fmt.Println("sicketype", sicktype)
504
+	sick_type, _ := strconv.ParseInt(sicktype, 10, 64)
505
+	symptom := c.GetString("symptom")
506
+	sick_date := c.GetString("sick_date")
507
+	temperatures := c.GetString("temperature")
508
+	fmt.Println("temperatures", temperatures)
509
+	temperature, _ := strconv.ParseFloat(temperatures, 64)
488 510
 	record_date := c.GetString("record_date")
489
-	patient_id, _ := c.GetInt64("patient_id")
511
+	breathing := c.GetString("breathing")
512
+	doctor_advice := c.GetString("doctor_advice")
513
+	remark := c.GetString("remark")
514
+	breathingfloat, _ := strconv.ParseFloat(breathing, 64)
515
+	fmt.Println("breathingfloat", breathingfloat)
490 516
 	timeLayout := "2006-01-02"
491 517
 	loc, _ := time.LoadLocation("Local")
492 518
 	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
@@ -503,14 +529,15 @@ func (c *HisApiController) CreateHisPatientCaseHistory() {
503 529
 	sickTimes := sickTime.Unix()
504 530
 	ctime := time.Now().Unix()
505 531
 	caseHistory := models.HisPatientCaseHistory{
506
-		HisPatientId:            patient_id,
532
+		HisPatientId:            his_patient_id,
533
+		PatientId:               patient_id,
507 534
 		Temperature:             temperature,
508
-		BloodSugar:              blood_sugar,
509
-		Pulse:                   pulse,
510
-		Sbp:                     sbp,
511
-		Dbp:                     dbp,
512
-		Height:                  height,
513
-		BloodFat:                blood_fat,
535
+		BloodSugar:              bloodsugarfloat,
536
+		Pulse:                   pulsefloat,
537
+		Sbp:                     sbpfloat,
538
+		Dbp:                     dbpfloat,
539
+		Height:                  heightfloat,
540
+		BloodFat:                bloodfatfloat,
514 541
 		SickType:                sick_type,
515 542
 		Symptom:                 symptom,
516 543
 		SickDate:                sickTimes,
@@ -527,13 +554,26 @@ func (c *HisApiController) CreateHisPatientCaseHistory() {
527 554
 		Ctime:                   ctime,
528 555
 		Mtime:                   ctime,
529 556
 		RecordDate:              recordDateTime,
557
+		DeliveryWay:             delivery_way,
558
+		Breathing:               breathingfloat,
559
+		DoctorAdvice:            doctor_advice,
560
+		Remark:                  remark,
530 561
 	}
531
-	err = service.SaveHisPatientCaseHistory(caseHistory)
532
-	if err != nil {
533
-		c.ServeSuccessJSON(map[string]interface{}{
534
-			"msg": "保存成功",
535
-		})
562
+
563
+	//查询该患者是否有病历
564
+	_, errcode := service.GetHisPatientCaseHistoryById(his_patient_id)
565
+	if errcode == gorm.ErrRecordNotFound {
566
+		err = service.SaveHisPatientCaseHistory(caseHistory)
567
+		if err != nil {
568
+			c.ServeSuccessJSON(map[string]interface{}{
569
+				"msg": "保存成功",
570
+			})
571
+		}
572
+	} else if errcode == nil {
573
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
574
+		return
536 575
 	}
576
+
537 577
 }
538 578
 func (c *HisApiController) GetHisPatientCaseHistoryList() {
539 579
 	patient_id, _ := c.GetInt64("patient_id", 0)
@@ -558,25 +598,27 @@ func (c *HisApiController) GetHisPatientCaseHistory() {
558 598
 }
559 599
 func (c *HisApiController) CreateCaseHistoryTemplate() {
560 600
 	template_name := c.GetString("template_name")
601
+	fmt.Println("template_name22222222222222", template_name)
561 602
 	template_remark := c.GetString("template_remark")
562 603
 	doctor := c.GetAdminUserInfo().AdminUser.Id
563 604
 	diagnostic := c.GetString("diagnostic")
564
-	chief_conplaint := c.GetString("chief_conplaint")
605
+	chief_conplaint := c.GetString("chief_conplain")
565 606
 	history_of_present_illness := c.GetString("history_of_present_illness")
566 607
 	past_history := c.GetString("past_history")
567 608
 	personal_history := c.GetString("personal_history")
568 609
 	family_history := c.GetString("family_history")
569
-	record_date := c.GetString("record_date")
570
-
571
-	timeLayout := "2006-01-02"
572
-	loc, _ := time.LoadLocation("Local")
573
-
574
-	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
575
-	if err != nil {
576
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
577
-		return
578
-	}
579
-	recordDateTime := theTime.Unix()
610
+	user_name := c.GetString("user_name")
611
+	//record_date := c.GetString("record_date")
612
+	//fmt.Println("record_date--------",record_date)
613
+	//timeLayout := "2006-01-02"
614
+	//loc, _ := time.LoadLocation("Local")
615
+	//
616
+	//theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
617
+	//if err != nil {
618
+	//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
619
+	//	return
620
+	//}
621
+	//recordDateTime := theTime.Unix()
580 622
 
581 623
 	ctime := time.Now().Unix()
582 624
 
@@ -591,14 +633,15 @@ func (c *HisApiController) CreateCaseHistoryTemplate() {
591 633
 		Status:                  1,
592 634
 		Ctime:                   ctime,
593 635
 		Mtime:                   ctime,
594
-		RecordDate:              recordDateTime,
636
+		RecordDate:              time.Now().Unix(),
595 637
 		TemplateName:            template_name,
596 638
 		TemplateRemark:          template_remark,
597 639
 		Creator:                 doctor,
598 640
 		Modifier:                doctor,
641
+		UserName:                user_name,
599 642
 	}
600 643
 
601
-	err = service.SaveHisPatientCaseHistoryTemplate(template)
644
+	err := service.SaveHisPatientCaseHistoryTemplate(template)
602 645
 
603 646
 	if err == nil {
604 647
 		c.ServeSuccessJSON(map[string]interface{}{
@@ -612,10 +655,19 @@ func (c *HisApiController) CreateCaseHistoryTemplate() {
612 655
 
613 656
 }
614 657
 func (c *HisApiController) GetCaseHistoryTemplate() {
658
+	timeLayout := "2006-01-02"
659
+	loc, _ := time.LoadLocation("Local")
660
+	keyword := c.GetString("keyword")
661
+	start_time := c.GetString("start_time")
662
+	end_time := c.GetString("end_time")
663
+	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
664
+	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
615 665
 	admin := c.GetAdminUserInfo()
616
-	template, _ := service.GetHisPatientCaseHistoryTemplate(admin.CurrentOrgId)
666
+	template, _ := service.GetHisPatientCaseHistoryTemplate(admin.CurrentOrgId, startTime.Unix(), endTime.Unix(), keyword)
667
+	history, _ := service.GetHisPatientCaseHistory(admin.CurrentOrgId)
617 668
 	c.ServeSuccessJSON(map[string]interface{}{
618 669
 		"template": template,
670
+		"history":  history,
619 671
 	})
620 672
 
621 673
 }
@@ -830,9 +882,9 @@ func (c *HisApiController) GetRegisterInfo() {
830 882
 
831 883
 }
832 884
 
833
-func (c *HisApiController) GetPrintHisPatientCaseHistory() {
834
-
835
-}
885
+//func (c *HisApiController) GetPrintHisPatientCaseHistory() {
886
+//
887
+//}
836 888
 func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo, json map[string]interface{}) int {
837 889
 
838 890
 	if json["drug_name"] == nil || reflect.TypeOf(json["drug_name"]).String() != "string" {

+ 77 - 1
controllers/his_project_api_controller.go Ver fichero

@@ -55,6 +55,10 @@ func HisProjectRouters() {
55 55
 	beego.Router("/api/his/getprojectlistbyid", &HisProjectApiController{}, "Get:GetProjectListById")
56 56
 	beego.Router("/api/his/gethispatienthistory", &HisProjectApiController{}, "Get:GetHisPatientHistory")
57 57
 	beego.Router("/api/patient/changepatient", &HisProjectApiController{}, "Get:ChangePatient")
58
+
59
+	beego.Router("/api/patient/getpatientcasehistory", &HisProjectApiController{}, "Get:GetPatientcaseHistory")
60
+	beego.Router("/api/doctorworkstation/gettemplatedetail", &HisProjectApiController{}, "Get:GetTemplateDetail")
61
+	beego.Router("/api/doctorworkstation/updaterecordtemplate", &HisProjectApiController{}, "Get:UpdateRecordTemplate")
58 62
 }
59 63
 
60 64
 func (this *HisProjectApiController) SaveProject() {
@@ -138,7 +142,7 @@ func (this *HisProjectApiController) SaveProject() {
138 142
 		})
139 143
 		return
140 144
 	} else if errcode == nil {
141
-		fmt.Println("3333")
145
+
142 146
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
143 147
 		return
144 148
 	}
@@ -151,7 +155,9 @@ func (this *HisProjectApiController) GetProjectList() {
151 155
 	limit, _ := this.GetInt64("limit")
152 156
 	page, _ := this.GetInt64("page")
153 157
 	is_charge, _ := this.GetInt64("is_charge")
158
+	fmt.Println("is_charge====================", is_charge)
154 159
 	is_start, _ := this.GetInt64("is_start")
160
+	fmt.Println("is_start--------------------", is_start)
155 161
 	keyword := this.GetString("keyword")
156 162
 	projecList, total, err := service.GetHisProjectList(orgId, limit, page, is_charge, is_start, keyword)
157 163
 	fmt.Println("err", err)
@@ -918,3 +924,73 @@ func (this *HisProjectApiController) ChangePatient() {
918 924
 	}
919 925
 
920 926
 }
927
+
928
+func (this *HisProjectApiController) GetPatientcaseHistory() {
929
+
930
+	patient_id, _ := this.GetInt64("patient_id")
931
+	patient, _ := service.GetBloodPatientInfoById(patient_id)
932
+	history, err := service.GetPatientCaseHistory(patient_id)
933
+	hispatient, _ := service.GetHisPatientById(patient_id)
934
+
935
+	if err != nil {
936
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
937
+		return
938
+	}
939
+	this.ServeSuccessJSON(map[string]interface{}{
940
+		"patient":    patient,
941
+		"history":    history,
942
+		"hispatient": hispatient,
943
+	})
944
+}
945
+
946
+func (this *HisProjectApiController) GetTemplateDetail() {
947
+
948
+	id, _ := this.GetInt64("id")
949
+	templateDetail, err := service.GetTemplateDetail(id)
950
+
951
+	if err != nil {
952
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
953
+		return
954
+	}
955
+	this.ServeSuccessJSON(map[string]interface{}{
956
+		"templateDetail": templateDetail,
957
+	})
958
+}
959
+
960
+func (this *HisProjectApiController) UpdateRecordTemplate() {
961
+	id, _ := this.GetInt64("id")
962
+	template_name := this.GetString("template_name")
963
+	fmt.Println("template_name22222222222222", template_name)
964
+	template_remark := this.GetString("template_remark")
965
+
966
+	diagnostic := this.GetString("diagnostic")
967
+	chief_conplaint := this.GetString("chief_conplaint")
968
+	history_of_present_illness := this.GetString("history_of_present_illness")
969
+	past_history := this.GetString("past_history")
970
+	personal_history := this.GetString("personal_history")
971
+	family_history := this.GetString("family_history")
972
+	adminUserInfo := this.GetAdminUserInfo()
973
+	creater := adminUserInfo.AdminUser.Id
974
+	historyTemplate := models.HisCaseHistoryTemplate{
975
+		HistoryOfPresentIllness: history_of_present_illness,
976
+		PastHistory:             past_history,
977
+		ChiefConplaint:          chief_conplaint,
978
+		PersonalHistory:         personal_history,
979
+		FamilyHistory:           family_history,
980
+		Diagnostic:              diagnostic,
981
+		Status:                  1,
982
+		Mtime:                   time.Now().Unix(),
983
+		RecordDate:              time.Now().Unix(),
984
+		TemplateName:            template_name,
985
+		TemplateRemark:          template_remark,
986
+		Modifier:                creater,
987
+	}
988
+	err := service.UpdateCaseHistoryTemplate(&historyTemplate, id)
989
+	if err != nil {
990
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeUpdateConfig)
991
+		return
992
+	}
993
+	this.ServeSuccessJSON(map[string]interface{}{
994
+		"templateDetail": historyTemplate,
995
+	})
996
+}

+ 33 - 0
controllers/mobile_api_controllers/check_weight_api_controller.go Ver fichero

@@ -713,6 +713,39 @@ func (c *CheckWeightApiController) GetPatientList() {
713 713
 		"servicetime": serviceTime,
714 714
 	})
715 715
 }
716
+
717
+func (c *CheckWeightApiController) GetPatientListForSchedules() {
718
+	thisTime := time.Now()
719
+	scheduleDateStart := thisTime.Format("2006-01-02") + " 00:00:00"
720
+	timeLayout := "2006-01-02 15:04:05"
721
+	loc, _ := time.LoadLocation("Local")
722
+	theStartTime, _ := time.ParseInLocation(timeLayout, scheduleDateStart, loc)
723
+	syncTime := theStartTime.Unix()
724
+	adminUserInfo := c.GetMobileAdminUserInfo()
725
+	patientList, total, error := service.GetPatientListBySchedules(adminUserInfo.Org.Id, syncTime)
726
+	patientSchedule := make([]map[string]interface{},0)
727
+	for _, item := range patientList {
728
+		patientTemp := make(map[string]interface{})
729
+		patientTemp["patient_id"] = item.PatientId
730
+		patientTemp["patient_name"] = item.Patient.Name
731
+		patientTemp["schedule_type"] = item.ScheduleType
732
+		patientSchedule = append(patientSchedule, patientTemp)
733
+	}
734
+
735
+	if error != nil {
736
+		c.ErrorLog("获取病人列表失败:%v", error)
737
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
738
+		return
739
+	}
740
+	serviceTime := time.Now().Unix()
741
+	c.ServeSuccessJSON(map[string]interface{}{
742
+		"patientlist": patientSchedule,
743
+		"total":       total,
744
+		"servicetime": serviceTime,
745
+	})
746
+}
747
+
748
+
716 749
 func (c *CheckWeightApiController) GetPatientListById() {
717 750
 	patientId, _ := c.GetInt64("patient_id", 0)
718 751
 	if patientId <= 0 {

+ 6 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go Ver fichero

@@ -821,6 +821,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
821 821
 	setting_pressure := c.GetString("setting_pressure")
822 822
 	supine_diastolic_blood_pressure := c.GetString("supine_diastolic_blood_pressure")
823 823
 	diastolic_pressure := c.GetString("diastolic_pressure")
824
+	other_complication := c.GetString("other_complication")
824 825
 	if id <= 0 {
825 826
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
826 827
 		return
@@ -912,6 +913,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
912 913
 		SupineSystolicBloodPressure:  supine_systolic_blood_pressure,
913 914
 		SettingPressure:              setting_pressure,
914 915
 		DiastolicPressure:            diastolic_pressure,
916
+		OtherComplication:            other_complication,
915 917
 	}
916 918
 
917 919
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
@@ -1045,7 +1047,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1045 1047
 	fmt.Println("预冲量====", pre_impulse)
1046 1048
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
1047 1049
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
1048
-
1050
+	blood := c.GetString("blood")
1049 1051
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1050 1052
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
1051 1053
 	//
@@ -1128,6 +1130,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1128 1130
 		PreImpulse:                 pre_impulse,
1129 1131
 		AnticoagulantStopTimeHour:  anticoagulant_stop_time_hour,
1130 1132
 		AnticoagulantStopTimeMin:   anticoagulant_stop_time_min,
1133
+		Blood:                      blood,
1131 1134
 	}
1132 1135
 
1133 1136
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
@@ -1806,7 +1809,7 @@ func (c *DialysisAPIController) PostSolution() {
1806 1809
 
1807 1810
 	anticoagulant_stop_time_hour, _ := c.GetInt64("anticoagulant_stop_time_hour", 0)
1808 1811
 	anticoagulant_stop_time_min, _ := c.GetInt64("anticoagulant_stop_time_min", 0)
1809
-
1812
+	blood := c.GetString("blood")
1810 1813
 	if mode_id > 0 {
1811 1814
 		service.ModifyScheduleMode(mode_id, patient.ID, recordDate.Unix(), adminUserInfo.Org.Id)
1812 1815
 	}
@@ -1890,6 +1893,7 @@ func (c *DialysisAPIController) PostSolution() {
1890 1893
 		ALiquid:                   a_liquid,
1891 1894
 		AnticoagulantStopTimeMin:  anticoagulant_stop_time_min,
1892 1895
 		AnticoagulantStopTimeHour: anticoagulant_stop_time_hour,
1896
+		Blood:                     blood,
1893 1897
 	}
1894 1898
 
1895 1899
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)

+ 1 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go Ver fichero

@@ -12,6 +12,7 @@ func MobileAPIControllersRegisterRouters() {
12 12
 	beego.Router("/m/api/savebloodpressure", &CheckWeightApiController{}, "Post:SaveBloodPressure")
13 13
 	beego.Router("/m/api/checkbeforedialysis", &CheckWeightApiController{}, "get:GetPatientInfoBeforeDialysis")
14 14
 	beego.Router("/m/api/getpatientlist", &CheckWeightApiController{}, "get:GetPatientList")
15
+	beego.Router("/m/api/getschedulepatient", &CheckWeightApiController{}, "get:GetPatientListForSchedules")
15 16
 	beego.Router("/m/api/getpatientinfo", &CheckWeightApiController{}, "get:GetPatientListById")
16 17
 	beego.Router("/m/api/checkdialysis", &CheckWeightApiController{}, "get:GetPatientInfoDialysis")
17 18
 	beego.Router("/m/api/savecheckdialysis", &CheckWeightApiController{}, "Post:SavePatientInfoDialysis")

+ 5 - 0
controllers/mobile_api_controllers/patient_api_controller.go Ver fichero

@@ -2245,6 +2245,11 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
2245 2245
 		evaluation.SpecialTreatment = specialTreatment
2246 2246
 	}
2247 2247
 
2248
+	if dataBody["catheter_maintenance"] != nil && reflect.TypeOf(dataBody["catheter_maintenance"]).String() == "string" {
2249
+		catheter_maintenance := dataBody["catheter_maintenance"].(string)
2250
+		evaluation.CatheterMaintenance = catheter_maintenance
2251
+	}
2252
+
2248 2253
 	return
2249 2254
 }
2250 2255
 

+ 15 - 14
models/dialysis.go Ver fichero

@@ -275,6 +275,7 @@ type PredialysisEvaluation struct {
275 275
 	UrineVolume                    float64 `gorm:"column:urine_volume" json:"urine_volume" form:"urine_volume"`
276 276
 	Edema                          string  `gorm:"column:edema" json:"edema" form:"edema"`
277 277
 	SpecialTreatment               string  `gorm:"column:special_treatment" json:"special_treatment" form:"special_treatment"`
278
+	CatheterMaintenance            string  `gorm:"column:catheter_maintenance" json:"catheter_maintenance" form:"catheter_maintenance"`
278 279
 }
279 280
 
280 281
 func (PredialysisEvaluation) TableName() string {
@@ -572,6 +573,7 @@ type AssessmentAfterDislysis struct {
572 573
 	SettingPressure                 string  `gorm:"column:setting_pressure" json:"setting_pressure" form:"setting_pressure"`
573 574
 	SupineDiastolicBloodPressure    string  `gorm:"column:supine_diastolic_blood_pressure" json:"supine_diastolic_blood_pressure" form:"supine_diastolic_blood_pressure"`
574 575
 	DiastolicPressure               string  `gorm:"column:diastolic_pressure" json:"diastolic_pressure" form:"diastolic_pressure"`
576
+	OtherComplication               string  `gorm:"column:other_complication" json:"other_complication" form:"other_complication"`
575 577
 }
576 578
 
577 579
 func (AssessmentAfterDislysis) TableName() string {
@@ -957,20 +959,19 @@ func (DialysisBeforePrepare) TableName() string {
957 959
 }
958 960
 
959 961
 type QueueCallConfig struct {
960
-	ID         	int64 `gorm:"column:id" json:"id" form:"id"`
961
-	OrgId     	int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
962
-	Qhsj  		int64 `gorm:"column:qhsj" json:"qhsj" form:"qhsj"`
963
-	Jzdcbbcs	int64 `gorm:"column:jzdcbbcs" json:"jzdcbbcs" form:"jzdcbbcs"`
964
-	Jzbbsy		int64 `gorm:"column:jzbbsy" json:"jzbbsy" form:"jzbbsy"`
965
-	Jzjhyc		int64 `gorm:"column:jzjhyc" json:"jzjhyc" form:"jzjhyc"`
966
-	Sjdcbbcs 	int64 `gorm:"column:sjdcbbcs" json:"sjdcbbcs" form:"sjdcbbcs"`
967
-	Sjbbsy 		int64 `gorm:"column:sjbbsy" json:"sjbbsy" form:"sjbbsy"`
968
-	Sjjhyc		int64 `gorm:"column:sjjhyc" json:"sjjhyc" form:"sjjhyc"`
969
-	Txxqyxs		int64 `gorm:"column:txxqyxs" json:"txxqyxs" form:"txxqyxs"`
970
-	Txglsyxs	int64 `gorm:"column:txglsyxs" json:"txglsyxs" form:"txglsyxs"`
971
-	CreateTime	int64 `gorm:"column:create_time" json:"create_time" form:"create_time"`
972
-	UpdateTime  int64 `gorm:"column:update_time" json:"update_time" form:"update_time"`
973
-
962
+	ID         int64 `gorm:"column:id" json:"id" form:"id"`
963
+	OrgId      int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
964
+	Qhsj       int64 `gorm:"column:qhsj" json:"qhsj" form:"qhsj"`
965
+	Jzdcbbcs   int64 `gorm:"column:jzdcbbcs" json:"jzdcbbcs" form:"jzdcbbcs"`
966
+	Jzbbsy     int64 `gorm:"column:jzbbsy" json:"jzbbsy" form:"jzbbsy"`
967
+	Jzjhyc     int64 `gorm:"column:jzjhyc" json:"jzjhyc" form:"jzjhyc"`
968
+	Sjdcbbcs   int64 `gorm:"column:sjdcbbcs" json:"sjdcbbcs" form:"sjdcbbcs"`
969
+	Sjbbsy     int64 `gorm:"column:sjbbsy" json:"sjbbsy" form:"sjbbsy"`
970
+	Sjjhyc     int64 `gorm:"column:sjjhyc" json:"sjjhyc" form:"sjjhyc"`
971
+	Txxqyxs    int64 `gorm:"column:txxqyxs" json:"txxqyxs" form:"txxqyxs"`
972
+	Txglsyxs   int64 `gorm:"column:txglsyxs" json:"txglsyxs" form:"txglsyxs"`
973
+	CreateTime int64 `gorm:"column:create_time" json:"create_time" form:"create_time"`
974
+	UpdateTime int64 `gorm:"column:update_time" json:"update_time" form:"update_time"`
974 975
 }
975 976
 
976 977
 func (QueueCallConfig) TableName() string {

+ 6 - 1
models/his_models.go Ver fichero

@@ -140,10 +140,11 @@ type HisCaseHistoryTemplate struct {
140 140
 	TemplateRemark          string `gorm:"column:template_remark" json:"template_remark" form:"template_remark"`
141 141
 	Creator                 int64  `gorm:"column:creator" json:"creator" form:"creator"`
142 142
 	Modifier                int64  `gorm:"column:modifier" json:"modifier" form:"modifier"`
143
+	UserName                string `gorm:"column:user_name" json:"user_name" form:"user_name"`
143 144
 }
144 145
 
145 146
 func (HisCaseHistoryTemplate) TableName() string {
146
-	return "his_patient"
147
+	return "his_case_history_template"
147 148
 }
148 149
 
149 150
 type HisDoctorAdviceInfo struct {
@@ -234,6 +235,10 @@ type HisPatientCaseHistory struct {
234 235
 	Ctime                   int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
235 236
 	Mtime                   int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
236 237
 	RecordDate              int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
238
+	DeliveryWay             int64   `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
239
+	Breathing               float64 `gorm:"column:breathing" json:"breathing" form:"breathing"`
240
+	DoctorAdvice            string  `gorm:"column:doctor_advice" json:"doctor_advice" form:"doctor_advice"`
241
+	Remark                  string  `gorm:"column:remark" json:"remark" form:"remark"`
237 242
 }
238 243
 
239 244
 func (HisPatientCaseHistory) TableName() string {

+ 1 - 0
models/patient_models.go Ver fichero

@@ -224,6 +224,7 @@ type DialysisPrescription struct {
224 224
 	PreImpulse                 float64       `gorm:"column:pre_impulse" json:"pre_impulse" form:"pre_impulse"`
225 225
 	AnticoagulantStopTimeMin   int64         `gorm:"column:anticoagulant_stop_time_min" json:"anticoagulant_stop_time_min" form:"anticoagulant_stop_time_min"`
226 226
 	AnticoagulantStopTimeHour  int64         `gorm:"column:anticoagulant_stop_time_hour" json:"anticoagulant_stop_time_hour" form:"anticoagulant_stop_time_hour"`
227
+	Blood                      string        `gorm:"column:blood" json:"blood"`
227 228
 }
228 229
 
229 230
 func (DialysisPrescription) TableName() string {

+ 22 - 0
models/schedule_models.go Ver fichero

@@ -28,6 +28,28 @@ func (Schedule) TableName() string {
28 28
 	return "xt_schedule"
29 29
 }
30 30
 
31
+type SchedulePatients struct {
32
+	ID           int64 `gorm:"column:id" json:"id" form:"id"`
33
+	UserOrgId    int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
34
+	PartitionId  int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
35
+	BedId        int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
36
+	PatientId    int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
37
+	ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
38
+	ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
39
+	ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
40
+	ModeId       int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
41
+	Status       int64 `gorm:"column:status" json:"status" form:"status"`
42
+	CreatedTime  int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
43
+	UpdatedTime  int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
44
+	IsExport     int64 `gorm:"column:is_export" json:"is_export" form:"is_export"`
45
+	Patient      PatientListForFace        `json:"patient" gorm:"foreignkey:ID;AssociationForeignKey:PatientId;"`
46
+}
47
+
48
+func (SchedulePatients) TableName() string {
49
+	return "xt_schedule"
50
+}
51
+
52
+
31 53
 type PatientSchedule struct {
32 54
 	Schedule
33 55
 

+ 194 - 0
service/gdyb_service.go Ver fichero

@@ -717,6 +717,200 @@ func Gdyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doct
717 717
 	return str
718 718
 }
719 719
 
720
+//  门诊结算撤销
721
+func Gdyb4101(psnNo string, mdtrtId string, setlId string) string {
722
+	// 生成签名
723
+	nonce := GetRandomString(32)
724
+	timestamp := time.Now().Unix()
725
+	signature := setSignature(timestamp, nonce)
726
+
727
+	// 生成输入报文
728
+	inputMessage := SetInputMessage(nonce, timestamp)
729
+	input := make(map[string]interface{})
730
+	inputData := make(map[string]interface{})
731
+	inputMessage["infno"] = "4101" // 交易编码
732
+
733
+	inputData["mdtrt_id"] = mdtrtId // 就诊 ID  必填(来自2201接口返回)
734
+	inputData["setl_id"] = setlId   // 结算 ID  必填
735
+	inputData["fixmedins_name"] = ""   // 定点医药机构名称  必填
736
+	inputData["fixmedins_code"] = ""   // 定点医药机构编码  必填
737
+	inputData["hi_setl_lv"] = ""   // 医保结算等级
738
+	inputData["hi_no"] = ""   // 医保编号
739
+	inputData["medcasno"] = ""   // 病案号  必填
740
+	inputData["dcla_time"] = ""   // 申报时间  必填
741
+	inputData["psn_name"] = ""   // 人员姓名  必填
742
+	inputData["gend"] = ""   // 性别  必填
743
+	inputData["brdy"] = ""   // 出生日期  必填
744
+	inputData["age"] = ""   // 年龄  必填
745
+	inputData["ntly"] = ""   // 国籍  必填
746
+	inputData["nwb_age"] = ""   // 年龄  必填
747
+	inputData["naty"] = ""   // 民族  必填
748
+	inputData["patn_cert_type"] = ""   // 患者证件类别  必填
749
+	inputData["certno"] = ""   // 证件号码  必填
750
+	inputData["prfs"] = ""   // 职业  必填
751
+	inputData["curr_addr"] = ""   // 现住址  必填
752
+	inputData["emp_name"] = ""   // 单位名称  必填
753
+	inputData["emp_addr"] = ""   // 单位地址  必填
754
+	inputData["emp_tel"] = ""   // 单位电话  必填
755
+	inputData["poscode"] = ""   // 邮编  必填
756
+	inputData["coner_name"] = ""   // 联系人姓名  必填
757
+	inputData["patn_rlts"] = ""   // 与患者关系  必填
758
+	inputData["coner_addr"] = ""   // 联系人地址  必填
759
+	inputData["coner_tel"] = ""   // 联系人电话  必填
760
+	inputData["hi_type"] = ""   // 医保类型  必填
761
+	inputData["insuplc"] = ""   // 参保地  必填
762
+	inputData["sp_psn_type"] = ""   // 特殊人员类型  必填
763
+	inputData["nwb_adm_type"] = ""   // 新生儿入院类型  必填
764
+	inputData["nwb_bir_wt"] = ""   // 新生儿出生体重  必填
765
+	inputData["nwb_adm_wt"] = ""   // 新生儿入院体重  必填
766
+	inputData["opsp_diag_caty"] = ""   // 门诊慢特病诊断  必填
767
+	inputData["opsp_mdtrt_date"] = ""   // 门诊慢特病就诊日期  必填
768
+	inputData["ipt_med_type"] = ""   // 住院医疗类型  必填
769
+	inputData["adm_way"] = ""   // 入院途径  必填
770
+	inputData["trt_type"] = ""   // 治疗类别  必填
771
+	inputData["adm_time"] = ""   // 入院时间  必填
772
+	inputData["adm_caty"] = ""   // 入院科别  必填
773
+	inputData["refldept_dept"] = ""   // 转科科别  必填
774
+	inputData["dscg_time"] = ""   // 出院时间  必填
775
+	inputData["dscg_caty"] = ""   // 出院科别  必填
776
+	inputData["act_ipt_days"] = ""   // 实际住院天数  必填
777
+	inputData["otp_wm_dise"] = ""   // 门(急) 诊西医诊断  必填
778
+	inputData["wm_dise_code"] = ""   // 门(急) 诊中医诊断  必填
779
+	inputData["otp_tcm_dise"] = ""   // 西医诊断疾病代码  必填
780
+	inputData["tcm_dise_code"] = ""   // 中医诊断代码  必填
781
+	inputData["oprn_oprt_code_cnt"] = ""   // 手术操作代码计数  必填
782
+	inputData["vent_used_dura"] = ""   // 呼吸机使用时长  必填
783
+	inputData["pwcry_bfadm_coma_dura"] = ""   // 颅脑损伤患者入院前昏迷时长  必填
784
+	inputData["pwcry_afadm_coma_dura"] = ""   // 颅脑损伤患者入院后昏迷时长  必填
785
+	inputData["bld_cat"] = ""   // 输血品种  必填
786
+	inputData["bld_amt"] = ""   // 输血量  必填
787
+	inputData["bld_unt"] = ""   // 输血计量单位  必填
788
+	inputData["spga_nurscare_days"] = ""   // 特级护理天数  必填
789
+	inputData["lv1_nurscare_days"] = ""   // 一级护理天数  必填
790
+	inputData["scd_nurscare_days"] = ""   // 二级护理天数  必填
791
+	inputData["lv3_nurscare_days"] = ""   // 三级护理天数  必填
792
+	inputData["acp_medins_name"] = ""   // 拟接收机构名称  必填
793
+	inputData["acp_optins_code"] = ""   // 拟接收机构代码  必填
794
+	inputData["bill_code"] = ""   // 票据代码  必填
795
+	inputData["bill_no"] = ""   // 票据号码  必填
796
+	inputData["biz_sn"] = ""   // 业务流水号  必填
797
+	inputData["days_rinp_flag_31"] = ""   // 出院 31 天内再住院计划标志  必填
798
+	inputData["days_rinp_pup_31"] = ""   // 出院 31 天内再住院目的  必填
799
+	inputData["chfpdr_name"] = ""   // 主诊医师姓名  必填
800
+	inputData["chfpdr_code"] = ""   // 主诊医师代码  必填
801
+	inputData["setl_begn_date"] = ""   // 结算开始日期  必填
802
+	inputData["setl_end_date"] = ""   // 结算结束日期  必填
803
+	inputData["psn_selfpay"] = ""   // 个人自付  必填
804
+	inputData["psn_ownpay"] = ""   // 个人自费  必填
805
+	inputData["acct_pay"] = ""   // 个人账户支出  必填
806
+	inputData["hi_paymtd"] = ""   // 医保支付方式  必填
807
+	inputData["hsorg"] = ""   // 医保机构  必填
808
+	inputData["hsorg_opter"] = ""   // 医保机构经办人  必填
809
+	inputData["medins_fill_dept"] = ""   // 医疗机构填报部门  必填
810
+	inputData["medins_fill_psn"] = ""   // 医疗机构填报人  必填
811
+
812
+	payinfo := make([]map[string]interface{},0)  // 基金支付信息
813
+	payinfotemp := make(map[string]interface{})
814
+	payinfotemp["fund_pay_type"] =  "" // 基金支付类型  必填
815
+	payinfotemp["fund_payamt"] = ""    // 基金支付金额
816
+	payinfo = append(payinfo,payinfotemp)
817
+
818
+	opspdiseinfo := make([]map[string]interface{},0) // 门诊慢特病诊断信息
819
+	opspdiseinfotemp := make(map[string]interface{})
820
+	opspdiseinfotemp["diag_name"] =  "" // 诊断名称  必填
821
+	opspdiseinfotemp["diag_code"] = ""    // 诊断代码 必填
822
+	opspdiseinfotemp["oprn_oprt_name"] = ""    // 手术操作名称 必填
823
+	opspdiseinfotemp["oprn_oprt_code"] = ""    // 手术操作代码 必填
824
+	opspdiseinfo = append(opspdiseinfo,opspdiseinfotemp)
825
+
826
+	diseinfo := make([]map[string]interface{},0) // 住院诊断信息
827
+	diseinfotemp := make(map[string]interface{})
828
+	diseinfotemp["diag_type"] =  "" // 诊断类别  必填
829
+	diseinfotemp["diag_code"] = ""    // 诊断代码 必填
830
+	diseinfotemp["diag_name"] = ""    // 诊断名称 必填
831
+	diseinfotemp["adm_cond_type"] = ""    // 入院病情类型 必填
832
+	diseinfo = append(diseinfo,diseinfotemp)
833
+
834
+	iteminfo := make([]map[string]interface{},0) // 住院诊断信息
835
+	iteminfotemp := make(map[string]interface{})
836
+	iteminfotemp["med_chrgitm"] =  "" // 医疗收费项目  必填
837
+	iteminfotemp["amt"] = ""    // 金额 必填
838
+	iteminfotemp["claa_sumfee"] = ""    // 甲类费用合计 必填
839
+	iteminfotemp["clab_amt"] = ""    // 乙类金额 必填
840
+	iteminfotemp["fulamt_ownpay_amt"] = ""    // 全自费金额 必填
841
+	iteminfotemp["oth_amt"] = ""    // 其他金额 必填
842
+	iteminfo = append(iteminfo,iteminfotemp)
843
+
844
+	oprninfo := make([]map[string]interface{},0) // 手术操作信息
845
+	oprninfotemp := make(map[string]interface{})
846
+	oprninfotemp["oprn_oprt_type"] =  "" // 手术操作类别  必填
847
+	oprninfotemp["oprn_oprt_name"] = ""    // 手术操作名称 必填
848
+	oprninfotemp["oprn_oprt_code"] = ""    // 手术操作代码 必填
849
+	oprninfotemp["oprn_oprt_date"] = ""    // 手术操作日期 必填
850
+	oprninfotemp["anst_way"] = ""    // 麻醉方式 必填
851
+	oprninfotemp["oper_dr_name"] = ""    // 术者医师姓名 必填
852
+	oprninfotemp["oper_dr_code"] = ""    // 术者医师代码 必填
853
+	oprninfotemp["anst_dr_name"] = ""    // 麻醉医师姓名 必填
854
+	oprninfotemp["anst_dr_code"] = ""    // 麻醉医师代码 必填
855
+	oprninfo = append(oprninfo,iteminfotemp)
856
+
857
+	icuinfo := make([]map[string]interface{},0) // 重症监护信息
858
+	icuinfotemp := make(map[string]interface{})
859
+	icuinfotemp["scs_cutd_ward_type"] =  "" // 重症监护病房类型  必填
860
+	icuinfotemp["scs_cutd_inpool_time"] = ""    // 重症监护进入时间 必填
861
+	icuinfotemp["scs_cutd_exit_time"] = ""    // 重症监护退出时间 必填
862
+	icuinfotemp["scs_cutd_sum_dura"] = ""    // 重症监护合计时长 必填
863
+	icuinfo = append(icuinfo,iteminfotemp)
864
+
865
+
866
+
867
+
868
+	input["setlinfo"] = inputData
869
+	input["payinfo"] = payinfo
870
+	input["opspdiseinfo"] = opspdiseinfo
871
+	input["diseinfo"] = diseinfo
872
+	input["iteminfo"] = iteminfo
873
+	input["oprninfo"] = oprninfo
874
+	input["icuinfo"] = icuinfo
875
+	inputMessage["input"] = input //交易输入
876
+
877
+	bytesData, err := json.Marshal(inputMessage)
878
+	fmt.Println(string(bytesData))
879
+	if err != nil {
880
+		fmt.Println(err.Error())
881
+		return err.Error()
882
+	}
883
+	reader := bytes.NewReader(bytesData)
884
+
885
+	url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2208"
886
+	request, err := http.NewRequest("POST", url, reader)
887
+	if err != nil {
888
+		fmt.Println(err.Error())
889
+		return err.Error()
890
+	}
891
+
892
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
893
+	request.Header.Set("x-tif-paasid", "test_hosp")
894
+	request.Header.Set("x-tif-signature", signature)
895
+	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
896
+	request.Header.Set("x-tif-nonce", nonce)
897
+
898
+	client := http.Client{}
899
+	resp, err := client.Do(request)
900
+	if err != nil {
901
+		fmt.Println(err.Error())
902
+		return err.Error()
903
+	}
904
+	respBytes, err := ioutil.ReadAll(resp.Body)
905
+	if err != nil {
906
+		fmt.Println(err.Error())
907
+		return err.Error()
908
+	}
909
+	str := string(respBytes)
910
+	fmt.Println(str)
911
+	return str
912
+}
913
+
720 914
 // 生成签名
721 915
 func setSignature(timestamp int64, nonce string) string {
722 916
 	str := strconv.FormatInt(timestamp, 10) + SceretKey + nonce + strconv.FormatInt(timestamp, 10)

+ 35 - 2
service/his_project_service.go Ver fichero

@@ -36,10 +36,10 @@ func GetHisProjectList(orgid int64, limit int64, page int64, start int64, charge
36 36
 		db = db.Where("x.user_org_id = ?", orgid)
37 37
 	}
38 38
 	if start > 0 {
39
-		db = db.Where("x.medical_status = ?", start)
39
+		db = db.Where("x.medical_status = ?", charge)
40 40
 	}
41 41
 	if charge > 0 {
42
-		db = db.Where("x.is_charge = ? ", charge)
42
+		db = db.Where("x.is_charge = ? ", start)
43 43
 	}
44 44
 	if len(keyword) > 0 {
45 45
 		db = db.Where("x.project_name like ?", likeKey)
@@ -333,3 +333,36 @@ func UpdatedHisPatient(hispatientid int64, orgid int64, recorddate int64) error
333 333
 	err := XTWriteDB().Model(&hisPatient).Where("id = ? and user_org_id = ? and record_date = ?", hispatientid, orgid, recorddate).Updates(map[string]interface{}{"is_return": 3}).Error
334 334
 	return err
335 335
 }
336
+
337
+func GetBloodPatientInfoById(patientid int64) (models.XtPatients, error) {
338
+
339
+	patients := models.XtPatients{}
340
+	err := XTReadDB().Model(&patients).Where("id = ? and status = 1", patientid).Find(&patients).Error
341
+	return patients, err
342
+}
343
+
344
+func GetPatientCaseHistory(patientid int64) (models.HisPatientCaseHistory, error) {
345
+
346
+	history := models.HisPatientCaseHistory{}
347
+	err := XTReadDB().Model(&history).Where("patient_id = ? and status = 1", patientid).Find(&history).Error
348
+	return history, err
349
+}
350
+
351
+func GetHisPatientById(patientid int64) (models.HisPatient, error) {
352
+	patient := models.HisPatient{}
353
+	err := XTReadDB().Model(&patient).Where("patient_id = ? and status = 1", patientid).Find(&patient).Error
354
+	return patient, err
355
+}
356
+
357
+func GetTemplateDetail(id int64) (models.HisCaseHistoryTemplate, error) {
358
+
359
+	template := models.HisCaseHistoryTemplate{}
360
+	err := XTReadDB().Model(&template).Where("id= ? and status = 1", id).Find(&template).Error
361
+	return template, err
362
+}
363
+
364
+func UpdateCaseHistoryTemplate(tem *models.HisCaseHistoryTemplate, id int64) error {
365
+
366
+	err := XTWriteDB().Model(&tem).Where("id = ? ", id).Updates(map[string]interface{}{"history_of_present_illness": tem.HistoryOfPresentIllness, "past_history": tem.PastHistory, "chief_conplaint": tem.ChiefConplaint, "personal_history": tem.PersonalHistory, "family_history": tem.FamilyHistory, "diagnostic": tem.Diagnostic, "template_name": tem.TemplateName, "template_remark": tem.TemplateRemark, "modifier": tem.Modifier}).Error
367
+	return err
368
+}

+ 30 - 1
service/his_service.go Ver fichero

@@ -96,17 +96,46 @@ func GetHisPatientCaseHistoryList(org_id int64, patient_id int64) (caseHistorys
96 96
 	return
97 97
 }
98 98
 
99
-func GetHisPatientCaseHistoryTemplate(org_id int64) (caseHistorys []*models.HisCaseHistoryTemplate, err error) {
99
+func GetHisPatientCaseHistoryTemplate(org_id int64, startime int64, endtime int64, keyword string) (caseHistorys []*models.HisCaseHistoryTemplate, err error) {
100
+	likekey := "%" + keyword + "%"
100 101
 	db := readDb.Model(&models.HisCaseHistoryTemplate{}).Where("user_org_id = ? AND status = 1", org_id)
102
+	if startime > 0 {
103
+		db = db.Where("record_date>=?", startime)
104
+	}
105
+	if endtime > 0 {
106
+		db = db.Where("record_date<=?", endtime)
107
+	}
108
+	if len(keyword) > 0 {
109
+		db = db.Where("template_name like ? ", likekey)
110
+	}
101 111
 	err = db.Find(&caseHistorys).Error
102 112
 	return
103 113
 }
104 114
 
115
+func GetHisPatientCaseHistory(org_id int64) (caseHistory []*models.HisPatientCaseHistory, err error) {
116
+
117
+	err = readDb.Model(&models.HisPatientCaseHistory{}).Where("user_org_id = ? and status = 1", org_id).Find(&caseHistory).Error
118
+	return caseHistory, err
119
+}
120
+
105 121
 func SaveHisPatientCaseHistoryTemplate(template models.HisCaseHistoryTemplate) (err error) {
106 122
 	err = writeDb.Create(&template).Error
107 123
 	return
108 124
 }
109 125
 
126
+func GetHisPatientCaseHistoryById(hispatientid int64) (*models.HisPatientCaseHistory, error) {
127
+	history := models.HisPatientCaseHistory{}
128
+	err := XTReadDB().Model(&history).Where("his_patient_id = ? and status = 1", hispatientid).Find(&history).Error
129
+	if err != nil {
130
+		if err == gorm.ErrRecordNotFound {
131
+			return nil, err
132
+		} else {
133
+			return nil, err
134
+		}
135
+	}
136
+	return &history, nil
137
+}
138
+
110 139
 func SaveHisPatientCaseHistory(caseHistory models.HisPatientCaseHistory) (err error) {
111 140
 	err = writeDb.Create(&caseHistory).Error
112 141
 	return

+ 6 - 0
service/patient_service.go Ver fichero

@@ -89,6 +89,12 @@ func GetPatientListByUpdateTime(orgID int64, syncTime int64, force int64) (patie
89 89
 	return
90 90
 }
91 91
 
92
+func GetPatientListBySchedules(orgID int64, syncTime int64) (patients []*models.SchedulePatients, total int64, err error) {
93
+	db := readDb.Model(&models.SchedulePatients{}).Where("user_org_id=?  AND  status=1  AND  schedule_date = ?", orgID,syncTime).Preload("Patient", "status = 1 AND user_org_id = ? ", orgID,)
94
+	err = db.Count(&total).Find(&patients).Error
95
+	return
96
+}
97
+
92 98
 func GetPatientListById(orgID int64, patientId int64) (patients models.PatientListForFace, err error) {
93 99
 	err = readDb.Model(&models.PatientListForFaceList{}).Where("user_org_id=? and id = ? and status=1", orgID, patientId).First(&patients).Error
94 100
 	return