diff --git a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureActivity.kt b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureActivity.kt index e4a538765b..d853902964 100644 --- a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureActivity.kt +++ b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureActivity.kt @@ -98,8 +98,8 @@ class EventCaptureActivity : eventUid = intent.getStringExtra(Constants.EVENT_UID) programUid = intent.getStringExtra(Constants.PROGRAM_UID) setUpEventCaptureComponent(eventUid) - teiUid = presenter!!.teiUid - enrollmentUid = presenter!!.enrollmentUid + teiUid = presenter.getTeiUid() + enrollmentUid = presenter.getEnrollmentUid() themeManager!!.setProgramTheme(intent.getStringExtra(Constants.PROGRAM_UID)!!) super.onCreate(savedInstanceState) binding = DataBindingUtil.setContentView(this, R.layout.activity_event_capture) diff --git a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureContract.kt b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureContract.kt index 91e9fff76c..a90a5c914d 100644 --- a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureContract.kt +++ b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureContract.kt @@ -62,6 +62,8 @@ class EventCaptureContract { fun getCompletionPercentageVisibility(): Boolean fun emitAction(onBack: EventCaptureAction) fun programStage(): String + fun getTeiUid(): String? + fun getEnrollmentUid(): String? } interface EventCaptureRepository { @@ -85,5 +87,7 @@ class EventCaptureContract { fun hasAnalytics(): Boolean fun hasRelationships(): Boolean fun validationStrategy(): ValidationStrategy + fun getTeiUid(): String? + fun getEnrollmentUid(): String? } } diff --git a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCapturePresenterImpl.kt b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCapturePresenterImpl.kt index 41884b99e4..1ee0a6c4a3 100644 --- a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCapturePresenterImpl.kt +++ b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCapturePresenterImpl.kt @@ -302,9 +302,9 @@ class EventCapturePresenterImpl( override fun programStage(): String = eventCaptureRepository.programStage().blockingFirst() override fun getEnrollmentUid(): String? { - return eventCaptureRepository.enrollmentUid + return eventCaptureRepository.getEnrollmentUid() } override fun getTeiUid(): String? { - return eventCaptureRepository.teiUid + return eventCaptureRepository.getTeiUid() } } diff --git a/app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/teidata/TEIDataPresenter.kt b/app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/teidata/TEIDataPresenter.kt index f93347e1a1..7216e851ba 100644 --- a/app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/teidata/TEIDataPresenter.kt +++ b/app/src/main/java/org/dhis2/usescases/teiDashboard/dashboardfragments/teidata/TEIDataPresenter.kt @@ -128,10 +128,6 @@ class TEIDataPresenter( .subscribe( { events -> _events.postValue(events) - _totalTimeLineEvents.postValue( - events.firstOrNull()?.eventCount - ?: 0, - ) decrement() }, Timber.Forest::d,