report.api.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import { type ReportModel, transformIndicator } from '@/model';
  2. import request from '@/request/alova';
  3. export function reportsMethod(patientId: string) {
  4. return request.Get<ReportModel[], any[]>(`/fdhb-pc/analysisManage/getHarsTid`, {
  5. params: { patientId },
  6. transform(data, headers) {
  7. return data?.map(item => {
  8. return {
  9. ...item,
  10. id: item.healthAnalysisReportId,
  11. time: item.time2,
  12. }
  13. }) ?? [];
  14. },
  15. });
  16. }
  17. export function reportMethod(id: string) {
  18. return request.Get<ReportModel, any>(`/fdhb-pc/analysisManage/getHealRepDetailById`, {
  19. params: { healthAnalysisReportId: id },
  20. transform(data, headers) {
  21. return {
  22. ...data,
  23. id: data.healthAnalysisReportId,
  24. time: data.reportTime,
  25. };
  26. },
  27. });
  28. }
  29. export function schemeMethod(reportId: string) {
  30. return request.Get<ReportModel>(`/fdhb-pc/analysisManage/getCondProgDetailById`, {
  31. params: { healthAnalysisReportId: reportId },
  32. });
  33. }
  34. export function indicatorMethod(reportId: string) {
  35. return request.Get<Record<string, any>[], any[]>(`fdhb-pc/analysisManage/getLast7Day`, {
  36. params: { healthAnalysisReportId: reportId },
  37. transform(data, headers) {
  38. return transformIndicator(data);
  39. },
  40. });
  41. }
  42. // 患者指标
  43. export function patientIndicatorMethod(patientId: string) {
  44. return request.Get<Record<string, any>[], any[]>(`/fdhb-pc/patientQuota/getCurQuovalByPatId`, {
  45. params: { patientId },
  46. transform(data, headers) {
  47. return transformIndicator(data);
  48. },
  49. });
  50. }
  51. // 患者指标更新记录
  52. export function patientIndicatorUpdateReportMethod(patientId: string) {
  53. return request.Get(`/fdhb-pc/patientQuota/getQuovalRecord`, {
  54. params: { patientId },
  55. });
  56. }
  57. // 患者数据更新记录
  58. export function patientInfoUpdateReportMethod(id: string) {
  59. return request.Get(`/fdhb-pc/patientInfoManage/pageChangeRecordById`, {
  60. params: { patientId: id },
  61. });
  62. }