@kenyaemr/esm-care-panel-app 5.4.4-pre.43 → 5.4.4-pre.430

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (487) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/currentProphylaxisUsed/fr.json +1 -0
  3. package/dist/1072.js +1 -1
  4. package/dist/1072.js.map +1 -1
  5. package/dist/1278.js +1 -0
  6. package/dist/1278.js.map +1 -0
  7. package/dist/1354.js +1 -0
  8. package/dist/1354.js.map +1 -0
  9. package/dist/1375.js +66 -0
  10. package/dist/1375.js.map +1 -0
  11. package/dist/1442.js +1 -0
  12. package/dist/1442.js.map +1 -0
  13. package/dist/15.js +1 -0
  14. package/dist/15.js.map +1 -0
  15. package/dist/1620.js +1 -0
  16. package/dist/1620.js.map +1 -0
  17. package/dist/1761.js +1 -1
  18. package/dist/1761.js.map +1 -1
  19. package/dist/1789.js +1 -0
  20. package/dist/1789.js.map +1 -0
  21. package/dist/1831.js +1 -0
  22. package/dist/1831.js.map +1 -0
  23. package/dist/1844.js +1 -0
  24. package/dist/1844.js.map +1 -0
  25. package/dist/1854.js +1 -0
  26. package/dist/1854.js.map +1 -0
  27. package/dist/1919.js +1 -0
  28. package/dist/1919.js.map +1 -0
  29. package/dist/1946.js +1 -0
  30. package/dist/1946.js.map +1 -0
  31. package/dist/2007.js +1 -1
  32. package/dist/2007.js.map +1 -1
  33. package/dist/2127.js +1 -0
  34. package/dist/2127.js.map +1 -0
  35. package/dist/2146.js +1 -0
  36. package/dist/2146.js.map +1 -0
  37. package/dist/2152.js +1 -0
  38. package/dist/2152.js.map +1 -0
  39. package/dist/2202.js +1 -0
  40. package/dist/2202.js.map +1 -0
  41. package/dist/2300.js +1 -0
  42. package/dist/2300.js.map +1 -0
  43. package/dist/2394.js +1 -0
  44. package/dist/2394.js.map +1 -0
  45. package/dist/2468.js +1 -0
  46. package/dist/2468.js.map +1 -0
  47. package/dist/2534.js +1 -1
  48. package/dist/2534.js.map +1 -1
  49. package/dist/2556.js +1 -0
  50. package/dist/2556.js.map +1 -0
  51. package/dist/26.js +1 -0
  52. package/dist/26.js.map +1 -0
  53. package/dist/2648.js +1 -0
  54. package/dist/2648.js.map +1 -0
  55. package/dist/2823.js +1 -0
  56. package/dist/2823.js.map +1 -0
  57. package/dist/2840.js +1 -0
  58. package/dist/2840.js.map +1 -0
  59. package/dist/2842.js +1 -0
  60. package/dist/2842.js.map +1 -0
  61. package/dist/2916.js +1 -0
  62. package/dist/2916.js.map +1 -0
  63. package/dist/2924.js +1 -0
  64. package/dist/2924.js.map +1 -0
  65. package/dist/3285.js +1 -0
  66. package/dist/3285.js.map +1 -0
  67. package/dist/3302.js +1 -0
  68. package/dist/3302.js.map +1 -0
  69. package/dist/3321.js +1 -0
  70. package/dist/3321.js.map +1 -0
  71. package/dist/3335.js +1 -0
  72. package/dist/3335.js.map +1 -0
  73. package/dist/3378.js +1 -0
  74. package/dist/3378.js.map +1 -0
  75. package/dist/3504.js +1 -0
  76. package/dist/3504.js.map +1 -0
  77. package/dist/356.js +1 -0
  78. package/dist/356.js.map +1 -0
  79. package/dist/3569.js +1 -0
  80. package/dist/3569.js.map +1 -0
  81. package/dist/3580.js +1 -0
  82. package/dist/3580.js.map +1 -0
  83. package/dist/3690.js +1 -0
  84. package/dist/3690.js.map +1 -0
  85. package/dist/3723.js +1 -0
  86. package/dist/3723.js.map +1 -0
  87. package/dist/3745.js +1 -0
  88. package/dist/3745.js.map +1 -0
  89. package/dist/3796.js +1 -0
  90. package/dist/3796.js.map +1 -0
  91. package/dist/3805.js +1 -0
  92. package/dist/3805.js.map +1 -0
  93. package/dist/3813.js +1 -0
  94. package/dist/3813.js.map +1 -0
  95. package/dist/3847.js +1 -0
  96. package/dist/3847.js.map +1 -0
  97. package/dist/393.js +6 -0
  98. package/dist/393.js.map +1 -0
  99. package/dist/3953.js +1 -0
  100. package/dist/3953.js.map +1 -0
  101. package/dist/3989.js +1 -0
  102. package/dist/3989.js.map +1 -0
  103. package/dist/4178.js +1 -1
  104. package/dist/4178.js.map +1 -1
  105. package/dist/4212.js +1 -0
  106. package/dist/4212.js.map +1 -0
  107. package/dist/4337.js +1 -0
  108. package/dist/4337.js.map +1 -0
  109. package/dist/4405.js +1 -0
  110. package/dist/4405.js.map +1 -0
  111. package/dist/4487.js +11 -0
  112. package/dist/4487.js.map +1 -0
  113. package/dist/4567.js +1 -0
  114. package/dist/4567.js.map +1 -0
  115. package/dist/4588.js +1 -0
  116. package/dist/4588.js.map +1 -0
  117. package/dist/4637.js +1 -1
  118. package/dist/4637.js.map +1 -1
  119. package/dist/466.js +1 -1
  120. package/dist/466.js.map +1 -1
  121. package/dist/4711.js +1 -0
  122. package/dist/4711.js.map +1 -0
  123. package/dist/4759.js +1 -0
  124. package/dist/4759.js.map +1 -0
  125. package/dist/4817.js +1 -0
  126. package/dist/4817.js.map +1 -0
  127. package/dist/4818.js +1 -0
  128. package/dist/4818.js.map +1 -0
  129. package/dist/500.js +1 -0
  130. package/dist/500.js.map +1 -0
  131. package/dist/5086.js +1 -1
  132. package/dist/5086.js.map +1 -1
  133. package/dist/510.js +1 -0
  134. package/dist/510.js.map +1 -0
  135. package/dist/5117.js +1 -0
  136. package/dist/5117.js.map +1 -0
  137. package/dist/5209.js +1 -1
  138. package/dist/5209.js.map +1 -1
  139. package/dist/5279.js +1 -0
  140. package/dist/5279.js.map +1 -0
  141. package/dist/5362.js +1 -0
  142. package/dist/5362.js.map +1 -0
  143. package/dist/5366.js +1 -0
  144. package/dist/5366.js.map +1 -0
  145. package/dist/5567.js +1 -0
  146. package/dist/5567.js.map +1 -0
  147. package/dist/5598.js +1 -0
  148. package/dist/5598.js.map +1 -0
  149. package/dist/5676.js +1 -1
  150. package/dist/5676.js.map +1 -1
  151. package/dist/5731.js +5 -0
  152. package/dist/5731.js.map +1 -0
  153. package/dist/5809.js +1 -1
  154. package/dist/5809.js.map +1 -1
  155. package/dist/5825.js +1 -0
  156. package/dist/5825.js.map +1 -0
  157. package/dist/5932.js +1 -0
  158. package/dist/5932.js.map +1 -0
  159. package/dist/5941.js +1 -0
  160. package/dist/5941.js.map +1 -0
  161. package/dist/6104.js +1 -1
  162. package/dist/6104.js.map +1 -1
  163. package/dist/6273.js +1 -0
  164. package/dist/6273.js.map +1 -0
  165. package/dist/6337.js +1 -0
  166. package/dist/6337.js.map +1 -0
  167. package/dist/6357.js +1 -0
  168. package/dist/6357.js.map +1 -0
  169. package/dist/6427.js +1 -1
  170. package/dist/6427.js.map +1 -1
  171. package/dist/6478.js +7 -0
  172. package/dist/6478.js.map +1 -0
  173. package/dist/65.js +1 -0
  174. package/dist/65.js.map +1 -0
  175. package/dist/6508.js +1 -0
  176. package/dist/6508.js.map +1 -0
  177. package/dist/6567.js +1 -0
  178. package/dist/6567.js.map +1 -0
  179. package/dist/6634.js +1 -0
  180. package/dist/6634.js.map +1 -0
  181. package/dist/6698.js +1 -0
  182. package/dist/6698.js.map +1 -0
  183. package/dist/682.js +1 -0
  184. package/dist/682.js.map +1 -0
  185. package/dist/689.js +1 -1
  186. package/dist/689.js.map +1 -1
  187. package/dist/7126.js +1 -0
  188. package/dist/7126.js.map +1 -0
  189. package/dist/7205.js +1 -0
  190. package/dist/7205.js.map +1 -0
  191. package/dist/7209.js +1 -0
  192. package/dist/7209.js.map +1 -0
  193. package/dist/740.js +1 -0
  194. package/dist/740.js.map +1 -0
  195. package/dist/7478.js +1 -1
  196. package/dist/7478.js.map +1 -1
  197. package/dist/7479.js +1 -0
  198. package/dist/7479.js.map +1 -0
  199. package/dist/7602.js +1 -0
  200. package/dist/7602.js.map +1 -0
  201. package/dist/7686.js +1 -0
  202. package/dist/7686.js.map +1 -0
  203. package/dist/7782.js +1 -0
  204. package/dist/7782.js.map +1 -0
  205. package/dist/7796.js +1 -0
  206. package/dist/7796.js.map +1 -0
  207. package/dist/7808.js +1 -0
  208. package/dist/7808.js.map +1 -0
  209. package/dist/781.js +1 -1
  210. package/dist/781.js.map +1 -1
  211. package/dist/8018.js +1 -0
  212. package/dist/8018.js.map +1 -0
  213. package/dist/8183.js +1 -0
  214. package/dist/8183.js.map +1 -0
  215. package/dist/8196.js +1 -1
  216. package/dist/8196.js.map +1 -1
  217. package/dist/820.js +1 -0
  218. package/dist/820.js.map +1 -0
  219. package/dist/8240.js +1 -1
  220. package/dist/8240.js.map +1 -1
  221. package/dist/8472.js +1 -0
  222. package/dist/8472.js.map +1 -0
  223. package/dist/8521.js +1 -0
  224. package/dist/8521.js.map +1 -0
  225. package/dist/8602.js +1 -0
  226. package/dist/8602.js.map +1 -0
  227. package/dist/8607.js +1 -0
  228. package/dist/8607.js.map +1 -0
  229. package/dist/867.js +1 -0
  230. package/dist/867.js.map +1 -0
  231. package/dist/8743.js +1 -0
  232. package/dist/8743.js.map +1 -0
  233. package/dist/8762.js +1 -0
  234. package/dist/8762.js.map +1 -0
  235. package/dist/8812.js +1 -0
  236. package/dist/8812.js.map +1 -0
  237. package/dist/8860.js +1 -0
  238. package/dist/8860.js.map +1 -0
  239. package/dist/8985.js +1 -0
  240. package/dist/8985.js.map +1 -0
  241. package/dist/8990.js +1 -0
  242. package/dist/8990.js.map +1 -0
  243. package/dist/9011.js +1 -1
  244. package/dist/9011.js.map +1 -1
  245. package/dist/9061.js +1 -0
  246. package/dist/9061.js.map +1 -0
  247. package/dist/9087.js +1 -0
  248. package/dist/9087.js.map +1 -0
  249. package/dist/9134.js +1 -0
  250. package/dist/9134.js.map +1 -0
  251. package/dist/9148.js +1 -0
  252. package/dist/9148.js.map +1 -0
  253. package/dist/9168.js +1 -0
  254. package/dist/9168.js.map +1 -0
  255. package/dist/9197.js +1 -0
  256. package/dist/9197.js.map +1 -0
  257. package/dist/9267.js +1 -0
  258. package/dist/9267.js.map +1 -0
  259. package/dist/935.js +1 -0
  260. package/dist/935.js.map +1 -0
  261. package/dist/9425.js +1 -1
  262. package/dist/9520.js +1 -1
  263. package/dist/9520.js.map +1 -1
  264. package/dist/9547.js +1 -0
  265. package/dist/9547.js.map +1 -0
  266. package/dist/9549.js +1 -0
  267. package/dist/9549.js.map +1 -0
  268. package/dist/9612.js +1 -0
  269. package/dist/9612.js.map +1 -0
  270. package/dist/9621.js +1 -0
  271. package/dist/9621.js.map +1 -0
  272. package/dist/9771.js +1 -0
  273. package/dist/9771.js.map +1 -0
  274. package/dist/9774.js +1 -0
  275. package/dist/9774.js.map +1 -0
  276. package/dist/9800.js +1 -0
  277. package/dist/9800.js.map +1 -0
  278. package/dist/9806.js +1 -0
  279. package/dist/9806.js.map +1 -0
  280. package/dist/9885.js +1 -0
  281. package/dist/9885.js.map +1 -0
  282. package/dist/992.js +1 -0
  283. package/dist/992.js.map +1 -0
  284. package/dist/995.js +1 -0
  285. package/dist/995.js.map +1 -0
  286. package/dist/kenyaemr-esm-care-panel-app.js +6 -5
  287. package/dist/kenyaemr-esm-care-panel-app.js.buildmanifest.json +1573 -672
  288. package/dist/kenyaemr-esm-care-panel-app.js.map +1 -1
  289. package/dist/main.js +6 -5
  290. package/dist/main.js.map +1 -1
  291. package/dist/routes.json +1 -1
  292. package/hivStatus/fr.json +1 -0
  293. package/package.json +4 -6
  294. package/src/care-panel/care-panel.component.tsx +1 -1
  295. package/src/care-panel-dashboard/care-panel-dashboard.component.tsx +8 -4
  296. package/src/care-programs/care-program-form-translation-keys.ts +121 -0
  297. package/src/care-programs/care-program.resource.ts +12 -6
  298. package/src/care-programs/care-programs.component.tsx +66 -31
  299. package/src/care-programs/link-patient-to-peer-action.component.tsx +38 -26
  300. package/src/care-programs/program-form-overflow-menu-item.component.tsx +40 -12
  301. package/src/care-programs/program.workspace.tsx +108 -96
  302. package/src/config-schema.ts +90 -14
  303. package/src/iit-risk-score/iit-risk-score-plot.tsx +5 -4
  304. package/src/index.ts +0 -4
  305. package/src/patient-discharge/patient-discharge.workspace.test.tsx +5 -10
  306. package/src/patient-discharge/patient-discharge.workspace.tsx +2 -2
  307. package/src/program-enrollment/program-enrollment.component.tsx +75 -67
  308. package/src/regimen-editor/regimen-button.component.tsx +12 -7
  309. package/src/regimen-editor/regimen-form.component.tsx +111 -107
  310. package/src/routes.json +19 -22
  311. package/translations/am.json +137 -0
  312. package/translations/en.json +137 -0
  313. package/translations/fr.json +138 -0
  314. package/translations/sw.json +272 -135
  315. package/treatmentNumber/fr.json +1 -0
  316. package/tsconfig.json +1 -1
  317. package/dist/1091.js +0 -1
  318. package/dist/1091.js.map +0 -1
  319. package/dist/1172.js +0 -1
  320. package/dist/1172.js.map +0 -1
  321. package/dist/121.js +0 -1
  322. package/dist/121.js.map +0 -1
  323. package/dist/132.js +0 -1
  324. package/dist/132.js.map +0 -1
  325. package/dist/1525.js +0 -1
  326. package/dist/1525.js.map +0 -1
  327. package/dist/1660.js +0 -1
  328. package/dist/1660.js.map +0 -1
  329. package/dist/1729.js +0 -17
  330. package/dist/1729.js.map +0 -1
  331. package/dist/1809.js +0 -7
  332. package/dist/1809.js.map +0 -1
  333. package/dist/1866.js +0 -1
  334. package/dist/1866.js.map +0 -1
  335. package/dist/1881.js +0 -1
  336. package/dist/1881.js.map +0 -1
  337. package/dist/1962.js +0 -1
  338. package/dist/1962.js.map +0 -1
  339. package/dist/1978.js +0 -1
  340. package/dist/1978.js.map +0 -1
  341. package/dist/2045.js +0 -1
  342. package/dist/2045.js.map +0 -1
  343. package/dist/2163.js +0 -1
  344. package/dist/2163.js.map +0 -1
  345. package/dist/2267.js +0 -1
  346. package/dist/2267.js.map +0 -1
  347. package/dist/2398.js +0 -1
  348. package/dist/2398.js.map +0 -1
  349. package/dist/2561.js +0 -1
  350. package/dist/2561.js.map +0 -1
  351. package/dist/2564.js +0 -1
  352. package/dist/2564.js.map +0 -1
  353. package/dist/2810.js +0 -2
  354. package/dist/2810.js.map +0 -1
  355. package/dist/2867.js +0 -1
  356. package/dist/2867.js.map +0 -1
  357. package/dist/3040.js +0 -1
  358. package/dist/3228.js +0 -1
  359. package/dist/3228.js.map +0 -1
  360. package/dist/3472.js +0 -1
  361. package/dist/3472.js.map +0 -1
  362. package/dist/3491.js +0 -1
  363. package/dist/3491.js.map +0 -1
  364. package/dist/3509.js +0 -1
  365. package/dist/3509.js.map +0 -1
  366. package/dist/3576.js +0 -1
  367. package/dist/3576.js.map +0 -1
  368. package/dist/3901.js +0 -1
  369. package/dist/3901.js.map +0 -1
  370. package/dist/399.js +0 -1
  371. package/dist/399.js.map +0 -1
  372. package/dist/4007.js +0 -66
  373. package/dist/4007.js.map +0 -1
  374. package/dist/4146.js +0 -1
  375. package/dist/4146.js.map +0 -1
  376. package/dist/4187.js +0 -1
  377. package/dist/4187.js.map +0 -1
  378. package/dist/4224.js +0 -1
  379. package/dist/4224.js.map +0 -1
  380. package/dist/4280.js +0 -1
  381. package/dist/4280.js.map +0 -1
  382. package/dist/4308.js +0 -1
  383. package/dist/4308.js.map +0 -1
  384. package/dist/4335.js +0 -1
  385. package/dist/4335.js.map +0 -1
  386. package/dist/4402.js +0 -1
  387. package/dist/4402.js.map +0 -1
  388. package/dist/4539.js +0 -1
  389. package/dist/4539.js.map +0 -1
  390. package/dist/4619.js +0 -1
  391. package/dist/4619.js.map +0 -1
  392. package/dist/4717.js +0 -1
  393. package/dist/4717.js.map +0 -1
  394. package/dist/4724.js +0 -1
  395. package/dist/4724.js.map +0 -1
  396. package/dist/4972.js +0 -1
  397. package/dist/4972.js.map +0 -1
  398. package/dist/509.js +0 -1
  399. package/dist/509.js.map +0 -1
  400. package/dist/5096.js +0 -1
  401. package/dist/5096.js.map +0 -1
  402. package/dist/5119.js +0 -1
  403. package/dist/5119.js.map +0 -1
  404. package/dist/5159.js +0 -13
  405. package/dist/5159.js.map +0 -1
  406. package/dist/5341.js +0 -1
  407. package/dist/5341.js.map +0 -1
  408. package/dist/5361.js +0 -1
  409. package/dist/5361.js.map +0 -1
  410. package/dist/5733.js +0 -1
  411. package/dist/5733.js.map +0 -1
  412. package/dist/5882.js +0 -1
  413. package/dist/5939.js +0 -5
  414. package/dist/5939.js.map +0 -1
  415. package/dist/6004.js +0 -1
  416. package/dist/6004.js.map +0 -1
  417. package/dist/6121.js +0 -3
  418. package/dist/6121.js.map +0 -1
  419. package/dist/6137.js +0 -1
  420. package/dist/6137.js.map +0 -1
  421. package/dist/623.js +0 -1
  422. package/dist/623.js.map +0 -1
  423. package/dist/6232.js +0 -1
  424. package/dist/6232.js.map +0 -1
  425. package/dist/6356.js +0 -1
  426. package/dist/6356.js.map +0 -1
  427. package/dist/6479.js +0 -1
  428. package/dist/6479.js.map +0 -1
  429. package/dist/6548.js +0 -1
  430. package/dist/6548.js.map +0 -1
  431. package/dist/6571.js +0 -1
  432. package/dist/6571.js.map +0 -1
  433. package/dist/6626.js +0 -1
  434. package/dist/6626.js.map +0 -1
  435. package/dist/6643.js +0 -1
  436. package/dist/6643.js.map +0 -1
  437. package/dist/6721.js +0 -1
  438. package/dist/6721.js.map +0 -1
  439. package/dist/6868.js +0 -1
  440. package/dist/6868.js.map +0 -1
  441. package/dist/6925.js +0 -1
  442. package/dist/6925.js.map +0 -1
  443. package/dist/7085.js +0 -1
  444. package/dist/7085.js.map +0 -1
  445. package/dist/7091.js +0 -1
  446. package/dist/7091.js.map +0 -1
  447. package/dist/7127.js +0 -1
  448. package/dist/7329.js +0 -1
  449. package/dist/7329.js.map +0 -1
  450. package/dist/7419.js +0 -1
  451. package/dist/7419.js.map +0 -1
  452. package/dist/7428.js +0 -1
  453. package/dist/7428.js.map +0 -1
  454. package/dist/7544.js +0 -1
  455. package/dist/7544.js.map +0 -1
  456. package/dist/7560.js +0 -1
  457. package/dist/7560.js.map +0 -1
  458. package/dist/774.js +0 -1
  459. package/dist/774.js.map +0 -1
  460. package/dist/8179.js +0 -6
  461. package/dist/8179.js.map +0 -1
  462. package/dist/8189.js +0 -1
  463. package/dist/8189.js.map +0 -1
  464. package/dist/8249.js +0 -1
  465. package/dist/8249.js.map +0 -1
  466. package/dist/8470.js +0 -1
  467. package/dist/8470.js.map +0 -1
  468. package/dist/8488.js +0 -1
  469. package/dist/8488.js.map +0 -1
  470. package/dist/8502.js +0 -1
  471. package/dist/8502.js.map +0 -1
  472. package/dist/8522.js +0 -1
  473. package/dist/8522.js.map +0 -1
  474. package/dist/8775.js +0 -11
  475. package/dist/8775.js.map +0 -1
  476. package/dist/887.js +0 -1
  477. package/dist/887.js.map +0 -1
  478. package/dist/916.js +0 -1
  479. package/dist/9466.js +0 -1
  480. package/dist/9466.js.map +0 -1
  481. package/dist/9675.js +0 -1
  482. package/dist/9675.js.map +0 -1
  483. package/dist/982.js +0 -1
  484. package/dist/982.js.map +0 -1
  485. package/dist/9931.js +0 -1
  486. package/dist/9931.js.map +0 -1
  487. package/jest.config.js +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-care-panel-app",
3
- "version": "5.4.4-pre.43",
3
+ "version": "5.4.4-pre.430",
4
4
  "description": "Patient care panels microfrontend for the OpenMRS SPA",
5
5
  "keywords": [
6
6
  "openmrs"
@@ -20,14 +20,12 @@
20
20
  "scripts": {
21
21
  "analyze": "rspack build --mode=production --analyze",
22
22
  "build": "rspack --mode=production",
23
- "coverage": "yarn test --coverage",
23
+ "coverage": "echo \"Jest has been removed; no unit test runner is configured\" && exit 0",
24
24
  "debug": "npm run serve",
25
- "extract-translations": "i18next 'src/**/*.component.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js",
25
+ "extract-translations": "i18next 'src/**/*.{ts,tsx}' --config ../../tools/i18next-parser.config.js",
26
26
  "lint": "eslint src --ext ts,tsx",
27
27
  "serve": "rspack serve --mode=development",
28
28
  "start": "openmrs develop",
29
- "test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests",
30
- "test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js",
31
29
  "typescript": "tsc"
32
30
  },
33
31
  "browserslist": [
@@ -39,7 +37,7 @@
39
37
  },
40
38
  "peerDependencies": {
41
39
  "@carbon/react": "1.x",
42
- "@openmrs/esm-framework": "8.x",
40
+ "@openmrs/esm-framework": "9.x",
43
41
  "react": "^18.1.0",
44
42
  "react-i18next": "11.x",
45
43
  "react-router-dom": "6.x",
@@ -53,7 +53,7 @@ const CarePanel: React.FC<CarePanelProps> = ({ patientUuid, formEntrySub }) => {
53
53
  <div className={styles.contextSwitcherContainer}>
54
54
  <ContentSwitcher size="md" selectedIndex={switchItem?.index} onChange={(params) => setSwitcherItem(params)}>
55
55
  {switcherHeaders?.map((enrollment) => (
56
- <Switch key={enrollment} name={enrollment} text={enrollment} />
56
+ <Switch key={enrollment} name={enrollment} text={t(enrollment)} />
57
57
  ))}
58
58
  </ContentSwitcher>
59
59
  </div>
@@ -7,11 +7,15 @@ import CarePrograms from '../care-programs/care-programs.component';
7
7
 
8
8
  import CarePanelMachineLearning from '../machine-learning/machine-learning.component';
9
9
  import styles from './care-panel-dashboard.scss';
10
- import { DefaultWorkspaceProps, launchWorkspace } from '@openmrs/esm-framework/src';
10
+ import { DefaultWorkspaceProps } from '@openmrs/esm-framework';
11
11
 
12
- type CarePanelDashboardProps = { patientUuid: string; formEntrySub: any } & DefaultWorkspaceProps;
12
+ type CarePanelDashboardProps = {
13
+ patientUuid: string;
14
+ formEntrySub: any;
15
+ patient: fhir.Patient;
16
+ } & DefaultWorkspaceProps;
13
17
 
14
- const CarePanelDashboard: React.FC<CarePanelDashboardProps> = ({ formEntrySub, patientUuid }) => {
18
+ const CarePanelDashboard: React.FC<CarePanelDashboardProps> = ({ formEntrySub, patientUuid, patient }) => {
15
19
  const { t } = useTranslation();
16
20
  return (
17
21
  <Layer className={styles.container}>
@@ -32,7 +36,7 @@ const CarePanelDashboard: React.FC<CarePanelDashboardProps> = ({ formEntrySub, p
32
36
  <CarePanel patientUuid={patientUuid} formEntrySub={formEntrySub} />
33
37
  </TabPanel>
34
38
  <TabPanel>
35
- <CarePrograms patientUuid={patientUuid} />
39
+ <CarePrograms patientUuid={patientUuid} patient={patient} />
36
40
  </TabPanel>
37
41
  <TabPanel>
38
42
  <CarePanelMachineLearning patientUuid={patientUuid} />
@@ -0,0 +1,121 @@
1
+ /**
2
+ * This file exists solely to register care program form translation keys for i18next-parser extraction.
3
+ * The keys are used dynamically via `formTranslationKey` in the careProgramForms config — the parser
4
+ * cannot detect dynamic keys, so they are listed here as static t() calls.
5
+ *
6
+ * Do not remove or call this function at runtime.
7
+ */
8
+ export function registerCareProgramFormTranslationKeys(t: (key: string, defaultValue: string) => string) {
9
+ // VMMC
10
+ t('vmmcEnrollment', 'VMMC Enrollment');
11
+ t('vmmcInitial', 'VMMC Initial');
12
+ t('vmmcClientFollowUp', 'VMMC Client Follow-Up');
13
+ t('vmmcCircumcisionProcedure', 'VMMC Circumcision Procedure');
14
+ t('vmmcImmediatePostOperationAssessment', 'VMMC Immediate Post-Operation Assessment');
15
+ t('vmmcMedicalExamination', 'VMMC Medical Examination');
16
+ t('vmmcDiscontinuation', 'VMMC Discontinuation');
17
+
18
+ // CPM
19
+ t('cpmEnrollment', 'CPM Enrollment');
20
+ t('cpmInitial', 'CPM Initial');
21
+ t('cpmReferral', 'CPM Referral');
22
+ t('cpmScreening', 'CPM Screening');
23
+ t('cpmDiscontinuation', 'CPM Discontinuation');
24
+
25
+ // PNC
26
+ t('pncEnrollment', 'PNC Enrollment');
27
+ t('mchPncVisit', 'MCH PNC Visit');
28
+ t('pncDiscontinuation', 'PNC Discontinuation');
29
+
30
+ // ANC
31
+ t('ancEnrollment', 'ANC Enrollment');
32
+ t('mchAntenatalVisit', 'MCH Antenatal Visit');
33
+ t('ancFollowUpForm', 'ANC Follow Up form');
34
+ t('ancDiscontinuation', 'ANC Discontinuation');
35
+
36
+ // MCH - Child Services (CWC)
37
+ t('cwcEnrolment', 'CWC Enrolment');
38
+ t('cwcInitial', 'Initial CWC');
39
+ t('cwcFollowup', 'CWC Followup');
40
+ t('cwcDiscontinuation', 'CWC Discontinuation');
41
+
42
+ // Nutrition
43
+ t('nutritionEnrollment', 'Nutrition Enrollment');
44
+ t('nutritionForm', 'Nutrition form');
45
+ t('nutritionDiscontinuation', 'Nutrition Discontinuation');
46
+
47
+ // Family Planning
48
+ t('familyPlanningEnrollment', 'Family Planning Enrollment');
49
+ t('familyPlanningForm', 'Family Planning Form');
50
+ t('familyPlanningDiscontinuation', 'Family Planning Discontinuation');
51
+
52
+ // TB
53
+ t('tbEnrollment', 'TB Enrollment');
54
+ t('tbInitial', 'TB Initial');
55
+ t('tbFollowUp', 'TB FollowUp');
56
+ t('tbDiscontinuation', 'TB Discontinuation');
57
+
58
+ // Violence screening
59
+ t('violenceEnrollment', 'Violence enrollment');
60
+ t('violenceScreening', 'Violence Screening');
61
+ t('violenceInitialForm', 'Violence Initial Form');
62
+ t('violenceConsentForm', 'Violence Consent Form');
63
+ t('sexualViolencePostRapeCare363A', 'Sexual Violence post rape care 363A');
64
+ t('sexualViolencePrcPsychologicalAssessment363B', 'Sexual Violence PRC Psychological Assessment 363B');
65
+ t('physicalAndEmotionalViolenceForm', 'Physical and Emotional Violence Form');
66
+ t('violenceTraumaCounselling', 'Violence Trauma Counselling');
67
+ t('violenceReportingForm', 'Violence Reporting Form');
68
+ t('violenceCommunityLinkageForm', 'Violence Community Linkage Form');
69
+ t('violenceLegalForm', 'Violence Legal Form');
70
+ t('violencePerpetratorDetails', 'Violence Perpetrator Details');
71
+ t('pepFollowupForm', 'PEP FOLLOWUP Form');
72
+ t('violenceDiscontinuationForm', 'Violence Discontinuation Form');
73
+
74
+ // TPT
75
+ t('tptInitiation', 'TPT Initiation');
76
+ t('tptInitial', 'TPT Initial');
77
+ t('tptFollowUp', 'TPT FollowUp');
78
+ t('tptOutcomeDiscontinuation', 'TPT Outcome/Discontinuation');
79
+
80
+ // PrEP
81
+ t('prepEnrollment', 'PrEP Enrollment');
82
+ t('prepInitiation', 'PrEP Initiation');
83
+ t('prepClinicalForm', 'PrEP Clinical Form');
84
+ t('prepDiscontinuation', 'PrEP Discontinuation');
85
+
86
+ // NCD
87
+ t('ncdEnrollment', 'NCD Enrollment');
88
+ t('ncdInitial', 'NCD Initial');
89
+ t('ncdFollowUp', 'NCD Follow Up');
90
+ t('ncdDiscontinuation', 'NCD Discontinuation');
91
+
92
+ // KVP
93
+ t('kvpEnrollmentForm', 'KVP Enrollment Form');
94
+ t('kvpContactForm', 'KVP Contact Form');
95
+ t('kvpClinicalEnrollment', 'KVP Clinical Enrollment');
96
+ t('kvpPeerEducatorOutreachCalendar', 'KVP Peer Educator Outreach Calendar');
97
+ t('kvpClinicalEncounterForm', 'KVP Clinical Encounter form');
98
+ t('kvpClientDiscontinuation', 'KVP Client Discontinuation');
99
+
100
+ // HIV Program
101
+ t('hivEnrollment', 'HIV Enrollment');
102
+ t('hivInitialForm', 'HIV Initial form');
103
+ t('artReadiness', 'ART Readyness');
104
+ t('hivGreenCard', 'HIV Green Card');
105
+ t('hivDiscontinuation', 'HIV Discontinuation');
106
+
107
+ // Pre-Conception care program
108
+ t('preConceptionCareEnrollmentForm', 'Pre-Conception Care Enrollment Form');
109
+ t('preConceptionCare', 'Pre-Conception Care');
110
+ t('preConceptionDiscontinuation', 'Pre-Conception Discontinuation');
111
+
112
+ // MAT
113
+ t('matClinicalEligibilityAssessmentAndReferralForm', 'MAT Clinical Eligibility Assessment & Referral Form');
114
+ t('matInitialRegistrationForm', 'MAT Initial Registration Form');
115
+ t('matPsychoSocialIntakeAndFollowUpForm', 'MAT Psycho-social Intake & Follow-up Form');
116
+ t('matClinicalEncounterForm', 'MAT Clinical Encounter Form');
117
+ t('matPsychiatricIntakeAndFollowUpForm', 'MAT Psychiatric Intake and Follow up Form');
118
+ t('matTransitReferralForm', 'MAT Transit/Referral Form');
119
+ t('matCessationForm', 'MAT Cessation Form');
120
+ t('matDiscontinuationForm', 'MAT Discontinuation Form');
121
+ }
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  FetchResponse,
3
3
  launchWorkspace,
4
+ launchWorkspace2,
4
5
  openmrsFetch,
5
6
  parseDate,
6
7
  restBaseUrl,
@@ -266,10 +267,15 @@ export const launchProgramForm = (
266
267
  enrollment: Enrollment | undefined,
267
268
  onSuccess?: () => void,
268
269
  ) => {
269
- launchWorkspace('mch-program-form-workspace', {
270
- enrollment,
271
- patientUuid,
272
- programUuid,
273
- onSubmitSuccess: onSuccess,
274
- });
270
+ launchWorkspace2(
271
+ 'mch-program-form-workspace',
272
+ {
273
+ enrollment,
274
+ patientUuid,
275
+ programUuid,
276
+ onSubmitSuccess: onSuccess,
277
+ },
278
+ {},
279
+ {},
280
+ );
275
281
  };
@@ -16,8 +16,14 @@ import {
16
16
  Tile,
17
17
  } from '@carbon/react';
18
18
  import { Close, DocumentAdd } from '@carbon/react/icons';
19
- import { formatDate, launchWorkspace, restBaseUrl, useLayoutType, useVisit } from '@openmrs/esm-framework';
20
- import { CardHeader, EmptyState, ErrorState, launchStartVisitPrompt } from '@openmrs/esm-patient-common-lib';
19
+ import { formatDate, restBaseUrl, useLayoutType, useVisit } from '@openmrs/esm-framework';
20
+ import {
21
+ CardHeader,
22
+ EmptyState,
23
+ ErrorState,
24
+ useLaunchWorkspaceRequiringVisit,
25
+ usePatientChartStore,
26
+ } from '@openmrs/esm-patient-common-lib';
21
27
  import capitalize from 'lodash/capitalize';
22
28
  import React, { useCallback, useMemo } from 'react';
23
29
  import { useTranslation } from 'react-i18next';
@@ -31,12 +37,12 @@ import useCareProgramForms from './useCareProgramForms';
31
37
 
32
38
  type CareProgramsProps = {
33
39
  patientUuid: string;
40
+ patient: fhir.Patient;
34
41
  };
35
42
 
36
- const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
43
+ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid, patient }) => {
37
44
  const { t } = useTranslation();
38
45
  const { getProgramForms, getProgramEnrollmentForm } = useCareProgramForms();
39
- const { currentVisit, mutate: mutateVisit } = useVisit(patientUuid);
40
46
  const { eligibleCarePrograms, isLoading, isValidating, error, mutateEligiblePrograms } = useCarePrograms(patientUuid);
41
47
  const {
42
48
  enrollments,
@@ -44,9 +50,7 @@ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
44
50
  error: enrollmentsError,
45
51
  mutate: mutateEnrollments,
46
52
  } = usePatientEnrolledPrograms(patientUuid);
47
-
48
- const isTablet = useLayoutType() === 'tablet';
49
-
53
+ const { mutateVisitContext, visitContext } = usePatientChartStore(patientUuid);
50
54
  const handleMutations = useCallback(() => {
51
55
  mutateEligiblePrograms();
52
56
  mutate(
@@ -60,9 +64,24 @@ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
60
64
  undefined,
61
65
  { revalidate: true },
62
66
  );
63
- mutateVisit();
64
67
  mutateEnrollments();
65
- }, [mutateEligiblePrograms, mutateEnrollments, mutateVisit, patientUuid]);
68
+ }, [mutateEligiblePrograms, mutateEnrollments, patientUuid]);
69
+ const groupProps = useMemo(
70
+ () => ({
71
+ patient,
72
+ patientUuid,
73
+ visitContext,
74
+ mutateVisitContext: () => {
75
+ mutateVisitContext();
76
+ handleMutations();
77
+ },
78
+ }),
79
+ [patient, patientUuid, visitContext, mutateVisitContext, handleMutations],
80
+ );
81
+
82
+ const isTablet = useLayoutType() === 'tablet';
83
+
84
+ const launchFormEntryWorkspace = useLaunchWorkspaceRequiringVisit(patientUuid, 'patient-form-entry-workspace');
66
85
 
67
86
  const rows = useMemo(
68
87
  () => [
@@ -71,7 +90,7 @@ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
71
90
 
72
91
  return {
73
92
  id: enrollment.program.uuid,
74
- programName: enrollment.program.name,
93
+ programName: t(enrollment.program.name),
75
94
  status: (
76
95
  <div className={styles.careProgramButtonContainer}>
77
96
  <Tag type="green">{t('enrolled', 'Enrolled')}</Tag>
@@ -81,7 +100,6 @@ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
81
100
  <ProgramFormOverflowMenuItem
82
101
  key={`${enrollment.uuid}-${form.formUuId}`}
83
102
  form={form}
84
- visit={currentVisit}
85
103
  patientUuid={patientUuid}
86
104
  mutate={handleMutations}
87
105
  enrollment={enrollment}
@@ -105,15 +123,35 @@ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
105
123
  }),
106
124
  ...eligibleCarePrograms.map((careProgram) => {
107
125
  const enrollmentForm = getProgramEnrollmentForm(careProgram.uuid);
108
-
109
126
  return {
110
127
  id: `${careProgram.uuid}`,
111
- programName: careProgram.display,
128
+ // t('HIV', 'HIV')
129
+ // t('Child Welfare Clinic', 'Child Welfare Clinic')
130
+ // t('SMNI - Services maternels', 'SMNI - Services maternels')
131
+ // t('TB', 'TB')
132
+ // t('TPT', 'TPT')
133
+ // t('PrEP', 'PrEP')
134
+ // t('OVC', 'OVC')
135
+ // t('OTZ', 'OTZ')
136
+ // t('KVP', 'KVP')
137
+ // t('NimeCONFIRM', 'NimeCONFIRM')
138
+ // t('VMMC', 'VMMC')
139
+ // t('MAT', 'MAT')
140
+ // t('NCD', 'NCD')
141
+ // t('Violence screening', 'Violence screening')
142
+ // t('CPM', 'CPM')
143
+ // t('Nutrition', 'Nutrition')
144
+ // t('Antenatal Care', 'Antenatal Care')
145
+ // t('Postnatal Care', 'Postnatal Care')
146
+ // t('Family Planning', 'Family Planning')
147
+ // t('Pre-Conception Care', 'Pre-Conception Care')
148
+ programName: t(careProgram.display),
112
149
  status: (
113
150
  <div className={styles.careProgramButtonContainer}>
114
151
  <span>
115
152
  {capitalize(
116
- `${careProgram.enrollmentStatus} ${
153
+ // t('eligible', 'Eligible')
154
+ `${t(careProgram.enrollmentStatus)} ${
117
155
  careProgram.enrollmentDetails?.dateEnrolled && careProgram.enrollmentStatus === 'active'
118
156
  ? `Since (${formatDate(new Date(careProgram.enrollmentDetails.dateEnrolled))})`
119
157
  : ''
@@ -132,22 +170,18 @@ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
132
170
  mutateEligiblePrograms();
133
171
  });
134
172
  }
135
- if (currentVisit) {
136
- if (enrollmentForm) {
137
- return launchWorkspace('patient-form-entry-workspace', {
138
- workspaceTitle: enrollmentForm.formName,
139
- mutateForm: handleMutations,
140
- formInfo: {
141
- encounterUuid: '',
142
- formUuid: enrollmentForm.formUuId,
143
- },
144
- });
145
- }
146
- }
147
- launchStartVisitPrompt();
173
+ launchFormEntryWorkspace(
174
+ {
175
+ workspaceTitle: enrollmentForm.formName,
176
+ form: { uuid: enrollmentForm.formUuId },
177
+ encounterUuid: '',
178
+ },
179
+ {},
180
+ groupProps,
181
+ );
148
182
  }}
149
183
  renderIcon={careProgram.enrollmentStatus == 'active' ? Close : DocumentAdd}>
150
- {careProgram.enrollmentStatus == 'active' ? 'Discontinue' : 'Enroll'}
184
+ {careProgram.enrollmentStatus == 'active' ? t('discontinue', 'Discontinue') : t('enroll', 'Enroll')}
151
185
  </Button>
152
186
  </div>
153
187
  ),
@@ -159,11 +193,12 @@ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
159
193
  eligibleCarePrograms,
160
194
  getProgramForms,
161
195
  t,
162
- currentVisit,
163
196
  patientUuid,
164
197
  handleMutations,
165
198
  mutateEnrollments,
166
199
  getProgramEnrollmentForm,
200
+ launchFormEntryWorkspace,
201
+ groupProps,
167
202
  mutateEligiblePrograms,
168
203
  ],
169
204
  );
@@ -171,11 +206,11 @@ const CarePrograms: React.FC<CareProgramsProps> = ({ patientUuid }) => {
171
206
  const headers = [
172
207
  {
173
208
  key: 'programName',
174
- header: 'Program name',
209
+ header: t('programName', 'Program Name'),
175
210
  },
176
211
  {
177
212
  key: 'status',
178
- header: 'Status',
213
+ header: t('status', 'Status'),
179
214
  },
180
215
  ];
181
216
 
@@ -1,27 +1,37 @@
1
- import React, { FC } from 'react';
1
+ import React, { FC, useMemo } from 'react';
2
2
  import { usePatientActivePeerEducator } from './kvp-program-actions.resource';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { InlineLoading, OverflowMenuItem } from '@carbon/react';
5
- import { launchWorkspace, useConfig, Visit } from '@openmrs/esm-framework';
5
+ import { launchWorkspace, launchWorkspace2, useConfig, Visit } from '@openmrs/esm-framework';
6
6
  import { CarePanelConfig } from '../config-schema';
7
- import { launchStartVisitPrompt } from '@openmrs/esm-patient-common-lib';
7
+ import {
8
+ launchStartVisitPrompt,
9
+ useLaunchWorkspaceRequiringVisit,
10
+ usePatientChartStore,
11
+ } from '@openmrs/esm-patient-common-lib';
8
12
 
9
13
  type KvpLinkPatientToPeerEducatorProps = {
10
14
  patientUuid: string;
11
15
  form: CarePanelConfig['careProgramForms'][0]['forms'][0];
12
- visit?: Visit;
13
16
  mutate?: () => void;
14
17
  };
15
- const KvpLinkPatientToPeerEducator: FC<KvpLinkPatientToPeerEducatorProps> = ({
16
- patientUuid,
17
- form,
18
- visit: currentVisit,
19
- mutate,
20
- }) => {
18
+ const KvpLinkPatientToPeerEducator: FC<KvpLinkPatientToPeerEducatorProps> = ({ patientUuid, form, mutate }) => {
19
+ const { mutateVisitContext, visitContext, patient: fhirPatient } = usePatientChartStore(patientUuid);
21
20
  const { activePeer, error, isLoading } = usePatientActivePeerEducator(patientUuid);
22
21
  const { hideFilledProgramForm } = useConfig<CarePanelConfig>();
23
22
  const { t } = useTranslation();
24
- const formEncounter = currentVisit?.encounters?.find((en) => en.form?.uuid === form.formUuId);
23
+ const formEncounter = visitContext?.encounters?.find((en) => en.form?.uuid === form.formUuId);
24
+ const launchFormEntryWorkspace = useLaunchWorkspaceRequiringVisit(patientUuid, 'patient-form-entry-workspace');
25
+
26
+ const groupProps = useMemo(
27
+ () => ({
28
+ patientUuid,
29
+ patient: fhirPatient,
30
+ visitContext,
31
+ mutateVisitContext,
32
+ }),
33
+ [patientUuid, fhirPatient, visitContext, mutateVisitContext],
34
+ );
25
35
 
26
36
  if (isLoading) {
27
37
  return <InlineLoading />;
@@ -32,10 +42,15 @@ const KvpLinkPatientToPeerEducator: FC<KvpLinkPatientToPeerEducatorProps> = ({
32
42
  <OverflowMenuItem
33
43
  itemText={t('linkToPeerEducator', 'Link to peer Educator')}
34
44
  onClick={() => {
35
- launchWorkspace('kvp-peer-linkage-form-workspace', {
36
- workspaceTitle: t('linkPatientToPeerEducator', 'Link Patient to Peer Educator'),
37
- patientUuid,
38
- });
45
+ launchWorkspace2(
46
+ 'kvp-peer-linkage-form-workspace',
47
+ {
48
+ workspaceTitle: t('linkPatientToPeerEducator', 'Link Patient to Peer Educator'),
49
+ patientUuid,
50
+ },
51
+ {},
52
+ {},
53
+ );
39
54
  }}
40
55
  />
41
56
  );
@@ -50,18 +65,15 @@ const KvpLinkPatientToPeerEducator: FC<KvpLinkPatientToPeerEducatorProps> = ({
50
65
  key={form.formUuId}
51
66
  itemText={form.formName}
52
67
  onClick={() => {
53
- if (currentVisit) {
54
- return launchWorkspace('patient-form-entry-workspace', {
68
+ launchFormEntryWorkspace(
69
+ {
55
70
  workspaceTitle: form.formName,
56
- mutateForm: mutate,
57
- formInfo: {
58
- encounterUuid: formEncounter?.uuid ?? '',
59
- formUuid: form.formUuId,
60
- // additionalProps: { enrollmenrDetails: careProgram.enrollmentDetails ?? {} },
61
- },
62
- });
63
- }
64
- launchStartVisitPrompt();
71
+ form: { uuid: form.formUuId },
72
+ encounterUuid: formEncounter?.uuid ?? '',
73
+ },
74
+ {},
75
+ groupProps,
76
+ );
65
77
  }}
66
78
  />
67
79
  );
@@ -1,6 +1,6 @@
1
1
  import { InlineLoading, OverflowMenuItem } from '@carbon/react';
2
- import { launchWorkspace, showSnackbar, useConfig, Visit } from '@openmrs/esm-framework';
3
- import { launchStartVisitPrompt } from '@openmrs/esm-patient-common-lib';
2
+ import { showSnackbar, useConfig } from '@openmrs/esm-framework';
3
+ import { useLaunchWorkspaceRequiringVisit, usePatientChartStore } from '@openmrs/esm-patient-common-lib';
4
4
  import React, { FC, useEffect, useMemo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { CarePanelConfig } from '../config-schema';
@@ -11,7 +11,6 @@ type ProgramFormOverflowMenuItemProps = {
11
11
  patientUuid: string;
12
12
  form: CarePanelConfig['careProgramForms'][0]['forms'][0];
13
13
  mutate?: () => void;
14
- visit?: Visit;
15
14
  enrollment: Enrollment;
16
15
  };
17
16
 
@@ -19,9 +18,10 @@ const ProgramFormOverflowMenuItem: FC<ProgramFormOverflowMenuItemProps> = ({
19
18
  form,
20
19
  patientUuid,
21
20
  mutate,
22
- visit: currentVisit,
23
21
  enrollment,
24
22
  }) => {
23
+ const { mutateVisitContext, visitContext, patient: fhirPatient } = usePatientChartStore(patientUuid);
24
+ const launchFormEntryWorkspace = useLaunchWorkspaceRequiringVisit(patientUuid, 'patient-form-entry-workspace');
25
25
  const {
26
26
  formEncounters,
27
27
  error,
@@ -29,7 +29,7 @@ const ProgramFormOverflowMenuItem: FC<ProgramFormOverflowMenuItemProps> = ({
29
29
  mutate: mutateFormEncounters,
30
30
  } = usePatientFormEncounter(patientUuid, form.formUuId, {
31
31
  scope: form.tags.includes('bound-to-current-visit') ? 'current-visit' : 'all-visits',
32
- currentVisit: currentVisit,
32
+ currentVisit: visitContext,
33
33
  });
34
34
  const { hideFilledProgramForm, peerCalendarOutreactForm } = useConfig<CarePanelConfig>();
35
35
  const { t } = useTranslation();
@@ -39,6 +39,20 @@ const ProgramFormOverflowMenuItem: FC<ProgramFormOverflowMenuItemProps> = ({
39
39
  isLoading: isLoadingDependancyStatus,
40
40
  mutate: mutateDependancyStatus,
41
41
  } = useFormsFilled(patientUuid, form.dependancies);
42
+ const groupProps = useMemo(
43
+ () => ({
44
+ patientUuid,
45
+ patient: fhirPatient,
46
+ visitContext,
47
+ mutateVisitContext: () => {
48
+ mutateVisitContext();
49
+ mutate?.();
50
+ mutateDependancyStatus();
51
+ mutateFormEncounters();
52
+ },
53
+ }),
54
+ [patientUuid, fhirPatient, visitContext, mutateVisitContext, mutate, mutateDependancyStatus, mutateFormEncounters],
55
+ );
42
56
 
43
57
  const latestFormEncounter = useMemo(() => formEncounters.at(0)?.encounter, [formEncounters]);
44
58
  // Show form if
@@ -78,7 +92,6 @@ const ProgramFormOverflowMenuItem: FC<ProgramFormOverflowMenuItemProps> = ({
78
92
  <KvpLinkPatientToPeerEducator
79
93
  form={form}
80
94
  patientUuid={patientUuid}
81
- visit={currentVisit}
82
95
  mutate={() => {
83
96
  mutate?.();
84
97
  mutateDependancyStatus();
@@ -88,14 +101,16 @@ const ProgramFormOverflowMenuItem: FC<ProgramFormOverflowMenuItemProps> = ({
88
101
  );
89
102
  }
90
103
 
104
+ const formLabel = t(form.formTranslationKey ?? form.formName, { defaultValue: form.formName });
105
+
91
106
  return (
92
107
  <OverflowMenuItem
93
108
  key={form.formUuId}
94
- itemText={form.formName}
109
+ itemText={formLabel}
95
110
  onClick={() => {
96
- if (currentVisit) {
97
- return launchWorkspace('patient-form-entry-workspace', {
98
- workspaceTitle: form.formName,
111
+ /**
112
+ launchWorkspace('patient-form-entry-workspace', {
113
+ workspaceTitle: formLabel,
99
114
  mutateForm: () => {
100
115
  mutate?.();
101
116
  mutateDependancyStatus();
@@ -109,8 +124,21 @@ const ProgramFormOverflowMenuItem: FC<ProgramFormOverflowMenuItemProps> = ({
109
124
  },
110
125
  },
111
126
  });
112
- }
113
- launchStartVisitPrompt();
127
+ */
128
+ return launchFormEntryWorkspace(
129
+ {
130
+ workspaceTitle: formLabel,
131
+ form: {
132
+ uuid: form.formUuId,
133
+ },
134
+ additionalProps: {
135
+ enrollmentDetails: { dateEnrolled: new Date(enrollment.dateEnrolled), uuid: enrollment.uuid },
136
+ },
137
+ encounterUuid: form.tags.includes('discontinuation') ? '' : latestFormEncounter?.uuid ?? '',
138
+ },
139
+ {},
140
+ groupProps,
141
+ );
114
142
  }}
115
143
  />
116
144
  );