followup_new.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. Vue.filter('dateString', function (value) {
  2. return value?value.substr(0,16):''
  3. })
  4. new Vue({
  5. el:"#app",
  6. data: {
  7. date1:'',
  8. radio: '1',
  9. value:'',
  10. id:'',//1888849
  11. status:false,//2计划中,可编辑
  12. queryData:{},
  13. objData:{}, //症状
  14. checkList:[],//症状体现
  15. symptoms:[
  16. {key:"NO_SYMPTOM",name:'无症状',value:'',code:'0'},
  17. {key:"HEADACHE",name:'头痛头晕',value:'',code:'1'},
  18. {key:"NAUSEA",name:'恶心呕吐',value:'',code:'1'},
  19. {key:"VERTIGO_TINNITUS",name:'眼花耳鸣',value:'',code:'1'},
  20. {key:"DIFFICULTY_BREATHING",name:'呼吸困难',value:'',code:'1'},
  21. {key:"PALPITATIONS",name:'心悸胸闷',value:'',code:'1'},
  22. {key:"EPISTAXIS_BLEEDING",name:'鼻衄出血不止',value:'',code:'1'},
  23. {key:"LIMBS_NUMB",name:'四肢发麻',value:'',code:'1'},
  24. {key:"EXTREMITY_EDEMA",name:'下肢水肿',value:'',code:'1'},
  25. {key:"POLYDIPSIA",name:'多饮',value:'',code:'1'},
  26. {key:"MORE_FOOD",name:'多食',value:'',code:'1'},
  27. {key:"MORE_URINE",name:'多尿',value:'',code:'1'},
  28. {key:"BLURRED_VISION",name:'视力模糊',value:'',code:'1'},
  29. {key:"INFECTION",name:'感染',value:'',code:'1'},
  30. {key:"NUMB_HANDS",name:'四肢麻痹',value:'',code:'1'},
  31. {key:"WEIGHT_LOSS",name:'体重下降',value:'',code:'1'}
  32. ],//症状
  33. frequency_dict:recipe_frequency_dict,//频次
  34. unit_dict:measure_unit_dict, //单位
  35. hasInsulin:[],//胰岛素药
  36. noInsulin:[],//其他药
  37. allDrugs:[],//所有药品
  38. // remark:'' //其他,
  39. },
  40. mounted:function(){
  41. var vm = this
  42. var Request = GetRequest();
  43. vm.id = Request["id"]
  44. this.initData()
  45. },
  46. methods: {
  47. getDrugs(data,val){
  48. var drug = this.allDrugs.find(item=>{
  49. return item.drugCode == val
  50. })
  51. data = Object.assign(data,{
  52. drugsName:drug.drugName,
  53. drugsGroup:'normal',
  54. drugsCode:drug.drugCode
  55. })
  56. console.log(data)
  57. },
  58. initData:function(){
  59. var vm = this
  60. //获取随访登记数据
  61. recordAPI.getFollowup({id:this.id}).then(function(res){
  62. if(res.status==200){
  63. var data = res.data
  64. data.followupDate = data.followupDate?data.followupDate.substr(0,10):''
  65. vm.queryData = data
  66. window.localStorage.setItem('serveFollowupDate',JSON.stringify(data));//储存数据,后续页面需要调用
  67. console.log(vm.queryData.followupDate)
  68. if(data.status=='2'){
  69. vm.status=false
  70. }else{
  71. vm.status=true
  72. }
  73. }else{
  74. toastr.error(res.msg)
  75. }
  76. })
  77. //获取数据
  78. recordAPI.getFollowupProjectData({id:this.id}).then(function(res){
  79. if(res.status==200){
  80. var data = res.data;
  81. console.log(data.EXAM_DATE)
  82. vm.objData = res.data
  83. delete data["create_time"];delete data["followup_id"];delete data["followup_project"];delete data["id"];
  84. var allData = vm.symptoms,checkList=[]
  85. for(var key in data){
  86. for(var j=0;j<allData.length;j++){
  87. if(allData[j].key == key){
  88. checkList.push(key)
  89. break;
  90. }
  91. }
  92. vm.checkList = checkList
  93. }
  94. }
  95. })
  96. // 获取已填写的药品数据
  97. recordAPI.getFollowupDrugs({id:this.id}).then(function(res){
  98. if(res.status==200){
  99. var data = res.data.DRUG_LIST;
  100. if(data.length){
  101. for(var i=0;i<data.length;i++){
  102. if(data[i].drugsGroup == 'insulin'){//胰岛素药品
  103. vm.hasInsulin.push(data[i])
  104. }else{
  105. vm.noInsulin.push(data[i])
  106. }
  107. }
  108. }else{
  109. var k=6
  110. while(k>0){
  111. vm.hasInsulin.push({
  112. drugsName:'',
  113. dose:'',
  114. unit:'',
  115. frequency:'',
  116. drugsGroup:"",
  117. drugsCode:""
  118. })
  119. vm.noInsulin.push({
  120. drugsName:'',
  121. dose:'',
  122. unit:'',
  123. frequency:'',
  124. drugsGroup:"",
  125. drugsCode:""
  126. })
  127. k--
  128. }
  129. }
  130. if(vm.hasInsulin.length<6){
  131. while((6-vm.hasInsulin.length)>0){
  132. vm.hasInsulin.push({
  133. drugsName:'',
  134. dose:'',
  135. unit:'',
  136. frequency:'',
  137. drugsGroup:"",
  138. drugsCode:""
  139. })
  140. }
  141. }
  142. if(vm.noInsulin.length<6){
  143. while((6-vm.noInsulin.length)>0){
  144. vm.noInsulin.push({
  145. drugsName:'',
  146. dose:'',
  147. unit:'',
  148. frequency:'',
  149. drugsGroup:"",
  150. drugsCode:""
  151. })
  152. }
  153. }
  154. }else{
  155. toastr.error('获取数据失败')
  156. while((6-vm.hasInsulin.length)>0){
  157. vm.hasInsulin.push({
  158. drugsName:'',
  159. dose:'',
  160. unit:'',
  161. frequency:'',
  162. drugsGroup:"",
  163. drugsCode:""
  164. })
  165. }
  166. while((6-vm.noInsulin.length)>0){
  167. vm.noInsulin.push({
  168. drugsName:'',
  169. dose:'',
  170. unit:'',
  171. frequency:'',
  172. drugsGroup:"",
  173. drugsCode:""
  174. })
  175. }
  176. }
  177. })
  178. //获取所有药品数据
  179. recordAPI.findDictByName({name:''}).then(function(res){
  180. if(res.status==200){
  181. vm.allDrugs = res.data
  182. }
  183. })
  184. },
  185. submitData(){
  186. var vm = this,params={
  187. id: this.id, //随访记录ID
  188. date:this.queryData.followupDate+" 00:00:00", //随访时间
  189. followupType:this.queryData.followupType,//随访方式
  190. followupClass:this.queryData.followupClass, //随访类别【1.高血压 2.糖尿病】
  191. followupManagerStatus:this.queryData.followupManagerStatus, //随访管理状态
  192. followupNo:this.queryData.followupNo, //随访记录编码
  193. plandate: this.queryData.followupNextDate,//下次随访时间
  194. // prescriptioncode:'',//续方CODE
  195. followupProjectData:{} //随访项目数据
  196. },symptom,sign={},inspect={},guidance={},evaluate={},medication={},target={},education={},referral={},drugs
  197. var checkList = Array.from(vm.checkList, (data) => [data,1])
  198. symptom = Object.fromEntries(checkList)
  199. symptom["HYPOG_REACT_CODE"]=this.objData.HYPOG_REACT_CODE
  200. symptom["SYMPTOM_OTHER"]=this.objData.SYMPTOM_OTHER
  201. sign["BP_D"]=this.objData.BP_D
  202. sign["BP_U"]=this.objData.BP_U
  203. sign["HEIGHT"]=this.objData.HEIGHT
  204. sign["WEIGHT"]=this.objData.WEIGHT
  205. sign["BMI"]=this.objData.BMI
  206. sign["WEIGHT_EXP"]=this.objData.WEIGHT_EXP
  207. sign["BMI_EXP"]=this.objData.BMI_EXP
  208. sign["HEART_RATE"]=this.objData.HEART_RATE
  209. sign["POFDA_MARK"]=this.objData.POFDA_MARK
  210. sign["OTHER_POSITIVE_SIGNS"]=this.objData.OTHER_POSITIVE_SIGNS
  211. inspect["BS_FPG"]=this.objData.BS_FPG
  212. inspect["NO_BS_FPG"]=this.objData.NO_BS_FPG
  213. inspect["GHB"]=this.objData.GHB
  214. inspect["RANDOM_BLOOD_SUGAR"]=this.objData.RANDOM_BLOOD_SUGAR
  215. inspect["EXAM_DATE"]=this.objData.EXAM_DATE
  216. inspect["BLOOD_FAT_TRIGLYCERIDE"]=this.objData.BLOOD_FAT_TRIGLYCERIDE
  217. inspect["BLOOD_FAT_TC"]=this.objData.BLOOD_FAT_TC
  218. inspect["BLOOD_FAT_LDLC"]=this.objData.BLOOD_FAT_LDLC
  219. inspect["RENAL_FUNCTION_CREATININE"]=this.objData.RENAL_FUNCTION_CREATININE
  220. inspect["RENAL_FUNCTION_BUN"]=this.objData.RENAL_FUNCTION_BUN
  221. inspect["MICROALBUMINURIA"]=this.objData.MICROALBUMINURIA
  222. guidance["DAILY_SMOKING"]=this.objData.DAILY_SMOKING
  223. guidance["DAILY_DRINKING"]=this.objData.DAILY_DRINKING
  224. guidance["EXERCISE_FREQ_CODE"]=this.objData.EXERCISE_FREQ_CODE
  225. guidance["EXERCISE_DURATION_MINS"]=this.objData.EXERCISE_DURATION_MINS
  226. guidance["SOMKING_EXP"]=this.objData.SOMKING_EXP
  227. guidance["DRINK_EXP"]=this.objData.DRINK_EXP
  228. guidance["EXERCISE_FREQ_CODE_EXP"]=this.objData.EXERCISE_FREQ_CODE_EXP
  229. guidance["EXERCISE_DURATION_MINS_EXP"]=this.objData.EXERCISE_DURATION_MINS_EXP
  230. guidance["COMPLIANCE_RESULT_CODE"]=this.objData.COMPLIANCE_RESULT_CODE
  231. guidance["PSY_ADJUST_RESULT_CODE"]=this.objData.PSY_ADJUST_RESULT_CODE
  232. guidance["DAILY_STAPLE"]=this.objData.DAILY_STAPLE
  233. guidance["SALT_TAKEN_LEVEL_CODE"]=this.objData.SALT_TAKEN_LEVEL_CODE
  234. guidance["SALT_TAKEN_LEVEL_EXP"]=this.objData.SALT_TAKEN_LEVEL_EXP
  235. evaluate["HYP_FOLLOWUP_TYPE_CODE"] = this.objData.HYP_FOLLOWUP_TYPE_CODE //高血压
  236. evaluate["HYP_COMPLICATION_DETAIL"] = this.objData.HYP_COMPLICATION_DETAIL
  237. evaluate["DIA_FOLLOWUP_TYPE_CODE"] = "" //糖尿病
  238. evaluate["DIA_COMPLICATION_DETAIL"] = ""
  239. drugs={
  240. DRUG_COMPLIANCE_CODE:this.objData.DRUG_COMPLIANCE_CODE
  241. }
  242. medication["drugsData"] = []
  243. for(let k=0;k<vm.noInsulin.length;k++){
  244. //药品名称
  245. if(vm.noInsulin[k].drugsName){
  246. medication["drugsData"].push(vm.noInsulin[k])
  247. }
  248. }
  249. for(let k=0;k<vm.hasInsulin.length;k++){
  250. //胰岛素药品
  251. if(vm.hasInsulin[k].drugsName){
  252. medication["drugsData"].push(vm.hasInsulin[k])
  253. }
  254. }
  255. medication["drugsData"].map(item=>{
  256. let data = item
  257. return {
  258. drugsName:data.drugsName,
  259. dose:data.dose,
  260. unit:data.unit,
  261. frequency:data.frequency,
  262. drugsGroup:data.drugsGroup,
  263. drugsCode:data.drugsCode
  264. }
  265. })
  266. target["CONTROL_DATE"]=this.objData.CONTROL_DATE
  267. target["CONTROL_CONSTITUTOR"]=this.objData.CONTROL_CONSTITUTOR
  268. target["CONTROL_BP_D"]=this.objData.CONTROL_BP_D
  269. target["CONTROL_BP_U"]=this.objData.CONTROL_BP_U
  270. target["CONTROL_BS_FPG"]=this.objData.CONTROL_BS_FPG
  271. target["CONTROL_NO_BS_FPG"]=this.objData.CONTROL_NO_BS_FPG
  272. target["CONTROL_GHB"]=this.objData.CONTROL_GHB
  273. target["CONTROL_TRIGLYCERIDE"]=this.objData.CONTROL_TRIGLYCERIDE
  274. target["CONTROL_TOTAL_CHOLESTEROL"]=this.objData.CONTROL_TOTAL_CHOLESTEROL
  275. target["CONTROL_LDL"]=this.objData.CONTROL_LDL
  276. target["CONTROL_WEIGHT"]=this.objData.CONTROL_WEIGHT
  277. target["CONTROL_EXERCISE_FREQ_CODE"]=this.objData.CONTROL_EXERCISE_FREQ_CODE
  278. target["CONTROL_EXERCISE_DURATION_MINS"]=this.objData.CONTROL_EXERCISE_DURATION_MINS
  279. education["ARCHIVE_TIME"]=this.objData.ARCHIVE_TIME
  280. education["ARCHIVE_OPERATOR_NAME"]=this.objData.ARCHIVE_OPERATOR_NAME
  281. education["HEALTH_EDUCATE"]=this.objData.HEALTH_EDUCATE
  282. education["EDUCATE_CONTENT"]=this.objData.EDUCATE_CONTENT
  283. referral["DRUG_ADVERSE_MARK"]=this.objData.DRUG_ADVERSE_MARK
  284. referral["ADR_REMARK"]=this.objData.ADR_REMARK
  285. referral["REFUSE_REFERRAL"]=this.objData.REFUSE_REFERRAL
  286. referral["REFUSE_REFERRAL_WHY"]=this.objData.REFUSE_REFERRAL_WHY
  287. referral["TRANSFER_RESON"]=this.objData.TRANSFER_RESON
  288. referral["TRANSFER_ORG_DEPT"]=this.objData.TRANSFER_ORG_DEPT
  289. var obj = {}
  290. Object.assign(obj,symptom,sign,inspect,guidance,evaluate,target,education,referral,drugs)
  291. params.followupProjectData["followupProjectData"] = obj
  292. params.followupProjectData["drugsData"]=medication["drugsData"]
  293. console.log(params)
  294. params.followupProjectData = JSON.stringify(params.followupProjectData)
  295. recordAPI.saveAllFollowupProjectData(params).then(function(res){
  296. if(res.status==200){
  297. toastr.info("保存成功")
  298. }else{
  299. toastr.error(res.msg)
  300. }
  301. })
  302. }
  303. },
  304. })