Compare commits
15 Commits
release-v1
...
hb3-hb4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e70f3c9a6 | ||
|
|
2642106b32 | ||
|
|
f50a1d8dcd | ||
|
|
5db43bf16c | ||
|
|
21d53cc2b8 | ||
|
|
82360b22c8 | ||
|
|
add61d9c65 | ||
|
|
92a01dbd9f | ||
|
|
bf73ea70b8 | ||
|
|
dfe39fb460 | ||
|
|
aa8a991fbb | ||
|
|
3aeb7ef543 | ||
|
|
f048335f77 | ||
|
|
44d5b4f0ba | ||
|
|
0b17ea9ab9 |
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -4,6 +4,7 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="modules">
|
||||
|
||||
@@ -16,11 +16,11 @@ android {
|
||||
|
||||
// prod - production, preprod - preproduction, quality - qc
|
||||
defaultConfig {
|
||||
applicationId "in.sminnovations.hpostesting.dev"
|
||||
applicationId "in.sminnovations.hpostesting.preprod"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 76
|
||||
versionName "2.1.76"
|
||||
versionCode 81
|
||||
versionName "2.1.81"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -66,15 +66,6 @@ object Constants {
|
||||
"HC-V1-020",
|
||||
"HCV-000-3001",
|
||||
"HCV-000-3002",
|
||||
"HCV-000-3003",
|
||||
"HCV-000-3004",
|
||||
"HCV-000-3005",
|
||||
"HCV-000-3006",
|
||||
"HCV-000-3007",
|
||||
"HCV-000-3008",
|
||||
"HCV-000-3009",
|
||||
"HCV-000-3010",
|
||||
"HPP1-0124-0001"
|
||||
)
|
||||
|
||||
const val password = "SMI@12345"
|
||||
@@ -104,64 +95,49 @@ object Constants {
|
||||
const val TEST_STATUS_CODE_TEST_COMPLETED = 12.0
|
||||
|
||||
val DEVICE_CONFIGURATION: Map<String, List<List<Double>>> = mapOf<String, List<List<Double>>>(
|
||||
"HPP1-0124-0001" to listOf(
|
||||
"HCV-000-3001" to listOf(
|
||||
listOf(1.313, -0.89), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2012, 0.0092), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
listOf(1.0, 0.0) // LED4, 560nm
|
||||
),
|
||||
"HCV-000-3002" to listOf(
|
||||
listOf(0.723142, -0.09135), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.1964, 0.011565), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
listOf(1.0, 0.0) // LED4, 560nm
|
||||
),
|
||||
"HCV-000-3003" to listOf(
|
||||
listOf(0.723142, -0.09135), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.1964, 0.011565), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
listOf(1.0, 0.0) // LED4, 560nm
|
||||
),
|
||||
)
|
||||
|
||||
val DEVICE_HB_PARAMETERS: Map<String, List<List<Double>>> = mapOf<String, List<List<Double>>>(
|
||||
"HCV-000-3001" to listOf(
|
||||
listOf(1.0, 0.0), // LED1, 435nm
|
||||
listOf(1.0, 0.0), // LED2, 415nm
|
||||
listOf(0.0305, 0.2067), // LED3, 555nm
|
||||
listOf(0.0258, 0.5534) // LED4, 560nm
|
||||
),
|
||||
"HCV-000-3002" to listOf(
|
||||
listOf(1.0, 0.0), // LED1, 435nm
|
||||
listOf(1.0, 0.0), // LED2, 415nm
|
||||
listOf(0.0305, 0.2067), // LED3, 555nm
|
||||
listOf(0.0258, 0.5534) // LED4, 560nm
|
||||
),
|
||||
"HCV-000-3003" to listOf(
|
||||
listOf(0.0562, 0.1001), // LED1, 435nm
|
||||
listOf(0.0902, 0.7021), // LED2, 415nm
|
||||
listOf(0.0208, 0.0191), // LED3, 555nm
|
||||
listOf(0.0153, 0.0152) // LED4
|
||||
),
|
||||
"HCV-000-3004" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(1.6837, -1.1417), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3005" to listOf(
|
||||
listOf(1.3801, -0.372), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.4565, -0.0371), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3006" to listOf(
|
||||
listOf(1.3801, -0.372), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.4565, -0.0371), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3007" to listOf(
|
||||
listOf(1.8445, -0.8213), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.4613, -0.0831), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3008" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3009" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
"HCV-000-3010" to listOf(
|
||||
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||
listOf(0.2241, -0.0106), // LED3, 555nm
|
||||
listOf(1.0, 0.0) // LED4
|
||||
),
|
||||
)
|
||||
@@ -170,8 +146,10 @@ object Constants {
|
||||
const val INCUBATION_TIME_MAX = 1400
|
||||
const val BATTERY_LEVEL_MIN = 0
|
||||
|
||||
const val MINIMUM_BATTERY_LEVEL = 0
|
||||
|
||||
val BUFFER_INTENSITY_THRESHOLDS: Map<String, List<List<Int>>> = mapOf<String, List<List<Int>>>(
|
||||
"HPP1-0124-0001" to listOf(
|
||||
"HCV-000-3001" to listOf(
|
||||
listOf(20000, 25074),
|
||||
listOf(20000, 24596),
|
||||
listOf(20000, 26065),
|
||||
@@ -194,42 +172,6 @@ object Constants {
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3005" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3006" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3007" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3008" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3009" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
),
|
||||
"HCV-000-3010" to listOf(
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
listOf(24500, 26250),
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -43,6 +43,8 @@ data class HemoCubeTestData(
|
||||
var abs2: Double? = null,
|
||||
var abs3: Double? = null,
|
||||
var abs4: Double? = null,
|
||||
var hb3: Double? = null,
|
||||
var hb4: Double? = null,
|
||||
var deviceRatio: Double? = null,
|
||||
var calculatedRatio: Double? = null,
|
||||
var predictedDenovixRatio: Double? = null,
|
||||
|
||||
@@ -26,7 +26,6 @@ import android.widget.AutoCompleteTextView
|
||||
import androidx.core.content.ContextCompat.getSystemService
|
||||
import androidx.core.content.getSystemService
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||
import com.google.firebase.firestore.FirebaseFirestore
|
||||
|
||||
@@ -197,7 +196,7 @@ class UserListAdapter(
|
||||
// }
|
||||
}
|
||||
userCard.setOnClickListener {
|
||||
if (batLevel < Constants.BATTERY_LEVEL_MIN) {
|
||||
if (batLevel < 40) {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
context?.getString(R.string.low_battery_warning),
|
||||
@@ -214,13 +213,13 @@ class UserListAdapter(
|
||||
).show()
|
||||
} else {
|
||||
if (model.incubationTime != "") {
|
||||
if (isBetween15And30Minutes(model.incubationTime) < 15) {
|
||||
if (isBetween15And30Minutes(model.incubationTime) < 0) {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
context?.getString(R.string.incubation_not_completed),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
} else if (isBetween15And30Minutes(model.incubationTime) > 30) {
|
||||
} else if (isBetween15And30Minutes(model.incubationTime) > 140000) {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
context?.getString(R.string.incubation_crossed_30_minutes),
|
||||
|
||||
@@ -304,11 +304,11 @@ class HemoCubeFragment : Fragment() {
|
||||
|
||||
when {
|
||||
resultData.contains("SNE") && this.testStatusCode < Constants.TEST_STATUS_CODE_CONFIG_COMPLETED -> {
|
||||
val pattern = Regex("HPP1-\\d{4}-\\d{4}")
|
||||
val pattern = Regex("HCV-\\d{3}-\\d{4}")
|
||||
val matchResult = pattern.find(resultData)
|
||||
val hardwareId = matchResult?.value
|
||||
|
||||
if (hardwareId.toString().length == 14) {
|
||||
if (hardwareId.toString().length == 12) {
|
||||
deviceHardwareId += hardwareId
|
||||
with(sharedPreferences.edit()) {
|
||||
putString(Constants.DEVICE_ID, deviceHardwareId)
|
||||
@@ -316,7 +316,7 @@ class HemoCubeFragment : Fragment() {
|
||||
}
|
||||
this.testStatusCode = Constants.TEST_STATUS_CODE_CONFIG_COMPLETED
|
||||
} else {
|
||||
hemoCubeViewModel.messages.postValue("Config error")
|
||||
hemoCubeViewModel.messages.postValue("config error")
|
||||
}
|
||||
activity?.runOnUiThread {
|
||||
binding.btnPlacebuffer.visibility = View.VISIBLE
|
||||
@@ -459,7 +459,7 @@ class HemoCubeFragment : Fragment() {
|
||||
allErrorMessages += "Error: Invalid Test. Improper buffer reading (low)"
|
||||
activity?.runOnUiThread {
|
||||
binding.errorMessage.text = getString(R.string.error_improper_buffer_low)
|
||||
binding.errorMessage.visibility = View.VISIBLE
|
||||
// binding.errorMessage.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ class HemoCubeFragment : Fragment() {
|
||||
activity?.runOnUiThread {
|
||||
binding.errorMessage.text =
|
||||
getString(R.string.error_improper_buffer_high)
|
||||
binding.errorMessage.visibility = View.VISIBLE
|
||||
// binding.errorMessage.visibility = View.VISIBLE
|
||||
binding.btnSubmit.isEnabled = true
|
||||
binding.btnSubmit.isClickable = true
|
||||
}
|
||||
@@ -498,10 +498,26 @@ class HemoCubeFragment : Fragment() {
|
||||
constant = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(2)?.get(1)
|
||||
fittedAbs3 = gradient?.times(led3Average)?.plus(constant!!)!!
|
||||
|
||||
gradient = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(3)?.get(0)
|
||||
constant = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(3)?.get(1)
|
||||
gradient = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(0)?.get(0)
|
||||
constant = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(0)?.get(1)
|
||||
fittedAbs4 = gradient?.times(led4Average)?.plus(constant!!)!!
|
||||
|
||||
val slope1 = Constants.DEVICE_HB_PARAMETERS[deviceHardwareId]?.get(1)?.get(0)
|
||||
val intercept1 = Constants.DEVICE_HB_PARAMETERS[deviceHardwareId]?.get(1)?.get(1)
|
||||
val _hb1 = (led3Average - intercept1!!) / slope1!!
|
||||
|
||||
val slope2 = Constants.DEVICE_HB_PARAMETERS[deviceHardwareId]?.get(3)?.get(0)
|
||||
val intercept = Constants.DEVICE_HB_PARAMETERS[deviceHardwareId]?.get(3)?.get(1)
|
||||
val _hb2 = (led4Average - intercept!!) / slope2!!
|
||||
|
||||
val slope3 = Constants.DEVICE_HB_PARAMETERS[deviceHardwareId]?.get(2)?.get(0)
|
||||
val intercept3 = Constants.DEVICE_HB_PARAMETERS[deviceHardwareId]?.get(2)?.get(1)
|
||||
val _hb3 = (led3Average - intercept3!!) / slope3!!
|
||||
|
||||
val slope4 = Constants.DEVICE_HB_PARAMETERS[deviceHardwareId]?.get(3)?.get(0)
|
||||
val intercept4 = Constants.DEVICE_HB_PARAMETERS[deviceHardwareId]?.get(3)?.get(1)
|
||||
val _hb4 = (led4Average - intercept4!!) / slope4!!
|
||||
|
||||
_predictedDenovixRatio = fittedAbs3.div(fittedAbs1)
|
||||
|
||||
if (fittedAbs1 <= fittedAbs2) {
|
||||
@@ -509,7 +525,7 @@ class HemoCubeFragment : Fragment() {
|
||||
allErrorMessages += "Error: Invalid Test. Problem with de-oxygenation" + "\n"
|
||||
activity?.runOnUiThread {
|
||||
binding.errorMessage.text = getString(R.string.error_invalid_test)
|
||||
binding.errorMessage.visibility = View.VISIBLE
|
||||
// binding.errorMessage.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,7 +533,7 @@ class HemoCubeFragment : Fragment() {
|
||||
validationError = true
|
||||
activity?.runOnUiThread {
|
||||
binding.errorMessage.text = getString(R.string.error_negative_abs)
|
||||
binding.errorMessage.visibility = View.VISIBLE
|
||||
// binding.errorMessage.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +542,7 @@ class HemoCubeFragment : Fragment() {
|
||||
allErrorMessages += "Error: Low Hb. Repeat test" + "\n"
|
||||
activity?.runOnUiThread {
|
||||
binding.errorMessage.text = "Error: Low Hb. Repeat test"
|
||||
binding.errorMessage.visibility = View.VISIBLE
|
||||
// binding.errorMessage.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,6 +565,8 @@ class HemoCubeFragment : Fragment() {
|
||||
this.abs2 = fittedAbs2
|
||||
this.abs3 = fittedAbs3
|
||||
this.abs4 = fittedAbs4
|
||||
this.hb3 = _hb3
|
||||
this.hb4 = _hb4
|
||||
this.deviceRatio = deviceRatio
|
||||
this.calculatedRatio = calculateRatio(deviceRatio)
|
||||
this.predictedDenovixRatio = _predictedDenovixRatio
|
||||
@@ -556,7 +574,7 @@ class HemoCubeFragment : Fragment() {
|
||||
.toString() + ", " + currentDeviceData?.coefficients?.get(1).toString()
|
||||
this.classificationResult = findResult(calculatedRatio)
|
||||
this.prdClassification = absorbanceBasedClassification(predictedDenovixRatio)
|
||||
hemoCubeViewModel.messages.postValue(this.prdClassification)
|
||||
hemoCubeViewModel.messages.postValue("HB: $_hb4")
|
||||
this.errorMessages = allErrorMessages
|
||||
this.resultData = deviceLog
|
||||
this.batteryLevel = hemoCubeViewModel.getBatteryLevel().toString()
|
||||
|
||||
@@ -126,6 +126,8 @@ class HemoCubeViewModel @Inject constructor(
|
||||
testDetails?.abs2 = DataHolder.hemoCubeTestData?.abs2
|
||||
testDetails?.abs3 = DataHolder.hemoCubeTestData?.abs3
|
||||
testDetails?.abs4 = DataHolder.hemoCubeTestData?.abs4
|
||||
testDetails?.hb3 = DataHolder.hemoCubeTestData?.hb3
|
||||
testDetails?.hb4 = DataHolder.hemoCubeTestData?.hb4
|
||||
testDetails?.deviceRatio = DataHolder.hemoCubeTestData?.deviceRatio
|
||||
testDetails?.predictedDenovixRatio = DataHolder.hemoCubeTestData?.predictedDenovixRatio
|
||||
testDetails?.calculatedRatio = DataHolder.hemoCubeTestData?.calculatedRatio
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
android:id="@+id/tv_subtitle4"
|
||||
style="@style/title1_1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="72dp"
|
||||
android:gravity="center"
|
||||
@@ -208,14 +208,15 @@
|
||||
<TextView
|
||||
android:id="@+id/tv_device_messages"
|
||||
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"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="11sp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/error_message" />
|
||||
|
||||
Reference in New Issue
Block a user