Skip to content

Commit c86ccd5

Browse files
authored
Merge branch 'ohcnetwork:develop' into develop
2 parents 178b6f3 + 37087ab commit c86ccd5

5 files changed

Lines changed: 15 additions & 1 deletion

File tree

.example.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ REACT_SENTRY_ENVIRONMENT=
4747
# Flag to allow some fields in patient registration to be non-mandatory
4848
REACT_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
5255
REACT_PATIENT_REG_MIN_GEO_ORG_LEVELS_REQUIRED=

care.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

scripts/validate-env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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(),

src/components/Patient/PatientDetailsTab/Demography.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
OrganizationParent,
2626
getOrgLabel,
2727
} from "@/types/organization/organization";
28+
import careConfig from "@careConfig";
2829

2930
export 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"

src/vite-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)