@@ -3,6 +3,7 @@ import React from 'react';
3
3
import { useTranslation } from 'react-i18next' ;
4
4
import { useActivePatientEnrollment } from '../hooks/useProgramEnrollment' ;
5
5
import O2IFrame from './o2-iframe.component' ;
6
+ import styles from './o2-pregnancy-infant-dashboard.scss' ;
6
7
7
8
/**
8
9
* Extension to display either the O2 pregnancy program or infant program dashboard,
@@ -48,17 +49,36 @@ const O2PregnancyInfantProgramDashboard: React.FC<{ patientUuid: string }> = ({
48
49
'.infant\\.dashboard\\.indicator a' ,
49
50
] ;
50
51
52
+ const o2PatientChartLink = (
53
+ < div className = { styles . patientChartLinkContainer } >
54
+ < a href = { `${ window . openmrsBase } /coreapps/clinicianfacing/patient.page?patientId=${ patientUuid } ` } >
55
+ { t ( 'fullPatientChart' , 'Full patient chart' ) }
56
+ </ a >
57
+ </ div >
58
+ ) ;
59
+
51
60
if ( isLoading ) {
52
61
return < InlineLoading /> ;
53
62
} else if ( inInfantProgram ) {
54
63
const src = `${ window . openmrsBase } /coreapps/clinicianfacing/patient.page?patientId=${ patientUuid } &dashboard=${ infantProgramUuid } ` ;
55
- return < O2IFrame key = { patientUuid } { ...{ src, elementsToDisable, elementsToHide } } /> ;
64
+ return (
65
+ < >
66
+ { o2PatientChartLink }
67
+ < O2IFrame key = { patientUuid } { ...{ src, elementsToDisable, elementsToHide } } />
68
+ </ >
69
+ ) ;
56
70
} else if ( inPregnancyProgram ) {
57
71
const src = `${ window . openmrsBase } /coreapps/clinicianfacing/patient.page?patientId=${ patientUuid } &dashboard=${ pregnancyProgramUuid } ` ;
58
- return < O2IFrame key = { patientUuid } { ...{ src, elementsToDisable, elementsToHide } } /> ;
72
+ return (
73
+ < >
74
+ { o2PatientChartLink }
75
+ < O2IFrame key = { patientUuid } { ...{ src, elementsToDisable, elementsToHide } } />
76
+ </ >
77
+ ) ;
59
78
} else {
60
79
return (
61
80
< div >
81
+ { o2PatientChartLink }
62
82
{ t (
63
83
'patientNotEnrolledInInfantOrPregnancyProgram' ,
64
84
'Patient not enrolled in either Infant or Pregnancy Program' ,
0 commit comments