File tree Expand file tree Collapse file tree
components/Patient/PatientDetailsTab Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ REACT_SENTRY_ENVIRONMENT=
4747# Flag to allow some fields in patient registration to be non-mandatory
4848REACT_ENABLE_MINIMAL_PATIENT_REGISTRATION = true
4949
50+ # Flag to bypass patient edit access permissions
51+ REACT_PATIENT_GLOBAL_EDIT_ACCESS_ENABLED = false
52+
5053# Minimum number of geo-organization levels required during patient registration
5154# If not set, disables the requirement
5255REACT_PATIENT_REG_MIN_GEO_ORG_LEVELS_REQUIRED =
Original file line number Diff line number Diff line change @@ -249,6 +249,11 @@ const careConfig = {
249249 env . REACT_ENABLE_MINIMAL_PATIENT_REGISTRATION ,
250250 false ,
251251 ) ,
252+
253+ globalPatientEditAccessEnabled : booleanFromString (
254+ env . REACT_PATIENT_GLOBAL_EDIT_ACCESS_ENABLED ,
255+ false ,
256+ ) ,
252257 } ,
253258
254259 i18nUrl : env . REACT_CUSTOM_REMOTE_I18N_URL ,
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ const envSchema = z
117117 REACT_JWT_TOKEN_REFRESH_INTERVAL : numberAsString . optional ( ) ,
118118 REACT_DISABLE_PATIENT_LOGIN : booleanAsStringSchema . optional ( ) ,
119119 REACT_ENABLE_MINIMAL_PATIENT_REGISTRATION : booleanAsStringSchema . optional ( ) ,
120+ REACT_PATIENT_GLOBAL_EDIT_ACCESS_ENABLED : booleanAsStringSchema . optional ( ) ,
120121 REACT_APPOINTMENTS_DEFAULT_DATE_FILTER : numberAsString . optional ( ) ,
121122 REACT_PAYMENT_LOCATION_REQUIRED : booleanAsStringSchema . optional ( ) ,
122123 REACT_ENCOUNTER_DEFAULT_DATE_FILTER : numberAsString . optional ( ) ,
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
2525 OrganizationParent ,
2626 getOrgLabel ,
2727} from "@/types/organization/organization" ;
28+ import careConfig from "@careConfig" ;
2829
2930export const Demography = ( props : PatientProps ) => {
3031 const { patientData, facilityId } = props ;
@@ -144,7 +145,10 @@ export const Demography = (props: PatientProps) => {
144145 const data : Data [ ] = [
145146 {
146147 id : "general-info" ,
147- allowEdit : canWritePatient && ! ! facilityId ,
148+ allowEdit :
149+ ( canWritePatient ||
150+ careConfig . patientRegistration . globalPatientEditAccessEnabled ) &&
151+ ! ! facilityId ,
148152 details : [
149153 < PLUGIN_Component
150154 key = "patient_details_tab__demography__general_info"
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ interface ImportMetaEnv {
3131 readonly REACT_DEFAULT_PAYMENT_TERMS ?: string ;
3232 readonly REACT_APP_MAX_IMAGE_UPLOAD_SIZE_MB ?: string ;
3333 readonly REACT_ENABLE_MINIMAL_PATIENT_REGISTRATION ?: string ;
34+ readonly REACT_PATIENT_GLOBAL_EDIT_ACCESS_ENABLED ?: string ;
3435 readonly REACT_DISABLE_PATIENT_LOGIN ?: string ;
3536 readonly REACT_CUSTOM_REMOTE_I18N_URL ?: string ;
3637 readonly REACT_ENABLE_AUTO_INVOICE_AFTER_DISPENSE ?: string ;
You can’t perform that action at this time.
0 commit comments