diagnosis.js 14 KB

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