Compare commits
102 Commits
HposUnitTe
...
preprod
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
039e17a3b8 | ||
|
|
f54af3c877 | ||
|
|
0149ec7111 | ||
|
|
c02bd1ba2e | ||
|
|
f6b1b83f24 | ||
|
|
7a4b68690d | ||
|
|
9183c97aef | ||
|
|
72f1231d93 | ||
|
|
dcf340a3a0 | ||
|
|
c573390082 | ||
|
|
48b2fefd02 | ||
|
|
59aefacec1 | ||
|
|
d1b5ca32bf | ||
|
|
3e690345c2 | ||
|
|
4f7aa74314 | ||
|
|
590abb5c73 | ||
|
|
7fe8202968 | ||
|
|
11d4c99e02 | ||
|
|
2e700601fe | ||
|
|
41798aa37b | ||
|
|
e7600dafec | ||
|
|
d6b3df25f8 | ||
|
|
0d7e8b0cd0 | ||
|
|
3c8570c46b | ||
|
|
96f9d4d6da | ||
|
|
e7505077ce | ||
|
|
41e30cf178 | ||
|
|
a34c095fde | ||
|
|
80fa523ec9 | ||
|
|
7a2e5ead51 | ||
|
|
f109c52288 | ||
|
|
a3a5c0d6fb | ||
|
|
fb5e6f3b49 | ||
|
|
8a22b44496 | ||
|
|
10d822c5d6 | ||
|
|
4a248f7c49 | ||
|
|
2123b2a7b4 | ||
|
|
704223e403 | ||
|
|
6097a05701 | ||
|
|
290bf77950 | ||
|
|
ad595a6299 | ||
|
|
7233305ca3 | ||
|
|
22bf66fc94 | ||
|
|
1dd66bcd6e | ||
|
|
a02ba3e9ea | ||
|
|
457c652161 | ||
|
|
5bebd88dfd | ||
|
|
657b9aea65 | ||
|
|
90590ee535 | ||
|
|
3d39c43c22 | ||
|
|
6fa5e760c1 | ||
|
|
8940352e05 | ||
|
|
47fabf036f | ||
|
|
d7a41e8f31 | ||
|
|
f26f3098bb | ||
|
|
4d454ea031 | ||
|
|
e92a80caec | ||
|
|
28bd9cbd43 | ||
|
|
fc3e4d506a | ||
|
|
60fbd70f2d | ||
|
|
7f2cafeef4 | ||
|
|
b37d3f1fce | ||
|
|
1d22fa54c9 | ||
|
|
3b3bc1adf4 | ||
|
|
a1206dbe0d | ||
|
|
6e9850c492 | ||
|
|
5982ce822f | ||
|
|
5c32a17871 | ||
|
|
16528bd165 | ||
|
|
f86caf0448 | ||
|
|
a7a57c7ff4 | ||
|
|
3c70142c15 | ||
|
|
467dde9a24 | ||
|
|
ae50d6a603 | ||
|
|
c0825a1c58 | ||
|
|
78763d8624 | ||
|
|
fcac603ce0 | ||
|
|
0a2f1ba2fd | ||
|
|
dcc7a921a0 | ||
|
|
b6f8999078 | ||
|
|
84e2a4bed9 | ||
|
|
74ad03bf8b | ||
|
|
f00a639028 | ||
|
|
d3083c8dbc | ||
|
|
29846ddf7d | ||
|
|
9deac8e278 | ||
|
|
264c4ebe74 | ||
|
|
2a976caac5 | ||
|
|
fb61b89850 | ||
|
|
e42183099c | ||
|
|
bf9288d0a1 | ||
|
|
d57bc713d1 | ||
|
|
f37cfb57e1 | ||
|
|
9d86d874af | ||
|
|
f0d0740cd7 | ||
|
|
27949352dd | ||
|
|
36eb659e3a | ||
|
|
2d0f11cfb2 | ||
|
|
3e8933de1b | ||
|
|
edf1d70608 | ||
|
|
a6d57fb52a | ||
|
|
e613bbd12b |
3
.idea/gradle.xml
generated
3
.idea/gradle.xml
generated
@@ -4,8 +4,6 @@
|
|||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
<option name="testRunner" value="GRADLE" />
|
|
||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleJvm" value="jbr-17" />
|
<option name="gradleJvm" value="jbr-17" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
@@ -14,6 +12,7 @@
|
|||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="$PROJECT_DIR$/app" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="resolveExternalAnnotations" value="false" />
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -14,12 +14,13 @@ android {
|
|||||||
compileSdk 34
|
compileSdk 34
|
||||||
namespace 'in.sminnovations.hpostesting'
|
namespace 'in.sminnovations.hpostesting'
|
||||||
|
|
||||||
|
// prod - production, preprod - preproduction, quality - qc
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "in.sminnovations.hpostesting"
|
applicationId "in.sminnovations.hpostesting.quality"
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 24
|
versionCode 68
|
||||||
versionName "2.1.24"
|
versionName "2.1.68"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@@ -48,15 +49,21 @@ 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'
|
||||||
implementation 'com.google.android.material:material:1.9.0'
|
implementation 'com.google.android.material:material:1.10.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
|
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
|
||||||
|
implementation 'androidx.fragment:fragment-ktx:1.6.2'
|
||||||
|
|
||||||
//firebase
|
//firebase
|
||||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||||
@@ -71,21 +78,29 @@ dependencies {
|
|||||||
implementation 'com.google.android.gms:play-services-location:21.0.1'
|
implementation 'com.google.android.gms:play-services-location:21.0.1'
|
||||||
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
|
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
|
||||||
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-beta10'
|
implementation 'com.google.firebase:firebase-appdistribution:16.0.0-beta11'
|
||||||
implementation("com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta10")
|
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
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||||
|
// Mockito dependencies
|
||||||
|
testImplementation 'org.mockito:mockito-core:3.12.4'
|
||||||
|
androidTestImplementation 'org.mockito:mockito-android:3.12.4'
|
||||||
|
androidTestImplementation 'org.mockito:mockito-inline:3.12.4'
|
||||||
|
testImplementation "androidx.arch.core:core-testing:2.2.0"
|
||||||
|
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'
|
||||||
@@ -97,25 +112,27 @@ 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"
|
||||||
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
|
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
|
||||||
|
|
||||||
|
implementation "androidx.preference:preference-ktx:1.2.1"
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,9 @@
|
|||||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission
|
||||||
|
android:name="android.permission.BATTERY_STATS"
|
||||||
|
tools:ignore="ProtectedPermissions" />
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.camera" />
|
<uses-feature android:name="android.hardware.camera" />
|
||||||
|
|
||||||
@@ -29,6 +32,9 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.HPOSTesting"
|
android:theme="@style/Theme.HPOSTesting"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
<activity
|
||||||
|
android:name="com.example.hpostesting.presentation.hemocube.DigitalCardActivity"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.diagnostics.DiagnosticsActivity"
|
android:name="com.example.hpostesting.presentation.diagnostics.DiagnosticsActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
@@ -55,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"
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ object Constants {
|
|||||||
const val DEVICE_VENDOR_ID = 1027
|
const val DEVICE_VENDOR_ID = 1027
|
||||||
const val HOMO_CUBE_ID = 29987
|
const val HOMO_CUBE_ID = 29987
|
||||||
const val VENDOR_ID = 6790
|
const val VENDOR_ID = 6790
|
||||||
|
const val HEMO_CUBE_V2_PRODUCT_ID = 24577
|
||||||
|
const val HEMO_CUBE_V2_VENDOR_ID = 1027
|
||||||
|
|
||||||
const val ERROR_NORMAL = 400
|
const val ERROR_NORMAL = 400
|
||||||
const val ERROR_CRITICAL = 401
|
const val ERROR_CRITICAL = 401
|
||||||
@@ -38,6 +40,7 @@ object Constants {
|
|||||||
const val USER_ID = "usernameId"
|
const val USER_ID = "usernameId"
|
||||||
|
|
||||||
val STATICID = listOf(
|
val STATICID = listOf(
|
||||||
|
"ADMIN",
|
||||||
"VIZ-1000-0004",
|
"VIZ-1000-0004",
|
||||||
"VIZ-1000-0005",
|
"VIZ-1000-0005",
|
||||||
"VIZ-1000-0006",
|
"VIZ-1000-0006",
|
||||||
@@ -61,6 +64,26 @@ object Constants {
|
|||||||
"HC-V1-018",
|
"HC-V1-018",
|
||||||
"HC-V1-019",
|
"HC-V1-019",
|
||||||
"HC-V1-020",
|
"HC-V1-020",
|
||||||
|
"HCV-000-3001",
|
||||||
|
"HCV-000-3002",
|
||||||
|
"HCV-000-3003",
|
||||||
|
"HCV-000-3004",
|
||||||
|
"HCV-000-3005",
|
||||||
|
"HCV-000-3006",
|
||||||
|
"HCV-000-3007",
|
||||||
|
"HCV-000-3008",
|
||||||
|
"HCV-000-3009",
|
||||||
|
"HCV-000-3010",
|
||||||
|
"HCV-000-3011",
|
||||||
|
"HCV-000-3012",
|
||||||
|
"HCV-000-3013",
|
||||||
|
"HCV-000-3014",
|
||||||
|
"HCV-000-3015",
|
||||||
|
"HCV-000-3016",
|
||||||
|
"HCV-000-3017",
|
||||||
|
"HCV-000-3018",
|
||||||
|
"HCV-000-3019",
|
||||||
|
"HCV-000-3020"
|
||||||
)
|
)
|
||||||
|
|
||||||
const val password = "SMI@12345"
|
const val password = "SMI@12345"
|
||||||
@@ -69,5 +92,289 @@ object Constants {
|
|||||||
const val KIT_COUNT = "KitCount"
|
const val KIT_COUNT = "KitCount"
|
||||||
const val BUFFER_VALUE_1 = "BufferValue1"
|
const val BUFFER_VALUE_1 = "BufferValue1"
|
||||||
const val BUFFER_VALUE_2 = "BufferValue2"
|
const val BUFFER_VALUE_2 = "BufferValue2"
|
||||||
|
const val BUFFER_VALUE_3 = "BufferValue3"
|
||||||
|
const val BUFFER_VALUE_4 = "BufferValue4"
|
||||||
const val DEVICE_ID = "DEVICE_ID"
|
const val DEVICE_ID = "DEVICE_ID"
|
||||||
|
|
||||||
|
const val BUFFER_LED_LOWER_BOUND = 21000
|
||||||
|
const val BUFFER_LED_UPPER_BOUND = 24500
|
||||||
|
|
||||||
|
const val TEST_STATUS_CODE_TEST_STARTED = 1.0
|
||||||
|
const val TEST_STATUS_CODE_CONFIG_STARTED = 2.0
|
||||||
|
const val TEST_STATUS_CODE_CONFIG_COMPLETED = 3.0
|
||||||
|
const val TEST_STATUS_CODE_BUFFER_STARTED = 4.0
|
||||||
|
const val TEST_STATUS_CODE_BUFFER_COMPLETED = 5.0
|
||||||
|
const val TEST_STATUS_CODE_BUFFER_PRINT_STARTED = 6.0
|
||||||
|
const val TEST_STATUS_CODE_BUFFER_PRINT_COMPLETED = 7.0
|
||||||
|
const val TEST_STATUS_CODE_SAMPLE_STARTED = 8.0
|
||||||
|
const val TEST_STATUS_CODE_SAMPLE_COMPLETED = 9.0
|
||||||
|
const val TEST_STATUS_CODE_SAMPLE_PRINT_STARTED = 10.0
|
||||||
|
const val TEST_STATUS_CODE_SAMPLE_PRINT_COMPLETED = 11.0
|
||||||
|
const val TEST_STATUS_CODE_FIRST_GAIN_STARTED = 12.0
|
||||||
|
const val TEST_STATUS_CODE_FIRST_GAIN_COMPLETED = 13.0
|
||||||
|
const val TEST_STATUS_CODE_FIRST_GAIN_PRINT_STARTED = 14.0
|
||||||
|
const val TEST_STATUS_CODE_FIRST_GAIN_PRINT_COMPLETED = 15.0
|
||||||
|
const val TEST_STATUS_CODE_SECOND_GAIN_STARTED = 16.0
|
||||||
|
const val TEST_STATUS_CODE_SECOND_GAIN_COMPLETED = 17.0
|
||||||
|
const val TEST_STATUS_CODE_SECOND_GAIN_PRINT_STARTED = 18.0
|
||||||
|
const val TEST_STATUS_CODE_SECOND_GAIN_PRINT_COMPLETED = 19.0
|
||||||
|
const val TEST_STATUS_CODE_THIRD_GAIN_STARTED = 20.0
|
||||||
|
const val TEST_STATUS_CODE_THIRD_GAIN_COMPLETED = 21.0
|
||||||
|
const val TEST_STATUS_CODE_THIRD_GAIN_PRINT_STARTED = 22.0
|
||||||
|
const val TEST_STATUS_CODE_THIRD_GAIN_PRINT_COMPLETED = 23.0
|
||||||
|
const val TEST_STATUS_CODE_FORTH_GAIN_STARTED = 24.0
|
||||||
|
const val TEST_STATUS_CODE_FORTH_GAIN_COMPLETED = 25.0
|
||||||
|
const val TEST_STATUS_CODE_FORTH_GAIN_PRINT_STARTED = 26.0
|
||||||
|
const val TEST_STATUS_CODE_FORTH_GAIN_PRINT_COMPLETED = 27.0
|
||||||
|
const val TEST_STATUS_CODE_TEST_COMPLETED = 30.0
|
||||||
|
|
||||||
|
val DEVICE_CONFIGURATION: Map<String, List<List<Double>>> = mapOf<String, List<List<Double>>>(
|
||||||
|
"HCV-000-3001" to listOf(
|
||||||
|
listOf(1.313, -0.89), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2012, 0.0092), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3002" to listOf(
|
||||||
|
listOf(0.723142, -0.09135), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.1964, 0.011565), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3003" to listOf(
|
||||||
|
listOf(0.723142, -0.09135), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.1964, 0.011565), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3004" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3005" to listOf(
|
||||||
|
listOf(1.3801, -0.372), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.4565, -0.0371), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3006" to listOf(
|
||||||
|
listOf(1.3801, -0.372), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.4565, -0.0371), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3007" to listOf(
|
||||||
|
listOf(1.8445, -0.8213), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.4613, -0.0831), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3008" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3009" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3010" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3011" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3012" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3013" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3014" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3015" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3016" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3017" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3018" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3019" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
"HCV-000-3020" to listOf(
|
||||||
|
listOf(1.7272, -1.1977), // LED1, 435nm
|
||||||
|
listOf(0.581462456, -0.58502), // LED2, 415nm
|
||||||
|
listOf(0.2304, -0.0145), // LED3, 555nm
|
||||||
|
listOf(1.0, 0.0) // LED4
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
const val INCUBATION_TIME_MIN = 0
|
||||||
|
const val INCUBATION_TIME_MAX = 1400
|
||||||
|
const val BATTERY_LEVEL_MIN = 0
|
||||||
|
|
||||||
|
val BUFFER_INTENSITY_THRESHOLDS: Map<String, List<List<Int>>> = mapOf<String, List<List<Int>>>(
|
||||||
|
"HCV-000-3001" to listOf(
|
||||||
|
listOf(20000, 25074),
|
||||||
|
listOf(20000, 24596),
|
||||||
|
listOf(20000, 26065),
|
||||||
|
listOf(20000, 27093),
|
||||||
|
),
|
||||||
|
"HCV-000-3002" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3003" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3004" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3005" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3006" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3007" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3008" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3009" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3010" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3011" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3012" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3013" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3014" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3015" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3016" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3017" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3018" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3019" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
"HCV-000-3020" to listOf(
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
listOf(24500, 26250),
|
||||||
|
),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,10 @@ enum class HemoCubeCommands(val command: String) {
|
|||||||
startBuffer("B\r"),
|
startBuffer("B\r"),
|
||||||
runDiagnostics("D\r"),
|
runDiagnostics("D\r"),
|
||||||
startSample("S\r"),
|
startSample("S\r"),
|
||||||
getSample("P\r"),
|
PRINT_COMMAND("P\r"),
|
||||||
getDeviceId("I\r"),
|
getDeviceId("I\r"),
|
||||||
|
FIRST_GAIN_COMMAND("T\r"),
|
||||||
|
SECOND_GAIN_COMMAND("U\r"),
|
||||||
|
THIRD_GAIN_COMMAND("V\r"),
|
||||||
|
FORTH_GAIN_COMMAND("W\r"),
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.example.hpostesting.data.constant
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
|
object LanguageManager {
|
||||||
|
private const val LANGUAGE_PREF_KEY = "language_pref"
|
||||||
|
|
||||||
|
fun setLocale(context: Context, languageCode: String) {
|
||||||
|
val locale = Locale(languageCode)
|
||||||
|
Locale.setDefault(locale)
|
||||||
|
|
||||||
|
val resources = context.resources
|
||||||
|
val configuration = resources.configuration
|
||||||
|
configuration.setLocale(locale)
|
||||||
|
|
||||||
|
context.createConfigurationContext(configuration)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun persistLanguagePreference(context: Context, languageCode: String) {
|
||||||
|
val prefs: SharedPreferences = context.getSharedPreferences("AppPrefs", Context.MODE_PRIVATE)
|
||||||
|
prefs.edit().putString(LANGUAGE_PREF_KEY, languageCode).apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getSavedLanguage(context: Context): String {
|
||||||
|
val prefs: SharedPreferences = context.getSharedPreferences("AppPrefs", Context.MODE_PRIVATE)
|
||||||
|
return prefs.getString(LANGUAGE_PREF_KEY, "en") ?: "en"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.example.hpostesting.data.dao
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.room.Dao
|
||||||
|
import androidx.room.Insert
|
||||||
|
import androidx.room.OnConflictStrategy
|
||||||
|
import androidx.room.Query
|
||||||
|
import com.example.hpostesting.data.model.patient.BufferCheckData
|
||||||
|
|
||||||
|
@Dao
|
||||||
|
interface HemoCubeBufferDao {
|
||||||
|
@Query("SELECT * from hemo_cube_buffer_test_table")
|
||||||
|
fun getAll(): LiveData<List<BufferCheckData>>
|
||||||
|
|
||||||
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||||
|
suspend fun insertAll(bufferCheckData: BufferCheckData)
|
||||||
|
|
||||||
|
@Query("SELECT * FROM hemo_cube_buffer_test_table WHERE _id = :id")
|
||||||
|
suspend fun getUserByID(id: String): BufferCheckData
|
||||||
|
|
||||||
|
@Query("DELETE FROM hemo_cube_buffer_test_table WHERE _id = :id")
|
||||||
|
suspend fun deleteById(id: String)
|
||||||
|
|
||||||
|
@Query("UPDATE hemo_cube_buffer_test_table SET localFlag = :newValue WHERE _id = :id")
|
||||||
|
suspend fun updateFieldById(id: String, newValue: Boolean)
|
||||||
|
}
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
package com.example.hpostesting.data.dao
|
package com.example.hpostesting.data.dao
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import androidx.room.Database
|
import androidx.room.Database
|
||||||
import androidx.room.Room
|
|
||||||
import androidx.room.RoomDatabase
|
import androidx.room.RoomDatabase
|
||||||
import androidx.room.TypeConverters
|
import androidx.room.TypeConverters
|
||||||
|
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.UserData
|
|
||||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||||
import com.google.android.datatransport.runtime.dagger.Provides
|
import com.example.hpostesting.data.model.patient.UserData
|
||||||
import javax.inject.Singleton
|
|
||||||
|
|
||||||
@Database(entities = [UserData::class, HemoCubeTestData::class, DeviceData::class], version = 3, exportSchema = false)
|
@Database(entities = [UserData::class, HemoCubeTestData::class, DeviceData::class], version = 17, exportSchema = false)
|
||||||
@TypeConverters(Converters::class)
|
@TypeConverters(Converters::class)
|
||||||
abstract class MyDatabase : RoomDatabase() {
|
abstract class MyDatabase : RoomDatabase() {
|
||||||
abstract fun userDao(): UserDao
|
abstract fun userDao(): UserDao
|
||||||
abstract fun hemoCubeDao(): HemoCubeDao
|
abstract fun hemoCubeDao(): HemoCubeDao
|
||||||
|
abstract fun hemoCubeBufferDao(): HemoCubeBufferDao
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,47 @@
|
|||||||
package com.example.hpostesting.data.model.patient
|
package com.example.hpostesting.data.model.patient
|
||||||
|
|
||||||
|
import androidx.room.Entity
|
||||||
|
import androidx.room.PrimaryKey
|
||||||
|
|
||||||
|
@Entity(tableName = "hemo_cube_buffer_test_table")
|
||||||
data class BufferCheckData(
|
data class BufferCheckData(
|
||||||
|
@PrimaryKey
|
||||||
|
var _id: String = "",
|
||||||
var kitno: String = "",
|
var kitno: String = "",
|
||||||
var deviceId: String? = "",
|
var deviceId: String? = "",
|
||||||
var appVersion:String? = "",
|
var appVersion:String? = "",
|
||||||
var deviceSerialNumber: String = "",
|
var deviceSerialNumber: String = "",
|
||||||
var deviceType: String = "HEMOCUBE",
|
var deviceType: String = "HEMOCUBE",
|
||||||
|
var localFlag: Boolean = false,
|
||||||
var resultData: String = "",
|
var resultData: String = "",
|
||||||
var led1Buffer: Double? = null,
|
var led1Buffer: Double? = null,
|
||||||
var led2Buffer: Double? = null,
|
var led2Buffer: Double? = null,
|
||||||
|
var led3Buffer: Double? = null,
|
||||||
|
var led4Buffer: Double? = null,
|
||||||
var led1Sample: Double? = null,
|
var led1Sample: Double? = null,
|
||||||
var led2Sample: Double? = null,
|
var led2Sample: Double? = null,
|
||||||
|
var led3Sample: Double? = null,
|
||||||
|
var led4Sample: Double? = null,
|
||||||
var led1Average: Double? = null,
|
var led1Average: Double? = null,
|
||||||
var led2Average: Double? = null,
|
var led2Average: Double? = null,
|
||||||
|
var led3Average: Double? = null,
|
||||||
|
var led4Average: Double? = null,
|
||||||
|
var abs1: Double? = null,
|
||||||
|
var abs2: Double? = null,
|
||||||
|
var abs3: Double? = null,
|
||||||
|
var abs4: Double? = null,
|
||||||
var deviceRatio: Double? = null,
|
var deviceRatio: Double? = null,
|
||||||
var calculatedRatio: Double? = null,
|
var calculatedRatio: Double? = null,
|
||||||
|
var predictedDenovixRatio: Double? = null,
|
||||||
var coefficients: String? = "",
|
var coefficients: String? = "",
|
||||||
var classificationResult: String = "",
|
var classificationResult: String = "",
|
||||||
var testTime: String = ""
|
var testTime: String = "",
|
||||||
|
var prdClassification: String = "",
|
||||||
|
var errorMessages: String = "",
|
||||||
|
var batteryLevel: String = "",
|
||||||
|
var batteryCapacity: String = "",
|
||||||
|
var batteryMaxCapacity: String = "",
|
||||||
|
var batteryTemperature: String = "",
|
||||||
|
var batteryVoltage: String = "",
|
||||||
|
var reportUploadTime: String? = "",
|
||||||
)
|
)
|
||||||
@@ -8,13 +8,18 @@ data class HemoCubeTestData(
|
|||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
var _id: String = "",
|
var _id: String = "",
|
||||||
var name: String = "",
|
var name: String = "",
|
||||||
|
var incubationTime: String = "",
|
||||||
|
var bloodGroup: String = "",
|
||||||
var birthYear: String = "",
|
var birthYear: String = "",
|
||||||
|
var state: String = "",
|
||||||
|
var abhaId: String = "",
|
||||||
var userImageURL: String = "",
|
var userImageURL: String = "",
|
||||||
var location: UserData.Location? = null,
|
var location: UserData.Location? = null,
|
||||||
var reportUploadTime: String? = "",
|
var reportUploadTime: String? = "",
|
||||||
var testType: String? = "HEMOCUBE",
|
var testType: String? = "HEMOCUBE",
|
||||||
var testTime: String? = "",
|
var testTime: String? = "",
|
||||||
var testStatus: Boolean? = false,
|
var testStatus: Boolean? = false,
|
||||||
|
var gender: String = "",
|
||||||
var localFlag: Boolean = false,
|
var localFlag: Boolean = false,
|
||||||
var deviceId: String? = "",
|
var deviceId: String? = "",
|
||||||
var appVersion:String? = "",
|
var appVersion:String? = "",
|
||||||
@@ -24,12 +29,49 @@ data class HemoCubeTestData(
|
|||||||
var resultData: String = "",
|
var resultData: String = "",
|
||||||
var led1Buffer: Double? = null,
|
var led1Buffer: Double? = null,
|
||||||
var led2Buffer: Double? = null,
|
var led2Buffer: Double? = null,
|
||||||
|
var led3Buffer: Double? = null,
|
||||||
|
var led4Buffer: Double? = null,
|
||||||
var led1Sample: Double? = null,
|
var led1Sample: Double? = null,
|
||||||
var led2Sample: Double? = null,
|
var led2Sample: Double? = null,
|
||||||
|
var led3Sample: Double? = null,
|
||||||
|
var led4Sample: Double? = null,
|
||||||
var led1Average: Double? = null,
|
var led1Average: Double? = null,
|
||||||
var led2Average: Double? = null,
|
var led2Average: Double? = null,
|
||||||
|
var led3Average: Double? = null,
|
||||||
|
var led4Average: Double? = null,
|
||||||
|
var abs1: Double? = null,
|
||||||
|
var abs2: Double? = null,
|
||||||
|
var abs3: Double? = null,
|
||||||
|
var abs4: Double? = null,
|
||||||
|
var led1Gain1: Double? = null,
|
||||||
|
var led2Gain1: Double? = null,
|
||||||
|
var led3Gain1: Double? = null,
|
||||||
|
var led4Gain1: Double? = null,
|
||||||
|
var led1Gain2: Double? = null,
|
||||||
|
var led2Gain2: Double? = null,
|
||||||
|
var led3Gain2: Double? = null,
|
||||||
|
var led4Gain2: Double? = null,
|
||||||
|
var led1Gain3: Double? = null,
|
||||||
|
var led2Gain3: Double? = null,
|
||||||
|
var led3Gain3: Double? = null,
|
||||||
|
var led4Gain3: Double? = null,
|
||||||
|
var led1Gain4: Double? = null,
|
||||||
|
var led2Gain4: Double? = null,
|
||||||
|
var led3Gain4: Double? = null,
|
||||||
|
var led4Gain4: Double? = null,
|
||||||
var deviceRatio: Double? = null,
|
var deviceRatio: Double? = null,
|
||||||
var calculatedRatio: Double? = null,
|
var calculatedRatio: Double? = null,
|
||||||
|
var predictedDenovixRatio: Double? = null,
|
||||||
|
var slopeRatio: Double? = null,
|
||||||
var coefficients: String? = "",
|
var coefficients: String? = "",
|
||||||
var classificationResult: String = ""
|
var classificationResult: String = "",
|
||||||
|
var prdClassification: String = "",
|
||||||
|
var deviceRatioClass: String = "",
|
||||||
|
var slopeRatioClass: String = "",
|
||||||
|
var errorMessages: String = "",
|
||||||
|
var batteryLevel: String = "",
|
||||||
|
var batteryCapacity: String = "",
|
||||||
|
var batteryMaxCapacity: String = "",
|
||||||
|
var batteryTemperature: String = "",
|
||||||
|
var batteryVoltage: String = "",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ data class UserData(
|
|||||||
var name: String = "",
|
var name: String = "",
|
||||||
var incubationTime: String = "",
|
var incubationTime: String = "",
|
||||||
var birthYear: String = "",
|
var birthYear: String = "",
|
||||||
|
var abhaId: String = "",
|
||||||
|
var bloodGroup: String = "",
|
||||||
var userImageURL: String = "",
|
var userImageURL: String = "",
|
||||||
|
var gender: String ="",
|
||||||
var location: Location? = null,
|
var location: Location? = null,
|
||||||
var createdBy: String? = "",
|
var createdBy: String? = "",
|
||||||
var reportUploadTime: String? = "",
|
var reportUploadTime: String? = "",
|
||||||
@@ -19,12 +22,14 @@ data class UserData(
|
|||||||
var testStatus: Boolean? = false,
|
var testStatus: Boolean? = false,
|
||||||
var mobileId: String = "",
|
var mobileId: String = "",
|
||||||
var deviceId: String = "",
|
var deviceId: String = "",
|
||||||
|
var state: String = "",
|
||||||
var deviceSerialNumber: String = "",
|
var deviceSerialNumber: String = "",
|
||||||
var kitSerial: String = "",
|
var kitSerial: String = "",
|
||||||
var csvPath: String = "",
|
var csvPath: String = "",
|
||||||
var reportPath: String = "",
|
var reportPath: String = "",
|
||||||
var result: TestRightResultType? = null,
|
var result: TestRightResultType? = null,
|
||||||
var resultRatio: Double? = null
|
var resultRatio: Double? = null,
|
||||||
|
var prdClassification: String = ""
|
||||||
) {
|
) {
|
||||||
enum class Gender {
|
enum class Gender {
|
||||||
MALE,
|
MALE,
|
||||||
@@ -44,5 +49,11 @@ fun UserData.toHemoCubeTestData() = HemoCubeTestData(
|
|||||||
birthYear = birthYear,
|
birthYear = birthYear,
|
||||||
userImageURL = userImageURL,
|
userImageURL = userImageURL,
|
||||||
testStatus = testStatus,
|
testStatus = testStatus,
|
||||||
location = location
|
location = location,
|
||||||
|
gender = gender,
|
||||||
|
state = state,
|
||||||
|
abhaId = abhaId,
|
||||||
|
bloodGroup = bloodGroup,
|
||||||
|
prdClassification = prdClassification,
|
||||||
|
testTime = testTime
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -15,13 +15,14 @@ import com.google.firebase.ktx.Firebase
|
|||||||
import com.google.firebase.storage.ktx.storage
|
import com.google.firebase.storage.ktx.storage
|
||||||
import kotlinx.coroutines.tasks.await
|
import kotlinx.coroutines.tasks.await
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
class DatabaseRepository : Repository {
|
class DatabaseRepository @Inject constructor() : Repository {
|
||||||
|
|
||||||
private val db: FirebaseFirestore = Firebase.firestore
|
private val db: FirebaseFirestore = Firebase.firestore
|
||||||
private val storage = Firebase.storage
|
private val storage = Firebase.storage
|
||||||
|
|
||||||
suspend fun addTestToDatabase(data: HemoCubeTestData?): Response<String> {
|
override suspend fun addTestToDatabase(data: HemoCubeTestData?): Response<String> {
|
||||||
return try {
|
return try {
|
||||||
val userdata = db.collection("patientData").whereEqualTo("_id", data!!._id).get().await()
|
val userdata = db.collection("patientData").whereEqualTo("_id", data!!._id).get().await()
|
||||||
if (userdata.documents.isNotEmpty()) {
|
if (userdata.documents.isNotEmpty()) {
|
||||||
@@ -36,7 +37,7 @@ class DatabaseRepository : Repository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun addTestToDatabase(data: UserData?): Response<String> {
|
override suspend fun addTestToDatabase(data: UserData?): Response<String> {
|
||||||
return try {
|
return try {
|
||||||
val userdata = db.collection("patientData").whereEqualTo("_id", data!!._id).get().await()
|
val userdata = db.collection("patientData").whereEqualTo("_id", data!!._id).get().await()
|
||||||
if (userdata.documents.isNotEmpty()) {
|
if (userdata.documents.isNotEmpty()) {
|
||||||
@@ -52,7 +53,7 @@ class DatabaseRepository : Repository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun addTestToDatabaseforBufferCheck(data: BufferCheckData?): Response<String> {
|
override suspend fun addTestToDatabaseforBufferCheck(data: BufferCheckData?): Response<String> {
|
||||||
return try {
|
return try {
|
||||||
db.collection("buffers").add(data!!).await()
|
db.collection("buffers").add(data!!).await()
|
||||||
Response.Success(data!!.kitno)
|
Response.Success(data!!.kitno)
|
||||||
@@ -62,7 +63,7 @@ class DatabaseRepository : Repository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun addDiagnostics(data: DiagnosticsData?): Response<String> {
|
override suspend fun addDiagnostics(data: DiagnosticsData?): Response<String> {
|
||||||
return try {
|
return try {
|
||||||
db.collection("diagnostics").add(data!!).await()
|
db.collection("diagnostics").add(data!!).await()
|
||||||
Response.Success(data!!.deviceId)
|
Response.Success(data!!.deviceId)
|
||||||
@@ -72,7 +73,7 @@ class DatabaseRepository : Repository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun uploadFileToStorage(patientID: String, filePath: String): Response<Boolean> {
|
override suspend fun uploadFileToStorage(patientID: String, filePath: String): Response<Boolean> {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
val file = Uri.fromFile(File(filePath))
|
val file = Uri.fromFile(File(filePath))
|
||||||
@@ -131,7 +132,7 @@ class DatabaseRepository : Repository {
|
|||||||
return db.collection("devices").get().await().toObjects(DeviceData::class.java)
|
return db.collection("devices").get().await().toObjects(DeviceData::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getDeviceDataById(deviceId: String): DeviceData? {
|
override suspend fun getDeviceDataById(deviceId: String): DeviceData? {
|
||||||
val querySnapshot = db.collection("devices").get().await()
|
val querySnapshot = db.collection("devices").get().await()
|
||||||
val allDeviceDataList = querySnapshot.toObjects(DeviceData::class.java)
|
val allDeviceDataList = querySnapshot.toObjects(DeviceData::class.java)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,22 @@
|
|||||||
package com.example.hpostesting.data.repository
|
package com.example.hpostesting.data.repository
|
||||||
|
|
||||||
|
import com.example.hpostesting.data.model.Response
|
||||||
|
import com.example.hpostesting.data.model.diagnostics.DiagnosticsData
|
||||||
|
import com.example.hpostesting.data.model.patient.BufferCheckData
|
||||||
|
import com.example.hpostesting.data.model.patient.DeviceData
|
||||||
|
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||||
|
import com.example.hpostesting.data.model.patient.UserData
|
||||||
|
|
||||||
interface Repository {
|
interface Repository {
|
||||||
// suspend fun addToDatabase(data: PatientDetails)
|
suspend fun addTestToDatabase(data: HemoCubeTestData?): Response<String>
|
||||||
|
|
||||||
|
suspend fun addTestToDatabase(data: UserData?): Response<String>
|
||||||
|
|
||||||
|
suspend fun addTestToDatabaseforBufferCheck(data: BufferCheckData?): Response<String>
|
||||||
|
|
||||||
|
suspend fun addDiagnostics(data: DiagnosticsData?): Response<String>
|
||||||
|
|
||||||
|
suspend fun uploadFileToStorage(patientID: String, filePath: String): Response<Boolean>
|
||||||
|
|
||||||
|
suspend fun getDeviceDataById(deviceId: String): DeviceData?
|
||||||
}
|
}
|
||||||
@@ -3,12 +3,14 @@ package com.example.hpostesting.domain.di
|
|||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.room.Room
|
import androidx.room.Room
|
||||||
|
import com.example.hpostesting.data.dao.HemoCubeBufferDao
|
||||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
import com.example.hpostesting.data.dao.HemoCubeDao
|
||||||
import com.example.hpostesting.data.dao.MyDatabase
|
import com.example.hpostesting.data.dao.MyDatabase
|
||||||
import com.example.hpostesting.data.dao.UserDao
|
import com.example.hpostesting.data.dao.UserDao
|
||||||
import com.example.hpostesting.data.datasource.LocalFileDataSource
|
import com.example.hpostesting.data.datasource.LocalFileDataSource
|
||||||
import com.example.hpostesting.data.repository.DatabaseRepository
|
import com.example.hpostesting.data.repository.DatabaseRepository
|
||||||
import com.example.hpostesting.data.repository.LocalFileRepository
|
import com.example.hpostesting.data.repository.LocalFileRepository
|
||||||
|
import com.example.hpostesting.data.repository.Repository
|
||||||
import com.example.hpostesting.domain.SaveRawData
|
import com.example.hpostesting.domain.SaveRawData
|
||||||
import com.example.hpostesting.domain.SaveRawDataTest
|
import com.example.hpostesting.domain.SaveRawDataTest
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
@@ -43,6 +45,12 @@ object AppModule {
|
|||||||
fun provideMyHemo(myDatabase: MyDatabase): HemoCubeDao {
|
fun provideMyHemo(myDatabase: MyDatabase): HemoCubeDao {
|
||||||
return myDatabase.hemoCubeDao()
|
return myDatabase.hemoCubeDao()
|
||||||
}
|
}
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
fun provideMyHemoCubeBuffer(myDatabase: MyDatabase): HemoCubeBufferDao {
|
||||||
|
return myDatabase.hemoCubeBufferDao()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
@@ -69,4 +77,10 @@ object AppModule {
|
|||||||
fun provideDatabaseRepository(): DatabaseRepository {
|
fun provideDatabaseRepository(): DatabaseRepository {
|
||||||
return DatabaseRepository()
|
return DatabaseRepository()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
fun provideRepository(): Repository {
|
||||||
|
return DatabaseRepository()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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,8 +11,8 @@ 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.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.diagnostics.DiagnosticsActivity
|
|
||||||
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
|
||||||
@@ -33,7 +34,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)
|
||||||
@@ -44,6 +45,12 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
binding.nameEditText.setText(contents)
|
binding.nameEditText.setText(contents)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
|
super.attachBaseContext(newBase)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
@@ -120,16 +127,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(
|
||||||
@@ -145,7 +161,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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,7 +217,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
|
||||||
@@ -18,9 +17,9 @@ import androidx.core.content.ContextCompat
|
|||||||
import androidx.core.view.get
|
import androidx.core.view.get
|
||||||
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.data.constant.LanguageManager
|
||||||
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
|
||||||
@@ -46,6 +45,12 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
|
super.attachBaseContext(newBase)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||||
@@ -109,6 +114,15 @@ class MainActivity : AppCompatActivity() {
|
|||||||
Constants.DEVICE_TYPE_HOMOCUBE
|
Constants.DEVICE_TYPE_HOMOCUBE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
device.productId == Constants.HEMO_CUBE_V2_PRODUCT_ID && device.vendorId == Constants.HEMO_CUBE_V2_VENDOR_ID -> {
|
||||||
|
binding.cvItem1.visibility = View.VISIBLE
|
||||||
|
binding.cvItem3.visibility = View.VISIBLE
|
||||||
|
binding.cvItem2.visibility = View.GONE
|
||||||
|
binding.cvItem4.visibility = View.GONE
|
||||||
|
DataHolder.deviceType.postValue(Constants.DEVICE_TYPE_HOMOCUBE)
|
||||||
|
Constants.DEVICE_TYPE_HOMOCUBE
|
||||||
|
}
|
||||||
|
|
||||||
device.productId == Constants.DEVICE_PRODUCT_ID && device.vendorId == Constants.DEVICE_VENDOR_ID -> {
|
device.productId == Constants.DEVICE_PRODUCT_ID && device.vendorId == Constants.DEVICE_VENDOR_ID -> {
|
||||||
Log.d(
|
Log.d(
|
||||||
TAG,
|
TAG,
|
||||||
@@ -138,7 +152,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 +240,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 +327,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 +338,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,6 +1,8 @@
|
|||||||
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.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
@@ -13,11 +15,9 @@ 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.data.constant.LanguageManager
|
||||||
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() {
|
||||||
@@ -34,6 +34,12 @@ class SplashActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
private var allPermissionsGranted = false
|
private var allPermissionsGranted = false
|
||||||
|
|
||||||
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
|
super.attachBaseContext(newBase)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivitySplashBinding.inflate(layoutInflater)
|
binding = ActivitySplashBinding.inflate(layoutInflater)
|
||||||
@@ -77,7 +83,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 +145,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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,125 @@
|
|||||||
|
package com.example.hpostesting.presentation.adapter
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.navigation.findNavController
|
||||||
|
import androidx.recyclerview.widget.AsyncListDiffer
|
||||||
|
import androidx.recyclerview.widget.DiffUtil
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.example.hpostesting.data.DataHolder
|
||||||
|
import com.example.hpostesting.data.constant.Constants
|
||||||
|
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||||
|
import com.example.hpostesting.data.model.patient.UserData
|
||||||
|
import `in`.sminnovations.hpostesting.R
|
||||||
|
import `in`.sminnovations.hpostesting.databinding.OfflineUserListViewBinding
|
||||||
|
import org.apache.commons.collections4.MapUtils.getString
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Calendar
|
||||||
|
import java.util.Date
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
|
|
||||||
|
class OfflineUserListAdapter(private val view: View, private val batLevel: Int) :
|
||||||
|
RecyclerView.Adapter<OfflineUserListAdapter.OfflineUserListViewHolder>() {
|
||||||
|
|
||||||
|
inner class OfflineUserListViewHolder(val binding: OfflineUserListViewBinding) :
|
||||||
|
RecyclerView.ViewHolder(binding.root)
|
||||||
|
|
||||||
|
private val differCallback = object : DiffUtil.ItemCallback<HemoCubeTestData>() {
|
||||||
|
override fun areItemsTheSame(
|
||||||
|
oldItem: HemoCubeTestData, newItem: HemoCubeTestData
|
||||||
|
): Boolean {
|
||||||
|
return oldItem._id == newItem._id
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun areContentsTheSame(
|
||||||
|
oldItem: HemoCubeTestData, newItem: HemoCubeTestData
|
||||||
|
): Boolean {
|
||||||
|
return oldItem == newItem
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val differ = AsyncListDiffer(this, differCallback)
|
||||||
|
private val context: Context? = null
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): OfflineUserListViewHolder {
|
||||||
|
return OfflineUserListViewHolder(
|
||||||
|
OfflineUserListViewBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int {
|
||||||
|
return differ.currentList.size
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: OfflineUserListViewHolder, position: Int) {
|
||||||
|
val userList = differ.currentList[position]
|
||||||
|
holder.binding.apply {
|
||||||
|
userID.text = "User ID: ${userList._id}"
|
||||||
|
bloodGroup.text = "Blood group: ${userList.bloodGroup}"
|
||||||
|
time.text = "Time: ${userList.incubationTime}"
|
||||||
|
userCard.setOnClickListener {
|
||||||
|
if (batLevel < 40) {
|
||||||
|
Toast.makeText(
|
||||||
|
view.context,
|
||||||
|
context?.getString(R.string.low_battery_warning),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
if (userList.testStatus != null) {
|
||||||
|
if (userList.testStatus!!) {
|
||||||
|
Toast.makeText(
|
||||||
|
view.context,
|
||||||
|
context?.getString(R.string.test_already_conducted),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
} else {
|
||||||
|
if (userList.incubationTime != "") {
|
||||||
|
if (isBetween15And30Minutes(userList.incubationTime) < Constants.INCUBATION_TIME_MIN) {
|
||||||
|
Toast.makeText(
|
||||||
|
view.context,
|
||||||
|
context?.getString(R.string.incubation_not_completed),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
} else if (isBetween15And30Minutes(userList.incubationTime) > Constants.INCUBATION_TIME_MAX) {
|
||||||
|
Toast.makeText(
|
||||||
|
view.context,
|
||||||
|
context?.getString(R.string.incubation_crossed_30_minutes),
|
||||||
|
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 {
|
||||||
|
Toast.makeText(
|
||||||
|
view.context,
|
||||||
|
context?.getString(R.string.incubation_not_started),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun isBetween15And30Minutes(createdAt: String): Long {
|
||||||
|
val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
|
||||||
|
val createdAtDate: Date = formatter.parse(createdAt)!!
|
||||||
|
|
||||||
|
val currentTime = Calendar.getInstance().time
|
||||||
|
|
||||||
|
val diffMillis = currentTime.time - createdAtDate.time
|
||||||
|
|
||||||
|
return diffMillis / (60 * 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ import android.widget.AutoCompleteTextView
|
|||||||
import androidx.core.content.ContextCompat.getSystemService
|
import androidx.core.content.ContextCompat.getSystemService
|
||||||
import androidx.core.content.getSystemService
|
import androidx.core.content.getSystemService
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
|
import com.example.hpostesting.data.constant.Constants
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.google.firebase.firestore.FirebaseFirestore
|
import com.google.firebase.firestore.FirebaseFirestore
|
||||||
|
|
||||||
@@ -70,10 +71,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 {
|
||||||
@@ -94,19 +95,19 @@ class UserListAdapter(
|
|||||||
|
|
||||||
val builder = AlertDialog.Builder(context)
|
val builder = AlertDialog.Builder(context)
|
||||||
.setView(dialogView)
|
.setView(dialogView)
|
||||||
.setTitle("Add Blood Group")
|
.setTitle(R.string.blood_group)
|
||||||
|
|
||||||
val etBloodGroup = dialogView.findViewById<AutoCompleteTextView>(R.id.et_blood_group)
|
val etBloodGroup = dialogView.findViewById<AutoCompleteTextView>(R.id.et_blood_group)
|
||||||
|
|
||||||
builder.setPositiveButton("OK") { dialog, which ->
|
builder.setPositiveButton(R.string.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.equals("ರಕ್ತ ಗುಂಪು ಆಯ್ಕೆಮಾಡಿ") || 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 +126,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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -160,7 +167,7 @@ class UserListAdapter(
|
|||||||
// Handle the selected blood group here
|
// Handle the selected blood group here
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.setNegativeButton("Cancel") { dialog, which ->
|
builder.setNegativeButton(R.string.cancel) { dialog, which ->
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,10 +197,10 @@ class UserListAdapter(
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
userCard.setOnClickListener {
|
userCard.setOnClickListener {
|
||||||
if (batLevel < 40) {
|
if (batLevel < Constants.BATTERY_LEVEL_MIN) {
|
||||||
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,21 +209,21 @@ 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 {
|
||||||
if (model.incubationTime != "") {
|
if (model.incubationTime != "") {
|
||||||
if (isBetween15And30Minutes(model.incubationTime) < 15) {
|
if (isBetween15And30Minutes(model.incubationTime) < -15000) {
|
||||||
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) > 300000) {
|
||||||
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 +234,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()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,30 @@
|
|||||||
package com.example.hpostesting.presentation.buffercheck
|
package com.example.hpostesting.presentation.buffercheck
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
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.view.inputmethod.InputMethodManager
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
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.constant.HemoCubeCommands
|
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||||
import com.example.hpostesting.data.model.patient.BufferCheckData
|
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.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.UIUtils
|
|
||||||
import com.google.firebase.crashlytics.ktx.crashlytics
|
import com.google.firebase.crashlytics.ktx.crashlytics
|
||||||
import com.google.firebase.ktx.Firebase
|
import com.google.firebase.ktx.Firebase
|
||||||
import `in`.sminnovations.hpostesting.R
|
import `in`.sminnovations.hpostesting.R
|
||||||
import `in`.sminnovations.hpostesting.databinding.FragmentHemoCubeReferenceBinding
|
import `in`.sminnovations.hpostesting.databinding.FragmentHemoCubeReferenceBinding
|
||||||
import kotlin.math.log10
|
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Calendar
|
import java.util.Calendar
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
import java.util.UUID
|
||||||
|
import kotlin.math.log10
|
||||||
|
|
||||||
class HemoCubeBufferCheckFragment : Fragment() {
|
class HemoCubeBufferCheckFragment : Fragment() {
|
||||||
|
|
||||||
@@ -42,9 +35,24 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
private var resultData: String = ""
|
private var resultData: String = ""
|
||||||
private var kitno: String = ""
|
private var kitno: String = ""
|
||||||
private var isOnline = false
|
private var isOnline = false
|
||||||
private val messages = MutableLiveData<String>()
|
|
||||||
private var isTestOngoing = false
|
private var isTestOngoing = false
|
||||||
private var startListening = MutableLiveData(false)
|
private var startListening = MutableLiveData(false)
|
||||||
|
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 allErrorMessages = ""
|
||||||
|
private var deviceHardwareId = ""
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
||||||
): View {
|
): View {
|
||||||
@@ -65,15 +73,16 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
binding.nameEditText.setText("SMI/SC/")
|
binding.nameEditText.setText("SMI/SC/")
|
||||||
binding.tvTitle.visibility = View.GONE
|
binding.tvTitle.visibility = View.GONE
|
||||||
binding.tvName.visibility = View.GONE
|
binding.tvName.visibility = View.GONE
|
||||||
|
binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
|
||||||
binding.btnGo.setOnClickListener {
|
binding.btnGo.setOnClickListener {
|
||||||
val serialNumber = binding.nameEditText.text.toString().trim()
|
val serialNumber = binding.nameEditText.text.toString().trim()
|
||||||
if (serialNumber.isNotEmpty() && isSerialValid(serialNumber)) {
|
if (serialNumber.isNotEmpty() && isSerialValid(serialNumber)) {
|
||||||
kitno = serialNumber
|
kitno = serialNumber
|
||||||
listenToHemoCube()
|
listenToHemoCube()
|
||||||
startBufferProcess()
|
getDeviceInfo()
|
||||||
} 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 {
|
||||||
@@ -85,17 +94,17 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.btnSamplestart.setOnClickListener {
|
||||||
|
startSampleProcess()
|
||||||
activity?.runOnUiThread {
|
it.visibility = View.GONE
|
||||||
binding.btnSubmit.isEnabled = true
|
|
||||||
binding.btnSubmit.isClickable = true
|
|
||||||
}
|
|
||||||
binding.btnSubmit.setOnClickListener {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
binding.btnSubmit.isEnabled = false
|
binding.btnSubmit.isEnabled = false
|
||||||
binding.btnSubmit.isClickable = false
|
binding.btnSubmit.isClickable = false
|
||||||
|
|
||||||
|
binding.btnPlacebuffer.setOnClickListener {
|
||||||
|
checkAndStartProcess()
|
||||||
|
it.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun observeViewModel() {
|
private fun observeViewModel() {
|
||||||
@@ -108,43 +117,44 @@ 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 == "Error") {
|
||||||
|
showToast("Error uploading data, Kit result stored locally")
|
||||||
|
startActivity(Intent(requireActivity(), DashboardActivity::class.java))
|
||||||
}
|
}
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
messages.observe(viewLifecycleOwner) {
|
hemoCubeViewModel.messages.observe(viewLifecycleOwner) {
|
||||||
binding.tvSubtitle4.text = it
|
binding.tvSubtitle4.text = it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun checkAndStartProcess() {
|
||||||
|
startBufferProcess()
|
||||||
|
}
|
||||||
|
|
||||||
private fun listenToHemoCube() {
|
private fun listenToHemoCube() {
|
||||||
if (DataHolder.hemoCubeTestData == null) {
|
|
||||||
DataHolder.hemoCubeTestData = DataHolder.selectedTest?.toHemoCubeTestData()
|
|
||||||
}
|
|
||||||
|
|
||||||
val fullReadOutput = StringBuilder()
|
|
||||||
startListening.postValue(true)
|
startListening.postValue(true)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
(activity as HemocubeBufferCheckActivity).mService.listenToHemoCube(object :
|
(activity as HemocubeBufferCheckActivity).mService.listenToHemoCube(object :
|
||||||
UsbServiceListener {
|
UsbServiceListener {
|
||||||
override fun onUsbRead(data: ByteArray?) {
|
override fun onUsbRead(data: ByteArray?) {
|
||||||
data?.let {
|
data?.let {
|
||||||
val stringData = String(it)
|
val stringData = String(it)
|
||||||
fullReadOutput.append(stringData)
|
handleUsbData(stringData)
|
||||||
handleUsbData(stringData, fullReadOutput)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,102 +162,217 @@ 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleUsbData(stringData: String, fullReadOutput: StringBuilder) {
|
private fun handleUsbData(stringData: String) {
|
||||||
if (stringData.contains("#")) {
|
if (stringData.contains("#")) {
|
||||||
messages.postValue(stringData)
|
|
||||||
isTestOngoing = true
|
isTestOngoing = true
|
||||||
}
|
}
|
||||||
|
|
||||||
resultData += fullReadOutput.toString()
|
resultData += stringData
|
||||||
|
|
||||||
when {
|
when {
|
||||||
stringData.contains("#Buffer Completed") -> showStartSampleDialog()
|
stringData.contains("SN") -> {
|
||||||
stringData.contains("#Sample Completed") -> {
|
val slData = stringData.split(" ")
|
||||||
activity?.runOnUiThread {
|
if (slData.size > 1) {
|
||||||
binding.btnSubmit.isEnabled = true
|
val hardwareId = slData[1].trim()
|
||||||
binding.btnSubmit.isClickable = true
|
deviceHardwareId = hardwareId
|
||||||
|
with(sharedPreferences.edit()) {
|
||||||
|
putString(Constants.DEVICE_ID, hardwareId)
|
||||||
|
apply()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.tvSubtitle4.visibility = View.VISIBLE
|
||||||
|
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()
|
||||||
}
|
}
|
||||||
|
|
||||||
stringData.contains("RESULT") || resultData.contains("REND") -> {
|
resultData.contains("REND") -> {
|
||||||
var validString: String
|
hemoCubeViewModel.messages.postValue(
|
||||||
val results: List<String>
|
"Data collected \n" + " Processing data"
|
||||||
if (stringData.contains("RESULT")) {
|
|
||||||
validString = isValidResult(stringData)
|
|
||||||
if (validString.isEmpty()) {
|
|
||||||
results = resultData.split("\n")
|
|
||||||
validString = parseResult(results)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
results = resultData.split("\n")
|
|
||||||
validString = parseResult(results)
|
|
||||||
}
|
|
||||||
if (validString.isNotEmpty()) {
|
|
||||||
handleValidResult(validString)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun handleValidResult(validString: String) {
|
|
||||||
try {
|
|
||||||
val result = validString.split(" ")
|
|
||||||
if (result.size == 8) {
|
|
||||||
val deviceId = result[2]
|
|
||||||
val led1BufferForDevice = result[3].toDoubleOrNull()
|
|
||||||
val led2BufferForDevice = result[4].toDoubleOrNull()
|
|
||||||
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 calculateRatio = calculateRatio(deviceRatio)
|
|
||||||
val classificationResult = findResult(calculateRatio)
|
|
||||||
messages.postValue(classificationResult)
|
|
||||||
val bufferData = BufferCheckData(
|
|
||||||
deviceId= deviceId,
|
|
||||||
kitno = kitno,
|
|
||||||
led1Buffer = led1BufferForDevice,
|
|
||||||
led2Buffer = led2BufferForDevice,
|
|
||||||
led1Average = led1Average,
|
|
||||||
led2Average = led2Average,
|
|
||||||
led1Sample = led1Sample,
|
|
||||||
led2Sample = led2Sample,
|
|
||||||
deviceRatio = deviceRatio,
|
|
||||||
calculatedRatio = calculateRatio,
|
|
||||||
coefficients = currentDeviceData?.coefficients?.get(0).toString() + ", " + currentDeviceData?.coefficients?.get(1).toString(),
|
|
||||||
classificationResult = classificationResult,
|
|
||||||
deviceSerialNumber = sharedPreferences.getString(Constants.USER_ID, "").toString(),
|
|
||||||
testTime = SimpleDateFormat(
|
|
||||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
|
||||||
).format(Calendar.getInstance().time)
|
|
||||||
)
|
)
|
||||||
hemoCubeViewModel.uploadHemoCubeResultToDatabaseforbuffercheckN(bufferData)
|
val resultLines = resultData.split("\\s+(?=LB|LS)".toRegex())
|
||||||
|
var bufferIntensity = resultLines[1].split(' ')[1].trim()
|
||||||
|
led1BufferForDevice = bufferIntensity.toDoubleOrNull()!!
|
||||||
|
bufferIntensity = resultLines[2].split(' ')[1].trim()
|
||||||
|
led2BufferForDevice = bufferIntensity.toDoubleOrNull()!!
|
||||||
|
bufferIntensity = resultLines[3].split(' ')[1].trim()
|
||||||
|
led3BufferForDevice = bufferIntensity.toDoubleOrNull()!!
|
||||||
|
bufferIntensity = resultLines[4].split(' ')[1].trim()
|
||||||
|
led4BufferForDevice = bufferIntensity.toDoubleOrNull()!!
|
||||||
|
led1SampleForDevice = resultLines[5].split(' ')[1].trim().toDoubleOrNull()!!
|
||||||
|
led2SampleForDevice = resultLines[6].split(' ')[1].trim().toDoubleOrNull()!!
|
||||||
|
led3SampleForDevice = resultLines[7].split(' ')[1].trim().toDoubleOrNull()!!
|
||||||
|
led4SampleForDevice =
|
||||||
|
resultLines[8].split(' ')[1].split('\r')[0].trim().toDoubleOrNull()!!
|
||||||
|
processResult()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun processResult() {
|
||||||
|
try {
|
||||||
|
hemoCubeViewModel.messages.postValue("processing result")
|
||||||
|
val deviceLog = resultData
|
||||||
|
|
||||||
|
val pInfo = requireActivity().packageManager.getPackageInfo(
|
||||||
|
requireActivity().packageName, 0
|
||||||
|
)
|
||||||
|
val version = pInfo.versionName
|
||||||
|
|
||||||
|
val led1Average = log10(led1BufferForDevice.div(led1SampleForDevice))
|
||||||
|
val led2Average = log10(led2BufferForDevice.div(led2SampleForDevice))
|
||||||
|
val led3Average = log10(led3BufferForDevice.div(led3SampleForDevice))
|
||||||
|
val led4Average = log10(led4BufferForDevice.div(led4SampleForDevice))
|
||||||
|
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
|
||||||
|
allErrorMessages += "Error: Invalid Test. Improper buffer reading (low)"
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.errorMessage.text =
|
||||||
|
"Error: Invalid Test. Improper buffer reading (low)" + "\n"
|
||||||
|
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
|
||||||
|
allErrorMessages += "Error: Invalid Test. Improper buffer reading (high)" + "\n"
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.errorMessage.text =
|
||||||
|
"Error: Invalid Test. Improper buffer reading (high)"
|
||||||
|
binding.errorMessage.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
allErrorMessages += "Error: Invalid Test. Problem with de-oxygenation" + "\n"
|
||||||
|
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. Redo Kit check Reading"
|
||||||
|
binding.errorMessage.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val prdClassification = absorbanceBasedClassification(_predictedDenovixRatio)
|
||||||
|
hemoCubeViewModel.messages.postValue(prdClassification)
|
||||||
|
|
||||||
|
val bufferData = BufferCheckData(
|
||||||
|
_id = UUID.randomUUID().toString(),
|
||||||
|
deviceId = deviceHardwareId,
|
||||||
|
kitno = kitno,
|
||||||
|
appVersion = version,
|
||||||
|
led1Buffer = led1BufferForDevice,
|
||||||
|
led2Buffer = led2BufferForDevice,
|
||||||
|
led3Buffer = led3BufferForDevice,
|
||||||
|
led4Buffer = led4BufferForDevice,
|
||||||
|
led1Sample = led1SampleForDevice,
|
||||||
|
led2Sample = led2SampleForDevice,
|
||||||
|
led3Sample = led3SampleForDevice,
|
||||||
|
led4Sample = led4SampleForDevice,
|
||||||
|
led1Average = led1Average,
|
||||||
|
led2Average = led2Average,
|
||||||
|
led3Average = led3Average,
|
||||||
|
led4Average = led4Average,
|
||||||
|
abs1 = fittedAbs1,
|
||||||
|
abs2 = fittedAbs2,
|
||||||
|
abs3 = fittedAbs3,
|
||||||
|
abs4 = fittedAbs4,
|
||||||
|
deviceRatio = deviceRatio,
|
||||||
|
resultData = deviceLog,
|
||||||
|
predictedDenovixRatio = _predictedDenovixRatio,
|
||||||
|
prdClassification = prdClassification,
|
||||||
|
errorMessages = allErrorMessages,
|
||||||
|
coefficients = currentDeviceData?.coefficients?.get(0)
|
||||||
|
.toString() + ", " + currentDeviceData?.coefficients?.get(1).toString(),
|
||||||
|
deviceSerialNumber = sharedPreferences.getString(Constants.USER_ID, "").toString(),
|
||||||
|
testTime = SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
).format(Calendar.getInstance().time),
|
||||||
|
batteryLevel = hemoCubeViewModel.getBatteryLevel().toString(),
|
||||||
|
batteryCapacity = hemoCubeViewModel.getBatteryCapacity(requireContext()).toString(),
|
||||||
|
batteryMaxCapacity = hemoCubeViewModel.getBatteryMaxCapacity(requireContext())
|
||||||
|
.toString(),
|
||||||
|
batteryTemperature = hemoCubeViewModel.getBatteryTemperature().toString(),
|
||||||
|
batteryVoltage = hemoCubeViewModel.getBatteryVoltage(requireContext()).toString()
|
||||||
|
)
|
||||||
|
|
||||||
|
hemoCubeViewModel.uploadHemoCubeResultToDatabaseForBufferCheck(isOnline, bufferData)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
requireContext(), "Error while processing device data", Toast.LENGTH_SHORT
|
requireContext(), "Error while processing device data", Toast.LENGTH_SHORT
|
||||||
@@ -258,30 +383,55 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
|
|
||||||
private 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.085) return "Kit Failed"
|
if (calculatedRatio < 0.05) return "Inconclusive. Very low Absorbance - Repeat test with Higher Blood Volume"
|
||||||
if (calculatedRatio in 0.085..0.155) return "Kit Passed"
|
if (calculatedRatio in 0.05..0.155) return "Normal"
|
||||||
if (calculatedRatio in 0.155..0.175) return "Kit Failed"
|
if (calculatedRatio in 0.155..0.175) return "Negative Borderline. Repeat Test"
|
||||||
if (calculatedRatio in 0.175..0.22) return "Kit Failed"
|
if (calculatedRatio in 0.175..0.22) return "Sickle Cell Trait"
|
||||||
if (calculatedRatio in 0.22..0.25) return "Kit Failed"
|
if (calculatedRatio in 0.22..0.25) return "Positive for Sickle Cell. HPLC for Confirmation"
|
||||||
if (calculatedRatio in 0.25..0.35) return "Kit Failed"
|
if (calculatedRatio in 0.25..0.35) return "Sickle Cell Disease"
|
||||||
if (calculatedRatio > 0.35) return "Kit Failed"
|
if (calculatedRatio > 0.35) return "Inconclusive. Repeat with test with lower volume of blood"
|
||||||
} else {
|
} else {
|
||||||
return "NULL"
|
return "INVALID"
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showToast(R.string.error_classification)
|
||||||
|
Firebase.crashlytics.recordException(e)
|
||||||
|
return "ERROR"
|
||||||
|
}
|
||||||
|
return "INVALID"
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun absorbanceBasedClassification(predictedDenovixRatio: Double?): String {
|
||||||
|
try {
|
||||||
|
hemoCubeViewModel.messages.postValue("result classification")
|
||||||
|
if (predictedDenovixRatio != null) {
|
||||||
|
if (predictedDenovixRatio in 0.0..0.16) return "Kit Passed"
|
||||||
|
if (predictedDenovixRatio in 0.16..0.165) return "Kit Passed"
|
||||||
|
if (predictedDenovixRatio in 0.165..0.235) return "Kit Failed"
|
||||||
|
if (predictedDenovixRatio in 0.235..0.24) return "Kit Failed"
|
||||||
|
if (predictedDenovixRatio in 0.24..1.0) return "Kit Failed"
|
||||||
|
} else {
|
||||||
|
return "INVALID"
|
||||||
}
|
}
|
||||||
} 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 "NULL"
|
return "INVALID"
|
||||||
}
|
}
|
||||||
|
|
||||||
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?.runOnUiThread {
|
||||||
|
binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startBuffer,
|
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startBuffer,
|
||||||
object : UsbServiceListener {
|
object : UsbServiceListener {
|
||||||
@@ -293,6 +443,9 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun startSampleProcess() {
|
private fun startSampleProcess() {
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.btnPlacebuffer.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startSample,
|
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.startSample,
|
||||||
object : UsbServiceListener {
|
object : UsbServiceListener {
|
||||||
@@ -303,9 +456,28 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getDeviceInfo() {
|
||||||
|
hemoCubeViewModel.progressBar.postValue(true)
|
||||||
|
(activity as HemocubeBufferCheckActivity).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 fetchResult() {
|
private fun fetchResult() {
|
||||||
|
|
||||||
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.getSample,
|
(activity as HemocubeBufferCheckActivity).mService.sendAndListenToHemoCube(HemoCubeCommands.PRINT_COMMAND,
|
||||||
object : UsbServiceListener {
|
object : UsbServiceListener {
|
||||||
override fun onUsbRead(data: ByteArray?) {}
|
override fun onUsbRead(data: ByteArray?) {}
|
||||||
|
|
||||||
@@ -320,21 +492,6 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
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 isSerialValid(s: String): Boolean {
|
private fun isSerialValid(s: String): Boolean {
|
||||||
if (s.length != 17) {
|
if (s.length != 17) {
|
||||||
binding.nameEditText.error = getString(R.string.invalid_kit)
|
binding.nameEditText.error = getString(R.string.invalid_kit)
|
||||||
@@ -342,13 +499,4 @@ class HemoCubeBufferCheckFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun isValidResult(line: String): String {
|
|
||||||
return if (line.contains("RESULT") && line.split(" ").size == 8) {
|
|
||||||
line
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import androidx.core.content.ContextCompat
|
|||||||
import androidx.core.view.get
|
import androidx.core.view.get
|
||||||
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.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.presentation.testRight.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
@@ -73,6 +74,12 @@ open class HemocubeBufferCheckActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
|
super.attachBaseContext(newBase)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityHemocubeBinding.inflate(layoutInflater)
|
binding = ActivityHemocubeBinding.inflate(layoutInflater)
|
||||||
@@ -92,7 +99,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 +110,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)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.hpostesting.presentation.dashboard
|
package com.example.hpostesting.presentation.dashboard
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
@@ -10,13 +11,11 @@ import androidx.navigation.ui.AppBarConfiguration
|
|||||||
import androidx.navigation.ui.navigateUp
|
import androidx.navigation.ui.navigateUp
|
||||||
import androidx.navigation.ui.setupActionBarWithNavController
|
import androidx.navigation.ui.setupActionBarWithNavController
|
||||||
import androidx.navigation.ui.setupWithNavController
|
import androidx.navigation.ui.setupWithNavController
|
||||||
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.google.android.material.navigation.NavigationView
|
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
|
||||||
@@ -27,6 +26,12 @@ class DashboardActivity : AppCompatActivity() {
|
|||||||
private lateinit var appBarConfiguration: AppBarConfiguration
|
private lateinit var appBarConfiguration: AppBarConfiguration
|
||||||
private lateinit var binding: ActivityDashboardBinding
|
private lateinit var binding: ActivityDashboardBinding
|
||||||
|
|
||||||
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
|
super.attachBaseContext(newBase)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
@@ -59,7 +64,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()
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.example.hpostesting.data.constant.Constants
|
|||||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
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 com.example.hpostesting.presentation.KitScanActivity
|
import com.example.hpostesting.presentation.KitScanActivity
|
||||||
|
import com.example.hpostesting.presentation.adapter.OfflineUserListAdapter
|
||||||
import com.example.hpostesting.presentation.adapter.UserListAdapter
|
import com.example.hpostesting.presentation.adapter.UserListAdapter
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.example.hpostesting.presentation.testRight.TestRightViewModel
|
import com.example.hpostesting.presentation.testRight.TestRightViewModel
|
||||||
@@ -33,6 +34,7 @@ import dagger.hilt.android.AndroidEntryPoint
|
|||||||
import `in`.sminnovations.hpostesting.R
|
import `in`.sminnovations.hpostesting.R
|
||||||
import `in`.sminnovations.hpostesting.databinding.FragmentHomeBinding
|
import `in`.sminnovations.hpostesting.databinding.FragmentHomeBinding
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Calendar
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
@@ -43,7 +45,9 @@ class HomeFragment : Fragment() {
|
|||||||
private val viewModel: TestRightViewModel by activityViewModels()
|
private val viewModel: TestRightViewModel by activityViewModels()
|
||||||
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
||||||
private lateinit var rvAdapter: UserListAdapter
|
private lateinit var rvAdapter: UserListAdapter
|
||||||
private var batLevel: Int = 0 // Initialize with a default value, or obtain the actual battery level
|
private var batLevel: Int =
|
||||||
|
0 // Initialize with a default value, or obtain the actual battery level
|
||||||
|
private lateinit var adapter: OfflineUserListAdapter
|
||||||
|
|
||||||
|
|
||||||
private lateinit var sharedPreference: SharedPreferences
|
private lateinit var sharedPreference: SharedPreferences
|
||||||
@@ -73,6 +77,19 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userData ->
|
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userData ->
|
||||||
deleteHemoCubeIncompleteRegistrations(userData)
|
deleteHemoCubeIncompleteRegistrations(userData)
|
||||||
|
if (userData.isNotEmpty()) {
|
||||||
|
val userList = mutableListOf<HemoCubeTestData>()
|
||||||
|
userData.forEach {
|
||||||
|
if (it.testStatus == false) {
|
||||||
|
userList.add(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val bm = requireContext().getSystemService(BATTERY_SERVICE) as BatteryManager
|
||||||
|
val batLevel: Int = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
||||||
|
adapter = OfflineUserListAdapter(binding.root, batLevel)
|
||||||
|
adapter.differ.submitList(userList)
|
||||||
|
binding.rvOrderOffline.adapter = adapter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
viewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isConnected ->
|
viewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isConnected ->
|
||||||
if (isConnected) {
|
if (isConnected) {
|
||||||
@@ -91,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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,10 +137,18 @@ class HomeFragment : Fragment() {
|
|||||||
private fun setUserId() {
|
private fun setUserId() {
|
||||||
binding.btnSubmit.setOnClickListener {
|
binding.btnSubmit.setOnClickListener {
|
||||||
val userId = binding.userId.text.toString()
|
val userId = binding.userId.text.toString()
|
||||||
if (userId.length >= 18) {
|
val bloodGroup = binding.etBloodGroup.text
|
||||||
val userData = UserData(_id = userId)
|
if (userId.length >= 18 && !bloodGroup.equals("Select Blood Group") || !bloodGroup.isNullOrBlank()) {
|
||||||
DataHolder.selectedTest = userData
|
hemoCubeViewModel.addUser(
|
||||||
findNavController().navigate(R.id.action_nav_home_to_mainActivity)
|
HemoCubeTestData(
|
||||||
|
_id = userId, bloodGroup = bloodGroup.toString(), incubationTime = SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
).format(Calendar.getInstance().time).toString()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
// val userData = UserData(_id = userId)
|
||||||
|
// DataHolder.selectedTest = userData
|
||||||
|
// findNavController().navigate(R.id.action_nav_home_to_mainActivity)
|
||||||
} else {
|
} else {
|
||||||
val errorMessage = getString(R.string.user_id_error_message)
|
val errorMessage = getString(R.string.user_id_error_message)
|
||||||
Toast.makeText(requireContext(), errorMessage, Toast.LENGTH_SHORT).show()
|
Toast.makeText(requireContext(), errorMessage, Toast.LENGTH_SHORT).show()
|
||||||
@@ -155,10 +180,12 @@ class HomeFragment : Fragment() {
|
|||||||
val bm = requireContext().getSystemService(BATTERY_SERVICE) as BatteryManager
|
val bm = requireContext().getSystemService(BATTERY_SERVICE) as BatteryManager
|
||||||
val batLevel: Int = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
val batLevel: Int = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
||||||
|
|
||||||
rvAdapter = view?.let {
|
rvAdapter = view?.let {
|
||||||
UserListAdapter(requireContext(), hemoCubeViewModel, recyclerViewOptions,
|
UserListAdapter(
|
||||||
it, batLevel, requireActivity())
|
requireContext(), hemoCubeViewModel, recyclerViewOptions,
|
||||||
}!!
|
it, batLevel, requireActivity()
|
||||||
|
)
|
||||||
|
}!!
|
||||||
binding.rvOrder.adapter = rvAdapter
|
binding.rvOrder.adapter = rvAdapter
|
||||||
|
|
||||||
rvAdapter.startListening()
|
rvAdapter.startListening()
|
||||||
@@ -176,14 +203,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()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,8 +233,9 @@ class HomeFragment : Fragment() {
|
|||||||
val partition = dateFormat.format(currentDate)
|
val partition = dateFormat.format(currentDate)
|
||||||
val searchTerm = partition + search
|
val searchTerm = partition + search
|
||||||
val searchField = field + "Search"
|
val searchField = field + "Search"
|
||||||
val query = Firebase.firestore.collection("patientData").orderBy(searchField).startAt(searchTerm)
|
val query =
|
||||||
.endAt(searchTerm + "\uf8ff")
|
Firebase.firestore.collection("patientData").orderBy(searchField).startAt(searchTerm)
|
||||||
|
.endAt(searchTerm + "\uf8ff")
|
||||||
query.get().addOnSuccessListener {
|
query.get().addOnSuccessListener {
|
||||||
userSearchTrace.stop()
|
userSearchTrace.stop()
|
||||||
}
|
}
|
||||||
@@ -218,7 +246,14 @@ class HomeFragment : Fragment() {
|
|||||||
batLevel = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
batLevel = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
||||||
|
|
||||||
rvAdapter = view?.let {
|
rvAdapter = view?.let {
|
||||||
UserListAdapter(requireContext(), hemoCubeViewModel, recyclerViewOptions, it, batLevel, requireActivity())
|
UserListAdapter(
|
||||||
|
requireContext(),
|
||||||
|
hemoCubeViewModel,
|
||||||
|
recyclerViewOptions,
|
||||||
|
it,
|
||||||
|
batLevel,
|
||||||
|
requireActivity()
|
||||||
|
)
|
||||||
}!!
|
}!!
|
||||||
binding.rvOrder.adapter = rvAdapter
|
binding.rvOrder.adapter = rvAdapter
|
||||||
rvAdapter.startListening()
|
rvAdapter.startListening()
|
||||||
@@ -272,7 +307,14 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
hemoCubeViewModel.allUserData.observe(viewLifecycleOwner) { userDataList ->
|
||||||
val uploadDataVisibility = if (userDataList.any { !it.localFlag }) View.VISIBLE else View.GONE
|
val uploadDataVisibility =
|
||||||
|
if (userDataList.any { !it.localFlag && it.testStatus == true}) View.VISIBLE else View.GONE
|
||||||
|
binding.uploadData.visibility = uploadDataVisibility
|
||||||
|
}
|
||||||
|
|
||||||
|
hemoCubeViewModel.allKitTestData.observe(viewLifecycleOwner) {bufferData ->
|
||||||
|
val uploadDataVisibility =
|
||||||
|
if (bufferData.any { !it.localFlag}) View.VISIBLE else View.GONE
|
||||||
binding.uploadData.visibility = uploadDataVisibility
|
binding.uploadData.visibility = uploadDataVisibility
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -319,6 +361,16 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hemoCubeViewModel.allKitTestData.observe(viewLifecycleOwner) { kitDataList ->
|
||||||
|
kitDataList.forEach { userData ->
|
||||||
|
if (!userData.localFlag) {
|
||||||
|
userData.localFlag = true
|
||||||
|
hemoCubeViewModel.bulkAddResultKitTestToDb(userData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog.dismiss()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun deleteIncompleteRegistrations(userDataList: List<UserData>) {
|
private fun deleteIncompleteRegistrations(userDataList: List<UserData>) {
|
||||||
@@ -331,7 +383,7 @@ class HomeFragment : Fragment() {
|
|||||||
|
|
||||||
private fun deleteHemoCubeIncompleteRegistrations(userDataList: List<HemoCubeTestData>) {
|
private fun deleteHemoCubeIncompleteRegistrations(userDataList: List<HemoCubeTestData>) {
|
||||||
userDataList.forEach { userData ->
|
userDataList.forEach { userData ->
|
||||||
if (userData.testTime?.isEmpty() == true) {
|
if (userData._id.isEmpty()) {
|
||||||
hemoCubeViewModel.deleteById(userData._id)
|
hemoCubeViewModel.deleteById(userData._id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +1,66 @@
|
|||||||
package com.example.hpostesting.presentation.dashboard
|
package com.example.hpostesting.presentation.dashboard
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.pm.PackageManager
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.widget.Toast
|
||||||
import android.view.View
|
import androidx.preference.ListPreference
|
||||||
import android.view.ViewGroup
|
import androidx.preference.Preference
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.dashboard.ui.slideshow.SlideshowViewModel
|
import `in`.sminnovations.hpostesting.R
|
||||||
import `in`.sminnovations.hpostesting.databinding.FragmentSlideshowBinding
|
|
||||||
|
|
||||||
|
private var isLanguageChanged = false
|
||||||
|
|
||||||
class SlideshowFragment : Fragment() {
|
class SlideshowFragment : PreferenceFragmentCompat() {
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
val preferenceScreen = preferenceManager.createPreferenceScreen(requireContext())
|
||||||
|
|
||||||
private var _binding: FragmentSlideshowBinding? = null
|
val languagePreference = ListPreference(requireContext())
|
||||||
|
languagePreference.key = "language_preference"
|
||||||
|
languagePreference.title = getString(R.string.app_language)
|
||||||
|
languagePreference.summary = getString(R.string.select_language)
|
||||||
|
languagePreference.entries = arrayOf("English", "Kannada", "Hindi")
|
||||||
|
languagePreference.entryValues = arrayOf("en", "kn", "hi")
|
||||||
|
languagePreference.setDefaultValue("en")
|
||||||
|
|
||||||
// This property is only valid between onCreateView and
|
languagePreference.onPreferenceChangeListener =
|
||||||
// onDestroyView.
|
Preference.OnPreferenceChangeListener { _, newValue ->
|
||||||
private val binding get() = _binding!!
|
val languageCode = newValue as String
|
||||||
|
updateLanguage(requireContext(), languageCode)
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreateView(
|
preferenceScreen.addPreference(languagePreference)
|
||||||
inflater: LayoutInflater,
|
setPreferenceScreen(preferenceScreen)
|
||||||
container: ViewGroup?,
|
|
||||||
savedInstanceState: Bundle?,
|
|
||||||
): View {
|
|
||||||
val slideshowViewModel =
|
|
||||||
ViewModelProvider(this).get(SlideshowViewModel::class.java)
|
|
||||||
|
|
||||||
_binding = FragmentSlideshowBinding.inflate(inflater, container, false)
|
// App Version Preference
|
||||||
val root: View = binding.root
|
val appVersionPreference = Preference(requireContext())
|
||||||
|
appVersionPreference.title = "App Version"
|
||||||
|
appVersionPreference.summary = getAppVersion(requireContext())
|
||||||
|
|
||||||
val pInfo = requireActivity().packageManager.getPackageInfo(
|
preferenceScreen.addPreference(languagePreference)
|
||||||
requireActivity().packageName, 0
|
preferenceScreen.addPreference(appVersionPreference)
|
||||||
)
|
setPreferenceScreen(preferenceScreen)
|
||||||
val version = pInfo.versionName
|
|
||||||
binding.textSlideshow.text = version
|
|
||||||
|
|
||||||
// val textView: TextView = binding.textSlideshow
|
if (isLanguageChanged) {
|
||||||
// slideshowViewModel.text.observe(viewLifecycleOwner) {
|
Toast.makeText(requireContext(), R.string.language_update, Toast.LENGTH_SHORT).show()
|
||||||
// textView.text = it
|
}
|
||||||
// }
|
|
||||||
return root
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
private fun updateLanguage(context: Context, languageCode: String) {
|
||||||
super.onDestroyView()
|
LanguageManager.persistLanguagePreference(context, languageCode)
|
||||||
_binding = null
|
LanguageManager.setLocale(context, languageCode)
|
||||||
|
requireActivity().recreate() // Recreate activity to apply language changes
|
||||||
|
isLanguageChanged = true
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getAppVersion(context: Context): String {
|
||||||
|
return try {
|
||||||
|
val pInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
||||||
|
pInfo.versionName
|
||||||
|
} catch (e: PackageManager.NameNotFoundException) {
|
||||||
|
"N/A"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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) {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import androidx.core.content.ContextCompat
|
|||||||
import androidx.core.view.get
|
import androidx.core.view.get
|
||||||
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.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeFragment
|
import com.example.hpostesting.presentation.hemocube.HemoCubeFragment
|
||||||
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
import com.example.hpostesting.presentation.hemocube.HemoCubeViewModel
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.presentation.testRight.UsbService
|
||||||
@@ -77,6 +78,12 @@ class DiagnosticsActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
|
super.attachBaseContext(newBase)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityDiagnosticsBinding.inflate(layoutInflater)
|
binding = ActivityDiagnosticsBinding.inflate(layoutInflater)
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.example.hpostesting.presentation.hemocube
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.ComponentName
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.ServiceConnection
|
||||||
|
import android.hardware.usb.UsbDevice
|
||||||
|
import android.hardware.usb.UsbDeviceConnection
|
||||||
|
import android.hardware.usb.UsbManager
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.os.IBinder
|
||||||
|
import android.view.Menu
|
||||||
|
import androidx.activity.viewModels
|
||||||
|
import com.example.hpostesting.data.DataHolder
|
||||||
|
import com.example.hpostesting.data.constant.LanguageManager
|
||||||
|
import com.example.hpostesting.presentation.testRight.UsbService
|
||||||
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
|
import `in`.sminnovations.hpostesting.R
|
||||||
|
import `in`.sminnovations.hpostesting.databinding.ActivityDigitalCardBinding
|
||||||
|
import `in`.sminnovations.hpostesting.databinding.ActivityHemocubeBinding
|
||||||
|
|
||||||
|
class DigitalCardActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
private lateinit var binding: ActivityDigitalCardBinding
|
||||||
|
|
||||||
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
|
super.attachBaseContext(newBase)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
binding = ActivityDigitalCardBinding.inflate(layoutInflater)
|
||||||
|
setContentView(binding.root)
|
||||||
|
moveToNext()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun moveToNext() {
|
||||||
|
if (supportFragmentManager.isDestroyed) return
|
||||||
|
supportFragmentManager.beginTransaction().replace(binding.fghemocube.id, DigitalCardFragment())
|
||||||
|
.commit()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.example.hpostesting.presentation.hemocube
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import androidx.fragment.app.activityViewModels
|
||||||
|
import com.example.hpostesting.data.DataHolder
|
||||||
|
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||||
|
import `in`.sminnovations.hpostesting.R
|
||||||
|
import `in`.sminnovations.hpostesting.databinding.FragmentDigitalCardBinding
|
||||||
|
import `in`.sminnovations.hpostesting.databinding.FragmentHemoCubeReferenceBinding
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Calendar
|
||||||
|
import java.util.Date
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
|
class DigitalCardFragment : Fragment() {
|
||||||
|
private lateinit var binding: FragmentDigitalCardBinding
|
||||||
|
private val hemoCubeViewModel: HemoCubeViewModel by activityViewModels()
|
||||||
|
private lateinit var sharedPreferences: SharedPreferences
|
||||||
|
private val testDetails = DataHolder.selectedTest?.toHemoCubeTestData()
|
||||||
|
|
||||||
|
override fun onCreateView(
|
||||||
|
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?,
|
||||||
|
): View {
|
||||||
|
binding = FragmentDigitalCardBinding.inflate(inflater, container, false)
|
||||||
|
sharedPreferences =
|
||||||
|
requireContext().getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE)
|
||||||
|
return binding.root
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
initViews()
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
private fun initViews() {
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.progressBar.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
Log.d("DigitalCardFragment", "Name: ${DataHolder.hemoCubeTestData?.name}")
|
||||||
|
Log.d("DigitalCardFragment", "DOB: ${testDetails?.birthYear}")
|
||||||
|
Log.d("DigitalCardFragment", "Gender: ${testDetails?.gender}")
|
||||||
|
Log.d("DigitalCardFragment", "State: ${testDetails?.state}")
|
||||||
|
Log.d("DigitalCardFragment", "ABHA ID: ${testDetails?.abhaId}")
|
||||||
|
Log.d("DigitalCardFragment", "Blood Group: ${testDetails?.bloodGroup}")
|
||||||
|
Log.d("DigitalCardFragment", "Sickle-Cell: ${testDetails?.classificationResult}")
|
||||||
|
// Log.d("DigitalCardFragment", "Issue Date: $formattedDate")
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.progressBar.visibility = View.GONE
|
||||||
|
binding.name.text = "Name: ${DataHolder.hemoCubeTestData?.name}"
|
||||||
|
binding.dob.text = "DOB: ${testDetails?.birthYear}"
|
||||||
|
binding.gender.text = "Gender: ${testDetails?.gender}"
|
||||||
|
binding.State.text = "State: ${testDetails?.state}"
|
||||||
|
binding.abhaid.text = "ABHA ID: ${testDetails?.abhaId}"
|
||||||
|
binding.blood.text = "Blood Group: ${testDetails?.bloodGroup}"
|
||||||
|
binding.sicklecell.text = "Sickle-Cell: ${DataHolder.hemoCubeTestData?.prdClassification.toString()}"
|
||||||
|
|
||||||
|
}
|
||||||
|
// Update the UI with the fetched details
|
||||||
|
val originalDateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
|
||||||
|
val originalDate: Date? = originalDateFormat.parse(SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
).format(Calendar.getInstance().time))
|
||||||
|
|
||||||
|
// Format the parsed date to "mm date, year"
|
||||||
|
val desiredDateFormat = SimpleDateFormat("MMM dd, yyyy", Locale.getDefault())
|
||||||
|
val formattedDate: String = originalDate?.let { desiredDateFormat.format(it) } ?: "N/A"
|
||||||
|
activity?.runOnUiThread {
|
||||||
|
binding.issueDate.text = "Issue Date: ${formattedDate}"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,10 @@
|
|||||||
package com.example.hpostesting.presentation.hemocube
|
package com.example.hpostesting.presentation.hemocube
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
import android.os.BatteryManager
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
@@ -10,13 +13,14 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import com.example.hpostesting.data.DataHolder
|
import com.example.hpostesting.data.DataHolder
|
||||||
import com.example.hpostesting.data.NetworkStatusLiveData
|
import com.example.hpostesting.data.NetworkStatusLiveData
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
|
import com.example.hpostesting.data.dao.HemoCubeBufferDao
|
||||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
import com.example.hpostesting.data.dao.HemoCubeDao
|
||||||
import com.example.hpostesting.data.model.Response
|
import com.example.hpostesting.data.model.Response
|
||||||
import com.example.hpostesting.data.model.patient.BufferCheckData
|
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.HemoCubeTestData
|
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||||
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
import com.example.hpostesting.data.model.patient.toHemoCubeTestData
|
||||||
import com.example.hpostesting.data.repository.DatabaseRepository
|
import com.example.hpostesting.data.repository.Repository
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
@@ -27,7 +31,8 @@ import javax.inject.Inject
|
|||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
class HemoCubeViewModel @Inject constructor(
|
class HemoCubeViewModel @Inject constructor(
|
||||||
private val hemoCubeDao: HemoCubeDao,
|
private val hemoCubeDao: HemoCubeDao,
|
||||||
private val repository: DatabaseRepository,
|
private val hemoCubeBufferDao: HemoCubeBufferDao,
|
||||||
|
private val repository: Repository,
|
||||||
context: Context,
|
context: Context,
|
||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
var isServiceConnected = false
|
var isServiceConnected = false
|
||||||
@@ -41,11 +46,19 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
|
|
||||||
private val _networkStatusLiveData = NetworkStatusLiveData(context)
|
private val _networkStatusLiveData = NetworkStatusLiveData(context)
|
||||||
val allUserData = hemoCubeDao.getAll()
|
val allUserData = hemoCubeDao.getAll()
|
||||||
|
val allKitTestData = hemoCubeBufferDao.getAll()
|
||||||
val deviceData = MutableLiveData<DeviceData?>()
|
val deviceData = MutableLiveData<DeviceData?>()
|
||||||
val networkStatusLiveData: LiveData<Boolean>
|
val networkStatusLiveData: LiveData<Boolean>
|
||||||
get() = _networkStatusLiveData
|
get() = _networkStatusLiveData
|
||||||
|
val deviceMessages = MutableLiveData<String?>()
|
||||||
val fireBaseUpload = MutableLiveData<String>()
|
val fireBaseUpload = MutableLiveData<String>()
|
||||||
val fireBaseBulkUpload = MutableLiveData<String>()
|
val fireBaseBulkUpload = MutableLiveData<String>()
|
||||||
|
|
||||||
|
private val batteryStatus: Intent? =
|
||||||
|
IntentFilter(Intent.ACTION_BATTERY_CHANGED).let { ifilter ->
|
||||||
|
context.registerReceiver(null, ifilter)
|
||||||
|
}
|
||||||
|
|
||||||
fun uploadHemoCubeResultToDatabase(isOnline: Boolean, testStatus: Boolean, kitSerial: String?) =
|
fun uploadHemoCubeResultToDatabase(isOnline: Boolean, testStatus: Boolean, kitSerial: String?) =
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
if (kitSerial != null) {
|
if (kitSerial != null) {
|
||||||
@@ -71,16 +84,49 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fun uploadHemoCubeResultToDatabaseforbuffercheckN(bufferCheckData: BufferCheckData) =
|
fun uploadHemoCubeResultToDatabaseforbuffercheckN(bufferCheckData: BufferCheckData) =
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
addResultTestToDbforbuffercheck(bufferCheckData)
|
addResultTestToDbforbuffercheck(bufferCheckData)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getDeviceData(deviceId: String?) = viewModelScope.launch {
|
fun getDeviceData(deviceId: String?) = viewModelScope.launch {
|
||||||
deviceData.postValue(deviceId?.let { repository.getDeviceDataById(it) })
|
deviceData.postValue(deviceId?.let { repository.getDeviceDataById(it) })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun uploadHemoCubeResultToDatabaseForBufferCheck(
|
||||||
|
isOnline: Boolean,
|
||||||
|
bufferCheckData: BufferCheckData,
|
||||||
|
) =
|
||||||
|
viewModelScope.launch {
|
||||||
|
if (isOnline) {
|
||||||
|
try {
|
||||||
|
when (val response =
|
||||||
|
repository.addTestToDatabaseforBufferCheck(bufferCheckData)) {
|
||||||
|
is Response.Success -> {
|
||||||
|
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
||||||
|
fireBaseUpload.postValue("Success")
|
||||||
|
bufferCheckData.localFlag = true
|
||||||
|
hemoCubeBufferDao.insertAll(bufferCheckData)
|
||||||
|
}
|
||||||
|
|
||||||
|
is Response.Error -> {
|
||||||
|
Log.e("Testdb", "Error uploading data to Firestore: $response")
|
||||||
|
fireBaseUpload.postValue("Error")
|
||||||
|
bufferCheckData.localFlag = true
|
||||||
|
hemoCubeBufferDao.insertAll(bufferCheckData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("Testdb", "Exception during data upload: ${e.message}")
|
||||||
|
fireBaseUpload.postValue("Error")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
hemoCubeBufferDao.insertAll(bufferCheckData)
|
||||||
|
fireBaseUpload.postValue("Local")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun parseData() {
|
private fun parseData() {
|
||||||
testDetails?.deviceRatio = DataHolder.hemocubeResult
|
testDetails?.deviceRatio = DataHolder.hemocubeResult
|
||||||
testDetails?.resultData = DataHolder.hemoCubeTestData?.resultData.toString()
|
testDetails?.resultData = DataHolder.hemoCubeTestData?.resultData.toString()
|
||||||
@@ -95,14 +141,32 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
testDetails?.kitSerial = sharedPreference.getString(Constants.KIT_NUMBER, "").toString()
|
testDetails?.kitSerial = sharedPreference.getString(Constants.KIT_NUMBER, "").toString()
|
||||||
testDetails?.led1Buffer = DataHolder.hemoCubeTestData?.led1Buffer
|
testDetails?.led1Buffer = DataHolder.hemoCubeTestData?.led1Buffer
|
||||||
testDetails?.led2Buffer = DataHolder.hemoCubeTestData?.led2Buffer
|
testDetails?.led2Buffer = DataHolder.hemoCubeTestData?.led2Buffer
|
||||||
|
testDetails?.led3Buffer = DataHolder.hemoCubeTestData?.led3Buffer
|
||||||
|
testDetails?.led4Buffer = DataHolder.hemoCubeTestData?.led4Buffer
|
||||||
testDetails?.led1Sample = DataHolder.hemoCubeTestData?.led1Sample
|
testDetails?.led1Sample = DataHolder.hemoCubeTestData?.led1Sample
|
||||||
testDetails?.led2Sample = DataHolder.hemoCubeTestData?.led2Sample
|
testDetails?.led2Sample = DataHolder.hemoCubeTestData?.led2Sample
|
||||||
|
testDetails?.led3Sample = DataHolder.hemoCubeTestData?.led3Sample
|
||||||
|
testDetails?.led4Sample = DataHolder.hemoCubeTestData?.led4Sample
|
||||||
testDetails?.led1Average = DataHolder.hemoCubeTestData?.led1Average
|
testDetails?.led1Average = DataHolder.hemoCubeTestData?.led1Average
|
||||||
testDetails?.led2Average = DataHolder.hemoCubeTestData?.led2Average
|
testDetails?.led2Average = DataHolder.hemoCubeTestData?.led2Average
|
||||||
|
testDetails?.led3Average = DataHolder.hemoCubeTestData?.led3Average
|
||||||
|
testDetails?.led4Average = DataHolder.hemoCubeTestData?.led4Average
|
||||||
|
testDetails?.abs1 = DataHolder.hemoCubeTestData?.abs1
|
||||||
|
testDetails?.abs2 = DataHolder.hemoCubeTestData?.abs2
|
||||||
|
testDetails?.abs3 = DataHolder.hemoCubeTestData?.abs3
|
||||||
|
testDetails?.abs4 = DataHolder.hemoCubeTestData?.abs4
|
||||||
testDetails?.deviceRatio = DataHolder.hemoCubeTestData?.deviceRatio
|
testDetails?.deviceRatio = DataHolder.hemoCubeTestData?.deviceRatio
|
||||||
|
testDetails?.predictedDenovixRatio = DataHolder.hemoCubeTestData?.predictedDenovixRatio
|
||||||
testDetails?.calculatedRatio = DataHolder.hemoCubeTestData?.calculatedRatio
|
testDetails?.calculatedRatio = DataHolder.hemoCubeTestData?.calculatedRatio
|
||||||
testDetails?.coefficients = DataHolder.hemoCubeTestData?.coefficients
|
testDetails?.coefficients = DataHolder.hemoCubeTestData?.coefficients
|
||||||
testDetails?.classificationResult = DataHolder.hemoCubeTestData?.classificationResult!!
|
testDetails?.classificationResult = DataHolder.hemoCubeTestData?.classificationResult!!
|
||||||
|
testDetails?.prdClassification = DataHolder.hemoCubeTestData?.prdClassification.toString()
|
||||||
|
testDetails?.errorMessages = DataHolder.hemoCubeTestData?.errorMessages.toString()
|
||||||
|
testDetails?.batteryLevel = DataHolder.hemoCubeTestData?.batteryLevel.toString()
|
||||||
|
testDetails?.batteryCapacity = DataHolder.hemoCubeTestData?.batteryCapacity.toString()
|
||||||
|
testDetails?.batteryMaxCapacity = DataHolder.hemoCubeTestData?.batteryMaxCapacity.toString()
|
||||||
|
testDetails?.batteryTemperature = DataHolder.hemoCubeTestData?.batteryTemperature.toString()
|
||||||
|
testDetails?.batteryVoltage = DataHolder.hemoCubeTestData?.batteryVoltage.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addResultTestToDb() {
|
private fun addResultTestToDb() {
|
||||||
@@ -138,12 +202,30 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun bulkAddResultKitTestToDb(bufferCheckData: BufferCheckData) {
|
||||||
|
viewModelScope.launch {
|
||||||
|
bufferCheckData.reportUploadTime = SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
).format(Calendar.getInstance().time)
|
||||||
|
when (repository.addTestToDatabaseforBufferCheck(bufferCheckData)) {
|
||||||
|
is Response.Success -> {
|
||||||
|
fireBaseBulkUpload.postValue("Success")
|
||||||
|
updateBufferLocalFlag(bufferCheckData._id)
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
fireBaseBulkUpload.postValue("Error")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun addResultTestToDbforbuffercheck(bufferCheckData: BufferCheckData) {
|
private fun addResultTestToDbforbuffercheck(bufferCheckData: BufferCheckData) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
when (val response = repository.addTestToDatabaseforBufferCheck(bufferCheckData)) {
|
when (val response =
|
||||||
|
repository.addTestToDatabaseforBufferCheck(bufferCheckData)) {
|
||||||
is Response.Success -> {
|
is Response.Success -> {
|
||||||
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
||||||
fireBaseUpload.postValue("Success")
|
fireBaseUpload.postValue("Success")
|
||||||
@@ -161,6 +243,12 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun updateBufferLocalFlag(bufferId: String) =
|
||||||
|
viewModelScope.launch {
|
||||||
|
hemoCubeBufferDao.updateFieldById(id = bufferId, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun bulkAddResultTestToDb(userData: HemoCubeTestData) {
|
fun bulkAddResultTestToDb(userData: HemoCubeTestData) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
userData.reportUploadTime = SimpleDateFormat(
|
userData.reportUploadTime = SimpleDateFormat(
|
||||||
@@ -179,11 +267,88 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateLocalFlag(userId: String) = viewModelScope.launch {
|
private fun updateLocalFlag(userId: String) =
|
||||||
hemoCubeDao.updateFieldById(id = userId, true)
|
viewModelScope.launch {
|
||||||
}
|
hemoCubeDao.updateFieldById(id = userId, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun addUser(userData: HemoCubeTestData) =
|
||||||
|
viewModelScope.launch {
|
||||||
|
hemoCubeDao.insertAll(userData)
|
||||||
|
}
|
||||||
|
|
||||||
fun deleteById(userId: String) = viewModelScope.launch {
|
fun deleteById(userId: String) = viewModelScope.launch {
|
||||||
hemoCubeDao.deleteById(id = userId)
|
hemoCubeDao.deleteById(id = userId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getBatteryLevel(): Float? {
|
||||||
|
val batteryPct: Float? = batteryStatus?.let { intent ->
|
||||||
|
val level: Int =
|
||||||
|
intent.getIntExtra(
|
||||||
|
BatteryManager.EXTRA_LEVEL,
|
||||||
|
-1
|
||||||
|
)
|
||||||
|
val scale: Int =
|
||||||
|
intent.getIntExtra(
|
||||||
|
BatteryManager.EXTRA_SCALE,
|
||||||
|
-1
|
||||||
|
)
|
||||||
|
level * 100 / scale.toFloat()
|
||||||
|
}
|
||||||
|
|
||||||
|
return batteryPct
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getBatteryTemperature()
|
||||||
|
|
||||||
|
: Float
|
||||||
|
? {
|
||||||
|
val batteryTemp: Float? = batteryStatus?.let { intent ->
|
||||||
|
val temperature = intent?.getIntExtra(
|
||||||
|
BatteryManager.EXTRA_TEMPERATURE,
|
||||||
|
0
|
||||||
|
) ?: 0
|
||||||
|
temperature.toFloat() / 10
|
||||||
|
}
|
||||||
|
|
||||||
|
return batteryTemp
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getBatteryVoltage(context: Context): Float {
|
||||||
|
val batteryIntent =
|
||||||
|
context.registerReceiver(
|
||||||
|
null,
|
||||||
|
IntentFilter(Intent.ACTION_BATTERY_CHANGED)
|
||||||
|
)
|
||||||
|
val voltage = batteryIntent?.getIntExtra(
|
||||||
|
BatteryManager.EXTRA_VOLTAGE,
|
||||||
|
0
|
||||||
|
) ?: 0
|
||||||
|
|
||||||
|
// milli-volts to volts
|
||||||
|
return voltage.toFloat() / 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun getBatteryCapacity(context: Context): Int {
|
||||||
|
val batteryManager =
|
||||||
|
context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager
|
||||||
|
val currentCapacity =
|
||||||
|
batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER)
|
||||||
|
|
||||||
|
return currentCapacity
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getBatteryMaxCapacity(context: Context): Float {
|
||||||
|
val batteryManager = context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager
|
||||||
|
val designCapacity =
|
||||||
|
batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY)
|
||||||
|
val currentCapacity =
|
||||||
|
batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER)
|
||||||
|
|
||||||
|
// Calculate the estimated maximum battery capacity in mAh
|
||||||
|
val maxCapacity = currentCapacity.toFloat() / designCapacity.toFloat() * 100
|
||||||
|
|
||||||
|
return maxCapacity
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,7 @@ import androidx.core.content.ContextCompat
|
|||||||
import androidx.core.view.get
|
import androidx.core.view.get
|
||||||
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.data.constant.LanguageManager
|
||||||
import com.example.hpostesting.presentation.testRight.UsbService
|
import com.example.hpostesting.presentation.testRight.UsbService
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
import com.hoho.android.usbserial.driver.UsbSerialDriver
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber
|
import com.hoho.android.usbserial.driver.UsbSerialProber
|
||||||
@@ -72,6 +73,12 @@ open class HemocubeActivity : AppCompatActivity() {
|
|||||||
viewModel.isServiceConnected = false
|
viewModel.isServiceConnected = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
|
super.attachBaseContext(newBase)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.example.hpostesting.presentation.testRight
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.util.Log
|
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
|
|||||||
@@ -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(115200, 8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE)
|
mPort.setParameters(9600, 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}")
|
||||||
|
|
||||||
|
|||||||
BIN
app/src/main/res/drawable/indianoil.jpg
Normal file
BIN
app/src/main/res/drawable/indianoil.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable/karnataka.png
Normal file
BIN
app/src/main/res/drawable/karnataka.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
5
app/src/main/res/drawable/person.xml
Normal file
5
app/src/main/res/drawable/person.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
|
||||||
|
</vector>
|
||||||
BIN
app/src/main/res/drawable/user.png
Normal file
BIN
app/src/main/res/drawable/user.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
38
app/src/main/res/layout/activity_digital_card.xml
Normal file
38
app/src/main/res/layout/activity_digital_card.xml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/my_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:titleTextColor="#FFFFFF"
|
||||||
|
android:elevation="4dp"
|
||||||
|
app:menu="@menu/my_menu"
|
||||||
|
android:theme="@style/ToolbarTheme"
|
||||||
|
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fghemocube"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/my_toolbar"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<!-- NavHostFragment for navigation -->
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout 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">
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_parent"
|
android:id="@+id/cl_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -21,21 +19,17 @@
|
|||||||
android:theme="@style/ToolbarTheme"
|
android:theme="@style/ToolbarTheme"
|
||||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/fghemocube"
|
android:id="@+id/fghemocube"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/my_toolbar"
|
app:layout_constraintTop_toBottomOf="@id/my_toolbar"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:context=".presentation.hemocube.HemocubeActivity">
|
tools:context=".presentation.hemocube.HemocubeActivity">
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</layout>
|
|
||||||
|
|||||||
@@ -18,4 +18,6 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:navGraph="@navigation/dashboard_navigation" />
|
app:navGraph="@navigation/dashboard_navigation" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
242
app/src/main/res/layout/fragment_digital_card.xml
Normal file
242
app/src/main/res/layout/fragment_digital_card.xml
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context="com.example.hpostesting.presentation.hemocube.DigitalCardFragment">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/userCard"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="350dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:cardBackgroundColor="#C0C0C0"
|
||||||
|
app:cardCornerRadius="25dp"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fragment_container_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@android:color/background_light"/>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="22dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/userImage"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:src="@drawable/karnataka" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/userName"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/userImage"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/userImage"
|
||||||
|
android:src="@drawable/sickle_cell_gov_logo"/>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/userImage3"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/userName"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/userName"
|
||||||
|
android:src="@drawable/indianoil"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/userdetails"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:cardBackgroundColor="#FFFFFF"
|
||||||
|
app:cardCornerRadius="5dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/userImage"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
tools:ignore="MissingConstraints">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/userImage"
|
||||||
|
android:text="name: Mariya" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/dob"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/name"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/name"
|
||||||
|
android:text="DOB: 1998" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/gender"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/dob"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/dob"
|
||||||
|
android:text="gender: female" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/State"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="130dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginTop="70dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/gender"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/gender"
|
||||||
|
android:text="State: Kerala" />
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/userdetails2"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:cardBackgroundColor="#FFFFFF"
|
||||||
|
app:cardCornerRadius="5dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/userdetails"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/abhaid"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||||
|
android:text="ABHA-ID: XXXX-8734" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/blood"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||||
|
android:text="Blood Group: O +ve" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sicklecell"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||||
|
android:text="Sickle-Cell: Normal (HbA)" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/issueDate"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="70dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/userImage3"
|
||||||
|
android:text="Issue Date: Oct 2,2023" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/digitalcard"
|
||||||
|
android:backgroundTint="#00008B"
|
||||||
|
app:cardBackgroundColor="#00008B"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:text="@string/digital_card"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/userdetails" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:elevation="12dp"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:indeterminateDrawable="@drawable/progressbar_drawable"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -147,8 +147,35 @@
|
|||||||
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"
|
||||||
@@ -168,72 +195,49 @@
|
|||||||
style="@style/title1_1"
|
style="@style/title1_1"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginHorizontal="24dp"
|
android:layout_marginHorizontal="24dp"
|
||||||
android:layout_marginTop="172dp"
|
android:layout_marginTop="72dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/red"
|
android:textColor="@color/red"
|
||||||
android:textSize="18sp"
|
android:textSize="12sp"
|
||||||
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/btn_submit" />
|
app:layout_constraintTop_toBottomOf="@id/btn_submit" />
|
||||||
|
|
||||||
<!-- <com.google.android.material.textfield.TextInputLayout-->
|
<ScrollView
|
||||||
<!-- android:id="@+id/til_blood_group"-->
|
android:layout_width="match_parent"
|
||||||
<!-- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"-->
|
android:layout_height="wrap_content"
|
||||||
<!-- android:layout_width="match_parent"-->
|
android:layout_marginHorizontal="24dp"
|
||||||
<!-- android:layout_height="wrap_content"-->
|
android:layout_marginTop="12dp"
|
||||||
<!-- android:layout_marginHorizontal="24dp"-->
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
<!-- android:layout_marginTop="16dp"-->
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
app:layout_constraintTop_toBottomOf="@id/error_message">
|
||||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
|
||||||
<!-- app:layout_constraintTop_toBottomOf="@id/tv_subtitle4">-->
|
|
||||||
|
|
||||||
<!-- <AutoCompleteTextView-->
|
<TextView
|
||||||
<!-- android:id="@+id/et_blood_group"-->
|
android:id="@+id/tv_device_messages"
|
||||||
<!-- android:layout_width="match_parent"-->
|
style="@style/title1_1"
|
||||||
<!-- android:layout_height="wrap_content"-->
|
android:layout_width="match_parent"
|
||||||
<!-- android:hint="@string/select_blood_group"-->
|
android:layout_height="wrap_content"
|
||||||
<!-- android:inputType="none"-->
|
android:gravity="center"
|
||||||
<!-- android:labelFor="@id/til_blood_group"-->
|
android:textColor="@color/black"
|
||||||
<!-- app:simpleItems="@array/blood_group" />-->
|
android:textSize="11sp"
|
||||||
|
android:visibility="gone" />
|
||||||
<!-- </com.google.android.material.textfield.TextInputLayout>-->
|
</ScrollView>
|
||||||
|
|
||||||
<!-- <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>-->
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/btn_digitalCard"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:clickable="false"
|
||||||
|
android:text="DigitalCard View"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/error_message" />
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
android:id="@+id/internetNotAvailableCL"
|
android:id="@+id/internetNotAvailableCL"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:padding="24dp">
|
android:padding="24dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -57,6 +57,27 @@
|
|||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/til_blood_group"
|
||||||
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/til_name">
|
||||||
|
|
||||||
|
<AutoCompleteTextView
|
||||||
|
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>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_submit"
|
android:id="@+id/btn_submit"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -66,7 +87,18 @@
|
|||||||
app:cornerRadius="100dp"
|
app:cornerRadius="100dp"
|
||||||
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/til_name" />
|
app:layout_constraintTop_toBottomOf="@+id/til_blood_group" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_order_offline"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/btn_submit"
|
||||||
|
tools:listitem="@layout/offline_user_list_view" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
@@ -74,7 +106,7 @@
|
|||||||
android:id="@+id/internetAvailableCL"
|
android:id="@+id/internetAvailableCL"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
android:padding="24dp">
|
android:padding="24dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -4,19 +4,6 @@
|
|||||||
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
|
|
||||||
android:id="@+id/text_slideshow"
|
|
||||||
style="@style/title1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="24dp"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:text="@string/to_be_launched_in_next_version_of_the_app"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
</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>
|
||||||
71
app/src/main/res/layout/offline_user_list_view.xml
Normal file
71
app/src/main/res/layout/offline_user_list_view.xml
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/userCard"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:cardBackgroundColor="@color/primary_light"
|
||||||
|
app:cardCornerRadius="25dp"
|
||||||
|
app:cardElevation="0dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="12dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/userID"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
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_toTopOf="parent"
|
||||||
|
tools:text="Name: MohamedKaif" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bloodGroup"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
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/userID"
|
||||||
|
tools:text="UserID: MohamedKaif" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/time"
|
||||||
|
style="@style/title1_1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
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" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
22
app/src/main/res/navigation/navigation_graph.xml
Normal file
22
app/src/main/res/navigation/navigation_graph.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/navigation_graph"
|
||||||
|
app:startDestination="@id/hemoCubeFragment">
|
||||||
|
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/hemoCubeFragment"
|
||||||
|
android:name="com.example.hpostesting.presentation.hemocube.HemoCubeFragment"
|
||||||
|
android:label="fragment_hemo_cube_reference"
|
||||||
|
tools:layout="@layout/fragment_hemo_cube_reference" >
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_hemoCubeFragment_to_digitalCardFragment"
|
||||||
|
app:destination="@id/digitalCardFragment" />
|
||||||
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/digitalCardFragment"
|
||||||
|
android:name="com.example.hpostesting.presentation.hemocube.DigitalCardFragment"
|
||||||
|
android:label="fragment_digital_card"
|
||||||
|
tools:layout="@layout/fragment_digital_card" />
|
||||||
|
</navigation>
|
||||||
263
app/src/main/res/values-hi/strings.xml
Normal file
263
app/src/main/res/values-hi/strings.xml
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
<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>
|
||||||
|
<string name="language_update">भाषा सफलतापूर्वक अपडेट की गई है</string>
|
||||||
|
<string name="select_language">अपनी पसंदीदा भाषा का चयन करें</string>
|
||||||
|
<string name="app_language">ऐप भाषा</string>
|
||||||
|
<string name="add_blood_group">रक्त समूह जोड़ें</string>
|
||||||
|
<string name="ok">ठीक है</string>
|
||||||
|
</resources>
|
||||||
265
app/src/main/res/values-kn/strings.xml
Normal file
265
app/src/main/res/values-kn/strings.xml
Normal file
@@ -0,0 +1,265 @@
|
|||||||
|
<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">ಕಿಟ್ನ ಕ್ಯೂಆರ್ ಕೋಡ್ ಅನ್ನು ಸ್ಕ್ಯಾನ್ ಮಾಡಿ</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>
|
||||||
|
<string name="language_update">ಭಾಷೆ ಯಶಸ್ವಿಯಾಗಿ ನವೀಕರಿಸಲಾಗಿದೆ</string>
|
||||||
|
<string name="select_language">ನಿಮ್ಮ ಆದರಿತ ಭಾಷೆಯನ್ನು ಆಯ್ಕೆ ಮಾಡಿ</string>
|
||||||
|
<string name="app_language">ಅಪ್ಲಿಕೇಶನ್ ಭಾಷೆ</string>
|
||||||
|
<string name="add_blood_group">ರಕ್ತ ಗುಂಡನ್ನು ಸೇರಿಸಿ</string>
|
||||||
|
<string name="ok">ಸರಿ</string>
|
||||||
|
<!-- Add translations for other strings -->
|
||||||
|
|
||||||
|
</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>
|
||||||
@@ -113,7 +111,7 @@
|
|||||||
<string name="sickle_find">Sickle Find</string>
|
<string name="sickle_find">Sickle Find</string>
|
||||||
<string name="submit">Submit</string>
|
<string name="submit">Submit</string>
|
||||||
<string name="diagnostics">Device Diagnostics</string>
|
<string name="diagnostics">Device Diagnostics</string>
|
||||||
<string name="place_buffer">Start Buffer</string>
|
<string name="place_buffer">Start</string>
|
||||||
<string name="Start_Sample">Start Sample</string>
|
<string name="Start_Sample">Start Sample</string>
|
||||||
<string name="new_kit">New Kit</string>
|
<string name="new_kit">New Kit</string>
|
||||||
<string name="new_buffer">New Buffer</string>
|
<string name="new_buffer">New Buffer</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>
|
||||||
@@ -158,6 +155,8 @@
|
|||||||
<string name="is_patient_married_yes_no">Is Patient Married? (Yes/No)</string>
|
<string name="is_patient_married_yes_no">Is Patient Married? (Yes/No)</string>
|
||||||
<string name="category">Category</string>
|
<string name="category">Category</string>
|
||||||
<string name="blood_group">Blood Group</string>
|
<string name="blood_group">Blood Group</string>
|
||||||
|
<string name="add_blood_group">Add Blood Group</string>
|
||||||
|
<string name="digital_card">Digital Counselling Card</string>
|
||||||
<string name="patient_medical_records">Patient Medical Records</string>
|
<string name="patient_medical_records">Patient Medical Records</string>
|
||||||
<string name="patient_address_details">Patient Address Details</string>
|
<string name="patient_address_details">Patient Address Details</string>
|
||||||
<string name="district">District</string>
|
<string name="district">District</string>
|
||||||
@@ -183,10 +182,10 @@
|
|||||||
<string name="user_list">User List</string>
|
<string name="user_list">User List</string>
|
||||||
<string name="user_id">User ID</string>
|
<string name="user_id">User ID</string>
|
||||||
<string name="aadhar_id">Aadhar ID</string>
|
<string name="aadhar_id">Aadhar ID</string>
|
||||||
<string name="internet_not_available_please_enter_the_user_id_manually">Internet not available, please enter the user ID manually</string>
|
<string name="internet_not_available_please_enter_the_user_id_manually">Internet not available, please enter the user ID and blood group manually</string>
|
||||||
<string name="user_id_error_message">User ID should be 18 digits</string>
|
<string name="user_id_error_message">User ID should be 18 digits and please select the blood group</string>
|
||||||
<string name="upload_db_registration_title">Upload DB Registration</string>
|
<string name="upload_db_registration_title">Upload DB Tests</string>
|
||||||
<string name="upload_db_registration_message">Do you want to upload the local DB Registration to the cloud?</string>
|
<string name="upload_db_registration_message">Do you want to upload the local DB tests to the cloud?</string>
|
||||||
<string name="upload">Upload</string>
|
<string name="upload">Upload</string>
|
||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="upload_success_message">Upload done successfully</string>
|
<string name="upload_success_message">Upload done successfully</string>
|
||||||
@@ -195,5 +194,71 @@
|
|||||||
<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="power_bank">Connect with Power Bank</string>
|
||||||
|
<string name="start">Start</string>
|
||||||
|
<string name="place_sample">Place Sample</string>
|
||||||
|
<string name="invalid">Invalid</string>
|
||||||
|
<string name="error">Error</string>
|
||||||
|
<string name="language_update">Language updated successfully</string>
|
||||||
|
<string name="select_language">Select your preferred language</string>
|
||||||
|
<string name="app_language">App Language</string>
|
||||||
|
<string name="ok">OK</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
<!-- <usb-device vendor-id="1027" product-id="24592" /> <!– 0x6010: FT2232H –>-->
|
<!-- <usb-device vendor-id="1027" product-id="24592" /> <!– 0x6010: FT2232H –>-->
|
||||||
<!-- <usb-device vendor-id="1027" product-id="24593" /> <!– 0x6011: FT4232H –>-->
|
<!-- <usb-device vendor-id="1027" product-id="24593" /> <!– 0x6011: FT4232H –>-->
|
||||||
<!-- <usb-device vendor-id="1027" product-id="24596" /> <!– 0x6014: FT232H –>-->
|
<!-- <usb-device vendor-id="1027" product-id="24596" /> <!– 0x6014: FT232H –>-->
|
||||||
<usb-device vendor-id="1027" product-id="24597" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
<usb-device vendor-id="1027" product-id="24577" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
||||||
<usb-device vendor-id="6790" product-id="29987" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
<usb-device vendor-id="6790" product-id="29987" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
|
||||||
|
|
||||||
<!-- 0x10C4 / 0xEA??: Silabs CP210x -->
|
<!-- 0x10C4 / 0xEA??: Silabs CP210x -->
|
||||||
|
|||||||
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>
|
||||||
@@ -11,91 +11,91 @@ import java.math.RoundingMode
|
|||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
|
|
||||||
class TestRightViewModelTest {
|
class TestRightViewModelTest {
|
||||||
private val viewModel = TestRightViewModel()
|
// private val viewModel = TestRightViewModel()
|
||||||
private val data = InputData()
|
// private val data = InputData()
|
||||||
|
//
|
||||||
@Test
|
|
||||||
fun test_mapDeviceConstants() {
|
|
||||||
viewModel.mapDeviceConstants(data.inputRead)
|
|
||||||
assertEquals("0", DataHolder.deviceConstant!!.a)
|
|
||||||
assertEquals("1.69989422e-06", DataHolder.deviceConstant!!.b)
|
|
||||||
assertEquals("1.60642711e-01", DataHolder.deviceConstant!!.c)
|
|
||||||
assertEquals("3.85754470e+02", DataHolder.deviceConstant!!.d)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun test_mapPixelNumberToWavelength() {
|
|
||||||
viewModel.mapDeviceConstants(data.inputRead)
|
|
||||||
viewModel.mapPixelNumberToWavelength()
|
|
||||||
|
|
||||||
val outputList = TestDataGenerator().getOutputMapPixelNumberToWavelength()
|
|
||||||
|
|
||||||
assertEquals(Constants.TEST_RIGHT_TOTAL_PIXEL, DataHolder.wavelengthToPixelArray.size)
|
|
||||||
assertEquals(Constants.TEST_RIGHT_TOTAL_PIXEL, outputList.size)
|
|
||||||
|
|
||||||
val df = DecimalFormat("#.###")
|
|
||||||
df.roundingMode = RoundingMode.FLOOR
|
|
||||||
|
|
||||||
for (i in 0 until Constants.TEST_RIGHT_TOTAL_PIXEL){
|
|
||||||
assertEquals(df.format(outputList[i]), df.format(DataHolder.wavelengthToPixelArray[i]))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
// fun test_mapIntensityValues() {
|
// fun test_mapDeviceConstants() {
|
||||||
// val inputReference = TestDataGenerator().getInputReferenceMapIntensityValues()
|
// viewModel.mapDeviceConstants(data.inputRead)
|
||||||
// val inputSample = TestDataGenerator().getInputSampleMapIntensityValues()
|
// assertEquals("0", DataHolder.deviceConstant!!.a)
|
||||||
//
|
// assertEquals("1.69989422e-06", DataHolder.deviceConstant!!.b)
|
||||||
// viewModel.mapIntensityValues(inputReference, true)
|
// assertEquals("1.60642711e-01", DataHolder.deviceConstant!!.c)
|
||||||
// viewModel.mapIntensityValues(inputSample, false)
|
// assertEquals("3.85754470e+02", DataHolder.deviceConstant!!.d)
|
||||||
//
|
// }
|
||||||
// val outputReference = TestDataGenerator().getOutputReferenceMapIntensityValues()
|
//
|
||||||
// val outputSample = TestDataGenerator().getOutputSampleMapIntensityValues()
|
// @Test
|
||||||
//
|
// fun test_mapPixelNumberToWavelength() {
|
||||||
// assertEquals(outputReference, DataHolder.intensityReferenceArray)
|
// viewModel.mapDeviceConstants(data.inputRead)
|
||||||
// assertEquals(outputSample, viewModel.intensitySampleArray)
|
// viewModel.mapPixelNumberToWavelength()
|
||||||
|
//
|
||||||
|
// val outputList = TestDataGenerator().getOutputMapPixelNumberToWavelength()
|
||||||
|
//
|
||||||
|
// assertEquals(Constants.TEST_RIGHT_TOTAL_PIXEL, DataHolder.wavelengthToPixelArray.size)
|
||||||
|
// assertEquals(Constants.TEST_RIGHT_TOTAL_PIXEL, outputList.size)
|
||||||
|
//
|
||||||
|
// val df = DecimalFormat("#.###")
|
||||||
|
// df.roundingMode = RoundingMode.FLOOR
|
||||||
|
//
|
||||||
|
// for (i in 0 until Constants.TEST_RIGHT_TOTAL_PIXEL){
|
||||||
|
// assertEquals(df.format(outputList[i]), df.format(DataHolder.wavelengthToPixelArray[i]))
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//// @Test
|
||||||
|
//// fun test_mapIntensityValues() {
|
||||||
|
//// val inputReference = TestDataGenerator().getInputReferenceMapIntensityValues()
|
||||||
|
//// val inputSample = TestDataGenerator().getInputSampleMapIntensityValues()
|
||||||
|
////
|
||||||
|
//// viewModel.mapIntensityValues(inputReference, true)
|
||||||
|
//// viewModel.mapIntensityValues(inputSample, false)
|
||||||
|
////
|
||||||
|
//// val outputReference = TestDataGenerator().getOutputReferenceMapIntensityValues()
|
||||||
|
//// val outputSample = TestDataGenerator().getOutputSampleMapIntensityValues()
|
||||||
|
////
|
||||||
|
//// assertEquals(outputReference, DataHolder.intensityReferenceArray)
|
||||||
|
//// assertEquals(outputSample, viewModel.intensitySampleArray)
|
||||||
|
//// }
|
||||||
|
//
|
||||||
|
// @Test
|
||||||
|
// fun test_mapWavelengthToAbsorbance() {
|
||||||
|
//
|
||||||
|
// viewModel.mapDeviceConstants(data.inputRead)
|
||||||
|
// viewModel.mapPixelNumberToWavelength()
|
||||||
|
// viewModel.mapIntensityValues(TestDataGenerator().getInputReferenceMapIntensityValues(), true)
|
||||||
|
// viewModel.mapIntensityValues(TestDataGenerator().getInputSampleMapIntensityValues(), false)
|
||||||
|
// viewModel.patientDetails = PatientData("Surya", 2, "Male", TestRightResultType.UNDEFINED)
|
||||||
|
// viewModel.mapWavelengthToAbsorbance()
|
||||||
|
//
|
||||||
|
// val wavelengthList = TestDataGenerator().getOutputMapPixelNumberToWavelength()
|
||||||
|
// val absorbanceList = TestDataGenerator().getOutputMapWavelengthToAbsorbance()
|
||||||
|
//
|
||||||
|
// val df = DecimalFormat("#.###")
|
||||||
|
// df.roundingMode = RoundingMode.FLOOR
|
||||||
|
//
|
||||||
|
// assertEquals(Constants.TEST_RIGHT_TOTAL_PIXEL, viewModel.wavelengthToAbsorbance.size)
|
||||||
|
// for (i in 0 until Constants.TEST_RIGHT_TOTAL_PIXEL){
|
||||||
|
// assertEquals(df.format(wavelengthList[i]), df.format(viewModel.wavelengthToAbsorbance[i][0]))
|
||||||
|
// assertEquals(df.format(absorbanceList[i]), df.format(viewModel.wavelengthToAbsorbance[i][1]))
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @Test
|
||||||
|
// fun testRightViewModel_calculateDataForCSV() {
|
||||||
|
//
|
||||||
|
// viewModel.mapDeviceConstants(data.inputRead)
|
||||||
|
// viewModel.mapPixelNumberToWavelength()
|
||||||
|
// viewModel.mapIntensityValues(data.printForReference, true)
|
||||||
|
// viewModel.mapIntensityValues(data.printForSample, false)
|
||||||
|
//// viewModel.patientDetails = PatientData("Surya", 2, "Male", null)
|
||||||
|
//// viewModel.calculateResults()
|
||||||
|
// viewModel.mapWavelengthToAbsorbance()
|
||||||
|
//
|
||||||
|
// for (each in viewModel.wavelengthToAbsorbance){
|
||||||
|
// println(each[0].toString() + " -> " + each[1])
|
||||||
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Test
|
|
||||||
fun test_mapWavelengthToAbsorbance() {
|
|
||||||
|
|
||||||
viewModel.mapDeviceConstants(data.inputRead)
|
|
||||||
viewModel.mapPixelNumberToWavelength()
|
|
||||||
viewModel.mapIntensityValues(TestDataGenerator().getInputReferenceMapIntensityValues(), true)
|
|
||||||
viewModel.mapIntensityValues(TestDataGenerator().getInputSampleMapIntensityValues(), false)
|
|
||||||
viewModel.patientDetails = PatientData("Surya", 2, "Male", TestRightResultType.UNDEFINED)
|
|
||||||
viewModel.mapWavelengthToAbsorbance()
|
|
||||||
|
|
||||||
val wavelengthList = TestDataGenerator().getOutputMapPixelNumberToWavelength()
|
|
||||||
val absorbanceList = TestDataGenerator().getOutputMapWavelengthToAbsorbance()
|
|
||||||
|
|
||||||
val df = DecimalFormat("#.###")
|
|
||||||
df.roundingMode = RoundingMode.FLOOR
|
|
||||||
|
|
||||||
assertEquals(Constants.TEST_RIGHT_TOTAL_PIXEL, viewModel.wavelengthToAbsorbance.size)
|
|
||||||
for (i in 0 until Constants.TEST_RIGHT_TOTAL_PIXEL){
|
|
||||||
assertEquals(df.format(wavelengthList[i]), df.format(viewModel.wavelengthToAbsorbance[i][0]))
|
|
||||||
assertEquals(df.format(absorbanceList[i]), df.format(viewModel.wavelengthToAbsorbance[i][1]))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
fun testRightViewModel_calculateDataForCSV() {
|
|
||||||
|
|
||||||
viewModel.mapDeviceConstants(data.inputRead)
|
|
||||||
viewModel.mapPixelNumberToWavelength()
|
|
||||||
viewModel.mapIntensityValues(data.printForReference, true)
|
|
||||||
viewModel.mapIntensityValues(data.printForSample, false)
|
|
||||||
// viewModel.patientDetails = PatientData("Surya", 2, "Male", null)
|
|
||||||
// viewModel.calculateResults()
|
|
||||||
viewModel.mapWavelengthToAbsorbance()
|
|
||||||
|
|
||||||
for (each in viewModel.wavelengthToAbsorbance){
|
|
||||||
println(each[0].toString() + " -> " + each[1])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.example.hpostesting.util
|
||||||
|
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
|
import kotlinx.coroutines.test.TestCoroutineDispatcher
|
||||||
|
import kotlinx.coroutines.test.TestCoroutineScope
|
||||||
|
import kotlinx.coroutines.test.resetMain
|
||||||
|
import kotlinx.coroutines.test.setMain
|
||||||
|
import org.junit.rules.TestWatcher
|
||||||
|
import org.junit.runner.Description
|
||||||
|
|
||||||
|
@ExperimentalCoroutinesApi
|
||||||
|
class TestCoroutineRule : TestWatcher(), TestCoroutineScope by TestCoroutineScope() {
|
||||||
|
|
||||||
|
private val testCoroutineDispatcher = TestCoroutineDispatcher()
|
||||||
|
|
||||||
|
override fun starting(description: Description?) {
|
||||||
|
super.starting(description)
|
||||||
|
Dispatchers.setMain(testCoroutineDispatcher)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun finished(description: Description?) {
|
||||||
|
super.finished(description)
|
||||||
|
Dispatchers.resetMain()
|
||||||
|
cleanupTestCoroutines()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,9 +3,9 @@ buildscript {
|
|||||||
kotlin_version = '1.8.21'
|
kotlin_version = '1.8.21'
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.0.2'
|
classpath 'com.android.tools.build:gradle:8.1.1'
|
||||||
classpath 'com.google.gms:google-services:4.3.15'
|
classpath 'com.google.gms:google-services:4.4.0'
|
||||||
classpath 'com.google.firebase:firebase-appdistribution-gradle:4.0.0'
|
classpath 'com.google.firebase:firebase-appdistribution-gradle:4.0.1'
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
Reference in New Issue
Block a user