Skip to content

Commit

Permalink
Merge branch 'mwcore-dev' into mwcore-p2p-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
LZRS authored Dec 5, 2023
2 parents 524bc9f + ba88193 commit b1aa6de
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ enum class HealthStatus(var display: String = "") {
CHILD_CONTACT {
override fun priority(): StatusPriority = 3
},
SIBLING_CONTACT {
override fun priority(): StatusPriority = 3
},
SOCIAL_NETWORK_CONTACT {
override fun priority(): StatusPriority = 3
},
BIOLOGICAL_PARENT_CONTACT {
override fun priority(): StatusPriority = 3
},
SEXUAL_CONTACT {
override fun priority(): StatusPriority = 3
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ object TracingHelpers {
"art-client-child-contact-registration",
"art-client-sexual-contact-registration",
"art-client-sibling-contact-registration",
"art-client-social-network-contact-registration"
"art-client-social-network-contact-registration",
"contact-and-community-positive-hiv-test-and-next-appointment"
)
const val tracingBundleId = "tracing"
fun requireTracingTasks(id: String): Boolean =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,32 @@ class HealthStatusTest {

@Test
fun testPatientTypes() {

val expectedContactHealthStatusPriority = 3
Assert.assertNotNull(HealthStatus.valueOf("NEWLY_DIAGNOSED_CLIENT"))
Assert.assertNotNull(HealthStatus.valueOf("CLIENT_ALREADY_ON_ART"))
Assert.assertNotNull(HealthStatus.valueOf("EXPOSED_INFANT"))
Assert.assertNotNull(HealthStatus.valueOf("COMMUNITY_POSITIVE"))
Assert.assertNotNull(HealthStatus.valueOf("CHILD_CONTACT"))
Assert.assertNotNull(HealthStatus.valueOf("SEXUAL_CONTACT"))
Assert.assertNotNull(HealthStatus.valueOf("SIBLING_CONTACT"))

val siblingContactHealthStatus = HealthStatus.valueOf("SIBLING_CONTACT")
Assert.assertNotNull(siblingContactHealthStatus)
Assert.assertEquals(expectedContactHealthStatusPriority, siblingContactHealthStatus.priority())

val biologicalParentContactHealthStatus = HealthStatus.valueOf("BIOLOGICAL_PARENT_CONTACT")
Assert.assertNotNull(biologicalParentContactHealthStatus)
Assert.assertEquals(
expectedContactHealthStatusPriority,
biologicalParentContactHealthStatus.priority()
)

val socialNetworkContactHealthStatus = HealthStatus.valueOf("SOCIAL_NETWORK_CONTACT")
Assert.assertNotNull(socialNetworkContactHealthStatus)
Assert.assertEquals(
expectedContactHealthStatusPriority,
socialNetworkContactHealthStatus.priority()
)
}
}
12 changes: 6 additions & 6 deletions android/quest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -173,22 +173,22 @@ android {
dimension "apps"
applicationIdSuffix ".mwcore"
versionNameSuffix "-mwcore"
versionCode 29
versionName "0.1.19"
versionCode 30
versionName "0.1.20"
}
mwcoreDev {
dimension "apps"
applicationIdSuffix ".mwcoreDev"
versionNameSuffix "-mwcoreDev"
versionCode 29
versionName "0.1.19"
versionCode 30
versionName "0.1.20"
}
mwcoreProd {
dimension "apps"
applicationIdSuffix ".mwcoreProd"
versionNameSuffix "-mwcoreProd"
versionCode 7
versionName "0.0.7"
versionCode 8
versionName "0.0.8"
}
afyayangu {
dimension "apps"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,32 @@ enum class OverflowMenuHost(val overflowMenuItems: List<OverflowMenuItem>) {
OverflowMenuItem(R.id.tracing_history, R.string.tracing_history),
OverflowMenuItem(R.id.edit_profile, R.string.edit_profile)
)
)
),
SIBLING_CONTACT_PROFILE(
listOf(
OverflowMenuItem(R.id.hiv_test_and_next_appointment, R.string.hiv_test_and_next_appointment),
OverflowMenuItem(R.id.edit_profile, R.string.edit_profile),
OverflowMenuItem(R.id.clinic_history, R.string.clinic_history),
OverflowMenuItem(R.id.patient_transfer_out, R.string.transfer_out),
OverflowMenuItem(R.id.patient_change_status, R.string.change_status),
)
),
SOCIAL_NETWORK_CONTACT_PROFILE(
listOf(
OverflowMenuItem(R.id.hiv_test_and_next_appointment, R.string.hiv_test_and_next_appointment),
OverflowMenuItem(R.id.edit_profile, R.string.edit_profile),
OverflowMenuItem(R.id.clinic_history, R.string.clinic_history),
OverflowMenuItem(R.id.patient_transfer_out, R.string.transfer_out),
OverflowMenuItem(R.id.patient_change_status, R.string.change_status),
)
),
BIOLOGICAL_PARENT_CONTACT_PROFILE(
listOf(
OverflowMenuItem(R.id.hiv_test_and_next_appointment, R.string.hiv_test_and_next_appointment),
OverflowMenuItem(R.id.edit_profile, R.string.edit_profile),
OverflowMenuItem(R.id.clinic_history, R.string.clinic_history),
OverflowMenuItem(R.id.patient_transfer_out, R.string.transfer_out),
OverflowMenuItem(R.id.patient_change_status, R.string.change_status),
)
),
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ constructor(
HealthStatus.EXPOSED_INFANT -> OverflowMenuHost.EXPOSED_INFANT_PROFILE
HealthStatus.CHILD_CONTACT -> OverflowMenuHost.CHILD_CONTACT_PROFILE
HealthStatus.SEXUAL_CONTACT -> OverflowMenuHost.SEXUAL_CONTACT_PROFILE
HealthStatus.SIBLING_CONTACT -> OverflowMenuHost.SIBLING_CONTACT_PROFILE
HealthStatus.BIOLOGICAL_PARENT_CONTACT -> OverflowMenuHost.BIOLOGICAL_PARENT_CONTACT_PROFILE
HealthStatus.SOCIAL_NETWORK_CONTACT -> OverflowMenuHost.SOCIAL_NETWORK_CONTACT_PROFILE
HealthStatus.COMMUNITY_POSITIVE -> OverflowMenuHost.COMMUNITY_POSITIVE_PROFILE
else -> OverflowMenuHost.PATIENT_PROFILE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ class OverflowMenuFactoryTest : RobolectricTest() {
overflowMenuFactory.retrieveOverflowMenuItems(OverflowMenuHost.PATIENT_PROFILE)
Assert.assertNotNull(uiProfilePatient)
Assert.assertEquals(5, uiProfilePatient.size)

val uiProfileSiblingContact =
overflowMenuFactory.retrieveOverflowMenuItems(OverflowMenuHost.SEXUAL_CONTACT_PROFILE)
Assert.assertNotNull(uiProfileSiblingContact)
Assert.assertEquals(5, uiProfileSiblingContact.size)

val uiProfileSocialNetworkContact =
overflowMenuFactory.retrieveOverflowMenuItems(OverflowMenuHost.SOCIAL_NETWORK_CONTACT_PROFILE)
Assert.assertNotNull(uiProfileSocialNetworkContact)
Assert.assertEquals(5, uiProfileSocialNetworkContact.size)

val uiProfileBiologicalParentContact =
overflowMenuFactory.retrieveOverflowMenuItems(
OverflowMenuHost.BIOLOGICAL_PARENT_CONTACT_PROFILE
)
Assert.assertNotNull(uiProfileBiologicalParentContact)
Assert.assertEquals(5, uiProfileBiologicalParentContact.size)
}

@Test
Expand Down

0 comments on commit b1aa6de

Please sign in to comment.