Skip to content

Commit 3f07963

Browse files
Saket Narayanvinaysshenoy
authored andcommitted
Avoid logging PHI when multiple medical histories are present
1 parent fcb60a4 commit 3f07963

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/src/main/java/org/simple/clinic/medicalhistory/MedicalHistoryRepository.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package org.simple.clinic.medicalhistory
33
import io.reactivex.Completable
44
import io.reactivex.Observable
55
import io.reactivex.Single
6+
import org.simple.clinic.BuildConfig
67
import org.simple.clinic.medicalhistory.sync.MedicalHistoryPayload
78
import org.simple.clinic.patient.PatientUuid
89
import org.simple.clinic.patient.SyncStatus
@@ -36,7 +37,11 @@ class MedicalHistoryRepository @Inject constructor(
3637
.toObservable()
3738
.map { histories ->
3839
if (histories.size > 1) {
39-
throw AssertionError("Multiple histories are present for $patientUuid: $histories")
40+
if (BuildConfig.DEBUG) {
41+
throw AssertionError("Multiple histories are present for $patientUuid: $histories")
42+
} else {
43+
throw AssertionError("Multiple histories are present")
44+
}
4045
}
4146
if (histories.isEmpty()) {
4247
// This patient's MedicalHistory hasn't synced yet. We're okay with overriding

0 commit comments

Comments
 (0)