his_api_controller.go 18KB

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