@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.
- package/.turbo/turbo-build.log +7 -7
- package/currentProphylaxisUsed/fr.json +1 -0
- package/dist/1072.js +1 -1
- package/dist/1072.js.map +1 -1
- package/dist/1278.js +1 -0
- package/dist/1278.js.map +1 -0
- package/dist/1354.js +1 -0
- package/dist/1354.js.map +1 -0
- package/dist/1375.js +66 -0
- package/dist/1375.js.map +1 -0
- package/dist/1442.js +1 -0
- package/dist/1442.js.map +1 -0
- package/dist/15.js +1 -0
- package/dist/15.js.map +1 -0
- package/dist/1620.js +1 -0
- package/dist/1620.js.map +1 -0
- package/dist/1761.js +1 -1
- package/dist/1761.js.map +1 -1
- package/dist/1789.js +1 -0
- package/dist/1789.js.map +1 -0
- package/dist/1831.js +1 -0
- package/dist/1831.js.map +1 -0
- package/dist/1844.js +1 -0
- package/dist/1844.js.map +1 -0
- package/dist/1854.js +1 -0
- package/dist/1854.js.map +1 -0
- package/dist/1919.js +1 -0
- package/dist/1919.js.map +1 -0
- package/dist/1946.js +1 -0
- package/dist/1946.js.map +1 -0
- package/dist/2007.js +1 -1
- package/dist/2007.js.map +1 -1
- package/dist/2127.js +1 -0
- package/dist/2127.js.map +1 -0
- package/dist/2146.js +1 -0
- package/dist/2146.js.map +1 -0
- package/dist/2152.js +1 -0
- package/dist/2152.js.map +1 -0
- package/dist/2202.js +1 -0
- package/dist/2202.js.map +1 -0
- package/dist/2300.js +1 -0
- package/dist/2300.js.map +1 -0
- package/dist/2394.js +1 -0
- package/dist/2394.js.map +1 -0
- package/dist/2468.js +1 -0
- package/dist/2468.js.map +1 -0
- package/dist/2534.js +1 -1
- package/dist/2534.js.map +1 -1
- package/dist/2556.js +1 -0
- package/dist/2556.js.map +1 -0
- package/dist/26.js +1 -0
- package/dist/26.js.map +1 -0
- package/dist/2648.js +1 -0
- package/dist/2648.js.map +1 -0
- package/dist/2823.js +1 -0
- package/dist/2823.js.map +1 -0
- package/dist/2840.js +1 -0
- package/dist/2840.js.map +1 -0
- package/dist/2842.js +1 -0
- package/dist/2842.js.map +1 -0
- package/dist/2916.js +1 -0
- package/dist/2916.js.map +1 -0
- package/dist/2924.js +1 -0
- package/dist/2924.js.map +1 -0
- package/dist/3285.js +1 -0
- package/dist/3285.js.map +1 -0
- package/dist/3302.js +1 -0
- package/dist/3302.js.map +1 -0
- package/dist/3321.js +1 -0
- package/dist/3321.js.map +1 -0
- package/dist/3335.js +1 -0
- package/dist/3335.js.map +1 -0
- package/dist/3378.js +1 -0
- package/dist/3378.js.map +1 -0
- package/dist/3504.js +1 -0
- package/dist/3504.js.map +1 -0
- package/dist/356.js +1 -0
- package/dist/356.js.map +1 -0
- package/dist/3569.js +1 -0
- package/dist/3569.js.map +1 -0
- package/dist/3580.js +1 -0
- package/dist/3580.js.map +1 -0
- package/dist/3690.js +1 -0
- package/dist/3690.js.map +1 -0
- package/dist/3723.js +1 -0
- package/dist/3723.js.map +1 -0
- package/dist/3745.js +1 -0
- package/dist/3745.js.map +1 -0
- package/dist/3796.js +1 -0
- package/dist/3796.js.map +1 -0
- package/dist/3805.js +1 -0
- package/dist/3805.js.map +1 -0
- package/dist/3813.js +1 -0
- package/dist/3813.js.map +1 -0
- package/dist/3847.js +1 -0
- package/dist/3847.js.map +1 -0
- package/dist/393.js +6 -0
- package/dist/393.js.map +1 -0
- package/dist/3953.js +1 -0
- package/dist/3953.js.map +1 -0
- package/dist/3989.js +1 -0
- package/dist/3989.js.map +1 -0
- package/dist/4178.js +1 -1
- package/dist/4178.js.map +1 -1
- package/dist/4212.js +1 -0
- package/dist/4212.js.map +1 -0
- package/dist/4337.js +1 -0
- package/dist/4337.js.map +1 -0
- package/dist/4405.js +1 -0
- package/dist/4405.js.map +1 -0
- package/dist/4487.js +11 -0
- package/dist/4487.js.map +1 -0
- package/dist/4567.js +1 -0
- package/dist/4567.js.map +1 -0
- package/dist/4588.js +1 -0
- package/dist/4588.js.map +1 -0
- package/dist/4637.js +1 -1
- package/dist/4637.js.map +1 -1
- package/dist/466.js +1 -1
- package/dist/466.js.map +1 -1
- package/dist/4711.js +1 -0
- package/dist/4711.js.map +1 -0
- package/dist/4759.js +1 -0
- package/dist/4759.js.map +1 -0
- package/dist/4817.js +1 -0
- package/dist/4817.js.map +1 -0
- package/dist/4818.js +1 -0
- package/dist/4818.js.map +1 -0
- package/dist/500.js +1 -0
- package/dist/500.js.map +1 -0
- package/dist/5086.js +1 -1
- package/dist/5086.js.map +1 -1
- package/dist/510.js +1 -0
- package/dist/510.js.map +1 -0
- package/dist/5117.js +1 -0
- package/dist/5117.js.map +1 -0
- package/dist/5209.js +1 -1
- package/dist/5209.js.map +1 -1
- package/dist/5279.js +1 -0
- package/dist/5279.js.map +1 -0
- package/dist/5362.js +1 -0
- package/dist/5362.js.map +1 -0
- package/dist/5366.js +1 -0
- package/dist/5366.js.map +1 -0
- package/dist/5567.js +1 -0
- package/dist/5567.js.map +1 -0
- package/dist/5598.js +1 -0
- package/dist/5598.js.map +1 -0
- package/dist/5676.js +1 -1
- package/dist/5676.js.map +1 -1
- package/dist/5731.js +5 -0
- package/dist/5731.js.map +1 -0
- package/dist/5809.js +1 -1
- package/dist/5809.js.map +1 -1
- package/dist/5825.js +1 -0
- package/dist/5825.js.map +1 -0
- package/dist/5932.js +1 -0
- package/dist/5932.js.map +1 -0
- package/dist/5941.js +1 -0
- package/dist/5941.js.map +1 -0
- package/dist/6104.js +1 -1
- package/dist/6104.js.map +1 -1
- package/dist/6273.js +1 -0
- package/dist/6273.js.map +1 -0
- package/dist/6337.js +1 -0
- package/dist/6337.js.map +1 -0
- package/dist/6357.js +1 -0
- package/dist/6357.js.map +1 -0
- package/dist/6427.js +1 -1
- package/dist/6427.js.map +1 -1
- package/dist/6478.js +7 -0
- package/dist/6478.js.map +1 -0
- package/dist/65.js +1 -0
- package/dist/65.js.map +1 -0
- package/dist/6508.js +1 -0
- package/dist/6508.js.map +1 -0
- package/dist/6567.js +1 -0
- package/dist/6567.js.map +1 -0
- package/dist/6634.js +1 -0
- package/dist/6634.js.map +1 -0
- package/dist/6698.js +1 -0
- package/dist/6698.js.map +1 -0
- package/dist/682.js +1 -0
- package/dist/682.js.map +1 -0
- package/dist/689.js +1 -1
- package/dist/689.js.map +1 -1
- package/dist/7126.js +1 -0
- package/dist/7126.js.map +1 -0
- package/dist/7205.js +1 -0
- package/dist/7205.js.map +1 -0
- package/dist/7209.js +1 -0
- package/dist/7209.js.map +1 -0
- package/dist/740.js +1 -0
- package/dist/740.js.map +1 -0
- package/dist/7478.js +1 -1
- package/dist/7478.js.map +1 -1
- package/dist/7479.js +1 -0
- package/dist/7479.js.map +1 -0
- package/dist/7602.js +1 -0
- package/dist/7602.js.map +1 -0
- package/dist/7686.js +1 -0
- package/dist/7686.js.map +1 -0
- package/dist/7782.js +1 -0
- package/dist/7782.js.map +1 -0
- package/dist/7796.js +1 -0
- package/dist/7796.js.map +1 -0
- package/dist/7808.js +1 -0
- package/dist/7808.js.map +1 -0
- package/dist/781.js +1 -1
- package/dist/781.js.map +1 -1
- package/dist/8018.js +1 -0
- package/dist/8018.js.map +1 -0
- package/dist/8183.js +1 -0
- package/dist/8183.js.map +1 -0
- package/dist/8196.js +1 -1
- package/dist/8196.js.map +1 -1
- package/dist/820.js +1 -0
- package/dist/820.js.map +1 -0
- package/dist/8240.js +1 -1
- package/dist/8240.js.map +1 -1
- package/dist/8472.js +1 -0
- package/dist/8472.js.map +1 -0
- package/dist/8521.js +1 -0
- package/dist/8521.js.map +1 -0
- package/dist/8602.js +1 -0
- package/dist/8602.js.map +1 -0
- package/dist/8607.js +1 -0
- package/dist/8607.js.map +1 -0
- package/dist/867.js +1 -0
- package/dist/867.js.map +1 -0
- package/dist/8743.js +1 -0
- package/dist/8743.js.map +1 -0
- package/dist/8762.js +1 -0
- package/dist/8762.js.map +1 -0
- package/dist/8812.js +1 -0
- package/dist/8812.js.map +1 -0
- package/dist/8860.js +1 -0
- package/dist/8860.js.map +1 -0
- package/dist/8985.js +1 -0
- package/dist/8985.js.map +1 -0
- package/dist/8990.js +1 -0
- package/dist/8990.js.map +1 -0
- package/dist/9011.js +1 -1
- package/dist/9011.js.map +1 -1
- package/dist/9061.js +1 -0
- package/dist/9061.js.map +1 -0
- package/dist/9087.js +1 -0
- package/dist/9087.js.map +1 -0
- package/dist/9134.js +1 -0
- package/dist/9134.js.map +1 -0
- package/dist/9148.js +1 -0
- package/dist/9148.js.map +1 -0
- package/dist/9168.js +1 -0
- package/dist/9168.js.map +1 -0
- package/dist/9197.js +1 -0
- package/dist/9197.js.map +1 -0
- package/dist/9267.js +1 -0
- package/dist/9267.js.map +1 -0
- package/dist/935.js +1 -0
- package/dist/935.js.map +1 -0
- package/dist/9425.js +1 -1
- package/dist/9520.js +1 -1
- package/dist/9520.js.map +1 -1
- package/dist/9547.js +1 -0
- package/dist/9547.js.map +1 -0
- package/dist/9549.js +1 -0
- package/dist/9549.js.map +1 -0
- package/dist/9612.js +1 -0
- package/dist/9612.js.map +1 -0
- package/dist/9621.js +1 -0
- package/dist/9621.js.map +1 -0
- package/dist/9771.js +1 -0
- package/dist/9771.js.map +1 -0
- package/dist/9774.js +1 -0
- package/dist/9774.js.map +1 -0
- package/dist/9800.js +1 -0
- package/dist/9800.js.map +1 -0
- package/dist/9806.js +1 -0
- package/dist/9806.js.map +1 -0
- package/dist/9885.js +1 -0
- package/dist/9885.js.map +1 -0
- package/dist/992.js +1 -0
- package/dist/992.js.map +1 -0
- package/dist/995.js +1 -0
- package/dist/995.js.map +1 -0
- package/dist/kenyaemr-esm-care-panel-app.js +6 -5
- package/dist/kenyaemr-esm-care-panel-app.js.buildmanifest.json +1573 -672
- package/dist/kenyaemr-esm-care-panel-app.js.map +1 -1
- package/dist/main.js +6 -5
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/hivStatus/fr.json +1 -0
- package/package.json +4 -6
- package/src/care-panel/care-panel.component.tsx +1 -1
- package/src/care-panel-dashboard/care-panel-dashboard.component.tsx +8 -4
- package/src/care-programs/care-program-form-translation-keys.ts +121 -0
- package/src/care-programs/care-program.resource.ts +12 -6
- package/src/care-programs/care-programs.component.tsx +66 -31
- package/src/care-programs/link-patient-to-peer-action.component.tsx +38 -26
- package/src/care-programs/program-form-overflow-menu-item.component.tsx +40 -12
- package/src/care-programs/program.workspace.tsx +108 -96
- package/src/config-schema.ts +90 -14
- package/src/iit-risk-score/iit-risk-score-plot.tsx +5 -4
- package/src/index.ts +0 -4
- package/src/patient-discharge/patient-discharge.workspace.test.tsx +5 -10
- package/src/patient-discharge/patient-discharge.workspace.tsx +2 -2
- package/src/program-enrollment/program-enrollment.component.tsx +75 -67
- package/src/regimen-editor/regimen-button.component.tsx +12 -7
- package/src/regimen-editor/regimen-form.component.tsx +111 -107
- package/src/routes.json +19 -22
- package/translations/am.json +137 -0
- package/translations/en.json +137 -0
- package/translations/fr.json +138 -0
- package/translations/sw.json +272 -135
- package/treatmentNumber/fr.json +1 -0
- package/tsconfig.json +1 -1
- package/dist/1091.js +0 -1
- package/dist/1091.js.map +0 -1
- package/dist/1172.js +0 -1
- package/dist/1172.js.map +0 -1
- package/dist/121.js +0 -1
- package/dist/121.js.map +0 -1
- package/dist/132.js +0 -1
- package/dist/132.js.map +0 -1
- package/dist/1525.js +0 -1
- package/dist/1525.js.map +0 -1
- package/dist/1660.js +0 -1
- package/dist/1660.js.map +0 -1
- package/dist/1729.js +0 -17
- package/dist/1729.js.map +0 -1
- package/dist/1809.js +0 -7
- package/dist/1809.js.map +0 -1
- package/dist/1866.js +0 -1
- package/dist/1866.js.map +0 -1
- package/dist/1881.js +0 -1
- package/dist/1881.js.map +0 -1
- package/dist/1962.js +0 -1
- package/dist/1962.js.map +0 -1
- package/dist/1978.js +0 -1
- package/dist/1978.js.map +0 -1
- package/dist/2045.js +0 -1
- package/dist/2045.js.map +0 -1
- package/dist/2163.js +0 -1
- package/dist/2163.js.map +0 -1
- package/dist/2267.js +0 -1
- package/dist/2267.js.map +0 -1
- package/dist/2398.js +0 -1
- package/dist/2398.js.map +0 -1
- package/dist/2561.js +0 -1
- package/dist/2561.js.map +0 -1
- package/dist/2564.js +0 -1
- package/dist/2564.js.map +0 -1
- package/dist/2810.js +0 -2
- package/dist/2810.js.map +0 -1
- package/dist/2867.js +0 -1
- package/dist/2867.js.map +0 -1
- package/dist/3040.js +0 -1
- package/dist/3228.js +0 -1
- package/dist/3228.js.map +0 -1
- package/dist/3472.js +0 -1
- package/dist/3472.js.map +0 -1
- package/dist/3491.js +0 -1
- package/dist/3491.js.map +0 -1
- package/dist/3509.js +0 -1
- package/dist/3509.js.map +0 -1
- package/dist/3576.js +0 -1
- package/dist/3576.js.map +0 -1
- package/dist/3901.js +0 -1
- package/dist/3901.js.map +0 -1
- package/dist/399.js +0 -1
- package/dist/399.js.map +0 -1
- package/dist/4007.js +0 -66
- package/dist/4007.js.map +0 -1
- package/dist/4146.js +0 -1
- package/dist/4146.js.map +0 -1
- package/dist/4187.js +0 -1
- package/dist/4187.js.map +0 -1
- package/dist/4224.js +0 -1
- package/dist/4224.js.map +0 -1
- package/dist/4280.js +0 -1
- package/dist/4280.js.map +0 -1
- package/dist/4308.js +0 -1
- package/dist/4308.js.map +0 -1
- package/dist/4335.js +0 -1
- package/dist/4335.js.map +0 -1
- package/dist/4402.js +0 -1
- package/dist/4402.js.map +0 -1
- package/dist/4539.js +0 -1
- package/dist/4539.js.map +0 -1
- package/dist/4619.js +0 -1
- package/dist/4619.js.map +0 -1
- package/dist/4717.js +0 -1
- package/dist/4717.js.map +0 -1
- package/dist/4724.js +0 -1
- package/dist/4724.js.map +0 -1
- package/dist/4972.js +0 -1
- package/dist/4972.js.map +0 -1
- package/dist/509.js +0 -1
- package/dist/509.js.map +0 -1
- package/dist/5096.js +0 -1
- package/dist/5096.js.map +0 -1
- package/dist/5119.js +0 -1
- package/dist/5119.js.map +0 -1
- package/dist/5159.js +0 -13
- package/dist/5159.js.map +0 -1
- package/dist/5341.js +0 -1
- package/dist/5341.js.map +0 -1
- package/dist/5361.js +0 -1
- package/dist/5361.js.map +0 -1
- package/dist/5733.js +0 -1
- package/dist/5733.js.map +0 -1
- package/dist/5882.js +0 -1
- package/dist/5939.js +0 -5
- package/dist/5939.js.map +0 -1
- package/dist/6004.js +0 -1
- package/dist/6004.js.map +0 -1
- package/dist/6121.js +0 -3
- package/dist/6121.js.map +0 -1
- package/dist/6137.js +0 -1
- package/dist/6137.js.map +0 -1
- package/dist/623.js +0 -1
- package/dist/623.js.map +0 -1
- package/dist/6232.js +0 -1
- package/dist/6232.js.map +0 -1
- package/dist/6356.js +0 -1
- package/dist/6356.js.map +0 -1
- package/dist/6479.js +0 -1
- package/dist/6479.js.map +0 -1
- package/dist/6548.js +0 -1
- package/dist/6548.js.map +0 -1
- package/dist/6571.js +0 -1
- package/dist/6571.js.map +0 -1
- package/dist/6626.js +0 -1
- package/dist/6626.js.map +0 -1
- package/dist/6643.js +0 -1
- package/dist/6643.js.map +0 -1
- package/dist/6721.js +0 -1
- package/dist/6721.js.map +0 -1
- package/dist/6868.js +0 -1
- package/dist/6868.js.map +0 -1
- package/dist/6925.js +0 -1
- package/dist/6925.js.map +0 -1
- package/dist/7085.js +0 -1
- package/dist/7085.js.map +0 -1
- package/dist/7091.js +0 -1
- package/dist/7091.js.map +0 -1
- package/dist/7127.js +0 -1
- package/dist/7329.js +0 -1
- package/dist/7329.js.map +0 -1
- package/dist/7419.js +0 -1
- package/dist/7419.js.map +0 -1
- package/dist/7428.js +0 -1
- package/dist/7428.js.map +0 -1
- package/dist/7544.js +0 -1
- package/dist/7544.js.map +0 -1
- package/dist/7560.js +0 -1
- package/dist/7560.js.map +0 -1
- package/dist/774.js +0 -1
- package/dist/774.js.map +0 -1
- package/dist/8179.js +0 -6
- package/dist/8179.js.map +0 -1
- package/dist/8189.js +0 -1
- package/dist/8189.js.map +0 -1
- package/dist/8249.js +0 -1
- package/dist/8249.js.map +0 -1
- package/dist/8470.js +0 -1
- package/dist/8470.js.map +0 -1
- package/dist/8488.js +0 -1
- package/dist/8488.js.map +0 -1
- package/dist/8502.js +0 -1
- package/dist/8502.js.map +0 -1
- package/dist/8522.js +0 -1
- package/dist/8522.js.map +0 -1
- package/dist/8775.js +0 -11
- package/dist/8775.js.map +0 -1
- package/dist/887.js +0 -1
- package/dist/887.js.map +0 -1
- package/dist/916.js +0 -1
- package/dist/9466.js +0 -1
- package/dist/9466.js.map +0 -1
- package/dist/9675.js +0 -1
- package/dist/9675.js.map +0 -1
- package/dist/982.js +0 -1
- package/dist/982.js.map +0 -1
- package/dist/9931.js +0 -1
- package/dist/9931.js.map +0 -1
- 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.
|
|
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": "
|
|
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/**/*.
|
|
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": "
|
|
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
|
|
10
|
+
import { DefaultWorkspaceProps } from '@openmrs/esm-framework';
|
|
11
11
|
|
|
12
|
-
type CarePanelDashboardProps = {
|
|
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
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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,
|
|
20
|
-
import {
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
|
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 {
|
|
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 =
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
54
|
-
|
|
68
|
+
launchFormEntryWorkspace(
|
|
69
|
+
{
|
|
55
70
|
workspaceTitle: form.formName,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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 {
|
|
3
|
-
import {
|
|
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:
|
|
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={
|
|
109
|
+
itemText={formLabel}
|
|
95
110
|
onClick={() => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
workspaceTitle:
|
|
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
|
-
|
|
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
|
);
|