Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 years ago
parent
commit
e6a6b31b58
1 changed files with 2 additions and 20 deletions
  1. 2 20
      controllers/sg/his_api_controller.go

+ 2 - 20
controllers/sg/his_api_controller.go View File

1699
 	if config.IsOpen == 1 {
1699
 	if config.IsOpen == 1 {
1700
 		//service.Gdyb1201("", miConfig.OrgName, "1122", miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 1, "")
1700
 		//service.Gdyb1201("", miConfig.OrgName, "1122", miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 1, "")
1701
 
1701
 
1702
-		api := "http://127.0.0.1:9532/" + "gdyb/one?cert_no=" + patient.IdCardNo + "&org_name=" + miConfig.OrgName +  "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code + "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&certificates=" + strconv.FormatInt(certificates, 10)
1702
+		api := "http://127.0.0.1:9532/" + "gdyb/one?cert_no=" + patient.IdCardNo + "&org_name=" + miConfig.OrgName + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code + "&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&certificates=" + strconv.FormatInt(certificates, 10)
1703
 		resp, requestErr := http.Get(api)
1703
 		resp, requestErr := http.Get(api)
1704
 		if requestErr != nil {
1704
 		if requestErr != nil {
1705
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1705
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1890
 			his.Mtime = time.Now().Unix()
1890
 			his.Mtime = time.Now().Unix()
1891
 			his.Status = 1
1891
 			his.Status = 1
1892
 			service.UpdateHisPatientStatus(&his)
1892
 			service.UpdateHisPatientStatus(&his)
1893
-
1894
-			getYear := time.Now().Format("2006") //获取年
1895
-			getMonth := time.Now().Format("01")  //获取月
1896
-			getDay := time.Now().Format("02")
1897
-
1898
-			new_time := getYear + "-" + getMonth + "-" + getDay
1899
-
1900
-			new_timestamp, _ := time.ParseInLocation(timeLayout+" 15:04:05", new_time+" 00:00:00", loc)
1901
-
1902
-			if recordDateTime < new_timestamp.Unix() {
1903
-				thisTime := time.Now()
1904
-				thisTime = thisTime.AddDate(0, 0, -7)
1905
-				service.UpdateHisPrescriptionHisIDTwo(his.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId, thisTime.Unix())
1906
-			} else if recordDateTime == new_timestamp.Unix() {
1907
-				lists, _ := service.GetHisPatientInfoList(adminInfo.CurrentOrgId, patient.ID, recordDateTime)
1908
-				if len(lists) == 1 {
1909
-					service.UpdateHisPrescriptionHisID(his.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId)
1910
-				}
1911
-			}
1893
+			service.UpdateHisPrescriptionHisID(his.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId)
1912
 			c.ServeSuccessJSON(map[string]interface{}{
1894
 			c.ServeSuccessJSON(map[string]interface{}{
1913
 				"his_info": his,
1895
 				"his_info": his,
1914
 			})
1896
 			})