File tree 5 files changed +16
-1
lines changed
java/org/smartregister/fhircore/engine/util/extension
quest/src/main/java/org/smartregister/fhircore/quest
patient/profile/components
5 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,14 @@ fun CarePlan.CarePlanActivityComponent.shouldShowOnProfile(): Boolean {
82
82
.not ()
83
83
}
84
84
85
+ fun CarePlan.extractVisitNumber (): String? {
86
+ val visitNumberCoding =
87
+ this .category.firstOrNull {
88
+ (it.coding.firstOrNull()?.system ? : " " ) == " https://d-tree.org/fhir/care-plan-visit-number"
89
+ }
90
+ return visitNumberCoding?.coding?.firstOrNull()?.code
91
+ }
92
+
85
93
fun CarePlan.CarePlanStatus.toCoding () = Coding (this .system, this .toCode(), this .display)
86
94
87
95
fun CarePlan.isLastTask (task : Task ) =
Original file line number Diff line number Diff line change 168
168
<string name =" upload_strategy" >Upload Strategy</string >
169
169
<string name =" ok" >Ok</string >
170
170
<string name =" opening_form" >Opening form...</string >
171
+ <string name =" visit" >Visit</string >
171
172
</resources >
Original file line number Diff line number Diff line change 16
16
17
17
package org.smartregister.fhircore.quest.ui.patient.profile.components
18
18
19
- import android.graphics.Color
20
19
import androidx.compose.foundation.background
21
20
import androidx.compose.foundation.layout.Arrangement
22
21
import androidx.compose.foundation.layout.Column
@@ -100,6 +99,9 @@ fun PersonalData(
100
99
) {
101
100
OtherDetailsItem (title = stringResource(R .string.sex), value = patientProfileViewData.sex)
102
101
OtherDetailsItem (title = stringResource(R .string.age), value = patientProfileViewData.age)
102
+ patientProfileViewData.visitNumber?.let {
103
+ OtherDetailsItem (title = stringResource(R .string.visit), value = it)
104
+ }
103
105
}
104
106
}
105
107
}
@@ -124,6 +126,7 @@ fun PersonalDataPreview() {
124
126
sex = " Female" ,
125
127
age = " 48y" ,
126
128
dob = " 08 Dec" ,
129
+ visitNumber = " 1" ,
127
130
identifier = " 123455" ,
128
131
)
129
132
PersonalData (patientProfileViewData = patientProfileData)
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ sealed class ProfileViewData(
63
63
val addressTracingCatchment : String = " " ,
64
64
val addressPhysicalLocator : String = " " ,
65
65
val currentCarePlan : CarePlan ? = null ,
66
+ val visitNumber : String? = null ,
66
67
val phoneContacts : List <String > = emptyList(),
67
68
val observations : List <Observation > = emptyList(),
68
69
val practitioners : List <Practitioner > = emptyList(),
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import org.smartregister.fhircore.engine.ui.theme.SuccessColor
39
39
import org.smartregister.fhircore.engine.util.extension.asDdMmYyyy
40
40
import org.smartregister.fhircore.engine.util.extension.canBeCompleted
41
41
import org.smartregister.fhircore.engine.util.extension.extractId
42
+ import org.smartregister.fhircore.engine.util.extension.extractVisitNumber
42
43
import org.smartregister.fhircore.engine.util.extension.getQuestionnaire
43
44
import org.smartregister.fhircore.engine.util.extension.getQuestionnaireName
44
45
import org.smartregister.fhircore.engine.util.extension.makeItReadable
@@ -92,6 +93,7 @@ class ProfileViewDataMapper @Inject constructor(@ApplicationContext val context:
92
93
observations = inputModel.observations,
93
94
guardians = inputModel.guardians,
94
95
currentCarePlan = inputModel.currentCarePlan,
96
+ visitNumber = inputModel.currentCarePlan?.extractVisitNumber(),
95
97
tasks =
96
98
inputModel.tasks.map {
97
99
PatientProfileRowItem (
You can’t perform that action at this time.
0 commit comments