Browse Source

2024/6/17

28169 3 weeks ago
parent
commit
17bc2d52cc

BIN
XT_New.exe View File


+ 4 - 4
controllers/base_api_controller.go View File

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10402 //机构id
86
+		subscibe.OrgId = 10164 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,7 +93,7 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10402 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 12123 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10402 //机构id小英9675或4
332
+		subscibe.OrgId = 10164 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10402 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 12123 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 1 - 1
controllers/his_api_controller.go View File

@@ -3390,7 +3390,7 @@ func (c *HisApiController) CreateHisPrescription() {
3390 3390
 	var adviceList []models.HisDoctorAdviceInfo
3391 3391
 	var projectList []models.HisPrescriptionProject
3392 3392
 
3393
-	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10635 || adminInfo.CurrentOrgId == 10598 || adminInfo.CurrentOrgId == 10028 || adminInfo.CurrentOrgId == 10721 || adminInfo.CurrentOrgId == 10726 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10571 || adminInfo.CurrentOrgId == 10724 || adminInfo.CurrentOrgId == 9671 {
3393
+	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10635 || adminInfo.CurrentOrgId == 10598 || adminInfo.CurrentOrgId == 10028 || adminInfo.CurrentOrgId == 10721 || adminInfo.CurrentOrgId == 10726 || adminInfo.CurrentOrgId == 10731 || adminInfo.CurrentOrgId == 10571 || adminInfo.CurrentOrgId == 10724 || adminInfo.CurrentOrgId == 9671 || adminInfo.CurrentOrgId == 10731 {
3394 3394
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3395 3395
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3396 3396
 

+ 81 - 0
controllers/patient_api_controller.go View File

@@ -168,6 +168,10 @@ func PatientApiRegistRouters() {
168 168
 
169 169
 	beego.Router("/api/patient/deletepatientdeathsummary", &DialysisApiController{}, "Get:DeletePatientDeathSummary")
170 170
 
171
+	beego.Router("/api/patient/createnewsickhistoryrecord", &DialysisApiController{}, "Post:CreateNewSickHistoryRecord")
172
+
173
+	beego.Router("/api/patient/getnewsickhistory", &DialysisApiController{}, "Get:GetNewSickHistory")
174
+
171 175
 }
172 176
 func (c *PatientApiController) GetExportList() {
173 177
 	startTime := c.GetString("start_time")
@@ -8159,3 +8163,80 @@ func (c *DialysisApiController) DeletePatientDeathSummary() {
8159 8163
 		"msg": "删除成功",
8160 8164
 	})
8161 8165
 }
8166
+
8167
+func (this *DialysisApiController) CreateNewSickHistoryRecord() {
8168
+
8169
+	dataBody := make(map[string]interface{}, 0)
8170
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
8171
+	if err != nil {
8172
+		utils.ErrorLog(err.Error())
8173
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
8174
+		return
8175
+	}
8176
+
8177
+	record_date := dataBody["record_time"].(string)
8178
+	timeLayout := "2006-01-02"
8179
+	loc, _ := time.LoadLocation("Local")
8180
+	var recordDate int64
8181
+	if len(record_date) > 0 {
8182
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
8183
+		if err != nil {
8184
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
8185
+			return
8186
+		}
8187
+		recordDate = theTime.Unix()
8188
+	}
8189
+
8190
+	patient_id := int64(dataBody["patient_id"].(float64))
8191
+
8192
+	doctor_id := int64(dataBody["doctor_id"].(float64))
8193
+
8194
+	guominyaowu_desc := dataBody["guominyaowu_desc"].(string)
8195
+
8196
+	is_fumotouxishi := int64(dataBody["is_fumotouxishi"].(float64))
8197
+
8198
+	is_guominyaowu := int64(dataBody["is_guominyaowu"].(float64))
8199
+
8200
+	is_shenyizhishi := int64(dataBody["is_shenyizhishi"].(float64))
8201
+
8202
+	content := dataBody["content"].(string)
8203
+
8204
+	orgId := this.GetAdminUserInfo().CurrentOrgId
8205
+
8206
+	patientSickHistory := models.XtPatientSickHistory{
8207
+		OrgId:                   orgId,
8208
+		PatientId:               patient_id,
8209
+		Recorder:                0,
8210
+		RecordTime:              recordDate,
8211
+		RecordDate:              recordDate,
8212
+		Content:                 content,
8213
+		Status:                  1,
8214
+		Ctime:                   time.Now().Unix(),
8215
+		Mtime:                   time.Now().Unix(),
8216
+		Title:                   "",
8217
+		IsShenyizhiHistory:      is_shenyizhishi,
8218
+		IsFumoDialysisHistory:   is_fumotouxishi,
8219
+		HypersusceptibilityDesc: guominyaowu_desc,
8220
+		DoctorId:                doctor_id,
8221
+		IsHypersusceptibility:   is_guominyaowu,
8222
+	}
8223
+
8224
+	service.CreateNewSickHistoryRecord(patientSickHistory)
8225
+
8226
+	this.ServeSuccessJSON(map[string]interface{}{
8227
+		"patientSickHistory": patientSickHistory,
8228
+	})
8229
+}
8230
+
8231
+func (this *DialysisApiController) GetNewSickHistory() {
8232
+
8233
+	patient_id, _ := this.GetInt64("patient_id")
8234
+
8235
+	orgId := this.GetAdminUserInfo().CurrentOrgId
8236
+
8237
+	list, _ := service.GetNewSickHistory(patient_id, orgId)
8238
+
8239
+	this.ServeSuccessJSON(map[string]interface{}{
8240
+		"list": list,
8241
+	})
8242
+}

+ 14 - 0
service/patient_service.go View File

@@ -4392,3 +4392,17 @@ func DeletePatientDeathSummary(id int64) error {
4392 4392
 
4393 4393
 	return err
4394 4394
 }
4395
+
4396
+func CreateNewSickHistoryRecord(history models.XtPatientSickHistory) error {
4397
+
4398
+	err := XTWriteDB().Create(&history).Error
4399
+
4400
+	return err
4401
+}
4402
+
4403
+func GetNewSickHistory(patient_id int64, org_id int64) (sick []*models.XtPatientSickHistory, err error) {
4404
+
4405
+	err = XTReadDB().Where("patient_id = ? and org_id = ? and status =1", patient_id, org_id).Order("record_time desc").Find(&sick).Error
4406
+
4407
+	return sick, err
4408
+}