his_api_controller.go 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. package controllers
  2. import (
  3. "XT_New/enums"
  4. "XT_New/models"
  5. "XT_New/service"
  6. "XT_New/utils"
  7. "encoding/json"
  8. "github.com/astaxie/beego"
  9. "reflect"
  10. "strconv"
  11. "strings"
  12. "time"
  13. )
  14. type HisApiController struct {
  15. BaseAuthAPIController
  16. }
  17. func HisManagerApiRegistRouters() {
  18. beego.Router("/api/hispatient/list", &HisApiController{}, "get:GetHisPatientList")
  19. beego.Router("/api/hispatient/get", &HisApiController{}, "get:GetHisPatientInfo")
  20. beego.Router("/api/hisprescription/config", &HisApiController{}, "get:GetHisPrescriptionConfig")
  21. beego.Router("/api/hisprescription/create", &HisApiController{}, "post:CreateHisPrescription")
  22. beego.Router("/api/hisdoctoradvice/create", &HisApiController{}, "post:CreateHisDoctorAdvice")
  23. //beego.Router("/api/hisproject/create", &HisApiController{}, "post:CreateHisProject")
  24. //beego.Router("/api/hisorder/create", &HisApiController{}, "post:CreateHisOrder")
  25. //beego.Router("/api/hisadditional/create", &HisApiController{}, "post:CreateHisAdditionalCharge")
  26. beego.Router("/api/doctorworkstation/casehistory/list", &HisApiController{}, "get:GetHisPatientCaseHistoryList")
  27. beego.Router("/api/doctorworkstation/casehistory/get", &HisApiController{}, "get:GetHisPatientCaseHistory")
  28. beego.Router("/api/doctorworkstation/casehistory/create", &HisApiController{}, "post:CreateHisPatientCaseHistory")
  29. beego.Router("/api/doctorworkstation/casehistorytemplate/create", &HisApiController{}, "post:CreateCaseHistoryTemplate")
  30. beego.Router("/api/doctorworkstation/casehistorytemplate/get", &HisApiController{}, "get:GetCaseHistoryTemplate")
  31. beego.Router("/api/doctorworkstation/printcasehistory/get", &HisApiController{}, "get:GetPrintHisPatientCaseHistory")
  32. }
  33. func (c *HisApiController) GetHisPatientList() {
  34. types, _ := c.GetInt64("type", 0)
  35. record_date := c.GetString("record_date")
  36. timeLayout := "2006-01-02"
  37. loc, _ := time.LoadLocation("Local")
  38. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  39. if err != nil {
  40. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  41. return
  42. }
  43. recordDateTime := theTime.Unix()
  44. adminInfo := c.GetAdminUserInfo()
  45. patients, _ := service.GetHisPatientList(adminInfo.CurrentOrgId, "", recordDateTime)
  46. if types == 0 {
  47. c.ServeSuccessJSON(map[string]interface{}{
  48. "list": patients,
  49. })
  50. } else if types == 1 { //未就诊
  51. var patientsOne []*service.Schedule
  52. for _, item := range patients {
  53. if item.HisPrescription == nil || len(item.HisPrescription) <= 0 {
  54. patientsOne = append(patientsOne, item)
  55. }
  56. }
  57. c.ServeSuccessJSON(map[string]interface{}{
  58. "list": patientsOne,
  59. })
  60. } else if types == 2 { //已就诊
  61. var patientsTwo []*service.Schedule
  62. for _, item := range patients {
  63. if item.HisPrescription != nil && len(item.HisPrescription) > 0 {
  64. patientsTwo = append(patientsTwo, item)
  65. }
  66. }
  67. c.ServeSuccessJSON(map[string]interface{}{
  68. "list": patientsTwo,
  69. })
  70. }
  71. }
  72. func (c *HisApiController) GetHisPatientInfo() {
  73. patient_id, _ := c.GetInt64("patient_id")
  74. record_date := c.GetString("record_date")
  75. timeLayout := "2006-01-02"
  76. loc, _ := time.LoadLocation("Local")
  77. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  78. if err != nil {
  79. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  80. return
  81. }
  82. recordDateTime := theTime.Unix()
  83. admin := c.GetAdminUserInfo()
  84. his_patient_info, _ := service.GetHisPatientInfo(admin.CurrentOrgId, patient_id, recordDateTime)
  85. xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
  86. prescriptions, _ := service.GetHisPrescription(admin.CurrentOrgId, patient_id, recordDateTime)
  87. //prescriptions, _ := service.GetHisPrescription(admin.CurrentOrgId, patient_id, recordDateTime)
  88. case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
  89. c.ServeSuccessJSON(map[string]interface{}{
  90. "his_info": his_patient_info,
  91. "xt_info": xt_patient_info,
  92. "prescription": prescriptions,
  93. "case_history": case_history,
  94. })
  95. return
  96. }
  97. func (c *HisApiController) GetHisPrescriptionConfig() {
  98. adminInfo := c.GetAdminUserInfo()
  99. //获取医嘱模版
  100. advices, _ := service.FindAllHisAdviceTemplate(adminInfo.CurrentOrgId)
  101. //获取所有基础药
  102. drugs, _ := service.GetAllDrugLibList(adminInfo.CurrentOrgId)
  103. //drugs, _ := service.GetAllDrugLibList(adminInfo.CurrentOrgId)
  104. //drugs, _ := service.GetAllDrugLibList(adminInfo.CurrentOrgId)
  105. drugways, _, _ := service.GetDrugWayDics(adminInfo.CurrentOrgId)
  106. efs, _, _ := service.GetExecutionFrequencyDics(adminInfo.CurrentOrgId)
  107. //获取所有项目
  108. projects, _ := service.GetAllProjectList(adminInfo.CurrentOrgId)
  109. //获取所有项目组套
  110. c.ServeSuccessJSON(map[string]interface{}{
  111. "drugs": drugs,
  112. "advices_template": advices,
  113. "projects": projects,
  114. "drugways": drugways,
  115. "efs": efs,
  116. })
  117. }
  118. func (c *HisApiController) CreateHisPrescription() {
  119. record_date := c.GetString("record_date")
  120. patient_id, _ := c.GetInt64("patient_id")
  121. doctor, _ := c.GetInt64("doctor")
  122. diagnose := c.GetString("diagnose")
  123. special_sick_history := c.GetString("special_sick_history")
  124. dataBody := make(map[string]interface{}, 0)
  125. err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
  126. if err != nil {
  127. utils.ErrorLog(err.Error())
  128. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  129. return
  130. }
  131. timeLayout := "2006-01-02"
  132. loc, _ := time.LoadLocation("Local")
  133. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  134. if err != nil {
  135. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  136. return
  137. }
  138. adminInfo := c.GetAdminUserInfo()
  139. recordDateTime := theTime.Unix()
  140. //types, _ := c.GetInt64("type")
  141. var prescriptions []*models.HisPrescription
  142. if dataBody["prescription"] != nil && reflect.TypeOf(dataBody["prescription"]).String() == "[]interface {}" {
  143. prescriptions, _ := dataBody["prescription"].([]interface{})
  144. if len(prescriptions) > 0 {
  145. for _, item := range prescriptions {
  146. items := item.(map[string]interface{})
  147. if items["type"] == nil || reflect.TypeOf(items["type"]).String() != "float64" {
  148. utils.ErrorLog("type")
  149. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  150. return
  151. }
  152. types := int64(items["type"].(float64))
  153. ctime := time.Now().Unix()
  154. prescription := &models.HisPrescription{
  155. PatientId: patient_id,
  156. UserOrgId: adminInfo.CurrentOrgId,
  157. RecordDate: recordDateTime,
  158. Ctime: ctime,
  159. Mtime: ctime,
  160. Type: types,
  161. Modifier: adminInfo.AdminUser.Id,
  162. Creator: adminInfo.AdminUser.Id,
  163. Status: 1,
  164. Doctor: doctor,
  165. }
  166. //prescriptions = append(prescriptions, prescription)
  167. service.SaveHisPrescription(prescription)
  168. if items["advices"] != nil && reflect.TypeOf(items["advices"]).String() == "[]interface {}" {
  169. advices := items["advices"].([]interface{})
  170. if len(advices) > 0 {
  171. for _, advice := range advices {
  172. var s models.HisDoctorAdviceInfo
  173. errcode := c.setAdviceWithJSON(&s, advice.(map[string]interface{}))
  174. if errcode > 0 {
  175. c.ServeFailJSONWithSGJErrorCode(errcode)
  176. return
  177. }
  178. advice.Children = append(advice.Children, &s)
  179. }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. if err == nil {
  186. c.ServeSuccessJSON(map[string]interface{}{
  187. "msg": "保存成功",
  188. })
  189. return
  190. } else {
  191. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  192. return
  193. }
  194. }
  195. func (c *HisApiController) CreateHisAdditionalCharge() {
  196. his_patient_id, _ := c.GetInt64("his_patient_id")
  197. patient_id, _ := c.GetInt64("patient_id")
  198. record_date := c.GetString("record_date")
  199. timeLayout := "2006-01-02"
  200. loc, _ := time.LoadLocation("Local")
  201. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  202. if err != nil {
  203. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  204. return
  205. }
  206. adminInfo := c.GetAdminUserInfo()
  207. recordDateTime := theTime.Unix()
  208. dataBody := make(map[string]interface{}, 0)
  209. err = json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
  210. if err != nil {
  211. utils.ErrorLog(err.Error())
  212. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  213. return
  214. }
  215. var additions []*models.HisAdditionalCharge
  216. if dataBody["addition"] != nil && reflect.TypeOf(dataBody["addition"]).String() == "[]interface {}" {
  217. additions, _ := dataBody["addition"].([]interface{})
  218. if len(additions) > 0 {
  219. for _, item := range additions {
  220. items := item.(map[string]interface{})
  221. if items["item_id"] == nil || reflect.TypeOf(items["item_id"]).String() != "float64" {
  222. utils.ErrorLog("item_id")
  223. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  224. return
  225. }
  226. item_id := int64(items["item_id"].(float64))
  227. if items["item_name"] == nil || reflect.TypeOf(items["item_name"]).String() != "string" {
  228. utils.ErrorLog("item_name")
  229. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  230. return
  231. }
  232. item_name := items["item_name"].(string)
  233. if items["price"] == nil || reflect.TypeOf(items["price"]).String() != "string" {
  234. utils.ErrorLog("price")
  235. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  236. return
  237. }
  238. price, _ := strconv.ParseFloat(items["price"].(string), 64)
  239. ctime := time.Now().Unix()
  240. additional := &models.HisAdditionalCharge{
  241. PatientId: patient_id,
  242. HisPatientId: his_patient_id,
  243. UserOrgId: adminInfo.CurrentOrgId,
  244. RecordDate: recordDateTime,
  245. CreatedTime: ctime,
  246. UpdatedTime: ctime,
  247. Modifier: adminInfo.AdminUser.Id,
  248. Creator: adminInfo.AdminUser.Id,
  249. Price: price,
  250. ItemName: item_name,
  251. ItemId: item_id,
  252. Status: 1,
  253. }
  254. additions = append(additions, additional)
  255. }
  256. }
  257. }
  258. for _, item := range additions {
  259. service.CreateAddtionalCharge(item)
  260. }
  261. c.ServeSuccessJSON(map[string]interface{}{
  262. "msg": "创建成功",
  263. })
  264. }
  265. func (c *HisApiController) CreateHisPatientCaseHistory() {
  266. diagnostic := c.GetString("diagnostic")
  267. temperature, _ := c.GetFloat("temperature")
  268. blood_sugar, _ := c.GetFloat("blood_sugar")
  269. pulse, _ := c.GetFloat("pulse")
  270. sbp, _ := c.GetFloat("sbp")
  271. dbp, _ := c.GetFloat("dbp")
  272. blood_fat, _ := c.GetFloat("blood_fat")
  273. height, _ := c.GetFloat("height")
  274. sick_type, _ := c.GetInt64("sick_type")
  275. symptom := c.GetString("symptom")
  276. sick_date := c.GetString("sick_date")
  277. is_infect, _ := c.GetInt64("is_infect")
  278. chief_conplaint := c.GetString("chief_conplaint")
  279. history_of_present_illness := c.GetString("history_of_present_illness")
  280. past_history := c.GetString("past_history")
  281. personal_history := c.GetString("personal_history")
  282. family_history := c.GetString("family_history")
  283. record_date := c.GetString("record_date")
  284. patient_id, _ := c.GetInt64("patient_id")
  285. timeLayout := "2006-01-02"
  286. loc, _ := time.LoadLocation("Local")
  287. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  288. if err != nil {
  289. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  290. return
  291. }
  292. recordDateTime := theTime.Unix()
  293. sickTime, err := time.ParseInLocation(timeLayout+" 15:04:05", sick_date+" 00:00:00", loc)
  294. if err != nil {
  295. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  296. return
  297. }
  298. sickTimes := sickTime.Unix()
  299. ctime := time.Now().Unix()
  300. caseHistory := models.HisPatientCaseHistory{
  301. HisPatientId: patient_id,
  302. Temperature: temperature,
  303. BloodSugar: blood_sugar,
  304. Pulse: pulse,
  305. Sbp: sbp,
  306. Dbp: dbp,
  307. Height: height,
  308. BloodFat: blood_fat,
  309. SickType: sick_type,
  310. Symptom: symptom,
  311. SickDate: sickTimes,
  312. IsInfect: is_infect,
  313. HistoryOfPresentIllness: history_of_present_illness,
  314. PastHistory: past_history,
  315. Doctor: c.GetAdminUserInfo().AdminUser.Id,
  316. ChiefConplaint: chief_conplaint,
  317. PersonalHistory: personal_history,
  318. FamilyHistory: family_history,
  319. Diagnostic: diagnostic,
  320. UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
  321. Status: 1,
  322. Ctime: ctime,
  323. Mtime: ctime,
  324. RecordDate: recordDateTime,
  325. }
  326. err = service.SaveHisPatientCaseHistory(caseHistory)
  327. if err != nil {
  328. c.ServeSuccessJSON(map[string]interface{}{
  329. "msg": "保存成功",
  330. })
  331. }
  332. }
  333. func (c *HisApiController) GetHisPatientCaseHistoryList() {
  334. patient_id, _ := c.GetInt64("patient_id", 0)
  335. adminUser := c.GetAdminUserInfo()
  336. caseHistorys, _ := service.GetHisPatientCaseHistoryList(adminUser.CurrentOrgId, patient_id)
  337. c.ServeSuccessJSON(map[string]interface{}{
  338. "list": caseHistorys,
  339. })
  340. }
  341. func (c *HisApiController) GetHisPatientCaseHistory() {
  342. record_date, _ := c.GetInt64("record_date", 0)
  343. patient_id, _ := c.GetInt64("patient_id", 0)
  344. admin := c.GetAdminUserInfo()
  345. info, _ := service.GetHisPatientInfo(admin.CurrentOrgId, patient_id, record_date)
  346. case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, record_date)
  347. c.ServeSuccessJSON(map[string]interface{}{
  348. "info": info,
  349. "case_history": case_history,
  350. })
  351. }
  352. func (c *HisApiController) CreateCaseHistoryTemplate() {
  353. template_name := c.GetString("template_name")
  354. template_remark := c.GetString("template_remark")
  355. doctor := c.GetAdminUserInfo().AdminUser.Id
  356. diagnostic := c.GetString("diagnostic")
  357. chief_conplaint := c.GetString("chief_conplaint")
  358. history_of_present_illness := c.GetString("history_of_present_illness")
  359. past_history := c.GetString("past_history")
  360. personal_history := c.GetString("personal_history")
  361. family_history := c.GetString("family_history")
  362. record_date := c.GetString("record_date")
  363. timeLayout := "2006-01-02"
  364. loc, _ := time.LoadLocation("Local")
  365. theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
  366. if err != nil {
  367. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
  368. return
  369. }
  370. recordDateTime := theTime.Unix()
  371. ctime := time.Now().Unix()
  372. template := models.HisCaseHistoryTemplate{
  373. HistoryOfPresentIllness: history_of_present_illness,
  374. PastHistory: past_history,
  375. ChiefConplaint: chief_conplaint,
  376. PersonalHistory: personal_history,
  377. FamilyHistory: family_history,
  378. Diagnostic: diagnostic,
  379. UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
  380. Status: 1,
  381. Ctime: ctime,
  382. Mtime: ctime,
  383. RecordDate: recordDateTime,
  384. TemplateName: template_name,
  385. TemplateRemark: template_remark,
  386. Creator: doctor,
  387. Modifier: doctor,
  388. }
  389. err = service.SaveHisPatientCaseHistoryTemplate(template)
  390. if err == nil {
  391. c.ServeSuccessJSON(map[string]interface{}{
  392. "msg": "保存成功",
  393. })
  394. } else {
  395. c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
  396. return
  397. }
  398. }
  399. func (c *HisApiController) GetCaseHistoryTemplate() {
  400. admin := c.GetAdminUserInfo()
  401. template, _ := service.GetHisPatientCaseHistoryTemplate(admin.CurrentOrgId)
  402. c.ServeSuccessJSON(map[string]interface{}{
  403. "template": template,
  404. })
  405. }
  406. func (c *HisApiController) GetPrintHisPatientCaseHistory() {
  407. }
  408. func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo, json map[string]interface{}) int {
  409. if json["advice_name"] == nil || reflect.TypeOf(json["advice_name"]).String() != "string" {
  410. utils.ErrorLog("advice_name")
  411. return enums.ErrorCodeParamWrong
  412. }
  413. adviceName, _ := json["advice_name"].(string)
  414. if len(adviceName) == 0 {
  415. utils.ErrorLog("len(advice_name) == 0")
  416. return enums.ErrorCodeParamWrong
  417. }
  418. advice.AdviceName = adviceName
  419. adviceDesc, _ := json["advice_desc"].(string)
  420. advice.AdviceDesc = adviceDesc
  421. if json["drug_spec"] != nil && reflect.TypeOf(json["drug_spec"]).String() == "string" {
  422. drugSpec, _ := strconv.ParseFloat(json["drug_spec"].(string), 64)
  423. advice.DrugSpec = drugSpec
  424. }
  425. if json["remark"] != nil && reflect.TypeOf(json["remark"]).String() == "string" {
  426. remark, _ := json["remark"].(string)
  427. advice.Remark = remark
  428. }
  429. if json["way"] == nil {
  430. advice.Way = 0
  431. } else {
  432. if json["way"] != nil || reflect.TypeOf(json["way"]).String() == "float64" {
  433. way := int64(json["way"].(float64))
  434. advice.Way = way
  435. }
  436. }
  437. if json["drug_id"] == nil {
  438. advice.DrugId = 0
  439. } else {
  440. if json["drug_id"] != nil || reflect.TypeOf(json["drug_id"]).String() == "float64" {
  441. drug_id := int64(json["drug_id"].(float64))
  442. advice.DrugId = drug_id
  443. }
  444. }
  445. if json["drug_name_id"] == nil {
  446. advice.DrugNameId = 0
  447. } else {
  448. if json["drug_name_id"] != nil || reflect.TypeOf(json["drug_name_id"]).String() == "float64" {
  449. drug_name_id := int64(json["drug_name_id"].(float64))
  450. advice.DrugNameId = drug_name_id
  451. }
  452. }
  453. if json["drug_spec_unit"] != nil && reflect.TypeOf(json["drug_spec_unit"]).String() == "string" {
  454. drugSpecUnit, _ := json["drug_spec_unit"].(string)
  455. advice.DrugSpecUnit = drugSpecUnit
  456. }
  457. if json["single_dose"] != nil && reflect.TypeOf(json["single_dose"]).String() == "string" {
  458. singleDose, _ := strconv.ParseFloat(json["single_dose"].(string), 64)
  459. advice.SingleDose = singleDose
  460. }
  461. if json["single_dose_unit"] != nil && reflect.TypeOf(json["single_dose_unit"]).String() == "string" {
  462. singleDoseUnit, _ := json["single_dose_unit"].(string)
  463. advice.SingleDoseUnit = singleDoseUnit
  464. }
  465. if json["prescribing_number"] != nil && reflect.TypeOf(json["prescribing_number"]).String() == "string" {
  466. prescribingNumber, _ := strconv.ParseFloat(json["prescribing_number"].(string), 64)
  467. advice.PrescribingNumber = prescribingNumber
  468. }
  469. if json["prescribing_number_unit"] != nil && reflect.TypeOf(json["prescribing_number_unit"]).String() == "string" {
  470. prescribingNumberUnit, _ := json["prescribing_number_unit"].(string)
  471. advice.PrescribingNumberUnit = prescribingNumberUnit
  472. }
  473. if json["delivery_way"] != nil && reflect.TypeOf(json["delivery_way"]).String() == "string" {
  474. deliveryWay, _ := json["delivery_way"].(string)
  475. advice.DeliveryWay = deliveryWay
  476. }
  477. if json["execution_frequency"] != nil && reflect.TypeOf(json["execution_frequency"]).String() == "string" {
  478. executionFrequency, _ := json["execution_frequency"].(string)
  479. advice.ExecutionFrequency = executionFrequency
  480. }
  481. return 0
  482. }