add new slope class thresholds
This commit is contained in:
@@ -19,8 +19,8 @@ android {
|
||||
applicationId "in.sminnovations.hpostesting.preprod"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 60
|
||||
versionName "2.1.60"
|
||||
versionCode 62
|
||||
versionName "2.1.62"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.google.android.datatransport.runtime.dagger.Provides
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Database(entities = [UserData::class, HemoCubeTestData::class, DeviceData::class], version = 13, exportSchema = false)
|
||||
@Database(entities = [UserData::class, HemoCubeTestData::class, DeviceData::class], version = 14, exportSchema = false)
|
||||
@TypeConverters(Converters::class)
|
||||
abstract class MyDatabase : RoomDatabase() {
|
||||
abstract fun userDao(): UserDao
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.google.firebase.ktx.Firebase
|
||||
import com.google.firebase.perf.ktx.performance
|
||||
import `in`.sminnovations.hpostesting.R
|
||||
import `in`.sminnovations.hpostesting.databinding.FragmentHemoCubeReferenceBinding
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.log10
|
||||
|
||||
class HemoCubeFragment : Fragment() {
|
||||
@@ -504,7 +505,8 @@ class HemoCubeFragment : Fragment() {
|
||||
|
||||
_predictedDenovixRatio = fittedAbs3.div(fittedAbs1)
|
||||
|
||||
val _slopeRatio = (fittedAbs1 - fittedAbs2) / (435 - 415)
|
||||
val slope = (led1Average - led2Average) / (435 - 415)
|
||||
val _slopeRatio = abs(led3Average / slope)
|
||||
val slopeClass = slopeRatioClassification(_slopeRatio)
|
||||
|
||||
if (fittedAbs1 <= fittedAbs2) {
|
||||
@@ -569,8 +571,8 @@ class HemoCubeFragment : Fragment() {
|
||||
this.classificationResult = findResult(calculatedRatio)
|
||||
this.prdClassification = absorbanceBasedClassification(predictedDenovixRatio)
|
||||
this.deviceRatioClass = deviceRatioClassification(deviceRatio)
|
||||
this.slopeRatioClass = slopeRatioClass
|
||||
hemoCubeViewModel.messages.postValue("Pdr: ${this.prdClassification}\n, Slope: ${this.slopeRatioClass}\n, Device: ${this.deviceRatioClass}")
|
||||
this.slopeRatioClass = slopeClass
|
||||
hemoCubeViewModel.messages.postValue("Slope Ratio: ${slopeRatio},\n Slope: ${this.slopeRatioClass}\n")
|
||||
this.errorMessages = allErrorMessages
|
||||
this.resultData = deviceLog
|
||||
this.batteryLevel = hemoCubeViewModel.getBatteryLevel().toString()
|
||||
@@ -669,15 +671,15 @@ class HemoCubeFragment : Fragment() {
|
||||
try {
|
||||
hemoCubeViewModel.messages.postValue("result classification")
|
||||
if (ratio != null) {
|
||||
if (ratio in 0.0..35.0)
|
||||
if (ratio in 0.0..30.0)
|
||||
return getString(R.string.normal)
|
||||
if (ratio in 35.0..40.0)
|
||||
if (ratio in 30.0..35.0)
|
||||
return getString(R.string.negative_borderline)
|
||||
if (ratio in 40.0..70.0)
|
||||
if (ratio in 35.0..50.0)
|
||||
return getString(R.string.sickle_cell_trait)
|
||||
if (ratio in 70.0..75.0)
|
||||
if (ratio in 50.0..60.0)
|
||||
return getString(R.string.positive_for_sickle_cell)
|
||||
if (ratio in 75.0..300.0)
|
||||
if (ratio > 60.0)
|
||||
return getString(R.string.sickle_cell_disease)
|
||||
} else {
|
||||
return getString(R.string.invalid)
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
style="@style/title1_1"
|
||||
android:visibility="gone"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="180dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="72dp"
|
||||
android:gravity="center"
|
||||
|
||||
Reference in New Issue
Block a user