Compare commits
153 Commits
DEV_UAT
...
dev-2.1.12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f97842b18 | ||
|
|
70ba5077d6 | ||
|
|
179752b0b0 | ||
|
|
e77b4d9a23 | ||
|
|
cf429b4fc3 | ||
|
|
30df9732a7 | ||
|
|
a1ce200ad8 | ||
|
|
2512556e8a | ||
|
|
4c1429f3cb | ||
|
|
d0f33582df | ||
|
|
6be6a65e95 | ||
|
|
b32c5e29d0 | ||
|
|
453af33baa | ||
|
|
dd345a1b31 | ||
|
|
ba52efc670 | ||
|
|
eb60025add | ||
|
|
5e1283873d | ||
|
|
735afbf3c0 | ||
|
|
5c8d6581b6 | ||
|
|
1f9784aea6 | ||
|
|
81b799d9c1 | ||
|
|
b89139d571 | ||
|
|
0de4b71866 | ||
|
|
331726682f | ||
|
|
c41a2f5139 | ||
|
|
262f334f40 | ||
|
|
50fd8c0632 | ||
|
|
bdb58f9b49 | ||
|
|
7fe72b0371 | ||
|
|
d620aa9e0d | ||
|
|
238debae85 | ||
|
|
4ba2f38583 | ||
|
|
0b6e3749c3 | ||
|
|
f2e9bf2eed | ||
|
|
7fcfd58544 | ||
|
|
628b84bfef | ||
|
|
c825ebbda3 | ||
|
|
fe8a340021 | ||
|
|
6bbbcea227 | ||
|
|
ad237e75ae | ||
|
|
5cfb04c680 | ||
|
|
31e92a0cbb | ||
|
|
96ba5ce92f | ||
|
|
0635cb6813 | ||
|
|
326936fc26 | ||
|
|
da195ab573 | ||
|
|
47f586ff63 | ||
|
|
9c22bdabf9 | ||
|
|
0a103795cd | ||
|
|
541b555c05 | ||
|
|
d14afa0942 | ||
|
|
71a364a9a2 | ||
|
|
9aa89f810e | ||
|
|
262c3c19d2 | ||
|
|
12af81d142 | ||
|
|
29115786fa | ||
|
|
614192c04c | ||
|
|
4fe1a0e187 | ||
|
|
688165eaad | ||
|
|
a9c2a4c365 | ||
|
|
014e9bdc96 | ||
|
|
a3484153ed | ||
|
|
0bdf551574 | ||
|
|
d9882b14aa | ||
|
|
49fda2fdcb | ||
|
|
b47d55fce2 | ||
|
|
91361c7964 | ||
|
|
007db1ca7d | ||
|
|
b8721b7f27 | ||
|
|
ab26d0228d | ||
|
|
d2f9c3c3a7 | ||
|
|
d012b9edda | ||
|
|
721ac5d53c | ||
|
|
75acfc34bd | ||
|
|
d365bbcfe0 | ||
|
|
31ed1edd0b | ||
|
|
d62fafb129 | ||
|
|
2fbad8968e | ||
|
|
4b059bc953 | ||
|
|
320ceae26a | ||
|
|
08a781a706 | ||
|
|
8c4fedfe28 | ||
|
|
ecd7f20b08 | ||
|
|
71818e1115 | ||
|
|
8ba574aeac | ||
|
|
d8cb0bd96e | ||
|
|
75c6269e4a | ||
|
|
d7c1508397 | ||
|
|
1e4f801774 | ||
|
|
d701ee4f6d | ||
|
|
e4b237bb9a | ||
|
|
372489330a | ||
|
|
0c10e5a920 | ||
|
|
045bda26ff | ||
|
|
b31e5e6c06 | ||
|
|
3913aedefc | ||
|
|
53c36d3cf9 | ||
|
|
b554f64b51 | ||
|
|
95bb428041 | ||
|
|
f922f585b5 | ||
|
|
1742363f1a | ||
|
|
ba9564d867 | ||
|
|
1aaf2ba485 | ||
|
|
85756a7052 | ||
|
|
0141c2791e | ||
|
|
a52538e72d | ||
|
|
78cc79eef8 | ||
|
|
c9d0c440e3 | ||
|
|
99da2fc094 | ||
|
|
20f408230e | ||
|
|
c8d5d41c81 | ||
|
|
210c9fed5d | ||
|
|
e947d083fb | ||
|
|
b68ec45642 | ||
|
|
1e5afa0a5c | ||
|
|
80ab69c772 | ||
|
|
2e1c932e72 | ||
|
|
6474181664 | ||
|
|
a142717ef2 | ||
|
|
0d72a0f6f1 | ||
|
|
63b51b1526 | ||
|
|
95533aab0d | ||
|
|
f7dc879c75 | ||
|
|
e8b5d12db5 | ||
|
|
626dd380ab | ||
|
|
c8677bc2bb | ||
|
|
70b0b93f57 | ||
|
|
5cdc156f33 | ||
|
|
71d298cd69 | ||
|
|
c48c5a1ae3 | ||
|
|
97cc281752 | ||
|
|
4f6d3fa203 | ||
|
|
bb6f4ee859 | ||
|
|
4272e36385 | ||
|
|
eb1c764551 | ||
|
|
cd593bb67b | ||
|
|
69ebb2f343 | ||
|
|
3ddad93a6a | ||
|
|
f0d71b3167 | ||
|
|
ab810e788b | ||
|
|
1bc8b18669 | ||
|
|
ea21c5d862 | ||
|
|
3bad0720e3 | ||
|
|
b1342580ea | ||
|
|
d4c66e5e1a | ||
|
|
14516cad5f | ||
|
|
a384c3e93a | ||
|
|
8910e2978f | ||
|
|
3bab859d0b | ||
|
|
b036ae8377 | ||
|
|
c91657c529 | ||
|
|
e64aa27f8a | ||
|
|
f2d6916aa6 |
3
.idea/gradle.xml
generated
3
.idea/gradle.xml
generated
@@ -4,9 +4,8 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
||||
1
app/.gitignore
vendored
1
app/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/build
|
||||
/release
|
||||
/google-services*
|
||||
/idea
|
||||
@@ -19,8 +19,8 @@ android {
|
||||
applicationId "in.sminnovations.hpostesting.dev"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 114
|
||||
versionName "2.1.114"
|
||||
versionCode 128
|
||||
versionName "2.1.128"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@@ -62,6 +62,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation "com.google.dagger:hilt-android:2.46"
|
||||
implementation 'androidx.activity:activity:1.8.0'
|
||||
kapt "com.google.dagger:hilt-android-compiler:2.46"
|
||||
|
||||
implementation 'androidx.core:core-ktx:1.12.0'
|
||||
@@ -75,21 +76,21 @@ dependencies {
|
||||
implementation platform('com.google.firebase:firebase-bom:32.1.0')
|
||||
implementation("com.google.firebase:firebase-perf-ktx")
|
||||
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
implementation("com.google.firebase:firebase-config-ktx")
|
||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
implementation 'com.google.firebase:firebase-firestore-ktx'
|
||||
implementation 'com.google.firebase:firebase-auth-ktx'
|
||||
implementation 'com.google.firebase:firebase-storage-ktx'
|
||||
implementation 'com.firebaseui:firebase-ui-firestore:8.0.2'
|
||||
implementation 'com.google.android.gms:play-services-auth:20.7.0'
|
||||
implementation 'com.google.android.gms:play-services-auth:21.0.0'
|
||||
implementation 'com.google.android.gms:play-services-location:21.1.0'
|
||||
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
|
||||
implementation 'com.google.android.things:androidthings:1.0'
|
||||
implementation 'com.google.firebase:firebase-appdistribution:16.0.0-beta11'
|
||||
implementation("com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta11")
|
||||
implementation 'com.google.firebase:firebase-appdistribution:16.0.0-beta12'
|
||||
implementation("com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta12")
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
implementation 'com.google.android.play:core:1.10.3'
|
||||
implementation 'io.nats:jnats:2.11.2'
|
||||
implementation 'io.nats:jnats:2.11.4'
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +121,7 @@ dependencies {
|
||||
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0"
|
||||
implementation 'com.opencsv:opencsv:5.9'
|
||||
implementation 'com.github.mik3y:usb-serial-for-android:3.5.1'
|
||||
implementation 'com.github.mik3y:usb-serial-for-android:3.8.0'
|
||||
|
||||
implementation "androidx.fragment:fragment-ktx:1.6.2"
|
||||
|
||||
@@ -137,14 +138,15 @@ dependencies {
|
||||
implementation "androidx.room:room-ktx:2.6.1"
|
||||
implementation "androidx.room:room-runtime:2.6.1"
|
||||
kapt ("androidx.room:room-compiler:2.6.1")
|
||||
implementation "net.zetetic:android-database-sqlcipher:4.4.0"
|
||||
|
||||
//image
|
||||
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
|
||||
|
||||
// Navigation Component
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:2.7.6"
|
||||
implementation "androidx.navigation:navigation-ui-ktx:2.7.6"
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:2.7.7"
|
||||
implementation "androidx.navigation:navigation-ui-ktx:2.7.7"
|
||||
|
||||
//Dagger - Hilt
|
||||
implementation "com.google.dagger:hilt-android:2.46"
|
||||
@@ -162,9 +164,12 @@ dependencies {
|
||||
implementation("androidx.work:work-runtime-ktx:2.9.0")
|
||||
|
||||
// implementation("io.nats:jnats:2.11.2")
|
||||
implementation 'com.google.android.play:core:1.10.3'
|
||||
// implementation 'com.google.android.play:core:1.10.3'
|
||||
|
||||
implementation fileTree(dir: 'libs', include: ['*.aar'])
|
||||
implementation 'io.nats:jnats:2.11.4'
|
||||
implementation 'org.apache.commons:commons-math3:3.6.1'
|
||||
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.17'
|
||||
implementation 'androidx.security:security-crypto:1.1.0-alpha03'
|
||||
|
||||
}
|
||||
@@ -4,17 +4,34 @@
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "in.sminnovations.hpostesting.quality",
|
||||
"applicationId": "in.sminnovations.hpostesting.dev",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 101,
|
||||
"versionName": "2.1.101",
|
||||
"versionCode": 128,
|
||||
"versionName": "2.1.128",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
"elementType": "File",
|
||||
"baselineProfiles": [
|
||||
{
|
||||
"minApi": 28,
|
||||
"maxApi": 30,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/1/app-release.dm"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minApi": 31,
|
||||
"maxApi": 2147483647,
|
||||
"baselineProfiles": [
|
||||
"baselineProfiles/0/app-release.dm"
|
||||
]
|
||||
}
|
||||
],
|
||||
"minSdkVersionForDexing": 21
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting
|
||||
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
<!--
|
||||
~ // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
~ // Notice: All information contained herein is, and remains
|
||||
~ // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
~ // if any. The intellectual and technical concepts contained
|
||||
~ // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
~ // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
~ // patents in process, and are protected by trade secret or copyright law.
|
||||
~ // Dissemination of this information or reproduction of this material
|
||||
~ // is strictly forbidden unless prior written permission is obtained
|
||||
~ // from ShanMukha Innovations Pvt. Ltd.
|
||||
-->
|
||||
|
||||
<vector android:height="24dp" android:tint="@color/primary"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.AUTHENTICATE_ACCOUNTS"
|
||||
android:maxSdkVersion="22" />
|
||||
<uses-permission android:name="android.permission.MANAGE_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.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.BATTERY_STATS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
@@ -30,13 +32,41 @@
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/hpos_icon"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:roundIcon="@mipmap/hpos_icon_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.HPOSTesting"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.dashboard.UpdateValuesActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"/>
|
||||
|
||||
<service
|
||||
android:name="com.example.hpostesting.util.MyAuthenticatorService"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_AUTOFILL_SERVICE">
|
||||
<intent-filter>
|
||||
<action android:name="android.accounts.AccountAuthenticator" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.accounts.AccountAuthenticator"
|
||||
android:resource="@xml/authenticator" />
|
||||
</service>
|
||||
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.dashboard.ui.PasswordResetActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.usb_teminal.UsbTerminalActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.deviceinfo.DeviceActivity"
|
||||
android:exported="false" />
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar" />
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.hemocube.DigitalCardActivity"
|
||||
android:exported="false" />
|
||||
@@ -44,6 +74,10 @@
|
||||
android:name="com.example.hpostesting.presentation.diagnostics.DiagnosticsActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar" />
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.hb_test.HBTestActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar" />
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.autodac.AutoDacActivity"
|
||||
android:exported="false"
|
||||
@@ -59,21 +93,20 @@
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.calibration.CalibrationActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar"/>
|
||||
|
||||
android:theme="@style/Theme.HPOS.NoActionBar" />
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.assurance.AssuranceControlsActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar"/>
|
||||
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar" />
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.hemocube.HemocubeActivity"
|
||||
android:exported="false"
|
||||
android:noHistory="true"
|
||||
android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.trueheme.TrueHemeActivity"
|
||||
android:exported="false"
|
||||
@@ -81,7 +114,6 @@
|
||||
android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.buffercheck.HemocubeBufferCheckActivity"
|
||||
android:exported="false"
|
||||
@@ -98,24 +130,25 @@
|
||||
android:name="com.example.hpostesting.presentation.dashboard.DashboardActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/title_activity_dashboard"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||
tools:ignore="AppLinkUrlError,MissingClass">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<data android:scheme="content" />
|
||||
<data android:scheme="file" />
|
||||
<data android:mimeType="application/vnd.android.package-archive" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<service
|
||||
android:name="com.example.hpostesting.presentation.testRight.UsbService"
|
||||
android:name="com.example.hpostesting.util.UsbService"
|
||||
android:enabled="true"
|
||||
android:exported="false" />
|
||||
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.SplashActivity"
|
||||
android:exported="true"
|
||||
@@ -123,11 +156,16 @@
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.HOME" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.MONKEY" />
|
||||
<category android:name="android.intent.category.LAUNCHER_APP" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<!-- <category android:name="android.intent.category.HOME" />-->
|
||||
<!-- <category android:name="android.intent.category.DEFAULT" />-->
|
||||
<!-- <category android:name="android.intent.category.MONKEY"/>-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER_APP" />-->
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
@@ -150,6 +188,7 @@
|
||||
<activity
|
||||
android:name="com.example.hpostesting.presentation.MainActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
|
||||
@@ -163,8 +202,7 @@
|
||||
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:stateNotNeeded="true"
|
||||
tools:replace="android:screenOrientation" />
|
||||
|
||||
tools:replace="android:screenOrientation" /> <!-- ${applicationId} -->
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
@@ -174,7 +212,6 @@
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1 +1,14 @@
|
||||
#
|
||||
# // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
# // Notice: All information contained herein is, and remains
|
||||
# // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
# // if any. The intellectual and technical concepts contained
|
||||
# // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
# // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
# // patents in process, and are protected by trade secret or copyright law.
|
||||
# // Dissemination of this information or reproduction of this material
|
||||
# // is strictly forbidden unless prior written permission is obtained
|
||||
# // from ShanMukha Innovations Pvt. Ltd.
|
||||
#
|
||||
|
||||
BASE_URL= https://datacollection.micropcr.com/api/
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting
|
||||
|
||||
import android.app.Application
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.example.hpostesting.data
|
||||
|
||||
sealed class Result<out T : Any> {
|
||||
data class Success<out T : Any>(val data: T) : Result<T>()
|
||||
data class Error(val exception: Exception) : Result<Nothing>()
|
||||
class Loading<T : Any> : Result<T>()
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.api
|
||||
|
||||
import com.example.hpostesting.data.model.devicediagnostics.DeviceDiagnosticsRequest
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.api
|
||||
|
||||
import com.example.hpostesting.data.model.devicediagnostics.DeviceDiagnosticsRequest
|
||||
@@ -10,6 +23,7 @@ import com.example.hpostesting.data.model.updates.CheckUpdateResponse
|
||||
import com.example.hpostesting.data.model.updates.DeviceUpdateRequest
|
||||
import okhttp3.MultipartBody
|
||||
import okhttp3.ResponseBody
|
||||
import retrofit2.Response
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Multipart
|
||||
@@ -29,10 +43,14 @@ interface MolbioResultApi {
|
||||
@Body checkUpdateRequest: CheckUpdateRequest,
|
||||
): CheckUpdateResponse
|
||||
|
||||
// @POST("deviceService/device/getUpdate")
|
||||
// suspend fun deviceUpdate(
|
||||
// @Body deviceUpdateRequest: DeviceUpdateRequest,
|
||||
// ): ResponseBody
|
||||
@POST("deviceService/device/getUpdate")
|
||||
suspend fun deviceUpdate(
|
||||
@Body deviceUpdateRequest: DeviceUpdateRequest,
|
||||
): ResponseBody
|
||||
): Response<ResponseBody>
|
||||
|
||||
@GET("deviceService/device/getClientCertificate")
|
||||
suspend fun downloadClientCertificate(
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.example.hpostesting.data.api
|
||||
|
||||
import com.example.hpostesting.data.constant.HemoCubeCommands
|
||||
import com.example.hpostesting.presentation.UsbServiceListener
|
||||
|
||||
interface PropertyProvider {
|
||||
|
||||
fun getProperty(key: String): String
|
||||
}
|
||||
|
||||
interface DeviceCommunicationHandler {
|
||||
fun sendAndListenToDevice(command: HemoCubeCommands, listener: UsbServiceListener)
|
||||
}
|
||||
@@ -1,14 +1,35 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
object Constants {
|
||||
const val CENTER_NAME =""
|
||||
const val DISTRICT =""
|
||||
const val BUFFER_FLAGS_ENABLED = true//testing flag disable then pass buffer and sample checks
|
||||
const val ABS_FLAGS_ENABLED = false
|
||||
const val IP_ADDRESS="ip_address"
|
||||
const val QUICK_CAPTURE="quick_capture"
|
||||
const val KIT_TIME = "kit_time"
|
||||
const val ACTION_USB_PERMISSION = "shanmukha.in.sickle_cell.USB_PERMISSION"
|
||||
const val HEMOCUBE_USB_PERMISSION = "shanmukha.in.sickle_cell_homocube.USB_PERMISSION"
|
||||
|
||||
const val passphrase = "smi_#@sql"
|
||||
const val BASE_URL = "www.google.com"
|
||||
|
||||
const val DOCUMENT_ID_FOR_UPDATE ="2o71vBKLqdgEKYtFG8Lb"
|
||||
const val ABHA_APP_PACKAGE = "in.ndhm.phr"
|
||||
|
||||
const val MOLBIO_INTEGRATION = true
|
||||
const val MOLBIO_INTEGRATION = false
|
||||
const val FIREBASE_INTEGRATION = true
|
||||
const val deviceProvisionEmail = "HPOS_provisioner@bigtec.co.in"
|
||||
const val deviceProvisionPassword = "f2ab0e7f9d69"
|
||||
const val DEVICE_ID_API = "deviceIDAPI"
|
||||
@@ -24,7 +45,8 @@ object Constants {
|
||||
|
||||
const val TEST_RIGHT_TOTAL_PIXEL = 3694
|
||||
|
||||
const val MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE = 40
|
||||
const val MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE = 34
|
||||
const val MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE10MM = 9
|
||||
|
||||
const val RANGE_IN_RESULT_CALCULATIONS = 10
|
||||
|
||||
@@ -55,6 +77,7 @@ object Constants {
|
||||
const val USER_ID = "usernameId"
|
||||
|
||||
const val QUICK_CAPTURE_SOLUTION = "SOLUTION"
|
||||
const val QUICK_CAPTURE_FOR_ADMIN = "ADMIN"
|
||||
const val QUICK_CAPTURE_CONCENTRATION = "CONCENTRATION"
|
||||
const val QUICK_CAPTURE_VOLUME = "VOLUME"
|
||||
const val QUICK_CAPTURE_READING_PER_SAMPLE = "READING_PER_SAMPLE"
|
||||
@@ -64,166 +87,16 @@ object Constants {
|
||||
// jig
|
||||
const val NAVIGATE_TO_TEST_JIG_DIRECTLY = false
|
||||
|
||||
val STATICID = listOf(
|
||||
"FACTORY",
|
||||
"ADMIN",
|
||||
"VIZ-1000-0004",
|
||||
"VIZ-1000-0005",
|
||||
"VIZ-1000-0006",
|
||||
"HC-V1-001",
|
||||
"HC-V1-002",
|
||||
"HC-V1-003",
|
||||
"HC-V1-004",
|
||||
"HC-V1-005",
|
||||
"HC-V1-006",
|
||||
"HC-V1-007",
|
||||
"HC-V1-008",
|
||||
"HC-V1-009",
|
||||
"HC-V1-010",
|
||||
"HC-V1-011",
|
||||
"HC-V1-012",
|
||||
"HC-V1-013",
|
||||
"HC-V1-014",
|
||||
"HC-V1-015",
|
||||
"HC-V1-016",
|
||||
"HC-V1-017",
|
||||
"HC-V1-018",
|
||||
"HC-V1-019",
|
||||
"HC-V1-020",
|
||||
"HCV-000-1015",
|
||||
"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",
|
||||
"HCV-000-3021",
|
||||
"HCV-000-3022",
|
||||
"HCV-000-3023",
|
||||
"HCV-000-3024",
|
||||
"HCV-000-3025",
|
||||
"HCV-000-3026",
|
||||
"HCV-000-3027",
|
||||
"HCV-000-3028",
|
||||
"HCV-000-3029",
|
||||
"HCV-000-3030",
|
||||
"HPP1-0124-0001",
|
||||
"HPP1-0124-0002",
|
||||
"HPP1-0124-0003",
|
||||
"HPP1-0124-0004",
|
||||
"HPP1-0124-0005",
|
||||
"HPP1-0124-0006",
|
||||
"HPP1-0124-0007",
|
||||
"HPP1-0124-0008",
|
||||
"HPP1-0124-0009",
|
||||
"HPP1-0124-0010",
|
||||
"HPP1-0124-0011",
|
||||
"HPP1-0124-0012",
|
||||
"HPP1-0124-0013",
|
||||
"HPP1-0124-0014",
|
||||
"HPP1-0124-0015",
|
||||
"HPP1-0124-0016",
|
||||
"HPP1-0124-0017",
|
||||
"HPP1-0124-0018",
|
||||
"HPP1-0124-0019",
|
||||
"HPP1-0124-0020",
|
||||
"HPP1-0124-0021",
|
||||
"HPP1-0124-0022",
|
||||
"HPP1-0124-0023",
|
||||
"HPP1-0124-0024",
|
||||
"HPP1-0124-0025",
|
||||
"HPP1-0124-0026",
|
||||
"HPP1-0124-0027",
|
||||
"HPP1-0124-0028",
|
||||
"HPP1-0124-0029",
|
||||
"HPP1-0124-0030",
|
||||
"HPP1-0124-0031",
|
||||
"HPP1-0124-0032",
|
||||
"HPP1-0124-0033",
|
||||
"HPP1-0124-0034",
|
||||
"HPP1-0124-0035",
|
||||
"HPP1-0124-0036",
|
||||
"HPP1-0124-0037",
|
||||
"HPP1-0124-0038",
|
||||
"HPP1-0124-0039",
|
||||
"HPP1-0124-0040",
|
||||
"HPP1-0124-0041",
|
||||
"HPP1-0124-0042",
|
||||
"HPP1-0124-0043",
|
||||
"HPP1-0124-0044",
|
||||
"HPP1-0124-0045",
|
||||
"HPP1-0124-0046",
|
||||
"HPP1-0124-0047",
|
||||
"HPP1-0124-0048",
|
||||
"HPP1-0124-0049",
|
||||
"HPP1-0124-0050",
|
||||
"HCV-001-0001",
|
||||
"HCV-001-0002",
|
||||
"HCV-001-0003",
|
||||
"HCV-001-0004",
|
||||
"HCV-001-0005",
|
||||
"HCV-001-0006",
|
||||
"HCV-001-0007",
|
||||
"HCV-001-0008",
|
||||
"HCV-001-0009",
|
||||
"HCV-001-0010",
|
||||
"HCV-001-0011",
|
||||
"HCV-001-0012",
|
||||
"HCV-001-0013",
|
||||
"HCV-001-0014",
|
||||
"HCV-001-0015",
|
||||
"HCV-001-0016",
|
||||
"HCV-001-0017",
|
||||
"HCV-001-0018",
|
||||
"HCV-001-0019",
|
||||
"HCV-001-0020",
|
||||
"HCV-001-0021",
|
||||
"HCV-001-0022",
|
||||
"HCV-001-0023",
|
||||
"HCV-001-0024",
|
||||
"HCV-001-0025",
|
||||
"HCV-001-0026",
|
||||
"HCV-001-0027",
|
||||
"HCV-001-0028",
|
||||
"HCV-001-0029",
|
||||
"HCV-001-0030",
|
||||
"HCV-001-0031",
|
||||
"HCV-001-0032",
|
||||
"HCV-001-0033",
|
||||
"HCV-001-0034",
|
||||
"HCV-001-0003",
|
||||
"HCV-001-0035",
|
||||
"HCV-001-0036",
|
||||
"HCV-001-0037",
|
||||
"HCV-001-0038",
|
||||
"HCV-001-0039",
|
||||
"HCV-001-0040",
|
||||
"HCV-001-0041",
|
||||
"HCV-001-0042",
|
||||
"HCV-001-0043",
|
||||
"HCV-001-0044",
|
||||
"HCV-001-0045",
|
||||
"HCV-001-0046",
|
||||
"HCV-001-0047",
|
||||
"HCV-001-0048",
|
||||
"HCV-001-0049",
|
||||
"HCV-001-0050",
|
||||
)
|
||||
//update values of abs
|
||||
const val ABS2LED1MMLL = "ABS2LED1MMLL"
|
||||
const val ABS2LED1MMUL = "ABS2LED1MMUL"
|
||||
const val ABS2LED2MMLL = "ABS2LED2MMLL"
|
||||
const val ABS2LED2MMUL = "ABS2LED2MMUL"
|
||||
|
||||
const val password = "SMI@12345"
|
||||
const val ABS10LED1MMLL = "ABS10LED1MMLL"
|
||||
const val ABS10LED1MMUL = "ABS10LED1MMUL"
|
||||
const val ABS10LED2MMLL = "ABS10LED2MMLL"
|
||||
const val ABS10LED2MMUL = "ABS10LED2MMUL"
|
||||
|
||||
const val KIT_NUMBER = "KitNumber"
|
||||
const val KIT_COUNT = "KitCount"
|
||||
@@ -233,7 +106,10 @@ object Constants {
|
||||
const val BUFFER_VALUE_3 = "BufferValue3"
|
||||
const val BUFFER_VALUE_4 = "BufferValue4"
|
||||
const val DEVICE_ID = "DEVICE_ID"
|
||||
|
||||
const val LABNAME = "LAB_NAME"
|
||||
const val CUVETTE_SIZE = "CUVETTE_SIZE"
|
||||
const val LAST_UPDATED = "LAST_UPDATED"
|
||||
const val IS_TOKEN_AVAILABLE = "IS_TOKEN_AVAILABLE"
|
||||
const val BUFFER_LED_LOWER_BOUND = 21000
|
||||
const val BUFFER_LED_UPPER_BOUND = 23500
|
||||
|
||||
@@ -1210,7 +1086,8 @@ object Constants {
|
||||
)
|
||||
|
||||
const val INCUBATION_TIME_MIN = 0
|
||||
const val INCUBATION_TIME_MAX = 1400
|
||||
const val INCUBATION_TIME_MAX = 300
|
||||
const val MAX_KIT_TIME = 240
|
||||
const val BATTERY_LEVEL_MIN = Int.MIN_VALUE
|
||||
|
||||
const val PQ_MODE = true
|
||||
@@ -1707,5 +1584,221 @@ object Constants {
|
||||
listOf(0.0, 0.0)
|
||||
)
|
||||
)
|
||||
//Hemocube for 10mm
|
||||
const val positiveBoderLine10mm1 = 1.3
|
||||
const val positiveBoderLine10mm2 = 1.66
|
||||
const val negativeBoderLine10mm1 = 2.0
|
||||
const val negativeBoderLine10mm2 = 2.4
|
||||
const val normalMin10mm = 0.07
|
||||
const val normalMax10mm = 0.23
|
||||
const val negativeBorderlineMin10mm = 0.23
|
||||
const val negativeBorderlineMax10mm = 0.27
|
||||
const val sickleCellTraitMin10mm = 0.27
|
||||
const val sickleCellTraitMax10mm = 0.31
|
||||
const val positiveForSickleCellMin10mm = 0.31
|
||||
const val positiveForSickleCellMax10mm = 0.39
|
||||
const val sickleCellDiseaseMin10mm = 0.39
|
||||
const val sickleCellDiseaseMax10mm = 0.7
|
||||
//Hemocube for 2mm
|
||||
const val positiveBoderLine2mm1 = 0.8
|
||||
const val positiveBoderLine2mm2 = 1.1
|
||||
const val negativeBoderLine2mm1 = 1.5
|
||||
const val negativeBoderLine2mm2 = 1.9
|
||||
const val normalMin2mm = 0.1
|
||||
const val normalMax2mm = 0.23
|
||||
const val negativeBorderlineMin2mm = 0.23
|
||||
const val negativeBorderlineMax2mm = 0.25
|
||||
const val sickleCellTraitMin2mm = 0.25
|
||||
const val sickleCellTraitMax2mm = 0.31
|
||||
const val positiveForSickleCellMin2mm = 0.31
|
||||
const val positiveForSickleCellMax2mm = 0.45
|
||||
const val sickleCellDiseaseMin2mm = 0.45
|
||||
const val sickleCellDiseaseMax2mm = 0.7
|
||||
|
||||
const val min2mmLed1 = 0.34
|
||||
const val max2mmLed1 = 1.48
|
||||
const val min2mmLed2 = 0.04
|
||||
const val max2mmLed2 = 0.33
|
||||
const val min10mmLed1 = 0.22
|
||||
const val max10mmLed1 = 1.12
|
||||
const val min10mmLed2 = 0.05
|
||||
const val max10mmLed2 = 0.41
|
||||
|
||||
const val bufferMinLed1 = 21000.00
|
||||
const val bufferMaxLed1 = 23000.00
|
||||
const val bufferMinLed2 = 17000.00
|
||||
const val bufferMaxLed2 = 19000.00
|
||||
|
||||
|
||||
// val STATICID = listOf(
|
||||
// "FACTORY",
|
||||
// "ADMIN",
|
||||
// "PQUSER",
|
||||
// "QCUSER",
|
||||
// "VIZ-1000-0004",
|
||||
// "VIZ-1000-0005",
|
||||
// "VIZ-1000-0006",
|
||||
// "HC-V1-001",
|
||||
// "HC-V1-002",
|
||||
// "HC-V1-003",
|
||||
// "HC-V1-004",
|
||||
// "HC-V1-005",
|
||||
// "HC-V1-006",
|
||||
// "HC-V1-007",
|
||||
// "HC-V1-008",
|
||||
// "HC-V1-009",
|
||||
// "HC-V1-010",
|
||||
// "HC-V1-011",
|
||||
// "HC-V1-012",
|
||||
// "HC-V1-013",
|
||||
// "HC-V1-014",
|
||||
// "HC-V1-015",
|
||||
// "HC-V1-016",
|
||||
// "HC-V1-017",
|
||||
// "HC-V1-018",
|
||||
// "HC-V1-019",
|
||||
// "HC-V1-020",
|
||||
// "HCV-000-1015",
|
||||
// "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",
|
||||
// "HCV-000-3021",
|
||||
// "HCV-000-3022",
|
||||
// "HCV-000-3023",
|
||||
// "HCV-000-3024",
|
||||
// "HCV-000-3025",
|
||||
// "HCV-000-3026",
|
||||
// "HCV-000-3027",
|
||||
// "HCV-000-3028",
|
||||
// "HCV-000-3029",
|
||||
// "HCV-000-3030",
|
||||
// "HPP1-0124-0001",
|
||||
// "HPP1-0124-0002",
|
||||
// "HPP1-0124-0003",
|
||||
// "HPP1-0124-0004",
|
||||
// "HPP1-0124-0005",
|
||||
// "HPP1-0124-0006",
|
||||
// "HPP1-0124-0007",
|
||||
// "HPP1-0124-0008",
|
||||
// "HPP1-0124-0009",
|
||||
// "HPP1-0124-0010",
|
||||
// "HPP1-0124-0011",
|
||||
// "HPP1-0124-0012",
|
||||
// "HPP1-0124-0013",
|
||||
// "HPP1-0124-0014",
|
||||
// "HPP1-0124-0015",
|
||||
// "HPP1-0124-0016",
|
||||
// "HPP1-0124-0017",
|
||||
// "HPP1-0124-0018",
|
||||
// "HPP1-0124-0019",
|
||||
// "HPP1-0124-0020",
|
||||
// "HPP1-0124-0021",
|
||||
// "HPP1-0124-0022",
|
||||
// "HPP1-0124-0023",
|
||||
// "HPP1-0124-0024",
|
||||
// "HPP1-0124-0025",
|
||||
// "HPP1-0124-0026",
|
||||
// "HPP1-0124-0027",
|
||||
// "HPP1-0124-0028",
|
||||
// "HPP1-0124-0029",
|
||||
// "HPP1-0124-0030",
|
||||
// "HPP1-0124-0031",
|
||||
// "HPP1-0124-0032",
|
||||
// "HPP1-0124-0033",
|
||||
// "HPP1-0124-0034",
|
||||
// "HPP1-0124-0035",
|
||||
// "HPP1-0124-0036",
|
||||
// "HPP1-0124-0037",
|
||||
// "HPP1-0124-0038",
|
||||
// "HPP1-0124-0039",
|
||||
// "HPP1-0124-0040",
|
||||
// "HPP1-0124-0041",
|
||||
// "HPP1-0124-0042",
|
||||
// "HPP1-0124-0043",
|
||||
// "HPP1-0124-0044",
|
||||
// "HPP1-0124-0045",
|
||||
// "HPP1-0124-0046",
|
||||
// "HPP1-0124-0047",
|
||||
// "HPP1-0124-0048",
|
||||
// "HPP1-0124-0049",
|
||||
// "HPP1-0124-0050",
|
||||
// "HCV-001-0001",
|
||||
// "HCV-001-0002",
|
||||
// "HCV-001-0003",
|
||||
// "HCV-001-0004",
|
||||
// "HCV-001-0005",
|
||||
// "HCV-001-0006",
|
||||
// "HCV-001-0007",
|
||||
// "HCV-001-0008",
|
||||
// "HCV-001-0009",
|
||||
// "HCV-001-0010",
|
||||
// "HCV-001-0011",
|
||||
// "HCV-001-0012",
|
||||
// "HCV-001-0013",
|
||||
// "HCV-001-0014",
|
||||
// "HCV-001-0015",
|
||||
// "HCV-001-0016",
|
||||
// "HCV-001-0017",
|
||||
// "HCV-001-0018",
|
||||
// "HCV-001-0019",
|
||||
// "HCV-001-0020",
|
||||
// "HCV-001-0021",
|
||||
// "HCV-001-0022",
|
||||
// "HCV-001-0023",
|
||||
// "HCV-001-0024",
|
||||
// "HCV-001-0025",
|
||||
// "HCV-001-0026",
|
||||
// "HCV-001-0027",
|
||||
// "HCV-001-0028",
|
||||
// "HCV-001-0029",
|
||||
// "HCV-001-0030",
|
||||
// "HCV-001-0031",
|
||||
// "HCV-001-0032",
|
||||
// "HCV-001-0033",
|
||||
// "HCV-001-0034",
|
||||
// "HCV-001-0003",
|
||||
// "HCV-001-0035",
|
||||
// "HCV-001-0036",
|
||||
// "HCV-001-0037",
|
||||
// "HCV-001-0038",
|
||||
// "HCV-001-0039",
|
||||
// "HCV-001-0040",
|
||||
// "HCV-001-0041",
|
||||
// "HCV-001-0042",
|
||||
// "HCV-001-0043",
|
||||
// "HCV-001-0044",
|
||||
// "HCV-001-0045",
|
||||
// "HCV-001-0046",
|
||||
// "HCV-001-0047",
|
||||
// "HCV-001-0048",
|
||||
// "HCV-001-0049",
|
||||
// "HCV-001-0050",
|
||||
// "HCV-000-6001",
|
||||
// "HCV-000-6002",
|
||||
// "HCV-000-6003",
|
||||
// "HCV-000-6004",
|
||||
// "HCV-000-6005",
|
||||
// "HCV-000-6006",
|
||||
// "HCV-000-6007",
|
||||
// "HCV-000-6008",
|
||||
// "HCV-000-6009",
|
||||
// "HCV-000-6010",
|
||||
// )
|
||||
//
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
package com.example.hpostesting.data
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
@@ -8,12 +21,14 @@ import com.example.hpostesting.data.model.test.TestType
|
||||
|
||||
object DataHolder {
|
||||
|
||||
var sampleId: String = "sampleId"
|
||||
var selectedTestType: TestType = TestType.SICKLECERT
|
||||
val usbConnected = MutableLiveData(true)
|
||||
var mobileUniqueId: String? = null
|
||||
var isAppFolderCreated = false
|
||||
var appFolderPath = ""
|
||||
var isReferenceTaken = false
|
||||
var isToken = false
|
||||
var sampleReadCounter = 0
|
||||
|
||||
var deviceConstant: TestRightDeviceConstants? = null
|
||||
@@ -23,8 +38,14 @@ object DataHolder {
|
||||
val intensityReferenceArray = ArrayList<Double>()
|
||||
var selectedTest: UserData? = null
|
||||
var hemoCubeTestData: HemoCubeTestData? = null
|
||||
var bloodGroup: String = "Unknown"
|
||||
var age = "0"
|
||||
var kitSerial: String = ""
|
||||
var centerName: String = ""
|
||||
var district: String = ""
|
||||
var quickCapture:Boolean = false
|
||||
var location: UserData.Location? = null
|
||||
var ipAddress: String ="0.0"
|
||||
var testExp: Boolean = true
|
||||
var hemocubeResult: Double? = null
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
enum class HemoCubeCommands(val command: String) {
|
||||
@@ -15,4 +28,7 @@ enum class HemoCubeCommands(val command: String) {
|
||||
SECOND_GAIN_COMMAND("U\r"),
|
||||
THIRD_GAIN_COMMAND("V\r"),
|
||||
FORTH_GAIN_COMMAND("W\r"),
|
||||
CHECK_CUVETTE_COMMAND("L\r"),
|
||||
CHECK_TEMP_COMMAND("A\r"),
|
||||
J_COMMAND("J\r"),
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
import android.content.Context
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
enum class TestRightCommands(val command: String) {
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.constant
|
||||
|
||||
enum class TestStatus(val code: Double) {
|
||||
@@ -10,11 +23,20 @@ enum class TestStatus(val code: Double) {
|
||||
FIRST_EMPTY_AIR_READING_PRINT_COMPLETED(4.4),
|
||||
EPROM_ADC_RETRIEVAL_STARTED(4.5),
|
||||
EPROM_ADC_RETRIEVAL_COMPLETED(4.6),
|
||||
BUFFER_STARTED(4.7),
|
||||
BUFFER_COMPLETED(5.0),
|
||||
TEMPERATURE_CHECK(4.7),
|
||||
CUVETTE_ABSENT(4.8),
|
||||
CUVETTE_PRESENT(4.9),
|
||||
CUVETTE_ABSENTR(5.1),
|
||||
CUVETTE_PRESENTR(5.2),
|
||||
CUVETTE_ABSENTS(7.7),
|
||||
CUVETTE_PRESENTS(7.8),
|
||||
BUFFER_STARTED(5.4),
|
||||
BUFFER_COMPLETED(5.5),
|
||||
BUFFER_PRINT_STARTED(6.0),
|
||||
BUFFER_PRINT_COMPLETED(7.0),
|
||||
SAMPLE_STARTED(8.0),
|
||||
CUVETTE_ABSENTT(30.2),
|
||||
CUVETTE_PRESENTT(30.1),
|
||||
SAMPLE_COMPLETED(9.0),
|
||||
SAMPLE_PRINT_STARTED(10.0),
|
||||
SAMPLE_PRINT_COMPLETED(11.0),
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.room.TypeConverter
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
@@ -5,6 +18,7 @@ import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import androidx.room.Update
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
@Dao
|
||||
@@ -12,6 +26,12 @@ interface HemoCubeDao {
|
||||
@Query("SELECT * from hemo_cube_test_table")
|
||||
fun getAll(): LiveData<List<HemoCubeTestData>>
|
||||
|
||||
@Query("SELECT * from hemo_cube_test_table WHERE molbioFlag=0")
|
||||
fun getMolbioPending(): List<HemoCubeTestData>
|
||||
|
||||
@Query("SELECT * from hemo_cube_test_table WHERE localFlag=0")
|
||||
fun getFirebasePending():List<HemoCubeTestData>
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertAll(hemoCubeTestData: HemoCubeTestData)
|
||||
|
||||
@@ -20,7 +40,8 @@ interface HemoCubeDao {
|
||||
|
||||
@Query("DELETE FROM hemo_cube_test_table WHERE _id = :id")
|
||||
suspend fun deleteById(id: String)
|
||||
|
||||
@Query("DELETE FROM hemo_cube_test_table WHERE testStatus = 0")
|
||||
suspend fun deleteByStatus()
|
||||
@Query("UPDATE hemo_cube_test_table SET localFlag = :newValue WHERE _id = :id")
|
||||
suspend fun updateFieldById(id: String, newValue: Boolean)
|
||||
|
||||
@@ -29,4 +50,12 @@ interface HemoCubeDao {
|
||||
|
||||
@Query("UPDATE hemo_cube_test_table SET isCSVCreated = :newValue WHERE _id = :id")
|
||||
suspend fun updateCSVFieldById(id: String, newValue: Boolean)
|
||||
|
||||
@Query("SELECT * from hemo_cube_test_table WHERE localFlag = 0")
|
||||
fun getPendingUser(): LiveData<List<HemoCubeTestData>>
|
||||
|
||||
@Update
|
||||
suspend fun updateTest(hemoCubeTestData: HemoCubeTestData)
|
||||
|
||||
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.room.Database
|
||||
@@ -10,7 +23,7 @@ import com.example.hpostesting.data.model.patient.UserData
|
||||
|
||||
@Database(
|
||||
entities = [UserData::class, HemoCubeTestData::class, DeviceData::class, BufferCheckData::class],
|
||||
version = 26,
|
||||
version = 38,
|
||||
exportSchema = false
|
||||
)
|
||||
@TypeConverters(Converters::class)
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.dao
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.datasource
|
||||
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
@@ -11,4 +24,6 @@ interface LocalFileDataSource {
|
||||
fun exportDataToCSV(
|
||||
fileName: String, dataList: List<HemoCubeTestData>,
|
||||
): Boolean
|
||||
fun backUpDataToCSV(fileName: String, dataList: List<HemoCubeTestData>)
|
||||
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.datasource
|
||||
|
||||
import android.os.Environment
|
||||
@@ -41,7 +54,7 @@ class LocalFileDataSourceImpl @Inject constructor() : LocalFileDataSource {
|
||||
"name",
|
||||
"incubationTime",
|
||||
"bloodGroup",
|
||||
"birthYear", // Include other fields from the data class
|
||||
"age", // Include other fields from the data class
|
||||
"state",
|
||||
"abhaId",
|
||||
"userImageURL",
|
||||
@@ -89,14 +102,15 @@ class LocalFileDataSourceImpl @Inject constructor() : LocalFileDataSource {
|
||||
)
|
||||
csvWriter.writeNext(header)
|
||||
|
||||
// Write data rows
|
||||
for (data in dataList) {
|
||||
// Filter and write data rows where testStatus is true
|
||||
val filteredDataList = dataList.filter { it.testStatus == true }
|
||||
for (data in filteredDataList) {
|
||||
val row = arrayOf(
|
||||
data._id,
|
||||
data.name,
|
||||
data.incubationTime,
|
||||
data.bloodGroup,
|
||||
data.birthYear, // Include other fields similarly
|
||||
data.age, // Include other fields similarly
|
||||
data.state,
|
||||
data.abhaId,
|
||||
data.userImageURL,
|
||||
@@ -152,6 +166,127 @@ class LocalFileDataSourceImpl @Inject constructor() : LocalFileDataSource {
|
||||
}
|
||||
}
|
||||
|
||||
override fun backUpDataToCSV(fileName: String, dataList: List<HemoCubeTestData>) {
|
||||
try {
|
||||
val filePath = File(getExternalStorageDirectory(), fileName)
|
||||
val writer = FileWriter(filePath)
|
||||
val csvWriter = CSVWriter(writer)
|
||||
// Write CSV header
|
||||
val header = arrayOf(
|
||||
"_id",
|
||||
"name",
|
||||
"incubationTime",
|
||||
"bloodGroup",
|
||||
"age", // Include other fields from the data class
|
||||
"state",
|
||||
"abhaId",
|
||||
"userImageURL",
|
||||
"location",
|
||||
"reportUploadTime",
|
||||
"testType",
|
||||
"testTime",
|
||||
"testStatus",
|
||||
"gender",
|
||||
"localFlag", // Add more fields as necessary
|
||||
"deviceId",
|
||||
"appVersion",
|
||||
"deviceSerialNumber",
|
||||
"deviceType",
|
||||
"kitSerial",
|
||||
"resultData",
|
||||
"led1Buffer",
|
||||
"led2Buffer",
|
||||
"led3Buffer",
|
||||
"led4Buffer",
|
||||
"led1Sample",
|
||||
"led2Sample",
|
||||
"led3Sample",
|
||||
"led4Sample",
|
||||
"led1Average",
|
||||
"led2Average",
|
||||
"led3Average",
|
||||
"led4Average",
|
||||
"abs1",
|
||||
"abs2",
|
||||
"abs3",
|
||||
"abs4",
|
||||
"deviceRatio",
|
||||
"calculatedRatio",
|
||||
"predictedDenovixRatio",
|
||||
"coefficients",
|
||||
"classificationResult",
|
||||
"prdClassification",
|
||||
"errorMessages",
|
||||
"batteryLevel",
|
||||
"batteryCapacity",
|
||||
"batteryMaxCapacity",
|
||||
"batteryTemperature",
|
||||
"batteryVoltage"
|
||||
)
|
||||
csvWriter.writeNext(header)
|
||||
|
||||
// Filter and write data rows where testStatus is true
|
||||
val filteredDataList = dataList.filter { it.testStatus == true }
|
||||
for (data in filteredDataList) {
|
||||
val row = arrayOf(
|
||||
data._id,
|
||||
data.name,
|
||||
data.incubationTime,
|
||||
data.bloodGroup,
|
||||
data.age, // Include other fields similarly
|
||||
data.state,
|
||||
data.abhaId,
|
||||
data.userImageURL,
|
||||
data.location?.toString(),
|
||||
data.reportUploadTime ?: "",
|
||||
data.testType ?: "",
|
||||
data.testTime ?: "",
|
||||
data.testStatus?.toString() ?: "",
|
||||
data.gender,
|
||||
data.localFlag.toString(),
|
||||
data.deviceId ?: "",
|
||||
data.appVersion ?: "",
|
||||
data.deviceSerialNumber,
|
||||
data.deviceType,
|
||||
data.kitSerial,
|
||||
data.resultData,
|
||||
data.led1Buffer?.toString() ?: "",
|
||||
data.led2Buffer?.toString() ?: "",
|
||||
data.led3Buffer?.toString() ?: "",
|
||||
data.led4Buffer?.toString() ?: "",
|
||||
data.led1Sample?.toString() ?: "",
|
||||
data.led2Sample?.toString() ?: "",
|
||||
data.led3Sample?.toString() ?: "",
|
||||
data.led4Sample?.toString() ?: "",
|
||||
data.led1Average?.toString() ?: "",
|
||||
data.led2Average?.toString() ?: "",
|
||||
data.led3Average?.toString() ?: "",
|
||||
data.led4Average?.toString() ?: "",
|
||||
data.abs1?.toString() ?: "",
|
||||
data.abs2?.toString() ?: "",
|
||||
data.abs3?.toString() ?: "",
|
||||
data.abs4?.toString() ?: "",
|
||||
data.deviceRatio?.toString() ?: "",
|
||||
data.calculatedRatio?.toString() ?: "",
|
||||
data.predictedDenovixRatio?.toString() ?: "",
|
||||
data.coefficients ?: "",
|
||||
data.classificationResult,
|
||||
data.prdClassification,
|
||||
data.errorMessages,
|
||||
data.batteryLevel,
|
||||
data.batteryCapacity,
|
||||
data.batteryMaxCapacity,
|
||||
data.batteryTemperature,
|
||||
data.batteryVoltage
|
||||
)
|
||||
csvWriter.writeNext(row)
|
||||
}
|
||||
writer.close()
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getExternalStorageDirectory(): File {
|
||||
val folder = File(Environment.getExternalStorageDirectory(), "HposFolder")
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.example.hpostesting.data.encryption
|
||||
|
||||
import android.security.keystore.KeyGenParameterSpec
|
||||
import android.security.keystore.KeyProperties
|
||||
import android.util.Base64
|
||||
import javax.crypto.Cipher
|
||||
import javax.crypto.KeyGenerator
|
||||
import javax.crypto.spec.SecretKeySpec
|
||||
|
||||
|
||||
object AESCrypt {
|
||||
private const val ALGORITHM = "AES"
|
||||
private const val KEY = "your_secret_key"
|
||||
|
||||
@Throws(Exception::class)
|
||||
fun encrypt(value: String): String {
|
||||
val keySpec = SecretKeySpec(KEY.toByteArray(), ALGORITHM)
|
||||
val cipher = Cipher.getInstance(ALGORITHM)
|
||||
cipher.init(Cipher.ENCRYPT_MODE, keySpec)
|
||||
val encryptedBytes = cipher.doFinal(value.toByteArray())
|
||||
return Base64.encodeToString(encryptedBytes, Base64.DEFAULT)
|
||||
}
|
||||
|
||||
@Throws(Exception::class)
|
||||
fun decrypt(encrypted: String?): String {
|
||||
val keySpec = SecretKeySpec(KEY.toByteArray(), ALGORITHM)
|
||||
val cipher = Cipher.getInstance(ALGORITHM)
|
||||
cipher.init(Cipher.DECRYPT_MODE, keySpec)
|
||||
val encryptedBytes = Base64.decode(encrypted, Base64.DEFAULT)
|
||||
val decryptedBytes = cipher.doFinal(encryptedBytes)
|
||||
return String(decryptedBytes)
|
||||
}
|
||||
|
||||
//generates a secret key for the encryption functions to use
|
||||
//TODO: Generating keys requires a higher API level. ask someone if this is okay.
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model
|
||||
|
||||
data class CalculationVariableForTest(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model
|
||||
|
||||
data class ErrorMessage (
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model
|
||||
|
||||
data class Location(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model
|
||||
|
||||
import com.example.hpostesting.data.model.test.TestRightResultType
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model
|
||||
|
||||
import java.util.Calendar
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model
|
||||
|
||||
sealed class Response<out R> {
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model
|
||||
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.calibration
|
||||
|
||||
data class CalibrationData (
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.devicediagnostics
|
||||
|
||||
data class AdditionalDetails(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.devicediagnostics
|
||||
|
||||
data class DeviceDiagnosticsData(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.devicediagnostics
|
||||
|
||||
data class DeviceDiagnosticsRequest(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.devicediagnostics
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.deviceprovision
|
||||
|
||||
data class Credentials(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.deviceprovision
|
||||
|
||||
data class Device(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.deviceprovision
|
||||
|
||||
data class DeviceProvisionData(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.deviceprovision
|
||||
|
||||
data class DeviceProvisionRequest(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.deviceprovision
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.deviceprovision
|
||||
|
||||
data class DeviceType(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.deviceprovision
|
||||
|
||||
data class DeviceUser(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.deviceprovision
|
||||
|
||||
data class ProvisionData(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.diagnostics
|
||||
|
||||
data class DiagnosticsData(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.jig
|
||||
|
||||
data class JigData(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.log
|
||||
|
||||
data class UploadLogsData(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.log
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.login
|
||||
|
||||
data class Device(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.login
|
||||
|
||||
data class DeviceType(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.login
|
||||
|
||||
data class DeviceUser(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.login
|
||||
|
||||
data class LoginData(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.login
|
||||
|
||||
data class LoginRequest(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.login
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.molbioresult
|
||||
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.molbioresult
|
||||
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.molbioresult
|
||||
|
||||
data class MolbioV2ResultRequest(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.molbioresult
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.molbioresult
|
||||
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.patient
|
||||
|
||||
import androidx.room.Entity
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.patient
|
||||
|
||||
import androidx.room.Entity
|
||||
@@ -26,4 +39,14 @@ data class DeviceData(
|
||||
var natsToken: String = "",
|
||||
@get:PropertyName("natsTokenExpiry") @set:PropertyName("natsTokenExpiry")
|
||||
var natsTokenExpiry: String = "",
|
||||
@get:PropertyName("deviceUpdateAvailable") @set:PropertyName("deviceUpdateAvailable")
|
||||
var deviceUpdateAvailable: Boolean = false,
|
||||
@get:PropertyName("updatePath") @set:PropertyName("updatePath")
|
||||
var updatePath: String = "",
|
||||
@get:PropertyName("deviceVersion") @set:PropertyName("deviceVersion")
|
||||
var deviceVersion: String = "",
|
||||
@get:PropertyName("globalUpdateDone") @set:PropertyName("globalUpdateDone")
|
||||
var globalUpdateDone: Boolean = false,
|
||||
@get:PropertyName("globalUpdateIgnore") @set:PropertyName("globalUpdateIgnore")
|
||||
var globalUpdateIgnore: Boolean = false,
|
||||
)
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.patient
|
||||
|
||||
import androidx.room.Entity
|
||||
@@ -5,12 +18,13 @@ import androidx.room.PrimaryKey
|
||||
|
||||
@Entity(tableName = "hemo_cube_test_table")
|
||||
data class HemoCubeTestData(
|
||||
@PrimaryKey
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
var sampleid: Int = 0,
|
||||
var _id: String = "",
|
||||
var name: String = "",
|
||||
var incubationTime: String = "",
|
||||
var bloodGroup: String = "",
|
||||
var birthYear: String = "",
|
||||
var age: String = "",
|
||||
var state: String = "",
|
||||
var abhaId: String = "",
|
||||
var userImageURL: String = "",
|
||||
@@ -78,6 +92,7 @@ data class HemoCubeTestData(
|
||||
var prdClassification: String = "",
|
||||
var deviceRatioClass: String = "",
|
||||
var slopeRatioClass: String = "",
|
||||
var borderlineMethod2Class: String = "",
|
||||
var errorMessages: String = "",
|
||||
var batteryLevel: String = "",
|
||||
var batteryCapacity: String = "",
|
||||
@@ -88,6 +103,13 @@ data class HemoCubeTestData(
|
||||
var quickCapture: Boolean = false,
|
||||
var solution: String? = "",
|
||||
var concentration: String? = "",
|
||||
var filter: String? = "",
|
||||
var volume: String? = "",
|
||||
var isCSVCreated: Boolean = false,
|
||||
var labName: String? = "",
|
||||
var cuvetteSize: String? = "",
|
||||
var district: String? = "",
|
||||
var centerName: String? = "",
|
||||
var ipAddress:String?= "",
|
||||
var configUpdatedRecent:String?= ""
|
||||
)
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.patient
|
||||
|
||||
import java.util.Date
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.patient
|
||||
|
||||
import androidx.room.Entity
|
||||
@@ -11,7 +24,7 @@ data class UserData(
|
||||
var name: String = "",
|
||||
var incubationTime: String = "",
|
||||
var gender: String = "",
|
||||
var birthYear: String = "",
|
||||
var age: String = "",
|
||||
var abhaId: String = "",
|
||||
var bloodGroup: String = "",
|
||||
var userImageURL: String = "",
|
||||
@@ -30,6 +43,7 @@ data class UserData(
|
||||
var result: TestRightResultType? = null,
|
||||
var resultRatio: Double? = null,
|
||||
var prdClassification: String = "",
|
||||
var sampleid: Int = 0
|
||||
) {
|
||||
enum class Gender {
|
||||
MALE,
|
||||
@@ -46,8 +60,10 @@ data class UserData(
|
||||
fun UserData.toHemoCubeTestData() = HemoCubeTestData(
|
||||
_id = _id,
|
||||
name = name,
|
||||
sampleid = sampleid,
|
||||
bloodGroup = bloodGroup,
|
||||
birthYear = birthYear,
|
||||
incubationTime = incubationTime,
|
||||
age = age,
|
||||
gender = gender,
|
||||
state = state,
|
||||
abhaId = abhaId,
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.test
|
||||
|
||||
data class TestRightCalculationData(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.test
|
||||
|
||||
data class TestRightDeviceConstants(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.test
|
||||
|
||||
enum class TestRightResultType {
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.test
|
||||
|
||||
enum class TestType {
|
||||
SICKLECERT,
|
||||
SICKLEFIND
|
||||
SICKLEFIND,
|
||||
HB_EST
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.example.hpostesting.di
|
||||
|
||||
import android.content.Context
|
||||
import com.example.hpostesting.data.repository.DatabaseRepository
|
||||
import com.example.hpostesting.data.dao.UserDao
|
||||
import com.example.hpostesting.domain.SaveRawData
|
||||
import com.example.hpostesting.domain.SaveRawDataTest
|
||||
import com.example.hpostesting.presentation.testRight.TestRightViewModel
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.components.ViewModelComponent
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
|
||||
@Module
|
||||
@InstallIn(ViewModelComponent::class)
|
||||
object ViewModelModule {
|
||||
|
||||
@Provides
|
||||
fun provideTestRightViewModel(
|
||||
saveRawData: SaveRawData,
|
||||
saveRawDataTest: SaveRawDataTest,
|
||||
databaseRepository: DatabaseRepository,
|
||||
userDao: UserDao,
|
||||
context: Context
|
||||
): TestRightViewModel {
|
||||
return TestRightViewModel(saveRawData, saveRawDataTest, databaseRepository, userDao, context)
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.updates
|
||||
|
||||
data class CheckUpdateData(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.updates
|
||||
|
||||
data class CheckUpdateRequest(
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.updates
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.model.updates
|
||||
|
||||
data class DeviceUpdateRequest(
|
||||
|
||||
@@ -1,7 +1,20 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.repository
|
||||
|
||||
import android.net.Uri
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.api.MolbioAuthApi
|
||||
import com.example.hpostesting.data.api.MolbioResultApi
|
||||
import com.example.hpostesting.data.model.PendingUploads
|
||||
@@ -76,8 +89,8 @@ class DatabaseRepository @Inject constructor(
|
||||
return safeApiCall { molbioResultApi.checkUpdate(checkUpdateRequest) }
|
||||
}
|
||||
|
||||
override suspend fun deviceUpdate(deviceUpdateRequest: DeviceUpdateRequest): Result<ResponseBody> {
|
||||
return safeApiCall { molbioResultApi.deviceUpdate(deviceUpdateRequest) }
|
||||
override suspend fun deviceUpdate(deviceUpdateRequest: DeviceUpdateRequest): retrofit2.Response<ResponseBody> {
|
||||
return molbioResultApi.deviceUpdate(deviceUpdateRequest)
|
||||
}
|
||||
|
||||
override suspend fun deviceDiagnostics(deviceDiagnosticsRequest: DeviceDiagnosticsRequest): Result<DeviceDiagnosticsResponse> {
|
||||
@@ -107,24 +120,21 @@ class DatabaseRepository @Inject constructor(
|
||||
Response.Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun addTestToDatabase(data: UserData?): Response<String> {
|
||||
override suspend fun addQcTestToDatabase(data: HemoCubeTestData?): Response<String> {
|
||||
return try {
|
||||
val userdata =
|
||||
db.collection("patientData").whereEqualTo("_id", data!!._id).get().await()
|
||||
if (userdata.documents.isNotEmpty()) {
|
||||
userdata.documents.forEach {
|
||||
db.collection("patientData").document(it.id).update("testStatus", true)
|
||||
}
|
||||
}
|
||||
db.collection("testData").add(data).await()
|
||||
|
||||
db.collection("qcData").add(data!!).await()
|
||||
Response.Success(data._id)
|
||||
|
||||
} catch (e: Exception) {
|
||||
Firebase.crashlytics.recordException(e)
|
||||
Response.Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun addTestToDatabase(data: UserData?): Response<String> {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override suspend fun addTestToDatabaseforBufferCheck(data: BufferCheckData?): Response<String> {
|
||||
return try {
|
||||
db.collection("buffers").add(data!!).await()
|
||||
@@ -145,6 +155,7 @@ class DatabaseRepository @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override suspend fun addTestJigData(data: JigData?): Response<String> {
|
||||
return try {
|
||||
db.collection("jigs").add(data!!).await()
|
||||
@@ -247,4 +258,22 @@ class DatabaseRepository @Inject constructor(
|
||||
override fun <UserData> addTestToDatabase(testDetails: UserData): Any {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override suspend fun addTestToDatabasefornew(data: HemoCubeTestData?): Response<String> {
|
||||
return try {
|
||||
val userdata =
|
||||
db.collection("patientData").whereEqualTo("_id", data!!._id).get().await()
|
||||
if (userdata.documents.isNotEmpty()) {
|
||||
userdata.documents.forEach {
|
||||
db.collection("patientData").document(it.id).update("testStatus", true)
|
||||
}
|
||||
}
|
||||
db.collection("testData").add(data).await()
|
||||
Response.Success(data._id)
|
||||
} catch (e: Exception) {
|
||||
Firebase.crashlytics.recordException(e)
|
||||
Response.Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.repository
|
||||
|
||||
import android.os.Environment
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.data.repository
|
||||
|
||||
import com.example.hpostesting.data.Result
|
||||
import com.example.hpostesting.util.Result
|
||||
import com.example.hpostesting.data.model.Response
|
||||
import com.example.hpostesting.data.model.devicediagnostics.DeviceDiagnosticsRequest
|
||||
import com.example.hpostesting.data.model.devicediagnostics.DeviceDiagnosticsResponse
|
||||
@@ -25,6 +38,8 @@ import okhttp3.ResponseBody
|
||||
|
||||
interface Repository {
|
||||
suspend fun addTestToDatabase(data: HemoCubeTestData?): Response<String>
|
||||
suspend fun addQcTestToDatabase(data: HemoCubeTestData?): Response<String>
|
||||
suspend fun addTestToDatabasefornew(data: HemoCubeTestData?): Response<String>
|
||||
|
||||
suspend fun addTestToDatabase(data: UserData?): Response<String>
|
||||
|
||||
@@ -50,7 +65,7 @@ interface Repository {
|
||||
|
||||
suspend fun checkUpdate(checkUpdateRequest: CheckUpdateRequest): Result<CheckUpdateResponse>
|
||||
|
||||
suspend fun deviceUpdate(deviceUpdateRequest: DeviceUpdateRequest): Result<ResponseBody>
|
||||
suspend fun deviceUpdate(deviceUpdateRequest: DeviceUpdateRequest): retrofit2.Response<ResponseBody>
|
||||
suspend fun deviceDiagnostics(deviceDiagnosticsRequest: DeviceDiagnosticsRequest): Result<DeviceDiagnosticsResponse>
|
||||
suspend fun downloadClientCertificate(): Result<ResponseBody>
|
||||
suspend fun uploadLogs(logFile: MultipartBody.Part): Result<UploadLogsResponse>
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
package com.example.hpostesting.domain.di
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.di
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
@@ -7,7 +20,8 @@ import android.content.res.AssetManager
|
||||
import androidx.room.Room
|
||||
import com.example.hpostesting.data.api.MolbioAuthApi
|
||||
import com.example.hpostesting.data.api.MolbioResultApi
|
||||
import com.example.hpostesting.data.api.PropertyProvider
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.util.PropertyProvider
|
||||
import com.example.hpostesting.data.dao.HemoCubeBufferDao
|
||||
import com.example.hpostesting.data.dao.HemoCubeDao
|
||||
import com.example.hpostesting.data.dao.MyDatabase
|
||||
@@ -22,12 +36,16 @@ import com.example.hpostesting.domain.LogFileManager
|
||||
import com.example.hpostesting.domain.LogFileManagerImpl
|
||||
import com.example.hpostesting.domain.SaveRawData
|
||||
import com.example.hpostesting.domain.SaveRawDataTest
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListener
|
||||
import com.example.hpostesting.presentation.utils.UsbServiceListenerImpl
|
||||
import com.example.hpostesting.util.PropertyProviderImpl
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import net.sqlcipher.database.SQLiteDatabase
|
||||
import net.sqlcipher.database.SupportFactory
|
||||
import okhttp3.OkHttpClient
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.converter.gson.GsonConverterFactory
|
||||
@@ -42,9 +60,12 @@ object AppModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideMyDatabase(@ApplicationContext context: Context): MyDatabase {
|
||||
val passphraseBytes: ByteArray = SQLiteDatabase.getBytes(Constants.passphrase.toCharArray())
|
||||
val factory = SupportFactory(passphraseBytes)
|
||||
|
||||
return Room.databaseBuilder(
|
||||
context, MyDatabase::class.java, "my_database"
|
||||
).fallbackToDestructiveMigration().build()
|
||||
).openHelperFactory(factory).fallbackToDestructiveMigration().build()
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -145,7 +166,7 @@ object AppModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideRetrofit(
|
||||
propertyProvider: PropertyProvider,@Named("Auth") client: OkHttpClient
|
||||
propertyProvider: PropertyProvider, @Named("Auth") client: OkHttpClient
|
||||
): Retrofit {
|
||||
return Retrofit.Builder().baseUrl(propertyProvider.getProperty("BASE_URL")).client(client)
|
||||
.addConverterFactory(GsonConverterFactory.create()).build()
|
||||
@@ -179,4 +200,10 @@ object AppModule {
|
||||
fun provideLocalFileDataSource(): LocalFileDataSource {
|
||||
return LocalFileDataSourceImpl()
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideUsbServiceListener(context: Context): UsbServiceListener {
|
||||
return UsbServiceListenerImpl(context)
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.domain
|
||||
|
||||
import android.content.SharedPreferences
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.domain
|
||||
|
||||
import android.content.Context
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.domain
|
||||
|
||||
import android.content.Context
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.domain
|
||||
|
||||
import android.content.Context
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.domain
|
||||
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.domain
|
||||
|
||||
import android.util.Log
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.domain
|
||||
|
||||
import com.example.hpostesting.data.repository.LocalFileRepository
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.domain
|
||||
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.domain
|
||||
|
||||
import com.example.hpostesting.data.model.test.TestRightCalculationData
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.encryption
|
||||
|
||||
import android.util.Base64
|
||||
import javax.crypto.Cipher
|
||||
import javax.crypto.SecretKeyFactory
|
||||
import javax.crypto.spec.IvParameterSpec
|
||||
import javax.crypto.spec.PBEKeySpec
|
||||
import javax.crypto.spec.SecretKeySpec
|
||||
|
||||
object Encryption {
|
||||
private const val AES_MODE = "AES/CBC/PKCS5Padding"
|
||||
private const val KEY_SPEC_ALGORITHM = "PBKDF2WithHmacSHA1"
|
||||
private const val SALT = "Bigtec"
|
||||
private const val ITERATION_COUNT = 10000
|
||||
private const val KEY_LENGTH = 256
|
||||
private val FIXED_IV = byteArrayOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
|
||||
|
||||
fun encrypt(textToEncrypt: String, password: String): String {
|
||||
val salt = SALT.toByteArray()
|
||||
val factory = SecretKeyFactory.getInstance(KEY_SPEC_ALGORITHM)
|
||||
val spec = PBEKeySpec(password.toCharArray(), salt, ITERATION_COUNT, KEY_LENGTH)
|
||||
val tmp = factory.generateSecret(spec)
|
||||
val key = SecretKeySpec(tmp.encoded, "AES")
|
||||
val cipher = Cipher.getInstance(AES_MODE)
|
||||
cipher.init(Cipher.ENCRYPT_MODE, key, IvParameterSpec(FIXED_IV))
|
||||
val encryptedBytes = cipher.doFinal(textToEncrypt.toByteArray(Charsets.UTF_8))
|
||||
return Base64.encodeToString(encryptedBytes, Base64.NO_WRAP)
|
||||
}
|
||||
|
||||
fun decrypt(encryptedText: String, password: String): String {
|
||||
val salt = SALT.toByteArray()
|
||||
val encryptedBytes = Base64.decode(encryptedText, Base64.NO_WRAP)
|
||||
val factory = SecretKeyFactory.getInstance(KEY_SPEC_ALGORITHM)
|
||||
val spec = PBEKeySpec(password.toCharArray(), salt, ITERATION_COUNT, KEY_LENGTH)
|
||||
val tmp = factory.generateSecret(spec)
|
||||
val key = SecretKeySpec(tmp.encoded, "AES")
|
||||
val cipher = Cipher.getInstance(AES_MODE)
|
||||
cipher.init(Cipher.DECRYPT_MODE, key, IvParameterSpec(FIXED_IV))
|
||||
val decryptedBytes = cipher.doFinal(encryptedBytes)
|
||||
return String(decryptedBytes, Charsets.UTF_8)
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.presentation
|
||||
|
||||
import android.content.Context
|
||||
@@ -10,10 +23,12 @@ import android.view.View
|
||||
import android.widget.EditText
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.data.model.test.TestType
|
||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||
import com.example.hpostesting.presentation.hb_test.HBTestActivity
|
||||
import com.example.hpostesting.presentation.hemocube.HemocubeActivity
|
||||
import com.example.hpostesting.presentation.testRight.TestRightActivity
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
@@ -31,9 +46,14 @@ import com.zebra.scannercontrol.IDcsSdkApiDelegate
|
||||
import com.zebra.scannercontrol.SDKHandler
|
||||
import `in`.sminnovations.hpostesting.R
|
||||
import `in`.sminnovations.hpostesting.databinding.ActivityKitScanBinding
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
import kotlin.math.max
|
||||
|
||||
class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
||||
|
||||
private var fromWhere = "Home"
|
||||
private val TAG = "KitScanActivity"
|
||||
private lateinit var binding: ActivityKitScanBinding
|
||||
|
||||
@@ -54,8 +74,24 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
private fun processScannedData(contents: String) {
|
||||
binding.nameEditText.setText(contents)
|
||||
private fun processScannedData(contents: String) {//edited auto selection of cuvette size
|
||||
if(contents.contains("SMI/SC/")){
|
||||
with(sharedPreference.edit()) {
|
||||
putString(Constants.CUVETTE_SIZE, "2mm")
|
||||
apply()
|
||||
}
|
||||
Toast.makeText(this, "Selected cuvette size: 2mm", Toast.LENGTH_SHORT).show()
|
||||
binding.nameEditText.setText(contents)
|
||||
}else if(contents.contains("SMI/SC-2-D10/")){
|
||||
with(sharedPreference.edit()) {
|
||||
putString(Constants.CUVETTE_SIZE, "10mm")
|
||||
apply()
|
||||
}
|
||||
Toast.makeText(this, "Selected cuvette size: 10mm", Toast.LENGTH_SHORT).show()
|
||||
binding.nameEditText.setText(contents)
|
||||
}else{
|
||||
Toast.makeText(this, R.string.invalid_kit, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
override fun attachBaseContext(newBase: Context?) {
|
||||
@@ -99,10 +135,30 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
||||
binding = ActivityKitScanBinding.inflate(layoutInflater)
|
||||
sharedPreference = this.getSharedPreferences("HEMOCUBE", Context.MODE_PRIVATE)
|
||||
setContentView(binding.root)
|
||||
binding.toolbar.title = "Kit Serial Number"
|
||||
fromWhere = intent.getStringExtra("fromWhere").toString()
|
||||
val maxTest = if(sharedPreference.getString(Constants.CUVETTE_SIZE, "10mm").toString() == "2mm"){
|
||||
Constants.MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE
|
||||
}else{
|
||||
Constants.MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE10MM
|
||||
}
|
||||
val time = timeDifference(sharedPreference.getString(Constants.KIT_TIME, "").toString())
|
||||
val kitNum = sharedPreference.getString(Constants.KIT_NUMBER, "").toString()
|
||||
// Toast.makeText(this@KitScanActivity,"Test MAx time"+ time+"-Test count-"+kitNum,Toast.LENGTH_SHORT).show()
|
||||
|
||||
if (DataHolder.sampleReadCounter <= Constants.MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE && DataHolder.isReferenceTaken) {
|
||||
DataHolder.selectedTest!!.kitSerial = DataHolder.kitSerial
|
||||
if (DataHolder.sampleReadCounter <= maxTest && kitNum != "" && time < Constants.MAX_KIT_TIME) {
|
||||
moveToNext()
|
||||
} else {
|
||||
Toast.makeText(this@KitScanActivity, "Limit Reached, Use New KIT for testing", Toast.LENGTH_SHORT).show()
|
||||
DataHolder.sampleReadCounter = 0
|
||||
DataHolder.kitSerial = ""
|
||||
|
||||
with(sharedPreference.edit()) {
|
||||
putString(Constants.KIT_NUMBER, "")
|
||||
putString(Constants.BUFFER_VALUE_1, "")
|
||||
putString(Constants.BUFFER_VALUE_2, "")
|
||||
apply()
|
||||
}
|
||||
}
|
||||
|
||||
// if (checkHemoCubeKitData()) {
|
||||
@@ -119,35 +175,31 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
||||
// }
|
||||
// }
|
||||
|
||||
try {
|
||||
if (checkHemoCubeKitData()) {
|
||||
DataHolder.selectedTest!!.kitSerial =
|
||||
sharedPreference.getString(Constants.KIT_NUMBER, "").toString()
|
||||
moveToNext()
|
||||
} else {
|
||||
// Handle the case when checkHemoCubeKitData() returns false
|
||||
with(sharedPreference.edit()) {
|
||||
putString(Constants.KIT_NUMBER, "")
|
||||
putInt(Constants.KIT_COUNT, 0)
|
||||
putString(Constants.BUFFER_VALUE_1, "")
|
||||
putString(Constants.BUFFER_VALUE_2, "")
|
||||
apply()
|
||||
}
|
||||
}
|
||||
} catch (e: NullPointerException) {
|
||||
// Handle the NullPointerException here
|
||||
e.printStackTrace() // You can log the exception for debugging
|
||||
FirebaseCrashlytics.getInstance().recordException(e)
|
||||
val errorMessage = "An error occurred: ${e.message}"
|
||||
val rootView = findViewById<View>(android.R.id.content)
|
||||
Snackbar.make(rootView, errorMessage, Snackbar.LENGTH_LONG).show()
|
||||
// Optionally, show a user-friendly error message to the user
|
||||
// Toast.makeText(applicationContext, "An error occurred", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
|
||||
binding.nameEditText.setText("SMI/SC/")
|
||||
|
||||
// try {
|
||||
// if (checkHemoCubeKitData()) {
|
||||
// DataHolder.selectedTest!!.kitSerial =
|
||||
// sharedPreference.getString(Constants.KIT_NUMBER, "").toString()
|
||||
// moveToNext()
|
||||
// } else {
|
||||
// // Handle the case when checkHemoCubeKitData() returns false
|
||||
// with(sharedPreference.edit()) {
|
||||
// putString(Constants.KIT_NUMBER, "")
|
||||
// putInt(Constants.KIT_COUNT, 0)
|
||||
// putString(Constants.BUFFER_VALUE_1, "")
|
||||
// putString(Constants.BUFFER_VALUE_2, "")
|
||||
// apply()
|
||||
// }
|
||||
// }
|
||||
// } catch (e: NullPointerException) {
|
||||
// // Handle the NullPointerException here
|
||||
// e.printStackTrace() // You can log the exception for debugging
|
||||
// FirebaseCrashlytics.getInstance().recordException(e)
|
||||
// val errorMessage = "An error occurred: ${e.message}"
|
||||
// val rootView = findViewById<View>(android.R.id.content)
|
||||
// Snackbar.make(rootView, errorMessage, Snackbar.LENGTH_LONG).show()
|
||||
// // Optionally, show a user-friendly error message to the user
|
||||
// // Toast.makeText(applicationContext, "An error occurred", Toast.LENGTH_SHORT).show()
|
||||
// }
|
||||
setSupportActionBar(binding.toolbar)
|
||||
|
||||
binding.btnScanNow.setOnClickListener {
|
||||
@@ -158,20 +210,39 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
||||
binding.btnGo.setOnClickListener {
|
||||
val serialNumber = binding.nameEditText.text.toString().trim()
|
||||
if (serialNumber.isNotEmpty() && isSerialValid(serialNumber)) {
|
||||
if(serialNumber.contains("SMI/SC/")){
|
||||
with(sharedPreference.edit()) {
|
||||
putString(Constants.CUVETTE_SIZE, "2mm")
|
||||
apply()
|
||||
}
|
||||
Toast.makeText(this, "Selected cuvette size: 2mm", Toast.LENGTH_SHORT).show()
|
||||
}else if(serialNumber.contains("SMI/SC-2-D10/")){
|
||||
with(sharedPreference.edit()) {
|
||||
putString(Constants.CUVETTE_SIZE, "10mm")
|
||||
apply()
|
||||
}
|
||||
Toast.makeText(this, "Selected cuvette size: 10mm", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
val kitTime = SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||
).format(Calendar.getInstance().time).toString()
|
||||
if (DataHolder.selectedTest == null) {
|
||||
with(sharedPreference.edit()) {
|
||||
putString(
|
||||
Constants.KIT_NUMBER, binding.nameEditText.text.toString()
|
||||
)
|
||||
putString(Constants.BUFFER_VALUE_1, "")
|
||||
putString(Constants.BUFFER_VALUE_2, "")
|
||||
putString(Constants.KIT_TIME, kitTime)
|
||||
putInt(Constants.KIT_COUNT, 1)
|
||||
apply()
|
||||
}
|
||||
DataHolder.kitSerial = binding.nameEditText.text.toString()
|
||||
Toast.makeText(
|
||||
applicationContext,
|
||||
R.string.kit_updated,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
|
||||
val i = Intent(applicationContext, DashboardActivity::class.java)
|
||||
startActivity(i)
|
||||
finish()
|
||||
@@ -179,6 +250,9 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
||||
DataHolder.kitSerial = binding.nameEditText.text.toString()
|
||||
DataHolder.selectedTest?.kitSerial = binding.nameEditText.text.toString()
|
||||
with(sharedPreference.edit()) {
|
||||
putString(Constants.BUFFER_VALUE_1, "")
|
||||
putString(Constants.BUFFER_VALUE_2, "")
|
||||
putString(Constants.KIT_TIME, kitTime)
|
||||
putString(Constants.KIT_NUMBER, binding.nameEditText.text.toString())
|
||||
putInt(Constants.KIT_COUNT, 1)
|
||||
apply()
|
||||
@@ -189,21 +263,21 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
||||
Toast.makeText(this, R.string.invalid_kit_number, Toast.LENGTH_LONG).show()
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (serialNumber.isNotEmpty() && checkDataNotNull() && isSerialValid(
|
||||
serialNumber
|
||||
)
|
||||
) {
|
||||
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 {
|
||||
Toast.makeText(this, R.string.invalid_kit_number, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
// if (serialNumber.isNotEmpty() && checkDataNotNull() && isSerialValid(
|
||||
// serialNumber
|
||||
// )
|
||||
// ) {
|
||||
// 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 {
|
||||
// Toast.makeText(this, R.string.invalid_kit_number, Toast.LENGTH_LONG).show()
|
||||
// }
|
||||
}
|
||||
|
||||
//Setting up the SDK handler
|
||||
@@ -262,42 +336,58 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
||||
Log.d("BARCODE", result)
|
||||
runOnUiThread {
|
||||
val editableResult: Editable = Editable.Factory.getInstance().newEditable(result)
|
||||
binding.nameEditText.text = editableResult
|
||||
processScannedData(result)
|
||||
// binding.nameEditText.text = editableResult
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkHemoCubeKitData(): Boolean {
|
||||
return sharedPreference.getString(Constants.KIT_NUMBER, "")
|
||||
?.isNotBlank() == true && sharedPreference.getInt(
|
||||
Constants.KIT_COUNT, 0
|
||||
) > 0 && sharedPreference.getInt(Constants.KIT_COUNT, 0) < Constants.KIT_CAPACITY
|
||||
}
|
||||
// private fun checkHemoCubeKitData(): Boolean {
|
||||
// return sharedPreference.getString(Constants.KIT_NUMBER, "")
|
||||
// ?.isNotBlank() == true && sharedPreference.getInt(
|
||||
// Constants.KIT_COUNT, 0
|
||||
// ) > 0 && sharedPreference.getInt(Constants.KIT_COUNT, 0) < Constants.KIT_CAPACITY
|
||||
// }
|
||||
|
||||
private fun isSerialValid(s: String): Boolean {
|
||||
if (s.length != 17) {
|
||||
binding.nameEditText.error = getString(R.string.invalid_kit)
|
||||
if (s.contains("SMI/SC/")) {
|
||||
if(s.length != 17){
|
||||
binding.nameEditText.error = "Invalid Kit Serial Number, correct example SMI/SC/000/00/000"
|
||||
return false
|
||||
}
|
||||
}else if(s.contains("SMI/SC-2-D10/")){
|
||||
if(s.length != 27){
|
||||
binding.nameEditText.error = "Invalid Kit Serial Number, correct example SMI/SC-2-D10/000000/000/000"
|
||||
return false
|
||||
}
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private fun moveToNext() {
|
||||
if(fromWhere == "Main"){
|
||||
if(DataHolder.selectedTestType == TestType.HB_EST){
|
||||
val i = Intent(applicationContext, HBTestActivity::class.java)
|
||||
startActivity(i)
|
||||
}else{
|
||||
DataHolder.deviceType.observe(this) { deviceType ->
|
||||
when (deviceType) {
|
||||
Constants.DEVICE_TYPE_HEMOCUBE -> {
|
||||
val i = Intent(applicationContext, HemocubeActivity::class.java)
|
||||
startActivity(i)
|
||||
}
|
||||
|
||||
DataHolder.deviceType.observe(this) { deviceType ->
|
||||
when (deviceType) {
|
||||
Constants.DEVICE_TYPE_HEMOCUBE -> {
|
||||
val i = Intent(applicationContext, HemocubeActivity::class.java)
|
||||
startActivity(i)
|
||||
}
|
||||
Constants.DEVICE_TYPE_TEST_RIGHT -> {
|
||||
val i = Intent(applicationContext, TestRightActivity::class.java)
|
||||
startActivity(i)
|
||||
}
|
||||
|
||||
Constants.DEVICE_TYPE_TEST_RIGHT -> {
|
||||
val i = Intent(applicationContext, TestRightActivity::class.java)
|
||||
startActivity(i)
|
||||
}
|
||||
|
||||
Constants.DEVICE_TYPE_TRUEHEME -> {
|
||||
val i = Intent(applicationContext, HemocubeActivity::class.java)
|
||||
startActivity(i)
|
||||
Constants.DEVICE_TYPE_TRUEHEME -> {
|
||||
val i = Intent(applicationContext, HemocubeActivity::class.java)
|
||||
startActivity(i)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -333,4 +423,18 @@ class KitScanActivity : AppCompatActivity(), IDcsSdkApiDelegate {
|
||||
true
|
||||
}
|
||||
}
|
||||
private fun timeDifference(createdAt: String): Long {
|
||||
val currentTime = Calendar.getInstance().time
|
||||
val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
|
||||
|
||||
val createdAtDate: Date = if (createdAt.isEmpty()) {
|
||||
currentTime
|
||||
} else {
|
||||
formatter.parse(createdAt) ?: currentTime
|
||||
}
|
||||
|
||||
val diffMillis = currentTime.time - createdAtDate.time
|
||||
|
||||
return diffMillis / (60 * 1000) // Convert milliseconds to minutes
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.presentation
|
||||
|
||||
import android.Manifest
|
||||
@@ -17,7 +30,7 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.get
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
@@ -62,7 +75,7 @@ class MainActivity : AppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.myToolbar.title = "Test Type"
|
||||
setSupportActionBar(binding.myToolbar)
|
||||
|
||||
setupListeners()
|
||||
@@ -71,10 +84,10 @@ class MainActivity : AppCompatActivity() {
|
||||
locationCallback = object : LocationCallback() {
|
||||
override fun onLocationResult(locationResult: LocationResult) {
|
||||
locationResult.lastLocation?.let { location ->
|
||||
DataHolder.location =
|
||||
UserData.Location(location.latitude, location.longitude)
|
||||
DataHolder.selectedTest?.location =
|
||||
UserData.Location(location.latitude, location.longitude)
|
||||
// DataHolder.location =
|
||||
// UserData.Location(location.latitude, location.longitude)
|
||||
// DataHolder.selectedTest?.location =
|
||||
// UserData.Location(location.latitude, location.longitude)
|
||||
Log.i("Location", DataHolder.location.toString())
|
||||
}
|
||||
}
|
||||
@@ -98,10 +111,10 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
if (DataHolder.selectedTest == null) {
|
||||
startActivity(Intent(this, DashboardActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
// if (DataHolder.selectedTest == null) {
|
||||
// startActivity(Intent(this, DashboardActivity::class.java))
|
||||
// finish()
|
||||
// }
|
||||
}
|
||||
|
||||
private fun checkAndUpdateUsbConnection() {
|
||||
@@ -207,6 +220,7 @@ class MainActivity : AppCompatActivity() {
|
||||
binding.cvItem1.setOnClickListener {
|
||||
DataHolder.selectedTestType = TestType.SICKLECERT
|
||||
val i = Intent(applicationContext, KitScanActivity::class.java)
|
||||
i.putExtra("fromWhere","Main")
|
||||
startActivity(i)
|
||||
finish()
|
||||
}
|
||||
@@ -214,6 +228,14 @@ class MainActivity : AppCompatActivity() {
|
||||
binding.cvItem2.setOnClickListener {
|
||||
DataHolder.selectedTestType = TestType.SICKLEFIND
|
||||
val i = Intent(applicationContext, KitScanActivity::class.java)
|
||||
i.putExtra("fromWhere","Main")
|
||||
startActivity(i)
|
||||
finish()
|
||||
}
|
||||
binding.cvItem3.setOnClickListener {
|
||||
DataHolder.selectedTestType = TestType.HB_EST
|
||||
val i = Intent(applicationContext, KitScanActivity::class.java)
|
||||
i.putExtra("fromWhere","Main")
|
||||
startActivity(i)
|
||||
finish()
|
||||
}
|
||||
@@ -301,14 +323,14 @@ class MainActivity : AppCompatActivity() {
|
||||
fusedLocationClient.lastLocation.addOnSuccessListener { location: Location? ->
|
||||
location?.let {
|
||||
if (DataHolder.selectedTest != null) {
|
||||
DataHolder.selectedTest!!.location =
|
||||
UserData.Location(location.latitude, location.longitude)
|
||||
// DataHolder.selectedTest!!.location =
|
||||
// UserData.Location(location.latitude, location.longitude)
|
||||
} else {
|
||||
startActivity(Intent(this, DashboardActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
DataHolder.location =
|
||||
UserData.Location(location.latitude, location.longitude)
|
||||
// DataHolder.location =
|
||||
// UserData.Location(location.latitude, location.longitude)
|
||||
} ?: run {
|
||||
requestLocationUpdates()
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.example.hpostesting.presentation
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
||||
class MainViewModel : ViewModel() {
|
||||
|
||||
}
|
||||
@@ -1,3 +1,16 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.presentation
|
||||
|
||||
import android.Manifest
|
||||
@@ -13,7 +26,7 @@ import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.example.hpostesting.data.DataHolder
|
||||
import com.example.hpostesting.data.constant.DataHolder
|
||||
import com.example.hpostesting.data.constant.LanguageManager
|
||||
import com.example.hpostesting.presentation.dashboard.DashboardActivity
|
||||
import com.example.hpostesting.util.MyUtils
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.example.hpostesting.presentation
|
||||
|
||||
interface UsbServiceListener {
|
||||
fun onUsbRead(data: ByteArray?)
|
||||
fun onUsbError(e: Exception?)
|
||||
}
|
||||
@@ -1,8 +1,22 @@
|
||||
/*
|
||||
* // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved.
|
||||
* // Notice: All information contained herein is, and remains
|
||||
* // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers,
|
||||
* // if any. The intellectual and technical concepts contained
|
||||
* // herein are proprietary to ShanMukha Innovations Pvt. Ltd.
|
||||
* // and its suppliers and may be covered by Indian and Foreign Patents,
|
||||
* // patents in process, and are protected by trade secret or copyright law.
|
||||
* // Dissemination of this information or reproduction of this material
|
||||
* // is strictly forbidden unless prior written permission is obtained
|
||||
* // from ShanMukha Innovations Pvt. Ltd.
|
||||
*/
|
||||
|
||||
package com.example.hpostesting.presentation.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.res.Resources
|
||||
import android.provider.ContactsContract.Data
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -11,7 +25,7 @@ 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.DataHolder
|
||||
import com.example.hpostesting.data.constant.Constants
|
||||
import com.example.hpostesting.data.model.patient.HemoCubeTestData
|
||||
import com.example.hpostesting.data.model.patient.UserData
|
||||
@@ -22,7 +36,7 @@ import java.util.Calendar
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
class OfflineUserListAdapter(private val view: View, private val batLevel: Int) :
|
||||
class OfflineUserListAdapter(private val view: View, private val batLevel: Int,private val fromWhere:String) :
|
||||
RecyclerView.Adapter<OfflineUserListAdapter.OfflineUserListViewHolder>() {
|
||||
|
||||
inner class OfflineUserListViewHolder(val binding: OfflineUserListViewBinding) :
|
||||
@@ -59,7 +73,7 @@ class OfflineUserListAdapter(private val view: View, private val batLevel: Int)
|
||||
override fun onBindViewHolder(holder: OfflineUserListViewHolder, position: Int) {
|
||||
val userList = differ.currentList[position]
|
||||
holder.binding.apply {
|
||||
userID.text = "User ID: ${userList._id}"
|
||||
userID.text = "Sample ID: ${userList._id}"
|
||||
bloodGroup.text = "Blood group: ${userList.bloodGroup}"
|
||||
time.text = "Time: ${isBetween15And30Minutes(userList.incubationTime)} \n Started at: ${
|
||||
SimpleDateFormat("HH:mm:ss").format(
|
||||
@@ -75,33 +89,32 @@ class OfflineUserListAdapter(private val view: View, private val batLevel: Int)
|
||||
} else {
|
||||
teststatus.text = view.context.getString(R.string.test_pending)
|
||||
}
|
||||
|
||||
userCard.setOnClickListener {
|
||||
if (false) {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
view.context.getString(R.string.low_battery_warning),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (userList.testStatus != null) {
|
||||
if (userList.testStatus!!) {
|
||||
if(fromWhere == "Home") {
|
||||
userCard.setOnClickListener {
|
||||
if (false) {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
view.context.getString(R.string.test_already_conducted),
|
||||
view.context.getString(R.string.low_battery_warning),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
} else {
|
||||
if (userList.incubationTime != "") {
|
||||
if (isBetween15And30Minutes(userList.incubationTime) < Constants.INCUBATION_TIME_MIN) {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
view.context.getString(R.string.incubation_not_completed),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
} else
|
||||
if (isBetween15And30Minutes(userList.incubationTime) > Constants.INCUBATION_TIME_MAX) {
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (userList.testStatus != null) {
|
||||
if (userList.testStatus!!) {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
view.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,
|
||||
view.context.getString(R.string.incubation_not_completed),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
} else if (isBetween15And30Minutes(userList.incubationTime) > Constants.INCUBATION_TIME_MAX) {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
view.context.getString(R.string.incubation_crossed_30_minutes),
|
||||
@@ -109,24 +122,25 @@ class OfflineUserListAdapter(private val view: View, private val batLevel: Int)
|
||||
).show()
|
||||
} else {
|
||||
DataHolder.selectedTest = UserData(
|
||||
_id = userList._id,
|
||||
bloodGroup = userList.bloodGroup,
|
||||
incubationTime = userList.incubationTime
|
||||
sampleid = userList.sampleid,
|
||||
_id = userList._id,
|
||||
bloodGroup = userList.bloodGroup,
|
||||
incubationTime = userList.incubationTime
|
||||
)
|
||||
view.findNavController()
|
||||
.navigate(R.id.action_nav_home_to_mainActivity)
|
||||
.navigate(R.id.action_nav_home_to_mainActivity)
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
view.context.getString(R.string.incubation_not_started),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
} else {
|
||||
Toast.makeText(
|
||||
view.context,
|
||||
view.context.getString(R.string.incubation_not_started),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user