Compare commits
27 Commits
DigitalPre
...
Test_work_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d34ce2a52 | ||
|
|
ec3d0b8628 | ||
|
|
7464bfef6d | ||
|
|
85986c87b1 | ||
|
|
dadddfd558 | ||
|
|
0903647500 | ||
|
|
326c66fea7 | ||
|
|
045eaee578 | ||
|
|
302960922e | ||
|
|
ea4fb6e4d2 | ||
|
|
80fa523ec9 | ||
|
|
7a2e5ead51 | ||
|
|
f109c52288 | ||
|
|
4a248f7c49 | ||
|
|
2123b2a7b4 | ||
|
|
704223e403 | ||
|
|
6097a05701 | ||
|
|
290bf77950 | ||
|
|
ad595a6299 | ||
|
|
22bf66fc94 | ||
|
|
1dd66bcd6e | ||
|
|
a02ba3e9ea | ||
|
|
457c652161 | ||
|
|
5bebd88dfd | ||
|
|
6fa5e760c1 | ||
|
|
8940352e05 | ||
|
|
28bd9cbd43 |
@@ -19,8 +19,8 @@ android {
|
|||||||
applicationId "in.sminnovations.hpostesting"
|
applicationId "in.sminnovations.hpostesting"
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 30
|
versionCode 44
|
||||||
versionName "2.1.30"
|
versionName "2.1.44"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@@ -49,9 +49,14 @@ android {
|
|||||||
abortOnError false
|
abortOnError false
|
||||||
checkReleaseBuilds false
|
checkReleaseBuilds false
|
||||||
}
|
}
|
||||||
|
packagingOptions {
|
||||||
|
exclude 'mockito-extensions/org.mockito.plugins.MockMaker'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation "com.google.dagger:hilt-android:2.46"
|
||||||
|
kapt "com.google.dagger:hilt-android-compiler:2.46"
|
||||||
|
|
||||||
implementation 'androidx.core:core-ktx:1.12.0'
|
implementation 'androidx.core:core-ktx:1.12.0'
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||||
@@ -75,6 +80,8 @@ dependencies {
|
|||||||
implementation 'com.google.android.things:androidthings:1.0'
|
implementation 'com.google.android.things:androidthings:1.0'
|
||||||
implementation 'com.google.firebase:firebase-appdistribution:16.0.0-beta11'
|
implementation 'com.google.firebase:firebase-appdistribution:16.0.0-beta11'
|
||||||
implementation("com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta11")
|
implementation("com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta11")
|
||||||
|
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||||
|
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||||
|
|
||||||
|
|
||||||
// Testing
|
// Testing
|
||||||
@@ -86,14 +93,14 @@ dependencies {
|
|||||||
androidTestImplementation 'org.mockito:mockito-android:3.12.4'
|
androidTestImplementation 'org.mockito:mockito-android:3.12.4'
|
||||||
androidTestImplementation 'org.mockito:mockito-inline:3.12.4'
|
androidTestImplementation 'org.mockito:mockito-inline:3.12.4'
|
||||||
testImplementation "androidx.arch.core:core-testing:2.2.0"
|
testImplementation "androidx.arch.core:core-testing:2.2.0"
|
||||||
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4'
|
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1'
|
||||||
|
|
||||||
|
|
||||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
|
||||||
implementation 'com.opencsv:opencsv:4.6'
|
implementation 'com.opencsv:opencsv:4.6'
|
||||||
implementation 'com.github.mik3y:usb-serial-for-android:3.5.1'
|
implementation 'com.github.mik3y:usb-serial-for-android:3.5.1'
|
||||||
|
|
||||||
implementation "androidx.fragment:fragment-ktx:1.6.1"
|
implementation "androidx.fragment:fragment-ktx:1.6.2"
|
||||||
|
|
||||||
// CSV read, write
|
// CSV read, write
|
||||||
implementation 'com.opencsv:opencsv:4.6'
|
implementation 'com.opencsv:opencsv:4.6'
|
||||||
@@ -105,22 +112,22 @@ dependencies {
|
|||||||
implementation 'com.google.android.gms:play-services-code-scanner:16.1.0'
|
implementation 'com.google.android.gms:play-services-code-scanner:16.1.0'
|
||||||
|
|
||||||
//Room
|
//Room
|
||||||
implementation "androidx.room:room-ktx:2.6.0-rc01"
|
implementation "androidx.room:room-ktx:2.6.0"
|
||||||
implementation "androidx.room:room-runtime:2.6.0-rc01"
|
implementation "androidx.room:room-runtime:2.6.0"
|
||||||
kapt ("androidx.room:room-compiler:2.6.0-rc01")
|
kapt ("androidx.room:room-compiler:2.6.0")
|
||||||
|
|
||||||
//image
|
//image
|
||||||
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
||||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
|
||||||
|
|
||||||
// Navigation Component
|
// Navigation Component
|
||||||
implementation "androidx.navigation:navigation-fragment-ktx:2.7.3"
|
implementation "androidx.navigation:navigation-fragment-ktx:2.7.5"
|
||||||
implementation "androidx.navigation:navigation-ui-ktx:2.7.3"
|
implementation "androidx.navigation:navigation-ui-ktx:2.7.5"
|
||||||
|
|
||||||
//Dagger - Hilt
|
//Dagger - Hilt
|
||||||
implementation "com.google.dagger:hilt-android:2.46"
|
implementation "com.google.dagger:hilt-android:2.46"
|
||||||
kapt "com.google.dagger:hilt-android-compiler:2.46"
|
kapt "com.google.dagger:hilt-android-compiler:2.46"
|
||||||
kapt "androidx.hilt:hilt-compiler:1.0.0"
|
kapt "androidx.hilt:hilt-compiler:1.1.0"
|
||||||
|
|
||||||
// Retrofit + GSON
|
// Retrofit + GSON
|
||||||
implementation "com.squareup.retrofit2:retrofit:2.9.0"
|
implementation "com.squareup.retrofit2:retrofit:2.9.0"
|
||||||
|
|||||||
@@ -61,7 +61,8 @@
|
|||||||
android:name="com.example.hpostesting.presentation.dashboard.DashboardActivity"
|
android:name="com.example.hpostesting.presentation.dashboard.DashboardActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/title_activity_dashboard"
|
android:label="@string/title_activity_dashboard"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar" />
|
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||||
|
tools:ignore="MissingClass" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="com.example.hpostesting.presentation.testRight.UsbService"
|
android:name="com.example.hpostesting.presentation.testRight.UsbService"
|
||||||
|
|||||||
@@ -80,34 +80,43 @@ object Constants {
|
|||||||
|
|
||||||
val DEVICE_CONFIGURATION: Map<String, List<List<Double>>> = mapOf<String, List<List<Double>>>(
|
val DEVICE_CONFIGURATION: Map<String, List<List<Double>>> = mapOf<String, List<List<Double>>>(
|
||||||
"HCV-000-3001" to listOf(
|
"HCV-000-3001" to listOf(
|
||||||
listOf(1.264817, -0.85965), // LED1, 435nm
|
listOf(1.313, -0.89), // LED1, 435nm
|
||||||
listOf(0.581462456, -0.58502), // LED2, 415nm
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
listOf(0.184991, 0.001704), // LED3, 555nm
|
listOf(0.2012, 0.0092), // LED3, 555nm
|
||||||
listOf(1.0, 0.0) // LED4
|
listOf(1.0, 0.0) // LED4
|
||||||
),
|
),
|
||||||
"HCV-000-3002" to listOf(
|
"HCV-000-3002" to listOf(
|
||||||
listOf(1.264817, -0.85965),
|
listOf(0.723142, -0.09135), // LED1, 435nm
|
||||||
listOf(0.581462456, -0.58502),
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
listOf(0.184991, 0.001704),
|
listOf(0.1964, 0.011565), // LED3, 555nm
|
||||||
listOf(1.0, 0.0)
|
listOf(1.0, 0.0) // LED4
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
const val INCUBATION_TIME_MIN = 15
|
const val INCUBATION_TIME_MIN = 0
|
||||||
const val INCUBATION_TIME_MAX = 30
|
const val INCUBATION_TIME_MAX = 1400
|
||||||
|
|
||||||
val BUFFER_INTENSITY_THRESHOLDS: Map<String, List<List<Int>>> = mapOf<String, List<List<Int>>>(
|
val BUFFER_INTENSITY_THRESHOLDS: Map<String, List<List<Int>>> = mapOf<String, List<List<Int>>>(
|
||||||
"HCV-000-3001" to listOf(
|
"HCV-000-3001" to listOf(
|
||||||
listOf(24000, 24500),
|
listOf(20000, 25074),
|
||||||
listOf(21000, 24500),
|
listOf(20000, 24596),
|
||||||
listOf(21000, 24500),
|
listOf(20000, 26065),
|
||||||
listOf(21000, 24500),
|
listOf(20000, 27093),
|
||||||
),
|
),
|
||||||
"HCV-000-3002" to listOf(
|
"HCV-000-3002" to listOf(
|
||||||
listOf(21000, 24500),
|
listOf(24500, 26250),
|
||||||
listOf(21000, 24500),
|
listOf(24500, 26250),
|
||||||
listOf(21000, 24500),
|
listOf(24500, 26250),
|
||||||
listOf(21000, 24500),
|
listOf(24500, 26250),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
val COEFFICIENTS: Map<String, List<List<Double>>> = mapOf(
|
||||||
|
"HC-V1-005" to listOf(
|
||||||
|
listOf(1.5,0.0),
|
||||||
|
listOf(0.0,0.0)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@ import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
|||||||
import com.google.android.datatransport.runtime.dagger.Provides
|
import com.google.android.datatransport.runtime.dagger.Provides
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
|
||||||
@Database(entities = [UserData::class, HemoCubeTestData::class, DeviceData::class], version = 9, exportSchema = false)
|
@Database(entities = [UserData::class, HemoCubeTestData::class, DeviceData::class], version = 11, exportSchema = false)
|
||||||
@TypeConverters(Converters::class)
|
@TypeConverters(Converters::class)
|
||||||
abstract class MyDatabase : RoomDatabase() {
|
abstract class MyDatabase : RoomDatabase() {
|
||||||
abstract fun userDao(): UserDao
|
abstract fun userDao(): UserDao
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ data class HemoCubeTestData(
|
|||||||
var coefficients: String? = "",
|
var coefficients: String? = "",
|
||||||
var classificationResult: String = "",
|
var classificationResult: String = "",
|
||||||
var prdClassification: String = "",
|
var prdClassification: String = "",
|
||||||
|
var errorMessages: String = "",
|
||||||
var batteryLevel: String = "",
|
var batteryLevel: String = "",
|
||||||
var batteryCapacity: String = "",
|
var batteryCapacity: String = "",
|
||||||
var batteryMaxCapacity: String = "",
|
var batteryMaxCapacity: String = "",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.hpostesting.presentation
|
package com.example.hpostesting.presentation
|
||||||
|
|
||||||
|
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
@@ -10,7 +11,7 @@ import android.widget.Toast
|
|||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.example.hpostesting.data.DataHolder
|
import com.example.hpostesting.data.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
|
||||||
import com.example.hpostesting.presentation.hemocube.HemocubeActivity
|
import com.example.hpostesting.presentation.hemocube.HemocubeActivity
|
||||||
import com.example.hpostesting.presentation.testRight.TestRightActivity
|
import com.example.hpostesting.presentation.testRight.TestRightActivity
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
@@ -32,7 +33,7 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
ScanContract()
|
ScanContract()
|
||||||
) { result: ScanIntentResult ->
|
) { result: ScanIntentResult ->
|
||||||
if (result.contents.isNullOrEmpty()) {
|
if (result.contents.isNullOrEmpty()) {
|
||||||
Toast.makeText(this, "Cancelled: Unable to scan, Try Again!!", Toast.LENGTH_LONG).show()
|
Toast.makeText(this, R.string.cancelled_unable_scan, Toast.LENGTH_LONG).show()
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, result.contents)
|
Log.d(TAG, result.contents)
|
||||||
processScannedData(result.contents)
|
processScannedData(result.contents)
|
||||||
@@ -119,16 +120,25 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
applicationContext,
|
applicationContext,
|
||||||
"Kit number is updated, Please Select user before starting test",
|
R.string.kit_updated,
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
|
|
||||||
val i = Intent(applicationContext, DashboardActivity::class.java)
|
val i = Intent(applicationContext, DashboardActivity::class.java)
|
||||||
startActivity(i)
|
startActivity(i)
|
||||||
finish()
|
finish()
|
||||||
|
} else {
|
||||||
|
DataHolder.kitSerial = binding.nameEditText.text.toString()
|
||||||
|
DataHolder.selectedTest?.kitSerial = binding.nameEditText.text.toString()
|
||||||
|
with(sharedPreference.edit()) {
|
||||||
|
putString(Constants.KIT_NUMBER, binding.nameEditText.text.toString())
|
||||||
|
putInt(Constants.KIT_COUNT, 1)
|
||||||
|
apply()
|
||||||
|
}
|
||||||
|
moveToNext()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, "Invalid KIT Number", Toast.LENGTH_LONG).show()
|
Toast.makeText(this, R.string.invalid_kit_number, Toast.LENGTH_LONG).show()
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
if (serialNumber.isNotEmpty() && checkDataNotNull() && isSerialValid(
|
if (serialNumber.isNotEmpty() && checkDataNotNull() && isSerialValid(
|
||||||
@@ -144,7 +154,7 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
moveToNext()
|
moveToNext()
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, "Invalid KIT Number", Toast.LENGTH_LONG).show()
|
Toast.makeText(this, R.string.invalid_kit_number, Toast.LENGTH_LONG).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,7 +210,7 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
private fun checkDataNotNull(): Boolean {
|
private fun checkDataNotNull(): Boolean {
|
||||||
return if (DataHolder.selectedTest?._id == null) {
|
return if (DataHolder.selectedTest?._id == null) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
applicationContext, "Please Select patient before starting test", Toast.LENGTH_SHORT
|
applicationContext, R.string.select_patient, Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
|
|
||||||
val i = Intent(applicationContext, DashboardActivity::class.java)
|
val i = Intent(applicationContext, DashboardActivity::class.java)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.hpostesting.presentation
|
package com.example.hpostesting.presentation
|
||||||
|
|
||||||
|
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.content.*
|
import android.content.*
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
@@ -9,8 +10,6 @@ import android.os.Bundle
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.Button
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.app.ActivityCompat
|
import androidx.core.app.ActivityCompat
|
||||||
@@ -20,7 +19,6 @@ import com.example.hpostesting.data.DataHolder
|
|||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.model.patient.UserData
|
import com.example.hpostesting.data.model.patient.UserData
|
||||||
import com.example.hpostesting.data.model.test.TestType
|
import com.example.hpostesting.data.model.test.TestType
|
||||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
|
||||||
import com.google.android.gms.location.*
|
import com.google.android.gms.location.*
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||||
@@ -138,7 +136,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
Log.d(TAG, "Device NOT Connected")
|
Log.d(TAG, "Device NOT Connected")
|
||||||
Toast.makeText(this, "Device Not Connected", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, R.string.device_not, Toast.LENGTH_SHORT).show()
|
||||||
DataHolder.usbConnected.value = false
|
DataHolder.usbConnected.value = false
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
@@ -226,7 +224,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
) != PackageManager.PERMISSION_GRANTED
|
) != PackageManager.PERMISSION_GRANTED
|
||||||
) {
|
) {
|
||||||
// Handle location permission request if needed
|
// Handle location permission request if needed
|
||||||
Toast.makeText(this, "Please enable location services", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, R.string.enable_location, Toast.LENGTH_SHORT).show()
|
||||||
requestCoarseLocationPermission()
|
requestCoarseLocationPermission()
|
||||||
requestFineLocationPermission()
|
requestFineLocationPermission()
|
||||||
return
|
return
|
||||||
@@ -313,7 +311,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
requestFineLocationPermission()
|
requestFineLocationPermission()
|
||||||
} else {
|
} else {
|
||||||
// Coarse location permission denied
|
// Coarse location permission denied
|
||||||
Toast.makeText(this, "Coarse location permission denied", Toast.LENGTH_SHORT)
|
Toast.makeText(this, R.string.coarse_location_denied, Toast.LENGTH_SHORT)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -324,7 +322,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
getLocation()
|
getLocation()
|
||||||
} else {
|
} else {
|
||||||
// Fine location permission denied
|
// Fine location permission denied
|
||||||
Toast.makeText(this, "Fine location permission denied", Toast.LENGTH_SHORT)
|
Toast.makeText(this, R.string.location_denied, Toast.LENGTH_SHORT)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.hpostesting.presentation
|
package com.example.hpostesting.presentation
|
||||||
|
|
||||||
|
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
@@ -13,11 +14,8 @@ import androidx.annotation.RequiresApi
|
|||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import com.example.hpostesting.data.DataHolder
|
import com.example.hpostesting.data.DataHolder
|
||||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
|
||||||
import com.example.hpostesting.util.MyUtils
|
import com.example.hpostesting.util.MyUtils
|
||||||
import com.google.firebase.firestore.FirebaseFirestoreSettings
|
import `in`.sminnovations.hpostesting.R
|
||||||
import com.google.firebase.firestore.ktx.firestore
|
|
||||||
import com.google.firebase.ktx.Firebase
|
|
||||||
import `in`.sminnovations.hpostesting.databinding.ActivitySplashBinding
|
import `in`.sminnovations.hpostesting.databinding.ActivitySplashBinding
|
||||||
|
|
||||||
class SplashActivity : AppCompatActivity() {
|
class SplashActivity : AppCompatActivity() {
|
||||||
@@ -77,7 +75,7 @@ class SplashActivity : AppCompatActivity() {
|
|||||||
} else {
|
} else {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
this,
|
this,
|
||||||
"You must grant permission to access all files to use the app",
|
R.string.permission_grant,
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
finish()
|
finish()
|
||||||
@@ -139,7 +137,7 @@ class SplashActivity : AppCompatActivity() {
|
|||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
moveToLandingPage()
|
moveToLandingPage()
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, "All permissions are required to use the app.", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, R.string.permission_required, Toast.LENGTH_SHORT).show()
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.example.hpostesting.presentation.adapter
|
package com.example.hpostesting.presentation.adapter
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.res.Resources
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@@ -14,16 +17,20 @@ import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
|||||||
import com.example.hpostesting.data.model.patient.UserData
|
import com.example.hpostesting.data.model.patient.UserData
|
||||||
import `in`.sminnovations.hpostesting.R
|
import `in`.sminnovations.hpostesting.R
|
||||||
import `in`.sminnovations.hpostesting.databinding.OfflineUserListViewBinding
|
import `in`.sminnovations.hpostesting.databinding.OfflineUserListViewBinding
|
||||||
|
import org.apache.commons.collections4.MapUtils.getString
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Calendar
|
import java.util.Calendar
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
|
|
||||||
class OfflineUserListAdapter(private val view: View, private val batLevel: Int) :
|
class OfflineUserListAdapter(private val view: View, private val batLevel: Int) :
|
||||||
RecyclerView.Adapter<OfflineUserListAdapter.OfflineUserListViewHolder>() {
|
RecyclerView.Adapter<OfflineUserListAdapter.OfflineUserListViewHolder>() {
|
||||||
|
|
||||||
inner class OfflineUserListViewHolder(val binding: OfflineUserListViewBinding) :
|
inner class OfflineUserListViewHolder(val binding: OfflineUserListViewBinding) :
|
||||||
RecyclerView.ViewHolder(binding.root)
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private val differCallback = object : DiffUtil.ItemCallback<HemoCubeTestData>() {
|
private val differCallback = object : DiffUtil.ItemCallback<HemoCubeTestData>() {
|
||||||
override fun areItemsTheSame(
|
override fun areItemsTheSame(
|
||||||
@@ -40,7 +47,7 @@ class OfflineUserListAdapter(private val view: View, private val batLevel: Int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
val differ = AsyncListDiffer(this, differCallback)
|
val differ = AsyncListDiffer(this, differCallback)
|
||||||
|
private val context: Context? = null
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): OfflineUserListViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): OfflineUserListViewHolder {
|
||||||
return OfflineUserListViewHolder(
|
return OfflineUserListViewHolder(
|
||||||
OfflineUserListViewBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
OfflineUserListViewBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||||
@@ -51,61 +58,58 @@ class OfflineUserListAdapter(private val view: View, private val batLevel: Int)
|
|||||||
return differ.currentList.size
|
return differ.currentList.size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
override fun onBindViewHolder(holder: OfflineUserListViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: OfflineUserListViewHolder, position: Int) {
|
||||||
val userList = differ.currentList[position]
|
val userList = differ.currentList[position]
|
||||||
holder.binding.apply {
|
holder.binding.apply {
|
||||||
userID.text = "User ID: ${userList._id}"
|
userID.text = "User ID: ${userList._id}"
|
||||||
bloodGroup.text = "Blood group: ${userList.bloodGroup}"
|
bloodGroup.text = "Blood group: ${userList.bloodGroup}"
|
||||||
time.text = "Time: ${userList.incubationTime}"
|
time.text = "Time: ${isBetween15And30Minutes(userList.incubationTime)} \n Started at: ${
|
||||||
|
SimpleDateFormat("HH:mm:ss").format(
|
||||||
|
SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
).parse(userList.incubationTime)!!
|
||||||
|
)
|
||||||
|
}"
|
||||||
|
|
||||||
|
if (userList.testStatus!!) {
|
||||||
|
teststatus.text = view.context.getString(R.string.test_concluded)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
teststatus.text = view.context.getString(R.string.test_pending)
|
||||||
|
}
|
||||||
|
|
||||||
userCard.setOnClickListener {
|
userCard.setOnClickListener {
|
||||||
if (batLevel < 40) {
|
if (batLevel < 40) {
|
||||||
Toast.makeText(
|
showWarningToast(R.string.low_battery_warning)
|
||||||
view.context,
|
} else {
|
||||||
"Battery level is low than 40%, please charge the device to continue testing",
|
if (userList.testStatus != null) {
|
||||||
Toast.LENGTH_SHORT
|
if (userList.testStatus!!) {
|
||||||
).show()
|
showWarningToast(R.string.test_already_conducted)
|
||||||
return@setOnClickListener
|
|
||||||
}
|
|
||||||
if (userList.testStatus != null) {
|
|
||||||
if (userList.testStatus!!) {
|
|
||||||
Toast.makeText(
|
|
||||||
view.context,
|
|
||||||
"Test has been already conducted for this user",
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
).show()
|
|
||||||
} else {
|
|
||||||
if (userList.incubationTime != "") {
|
|
||||||
if (isBetween15And30Minutes(userList.incubationTime) < Constants.INCUBATION_TIME_MIN) {
|
|
||||||
Toast.makeText(
|
|
||||||
view.context,
|
|
||||||
"Incubation has not completed 15 minutes",
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
).show()
|
|
||||||
} else if (isBetween15And30Minutes(userList.incubationTime) > Constants.INCUBATION_TIME_MAX) {
|
|
||||||
Toast.makeText(
|
|
||||||
view.context,
|
|
||||||
"Incubation crossed 30 minutes, need to repeat the incubation",
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
).show()
|
|
||||||
} else {
|
|
||||||
DataHolder.selectedTest = UserData(
|
|
||||||
_id = userList._id,
|
|
||||||
bloodGroup = userList.bloodGroup,
|
|
||||||
incubationTime = userList.incubationTime
|
|
||||||
)
|
|
||||||
view.findNavController()
|
|
||||||
.navigate(R.id.action_nav_home_to_mainActivity)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(
|
if (userList.incubationTime != "") {
|
||||||
view.context,
|
val incubationTimeDiff = isBetween15And30Minutes(userList.incubationTime)
|
||||||
"Incubation not started for this user",
|
if (incubationTimeDiff < 15) {
|
||||||
Toast.LENGTH_SHORT
|
showWarningToast(R.string.incubation_not_completed)
|
||||||
).show()
|
} else if (incubationTimeDiff > 30) {
|
||||||
|
showWarningToast(R.string.incubation_crossed_30_minutes)
|
||||||
|
} else {
|
||||||
|
DataHolder.selectedTest = UserData(
|
||||||
|
_id = userList._id,
|
||||||
|
bloodGroup = userList.bloodGroup,
|
||||||
|
incubationTime = userList.incubationTime
|
||||||
|
)
|
||||||
|
view.findNavController()
|
||||||
|
.navigate(R.id.action_nav_home_to_mainActivity)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showWarningToast(R.string.incubation_not_started)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,4 +123,25 @@ class OfflineUserListAdapter(private val view: View, private val batLevel: Int)
|
|||||||
|
|
||||||
return diffMillis / (60 * 1000)
|
return diffMillis / (60 * 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun showWarningToast(resId: Int) {
|
||||||
|
val contextToUse = view.context ?: return
|
||||||
|
|
||||||
|
val message = try {
|
||||||
|
contextToUse.getString(resId)
|
||||||
|
} catch (e: Resources.NotFoundException) {
|
||||||
|
"Resource not found for ID: $resId"
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.makeText(
|
||||||
|
contextToUse,
|
||||||
|
message,
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -70,10 +70,10 @@ class UserListAdapter(
|
|||||||
|
|
||||||
Glide.with(view).load(model.userImageURL).into(userImage)
|
Glide.with(view).load(model.userImageURL).into(userImage)
|
||||||
if (model.testStatus!!) {
|
if (model.testStatus!!) {
|
||||||
teststatus.text = "Test concluded"
|
teststatus.text = view.context.getString(R.string.test_concluded)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
teststatus.text = "Test is Pending"
|
teststatus.text = view.context.getString(R.string.test_pending)
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.binding.btnBlood.setOnClickListener {
|
holder.binding.btnBlood.setOnClickListener {
|
||||||
@@ -101,12 +101,12 @@ class UserListAdapter(
|
|||||||
builder.setPositiveButton("OK") { dialog, which ->
|
builder.setPositiveButton("OK") { dialog, which ->
|
||||||
val bloodGroup = etBloodGroup.text.toString()
|
val bloodGroup = etBloodGroup.text.toString()
|
||||||
if (bloodGroup.equals("Select Blood Group") || bloodGroup.isNullOrBlank()) {
|
if (bloodGroup.equals("Select Blood Group") || bloodGroup.isNullOrBlank()) {
|
||||||
etBloodGroup.error = "Please enter your blood group"
|
if (view != null) {
|
||||||
Toast.makeText(
|
etBloodGroup.error =view.context.getString(R.string.blood_group_error)
|
||||||
context,
|
}
|
||||||
"Please enter your blood group",
|
if (view != null) {
|
||||||
Toast.LENGTH_SHORT
|
Toast.makeText(context, view.context.getString(R.string.blood_group_toast), Toast.LENGTH_SHORT).show()
|
||||||
).show()
|
}
|
||||||
} else {
|
} else {
|
||||||
// Check if hemoCubeViewModel and testDetails are not null
|
// Check if hemoCubeViewModel and testDetails are not null
|
||||||
val db: FirebaseFirestore = FirebaseFirestore.getInstance()
|
val db: FirebaseFirestore = FirebaseFirestore.getInstance()
|
||||||
@@ -125,27 +125,33 @@ class UserListAdapter(
|
|||||||
).format(Calendar.getInstance().time).toString()
|
).format(Calendar.getInstance().time).toString()
|
||||||
)
|
)
|
||||||
.addOnSuccessListener {
|
.addOnSuccessListener {
|
||||||
Toast.makeText(
|
if (view != null) {
|
||||||
context,
|
Toast.makeText(
|
||||||
"Blood group updated successfully",
|
view.context,
|
||||||
Toast.LENGTH_SHORT
|
context?.getString(R.string.blood_group_updated_successfully),
|
||||||
).show()
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
btnBlood.visibility = View.GONE
|
btnBlood.visibility = View.GONE
|
||||||
}
|
}
|
||||||
.addOnFailureListener { e ->
|
.addOnFailureListener { e ->
|
||||||
Toast.makeText(
|
if (view != null) {
|
||||||
context,
|
Toast.makeText(
|
||||||
"Failed to update blood group: ${e.message}",
|
view.context,
|
||||||
Toast.LENGTH_SHORT
|
context?.getString(R.string.failed_to_update_blood_group),
|
||||||
).show()
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e: IndexOutOfBoundsException) {
|
} catch (e: IndexOutOfBoundsException) {
|
||||||
// Handle the case where no documents are found for the specified ID
|
// Handle the case where no documents are found for the specified ID
|
||||||
Toast.makeText(
|
if (view != null) {
|
||||||
context,
|
Toast.makeText(
|
||||||
"No user data found for the specified ID",
|
view.context,
|
||||||
Toast.LENGTH_SHORT
|
context?.getString(R.string.no_user_data_found),
|
||||||
).show()
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -193,7 +199,7 @@ class UserListAdapter(
|
|||||||
if (batLevel < 40) {
|
if (batLevel < 40) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
view.context,
|
view.context,
|
||||||
"Battery level is low than 40%, please charge the device to continue testing",
|
context?.getString(R.string.low_battery_warning),
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
@@ -202,7 +208,7 @@ class UserListAdapter(
|
|||||||
if (model.testStatus!!) {
|
if (model.testStatus!!) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
view.context,
|
view.context,
|
||||||
"Test has been already conducted for this user",
|
context?.getString(R.string.test_already_conducted),
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
} else {
|
} else {
|
||||||
@@ -210,13 +216,13 @@ class UserListAdapter(
|
|||||||
if (isBetween15And30Minutes(model.incubationTime) < 15) {
|
if (isBetween15And30Minutes(model.incubationTime) < 15) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
view.context,
|
view.context,
|
||||||
"Incubation has not completed 15 minutes",
|
context?.getString(R.string.incubation_not_completed),
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
} else if (isBetween15And30Minutes(model.incubationTime) > 30) {
|
} else if (isBetween15And30Minutes(model.incubationTime) > 30) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
view.context,
|
view.context,
|
||||||
"Incubation crossed 30 minutes, need to repeat the incubation",
|
context?.getString(R.string.incubation_crossed_30_minutes),
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
} else {
|
} else {
|
||||||
@@ -227,7 +233,7 @@ class UserListAdapter(
|
|||||||
} else {
|
} else {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
view.context,
|
view.context,
|
||||||
"Incubation not started for this user",
|
context?.getString(R.string.incubation_not_started),
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import com.example.hpostesting.data.model.patient.BufferCheckData
|
|||||||
import com.example.hpostesting.data.model.patient.DeviceData
|
import com.example.hpostesting.data.model.patient.DeviceData
|
||||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||||
import com.example.hpostesting.presentation.UsbServiceListener
|
import com.example.hpostesting.presentation.UsbServiceListener
|
||||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.example.hpostesting.presentation.utils.MyDialogListener
|
import com.example.hpostesting.presentation.utils.MyDialogListener
|
||||||
import com.example.hpostesting.presentation.utils.UIUtils
|
import com.example.hpostesting.presentation.utils.UIUtils
|
||||||
@@ -73,7 +72,7 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
listenToHemoCube()
|
listenToHemoCube()
|
||||||
startBufferProcess()
|
startBufferProcess()
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(context, "Invalid KIT Number", Toast.LENGTH_LONG).show()
|
Toast.makeText(context, R.string.invalid_kit_number, Toast.LENGTH_LONG).show()
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
@@ -108,17 +107,17 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
hemoCubeViewModel.getDeviceData(sharedPreferences.getString(Constants.USER_ID, ""))
|
hemoCubeViewModel.getDeviceData(sharedPreferences.getString(Constants.USER_ID, ""))
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
requireContext(), "No internet connection avaiable", Toast.LENGTH_SHORT
|
requireContext(), R.string.internt_not, Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
isOnline = isNetworkAvailable
|
isOnline = isNetworkAvailable
|
||||||
}
|
}
|
||||||
hemoCubeViewModel.fireBaseUpload.observe(viewLifecycleOwner) { result ->
|
hemoCubeViewModel.fireBaseUpload.observe(viewLifecycleOwner) { result ->
|
||||||
if (result == "Success") {
|
if (result == "Success") {
|
||||||
showToast("Kit result uploaded successfully")
|
showToast(R.string.kit_uploaded)
|
||||||
}
|
}
|
||||||
if (result == "Local") {
|
if (result == "Local") {
|
||||||
showToast("Kit result uploading failed, note it down manually")
|
showToast(R.string.kit_upload_failed)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.progressBar.visibility = View.GONE
|
binding.progressBar.visibility = View.GONE
|
||||||
@@ -152,7 +151,7 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showToast("test is going on")
|
showToast(R.string.test_ongoing)
|
||||||
Firebase.crashlytics.recordException(e)
|
Firebase.crashlytics.recordException(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -270,17 +269,18 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
return "NULL"
|
return "NULL"
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showToast("error while performing classification")
|
showToast(R.string.error_classification)
|
||||||
Firebase.crashlytics.recordException(e)
|
Firebase.crashlytics.recordException(e)
|
||||||
return "ERROR"
|
return "ERROR"
|
||||||
}
|
}
|
||||||
return "NULL"
|
return "NULL"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showToast(message: String) {
|
private fun showToast(messageResId: Int) {
|
||||||
Toast.makeText(requireContext(), message, Toast.LENGTH_SHORT).show()
|
Toast.makeText(requireContext(), getString(messageResId), Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun startBufferProcess() {
|
private fun startBufferProcess() {
|
||||||
|
|
||||||
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startBuffer,
|
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startBuffer,
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ open class HemocubeBufferCheckActivity : AppCompatActivity() {
|
|||||||
} else {
|
} else {
|
||||||
myMenu?.get(0)?.icon =
|
myMenu?.get(0)?.icon =
|
||||||
ContextCompat.getDrawable(this, R.drawable.ic_baseline_usb_off_24)
|
ContextCompat.getDrawable(this, R.drawable.ic_baseline_usb_off_24)
|
||||||
Toast.makeText(this, "Device is Disconnected", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, R.string.device_disconnected, Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ open class HemocubeBufferCheckActivity : AppCompatActivity() {
|
|||||||
val availableDrivers = UsbSerialProber.getDefaultProber().findAllDrivers(manager)
|
val availableDrivers = UsbSerialProber.getDefaultProber().findAllDrivers(manager)
|
||||||
|
|
||||||
if (availableDrivers.isEmpty()) {
|
if (availableDrivers.isEmpty()) {
|
||||||
Toast.makeText(this, "No device found", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, R.string.no_device_found, Toast.LENGTH_SHORT).show()
|
||||||
} else {
|
} else {
|
||||||
mDriver = availableDrivers[0]
|
mDriver = availableDrivers[0]
|
||||||
mConnection = manager.openDevice(mDriver.device)
|
mConnection = manager.openDevice(mDriver.device)
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ import com.google.android.material.navigation.NavigationView
|
|||||||
import com.google.firebase.appdistribution.FirebaseAppDistribution
|
import com.google.firebase.appdistribution.FirebaseAppDistribution
|
||||||
import com.google.firebase.appdistribution.FirebaseAppDistributionException
|
import com.google.firebase.appdistribution.FirebaseAppDistributionException
|
||||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
|
||||||
//import com.google.firebase.appdistribution.FirebaseAppDistribution
|
|
||||||
//import com.google.firebase.appdistribution.FirebaseAppDistributionException
|
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import `in`.sminnovations.hpostesting.R
|
import `in`.sminnovations.hpostesting.R
|
||||||
import `in`.sminnovations.hpostesting.databinding.ActivityDashboardBinding
|
import `in`.sminnovations.hpostesting.databinding.ActivityDashboardBinding
|
||||||
@@ -59,7 +56,6 @@ class DashboardActivity : AppCompatActivity() {
|
|||||||
return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
|
return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
|
|||||||
@@ -108,12 +108,12 @@ class HomeFragment : Fragment() {
|
|||||||
if (result == "Success") {
|
if (result == "Success") {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
"Test Results Uploaded Successfully",
|
R.string.test_upload,
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
if (result == "Error") {
|
if (result == "Error") {
|
||||||
Toast.makeText(requireContext(), "Test Results Upload Failed", Toast.LENGTH_SHORT)
|
Toast.makeText(requireContext(), R.string.test_upload_failed, Toast.LENGTH_SHORT)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,6 +138,7 @@ class HomeFragment : Fragment() {
|
|||||||
binding.btnSubmit.setOnClickListener {
|
binding.btnSubmit.setOnClickListener {
|
||||||
val userId = binding.userId.text.toString()
|
val userId = binding.userId.text.toString()
|
||||||
val bloodGroup = binding.etBloodGroup.text
|
val bloodGroup = binding.etBloodGroup.text
|
||||||
|
|
||||||
if (userId.length >= 18 && !bloodGroup.equals("Select Blood Group") || !bloodGroup.isNullOrBlank()) {
|
if (userId.length >= 18 && !bloodGroup.equals("Select Blood Group") || !bloodGroup.isNullOrBlank()) {
|
||||||
hemoCubeViewModel.addUser(
|
hemoCubeViewModel.addUser(
|
||||||
HemoCubeTestData(
|
HemoCubeTestData(
|
||||||
@@ -162,10 +163,10 @@ class HomeFragment : Fragment() {
|
|||||||
val dateFormat = SimpleDateFormat("yyyy-MM-dd")
|
val dateFormat = SimpleDateFormat("yyyy-MM-dd")
|
||||||
val currentDate = Date()
|
val currentDate = Date()
|
||||||
val formattedDate = dateFormat.format(currentDate)
|
val formattedDate = dateFormat.format(currentDate)
|
||||||
val query = Firebase.firestore.collection("patientData")
|
// val query = Firebase.firestore.collection("patientData")
|
||||||
.whereGreaterThanOrEqualTo("createdAt", formattedDate)
|
// .whereGreaterThanOrEqualTo("createdAt", formattedDate)
|
||||||
.orderBy("createdAt", Query.Direction.DESCENDING)
|
// .orderBy("createdAt", Query.Direction.DESCENDING)
|
||||||
// val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false)
|
val query = Firebase.firestore.collection("patientData").whereEqualTo("testStatus", false)
|
||||||
query.get().addOnSuccessListener {
|
query.get().addOnSuccessListener {
|
||||||
if (it.documents.isEmpty()) {
|
if (it.documents.isEmpty()) {
|
||||||
binding.pendingTest.visibility = View.VISIBLE
|
binding.pendingTest.visibility = View.VISIBLE
|
||||||
@@ -203,14 +204,14 @@ class HomeFragment : Fragment() {
|
|||||||
|
|
||||||
private fun logoutUser(context: Context) {
|
private fun logoutUser(context: Context) {
|
||||||
val builder = AlertDialog.Builder(context)
|
val builder = AlertDialog.Builder(context)
|
||||||
builder.setTitle("Log Out")
|
builder.setTitle(R.string.log_out)
|
||||||
builder.setMessage("Do you want to LogOut the Application?")
|
builder.setMessage(R.string.do_log_out)
|
||||||
builder.setPositiveButton("Yes") { dialog, _ ->
|
builder.setPositiveButton(R.string.yes) { dialog, _ ->
|
||||||
saveUserId("")
|
saveUserId("")
|
||||||
findNavController().navigate(R.id.action_nav_home_to_loginFragment)
|
findNavController().navigate(R.id.action_nav_home_to_loginFragment)
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
builder.setNegativeButton("No") { dialog, _ ->
|
builder.setNegativeButton(R.string.no) { dialog, _ ->
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
package com.example.hpostesting.presentation.dashboard
|
package com.example.hpostesting.presentation.dashboard
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@@ -7,11 +6,10 @@ import android.view.ViewGroup
|
|||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import com.example.hpostesting.presentation.dashboard.ui.slideshow.SlideshowViewModel
|
import com.example.hpostesting.presentation.dashboard.ui.slideshow.SlideshowViewModel
|
||||||
|
|
||||||
import `in`.sminnovations.hpostesting.databinding.FragmentSlideshowBinding
|
import `in`.sminnovations.hpostesting.databinding.FragmentSlideshowBinding
|
||||||
|
|
||||||
|
|
||||||
class SlideshowFragment : Fragment() {
|
class SlideshowFragment : Fragment() {
|
||||||
|
|
||||||
private var _binding: FragmentSlideshowBinding? = null
|
private var _binding: FragmentSlideshowBinding? = null
|
||||||
|
|
||||||
// This property is only valid between onCreateView and
|
// This property is only valid between onCreateView and
|
||||||
|
|||||||
@@ -47,10 +47,10 @@ class LoginFragment : Fragment() {
|
|||||||
performLogin(loginId, password)
|
performLogin(loginId, password)
|
||||||
} else {
|
} else {
|
||||||
if (loginId.isBlank()) {
|
if (loginId.isBlank()) {
|
||||||
binding.loginId.error = "Please enter a proper Login ID"
|
binding.loginId.error = R.string.enter_proper_login_id.toString()
|
||||||
}
|
}
|
||||||
if (password.isBlank()) {
|
if (password.isBlank()) {
|
||||||
binding.password.error = "Please enter a proper password"
|
binding.password.error = R.string.enter_proper_password.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,10 +72,10 @@ class LoginFragment : Fragment() {
|
|||||||
navigateToHomeFragment()
|
navigateToHomeFragment()
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(requireContext(), "Wrong Password", Toast.LENGTH_SHORT).show()
|
Toast.makeText(requireContext(), R.string.wrong_password, Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Toast.makeText(requireContext(), "Wrong UserID", Toast.LENGTH_SHORT).show()
|
Toast.makeText(requireContext(), R.string.wrong_user_id, Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun saveUserId(userId: String) {
|
private fun saveUserId(userId: String) {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import android.content.Intent
|
|||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.util.Log
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.FrameLayout
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
@@ -20,7 +20,6 @@ import com.example.hpostesting.data.model.patient.DeviceData
|
|||||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||||
import com.example.hpostesting.presentation.UsbServiceListener
|
import com.example.hpostesting.presentation.UsbServiceListener
|
||||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||||
import androidx.navigation.fragment.findNavController
|
|
||||||
import com.example.hpostesting.presentation.utils.MyDialogListener
|
import com.example.hpostesting.presentation.utils.MyDialogListener
|
||||||
import com.example.hpostesting.presentation.utils.UIUtils
|
import com.example.hpostesting.presentation.utils.UIUtils
|
||||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||||
@@ -35,29 +34,16 @@ class HemoCubeFragment : Fragment() {
|
|||||||
private lateinit var binding: FragmentHemoCubeReferenceBinding
|
private lateinit var binding: FragmentHemoCubeReferenceBinding
|
||||||
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
||||||
private lateinit var sharedPreferences: SharedPreferences
|
private lateinit var sharedPreferences: SharedPreferences
|
||||||
private val testDetails = DataHolder.selectedTest?.toHemoCubeTestData()
|
val testDetails = DataHolder.selectedTest?.toHemoCubeTestData()
|
||||||
private var isOnline = false
|
private var isOnline = false
|
||||||
private var currentDeviceData: DeviceData? = null
|
private var currentDeviceData: DeviceData? = null
|
||||||
private var resultData: String = ""
|
private var resultData: String = ""
|
||||||
|
private var deviceSerialNo: String = ""
|
||||||
|
private var coefficient: String? = ""
|
||||||
private var isUsingExistingBuffer = false
|
private var isUsingExistingBuffer = false
|
||||||
private var isTestOngoing = false
|
private var isTestOngoing = false
|
||||||
private var startListening = MutableLiveData<Boolean>(false)
|
private var startListening = MutableLiveData<Boolean>(false)
|
||||||
private val testingTrace = Firebase.performance.newTrace("testing_trace")
|
val testingTrace = Firebase.performance.newTrace("testing_trace")
|
||||||
private var led1BufferForDevice = 0.0
|
|
||||||
private var led2BufferForDevice = 0.0
|
|
||||||
private var led3BufferForDevice = 0.0
|
|
||||||
private var led4BufferForDevice = 0.0
|
|
||||||
private var led1SampleForDevice = 0.0
|
|
||||||
private var led2SampleForDevice = 0.0
|
|
||||||
private var led3SampleForDevice = 0.0
|
|
||||||
private var led4SampleForDevice = 0.0
|
|
||||||
private var fittedAbs1 = 0.0
|
|
||||||
private var fittedAbs2 = 0.0
|
|
||||||
private var fittedAbs3 = 0.0
|
|
||||||
private var fittedAbs4 = 0.0
|
|
||||||
private var _predictedDenovixRatio = 0.0
|
|
||||||
private var validationError = false
|
|
||||||
private var deviceHardwareId = ""
|
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
||||||
@@ -71,9 +57,8 @@ class HemoCubeFragment : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
initViews()
|
initViews()
|
||||||
listenToHemoCube()
|
|
||||||
getDeviceInfo()
|
|
||||||
observeViewModel()
|
observeViewModel()
|
||||||
|
checkAndStartProcess()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initViews() {
|
private fun initViews() {
|
||||||
@@ -85,6 +70,11 @@ class HemoCubeFragment : Fragment() {
|
|||||||
isOnline, true, sharedPreferences.getString(Constants.KIT_NUMBER, "")
|
isOnline, true, sharedPreferences.getString(Constants.KIT_NUMBER, "")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (isTestOngoing) {
|
||||||
|
// binding.btnKit.visibility = View.GONE
|
||||||
|
// binding.btnKit.isEnabled = false
|
||||||
|
// binding.btnKit.isClickable = false
|
||||||
|
}
|
||||||
|
|
||||||
binding.tvTitle2.visibility = View.GONE
|
binding.tvTitle2.visibility = View.GONE
|
||||||
binding.etAbhaId.visibility = View.GONE
|
binding.etAbhaId.visibility = View.GONE
|
||||||
@@ -93,52 +83,20 @@ class HemoCubeFragment : Fragment() {
|
|||||||
binding.btnGo.visibility = View.GONE
|
binding.btnGo.visibility = View.GONE
|
||||||
// binding.btnSubmit.isEnabled = false
|
// binding.btnSubmit.isEnabled = false
|
||||||
// binding.btnSubmit.isClickable = false
|
// binding.btnSubmit.isClickable = false
|
||||||
binding.btnPlacebuffer.visibility = View.GONE
|
|
||||||
|
|
||||||
binding.tvName.text = "Name: ${testDetails?.name}\n ID: ${testDetails?._id}"
|
binding.tvName.text = "Name: ${testDetails?.name}\n ID: ${testDetails?._id}"
|
||||||
binding.tvSubtitle4.text = "Config"
|
Log.e("nametext", binding.tvName.text.toString())
|
||||||
|
|
||||||
binding.btnSamplestart.setOnClickListener {
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.tvSubtitle4.visibility = View.VISIBLE
|
|
||||||
// binding.tvSubtitle4.text = "Sample Started"
|
|
||||||
}
|
|
||||||
startSampleProcess()
|
|
||||||
it.visibility = View.GONE
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.btnPlacebuffer.setOnClickListener {
|
|
||||||
if (isBufferValueAvailable()) {
|
|
||||||
showBufferAlertDialog()
|
|
||||||
} else {
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.tvSubtitle4.visibility = View.VISIBLE
|
|
||||||
// binding.tvSubtitle4.text = "Buffer Started"
|
|
||||||
}
|
|
||||||
|
|
||||||
checkAndStartProcess()
|
|
||||||
it.visibility = View.GONE
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun observeViewModel() {
|
private fun observeViewModel() {
|
||||||
hemoCubeViewModel.fireBaseUpload.observe(viewLifecycleOwner) { result ->
|
hemoCubeViewModel.fireBaseUpload.observe(viewLifecycleOwner) { result ->
|
||||||
if (result == "Success") {
|
if (result == "Success") {
|
||||||
showToast("Test Results Uploaded Successfully")
|
showToast("Test Results Uploaded Successfully")
|
||||||
|
val i = Intent(
|
||||||
activity?.runOnUiThread {
|
requireContext().applicationContext, DashboardActivity::class.java
|
||||||
binding.btnSubmit.visibility = View.GONE
|
)
|
||||||
binding.btnDigitalCard.visibility = View.VISIBLE
|
startActivity(i)
|
||||||
binding.btnDigitalCard.setOnClickListener {
|
(activity as HemocubeActivity).finish()
|
||||||
val i = Intent(
|
|
||||||
requireContext().applicationContext, DigitalCardActivity::class.java
|
|
||||||
)
|
|
||||||
startActivity(i)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (result == "Local") {
|
if (result == "Local") {
|
||||||
showToast("Internet not available, test details stored locally")
|
showToast("Internet not available, test details stored locally")
|
||||||
@@ -160,13 +118,25 @@ class HemoCubeFragment : Fragment() {
|
|||||||
|
|
||||||
hemoCubeViewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isNetworkAvailable ->
|
hemoCubeViewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isNetworkAvailable ->
|
||||||
apply {
|
apply {
|
||||||
DataHolder.hemoCubeTestData?.let {
|
// if (isNetworkAvailable) {
|
||||||
currentDeviceData?.coefficients?.let { coefficients ->
|
// Online mode
|
||||||
val coefficient1 = coefficients[0]
|
DataHolder.hemoCubeTestData?.let {
|
||||||
val coefficient2 = coefficients[1]
|
currentDeviceData?.coefficients?.let { coefficients ->
|
||||||
val result = coefficient1 * coefficient2
|
val coefficient1 = coefficients[0]
|
||||||
|
val coefficient2 = coefficients[1]
|
||||||
|
val result = coefficient1 * coefficient2
|
||||||
|
// Process result in online mode
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
// } else {
|
||||||
|
// // Offline mode
|
||||||
|
// val coefficient1 = Constants.COEFFICIENTS[deviceSerialNo]?.get(0)?.get(0).toString().toDoubleOrNull() ?: 0.0
|
||||||
|
// val coefficient2 = Constants.COEFFICIENTS[deviceSerialNo]?.get(1)?.get(0).toString().toDoubleOrNull() ?: 0.0
|
||||||
|
// val result = coefficient1 * coefficient2
|
||||||
|
//
|
||||||
|
// // Process result in offline mode
|
||||||
|
// }
|
||||||
|
|
||||||
isOnline = isNetworkAvailable
|
isOnline = isNetworkAvailable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,39 +144,42 @@ class HemoCubeFragment : Fragment() {
|
|||||||
hemoCubeViewModel.messages.observe(viewLifecycleOwner) {
|
hemoCubeViewModel.messages.observe(viewLifecycleOwner) {
|
||||||
binding.tvSubtitle4.text = it
|
binding.tvSubtitle4.text = it
|
||||||
}
|
}
|
||||||
|
// startListening.observe(viewLifecycleOwner) {
|
||||||
|
// if (it) {
|
||||||
|
// lifecycleScope.launch {
|
||||||
|
// delay(1000)
|
||||||
|
// if (binding.tvSubtitle4.text.toString().isEmpty()) {
|
||||||
|
// (activity as HemocubeActivity).reconnectDevice()
|
||||||
|
// if (isBufferValueAvailable()) {
|
||||||
|
// showBufferAlertDialog()
|
||||||
|
// } else {
|
||||||
|
// listenToHemoCube()
|
||||||
|
// startBufferProcess()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkAndStartProcess() {
|
private fun checkAndStartProcess() {
|
||||||
startBufferProcess()
|
if (isBufferValueAvailable()) {
|
||||||
|
showBufferAlertDialog()
|
||||||
|
} else {
|
||||||
|
listenToHemoCube()
|
||||||
|
startBufferProcess()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isBufferValueAvailable(): Boolean {
|
private fun isBufferValueAvailable(): Boolean {
|
||||||
return try {
|
return if (sharedPreferences.getString(
|
||||||
if (sharedPreferences.getString(
|
Constants.BUFFER_VALUE_1, ""
|
||||||
Constants.BUFFER_VALUE_1, ""
|
) != "" && sharedPreferences.getString(Constants.BUFFER_VALUE_2, "") != ""
|
||||||
) != "" && sharedPreferences.getString(Constants.BUFFER_VALUE_2, "") != ""
|
) {
|
||||||
&& sharedPreferences.getString(Constants.BUFFER_VALUE_3, "") != ""
|
sharedPreferences.getString(Constants.BUFFER_VALUE_1, "")
|
||||||
&& sharedPreferences.getString(Constants.BUFFER_VALUE_4, "") != ""
|
?.toDouble()!! > 0.0 && sharedPreferences.getString(Constants.BUFFER_VALUE_2, "")
|
||||||
) {
|
?.toDouble()!! > 0.0
|
||||||
sharedPreferences.getString(Constants.BUFFER_VALUE_1, "")
|
} else {
|
||||||
?.toDouble()!! > 0.0 && sharedPreferences.getString(
|
|
||||||
Constants.BUFFER_VALUE_2,
|
|
||||||
""
|
|
||||||
)
|
|
||||||
?.toDouble()!! > 0.0 && sharedPreferences.getString(
|
|
||||||
Constants.BUFFER_VALUE_3,
|
|
||||||
""
|
|
||||||
)
|
|
||||||
?.toDouble()!! > 0.0 && sharedPreferences.getString(
|
|
||||||
Constants.BUFFER_VALUE_4,
|
|
||||||
""
|
|
||||||
)
|
|
||||||
?.toDouble()!! > 0.0
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
showToast("error while getting existing buffer")
|
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,15 +197,13 @@ class HemoCubeFragment : Fragment() {
|
|||||||
positiveText,
|
positiveText,
|
||||||
object : MyDialogListener {
|
object : MyDialogListener {
|
||||||
override fun onClickNegativeButton() {
|
override fun onClickNegativeButton() {
|
||||||
|
listenToHemoCube()
|
||||||
startBufferProcess()
|
startBufferProcess()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClickPositiveButton() {
|
override fun onClickPositiveButton() {
|
||||||
activity?.runOnUiThread {
|
listenToHemoCube()
|
||||||
binding.btnPlacebuffer.visibility = View.GONE
|
startSampleProcess()
|
||||||
binding.btnSamplestart.visibility = View.VISIBLE
|
|
||||||
binding.tvSubtitle4.text = "Place Sample"
|
|
||||||
}
|
|
||||||
isUsingExistingBuffer = true
|
isUsingExistingBuffer = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -268,118 +239,42 @@ class HemoCubeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getDeviceInfo() {
|
|
||||||
hemoCubeViewModel.progressBar.postValue(true)
|
|
||||||
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(
|
|
||||||
HemoCubeCommands.getDeviceId,
|
|
||||||
object : UsbServiceListener {
|
|
||||||
override fun onUsbRead(data: ByteArray?) {
|
|
||||||
data?.let {
|
|
||||||
val stringData = String(it)
|
|
||||||
hemoCubeViewModel.messages.postValue(stringData)
|
|
||||||
binding.tvSubtitle4.text = stringData
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onUsbError(e: Exception?) {
|
|
||||||
hemoCubeViewModel.progressBar.postValue(false)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun handleUsbData(stringData: String, fullReadOutput: StringBuilder) {
|
private fun handleUsbData(stringData: String, fullReadOutput: StringBuilder) {
|
||||||
if (stringData.contains("#")) {
|
if (stringData.contains("#")) {
|
||||||
|
hemoCubeViewModel.messages.postValue(stringData)
|
||||||
isTestOngoing = true
|
isTestOngoing = true
|
||||||
}
|
}
|
||||||
|
|
||||||
resultData += stringData
|
resultData += stringData
|
||||||
|
|
||||||
when {
|
when {
|
||||||
stringData.contains("SN") -> {
|
stringData.contains("#Buffer Completed") -> showStartSampleDialog()
|
||||||
val slData = stringData.split(" ")
|
stringData.contains("#Sample Completed") -> {
|
||||||
if (slData.size > 1) {
|
|
||||||
val hardwareId = slData[1].trim()
|
|
||||||
deviceHardwareId = hardwareId
|
|
||||||
with(sharedPreferences.edit()) {
|
|
||||||
putString(Constants.DEVICE_ID, hardwareId)
|
|
||||||
apply()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.btnPlacebuffer.visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
hemoCubeViewModel.messages.postValue("Start")
|
|
||||||
}
|
|
||||||
|
|
||||||
stringData.contains("#BS") -> {
|
|
||||||
hemoCubeViewModel.messages.postValue("Buffer Started")
|
|
||||||
}
|
|
||||||
|
|
||||||
stringData.contains("#BC") -> {
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.tvSubtitle4.text = "Buffer Completed"
|
|
||||||
binding.btnSamplestart.visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stringData.contains("#SS") -> {
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.tvSubtitle4.text = "Sample Started"
|
|
||||||
binding.btnSamplestart.visibility = View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stringData.contains("#SC") -> {
|
|
||||||
hemoCubeViewModel.messages.postValue("Sample Completed \nGathering data")
|
|
||||||
fetchResult()
|
fetchResult()
|
||||||
testingTrace.stop()
|
testingTrace.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
resultData.contains("REND") -> {
|
stringData.contains("RESULT") || resultData.contains("REND") -> {
|
||||||
hemoCubeViewModel.messages.postValue(
|
var validString: String
|
||||||
"Data collected \n" +
|
val results: List<String>
|
||||||
" Processing data"
|
if (stringData.contains("RESULT")) {
|
||||||
)
|
validString = isValidResult(stringData)
|
||||||
val resultLines = resultData.split("\\s+(?=LB|LS)".toRegex())
|
if (validString.isEmpty()) {
|
||||||
var bufferIntensity = resultLines[1].split(' ')[1].trim()
|
results = resultData.split("\n")
|
||||||
led1BufferForDevice = if (isUsingExistingBuffer) {
|
validString = parseResult(results)
|
||||||
sharedPreferences.getString(Constants.BUFFER_VALUE_1, "")?.toDoubleOrNull()!!
|
}
|
||||||
} else {
|
} else {
|
||||||
bufferIntensity.toDoubleOrNull()!!
|
results = resultData.split("\n")
|
||||||
|
validString = parseResult(results)
|
||||||
}
|
}
|
||||||
bufferIntensity = resultLines[2].split(' ')[1].trim()
|
if (validString.isNotEmpty()) {
|
||||||
led2BufferForDevice = if (isUsingExistingBuffer) {
|
handleValidResult(validString, resultData)
|
||||||
sharedPreferences.getString(Constants.BUFFER_VALUE_2, "")?.toDoubleOrNull()!!
|
|
||||||
} else {
|
|
||||||
bufferIntensity.toDoubleOrNull()!!
|
|
||||||
}
|
}
|
||||||
bufferIntensity = resultLines[3].split(' ')[1].trim()
|
|
||||||
led3BufferForDevice = if (isUsingExistingBuffer) {
|
|
||||||
sharedPreferences.getString(Constants.BUFFER_VALUE_3, "")?.toDoubleOrNull()!!
|
|
||||||
} else {
|
|
||||||
bufferIntensity.toDoubleOrNull()!!
|
|
||||||
}
|
|
||||||
bufferIntensity = resultLines[4].split(' ')[1].trim()
|
|
||||||
led4BufferForDevice = if (isUsingExistingBuffer) {
|
|
||||||
sharedPreferences.getString(Constants.BUFFER_VALUE_4, "")?.toDoubleOrNull()!!
|
|
||||||
} else {
|
|
||||||
bufferIntensity.toDoubleOrNull()!!
|
|
||||||
}
|
|
||||||
|
|
||||||
var sampleIntensity = resultLines[5].split(' ')[1].trim()
|
|
||||||
led1SampleForDevice = resultLines[5].split(' ')[1].trim().toDoubleOrNull()!!
|
|
||||||
sampleIntensity = resultLines[6].split(' ')[1].trim()
|
|
||||||
led2SampleForDevice = resultLines[6].split(' ')[1].trim().toDoubleOrNull()!!
|
|
||||||
sampleIntensity = resultLines[7].split(' ')[1].trim()
|
|
||||||
led3SampleForDevice = resultLines[7].split(' ')[1].trim().toDoubleOrNull()!!
|
|
||||||
sampleIntensity = resultLines[8].split(' ')[1].split('\r')[0].trim()
|
|
||||||
led4SampleForDevice =
|
|
||||||
resultLines[8].split(' ')[1].split('\r')[0].trim().toDoubleOrNull()!!
|
|
||||||
processResult()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun showError() {
|
private fun showError() {
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
UIUtils.createAlertDialog(requireContext(),
|
UIUtils.createAlertDialog(requireContext(),
|
||||||
@@ -409,134 +304,112 @@ class HemoCubeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun processResult() {
|
private fun showStartSampleDialog() {
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
UIUtils.createAlertDialog(requireContext(),
|
||||||
|
"Start Sample",
|
||||||
|
"Do you want to start sample reading?",
|
||||||
|
getString(R.string.no),
|
||||||
|
"Yes",
|
||||||
|
object : MyDialogListener {
|
||||||
|
override fun onClickNegativeButton() {}
|
||||||
|
|
||||||
|
override fun onClickPositiveButton() {
|
||||||
|
listenToHemoCube()
|
||||||
|
startSampleProcess()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun handleValidResult(validString: String, fullReadOutput: String) {
|
||||||
try {
|
try {
|
||||||
hemoCubeViewModel.messages.postValue("processing result")
|
val result = validString.split(" ")
|
||||||
val deviceLog = resultData
|
val deviceLog = resultData
|
||||||
|
if (result.size == 8) {
|
||||||
val pInfo = requireActivity().packageManager.getPackageInfo(
|
val deviceSerialNo = result[2]
|
||||||
requireActivity().packageName, 0
|
|
||||||
)
|
|
||||||
val version = pInfo.versionName
|
|
||||||
|
|
||||||
val led1Average = log10(led1BufferForDevice?.div(led1SampleForDevice!!) ?: 0.0)
|
|
||||||
val led2Average = log10(led2BufferForDevice?.div(led2SampleForDevice!!) ?: 0.0)
|
|
||||||
val led3Average = log10(led3BufferForDevice?.div(led3SampleForDevice!!) ?: 0.0)
|
|
||||||
val led4Average = log10(led4BufferForDevice?.div(led4SampleForDevice!!) ?: 0.0)
|
|
||||||
val deviceRatio = led3Average / led1Average
|
|
||||||
|
|
||||||
if (led1BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(0)?.get(0)!!
|
|
||||||
|| led2BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(1)?.get(0)!!
|
|
||||||
|| led3BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(2)?.get(0)!!
|
|
||||||
|| led4BufferForDevice < Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(3)?.get(0)!!
|
|
||||||
) {
|
|
||||||
validationError = true
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.errorMessage.text = "Error: Invalid Test. Improper buffer reading (low)"
|
|
||||||
binding.errorMessage.visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (led1BufferForDevice > Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(0)?.get(1)!!
|
|
||||||
|| led2BufferForDevice > Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(1)?.get(1)!!
|
|
||||||
|| led3BufferForDevice > Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(2)?.get(1)!!
|
|
||||||
|| led4BufferForDevice > Constants.BUFFER_INTENSITY_THRESHOLDS[deviceHardwareId]?.get(3)?.get(1)!!
|
|
||||||
) {
|
|
||||||
validationError = true
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.errorMessage.text =
|
|
||||||
"Error: Invalid Test. Improper buffer reading (high)"
|
|
||||||
binding.errorMessage.visibility = View.VISIBLE
|
|
||||||
binding.btnSubmit.isEnabled = true
|
|
||||||
binding.btnSubmit.isClickable = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var gradient = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(0)?.get(0)
|
|
||||||
var constant = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(0)?.get(1)
|
|
||||||
fittedAbs1 = gradient?.times(led1Average)?.plus(constant!!)!!
|
|
||||||
|
|
||||||
gradient = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(1)?.get(0)
|
|
||||||
constant = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(1)?.get(1)
|
|
||||||
fittedAbs2 = gradient?.times(led2Average)?.plus(constant!!)!!
|
|
||||||
|
|
||||||
gradient = Constants.DEVICE_CONFIGURATION[deviceHardwareId]?.get(2)?.get(0)
|
|
||||||
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)
|
|
||||||
fittedAbs4 = gradient?.times(led4Average)?.plus(constant!!)!!
|
|
||||||
|
|
||||||
_predictedDenovixRatio = fittedAbs3?.div(fittedAbs1!!)!!
|
|
||||||
|
|
||||||
if (fittedAbs1!! <= fittedAbs2!!) {
|
|
||||||
validationError = true
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.errorMessage.text = "Error: Invalid Test. Problem with de-oxygenation"
|
|
||||||
binding.errorMessage.visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fittedAbs1 < 0 || fittedAbs2 < 0 || fittedAbs3 < 0 || fittedAbs4 < 0) {
|
|
||||||
validationError = true
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.errorMessage.text = "Error: Negative Abs. Retake Blank Reading"
|
|
||||||
binding.errorMessage.visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DataHolder.hemoCubeTestData?.apply {
|
|
||||||
deviceId = sharedPreferences.getString(Constants.DEVICE_ID, "").toString()
|
|
||||||
led1Buffer = led1BufferForDevice
|
|
||||||
led2Buffer = led2BufferForDevice
|
|
||||||
led3Buffer = led3BufferForDevice
|
|
||||||
led4Buffer = led4BufferForDevice
|
|
||||||
appVersion = version
|
|
||||||
this.led1Sample = led1SampleForDevice
|
|
||||||
this.led2Sample = led2SampleForDevice
|
|
||||||
this.led3Sample = led3SampleForDevice
|
|
||||||
this.led4Sample = led4SampleForDevice
|
|
||||||
this.led1Average = led1Average
|
|
||||||
this.led2Average = led2Average
|
|
||||||
this.led3Average = led3Average
|
|
||||||
this.led4Average = led4Average
|
|
||||||
this.abs1 = fittedAbs1
|
|
||||||
this.abs2 = fittedAbs2
|
|
||||||
this.abs3 = fittedAbs3
|
|
||||||
this.abs4 = fittedAbs4
|
|
||||||
this.deviceRatio = deviceRatio
|
|
||||||
this.calculatedRatio = calculateRatio(deviceRatio)
|
|
||||||
this.predictedDenovixRatio = _predictedDenovixRatio
|
|
||||||
this.coefficients = currentDeviceData?.coefficients?.get(0)
|
|
||||||
.toString() + ", " + currentDeviceData?.coefficients?.get(1).toString()
|
|
||||||
this.classificationResult = findResult(calculatedRatio)
|
|
||||||
this.prdClassification = absorbanceBasedClassification(predictedDenovixRatio)
|
|
||||||
hemoCubeViewModel.messages.postValue(this.prdClassification)
|
|
||||||
this.resultData = deviceLog
|
|
||||||
this.batteryLevel = hemoCubeViewModel.getBatteryLevel().toString()
|
|
||||||
this.batteryCapacity = hemoCubeViewModel.getBatteryCapacity(requireContext()).toString()
|
|
||||||
this.batteryMaxCapacity = hemoCubeViewModel.getBatteryMaxCapacity(requireContext()).toString()
|
|
||||||
this.batteryTemperature = hemoCubeViewModel.getBatteryTemperature().toString()
|
|
||||||
this.batteryVoltage = hemoCubeViewModel.getBatteryVoltage(requireContext()).toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isUsingExistingBuffer) {
|
|
||||||
with(sharedPreferences.edit()) {
|
with(sharedPreferences.edit()) {
|
||||||
putString(Constants.BUFFER_VALUE_1, led1BufferForDevice.toString())
|
putString(Constants.DEVICE_ID, deviceSerialNo)
|
||||||
putString(Constants.BUFFER_VALUE_2, led2BufferForDevice.toString())
|
|
||||||
putString(Constants.BUFFER_VALUE_3, led3BufferForDevice.toString())
|
|
||||||
putString(Constants.BUFFER_VALUE_4, led4BufferForDevice.toString())
|
|
||||||
apply()
|
apply()
|
||||||
}
|
}
|
||||||
}
|
val loginId = sharedPreferences.getString(Constants.USER_ID, "").toString()
|
||||||
|
if (checkDeviceIdMismatch(deviceSerialNo, loginId)) {
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.errorMessage.text = "Warning: Login Id is different"
|
||||||
|
binding.errorMessage.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val led1BufferForDevice = if (isUsingExistingBuffer) {
|
||||||
|
sharedPreferences.getString(Constants.BUFFER_VALUE_1, "")?.toDoubleOrNull()
|
||||||
|
} else {
|
||||||
|
result[3].toDoubleOrNull()
|
||||||
|
}
|
||||||
|
val led2BufferForDevice = if (isUsingExistingBuffer) {
|
||||||
|
sharedPreferences.getString(Constants.BUFFER_VALUE_2, "")?.toDoubleOrNull()
|
||||||
|
} else {
|
||||||
|
result[4].toDoubleOrNull()
|
||||||
|
}
|
||||||
|
val pInfo = requireActivity().packageManager.getPackageInfo(
|
||||||
|
requireActivity().packageName, 0
|
||||||
|
)
|
||||||
|
val version = pInfo.versionName
|
||||||
|
val led1Sample = result[5].toDoubleOrNull()
|
||||||
|
val led2Sample = result[6].toDoubleOrNull()
|
||||||
|
val led1Average = log10(led1BufferForDevice?.div(led1Sample!!) ?: 0.0)
|
||||||
|
val led2Average = log10(led2BufferForDevice?.div(led2Sample!!) ?: 0.0)
|
||||||
|
val deviceRatio = led1Average / led2Average
|
||||||
|
val coefficientsList = Constants.COEFFICIENTS[deviceSerialNo]
|
||||||
|
// if (coefficientsList != null) {
|
||||||
|
val coefficient1 = coefficientsList?.get(0)?.get(0).toString()
|
||||||
|
val coefficient2 = coefficientsList?.get(1)?.get(0).toString()
|
||||||
|
val coefficientsString = "$coefficient1,$coefficient2"
|
||||||
|
|
||||||
if (!validationError) {
|
// if (led1BufferForDevice!! > 20000 && led1BufferForDevice < 24000 && led2BufferForDevice!! > 20000 && led2BufferForDevice < 24000) {
|
||||||
activity?.runOnUiThread {
|
// if (led1Sample!! < led1BufferForDevice && led1Sample < 24000 && led2Sample!! < led2BufferForDevice && led2Sample < 24000) {
|
||||||
binding.btnSubmit.visibility = View.VISIBLE
|
// if (deviceRatio < 0.08) {
|
||||||
binding.btnSubmit.isEnabled = true
|
// if (deviceRatio > 1.07) {
|
||||||
binding.btnSubmit.isClickable = true
|
//
|
||||||
binding.clParent.setBackgroundColor(Color.parseColor("#edfffd"))
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (led1Average < 0 || led2Average < 0) {
|
||||||
|
activity?.runOnUiThread{
|
||||||
|
binding.errorMessage.text = "Warning: Negative Abs. Retake Blank Reading"
|
||||||
|
binding.errorMessage.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DataHolder.hemoCubeTestData?.apply {
|
||||||
|
deviceId = deviceSerialNo
|
||||||
|
led1Buffer = led1BufferForDevice
|
||||||
|
led2Buffer = led2BufferForDevice
|
||||||
|
appVersion = version
|
||||||
|
this.led1Sample = led1Sample
|
||||||
|
this.led2Sample = led2Sample
|
||||||
|
this.led1Average = led1Average
|
||||||
|
this.led2Average = led2Average
|
||||||
|
this.deviceRatio = deviceRatio
|
||||||
|
this.calculatedRatio = calculateRatio(deviceRatio)
|
||||||
|
// this.coefficients = currentDeviceData?.coefficients?.get(0).toString() + ", " + currentDeviceData?.coefficients?.get(1).toString()
|
||||||
|
this.coefficients = coefficientsString
|
||||||
|
this.classificationResult = findResult(calculatedRatio)
|
||||||
|
hemoCubeViewModel.messages.postValue(this.classificationResult)
|
||||||
|
this.resultData = deviceLog
|
||||||
|
if (!isUsingExistingBuffer) {
|
||||||
|
with(sharedPreferences.edit()) {
|
||||||
|
putString(Constants.BUFFER_VALUE_1, led1Buffer.toString())
|
||||||
|
putString(Constants.BUFFER_VALUE_2, led2Buffer.toString())
|
||||||
|
apply()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.btnSubmit.visibility = View.VISIBLE
|
||||||
|
binding.btnSubmit.isEnabled = true
|
||||||
|
binding.btnSubmit.isClickable = true
|
||||||
|
binding.clParent.setBackgroundColor(Color.parseColor("#edfffd"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -549,9 +422,8 @@ class HemoCubeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun findResult(calculatedRatio: Double?): String {
|
private fun findResult(calculatedRatio: Double?): String {
|
||||||
try {
|
try {
|
||||||
hemoCubeViewModel.messages.postValue("result classification")
|
|
||||||
if (calculatedRatio != null) {
|
if (calculatedRatio != null) {
|
||||||
if (calculatedRatio < 0.05)
|
if (calculatedRatio < 0.05)
|
||||||
return "Inconclusive. Very low Absorbance - Repeat test with Higher Blood Volume"
|
return "Inconclusive. Very low Absorbance - Repeat test with Higher Blood Volume"
|
||||||
@@ -568,39 +440,14 @@ class HemoCubeFragment : Fragment() {
|
|||||||
if (calculatedRatio > 0.35)
|
if (calculatedRatio > 0.35)
|
||||||
return "Inconclusive. Repeat with test with lower volume of blood"
|
return "Inconclusive. Repeat with test with lower volume of blood"
|
||||||
} else {
|
} else {
|
||||||
return "INVALID"
|
return "NULL"
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showToast("error while performing classification")
|
showToast("error while performing classification")
|
||||||
Firebase.crashlytics.recordException(e)
|
Firebase.crashlytics.recordException(e)
|
||||||
return "ERROR"
|
return "ERROR"
|
||||||
}
|
}
|
||||||
return "INVALID"
|
return "NULL"
|
||||||
}
|
|
||||||
|
|
||||||
private fun absorbanceBasedClassification(predictedDenovixRatio: Double?): String {
|
|
||||||
try {
|
|
||||||
hemoCubeViewModel.messages.postValue("result classification")
|
|
||||||
if (predictedDenovixRatio != null) {
|
|
||||||
if (predictedDenovixRatio in 0.0..0.16)
|
|
||||||
return "Normal"
|
|
||||||
if (predictedDenovixRatio in 0.16..0.165)
|
|
||||||
return "Negative Borderline"
|
|
||||||
if (predictedDenovixRatio in 0.165..0.235)
|
|
||||||
return "Sickle Cell Trait"
|
|
||||||
if (predictedDenovixRatio in 0.235..0.24)
|
|
||||||
return "Positive Borderline"
|
|
||||||
if (predictedDenovixRatio in 0.24..1.0)
|
|
||||||
return "Sickle Cell Disease"
|
|
||||||
} else {
|
|
||||||
return "INVALID"
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
showToast("error while performing classification")
|
|
||||||
Firebase.crashlytics.recordException(e)
|
|
||||||
return "ERROR"
|
|
||||||
}
|
|
||||||
return "INVALID"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showToast(message: String) {
|
private fun showToast(message: String) {
|
||||||
@@ -610,10 +457,6 @@ class HemoCubeFragment : Fragment() {
|
|||||||
private fun startBufferProcess() {
|
private fun startBufferProcess() {
|
||||||
hemoCubeViewModel.progressBar.postValue(true)
|
hemoCubeViewModel.progressBar.postValue(true)
|
||||||
|
|
||||||
activity?.runOnUiThread {
|
|
||||||
binding.btnPlacebuffer.visibility = View.GONE
|
|
||||||
}
|
|
||||||
|
|
||||||
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startBuffer,
|
(activity as HemocubeActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startBuffer,
|
||||||
object : UsbServiceListener {
|
object : UsbServiceListener {
|
||||||
override fun onUsbRead(data: ByteArray?) {}
|
override fun onUsbRead(data: ByteArray?) {}
|
||||||
@@ -652,11 +495,35 @@ class HemoCubeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun calculateRatio(ratio: Double): Double {
|
private fun calculateRatio(ratio: Double): Double {
|
||||||
val coefficient1 = currentDeviceData?.coefficients?.get(0) ?: 0.0
|
val coefficient1: Double = (Constants.COEFFICIENTS[deviceSerialNo]?.get(0) ?: 0.0) as Double
|
||||||
val coefficient2 = currentDeviceData?.coefficients?.get(1) ?: 0.0
|
val coefficient2: Double = (Constants.COEFFICIENTS[deviceSerialNo]?.get(1) ?: 0.0) as Double
|
||||||
return coefficient1 * ratio + coefficient2
|
return coefficient1 * ratio + coefficient2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun parseResult(frames: List<String>): String {
|
||||||
|
val lines = mutableListOf<String>()
|
||||||
|
for (frame in frames.reversed()) {
|
||||||
|
if (frame.contains("REND") || frame.contains("RESULT")) lines += frame
|
||||||
|
if (frame.contains("RESULT")) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val line = lines.reversed().joinToString("").trim()
|
||||||
|
if (line.contains("RESULT") && line.split(" ").size == 8) {
|
||||||
|
return line
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun isValidResult(line: String): String {
|
||||||
|
return if (line.contains("RESULT") && line.split(" ").size == 8) {
|
||||||
|
line
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkDeviceIdMismatch(deviceId: String, loginId: String): Boolean {
|
private fun checkDeviceIdMismatch(deviceId: String, loginId: String): Boolean {
|
||||||
if (!deviceId.isNullOrEmpty() && !loginId.isNullOrEmpty() && deviceId.last() != loginId.last())
|
if (!deviceId.isNullOrEmpty() && !loginId.isNullOrEmpty() && deviceId.last() != loginId.last())
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -166,6 +166,8 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
fireBaseUpload.postValue("Error")
|
fireBaseUpload.postValue("Error")
|
||||||
hemoCubeDao.insertAll(testDetails)
|
hemoCubeDao.insertAll(testDetails)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("Testdb", "Exception during data upload: ${e.message}")
|
Log.e("Testdb", "Exception during data upload: ${e.message}")
|
||||||
@@ -190,6 +192,8 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
Log.e("Testdb", "Error uploading data to Firestore: $response")
|
Log.e("Testdb", "Error uploading data to Firestore: $response")
|
||||||
fireBaseUpload.postValue("Error")
|
fireBaseUpload.postValue("Error")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("Testdb", "Exception during data upload: ${e.message}")
|
Log.e("Testdb", "Exception during data upload: ${e.message}")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.hpostesting.presentation.testRight
|
package com.example.hpostesting.presentation.testRight
|
||||||
|
|
||||||
|
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
@@ -14,7 +15,6 @@ import com.example.hpostesting.data.DataHolder
|
|||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.data.model.test.TestRightResultType
|
import com.example.hpostesting.data.model.test.TestRightResultType
|
||||||
import com.example.hpostesting.data.model.test.TestType
|
import com.example.hpostesting.data.model.test.TestType
|
||||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
|
||||||
import com.example.hpostesting.util.MyUtils.calculateAgeFromYOB
|
import com.example.hpostesting.util.MyUtils.calculateAgeFromYOB
|
||||||
import com.google.firebase.firestore.FirebaseFirestore
|
import com.google.firebase.firestore.FirebaseFirestore
|
||||||
import com.google.firebase.firestore.ktx.firestore
|
import com.google.firebase.firestore.ktx.firestore
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class UsbService : Service() {
|
|||||||
fun connect(driver: UsbSerialDriver, connection: UsbDeviceConnection) {
|
fun connect(driver: UsbSerialDriver, connection: UsbDeviceConnection) {
|
||||||
mPort = driver.ports[0] // Most devices have just one port (port 0)
|
mPort = driver.ports[0] // Most devices have just one port (port 0)
|
||||||
mPort.open(connection)
|
mPort.open(connection)
|
||||||
mPort.setParameters(9600, 8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE)
|
mPort.setParameters(115200, 8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE)
|
||||||
isUsbConnected = true
|
isUsbConnected = true
|
||||||
Log.d(TAG, "My Usb Connected ${mPort.driver}")
|
Log.d(TAG, "My Usb Connected ${mPort.driver}")
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,8 @@
|
|||||||
app:cardBackgroundColor="#FFFFFF"
|
app:cardBackgroundColor="#FFFFFF"
|
||||||
app:cardCornerRadius="5dp"
|
app:cardCornerRadius="5dp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/userImage"
|
app:layout_constraintTop_toBottomOf="@id/userImage"
|
||||||
app:cardElevation="0dp">
|
app:cardElevation="0dp"
|
||||||
|
tools:ignore="MissingConstraints">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/name"
|
android:id="@+id/name"
|
||||||
|
|||||||
@@ -31,17 +31,17 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||||
|
|
||||||
<!-- <TextView-->
|
<!-- <TextView-->
|
||||||
<!-- android:id="@+id/tv_subtitle3"-->
|
<!-- android:id="@+id/tv_subtitle3"-->
|
||||||
<!-- style="@style/title2"-->
|
<!-- style="@style/title2"-->
|
||||||
<!-- android:layout_width="0dp"-->
|
<!-- android:layout_width="0dp"-->
|
||||||
<!-- android:layout_height="wrap_content"-->
|
<!-- android:layout_height="wrap_content"-->
|
||||||
<!-- android:layout_marginHorizontal="24dp"-->
|
<!-- android:layout_marginHorizontal="24dp"-->
|
||||||
<!-- android:layout_marginTop="16dp"-->
|
<!-- android:layout_marginTop="16dp"-->
|
||||||
<!-- android:text="@string/step5"-->
|
<!-- android:text="@string/step5"-->
|
||||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||||
<!-- app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />-->
|
<!-- app:layout_constraintTop_toBottomOf="@id/tv_subtitle2" />-->
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
@@ -147,35 +147,8 @@
|
|||||||
app:layout_constraintHorizontal_bias="1.0"
|
app:layout_constraintHorizontal_bias="1.0"
|
||||||
app:layout_constraintStart_toEndOf="@id/et_abha_id"
|
app:layout_constraintStart_toEndOf="@id/et_abha_id"
|
||||||
app:layout_constraintTop_toTopOf="@id/et_abha_id" />
|
app:layout_constraintTop_toTopOf="@id/et_abha_id" />
|
||||||
<Button
|
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/btn_samplestart"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:text="@string/Start_Sample"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/btn_placebuffer" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_placebuffer"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:text="@string/place_buffer"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:id="@+id/btn_submit"
|
android:id="@+id/btn_submit"
|
||||||
@@ -205,19 +178,62 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||||
|
|
||||||
<Button
|
<!-- <com.google.android.material.textfield.TextInputLayout-->
|
||||||
android:visibility="gone"
|
<!-- android:id="@+id/til_blood_group"-->
|
||||||
android:id="@+id/btn_digitalCard"
|
<!-- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_marginHorizontal="16dp"
|
<!-- android:layout_marginHorizontal="24dp"-->
|
||||||
android:layout_marginTop="24dp"
|
<!-- android:layout_marginTop="16dp"-->
|
||||||
android:clickable="false"
|
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||||
android:text="DigitalCard View"
|
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||||
android:textColor="@color/white"
|
<!-- app:layout_constraintTop_toBottomOf="@id/tv_subtitle4">-->
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
<!-- <AutoCompleteTextView-->
|
||||||
app:layout_constraintTop_toBottomOf="@id/error_message" />
|
<!-- android:id="@+id/et_blood_group"-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:hint="@string/select_blood_group"-->
|
||||||
|
<!-- android:inputType="none"-->
|
||||||
|
<!-- android:labelFor="@id/til_blood_group"-->
|
||||||
|
<!-- app:simpleItems="@array/blood_group" />-->
|
||||||
|
|
||||||
|
<!-- </com.google.android.material.textfield.TextInputLayout>-->
|
||||||
|
|
||||||
|
<!-- <Button-->
|
||||||
|
<!-- android:id="@+id/btn_kit"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:layout_margin="10dp"-->
|
||||||
|
<!-- android:text="@string/new_kit"-->
|
||||||
|
<!-- android:textColor="@color/white"-->
|
||||||
|
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||||
|
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||||
|
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||||
|
|
||||||
|
<!-- <Button-->
|
||||||
|
<!-- android:id="@+id/btn_buffer"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:text="@string/new_buffer"-->
|
||||||
|
<!-- android:textColor="@color/white"-->
|
||||||
|
<!-- android:layout_margin="10dp"-->
|
||||||
|
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||||
|
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||||
|
<!-- app:layout_constraintEnd_toStartOf="@id/btn_kit"/>-->
|
||||||
|
|
||||||
|
<!-- <Button-->
|
||||||
|
<!-- android:id="@+id/btn_read"-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:text="@string/read"-->
|
||||||
|
<!-- android:layout_margin="16dp"-->
|
||||||
|
<!-- android:clickable="false"-->
|
||||||
|
<!-- app:layout_constraintTop_toBottomOf="@id/btn_set_reference"-->
|
||||||
|
<!-- app:layout_constraintStart_toStartOf="parent" />-->
|
||||||
|
|
||||||
|
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -233,5 +249,5 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<!-- SlideshowFragment layout -->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".presentation.dashboard.SlideshowFragment">
|
tools:context="com.example.hpostesting.presentation.dashboard.SlideshowFragment">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:visibility="gone"
|
||||||
android:id="@+id/text_slideshow"
|
android:id="@+id/text_slideshow"
|
||||||
style="@style/title1"
|
style="@style/title1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -19,4 +21,16 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<!-- Language Settings -->
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fragment_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/text_slideshow"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
23
app/src/main/res/layout/language_spinner_preference.xml
Normal file
23
app/src/main/res/layout/language_spinner_preference.xml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<!-- language_spinner_preference.xml -->
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Select Language -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textSelectLanguage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Select Language"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"/>
|
||||||
|
|
||||||
|
<!-- Language Spinner -->
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/languageSpinner"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"/>
|
||||||
|
</LinearLayout>
|
||||||
@@ -48,6 +48,20 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/userID"
|
app:layout_constraintTop_toBottomOf="@id/userID"
|
||||||
tools:text="UserID: MohamedKaif" />
|
tools:text="UserID: MohamedKaif" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/teststatus"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/bloodGroup"
|
||||||
|
tools:text="Test Status: Completed"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/time"
|
android:id="@+id/time"
|
||||||
@@ -61,9 +75,8 @@
|
|||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/bloodGroup"
|
app:layout_constraintTop_toBottomOf="@id/teststatus"
|
||||||
tools:text="Test Status: Completed" />
|
tools:text="startedAt: yyyy-MM-dd HH:mm:ss" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|||||||
259
app/src/main/res/values-hi/strings.xml
Normal file
259
app/src/main/res/values-hi/strings.xml
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">HPOS Testing</string>
|
||||||
|
|
||||||
|
<string-array name="instrument">
|
||||||
|
<item>TestRight</item>
|
||||||
|
<item>Denovix</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="gender">
|
||||||
|
<item>Male</item>
|
||||||
|
<item>Female</item>
|
||||||
|
<item>Other</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="yes_no">
|
||||||
|
<item>Yes</item>
|
||||||
|
<item>No</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="category">
|
||||||
|
<item>GEN</item>
|
||||||
|
<item>OBC</item>
|
||||||
|
<item>SC</item>
|
||||||
|
<item>ST</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="blood_group">
|
||||||
|
<item>O+ve</item>
|
||||||
|
<item>O-ve</item>
|
||||||
|
<item>A+ve</item>
|
||||||
|
<item>A-ve</item>
|
||||||
|
<item>B+ve</item>
|
||||||
|
<item>B-ve</item>
|
||||||
|
<item>AB+ve</item>
|
||||||
|
<item>AB-ve</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="hello_blank_fragment">नमस्ते खाली फ्रेगमेंट</string>
|
||||||
|
<string name="select_the_test">टेस्ट का चयन करें</string>
|
||||||
|
<string name="set_reference">संदर्भ सेट करें</string>
|
||||||
|
|
||||||
|
<!-- Alert Dialog -->
|
||||||
|
<string name="have_you_placed">क्या आपने संदर्भ नमूने की कुवेट रख दी है?</string>
|
||||||
|
<string name="please_place">कृपया चलने से पहले संदर्भ के रूप में नमूने की कुवेट रखें</string>
|
||||||
|
<string name="yes">हाँ</string>
|
||||||
|
<string name="no">नहीं</string>
|
||||||
|
<string name="noo"></string>
|
||||||
|
|
||||||
|
<string name="connect">कनेक्ट</string>
|
||||||
|
<string name="connected">कनेक्ट किया गया</string>
|
||||||
|
<string name="read">पढ़ें</string>
|
||||||
|
<string name="update_reference">संदर्भ अपडेट करें</string>
|
||||||
|
|
||||||
|
<string name="have_you_placed_sample">क्या आपने नमूने के साथ कुवेट रख दी है?</string>
|
||||||
|
<string name="please_place_sample">कृपया चलने से पहले नमूने की कुवेट रखें</string>
|
||||||
|
<string name="yes_and_run">हाँ, चलाएं</string>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Instructions Text -->
|
||||||
|
<string name="Instructions">परीक्षण निर्देश</string>
|
||||||
|
<string name="step1"><b><u>कदम 1</u> : </b> संदर्भ/बेसलाइन सैम्पल को संदर्भ के लिए रखें, जिसमें कुवेट है।</string>
|
||||||
|
<string name="step2"><b><u>कदम 2</u> : </b> डिवाइस को मूल्य पढ़ने के लिए नीचे बटन दबाएं।</string>
|
||||||
|
|
||||||
|
<string name="step3"><b><u>कदम 1</u> : </b> शुरू करने के लिए सैम्पल विवरण दर्ज करें।</string>
|
||||||
|
<string name="step4"><b><u>कदम 1</u> : </b> एक्सपेरिमेंट के लिए सैम्पल भरी ब्लड सैम्पल को संदर्भ के लिए कुवेट में रखें।</string>
|
||||||
|
<string name="step5"><b><u>कदम 2</u> : </b> डिवाइस को मूल्य पढ़ने के लिए नीचे बटन दबाएं।</string>
|
||||||
|
|
||||||
|
<string name="login_id">लॉगिन आईडी</string>
|
||||||
|
<string name="password">पासवर्ड</string>
|
||||||
|
<string name="login">लॉगिन</string>
|
||||||
|
<string name="acquire">प्राप्त करें</string>
|
||||||
|
<string name="enter_patient_details">रोगी विवरण दर्ज करें</string>
|
||||||
|
<string name="patient_name">रोगी का नाम</string>
|
||||||
|
<string name="age">आयु (वर्षों में)</string>
|
||||||
|
<string name="gender">लिंग</string>
|
||||||
|
<string name="name_error">नाम खाली नहीं हो सकता</string>
|
||||||
|
<string name="age_error">आयु खाली नहीं हो सकती</string>
|
||||||
|
<string name="gender_error">लिंग खाली नहीं हो सकती</string>
|
||||||
|
<string name="age_error_out_of_bound">आयु वैध होनी चाहिए</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="yob_error">जन्म की वर्ष साल नहीं हो सकता</string>
|
||||||
|
<string name="yob_error_2">अमान्य जन्म की वर्ष</string>
|
||||||
|
<string name="mobile_error">मोबाइल नंबर खाली नहीं हो सकता</string>
|
||||||
|
<string name="mobile_error_invalid">मोबाइल नंबर अमान्य है (10 अंक दर्ज करें)</string>
|
||||||
|
<string name="this_error">यह खाली नहीं हो सकता</string>
|
||||||
|
|
||||||
|
<string name="test_results">परीक्षण परिणाम</string>
|
||||||
|
<string name="name_in_textview"><b>नाम</b> : %1$s</string>
|
||||||
|
<string name="gender_in_textview"><b>लिंग</b> : %1$s</string>
|
||||||
|
<string name="age_in_textview"><b>आयु</b> : %1$s वर्ष</string>
|
||||||
|
<string name="results_in_textview"><b>परिणाम</b> :</string>
|
||||||
|
<string name="negative">नेगेटिव</string>
|
||||||
|
<string name="download_report">रिपोर्ट डाउनलोड करें</string>
|
||||||
|
<string name="home">होम</string>
|
||||||
|
<string name="new_test">नया परीक्षण</string>
|
||||||
|
<string name="start_now">अब शुरू करें</string>
|
||||||
|
<string name="hemo_cube">हेमो क्यूब</string>
|
||||||
|
<string name="hb">एचबी</string>
|
||||||
|
<string name="normal">सामान्य</string>
|
||||||
|
<string name="sickle_cell_disease">सिक्ल सेल रोग</string>
|
||||||
|
<string name="sickle_cell_trait">सिक्ल सेल ट्रेट</string>
|
||||||
|
<string name="undefined">अनिर्धारित</string>
|
||||||
|
<string name="sicklecell_nconfirmatory">सिक्लसेल\nनिश्चित</string>
|
||||||
|
<string name="sicklecell_screening">सिक्लसेल स्क्रीनिंग</string>
|
||||||
|
<string name="thalassemia">थैलसेमिया</string>
|
||||||
|
<string name="usb_connection">यूएसबी कनेक्शन</string>
|
||||||
|
<string name="high_performance_optical_spectroscopy">उच्च प्रदर्शन ऑप्टिकल स्पेक्ट्रोस्कोपी</string>
|
||||||
|
<string name="sickle_cert">सिक्ल प्रमाणपत्र</string>
|
||||||
|
<string name="sickle_find">सिक्ल फाइंड</string>
|
||||||
|
<string name="submit">सबमिट करें</string>
|
||||||
|
<string name="diagnostics">डिवाइस नुस्खा</string>
|
||||||
|
<string name="place_buffer">स्थान</string>
|
||||||
|
<string name="Start_Sample">सैम्पल शुरू करें</string>
|
||||||
|
<string name="new_kit">नया किट</string>
|
||||||
|
<string name="new_buffer">नया बफर</string>
|
||||||
|
<string name="name_error_2">अमान्य वर्ण, अनुमत अक्षर हैं अक्षर, संख्या और ( ) _ - , . केवल</string>
|
||||||
|
<string name="recommended">\*परिणाम को प्रमाणित करने के लिए प्रयोगशाला परीक्षण के साथ</string>
|
||||||
|
<string name="recommended_age">\*परिणाम को प्रमाणित करने के लिए प्रयोगशाला परीक्षण के साथ, चिकित्सक की आयु 5 वर्षों से कम है</string>
|
||||||
|
<string name="positive_borderline">सकारात्मक सीमारेखा</string>
|
||||||
|
<string name="negative_borderline">नकारात्मक सीमारेखा</string>
|
||||||
|
<string name="is_patient_under_any_medication">क्या रोगी को कोई दवा या उपचार हो रहा है?</string>
|
||||||
|
<string name="is_patient_undergoing_any_blood_transfusion">क्या रोगी को कोई रक्त प्रसूति हो रही है?</string>
|
||||||
|
<string name="scan_aadhaar_card">स्कैन आधार कार्ड</string>
|
||||||
|
<string name="patient_details">रोगी विवरण</string>
|
||||||
|
<string name="or">या</string>
|
||||||
|
<string name="scan_abha_card">स्कैन अभा कार्ड</string>
|
||||||
|
<string name="list_of_patients">रोगियों की सूची</string>
|
||||||
|
<string name="no_patient_records_found_to_test_please_add_one_from_below">परीक्षण के लिए कोई रोगी रिकॉर्ड नहीं मिला। कृपया नीचे से एक जोड़ें।</string>
|
||||||
|
<string name="add">जोड़ें</string>
|
||||||
|
<string name="test">परीक्षण</string>
|
||||||
|
<string name="pending">बकाया</string>
|
||||||
|
<string name="scan_patient_abha_id_card">रोगी अभा आईडी कार्ड स्कैन करें</string>
|
||||||
|
<string name="scan_now">अब स्कैन करें</string>
|
||||||
|
<string name="enter_abha_number_manualy">अभा नंबर हैंडपंजी से दर्ज करें</string>
|
||||||
|
<string name="abha_id">अभा आईडी</string>
|
||||||
|
<string name="patient_id_in_tv"><b>उपयोगकर्ता आईडी</b> : %1$s</string>
|
||||||
|
<string name="go">जाएं</string>
|
||||||
|
<string name="click_here">यहां क्लिक करें</string>
|
||||||
|
<string name="title_activity_dashboard">डैशबोर्ड गतिविधि</string>
|
||||||
|
<string name="navigation_drawer_open">नेविगेशन ड्रॉयर खोलें</string>
|
||||||
|
<string name="navigation_drawer_close">नेविगेशन ड्रॉयर बंद करें</string>
|
||||||
|
<string name="nav_header_title">एचपीओएस</string>
|
||||||
|
<string name="nav_header_subtitle">sminnovations.in</string>
|
||||||
|
<string name="nav_header_desc">नेविगेशन हैडर</string>
|
||||||
|
<string name="action_settings">सेटिंग्स</string>
|
||||||
|
|
||||||
|
<string name="menu_home">होम</string>
|
||||||
|
<string name="show_hemocube_result">परिणाम दिखाएं</string>
|
||||||
|
<string name="menu_gallery">गैलरी</string>
|
||||||
|
<string name="menu_settings">सेटिंग्स</string>
|
||||||
|
<string name="profile">प्रोफ़ाइल</string>
|
||||||
|
<string name="year_of_birth">जन्म की वर्ष</string>
|
||||||
|
<string name="father_s_name_husband_s_name">पिता का नाम / पति का नाम</string>
|
||||||
|
<string name="is_patient_married_yes_no">क्या रोगी विवाहित है? (हां/नहीं)</string>
|
||||||
|
<string name="category">श्रेणी</string>
|
||||||
|
<string name="blood_group">रक्त समूह</string>
|
||||||
|
<string name="digital_card">डिजिटल सलाहकार कार्ड</string>
|
||||||
|
<string name="patient_medical_records">रोगी चिकित्सा रिकॉर्ड</string>
|
||||||
|
<string name="patient_address_details">रोगी का पता</string>
|
||||||
|
<string name="district">जिला</string>
|
||||||
|
<string name="city_town">शहर / गाँव</string>
|
||||||
|
<string name="state">राज्य</string>
|
||||||
|
<string name="pincode">पिनकोड</string>
|
||||||
|
<string name="threedots">...</string>
|
||||||
|
<string name="create_abha_id_card">अभा आईडी कार्ड बनाएं</string>
|
||||||
|
<string name="official_abha_app">आधिकारिक अभा एप्लिकेशन</string>
|
||||||
|
<string name="scan_patient_aadhaar_card">रोगी का आधार कार्ड स्कैन करें</string>
|
||||||
|
<string name="enter_aadhaar_number_manualy">आधार नंबर हैंडपंजी से दर्ज करें</string>
|
||||||
|
<string name="aadhaar_number">आधार नंबर</string>
|
||||||
|
<string name="aadhaar_in_tv"><b>आधार नंबर</b></string>
|
||||||
|
<string name="please_use_official_abha_app_to_create_abha_id_and_come_back">कृपया "आधिकारिक अभा एप्लिकेशन" का उपयोग करें अभा आईडी बनाने के लिए, और वापस आएं।</string>
|
||||||
|
<string name="please_enter_aadhaar">कृपया जारी रखने के लिए आधार नंबर दर्ज करें</string>
|
||||||
|
<string name="scan_qr_code_of_the_kit">किट का क्यूआर कोड स्कैन करें</string>
|
||||||
|
<string name="enter_kit_serial_number_manually">किट सीरियल नंबर हैंडपंजी से दर्ज करें</string>
|
||||||
|
<string name="serial_number">सीरियल नंबर</string>
|
||||||
|
<string name="set_baseline_reference_again">क्या फिर से आधार लाइन सेट करना है?</string>
|
||||||
|
<string name="baseline_instruction">आधार निर्देश</string>
|
||||||
|
<string name="to_be_launched_in_next_version_of_the_app">अगले संस्करण में लॉन्च किया जाएगा</string>
|
||||||
|
<string name="invalid_kit">अमान्य किट सीरियल नंबर, सही उदाहरण, SMI/SC/019/01/001</string>
|
||||||
|
<string name="user_list">उपयोगकर्ता सूची</string>
|
||||||
|
<string name="user_id">उपयोगकर्ता आईडी</string>
|
||||||
|
<string name="aadhar_id">आधार आईडी</string>
|
||||||
|
<string name="internet_not_available_please_enter_the_user_id_manually">इंटरनेट उपलब्ध नहीं है, कृपया उपयोगकर्ता आईडी और रक्त समूह मैन्युअली प्रविष्ट करें</string>
|
||||||
|
<string name="user_id_error_message">उपयोगकर्ता आईडी 18 अंकों की होनी चाहिए और कृपया रक्त समूह का चयन करें</string>
|
||||||
|
<string name="upload_db_registration_title">डीबी टेस्ट अपलोड करें</string>
|
||||||
|
<string name="upload_db_registration_message">क्या आप स्थानीय डीबी टेस्ट को क्लाउड पर अपलोड करना चाहते हैं?</string>
|
||||||
|
<string name="upload">अपलोड</string>
|
||||||
|
<string name="cancel">रद्द करें</string>
|
||||||
|
<string name="upload_success_message">अपलोड सफलता पूर्वक हुआ</string>
|
||||||
|
<string name="test_completed">टेस्ट पूरा हुआ</string>
|
||||||
|
<string name="select_blood_group">रक्त समूह चयन करें</string>
|
||||||
|
<string name="all_registered_user_are_tested_successfully">सभी पंजीकृत उपयोगकर्ता सफलता पूर्वक टेस्ट हो चुके हैं</string>
|
||||||
|
<string name="start_incubation">अंडान</string>
|
||||||
|
<string name="check_buffer">बफर जाँचें</string>
|
||||||
|
<string name="low_battery_warning">बैटरी स्तर 40% से कम है, कृपया उपकरण को चार्ज करें जारी रखने के लिए</string>
|
||||||
|
<string name="test_already_conducted">इस उपयोगकर्ता के लिए पहले ही टेस्ट हो चुका है</string>
|
||||||
|
<string name="incubation_not_completed">अंडान 15 मिनट पूर्ण नहीं हुआ है</string>
|
||||||
|
<string name="incubation_crossed_30_minutes">अंडान 30 मिनटों को पार कर गया है, अंडान फिर से करना होगा</string>
|
||||||
|
<string name="incubation_not_started">इस उपयोगकर्ता के लिए अंडान शुरू नहीं हुआ है</string>
|
||||||
|
<string name="test_concluded">टेस्ट समाप्त हुआ</string>
|
||||||
|
<string name="test_pending">टेस्ट लंबित है</string>
|
||||||
|
<string name="blood_group_error">कृपया अपना रक्त समूह दर्ज करें</string>
|
||||||
|
<string name="blood_group_toast">कृपया अपना रक्त समूह दर्ज करें</string>
|
||||||
|
<string name="blood_group_updated_successfully">रक्त समूह सफलता पूर्वक अपडेट किया गया है</string>
|
||||||
|
<string name="failed_to_update_blood_group">रक्त समूह अपडेट करने में विफल: %1$s</string>
|
||||||
|
<string name="no_user_data_found">निर्दिष्ट आईडी के लिए कोई उपयोगकर्ता डेटा नहीं मिला</string>
|
||||||
|
<string name="device_disconnected">उपकरण डिस्कनेक्ट किया गया है</string>
|
||||||
|
<string name="no_device_found">कोई डिवाइस नहीं मिली</string>
|
||||||
|
<string name="invalid_kit_number">अमान्य किट नंबर</string>
|
||||||
|
<string name="internt_not">इंटरनेट उपलब्ध नहीं है</string>
|
||||||
|
<string name="internt_not_local">इंटरनेट उपलब्ध नहीं है, टेस्ट विवरण स्थानीय रूप से सहेजे गए हैं</string>
|
||||||
|
<string name="error_local">डेटा अपलोड करने में त्रुटि, टेस्ट विवरण स्थानीय रूप से सहेजे गए हैं</string>
|
||||||
|
<string name="error_exist">मौजूदा बफर प्राप्त करते समय त्रुटि</string>
|
||||||
|
<string name="do_exist">क्या आप मौजूदा बफर के साथ जारी रखना चाहते हैं?</string>
|
||||||
|
<string name="kit_uploaded">किट परिणाम सफलता पूर्वक अपलोड हुआ</string>
|
||||||
|
<string name="kit_upload_failed">किट परिणाम अपलोड करने में विफल, इसे मैन्युअली नोट करें</string>
|
||||||
|
<string name="test_ongoing">टेस्ट जारी है</string>
|
||||||
|
<string name="test_go_noback">टेस्ट जारी है, पीछे नहीं जा सकते</string>
|
||||||
|
<string name="error_classification">वर्गीकरण करते समय त्रुटि</string>
|
||||||
|
<string name="test_upload">टेस्ट परिणाम सफलता पूर्वक अपलोड हुआ</string>
|
||||||
|
<string name="test_upload_failed">टेस्ट परिणाम अपलोड करने में विफल</string>
|
||||||
|
<string name="log_out">लॉग आउट</string>
|
||||||
|
<string name="do_log_out">क्या आप ऐप्लिकेशन से लॉगआउट करना चाहते हैं?</string>
|
||||||
|
<string name="cancelled_unable_scan">रद्द किया गया: स्कैन करने में असमर्थ, पुनः प्रयास करें!!</string>
|
||||||
|
<string name="kit_updated">किट नंबर अपडेट किया गया है, कृपया टेस्ट शुरू करने से पहले उपयोगकर्ता का चयन करें</string>
|
||||||
|
<string name="select_patient">कृपया टेस्ट शुरू करने से पहले रोगी का चयन करें</string>
|
||||||
|
<string name="enable_location">कृपया स्थान सेवाएं सक्षम करें</string>
|
||||||
|
<string name="location_denied">फाइन स्थान अनुमति निरस्त</string>
|
||||||
|
<string name="coarse_location_denied">कोर्स स्थान अनुमति निरस्त</string>
|
||||||
|
<string name="permission_grant">आपको एप्लिकेशन का उपयोग करने के लिए सभी फ़ाइलों तक पहुँच की अनुमति देनी होगी</string>
|
||||||
|
<string name="permission_required">एप्लिकेशन का उपयोग करने के लिए सभी अनुमतियाँ आवश्यक हैं</string>
|
||||||
|
<string name="device_not">उपकरण कनेक्ट नहीं है।</string>
|
||||||
|
<string name="enter_proper_login_id">कृपया सही लॉगिन आईडी दर्ज करें</string>
|
||||||
|
<string name="enter_proper_password">कृपया सही पासवर्ड दर्ज करें</string>
|
||||||
|
<string name="wrong_password">गलत पासवर्ड</string>
|
||||||
|
<string name="wrong_user_id">गलत उपयोगकर्ता आईडी</string>
|
||||||
|
<string name="error_invalid_test">अमान्य टेस्ट. डी-ऑक्सीजनेशन समस्या</string>
|
||||||
|
<string name="error_negative_abs">त्रुटि: नेगेटिव ऍब्स॰. ब्लैंक रीडिंग पुनः लें</string>
|
||||||
|
<string name="error_improper_buffer_high">त्रुटि: अमान्य टेस्ट. बफर रीडिंग सही नहीं (उच्च)</string>
|
||||||
|
<string name="error_improper_buffer_low">त्रुटि: अमान्य टेस्ट. बफर रीडिंग सही नहीं (न्यून)</string>
|
||||||
|
<string name="error_processing_device_data">उपकरण डेटा प्रोसेस करते समय त्रुटि</string>
|
||||||
|
<string name="error_repeat_test_lower_volume">अमान्य. वाल्यूम कम है - पुनः टेस्ट करें</string>
|
||||||
|
<string name="error_repeat_test_higher_volume">अमान्य. बहुत कम एब्स॰ - उच्च वाल्यूम के साथ पुनः टेस्ट करें</string>
|
||||||
|
<string name="positive_for_sickle_cell">सिकल सेल के लिए सकारात्मक. पुनः सत्यापन के लिए HPLC</string>
|
||||||
|
<string name="something_wrong_with_device">डिवाइस में कुछ गड़बड़ है, कृपया डिवाइस को बहुत और टेस्ट करने के लिए बाहर निकालें और फिर से कनेक्ट करें</string>
|
||||||
|
<string name="processing_result">प्रोसेसिंग परिणाम</string>
|
||||||
|
<string name="data_collected_processing_data">डेटा संग्रहित हो रहा है, डेटा प्रोसेसिंग हो रहा है</string>
|
||||||
|
<string name="sample_completed">सैम्पल पूरा हुआ</string>
|
||||||
|
<string name="gathering_data">डेटा एकत्र किया जा रहा है</string>
|
||||||
|
<string name="sample_started">सैम्पल शुरू हुआ</string>
|
||||||
|
<string name="buffer_completed">बफर पूरा हुआ</string>
|
||||||
|
<string name="buffer_started">बफर शुरू हुआ</string>
|
||||||
|
<string name="start">शुरू</string>
|
||||||
|
<string name="place_sample">सैम्पल रखें</string>
|
||||||
|
<string name="invalid">अमान्य</string>
|
||||||
|
<string name="error">त्रुटि</string>
|
||||||
|
|
||||||
|
</resources>
|
||||||
259
app/src/main/res/values-ka/strings.xml
Normal file
259
app/src/main/res/values-ka/strings.xml
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">HPOS ಪರೀಕ್ಷೆ</string>
|
||||||
|
|
||||||
|
<string-array name="instrument">
|
||||||
|
<item>TestRight</item>
|
||||||
|
<item>Denovix</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="gender">
|
||||||
|
<item>ಪುರುಷ</item>
|
||||||
|
<item>ಹೆಣ್ಣು</item>
|
||||||
|
<item>ಇತರ</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="yes_no">
|
||||||
|
<item>ಹೌದು</item>
|
||||||
|
<item>ಇಲ್ಲ</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
|
||||||
|
<string-array name="category">
|
||||||
|
<item>GEN</item>
|
||||||
|
<item>OBC</item>
|
||||||
|
<item>SC</item>
|
||||||
|
<item>ST</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="blood_group">
|
||||||
|
<item>O+ve</item>
|
||||||
|
<item>O-ve</item>
|
||||||
|
<item>A+ve</item>
|
||||||
|
<item>A-ve</item>
|
||||||
|
<item>B+ve</item>
|
||||||
|
<item>B-ve</item>
|
||||||
|
<item>AB+ve</item>
|
||||||
|
<item>AB-ve</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string name="hello_blank_fragment">ಹಲೋ ಖಾಲಿ ಫ್ರ್ಯಾಗ್ಮೆಂಟ್</string>
|
||||||
|
<string name="select_the_test">ಪರೀಕ್ಷೆಯನ್ನು ಆಯ್ಕೆಮಾಡಿ</string>
|
||||||
|
<string name="set_reference">ಸಂದರ್ಭ ಹೊಂದಿಸಿ</string>
|
||||||
|
|
||||||
|
<!-- Alert Dialog -->
|
||||||
|
<string name="have_you_placed">ನೀವು ಆಧಾರ ನಮೂದಿಸಿದ್ದೀರಾ?</string>
|
||||||
|
<string name="please_place">ದಯವಿಟ್ಟು ಚಲಾಯಿಸುವ ಮೊದಲು ನಮೂದಿಸಿದ ನಮೂನೆಯ ಕೂವೆಟ್ಟನ್ನು ಇಟ್ಟುಕೊಳ್ಳಿ</string>
|
||||||
|
<string name="yes">ಹೌದು</string>
|
||||||
|
<string name="no">ಇಲ್ಲ</string>
|
||||||
|
<string name="noo"></string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="connect">ಸಂಪರ್ಕಿಸಿ</string>
|
||||||
|
<string name="connected">ಸಂಪರ್ಕಿಸಿದೆ</string>
|
||||||
|
<string name="read">ಓದಿ</string>
|
||||||
|
<string name="update_reference">ರೇಫರೆನ್ಸ್ ಅಪ್ಡೇಟ್ ಮಾಡಿ</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="have_you_placed_sample">ನೀವು ನಮೂನೆಯ ಕೂವೆಟ್ ಇಟ್ಟಿದ್ದೀರಾ?</string>
|
||||||
|
<string name="please_place_sample">ದಯವಿಟ್ಟು ಚಲಾಯಿಸುವ ಮೊದಲು ನಮೂದಿಸಿದ ನಮೂನೆಯ ಕೂವೆಟ್ಟನ್ನು ಇಟ್ಟುಕೊಳ್ಳಿ</string>
|
||||||
|
<string name="yes_and_run">ಹೌದು, ರನ್</string>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Instructions Text -->
|
||||||
|
<string name="Instructions">ಪರೀಕ್ಷಣ ನಿರ್ದೇಶಗಳು</string>
|
||||||
|
<string name="step1"><b><u>ಹೆಜ್ಜೆ 1</u> : </b> ಆಧಾರ/ಬೇಸ್ಲೈನ್ ನಮೂನೆಯನ್ನು ಹೊಂದಿಸಲು ಕೂವೆಟ್ಟನ್ನು ಇಟ್ಟುಕೊಳ್ಳಿ</string>
|
||||||
|
<string name="step2"><b><u>ಹೆಜ್ಜೆ 2</u> : </b> ಡೆವೈಸ್ ಮೌಲ್ಯಗಳನ್ನು ಓದಲು ಬಟನ್ ಕೆಳಗೆ ಒತ್ತಿ</string>
|
||||||
|
<string name="step3"><b><u>ಹೆಜ್ಜೆ 1</u> : </b> ಪ್ರಾರಂಭಿಸಲು ನಮೂನೆ ವಿವರಗಳನ್ನು ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="step4"><b><u>ಹೆಜ್ಜೆ 1</u> : </b> ರಸದ ನಮೂನೆಯನ್ನು ಪರೀಕ್ಷೆಗಾಗಿ ಇಟ್ಟುಕೊಳ್ಳಿ</string>
|
||||||
|
<string name="step5"><b><u>ಹೆಜ್ಜೆ 2</u> : </b> ಡೆವೈಸ್ ಮೌಲ್ಯಗಳನ್ನು ಓದಲು ಬಟನ್ ಕೆಳಗೆ ಒತ್ತಿ</string>
|
||||||
|
|
||||||
|
<string name="login_id">ಲಾಗಿನ್ ಐಡಿ</string>
|
||||||
|
<string name="password">ಪಾಸ್ವರ್ಡ್</string>
|
||||||
|
<string name="login">ಲಾಗಿನ್</string>
|
||||||
|
<string name="acquire">ಸಹಿಸಿ</string>
|
||||||
|
<string name="enter_patient_details">ರೋಗಿಯ ವಿವರಗಳನ್ನು ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="patient_name">ರೋಗಿಯ ಹೆಸರು</string>
|
||||||
|
<string name="age">ವಯಸ್ಸು ವರ್ಷಗಳಲ್ಲಿ</string>
|
||||||
|
<string name="gender">ಲಿಂಗ</string>
|
||||||
|
|
||||||
|
<string name="name_error">ಹೆಸರು ಖಾಲಿ ಇರಬಾರದು</string>
|
||||||
|
<string name="age_error">ವಯಸ್ಸು ಖಾಲಿ ಇರಬಾರದು</string>
|
||||||
|
<string name="gender_error">ಲಿಂಗ ಖಾಲಿ ಇರಬಾರದು</string>
|
||||||
|
<string name="age_error_out_of_bound">ವಯಸ್ಸು ಯಾವುದೇ ಸಾಧ್ಯವಿಲ್ಲ</string>
|
||||||
|
<string name="yob_error">ಹುಟ್ಟಿದ ವರ್ಷ ಖಾಲಿ ಇರಬಾರದು</string>
|
||||||
|
<string name="yob_error_2">ಅಮಾನ್ಯ ಹುಟ್ಟಿದ ವರ್ಷ</string>
|
||||||
|
<string name="mobile_error">ಮೊಬೈಲ್ ಸಂಖ್ಯೆ ಖಾಲಿ ಇರಬಾರದು</string>
|
||||||
|
<string name="mobile_error_invalid">ಮೊಬೈಲ್ ಸಂಖ್ಯೆ ಅಮಾನ್ಯ (10 ಅಂಕಗಳನ್ನು ನಮೂದಿಸಿ)</string>
|
||||||
|
<string name="this_error">ಇದು ಖಾಲಿ ಇರಬಾರದು</string>
|
||||||
|
<string name="test_results">ಪರೀಕ್ಷಾ ಫಲಿತಾಂಶಗಳು</string>
|
||||||
|
<string name="name_in_textview"><b>ಹೆಸರು</b> : %1$s</string>
|
||||||
|
<string name="gender_in_textview"><b>ಲಿಂಗ</b> : %1$s</string>
|
||||||
|
<string name="age_in_textview"><b>ವಯಸ್ಸು</b> : %1$s ವರ್ಷಗಳು</string>
|
||||||
|
<string name="results_in_textview"><b>ಫಲಿತಾಂಶಗಳು</b> :</string>
|
||||||
|
<string name="negative">ನೆಗೆಟಿವ್\ \ </string>
|
||||||
|
<string name="download_report">ವರದಿ\nಡೌನ್ಲೋಡ್ ಮಾಡಿ</string>
|
||||||
|
<string name="home">ಹೋಮ್</string>
|
||||||
|
<string name="new_test">ಹೊಸ ಪರೀಕ್ಷೆ</string>
|
||||||
|
<string name="start_now">ಈಗ ಪ್ರಾರಂಭಿಸಿ</string>
|
||||||
|
<string name="hemo_cube">ಹೆಮೋ ಕ್ಯೂಬ್</string>
|
||||||
|
<string name="hb">ಹೆಮೊಗ್ಲೊಬಿನ್</string>
|
||||||
|
<string name="normal">ಸಾಮಾನ್ಯ\ \ </string>
|
||||||
|
<string name="sickle_cell_disease">ಸಿಕ್ಲ್ ಸೆಲ್ ರೋಗ\ \ </string>
|
||||||
|
<string name="sickle_cell_trait">ಸಿಕ್ಲ್ ಸೆಲ್ ಗುಣ\ \ </string>
|
||||||
|
<string name="undefined">ಅವ್ಯಾಖ್ಯಾತ\ \ </string>
|
||||||
|
<string name="sicklecell_nconfirmatory">ಸಿಕ್ಲ್ಸೆಲ್\nದೃಢೀಕರಣ</string>
|
||||||
|
<string name="sicklecell_screening">ಸಿಕ್ಲ್ ಸೆಲ್ ಸ್ಕ್ರೀನಿಂಗ್</string>
|
||||||
|
<string name="thalassemia">ಥ್ಯಾಲಸೀಮಿಯಾ</string>
|
||||||
|
<string name="usb_connection">USB ಕನೆಕ್ಷನ್</string>
|
||||||
|
<string name="high_performance_optical_spectroscopy">ಹೈ ಪರಫಾರ್ಮೆನ್ಸ್\nಆಪ್ಟಿಕಲ್ ಸ್ಪೆಕ್ಟ್ರೋಸ್ಕೊಪಿ</string>
|
||||||
|
<string name="sickle_cert">ಸಿಕ್ಲ್ ಸರ್ಟಿಫಿಕೇಟ್</string>
|
||||||
|
<string name="sickle_find">ಸಿಕ್ಲ್ ಹುಡುಕಿ</string>
|
||||||
|
<string name="submit">ಸಲ್ಲಿಸಿ</string>
|
||||||
|
<string name="diagnostics">ಡೆವೈಸ್ ಟೆಸ್ಟ್</string>
|
||||||
|
<string name="place_buffer">ಪ್ರಾರಂಭಿಸಿ</string>
|
||||||
|
<string name="Start_Sample">ನಮೂನೆ ಪ್ರಾರಂಭಿಸಿ</string>
|
||||||
|
<string name="new_kit">ಹೊಸ ಕಿಟ್</string>
|
||||||
|
<string name="new_buffer">ಹೊಸ ಬಫರ್</string>
|
||||||
|
<string name="name_error_2">ಅಮಾನ್ಯ ಅಕ್ಷರ, ಅನುಮತವಾದ ಅಕ್ಷರಗಳು ಅಕ್ಷರಗಳು, ಸಂಖ್ಯೆಗಳು ಮತ್ತು ( ) _ - , . ಮಾತ್ರ</string>
|
||||||
|
<string name="recommended">\*ಫಲಿತಾಂಶವನ್ನು ಪ್ರಯೋಗಶಾಲೆಯ ಪರೀಕ್ಷಾದಿಂದ ದೃಢೀಕರಿಸಬೇಕು</string>
|
||||||
|
<string name="recommended_age">\*ಫಲಿತಾಂಶವನ್ನು ಪ್ರಯೋಗಶಾಲೆಯ ಪರೀಕ್ಷಾದಿಂದ ದೃಢೀಕರಿಸಬೇಕು ಏಕೆಂದರೆ ರೋಗಿಯ ವಯಸ್ಸು 5 ವರ್ಷಗಳಿಗಿಂತ ಕಡಿಮೆ</string>
|
||||||
|
<string name="positive_borderline">ಧನಸ್ಪರ್ಶ</string>
|
||||||
|
<string name="negative_borderline">ನೆಗೆಟಿವ್ ಬಾರ್ಡರ್ಲೈನ್</string>
|
||||||
|
<string name="is_patient_under_any_medication">ರೋಗಿ ಯಾವುದೇ ಔಷಧಿ ಅಥವಾ ಚಿಕಿತ್ಸೆಯಲ್ಲಿದ್ದಾನೆಯೇ?</string>
|
||||||
|
<string name="is_patient_undergoing_any_blood_transfusion">ರೋಗಿಗೆ ರಕ್ತ ಪ್ರವಾಹನೆ ನಡೆಯುತ್ತಿದೆಯೇ?</string>
|
||||||
|
<string name="scan_aadhaar_card">ಆಧಾರ್ ಕಾರ್ಡ್\nಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||||
|
<string name="patient_details">ರೋಗಿ ವಿವರಗಳು</string>
|
||||||
|
<string name="or">ಅಥವಾ</string>
|
||||||
|
<string name="scan_abha_card">ABHA ಕಾರ್ಡ್\nಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||||
|
<string name="list_of_patients">ರೋಗಿಗಳ ಪಟ್ಟಿ</string>
|
||||||
|
<string name="no_patient_records_found_to_test_please_add_one_from_below">ಪರೀಕ್ಷಿಸಲು ಯಾವುದೇ ರೋಗಿ ವಿವರಗಳು ಸಿಗಲಿಲ್ಲ. ದಯವಿಟ್ಟು ಕೆಳಗಿನಿಂದ ಒಂದನ್ನು ಸೇರಿಸಿ.</string>
|
||||||
|
<string name="add">ಸೇರಿಸಿ</string>
|
||||||
|
<string name="test">ಪರೀಕ್ಷೆ</string>
|
||||||
|
<string name="pending">ಬಾಕಿ</string>
|
||||||
|
<string name="scan_patient_abha_id_card">ABHA ಐಡಿ ಕಾರ್ಡ್ ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||||
|
<string name="scan_now">ಈಗ ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||||
|
<string name="enter_abha_number_manualy">ABHA ಸಂಖ್ಯೆಯನ್ನು ಕೈಯಿಂದ ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="abha_id">ABHA ಐಡಿ</string>
|
||||||
|
<string name="patient_id_in_tv"><b>ಬಳಕೆದಾರ ಐಡಿ</b> : %1$s</string>
|
||||||
|
<string name="go">ಹೋಗಿ</string>
|
||||||
|
<string name="click_here">ಇಲ್ಲಿ ಕ್ಲಿಕ್ ಮಾಡಿ</string>
|
||||||
|
<string name="title_activity_dashboard">ಡ್ಯಾಶ್ಬೋರ್ಡ್ ಆರಂಭ</string>
|
||||||
|
<string name="navigation_drawer_open">ನೇವಿಗೇಷನ್ ಡ್ರಾಯರ್ ತೆರೆಯಲಿ</string>
|
||||||
|
<string name="navigation_drawer_close">ನೇವಿಗೇಷನ್ ಡ್ರಾಯರ್ ಮುಚ್ಚಲಿ</string>
|
||||||
|
<string name="nav_header_title">HPOS</string>
|
||||||
|
<string name="nav_header_subtitle">sminnovations.in</string>
|
||||||
|
<string name="nav_header_desc">ನೇವಿಗೇಷನ್ ಹೆಡರ್</string>
|
||||||
|
<string name="action_settings">ಸೆಟ್ಟಿಂಗ್ಗಳು</string>
|
||||||
|
<string name="menu_home">ಹೋಮ್</string>
|
||||||
|
<string name="show_hemocube_result">ಫಲಿತಾಂಶ ತೋರಿಸಿ</string>
|
||||||
|
<string name="menu_gallery">ಗ್ಯಾಲರಿ</string>
|
||||||
|
<string name="menu_settings">ಸೆಟ್ಟಿಂಗ್ಗಳು</string>
|
||||||
|
<string name="profile">ಪ್ರೊಫೈಲ್</string>
|
||||||
|
<string name="year_of_birth">ಹುಟ್ಟಿದ ವರ್ಷ</string>
|
||||||
|
<string name="father_s_name_husband_s_name">ತಂದೆಯ/ಗಂಡನ ಹೆಸರು</string>
|
||||||
|
<string name="is_patient_married_yes_no">ರೋಗಿ ಮದುವೆಯಾಗಿದ್ದಾನೆಯೇ? (ಹೌದು/ಇಲ್ಲ)</string>
|
||||||
|
<string name="category">ವರ್ಗ</string>
|
||||||
|
<string name="blood_group">ರಕ್ತ ಗುಂಪು</string>
|
||||||
|
<string name="digital_card">ಡಿಜಿಟಲ್ ಸಲಹಾ ಕಾರ್ಡ್</string>
|
||||||
|
<string name="patient_medical_records">ರೋಗಿ ವೈದ್ಯಕೀಯ ದಾಖಲೆಗಳು</string>
|
||||||
|
<string name="patient_address_details">ರೋಗಿಯ ವಿಳಾಸ ವಿವರಗಳು</string>
|
||||||
|
<string name="district">ಜಿಲ್ಲೆ</string>
|
||||||
|
<string name="city_town">ನಗರ/ಪಟ್ಟಣ</string>
|
||||||
|
<string name="state">ರಾಜ್ಯ</string>
|
||||||
|
<string name="pincode">ಪಿನ್ಕೋಡ್</string>
|
||||||
|
<string name="threedots">...</string>
|
||||||
|
<string name="create_abha_id_card">ABHA ಐಡಿ ಕಾರ್ಡ್ ರಚಿಸಿ</string>
|
||||||
|
<string name="official_abha_app">ಆಧಿಕಾರಿ ABHA ಆಪ್</string>
|
||||||
|
<string name="scan_patient_aadhaar_card">ರೋಗಿ ಆಧಾರ್ ಕಾರ್ಡ್ ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||||
|
<string name="enter_aadhaar_number_manualy">ಆಧಾರ್ ಸಂಖ್ಯೆಯನ್ನು ಕೈಯಿಂದ ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="aadhaar_number">ಆಧಾರ್ ಸಂಖ್ಯೆ</string>
|
||||||
|
<string name="aadhaar_in_tv"><b>ಆಧಾರ್ ಸಂಖ್ಯೆ</b></string>
|
||||||
|
<string name="please_use_official_abha_app_to_create_abha_id_and_come_back">ದಯವಿಟ್ಟು "ಆಧಿಕಾರಿ ABHA ಆಪ್" ಅನ್ನು ಬಳಸಿ ABHA ಐಡಿ ರಚಿಸಿ ಮತ್ತು ಹಿಂತಿರುಗಿ ಬನ್ನಿ.</string>
|
||||||
|
<string name="please_enter_aadhaar">ಮುಂದುವರಿಸಲು ದಯವಿಟ್ಟು ಆಧಾರ್ ಸಂಖ್ಯೆಯನ್ನು ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="scan_qr_code_of_the_kit">ಕಿಟ್ ಯಾವಾಗಲೂ QR ಕೋಡ್ ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</string>
|
||||||
|
<string name="enter_kit_serial_number_manually">ಕಿಟ್ ಸೀರಿಯಲ್ ಸಂಖ್ಯೆಯನ್ನು ಕೈಯಿಂದ ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="serial_number">ಸೀರಿಯಲ್ ಸಂಖ್ಯೆ</string>
|
||||||
|
<string name="set_baseline_reference_again">ಬೇಸ್ಲೈನ್/ಸಂದರ್ಭ ಹೊಂದಿಸಿರಾ?</string>
|
||||||
|
<string name="baseline_instruction">ಬೇಸ್ಲೈನ್ ನಿರ್ದೇಶನ</string>
|
||||||
|
<string name="to_be_launched_in_next_version_of_the_app">ಮುಂದಿನ ಆಪ್ ಆವೃತ್ತಿಯಲ್ಲಿ ಪ್ರಕಟಿಸಲಾಗಿದೆ</string>
|
||||||
|
<string name="invalid_kit">ಅಮಾನ್ಯ ಕಿಟ್ ಸೀರಿಯಲ್ ಸಂಖ್ಯೆ, ಶರಿಯಾದ ಉದಾಹರಣೆ, SMI/SC/019/01/001</string>
|
||||||
|
<string name="user_list">ಬಳಕೆದಾರ ಪಟ್ಟಿ</string>
|
||||||
|
<string name="user_id">ಬಳಕೆದಾರ ಐಡಿ</string>
|
||||||
|
<string name="aadhar_id">ಆಧಾರ್ ಐಡಿ</string>
|
||||||
|
<string name="internet_not_available_please_enter_the_user_id_manually">ಇಂಟರ್ನೆಟ್ ಇಲ್ಲದೆ, ದಯವಿಟ್ಟು ಬಳಕೆದಾರ ಐಡಿ ಮತ್ತು ರಕ್ತ ಗುಂಪುವನ್ನು ಕೈಯಿಂದ ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="user_id_error_message">ಬಳಕೆದಾರ ಐಡಿ 18 ಅಂಕಗಳಿರಬೇಕು ಮತ್ತು ದಯವಿಟ್ಟು ರಕ್ತ ಗುಂಪುವನ್ನು ಆಯ್ಕೆ ಮಾಡಿ</string>
|
||||||
|
<string name="upload_db_registration_title">ಸ್ಥಾನಿಕ DB ಪರೀಕ್ಷೆಗಳನ್ನು ಅಪ್ಲೋಡ್ ಮಾಡಿ</string>
|
||||||
|
<string name="upload_db_registration_message">ನೀವು ಸ್ಥಾನಿಕ DB ಪರೀಕ್ಷೆಗಳನ್ನು ಕ್ಲೌಡ್ಗೆ ಅಪ್ಲೋಡ್ ಮಾಡಲು ಬಯಸುತ್ತೀರಾ?</string>
|
||||||
|
<string name="upload">ಅಪ್ಲೋಡ್ ಮಾಡಿ</string>
|
||||||
|
<string name="cancel">ರದ್ದು ಮಾಡಿ</string>
|
||||||
|
<string name="upload_success_message">ಯಶಸ್ವಿಯಾಗಿ ಅಪ್ಲೋಡ್ ಮಾಡಲಾಗಿದೆ</string>
|
||||||
|
<string name="test_completed">ಪರೀಕ್ಷೆ ಮುಗಿಯಿತು</string>
|
||||||
|
<string name="select_blood_group">ರಕ್ತ ಗುಂಪು ಆಯ್ಕೆಮಾಡಿ</string>
|
||||||
|
<string name="all_registered_user_are_tested_successfully">ಎಲ್ಲಾ ನೋಂದಣಿಗೆ ಬಂದ ಬಳಕೆದಾರರನ್ನು ಯಶಸ್ವಿಯಾಗಿ ಪರೀಕ್ಷಿಸಲಾಗಿದೆ</string>
|
||||||
|
<string name="start_incubation">ಇನ್ಕ್ಯೂಬೇಶನ್ ಆರಂಭ</string>
|
||||||
|
<string name="check_buffer">ಬಫರ್ ಚೆಕ್ ಮಾಡಿ</string>
|
||||||
|
<!-- Kannada Translations -->
|
||||||
|
<string name="low_battery_warning">ಬ್ಯಾಟರಿ ಸ್ತರ 40% ಕ್ಕಿಂತ ಕಡಿಮೆಯಾಗಿದೆ, ದಯವಿಟ್ಟು ಸಾಧನವನ್ನು ಮುಂದುವರಿಸಲು ಸಾಧನವನ್ನು ಚಾರ್ಜ್ ಮಾಡಿ</string>
|
||||||
|
<string name="test_already_conducted">ಈ ಬಳಕೆದಾರನ ಮೇಲೆ ಪರೀಕ್ಷೆ ಇನ್ನು ಮುಗಿದಿದೆ</string>
|
||||||
|
<string name="incubation_not_completed">ಇನ್ಕ್ಯೂಬೇಷನ್ ಹತ್ತಿಲ್ಲ 15 ನಿಮಿಷಗಳ ಪೂರ್ತಿ ಆಗಿಲ್ಲ</string>
|
||||||
|
<string name="incubation_crossed_30_minutes">ಇನ್ಕ್ಯೂಬೇಷನ್ 30 ನಿಮಿಷಗಳನ್ನು ದಾಟಿದೆ, ಇನ್ನೊಮ್ಮೆ ಇನ್ಕ್ಯೂಬೇಷನ್ ಮಾಡಬೇಕಾಗಿದೆ</string>
|
||||||
|
<string name="incubation_not_started">ಈ ಬಳಕೆದಾರನ ಮೇಲೆ ಇನ್ಕ್ಯೂಬೇಷನ್ ಆರಂಭವಾಗಿಲ್ಲ</string>
|
||||||
|
<string name="test_concluded">ಪರೀಕ್ಷೆ ಮುಗಿಯಿತು</string>
|
||||||
|
<string name="test_pending">ಪರೀಕ್ಷೆ ಬಾಕಿ ಇದೆ</string>
|
||||||
|
<string name="blood_group_error">ದಯವಿಟ್ಟು ನಿಮ್ಮ ರಕ್ತ ಗುಂಡಾರವನ್ನು ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="blood_group_toast">ದಯವಿಟ್ಟು ನಿಮ್ಮ ರಕ್ತ ಗುಂಡಾರವನ್ನು ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="blood_group_updated_successfully">ರಕ್ತ ಗುಂಡಾರ ಯಶಸ್ವಿಯಾಗಿ ನವೀಕರಿಸಲಾಗಿದೆ</string>
|
||||||
|
<string name="failed_to_update_blood_group">ರಕ್ತ ಗುಂಡಾರ ನವೀಕರಿಸಲು ವಿಫಲವಾಗಿದೆ: %1$s</string>
|
||||||
|
<string name="no_user_data_found">ನೀರು ನಿರ್ದಿಷ್ಟ ಐಡಿಗೆ ಯಾವುದೇ ಬಳಕೆದಾರ ಡೇಟಾ ಕಂಡುಬಂದಿಲ್ಲ</string>
|
||||||
|
<string name="device_disconnected">ಸಾಧನ ಹಂಚಿಹೋಯಿತು</string>
|
||||||
|
<string name="no_device_found">ಯಾವುದೇ ಸಾಧನ ಕಂಡುಬಂದಿಲ್ಲ</string>
|
||||||
|
<string name="invalid_kit_number">ಅಮಾನ್ಯವಾದ ಕಿಟ್ ಸಂಖ್ಯೆ</string>
|
||||||
|
<string name="internt_not">ಇಂಟರ್ನೆಟ್ ಲಭ್ಯವಿಲ್ಲ</string>
|
||||||
|
<string name="internt_not_local">ಇಂಟರ್ನೆಟ್ ಲಭ್ಯವಿಲ್ಲ, ಪರೀಕ್ಷೆ ವಿವರಗಳನ್ನು ಸ್ಥಾನಿಕವಾಗಿ ಉಳಿಸಲಾಗಿದೆ</string>
|
||||||
|
<string name="error_local">ಡೇಟಾ ಅಪ್ಲೋಡ್ ಮಾಡುವಾಗ ತಪ್ಪಾಗಿದೆ, ಪರೀಕ್ಷೆ ವಿವರಗಳನ್ನು ಸ್ಥಾನಿಕವಾಗಿ ಉಳಿಸಲಾಗಿದೆ</string>
|
||||||
|
<string name="error_exist">ಇನ್ನೊಂದು ಬಫರ್ ಪಡೆಯುವಾಗ ತಪ್ಪಾಗಿದೆ</string>
|
||||||
|
<string name="do_exist">ನೀವು ಇನ್ನೊಂದು ಬಫರ್ ಜಾರಿಗೆ ಹೋಗಲು ಇಚ್ಛಿಸುತ್ತಾರಾ?</string>
|
||||||
|
<string name="test_go_noback">ಪರೀಕ್ಷೆ ಜರುಗುತ್ತಿದೆ, ಹಿಂತಿರುಗಲು ಸಾಧ್ಯವಿಲ್ಲ</string>
|
||||||
|
<string name="kit_uploaded">ಕಿಟ್ ಪರಿಣಾಮ ಯಶಸ್ವಿಯಾಗಿ ಅಪ್ಲೋಡ್ ಆಗಿದೆ</string>
|
||||||
|
<string name="kit_upload_failed">ಕಿಟ್ ಪರಿಣಾಮ ಅಪ್ಲೋಡ್ ಆಗಲಿಲ್ಲ, ಅದನ್ನು ಕೈಯಾರೆ ಹೊಸದಾಗಿ ಬರೆಯಿರಿ</string>
|
||||||
|
<string name="test_ongoing">ಪರೀಕ್ಷೆ ಜರುಗುತ್ತಿದೆ</string>
|
||||||
|
<string name="error_classification">ವರ್ಗೀಕರಣ ನಡೆಸುವಾಗ ತಪ್ಪಾಗಿದೆ</string>
|
||||||
|
<string name="test_upload">ಪರೀಕ್ಷೆ ಫಲಿತಾಂಶ ಯಶಸ್ವಿಯಾಗಿ ಅಪ್ಲೋಡ್ ಆಗಿದೆ</string>
|
||||||
|
<string name="test_upload_failed">ಪರೀಕ್ಷೆ ಫಲಿತಾಂಶ ಅಪ್ಲೋಡ್ ಆಗಲಿಲ್ಲ</string>
|
||||||
|
<string name="log_out">ಲಾಗೌಟ್ ಮಾಡಿ</string>
|
||||||
|
<string name="do_log_out">ನೀವು ಅಪ್ಲಿಕೇಶನ್ ನಿಂದ ಲಾಗೌಟ್ ಮಾಡಲು ಬಯಸುತ್ತಿದ್ದೀರಾ?</string>
|
||||||
|
<string name="cancelled_unable_scan">ರದ್ದು ಮಾಡಲಾಗಿದೆ: ಸ್ಕ್ಯಾನ್ ಮಾಡಲು ಸಾಧ್ಯವಿಲ್ಲ, ಮತ್ತೊಮ್ಮೆ ಪ್ರಯಾಸಿಸಿ!!</string>
|
||||||
|
<string name="kit_updated">ಕಿಟ್ ಸಂಖ್ಯೆ ನವೀಕರಿಸಲಾಗಿದೆ, ದಯವಿಟ್ಟು ಟೆಸ್ಟ್ ಆರಂಭಿಸುವ ಮೊದಲು ಬಳಸುವವನನ್ನು ಆಯ್ಕೆಮಾಡಿ</string>
|
||||||
|
<string name="select_patient">ದಯವಿಟ್ಟು ಟೆಸ್ಟ್ ಆರಂಭಿಸುವ ಮೊದಲು ರೋಗಿಯನ್ನು ಆಯ್ಕೆಮಾಡಿ</string>
|
||||||
|
<string name="enable_location">ದಯವಿಟ್ಟು ಸ್ಥಾನ ಸೇವೆಗಳನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ</string>
|
||||||
|
<string name="location_denied">ಸರಿಯಾದ ಸ್ಥಾನ ಅನುಮತಿ ನಿರಾಕರಿಸಲಾಗಿದೆ</string>
|
||||||
|
<string name="coarse_location_denied">ಅಲ್ಪ ಸರಿಯಾದ ಸ್ಥಾನ ಅನುಮತಿ ನಿರಾಕರಿಸಲಾಗಿದೆ</string>
|
||||||
|
<string name="permission_grant">ನೀವು ಈ ಅಪ್ಲಿಕೇಶನ್ ಬಳಸಲು ಎಲ್ಲಾ ಫೈಲ್ಗಳಿಗೆ ಪ್ರವೇಶ ಅನುಮತಿ ನೀಡಬೇಕು</string>
|
||||||
|
<string name="permission_required">ಈ ಅಪ್ಲಿಕೇಶನ್ ಬಳಸಲು ಎಲ್ಲಾ ಅನುಮತಿಗಳು ಅಗತ್ಯವಿವೆ.</string>
|
||||||
|
<string name="device_not">ಡೆವೈಸ್ ಸಂಪರ್ಕಿಸಲಾಗಿಲ್ಲ.</string>
|
||||||
|
<string name="enter_proper_login_id">ದಯವಿಟ್ಟು ಸರಿಯಾದ ಲಾಗಿನ್ ಐಡಿ ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="enter_proper_password">ದಯವಿಟ್ಟು ಸರಿಯಾದ ಪಾಸ್ವರ್ಡ್ ನಮೂದಿಸಿ</string>
|
||||||
|
<string name="wrong_password">ತಪ್ಪಾದ ಪಾಸ್ವರ್ಡ್</string>
|
||||||
|
<string name="wrong_user_id">ತಪ್ಪಾದ ಬಳಕೆದಾರ ಐಡಿ</string>
|
||||||
|
<string name="error_invalid_test">ಅಮಾನ್ಯ ಟೆಸ್ಟ್. ಡಿ-ಆಕ್ಸಿಜನೇಷನ್ ಸಮಸ್ಯೆ</string>
|
||||||
|
<string name="error_negative_abs">ದೋಷ: ನೆಗೆಟಿವ್ ಆಬ್ಸ್. ಬ್ಲ್ಯಾಂಕ್ ರೀಡಿಂಗ್ ಪುನಃ ತೆಗೆದುಕೊಳ್ಳಿ</string>
|
||||||
|
<string name="error_improper_buffer_high">ದೋಷ: ಅಮಾನ್ಯ ಟೆಸ್ಟ್. ಬಫರ್ ರೀಡಿಂಗ್ ಅಸರವಿಲ್ಲ (ಹೈ)</string>
|
||||||
|
<string name="error_improper_buffer_low">ದೋಷ: ಅಮಾನ್ಯ ಟೆಸ್ಟ್. ಬಫರ್ ರೀಡಿಂಗ್ ಅಸರವಿಲ್ಲ (ಲೋ)</string>
|
||||||
|
<string name="error_processing_device_data">ಡೇಟಾ ಪ್ರಕ್ರಿಯಿಸುವಾಗ ದೋಷ</string>
|
||||||
|
<string name="error_repeat_test_lower_volume">ಅಮಾನ್ಯ. ರೇಟ್ ಹೆಚ್ಚುವ ಹೊರತು ಪುನಃ ಟೆಸ್ಟ್ ಮಾಡಿ</string>
|
||||||
|
<string name="error_repeat_test_higher_volume">ಅಮಾನ್ಯ. ಅತ್ಯಂತ ಕಡಿಮೆ ಅಭ್ಸರ್ಬೆನ್ಸ್ - ಹೆಚ್ಚು ಹೊರತು ಪುನಃ ಟೆಸ್ಟ್</string>
|
||||||
|
<string name="positive_for_sickle_cell">ಸಿಕ್ಲ್ ಸೆಲ್ ಸಾಕಾರಿ. HPLC ದೃಢೀಕರಣಕ್ಕಾಗಿ</string>
|
||||||
|
<string name="something_wrong_with_device">ಸಾಧನದಲ್ಲಿ ಏನಾದರೂ ತಪ್ಪಾಗಿದೆ, ದಯವಿಟ್ಟು ಸಾಧನವನ್ನು ಹತ್ತಿರಕ್ಕೆ ತರಿಸಿ ಮತ್ತೆ ಬಳಸಿ ಬಳಸಿ ಬಳಸಿ ಪರೀಕ್ಷಿಸಿ</string>
|
||||||
|
<string name="processing_result">ಪ್ರಕ್ರಿಯಿಸುತ್ತಿದೆ ಫಲಿತ</string>
|
||||||
|
<string name="data_collected_processing_data">ಸಮಿತಿ ಸೇರಿಸಿದ ಡೇಟಾ, ಡೇಟಾ ಪ್ರಕ್ರಿಯಿಸುತ್ತಿದೆ</string>
|
||||||
|
<string name="sample_completed">ನಮೂನೆ ಪೂರ್ಣಗೊಂಡಿದೆ</string>
|
||||||
|
<string name="gathering_data">ಡೇಟಾ ಸಂಗ್ರಹಿಸುತ್ತಿದೆ</string>
|
||||||
|
<string name="sample_started">ನಮೂನೆ ಪ್ರಾರಂಭವಾಗಿದೆ</string>
|
||||||
|
<string name="buffer_completed">ಬಫರ್ ಪೂರ್ಣಗೊಂಡಿದೆ</string>
|
||||||
|
<string name="buffer_started">ಬಫರ್ ಪ್ರಾರಂಭವಾಗಿದೆ</string>
|
||||||
|
<string name="start">ಆರಂಭ</string>
|
||||||
|
<string name="place_sample">ನಮೂನೆ ಇಟ್ಟುಕೊಳ್ಳಿ</string>
|
||||||
|
<string name="invalid">ಅಮಾನ್ಯ</string>
|
||||||
|
<string name="error">ದೋಷ</string>
|
||||||
|
|
||||||
|
</resources>
|
||||||
16
app/src/main/res/values/arrays.xml
Normal file
16
app/src/main/res/values/arrays.xml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<string-array name="languages">
|
||||||
|
<item>English</item>
|
||||||
|
<item>Kannada</item>
|
||||||
|
<!-- Add more languages as needed -->
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="language_values">
|
||||||
|
<item>en</item>
|
||||||
|
<item>ka</item>
|
||||||
|
<!-- Use language codes (e.g., en, kn) as values -->
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
</resources>
|
||||||
@@ -67,7 +67,6 @@
|
|||||||
<!-- <string name="step4"><b><u>Step 1</u> : </b> Place the cuvette containing sample for experiment.</string>-->
|
<!-- <string name="step4"><b><u>Step 1</u> : </b> Place the cuvette containing sample for experiment.</string>-->
|
||||||
<string name="step4"><b><u>Step 1</u> : </b> Place the cuvette containing blood sample mixed with kit solution.</string>
|
<string name="step4"><b><u>Step 1</u> : </b> Place the cuvette containing blood sample mixed with kit solution.</string>
|
||||||
<string name="step5"><b><u>Step 2</u> : </b> Press the button below to start the device reading values.</string>
|
<string name="step5"><b><u>Step 2</u> : </b> Press the button below to start the device reading values.</string>
|
||||||
|
|
||||||
<string name="login_id">Login ID</string>
|
<string name="login_id">Login ID</string>
|
||||||
<string name="password">Password</string>
|
<string name="password">Password</string>
|
||||||
<string name="login">Login</string>
|
<string name="login">Login</string>
|
||||||
@@ -80,7 +79,6 @@
|
|||||||
<string name="age_error">Age can\'t be empty</string>
|
<string name="age_error">Age can\'t be empty</string>
|
||||||
<string name="gender_error">Gender can\'t be empty</string>
|
<string name="gender_error">Gender can\'t be empty</string>
|
||||||
<string name="age_error_out_of_bound">Age should be valid</string>
|
<string name="age_error_out_of_bound">Age should be valid</string>
|
||||||
|
|
||||||
<string name="yob_error">Year of birth can\'t be empty</string>
|
<string name="yob_error">Year of birth can\'t be empty</string>
|
||||||
<string name="yob_error_2">Invalid Year of Birth</string>
|
<string name="yob_error_2">Invalid Year of Birth</string>
|
||||||
<string name="mobile_error">Mobile Number can\'t be empty</string>
|
<string name="mobile_error">Mobile Number can\'t be empty</string>
|
||||||
@@ -121,7 +119,7 @@
|
|||||||
<string name="recommended">\*Result to be confirmed with laboratory test</string>
|
<string name="recommended">\*Result to be confirmed with laboratory test</string>
|
||||||
<string name="recommended_age">\*Result to be confirmed with laboratory test as age of the patient is less than 5 years</string>
|
<string name="recommended_age">\*Result to be confirmed with laboratory test as age of the patient is less than 5 years</string>
|
||||||
<string name="positive_borderline">Positive Borderline</string>
|
<string name="positive_borderline">Positive Borderline</string>
|
||||||
<string name="negative_borderline">Negative Borderline</string>
|
<string name="negative_borderline">Negative Borderline, Repeat Test</string>
|
||||||
<string name="is_patient_under_any_medication">Is Patient under any medication or treatment?</string>
|
<string name="is_patient_under_any_medication">Is Patient under any medication or treatment?</string>
|
||||||
<string name="is_patient_undergoing_any_blood_transfusion">Is Patient undergoing any blood transfusion?</string>
|
<string name="is_patient_undergoing_any_blood_transfusion">Is Patient undergoing any blood transfusion?</string>
|
||||||
<string name="scan_aadhaar_card">Scan Aadhaar\nCard</string>
|
<string name="scan_aadhaar_card">Scan Aadhaar\nCard</string>
|
||||||
@@ -147,7 +145,6 @@
|
|||||||
<string name="nav_header_subtitle">sminnovations.in</string>
|
<string name="nav_header_subtitle">sminnovations.in</string>
|
||||||
<string name="nav_header_desc">Navigation header</string>
|
<string name="nav_header_desc">Navigation header</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
|
|
||||||
<string name="menu_home">Home</string>
|
<string name="menu_home">Home</string>
|
||||||
<string name="show_hemocube_result">Show Result</string>
|
<string name="show_hemocube_result">Show Result</string>
|
||||||
<string name="menu_gallery">Gallery</string>
|
<string name="menu_gallery">Gallery</string>
|
||||||
@@ -196,5 +193,67 @@
|
|||||||
<string name="all_registered_user_are_tested_successfully">All registered user are tested successfully</string>
|
<string name="all_registered_user_are_tested_successfully">All registered user are tested successfully</string>
|
||||||
<string name="start_incubation">Incubate</string>
|
<string name="start_incubation">Incubate</string>
|
||||||
<string name="check_buffer">Check Buffer</string>
|
<string name="check_buffer">Check Buffer</string>
|
||||||
|
<string name="low_battery_warning">Battery level is low than 40%, please charge the device to continue testing</string>
|
||||||
|
<string name="test_already_conducted">Test has been already conducted for this user</string>
|
||||||
|
<string name="incubation_not_completed">Incubation has not completed 15 minutes</string>
|
||||||
|
<string name="incubation_crossed_30_minutes">Incubation crossed 30 minutes, need to repeat the incubation</string>
|
||||||
|
<string name="incubation_not_started">Incubation not started for this user</string>
|
||||||
|
<string name="test_concluded">Test concluded</string>
|
||||||
|
<string name="test_pending">Test is Pending</string>
|
||||||
|
<string name="blood_group_error">Please enter your blood group</string>
|
||||||
|
<string name="blood_group_toast">Please enter your blood group</string>
|
||||||
|
<string name="blood_group_updated_successfully">Blood group updated successfully</string>
|
||||||
|
<string name="failed_to_update_blood_group">Failed to update blood group: %1$s</string>
|
||||||
|
<string name="no_user_data_found">No user data found for the specified ID</string>
|
||||||
|
<string name="device_disconnected">Device is Disconnected</string>
|
||||||
|
<string name="no_device_found">No device found</string>
|
||||||
|
<string name="invalid_kit_number">Invalid KIT Number</string>
|
||||||
|
<string name="internt_not">Internet is Not Available</string>
|
||||||
|
<string name="internt_not_local">Internet not available, test details stored locally</string>
|
||||||
|
<string name="error_local">Error uploading data, test details stored locally</string>
|
||||||
|
<string name="error_exist">error while getting existing buffer</string>
|
||||||
|
<string name="do_exist">Do you want to continue with existing buffer?</string>
|
||||||
|
<string name="kit_uploaded">Kit result uploaded successfully</string>
|
||||||
|
<string name="kit_upload_failed">Kit result uploading failed, note it down manually</string>
|
||||||
|
<string name="test_ongoing">test is going on</string>
|
||||||
|
<string name="test_go_noback">test is going on, can\'t go back</string>
|
||||||
|
<string name="error_classification">error while performing classification</string>
|
||||||
|
<string name="test_upload">Test Results Uploaded Successfully</string>
|
||||||
|
<string name="test_upload_failed">Test Results Upload Failed</string>
|
||||||
|
<string name="log_out">LOG OUT</string>
|
||||||
|
<string name="do_log_out">Do you want to LogOut the Application?</string>
|
||||||
|
<string name="cancelled_unable_scan">Cancelled: Unable to scan, Try Again!!</string>
|
||||||
|
<string name="kit_updated">Kit number is updated, Please Select user before starting test</string>
|
||||||
|
<string name="select_patient">Please Select patient before starting test</string>
|
||||||
|
<string name="enable_location">Please enable location services</string>
|
||||||
|
<string name="location_denied">Fine location permission denied</string>
|
||||||
|
<string name="coarse_location_denied">Coarse location permission denied</string>
|
||||||
|
<string name="permission_grant">You must grant permission to access all files to use the app</string>
|
||||||
|
<string name="permission_required">All permissions are required to use the app.</string>
|
||||||
|
<string name="device_not">Device Not Connected.</string>
|
||||||
|
<string name="enter_proper_login_id">Please enter a proper Login ID</string>
|
||||||
|
<string name="enter_proper_password">Please enter a proper password</string>
|
||||||
|
<string name="wrong_password">Wrong Password</string>
|
||||||
|
<string name="wrong_user_id">Wrong UserID</string>
|
||||||
|
<string name="error_invalid_test">Invalid Test. Problem with de-oxygenation</string>
|
||||||
|
<string name="error_negative_abs">Error: Negative Abs. Retake Blank Reading</string>
|
||||||
|
<string name="error_improper_buffer_high">Error: Invalid Test. Improper buffer reading (high)</string>
|
||||||
|
<string name="error_improper_buffer_low">Error: Invalid Test. Improper buffer reading (low)</string>
|
||||||
|
<string name="error_processing_device_data">error while processing device data</string>
|
||||||
|
<string name="error_repeat_test_lower_volume">Inconclusive. Repeat with test with lower volume of blood</string>
|
||||||
|
<string name="error_repeat_test_higher_volume">Inconclusive. Very low Absorbance - Repeat test with Higher Blood Volume</string>
|
||||||
|
<string name="positive_for_sickle_cell">Positive for Sickle Cell. HPLC for Confirmation</string>
|
||||||
|
<string name="something_wrong_with_device">Something is wrong with the device, please disconnect and reconnect the device and test the user again</string>
|
||||||
|
<string name="processing_result">processing result</string>
|
||||||
|
<string name="data_collected_processing_data">Data collected, Processing data</string>
|
||||||
|
<string name="sample_completed">Sample Completed</string>
|
||||||
|
<string name="gathering_data">Gathering data</string>
|
||||||
|
<string name="sample_started">Sample Started</string>
|
||||||
|
<string name="buffer_completed">Buffer Completed</string>
|
||||||
|
<string name="buffer_started">Buffer Started</string>
|
||||||
|
<string name="start">Start</string>
|
||||||
|
<string name="place_sample">Place Sample</string>
|
||||||
|
<string name="invalid">Invalid</string>
|
||||||
|
<string name="error">Error</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
15
app/src/main/res/xml/settings.xml
Normal file
15
app/src/main/res/xml/settings.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:title="Language Settings">
|
||||||
|
|
||||||
|
<!-- Spinner to select language -->
|
||||||
|
<Preference
|
||||||
|
android:key="language_preference"
|
||||||
|
android:title="Select Language"
|
||||||
|
android:summary="Choose your preferred language"
|
||||||
|
android:dialogTitle="Select Language"
|
||||||
|
android:widgetLayout="@layout/language_spinner_preference"/>
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
package com.example.hpostesting
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.content.SharedPreferences
|
|
||||||
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
|
|
||||||
import androidx.lifecycle.LiveData
|
|
||||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
|
||||||
import com.example.hpostesting.data.model.Response
|
|
||||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
|
||||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
|
||||||
import com.example.hpostesting.data.repository.DatabaseRepository
|
|
||||||
import com.example.hpostesting.data.repository.Repository
|
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeFragment
|
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
|
||||||
import com.example.hpostesting.presentation.hemocube.HemocubeActivity
|
|
||||||
import com.example.hpostesting.util.TestCoroutineRule
|
|
||||||
import `in`.sminnovations.hpostesting.databinding.FragmentHemoCubeReferenceBinding
|
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
|
||||||
import kotlinx.coroutines.test.advanceUntilIdle
|
|
||||||
import kotlinx.coroutines.test.runBlockingTest
|
|
||||||
import org.junit.Assert.assertEquals
|
|
||||||
import org.junit.Before
|
|
||||||
import org.junit.Rule
|
|
||||||
import org.junit.Test
|
|
||||||
import org.mockito.ArgumentMatchers.any
|
|
||||||
import org.mockito.ArgumentMatchers.anyString
|
|
||||||
import org.mockito.Mock
|
|
||||||
import org.mockito.Mockito.verify
|
|
||||||
import org.mockito.Mockito.`when`
|
|
||||||
import org.mockito.MockitoAnnotations
|
|
||||||
|
|
||||||
@ExperimentalCoroutinesApi
|
|
||||||
class HemoCubeViewModelTest {
|
|
||||||
|
|
||||||
// Add rule for testing LiveData
|
|
||||||
@get:Rule
|
|
||||||
val rule = InstantTaskExecutorRule()
|
|
||||||
|
|
||||||
// Add rule for testing coroutines
|
|
||||||
@get:Rule
|
|
||||||
val coroutineRule = TestCoroutineRule()
|
|
||||||
|
|
||||||
// Mock dependencies
|
|
||||||
@Mock
|
|
||||||
lateinit var hemoCubeDao: HemoCubeDao
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
lateinit var repository: Repository
|
|
||||||
|
|
||||||
// Mock context
|
|
||||||
@Mock
|
|
||||||
lateinit var context: Context
|
|
||||||
|
|
||||||
// Mock LiveData for testing
|
|
||||||
@Mock
|
|
||||||
lateinit var networkStatusLiveData: LiveData<Boolean>
|
|
||||||
|
|
||||||
// Initialize the ViewModel
|
|
||||||
lateinit var viewModel: HemoCubeViewModel
|
|
||||||
|
|
||||||
private lateinit var hemoCubeFragment: HemoCubeFragment
|
|
||||||
|
|
||||||
@Before
|
|
||||||
fun setUp() {
|
|
||||||
MockitoAnnotations.initMocks(this)
|
|
||||||
// viewModel = HemoCubeViewModel(hemoCubeDao, repository, context)
|
|
||||||
hemoCubeFragment = HemoCubeFragment()
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `uploadHemoCubeResultToDatabase with online status should call addResultTestToDb`() =
|
|
||||||
coroutineRule.runBlockingTest {
|
|
||||||
// Mock data and setup
|
|
||||||
val isOnline = true
|
|
||||||
val testStatus = true
|
|
||||||
val kitSerial = "12345"
|
|
||||||
|
|
||||||
// Mock the necessary methods
|
|
||||||
`when`(repository.addTestToDatabase(viewModel.testDetails!!))
|
|
||||||
.thenReturn(Response.Success("Success"))
|
|
||||||
|
|
||||||
// Call the function to be tested
|
|
||||||
viewModel.uploadHemoCubeResultToDatabase(isOnline, testStatus, kitSerial)
|
|
||||||
|
|
||||||
// Verify that addResultTestToDb is called
|
|
||||||
advanceUntilIdle()
|
|
||||||
assertEquals("Local", viewModel.fireBaseUpload.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Similar tests can be written for other methods in HemoCubeViewModel
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private lateinit var mockSharedPreferences: SharedPreferences
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private lateinit var mockActivity: HemocubeActivity // Replace with your actual Activity class
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private lateinit var mockBinding: FragmentHemoCubeReferenceBinding // Replace with your actual Binding class
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `findResult with valid input`() {
|
|
||||||
// Arrange
|
|
||||||
val validString = "valid string"
|
|
||||||
val fullReadOutput = "full read output"
|
|
||||||
`when`(mockSharedPreferences.getString(anyString(), anyString())).thenReturn("dummy_value")
|
|
||||||
`when`(mockActivity.runOnUiThread(any())).thenAnswer {
|
|
||||||
val runnable = it.getArgument(0, Runnable::class.java)
|
|
||||||
runnable.run()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Act
|
|
||||||
val result = hemoCubeFragment.findResult(calculatedRatio = 0.06)
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
// Add appropriate assertions based on the behavior you expect
|
|
||||||
// verify(mockSharedPreferences).edit()
|
|
||||||
// verify(mockBinding).btnSubmit.visibility = View.VISIBLE
|
|
||||||
// verify(mockBinding).btnSubmit.isEnabled = true
|
|
||||||
// Add more verifications as needed
|
|
||||||
|
|
||||||
assertEquals("Normal", result)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user