Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAPP-1824 #570

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class HealthRecordViewModel @Inject constructor(

fun showTimeLine(filterString: String) = viewModelScope.launch {
val healthRecords = generateTimeline()
val requiredProtectiveWordVerification =
(healthRecords.any { record -> record.healthRecordType == HealthRecordType.MEDICATION_RECORD } && !isShowMedicationRecords())

val timeLineFilters = mutableListOf<String>()
val filteredResult = mutableListOf<HealthRecordItem>()
Expand Down Expand Up @@ -100,7 +98,7 @@ class HealthRecordViewModel @Inject constructor(
}
}
},
requiredProtectiveWordVerification = requiredProtectiveWordVerification
requiredProtectiveWordVerification = !isShowMedicationRecords()
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
package ca.bc.gov.bchealth.ui.healthrecord.clinicaldocument

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -83,42 +87,53 @@ private fun ClinicalDocumentDetailScreenContent(
uiState: ClinicalDocumentUiState,
commentUIState: CommentsUiState
) {
Box(
modifier = modifier
.fillMaxSize()
) {

Column(modifier = modifier.fillMaxSize()) {
LazyColumn(
modifier.weight(1F), contentPadding = PaddingValues(32.dp),
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
item {
if (uiState.onLoading) {
CircularProgressIndicator(
modifier = modifier.align(Alignment.Center),
color = MaterialTheme.colors.primary
)
}
Column(modifier = modifier.fillMaxSize()) {
LazyColumn(
modifier.weight(1F), contentPadding = PaddingValues(32.dp),
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
item {

HGLargeOutlinedButton(
onClick = onClickDownload,
modifier = Modifier
.fillMaxWidth(),
text = stringResource(id = R.string.clinical_documents_detail_button_download)
)
HGLargeOutlinedButton(
onClick = onClickDownload,
modifier = Modifier
.fillMaxWidth(),
text = stringResource(id = R.string.clinical_documents_detail_button_download)
)
}

items(uiState.uiList) { listItem ->
HealthRecordListItem(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
stringResource(id = listItem.title),
listItem.description.orEmpty(),
)
}
}

items(uiState.uiList) { listItem ->
HealthRecordListItem(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
stringResource(id = listItem.title),
listItem.description.orEmpty(),
if (BuildConfig.FLAG_ADD_COMMENTS) {
CommentsSummaryUI(
onClickComments = onClickComments,
commentsSummary = commentUIState.commentsSummary
)
}
}

if (BuildConfig.FLAG_ADD_COMMENTS) {
CommentsSummaryUI(
onClickComments = onClickComments,
commentsSummary = commentUIState.commentsSummary
)
}

if (BuildConfig.FLAG_ADD_COMMENTS) {
CommentInputUI(onSubmitComment = onSubmitComment)
if (BuildConfig.FLAG_ADD_COMMENTS) {
CommentInputUI(onSubmitComment = onSubmitComment)
}
}
}
}
Expand Down
Loading