diagnosis.js 14 KB

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