care.api.ts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. import type { List } from '@/model';
  2. import type { SupplierQuery, SupplierModel, SystemItemModel, SystemIteQuery, SystemCwModel, OpenConditioningSchemeModel, ConditioningSchemeModel } from '@/model/care.model';
  3. import request from '@/request/alova';
  4. // 供应商搜索列表
  5. export function supplierMethod(page: number, size: number, query?: SupplierQuery) {
  6. return request.Post<List<SupplierModel>>('/fdhb-pc/conditioningManage/supplier/pageCpSupplier', query ?? {}, {
  7. hitSource: /plan$/, // 匹配失效源
  8. params: { pageNum: page, pageSize: size },
  9. });
  10. }
  11. // 新增和编辑供应商
  12. export function supplierEditMethod(data: Partial<SupplierModel>) {
  13. return data?.id
  14. ? request.Post(`/fdhb-pc/conditioningManage/supplier/updateCpSupplier`, { ...data, id: data.id }, { name: 'edit-supplier' })
  15. : request.Post(`/fdhb-pc/conditioningManage/supplier/addCpSupplier`, { ...data }, { name: 'edit-supplier' });
  16. }
  17. // 删除供应商
  18. export function supplierDeleteMethod(data: Partial<SupplierModel>) {
  19. return request.Post(`/fdhb-pc/conditioningManage/supplier/deleteCpSupplier/${data.id}`, {
  20. name: 'update-supplier',
  21. cacheFor: null,
  22. });
  23. }
  24. //系统项目列表
  25. export function pageSystemCpMethod(page: number, size: number, query?: SystemIteQuery) {
  26. return request.Post<List<SystemItemModel>>('/fdhb-pc/conditioningManage/program/pageSystemCp', query ?? {}, {
  27. // hitSource: /plan$/, // 匹配失效源
  28. params: { pageNum: page, pageSize: size },
  29. });
  30. }
  31. // 获取所有的系统项目
  32. export function getAllSystemCpMethod() {
  33. return request.Post(
  34. '/fdhb-pc/conditioningManage/program/getAllSystemCp',
  35. {},
  36. {
  37. name: 'get-all-system-cp',
  38. cacheFor: null,
  39. }
  40. );
  41. }
  42. // 新增和编辑系统项目和新增编辑项目列表。 项目列表就是机构项目
  43. export function systemCpEditMethod(data: Partial<SystemItemModel>) {
  44. console.log(data, 'data==>', data.addType,data.id,data.isType);
  45. if(data.isType === 'itemsList'){
  46. delete data.id;
  47. }
  48. if (data.addType === 'system') {
  49. return data?.id
  50. ? request.Post(`/fdhb-pc/conditioningManage/program/updateSystemCp`, { ...data, id: data.id }, { name: 'edit-system-cp' })
  51. : request.Post(`/fdhb-pc/conditioningManage/program/addSystemCp`, { ...data }, { name: 'edit-system-cp' });
  52. } else if (data.addType === 'itemsList') {
  53. return data?.id
  54. ? request.Post(`/fdhb-pc/conditioningManage/program/updateInstitutionCp`, { ...data, id: data.id }, { name: 'edit-system-cp' })
  55. : request.Post(`/fdhb-pc/conditioningManage/program/addInstitutionCp`, { ...data }, { name: 'edit-system-cp' });
  56. }
  57. }
  58. // 删除系统项目
  59. export function deleteSystemCpMethod(data: Partial<SystemItemModel>) {
  60. return request.Post(`/fdhb-pc/conditioningManage/program/deleteSystemCp/${data.id}`, {
  61. name: 'delete-system-cp',
  62. cacheFor: null,
  63. });
  64. }
  65. // 选择引入调理方案
  66. export function selectSystemCpMethod(data: Array<string>) {
  67. return request.Post(`/fdhb-pc/conditioningManage/program/copyCp`, [...data], {
  68. name: 'select-system-cp',
  69. cacheFor: null,
  70. });
  71. }
  72. // 机构待确认列表
  73. export function pageOrgConfirmMethod(page: number, size: number, query?: SystemIteQuery) {
  74. return request.Post<List<SystemItemModel>>('/fdhb-pc/conditioningManage/program/pageUnconfirmedCp', query ?? {}, {
  75. hitSource: /plan$/, // 匹配失效源
  76. params: { pageNum: page, pageSize: size },
  77. });
  78. }
  79. // 待确认列表删除
  80. export function deleteOrgConfirmMethod(data: Partial<SystemItemModel>) {
  81. return request.Post(`/fdhb-pc/conditioningManage/program/deleteUnconfirmedCp/${data.id}`, {
  82. name: 'delete-org-confirm',
  83. cacheFor: null,
  84. });
  85. }
  86. // 机构待确认列表确认
  87. export function confirmOrgConfirmMethod(data: Partial<SystemItemModel>) {
  88. return request.Post(
  89. `/fdhb-pc/conditioningManage/program/confirmedCp`,
  90. { ...data },
  91. {
  92. name: 'confirm-org-confirm',
  93. cacheFor: null,
  94. }
  95. );
  96. }
  97. // 已确认项目列表
  98. export function pageConfirmedCpMethod(page: number, size: number, query?: SystemIteQuery) {
  99. return request.Post('/fdhb-pc/conditioningManage/program/pageInstitutionCp', query ?? {}, {
  100. hitSource: /plan$/, // 匹配失效源
  101. params: { pageNum: page, pageSize: size },
  102. });
  103. }
  104. // 获取服务包内容里的列表
  105. export function getCpContentListMethod() {
  106. return request.Post(`/fdhb-pc/conditioningManage/program/getAllInstitutionCp`, {});
  107. }
  108. // 已确认项目列表删除
  109. export function deleteConfirmedCpMethod(data: Partial<SystemItemModel>) {
  110. return request.Post(`/fdhb-pc/conditioningManage/program/deleteInstitutionCp/${data.id}`, {
  111. name: 'delete-confirmed-cp',
  112. cacheFor: null,
  113. });
  114. }
  115. // 获取所有的供应商
  116. export function getAllSupplierMethod(data: Record<string, any>) {
  117. return request.Post(
  118. '/fdhb-pc/conditioningManage/supplier/getAllCpSupplier',
  119. { ...data },
  120. {
  121. name: 'get-all-supplier',
  122. cacheFor: null,
  123. }
  124. );
  125. }
  126. // 获取系统调理包列表
  127. export function getSystemCpListMethod(page: number, size: number, query?: SystemIteQuery) {
  128. return request.Post<List<SystemCwModel>>('/fdhb-pc/conditioningManage/wrap/pageSystemCw', query ?? {}, {
  129. hitSource: /plan$/, // 匹配失效源
  130. params: { pageNum: page, pageSize: size },
  131. name: 'get-system-cp-list',
  132. cacheFor: null,
  133. });
  134. }
  135. // 删除系统调理包
  136. export function deleteSystemCwMethod(data: Partial<SystemCwModel>) {
  137. return request.Post(`/fdhb-pc/conditioningManage/wrap/deleteSystemCw/${data.id}`, {
  138. name: 'delete-system-cw',
  139. cacheFor: null,
  140. });
  141. }
  142. // 新增和编辑系统调理包
  143. export function addSystemCwMethod(data: Partial<SystemCwModel>) {
  144. return data?.id
  145. ? request.Post(`/fdhb-pc/conditioningManage/wrap/updateSystemCw`, { ...data, id: data.id }, { name: 'edit-system-cw' })
  146. : request.Post(`/fdhb-pc/conditioningManage/wrap/addSystemCw`, { ...data }, { name: 'add-system-cw' });
  147. }
  148. // 获取系统调理包详情
  149. export function getSystemCwDetailMethod(data: Partial<SystemCwModel>) {
  150. return request.Post(`/fdhb-pc/conditioningManage/wrap/getCwDetailById/${data.id}`, {
  151. name: 'get-system-cw-detail',
  152. cacheFor: null,
  153. });
  154. }
  155. // 根据调理方案id获取调理方案详情
  156. export function getConditioningSchemeDetailMethod(data: Partial<SystemCwModel>) {
  157. return request.Post(`/fdhb-pc/conditioningManage/program/getCpDetailById/${data.id || data.sourceId}`, {
  158. name: 'get-system-cw-detail',
  159. cacheFor: null,
  160. });
  161. }
  162. // 疾病分页查查询
  163. export function pageMedicineMethod(page: number, size: number, query?: Record<string, any>) {
  164. return request.Post(
  165. `/fdhb-pc/common/pageDiagnoseDisease`,
  166. { page, limit: size, keyWord: query?.keyword, ...query },
  167. {
  168. transform(data: any, headers) {
  169. return {
  170. data: data.records,
  171. total: data.total,
  172. };
  173. },
  174. }
  175. );
  176. }
  177. // 证型分页查询
  178. export function pageDiagnoseTypeMethod(page: number, size: number, query?: Record<string, any>) {
  179. return request.Post(
  180. `/fdhb-pc/common/pageDiagnoseSyndrome`,
  181. { page, limit: size, keyWord: query?.keyword, ...query },
  182. {
  183. transform(data: any, headers) {
  184. return {
  185. data: data.records,
  186. total: data.total,
  187. };
  188. },
  189. }
  190. );
  191. }
  192. // 症状分页查询
  193. export function pageDiagnoseSymptomMethod(page: number, size: number, query?: Record<string, any>) {
  194. return request.Post(
  195. `/fdhb-pc/common/pageDiagnoseSymptom`,
  196. { page, limit: size, keyWord: query?.keyword, ...query },
  197. {
  198. transform(data: any, headers) {
  199. return {
  200. data: data.records,
  201. total: data.total,
  202. };
  203. },
  204. }
  205. );
  206. }
  207. // 穴位分页查询
  208. export function pageAcupointMethod(page: number, size: number, query?: Record<string, any>) {
  209. return request.Post(
  210. `/fdhb-pc/common/pageAcuPoint`,
  211. { page, limit: size, keyWord: query?.keyword, ...query },
  212. {
  213. transform(data: any, headers) {
  214. return {
  215. data: data.records,
  216. total: data.total,
  217. };
  218. },
  219. }
  220. );
  221. }
  222. // 经络分页查询
  223. export function pageMeridianMethod(page: number, size: number, query?: Record<string, any>) {
  224. return request.Post(
  225. `/fdhb-pc/common/pageAcuMeridian`,
  226. { page, limit: size, keyWord: query?.keyword, ...query },
  227. {
  228. transform(data: any, headers) {
  229. return {
  230. data: data.records,
  231. total: data.total,
  232. };
  233. },
  234. }
  235. );
  236. }
  237. // 体质分页查询
  238. export function pagePhysicalTypeMethod(page: number, size: number, query?: Record<string, any>) {
  239. return request.Post(
  240. `/fdhb-pc/common/pagePhysicalType`,
  241. { page, limit: size, keyWord: query?.keyword, ...query },
  242. {
  243. transform(data: any, headers) {
  244. return {
  245. data: data.records,
  246. total: data.total,
  247. };
  248. },
  249. }
  250. );
  251. }
  252. // 机构调理包分页列表
  253. export function pageOrgCwMethod(page: number, size: number, query?: Record<string, any>) {
  254. return request.Post<List<SupplierModel>>('/fdhb-pc/conditioningManage/wrap/pageInstitutionCw', query ?? {}, {
  255. hitSource: /plan$/, // 匹配失效源
  256. params: { pageNum: page, pageSize: size },
  257. });
  258. }
  259. // export function pageOrgCwMethod(page: number, size: number, query?: Record<string, any>) {
  260. // return request.Post<List<SupplierModel>>('/fdhb-pc/conditioningManage/wrap/pageInstitutionCw', query ?? {}, {
  261. // hitSource: /plan$/, // 匹配失效源
  262. // params: { pageNum: page, pageSize: size },
  263. // });
  264. // }
  265. // 新增机构调理包
  266. export function addOrgCwMethod(data: Partial<SystemCwModel>) {
  267. return data?.id
  268. ? request.Post(`/fdhb-pc/conditioningManage/wrap/updateInstitutionCw`, { ...data, id: data.id }, { name: 'edit-org-cw' })
  269. : request.Post(`/fdhb-pc/conditioningManage/wrap/addInstitutionCw`, { ...data }, { name: 'add-org-cw' });
  270. }
  271. // 删除机构调理包
  272. export function deleteOrgCwMethod(data: Partial<SystemCwModel>) {
  273. return request.Post(`/fdhb-pc/conditioningManage/wrap/deleteInstitutionCw/${data.id}`, {
  274. name: 'delete-org-cw',
  275. cacheFor: null,
  276. });
  277. }
  278. // 为患者开具调理方案
  279. export function addConditioningSchemeMethod(data: Partial<OpenConditioningSchemeModel>) {
  280. return request.Post(`/fdhb-pc/patientCrManage/addPcr`, { ...data }, { name: 'add-conditioning-record' });
  281. }
  282. // 根据调理包id获取调理包详情
  283. export function getConditioningRecordDetailMethod(data: Partial<SystemCwModel>) {
  284. if (data.types === 'institution' || data.types === 'system') {
  285. // 机构调理包详情
  286. return request.Post(`/fdhb-pc/conditioningManage/wrap/getCwDetailById/${data.id}`, {
  287. name: 'get-conditioning-record-detail',
  288. cacheFor: null,
  289. });
  290. } else if (data.types === 'record') {
  291. return request.Post(`/fdhb-pc/patientCrManage/getPcrDetailById/${data.id}`, {
  292. name: 'get-conditioning-record-detail',
  293. cacheFor: null,
  294. });
  295. }
  296. }
  297. // 获取的返回的机构服务包内容
  298. export function getCopyCwMethod(data: Partial<SystemCwModel>) {
  299. return request.Post(`/fdhb-pc/conditioningManage/wrap/copyCw/${data.id}/${data.institutionId}`, {
  300. name: 'get-copy-cw',
  301. cacheFor: null,
  302. });
  303. }
  304. // 获取患者列表
  305. export function getPatientListMethod(query?: Record<string, any>) {
  306. return request.Post<List<SystemCwModel>>('/fdhb-pc/patientCrManage/todayPcrs', query ?? {}, {
  307. hitSource: /plan$/, // 匹配失效源
  308. });
  309. }
  310. // 调理记录分页列表
  311. export function getConditioningRecordMethod(page: number, size: number, query?: Record<string, any>) {
  312. return request.Post<List<SystemCwModel>>('/fdhb-pc/patientCrManage/pagePcrs', query ?? {}, {
  313. hitSource: /plan$/, // 匹配失效源
  314. params: { pageNum: page, pageSize: size },
  315. });
  316. }
  317. // 根据调理方案id获取调理记录详情
  318. export function getCpDetailMethod(data: Partial<SystemCwModel>) {
  319. return request.Post(`/fdhb-pc/patientCrManage/getPcrDetailById/${data.id}`, {
  320. name: 'get-conditioning-record-detail',
  321. cacheFor: null,
  322. });
  323. }
  324. // 获取所有的机构服务包
  325. export function getAllOrgCwMethod(query?: Record<string, any>) {
  326. return request.Post('/fdhb-pc/conditioningManage/wrap/getAllInstitutionCw', query ?? {}, {
  327. name: 'get-all-org-cw',
  328. cacheFor: null,
  329. });
  330. }
  331. // 患者(已开具调理方案)调理记录列表
  332. export function getPatientConditioningRecordMethod(id: number) {
  333. return request.Post(`/fdhb-pc/patientCrManage/getPcrs/${id}`, {
  334. name: 'get-conditioning-record-detail',
  335. cacheFor: null,
  336. });
  337. }
  338. // 作废患者调理方案
  339. export function voidConditioningSchemeMethod(id: number) {
  340. return request.Post(`/fdhb-pc/patientCrManage/repealPcr/${id}`, {
  341. name: 'void-conditioning-scheme',
  342. cacheFor: null,
  343. });
  344. }
  345. // 获取省市区
  346. export function getProvinceMethod() {
  347. return request.Get('/fdhb-pc/region/regionCascadeProvince', {
  348. name: 'get-province',
  349. cacheFor: null,
  350. });
  351. }
  352. // 获取市
  353. export function getCityMethod(name: string, provincecode: string) {
  354. return request.Get('/fdhb-pc/region/regionCascadeCity', {
  355. name: 'get-city',
  356. cacheFor: null,
  357. params: { name, provincecode },
  358. });
  359. }
  360. // 获取区
  361. export function getAreaMethod(name: string, citycode: string) {
  362. return request.Get('/fdhb-pc/region/regionCascadeArea', {
  363. name: 'get-area',
  364. cacheFor: null,
  365. params: { name, citycode },
  366. });
  367. }
  368. // 根据调理记录ID获取调理过程
  369. export function getConditioningProcessMethod(id: number) {
  370. return request.Post(`/fdhb-pc/patientCrManage/getPcrProcessById/${id}`, {
  371. name: 'get-conditioning-process',
  372. cacheFor: null,
  373. });
  374. }
  375. // 获取可用的服务包
  376. export function getAvailableCwMethod(patientId: string, patientConditioningRecordId: string) {
  377. return request.Post(
  378. '/fdhb-pc/patientCrManage/getPatUsableCw',
  379. { patientId, patientConditioningRecordId },
  380. {
  381. name: 'get-available-cw',
  382. cacheFor: null,
  383. }
  384. );
  385. }
  386. // 调理方案配置分页列表
  387. export function getConditioningSchemeMethod(page: number, size: number, query?: Record<string, any>) {
  388. return request.Post<List<ConditioningSchemeModel>>('/fdhb-pc/conditioningManage/config/pageCpConfig', query ?? {}, {
  389. hitSource: /plan$/, // 匹配失效源
  390. params: { pageNum: page, pageSize: size },
  391. });
  392. }
  393. // 更新调理方案配置
  394. export function updateConditioningSchemeMethod(orgId: string | number, data: any) {
  395. return request.Post(`/fdhb-pc/conditioningManage/config/updateCpConfig/${orgId}`, data, {
  396. name: 'update-conditioning-scheme',
  397. cacheFor: null,
  398. });
  399. }
  400. // 根据调理方案id获取调理方案配置详情
  401. export function getConditioningDeviceDetailMethod(data: Partial<ConditioningSchemeModel>) {
  402. return request.Post(`/fdhb-pc/conditioningManage/config/getCpConfigDetailById/${data.id || 0}/${data.orgId}`, {
  403. name: 'get-conditioning-scheme-detail',
  404. cacheFor: null,
  405. });
  406. }