diagnosis.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. import request from '@/utils/request.js'
  2. import {fromAnalysisModel} from "@/model/tongue-analysis.model";
  3. import {removeRedundantSemicolons} from '@/api/hack';
  4. // 获取就诊病人信息
  5. export function getPatiiensMsg(data) {
  6. return request({
  7. url: `/outpatient/recordsMgr/${data}`,
  8. method: 'get',
  9. })
  10. };
  11. // 获取中医电子病历回显信息
  12. export function getEmrShowMsg(data) {
  13. return request({
  14. url: `/outpatient/electronicmedicalrecordMgr/infoByRecordsId?recordsId=${data.recordsId}`,
  15. method: 'post',
  16. data
  17. })
  18. };
  19. // 提交诊断页面数据
  20. export function addDiagnosisData(data) {
  21. return request({
  22. url: '/outpatient/diagnosisMgr/Add',
  23. method: 'post',
  24. data
  25. })
  26. };
  27. export function addDiagnosisData2(data) {
  28. return request({
  29. url: '/outpatient/diagnosisMgr/Add',
  30. method: 'post',
  31. data,
  32. }).then(res => {
  33. if (res.ResultCode !== 0) throw Error(res.ResultInfo || `错误`);
  34. if (!res.Data.mainDiagnosis) return {mainDiagnosis: res.Data};
  35. return res.Data;
  36. });
  37. }
  38. // 修改诊断页面数据
  39. export function editDiagnosisData(data) {
  40. return request({
  41. url: '/outpatient/diagnosisMgr/update',
  42. method: 'post',
  43. data
  44. })
  45. };
  46. // 开方获取患者基本信息
  47. export function getPatiensBasisM(data) {
  48. return request({
  49. url: '/test/outpatient/patientBaseInfo?patientId=' + data.patientId,
  50. method: 'post',
  51. // data
  52. }).then(res => removeRedundantSemicolons(res));
  53. };
  54. // 获取表格 药品列表
  55. export function getTableDrug(data, isPurposeType = false) {
  56. if (isPurposeType) {
  57. data.name = data.key;
  58. return request({
  59. url: '/basis/stitutionsdrugMgr/materialQuery',
  60. method: 'post',
  61. data
  62. }).then(res => {
  63. const data = Array.isArray(res.Data) ? res.Data : [];
  64. res.Data = {
  65. TotalRecordCount: data.length,
  66. TotalPageCount: 1,
  67. PageSize: data.length,
  68. ButtonRight: "",
  69. CurrentPageSize: data.length,
  70. PageIndex: 1,
  71. Items: data.map(item => {
  72. return {
  73. pid: item.drugId,
  74. matid: item.drugId,
  75. ypmc: item.name,
  76. gg: item.gg,
  77. dw: item.dw,
  78. price: item.price || '',
  79. }
  80. })
  81. };
  82. return res;
  83. })
  84. }
  85. return request({
  86. url: '/test/outpatient/selectDrug?page=' + data.page + '&limit=' + data.limit,
  87. method: 'post',
  88. data
  89. })
  90. };
  91. //添加处方
  92. export function addRecipe(data) {
  93. return request({
  94. url: '/test/outpatient/addOutPatient',
  95. method: 'post',
  96. data
  97. })
  98. };
  99. //获取诊断页 回显数据
  100. export function getDiagnosisShowData(data) {
  101. return request({
  102. url: '/outpatient/diagnosisMgr/infoByRecordsId?recordsId=' + data.recordsId,
  103. method: 'post',
  104. })
  105. };
  106. // 获取处方回显数据
  107. export function getRecipeShowData(data) {
  108. return request({
  109. url: '/test/outpatient/getPrescription/' + data,
  110. method: 'get'
  111. })
  112. };
  113. // 通过 处方id 获取处方回显数据
  114. export function getRecipeDataByid(data) {
  115. return request({
  116. url: `/outpatient/patientprescriptionMgr/${data.pid}`,
  117. method: 'get'
  118. })
  119. };
  120. // 添加中医电子病历
  121. export function addEMR(data) {
  122. return request({
  123. url: '/outpatient/electronicmedicalrecordMgr/Add',
  124. method: 'post',
  125. data: removeRedundantSemicolons(data),
  126. })
  127. };
  128. // 修改中医电子病历信息
  129. export function editEMR(data) {
  130. return request({
  131. url: '/outpatient/electronicmedicalrecordMgr/update',
  132. method: 'post',
  133. data: removeRedundantSemicolons(data),
  134. })
  135. };
  136. // 回传his
  137. export function backToHis(data) {
  138. return request({
  139. url: '/outpatient/electronicmedicalrecordMgr/electronicmedicalRecordsReturnHis',
  140. method: 'post',
  141. data
  142. })
  143. }
  144. // 寄到本院 获取地址
  145. export function getAddressForHospital(data) {
  146. return request({
  147. url: '/test/outpatient/getAddress',
  148. method: 'post',
  149. data
  150. })
  151. }
  152. // 获取体质辨识列表接口
  153. export function getPhysicalList(data) {
  154. return request({
  155. url: '/outpatient/identificationMgr/listPain?page=' + data.page + '&limit=' + data.limit + '&name=' + data.name,
  156. method: 'post',
  157. data
  158. })
  159. };
  160. // 获取某i个用户的体质辨识记录
  161. export function getUserPhysicList(data) {
  162. return request({
  163. url: '/outpatient/identificationMgr/listPainInfo?patientId=' + data.patientId + '&limit=' + data.limit + '&page=' + data.page,
  164. method: 'post',
  165. data
  166. })
  167. };
  168. //体质辨识 添加
  169. export function addPhysicalList(data) {
  170. return request({
  171. url: '/outpatient/identificationMgr/Add',
  172. method: 'post',
  173. data
  174. })
  175. };
  176. // 获取体质辨识 详情
  177. export function getPhysicalDetail(data) {
  178. return request({
  179. url: `/outpatient/identificationresultMgr/${data.identid}`,
  180. method: 'get'
  181. })
  182. };
  183. // 获取体质辨识 详情
  184. export function getPhysicalDetailGy(data) {
  185. return request({
  186. url: `/outpatient/identificationMgr/selecthealthInterventionBydentificationId?dentificationId=${data.dentificationId}`,
  187. method: 'post',
  188. data
  189. })
  190. };
  191. // 提交体质辨识 医生建议
  192. export function submitDoctorjy(data) {
  193. return request({
  194. url: '/outpatient/identificationresultMgr/update',
  195. method: 'post',
  196. data
  197. })
  198. };
  199. // 提交健康干预
  200. export function submitDoctorGy(data) {
  201. return request({
  202. url: '/outpatient/identificationMgr/SavehealthIntervention',
  203. method: 'post',
  204. data
  205. })
  206. }
  207. // 删除体质辨识记录
  208. export function deletePhysicRecord(data) {
  209. return request({
  210. url: '/outpatient/identificationMgr/BatchDelete?ids=' + data.ids,
  211. method: 'post',
  212. data
  213. })
  214. };
  215. //根据选择的中药类型查询所属药房id
  216. export function getPharmacyID(data) {
  217. return request({
  218. url: '/basis/pharmacyMgr/getPidBytype?type=' + data.type,
  219. method: 'post',
  220. data
  221. })
  222. };
  223. // 切换药房 id
  224. export function changePharmacy(data) {
  225. if (data && Array.isArray(data.drugIds) && data.drugIds.length === 0) return Promise.resolve({
  226. "Data": [],
  227. "ResultInfo": "操作成功",
  228. "ResultCode": 0
  229. });
  230. return request({
  231. url: '/test/outpatient/changeDrug',
  232. method: 'post',
  233. data
  234. })
  235. };
  236. // 获取开方界面协定方数据
  237. export function getAgreeRecipe(data) {
  238. return request({
  239. url: '/test/outpatient/getPres?page=' + data.pageId + '&limit=' + data.pageSize,
  240. method: 'post',
  241. data
  242. })
  243. };
  244. // 根绝就诊记录id 获取就诊信息
  245. export function getSeeDByID(data) {
  246. return request({
  247. url: '/test/outpatient/byRecId',
  248. method: 'get',
  249. params: data
  250. })
  251. };
  252. // 获取病历详情数据
  253. export function getRecordDetail(data) {
  254. return request({
  255. url: '/outpatient/CaseManagement/' + data.id,
  256. method: 'get',
  257. params: data
  258. })
  259. }
  260. // 获取药品详细信息
  261. export function getDrugDetail(data) {
  262. return request({
  263. url: '/basis/stitutionsdrugMgr/stiDrugInfo?stiDrugId=' + data.stiDrugId,
  264. method: 'post',
  265. data
  266. })
  267. };
  268. //开方界面获取协定方详细信息
  269. export function getAccordDetail(data) {
  270. return request({
  271. url: '/test/outpatient/preInfo',
  272. method: 'get',
  273. params: data
  274. })
  275. };
  276. // 获取我最常用
  277. export function getMyOfenUse(data) {
  278. return request({
  279. url: '/test/outpatient/myused',
  280. method: 'get',
  281. params: data
  282. })
  283. };
  284. //协定方 转方 判断
  285. export function changeBasisPre(data) {
  286. return request({
  287. url: '/test/outpatient/changeBasisPre',
  288. method: 'post',
  289. data
  290. })
  291. };
  292. //专家经验转方判断
  293. export function changeExpre(data) {
  294. return request({
  295. url: '/test/outpatient/changeExpPre',
  296. method: 'post',
  297. data
  298. })
  299. }
  300. // 处方修改
  301. export function updateRecipe(data) {
  302. return request({
  303. url: '/test/outpatient/update',
  304. method: 'post',
  305. data
  306. })
  307. };
  308. // 开方页面选择药房
  309. export function customerQuery(data) {
  310. return request({
  311. url: "/basis/pharmacyMgr/customerQuery?type=" + data.type,
  312. method: 'post',
  313. data
  314. })
  315. }
  316. //智能辩证 问卷临时存储
  317. export function znQuestionSave(data) {
  318. return request({
  319. url: '/smartDialecticalQuestionnaireTempSave/tempSave',
  320. method: 'post',
  321. data
  322. })
  323. }
  324. // 只能辩证 问卷回显
  325. export function znQusetionShow(data) {
  326. return request({
  327. url: `/smartDialecticalQuestionnaireTempSave/echoData/${data.recordId}`,
  328. method: 'get',
  329. params: data
  330. })
  331. };
  332. // 处方是否支付
  333. export function recipeIsPay(params) {
  334. return request({
  335. url: `/outpatient/pay/checkPrescriptionPaymentStatus`, //params.preId // ${JSON.stringify(params)}
  336. method: 'post',
  337. // params
  338. data: params
  339. })
  340. }
  341. // 根据就诊记录id 查询 是否有处方
  342. export function getPreNumber(params) {
  343. return request({
  344. url: `/outpatient/recordsMgr/getPrescriptionNumberByRecordId/${params.pid}`,
  345. method: 'get',
  346. params
  347. })
  348. }
  349. // 获取药房 共享药房和 本地药房id
  350. export function getPharmacyIDS(params) {
  351. return request({
  352. url: `/basis/pharmacyMgr/getPharmacyIds`,
  353. method: 'get',
  354. params
  355. })
  356. }
  357. // 提交处方预览
  358. export function getRecipePriview(data) {
  359. return request({
  360. url: `/test/outpatient/addOutPatientPreview`,
  361. method: 'post',
  362. data
  363. })
  364. }
  365. // 获取中药制剂 包装单位
  366. export function getBzdw(params) {
  367. return request({
  368. url: '/test/outpatient/getBZDW',
  369. method: 'get',
  370. params
  371. })
  372. }
  373. // 获取健康跟踪记录 详情
  374. export function getHealthTrack(data) {
  375. return request({
  376. url: '/outpatient/identificationMgr/getHealthTrackingRecordBydentificationId?page=' + data.page + '&limit=' + data.limit + '&dentificationId=' + data.dentificationId,
  377. method: 'post',
  378. data
  379. })
  380. }
  381. // 新增健康跟踪记录
  382. export function addHealthTrack(data) {
  383. return request({
  384. url: '/outpatient/identificationMgr/addHealthTrackingRecord',
  385. method: 'post',
  386. data
  387. })
  388. }
  389. // 获取主要体质
  390. export function getMainPhysical(data) {
  391. return request({
  392. url: '/outpatient/identificationMgr/getAnalysisGroupItemName',
  393. method: 'get'
  394. })
  395. }
  396. // 中医体质统计分析
  397. export function getPhysicalTotalList(data) {
  398. return request({
  399. url: '/outpatient/identificationMgr/statisticalList?page=' + data.page + '&limit=' + data.limit,
  400. method: 'post',
  401. data
  402. })
  403. }
  404. // 中医体质统计分析导出
  405. export function exportPhysicalTotal(data) {
  406. return request({
  407. url: '/outpatient/identificationMgr/statisticalListExport?page=' + data.page + '&limit=' + data.limit,
  408. method: 'post',
  409. data
  410. })
  411. }
  412. // 中医体质分析详情 生成PDF
  413. export function createPdf(data) {
  414. return request({
  415. url: '/PDF/PDF',
  416. method: 'post',
  417. data
  418. })
  419. }
  420. // 查询是否健康干预锅
  421. export function findIsHealthGY(data) {
  422. return request({
  423. url: `/outpatient/identificationresultMgr/healthInterventionOrNot/${data.identid}`,
  424. method: 'get',
  425. params: data
  426. })
  427. }
  428. // 获取医保规则最大(最小)药味数
  429. export function getMaxMinDoaseNumber(data) {
  430. return request({
  431. url: '/basis/medicalInsuranceRegulationMgr/minimumAndMaximumDosageNumber',
  432. method: 'post',
  433. data
  434. })
  435. }
  436. // 获取合理安全用药规则
  437. export async function getRationalSafeUse() {
  438. return request({
  439. url: '/basis/medicalInsuranceRegulationMgr/minimumAndMaximumDosageNumber',
  440. method: 'post',
  441. })
  442. }
  443. export function getTongueAndFaceAnalysis(data) {
  444. return request({
  445. url: '/outpatient/electronicmedicalrecordMgr/getTongueFaceAnalysisResult',
  446. method: 'post',
  447. data,
  448. params: {recordsId: data.recordsId},
  449. }).then(res => {
  450. if (res.ResultCode == 0) {
  451. const tongue = fromAnalysisModel('tongue', res.Data);
  452. const face = fromAnalysisModel('face', res.Data);
  453. return res.Data = {
  454. id: res.Data.recordsid,
  455. time: res.Data.recordstime,
  456. tongue,
  457. face,
  458. cover: [tongue ? tongue.cover : null, face ? face.cover : null].filter(Boolean).flatMap(item => item),
  459. }, res;
  460. } else {
  461. throw res
  462. }
  463. })
  464. }
  465. export function getTongueAndFaceAnalysisRecords(patientId, page = 1, limit = 6) {
  466. // patientId = '8d12c55e-7a29-45f3-804d-ed12b0e27660'
  467. return request({
  468. url: '/outpatient/electronicmedicalrecordMgr/getRecordTfs',
  469. method: 'post',
  470. params: {patientId, page, limit},
  471. }).then(res => {
  472. if (res.ResultCode == 0) {
  473. return {
  474. total: res.Data.TotalRecordCount,
  475. data: res.Data.Items.map(item => {
  476. const tongue = fromAnalysisModel('tongue', item);
  477. const face = fromAnalysisModel('face', item);
  478. return {
  479. id: item.recordsid,
  480. time: item.recordstime,
  481. tongue,
  482. face,
  483. cover: [tongue ? tongue.cover : null, face ? face.cover : null].filter(Boolean).flatMap(item => item),
  484. }
  485. }),
  486. }
  487. } else {
  488. throw res
  489. }
  490. })
  491. }