@@ -575,7 +575,10 @@ class PatientSummaryUpdate(
575575 prescribedDrugs : List <PrescribedDrug >,
576576 diagnosisWarningPrescriptions : DiagnosisWarningPrescriptions ,
577577 ): Next <PatientSummaryModel , PatientSummaryEffect > {
578- val canShowAppointmentSheet = hasPatientMeasurementDataChangedSinceScreenCreated && ! hasAppointmentChangedSinceScreenCreated
578+ val canShowAppointmentSheet = hasPatientMeasurementDataChangedSinceScreenCreated &&
579+ ! hasAppointmentChangedSinceScreenCreated &&
580+ medicalHistory.suspected.not ()
581+
579582 val hasAtLeastOneMeasurementRecorded = countOfRecordedBloodPressures + countOfRecordedBloodSugars > 0
580583 val shouldShowDiagnosisError = hasAtLeastOneMeasurementRecorded && when {
581584 model.isDiabetesManagementEnabled -> medicalHistory.diagnosisRecorded.not ()
@@ -589,8 +592,10 @@ class PatientSummaryUpdate(
589592 medicalHistory = medicalHistory,
590593 hasShownMeasurementsWarningDialog = model.hasShownMeasurementsWarningDialog
591594 )
595+
592596 val canShowHTNDiagnosisWarning = medicalHistory.diagnosedWithHypertension != Yes &&
593597 prescribedDrugs.any { prescription -> diagnosisWarningPrescriptions.htnPrescriptions.contains(prescription.name.lowercase()) }
598+
594599 val canShowDiabetesDiagnosisWarning = medicalHistory.diagnosedWithDiabetes != Yes &&
595600 prescribedDrugs.any { prescription -> diagnosisWarningPrescriptions.diabetesPrescriptions.contains(prescription.name.lowercase()) }
596601
@@ -616,21 +621,29 @@ class PatientSummaryUpdate(
616621 prescribedDrugs : List <PrescribedDrug >,
617622 diagnosisWarningPrescriptions : DiagnosisWarningPrescriptions ,
618623 ): Next <PatientSummaryModel , PatientSummaryEffect > {
619- val openIntention = model.openIntention
620- val canShowAppointmentSheet = hasPatientMeasurementDataChangedSinceScreenCreated && ! hasAppointmentChangedSinceScreenCreated
624+ val canShowAppointmentSheet = hasPatientMeasurementDataChangedSinceScreenCreated
625+ && ! hasAppointmentChangedSinceScreenCreated
626+ && medicalHistory.suspected.not ()
627+
621628 val hasAtLeastOneMeasurementRecorded = countOfRecordedBloodPressures + countOfRecordedBloodSugars > 0
622629 val shouldShowDiagnosisError = hasAtLeastOneMeasurementRecorded && when {
623630 model.isDiabetesManagementEnabled -> medicalHistory.diagnosisRecorded.not ()
624631 else -> medicalHistory.hypertensionRecorded.not ()
625632 }
633+
634+ val openIntention = model.openIntention
626635 val shouldGoToPreviousScreen = openIntention is ViewExistingPatient
627- val shouldGoToHomeScreen = openIntention is LinkIdWithPatient || openIntention is ViewNewPatient || openIntention is ViewExistingPatientWithTeleconsultLog
636+ val shouldGoToHomeScreen = openIntention is LinkIdWithPatient ||
637+ openIntention is ViewNewPatient ||
638+ openIntention is ViewExistingPatientWithTeleconsultLog
639+
628640 val measurementWarningEffect = validateMeasurements(
629641 isDiabetesManagementEnabled = model.isDiabetesManagementEnabled,
630642 countOfRecordedBloodSugars = countOfRecordedBloodSugars,
631643 countOfRecordedBloodPressures = countOfRecordedBloodPressures,
632644 medicalHistory = medicalHistory,
633645 hasShownMeasurementsWarningDialog = model.hasShownMeasurementsWarningDialog)
646+
634647 val canShowHTNDiagnosisWarning = medicalHistory.diagnosedWithHypertension != Yes &&
635648 prescribedDrugs.any { prescription -> diagnosisWarningPrescriptions.htnPrescriptions.contains(prescription.name.lowercase()) }
636649 val canShowDiabetesDiagnosisWarning = medicalHistory.diagnosedWithDiabetes != Yes &&
0 commit comments