Compare commits
3 Commits
dev
...
dev-nagpur
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a27a96f96 | ||
|
|
d35e59db9b | ||
|
|
5b3fcb3aa0 |
@@ -15,12 +15,13 @@ android {
|
|||||||
namespace 'in.sminnovations.hpostesting'
|
namespace 'in.sminnovations.hpostesting'
|
||||||
|
|
||||||
// dev -> development, quality -> qc, uat -> User Acceptance Testing, preprod -> preproduction, prod -> production, iocl -> iocl-iisc production
|
// dev -> development, quality -> qc, uat -> User Acceptance Testing, preprod -> preproduction, prod -> production, iocl -> iocl-iisc production
|
||||||
|
//for testing in iisc->in.sminnovations.hpostesting.test / prod -> in.sminnovations.hpostesting.iocl
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "in.sminnovations.hpostesting.iocl"
|
applicationId "in.sminnovations.hpostesting.iocl"
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 127
|
versionCode 129
|
||||||
versionName "2.1.127"
|
versionName "2.1.129"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,13 @@
|
|||||||
{
|
{
|
||||||
"project_info": {
|
"project_info": {
|
||||||
"project_number": "243503501547",
|
"project_number": "630821402019",
|
||||||
"project_id": "iocl-iisc-hpos",
|
"project_id": "iocl-iisc",
|
||||||
"storage_bucket": "iocl-iisc-hpos.appspot.com"
|
"storage_bucket": "iocl-iisc.appspot.com"
|
||||||
},
|
},
|
||||||
"client": [
|
"client": [
|
||||||
{
|
{
|
||||||
"client_info": {
|
"client_info": {
|
||||||
"mobilesdk_app_id": "1:243503501547:android:f17de652a3524d047feeae",
|
"mobilesdk_app_id": "1:630821402019:android:ab77866fb7b3114b1dd616",
|
||||||
"android_client_info": {
|
|
||||||
"package_name": "com.iocl_iisc.hposqc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth_client": [],
|
|
||||||
"api_key": [
|
|
||||||
{
|
|
||||||
"current_key": "AIzaSyBPxgcDkZfZMr8cFrkMWkVf1a-MstzWC1k"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": {
|
|
||||||
"appinvite_service": {
|
|
||||||
"other_platform_oauth_client": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_info": {
|
|
||||||
"mobilesdk_app_id": "1:243503501547:android:e1bb0f338c8448dd7feeae",
|
|
||||||
"android_client_info": {
|
"android_client_info": {
|
||||||
"package_name": "in.sminnovations.hposregistration.iocl"
|
"package_name": "in.sminnovations.hposregistration.iocl"
|
||||||
}
|
}
|
||||||
@@ -34,7 +15,7 @@
|
|||||||
"oauth_client": [],
|
"oauth_client": [],
|
||||||
"api_key": [
|
"api_key": [
|
||||||
{
|
{
|
||||||
"current_key": "AIzaSyBPxgcDkZfZMr8cFrkMWkVf1a-MstzWC1k"
|
"current_key": "AIzaSyABIdxI89eTZ8BqU2cIoJOgJ1lS1cFLCtQ"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"services": {
|
"services": {
|
||||||
@@ -45,7 +26,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"client_info": {
|
"client_info": {
|
||||||
"mobilesdk_app_id": "1:243503501547:android:18b8b33b2dc3776d7feeae",
|
"mobilesdk_app_id": "1:630821402019:android:ed56bae066ac32b51dd616",
|
||||||
"android_client_info": {
|
"android_client_info": {
|
||||||
"package_name": "in.sminnovations.hpostesting.iocl"
|
"package_name": "in.sminnovations.hpostesting.iocl"
|
||||||
}
|
}
|
||||||
@@ -53,7 +34,7 @@
|
|||||||
"oauth_client": [],
|
"oauth_client": [],
|
||||||
"api_key": [
|
"api_key": [
|
||||||
{
|
{
|
||||||
"current_key": "AIzaSyBPxgcDkZfZMr8cFrkMWkVf1a-MstzWC1k"
|
"current_key": "AIzaSyABIdxI89eTZ8BqU2cIoJOgJ1lS1cFLCtQ"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"services": {
|
"services": {
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 128,
|
"versionCode": 129,
|
||||||
"versionName": "2.1.128",
|
"versionName": "2.1.129",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ object Constants {
|
|||||||
const val ABHA_APP_PACKAGE = "in.ndhm.phr"
|
const val ABHA_APP_PACKAGE = "in.ndhm.phr"
|
||||||
|
|
||||||
const val MOLBIO_INTEGRATION = true
|
const val MOLBIO_INTEGRATION = true
|
||||||
|
const val FIREBASE_INTEGRATION = false
|
||||||
const val deviceProvisionEmail = "HPOS_provisioner@bigtec.co.in"
|
const val deviceProvisionEmail = "HPOS_provisioner@bigtec.co.in"
|
||||||
const val deviceProvisionPassword = "f2ab0e7f9d69"
|
const val deviceProvisionPassword = "f2ab0e7f9d69"
|
||||||
const val DEVICE_ID_API = "deviceIDAPI"
|
const val DEVICE_ID_API = "deviceIDAPI"
|
||||||
@@ -44,8 +45,8 @@ object Constants {
|
|||||||
|
|
||||||
const val TEST_RIGHT_TOTAL_PIXEL = 3694
|
const val TEST_RIGHT_TOTAL_PIXEL = 3694
|
||||||
|
|
||||||
const val MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE = 35
|
const val MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE = 34
|
||||||
const val MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE10MM = 10
|
const val MAXIMUM_TEST_ALLOWED_BEFORE_REFERENCE10MM = 9
|
||||||
|
|
||||||
const val RANGE_IN_RESULT_CALCULATIONS = 10
|
const val RANGE_IN_RESULT_CALCULATIONS = 10
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ interface HemoCubeDao {
|
|||||||
@Query("DELETE FROM hemo_cube_test_table WHERE _id = :id")
|
@Query("DELETE FROM hemo_cube_test_table WHERE _id = :id")
|
||||||
suspend fun deleteById(id: String)
|
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")
|
@Query("UPDATE hemo_cube_test_table SET localFlag = :newValue WHERE _id = :id")
|
||||||
suspend fun updateFieldById(id: String, newValue: Boolean)
|
suspend fun updateFieldById(id: String, newValue: Boolean)
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import com.example.hpostesting.data.model.patient.UserData
|
|||||||
|
|
||||||
@Database(
|
@Database(
|
||||||
entities = [UserData::class, HemoCubeTestData::class, DeviceData::class, BufferCheckData::class],
|
entities = [UserData::class, HemoCubeTestData::class, DeviceData::class, BufferCheckData::class],
|
||||||
version = 36,
|
version = 38,
|
||||||
exportSchema = false
|
exportSchema = false
|
||||||
)
|
)
|
||||||
@TypeConverters(Converters::class)
|
@TypeConverters(Converters::class)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class LocalFileDataSourceImpl @Inject constructor() : LocalFileDataSource {
|
|||||||
data.name,
|
data.name,
|
||||||
data.incubationTime,
|
data.incubationTime,
|
||||||
data.bloodGroup,
|
data.bloodGroup,
|
||||||
data.birthYear, // Include other fields similarly
|
data.age, // Include other fields similarly
|
||||||
data.state,
|
data.state,
|
||||||
data.abhaId,
|
data.abhaId,
|
||||||
data.userImageURL,
|
data.userImageURL,
|
||||||
@@ -233,7 +233,7 @@ class LocalFileDataSourceImpl @Inject constructor() : LocalFileDataSource {
|
|||||||
data.name,
|
data.name,
|
||||||
data.incubationTime,
|
data.incubationTime,
|
||||||
data.bloodGroup,
|
data.bloodGroup,
|
||||||
data.birthYear, // Include other fields similarly
|
data.age, // Include other fields similarly
|
||||||
data.state,
|
data.state,
|
||||||
data.abhaId,
|
data.abhaId,
|
||||||
data.userImageURL,
|
data.userImageURL,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ data class HemoCubeTestData(
|
|||||||
var name: String = "",
|
var name: String = "",
|
||||||
var incubationTime: String = "",
|
var incubationTime: String = "",
|
||||||
var bloodGroup: String = "",
|
var bloodGroup: String = "",
|
||||||
var birthYear: String = "",
|
var age: String = "",
|
||||||
var state: String = "",
|
var state: String = "",
|
||||||
var abhaId: String = "",
|
var abhaId: String = "",
|
||||||
var userImageURL: String = "",
|
var userImageURL: String = "",
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ data class UserData(
|
|||||||
var name: String = "",
|
var name: String = "",
|
||||||
var incubationTime: String = "",
|
var incubationTime: String = "",
|
||||||
var gender: String = "",
|
var gender: String = "",
|
||||||
var birthYear: String = "",
|
var age: String = "",
|
||||||
var abhaId: String = "",
|
var abhaId: String = "",
|
||||||
var bloodGroup: String = "",
|
var bloodGroup: String = "",
|
||||||
var userImageURL: String = "",
|
var userImageURL: String = "",
|
||||||
@@ -63,7 +63,7 @@ fun UserData.toHemoCubeTestData() = HemoCubeTestData(
|
|||||||
sampleid = sampleid,
|
sampleid = sampleid,
|
||||||
bloodGroup = bloodGroup,
|
bloodGroup = bloodGroup,
|
||||||
incubationTime = incubationTime,
|
incubationTime = incubationTime,
|
||||||
birthYear = birthYear,
|
age = age,
|
||||||
gender = gender,
|
gender = gender,
|
||||||
state = state,
|
state = state,
|
||||||
abhaId = abhaId,
|
abhaId = abhaId,
|
||||||
|
|||||||
@@ -111,10 +111,10 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DataHolder.selectedTest == null) {
|
// if (DataHolder.selectedTest == null) {
|
||||||
startActivity(Intent(this, DashboardActivity::class.java))
|
// startActivity(Intent(this, DashboardActivity::class.java))
|
||||||
finish()
|
// finish()
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkAndUpdateUsbConnection() {
|
private fun checkAndUpdateUsbConnection() {
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ import com.example.hpostesting.presentation.testRight.TestRightViewModel
|
|||||||
import `in`.sminnovations.hpostesting.R
|
import `in`.sminnovations.hpostesting.R
|
||||||
import `in`.sminnovations.hpostesting.databinding.FragmentActivitiesBinding
|
import `in`.sminnovations.hpostesting.databinding.FragmentActivitiesBinding
|
||||||
import `in`.sminnovations.hpostesting.databinding.FragmentHomeBinding
|
import `in`.sminnovations.hpostesting.databinding.FragmentHomeBinding
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Calendar
|
||||||
|
import java.util.Date
|
||||||
|
import java.util.Locale
|
||||||
|
|
||||||
class ActivitiesFragment : Fragment() {
|
class ActivitiesFragment : Fragment() {
|
||||||
private lateinit var binding: FragmentActivitiesBinding
|
private lateinit var binding: FragmentActivitiesBinding
|
||||||
@@ -53,6 +57,11 @@ class ActivitiesFragment : Fragment() {
|
|||||||
hemoCubeViewModel.allPendingUserToUpload.observe(viewLifecycleOwner) { userData ->
|
hemoCubeViewModel.allPendingUserToUpload.observe(viewLifecycleOwner) { userData ->
|
||||||
|
|
||||||
if (userData.isNotEmpty()) {
|
if (userData.isNotEmpty()) {
|
||||||
|
userData.forEach { user ->
|
||||||
|
if(isBetween15And30Minutes(user.incubationTime) > 30 && user.testStatus == false){
|
||||||
|
hemoCubeViewModel.deleteByStatus()
|
||||||
|
}
|
||||||
|
}
|
||||||
binding.rvOrderOffline.visibility = View.VISIBLE
|
binding.rvOrderOffline.visibility = View.VISIBLE
|
||||||
binding.noDataText.visibility = View.GONE
|
binding.noDataText.visibility = View.GONE
|
||||||
val bm =
|
val bm =
|
||||||
@@ -68,5 +77,15 @@ class ActivitiesFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private fun isBetween15And30Minutes(createdAt: String): Long {
|
||||||
|
val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
|
||||||
|
val createdAtDate: Date = formatter.parse(createdAt)!!
|
||||||
|
|
||||||
|
val currentTime = Calendar.getInstance().time
|
||||||
|
|
||||||
|
val diffMillis = currentTime.time - createdAtDate.time
|
||||||
|
|
||||||
|
return diffMillis / (60 * 1000)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -37,6 +37,7 @@ import android.util.Log
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.widget.ArrayAdapter
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.appcompat.content.res.AppCompatResources
|
import androidx.appcompat.content.res.AppCompatResources
|
||||||
@@ -133,7 +134,6 @@ class HomeFragment : Fragment() {
|
|||||||
binding.labelQuickCapture.visibility = View.VISIBLE
|
binding.labelQuickCapture.visibility = View.VISIBLE
|
||||||
binding.btnQuickCapture.visibility = View.VISIBLE
|
binding.btnQuickCapture.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
getDeviceId()
|
getDeviceId()
|
||||||
checkUnprocessedCSVData()
|
checkUnprocessedCSVData()
|
||||||
//checkForUpdate()
|
//checkForUpdate()
|
||||||
@@ -177,11 +177,13 @@ class HomeFragment : Fragment() {
|
|||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
requireContext(), R.string.test_upload, Toast.LENGTH_SHORT
|
requireContext(), R.string.test_upload, Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
|
hemoCubeViewModel.fireBaseBulkUpload.postValue("Done")
|
||||||
}
|
}
|
||||||
if (result == "Error") {
|
if (result == "Error") {
|
||||||
Toast.makeText(requireContext(), R.string.test_upload_failed, Toast.LENGTH_SHORT)
|
Toast.makeText(requireContext(), R.string.test_upload_failed, Toast.LENGTH_SHORT)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// binding.btnLogout.setOnClickListener {
|
// binding.btnLogout.setOnClickListener {
|
||||||
// logoutUser(requireContext())
|
// logoutUser(requireContext())
|
||||||
@@ -200,8 +202,7 @@ class HomeFragment : Fragment() {
|
|||||||
// }else{
|
// }else{
|
||||||
// binding.downloadCSV.visibility = View.GONE
|
// binding.downloadCSV.visibility = View.GONE
|
||||||
// }
|
// }
|
||||||
val btnSaveLocalVisibility =
|
val btnSaveLocalVisibility = if (userData.any { it.testStatus == true }) View.VISIBLE else View.GONE
|
||||||
if (userData.any { it.testStatus == true }) View.VISIBLE else View.GONE
|
|
||||||
binding.downloadCSV.visibility = btnSaveLocalVisibility
|
binding.downloadCSV.visibility = btnSaveLocalVisibility
|
||||||
binding.downloadCSV.setOnClickListener {
|
binding.downloadCSV.setOnClickListener {
|
||||||
if (btnSaveLocalVisibility == View.VISIBLE) {
|
if (btnSaveLocalVisibility == View.VISIBLE) {
|
||||||
@@ -291,15 +292,24 @@ class HomeFragment : Fragment() {
|
|||||||
private fun checkNetworkStatus() {
|
private fun checkNetworkStatus() {
|
||||||
hemoCubeViewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isConnected ->
|
hemoCubeViewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isConnected ->
|
||||||
// Toast.makeText(requireContext(),"connected"+isConnected+wasConnected, Toast.LENGTH_SHORT).show()
|
// Toast.makeText(requireContext(),"connected"+isConnected+wasConnected, Toast.LENGTH_SHORT).show()
|
||||||
|
if(isConnected){
|
||||||
|
binding.tvTitleNoInternet.text = "Please enter the user id and select blood group to start the test."
|
||||||
|
binding.internetIcon.setImageDrawable(AppCompatResources.getDrawable(requireContext(),R.drawable.internet))
|
||||||
|
binding.internetNotAvailableCL.visibility = View.VISIBLE
|
||||||
|
}else{
|
||||||
|
binding.internetIcon.setImageDrawable(AppCompatResources.getDrawable(requireContext(),R.drawable.off))
|
||||||
|
binding.tvTitleNoInternet.text = getString(R.string.internet_not_available_please_enter_the_user_id_manually)
|
||||||
|
binding.internetNotAvailableCL.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
if (isConnected != wasConnected) {
|
if (isConnected != wasConnected) {
|
||||||
if (isConnected) {
|
if (isConnected) {
|
||||||
binding.tvTitleNoInternet.text = "Please enter the user id and select blood group to start the test."
|
|
||||||
//binding.internetAvailableCL.visibility = View.VISIBLE
|
//binding.internetAvailableCL.visibility = View.VISIBLE
|
||||||
binding.internetIcon.setImageDrawable(AppCompatResources.getDrawable(requireContext(),R.drawable.internet))
|
|
||||||
binding.internetNotAvailableCL.visibility = View.VISIBLE
|
|
||||||
binding.pendingTest.visibility = View.GONE
|
binding.pendingTest.visibility = View.GONE
|
||||||
setUserId()
|
setUserId()
|
||||||
// loadUserData()
|
// loadUserData()
|
||||||
|
binding.tvTitleNoInternet.text = "Please enter the user id and select blood group to start the test."
|
||||||
|
binding.internetIcon.setImageDrawable(AppCompatResources.getDrawable(requireContext(),R.drawable.internet))
|
||||||
|
binding.internetNotAvailableCL.visibility = View.VISIBLE
|
||||||
// setSearch()
|
// setSearch()
|
||||||
//checkForLocalDBData()
|
//checkForLocalDBData()
|
||||||
if (Constants.MOLBIO_INTEGRATION) {
|
if (Constants.MOLBIO_INTEGRATION) {
|
||||||
@@ -372,7 +382,9 @@ class HomeFragment : Fragment() {
|
|||||||
if(Constants.MOLBIO_INTEGRATION){
|
if(Constants.MOLBIO_INTEGRATION){
|
||||||
hemoCubeViewModel.sendDataToMolbio()
|
hemoCubeViewModel.sendDataToMolbio()
|
||||||
}
|
}
|
||||||
hemoCubeViewModel.sendDataToFirebase()
|
if(Constants.FIREBASE_INTEGRATION) {
|
||||||
|
hemoCubeViewModel.sendDataToFirebase()
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
binding.tvTitleNoInternet.text = getString(R.string.internet_not_available_please_enter_the_user_id_manually)
|
binding.tvTitleNoInternet.text = getString(R.string.internet_not_available_please_enter_the_user_id_manually)
|
||||||
@@ -403,7 +415,8 @@ class HomeFragment : Fragment() {
|
|||||||
var userID = sharedPreference.getString(Constants.DEVICE_ID_API, "").toString()
|
var userID = sharedPreference.getString(Constants.DEVICE_ID_API, "").toString()
|
||||||
deviceId = sharedPreference.getString(Constants.DEVICE_ID, "").toString()
|
deviceId = sharedPreference.getString(Constants.DEVICE_ID, "").toString()
|
||||||
|
|
||||||
val target = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
|
// val target = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
|
||||||
|
val target = File(requireContext().getExternalFilesDir(null), "HPOSDocuments")
|
||||||
val file = File(target, "credentials.txt") //this file contains userID and password to communicate with API.
|
val file = File(target, "credentials.txt") //this file contains userID and password to communicate with API.
|
||||||
|
|
||||||
if (userID.isNotEmpty() && password.isNotEmpty()) {
|
if (userID.isNotEmpty() && password.isNotEmpty()) {
|
||||||
@@ -785,27 +798,75 @@ class HomeFragment : Fragment() {
|
|||||||
private fun setUserId() {
|
private fun setUserId() {
|
||||||
binding.btnSubmit.setOnClickListener {
|
binding.btnSubmit.setOnClickListener {
|
||||||
val userId = binding.userId.text.toString()
|
val userId = binding.userId.text.toString()
|
||||||
|
val age = binding.age.text.toString()
|
||||||
val bloodGroup = binding.etBloodGroup.text.toString()
|
val bloodGroup = binding.etBloodGroup.text.toString()
|
||||||
if (userId.length >= 5 && bloodGroup != "Select Blood Group") {
|
if (userId.length >= 5 && bloodGroup.isNotEmpty() && age.isNotEmpty()) {
|
||||||
DataHolder.selectedTest = UserData(
|
lifecycleScope.launch {
|
||||||
_id = userId,
|
// Add user first, ensuring it's done before fetching the user
|
||||||
bloodGroup = bloodGroup,
|
withContext(Dispatchers.IO) {
|
||||||
incubationTime = SimpleDateFormat(
|
hemoCubeViewModel.addUser(
|
||||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
HemoCubeTestData(
|
||||||
).format(Calendar.getInstance().time).toString()
|
_id = userId,
|
||||||
)
|
age = age,
|
||||||
findNavController().navigate(R.id.action_nav_home_to_mainActivity)
|
bloodGroup = bloodGroup,
|
||||||
|
incubationTime = SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
).format(Calendar.getInstance().time).toString()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now fetch the user after the addUser operation is complete
|
||||||
|
val user = withContext(Dispatchers.IO) {
|
||||||
|
hemoCubeViewModel.hemoCubeDao.getUserByID(userId)
|
||||||
|
}
|
||||||
|
|
||||||
|
user?.let {
|
||||||
|
DataHolder.selectedTest = UserData(
|
||||||
|
sampleid = it.sampleid,
|
||||||
|
_id = it._id,
|
||||||
|
age = it.age,
|
||||||
|
bloodGroup = it.bloodGroup,
|
||||||
|
incubationTime = SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
).format(Calendar.getInstance().time).toString()
|
||||||
|
)
|
||||||
|
findNavController().navigate(R.id.action_nav_home_to_mainActivity)
|
||||||
|
} ?: run {
|
||||||
|
Log.e("Error", "User not found")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// hemoCubeViewModel.addUser(
|
// hemoCubeViewModel.addUser(
|
||||||
// HemoCubeTestData(
|
// HemoCubeTestData(
|
||||||
// _id = userId,
|
// _id = userId,
|
||||||
// bloodGroup = bloodGroup.toString(),
|
// age = age,
|
||||||
|
// bloodGroup = bloodGroup,
|
||||||
// incubationTime = SimpleDateFormat(
|
// incubationTime = SimpleDateFormat(
|
||||||
// "yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
// "yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
// ).format(Calendar.getInstance().time).toString()
|
// ).format(Calendar.getInstance().time).toString()
|
||||||
// )
|
// )
|
||||||
// )
|
// )
|
||||||
|
//
|
||||||
|
// lifecycleScope.launch {
|
||||||
|
// val user = hemoCubeViewModel.hemoCubeDao.getUserByID(userId)
|
||||||
|
// user.let {
|
||||||
|
// DataHolder.selectedTest = UserData(
|
||||||
|
// sampleid = it.sampleid,
|
||||||
|
// _id = it._id,
|
||||||
|
// age = it.age,
|
||||||
|
// bloodGroup = it.bloodGroup,
|
||||||
|
// incubationTime = SimpleDateFormat(
|
||||||
|
// "yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
// ).format(Calendar.getInstance().time).toString()
|
||||||
|
// )
|
||||||
|
// findNavController().navigate(R.id.action_nav_home_to_mainActivity)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
Toast.makeText(requireContext(), "Successfully added- $userId", Toast.LENGTH_SHORT).show()
|
Toast.makeText(requireContext(), "Successfully added- $userId", Toast.LENGTH_SHORT).show()
|
||||||
binding.userId.setText("")
|
binding.userId.setText("")
|
||||||
|
binding.etBloodGroup.clearListSelection()
|
||||||
|
|
||||||
// val userData = UserData(_id = userId)
|
// val userData = UserData(_id = userId)
|
||||||
// DataHolder.selectedTest = userData
|
// DataHolder.selectedTest = userData
|
||||||
// findNavController().navigate(R.id.action_nav_home_to_mainActivity)
|
// findNavController().navigate(R.id.action_nav_home_to_mainActivity)
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class PrefsFragment: PreferenceFragmentCompat(){
|
|||||||
|
|
||||||
// App Version Preference
|
// App Version Preference
|
||||||
val appVersionPreference = Preference(requireContext())
|
val appVersionPreference = Preference(requireContext())
|
||||||
appVersionPreference.title = "App Version"
|
appVersionPreference.title = "App Version SMI"
|
||||||
appVersionPreference.summary =
|
appVersionPreference.summary =
|
||||||
getAppVersion(requireContext()) + " [ " + getAppEnvironment(requireContext()) + " ]"
|
getAppVersion(requireContext()) + " [ " + getAppEnvironment(requireContext()) + " ]"
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class LoginFragment : Fragment() {
|
|||||||
setupAutoCompleteTextView()
|
setupAutoCompleteTextView()
|
||||||
}
|
}
|
||||||
private fun setupAutoCompleteTextView() {
|
private fun setupAutoCompleteTextView() {
|
||||||
val districts = resources.getStringArray(R.array.district)
|
val districts = resources.getStringArray(R.array.districtN)
|
||||||
val adapter = ArrayAdapter(requireContext(), android.R.layout.simple_dropdown_item_1line, districts)
|
val adapter = ArrayAdapter(requireContext(), android.R.layout.simple_dropdown_item_1line, districts)
|
||||||
binding.etDistrict.setAdapter(adapter)
|
binding.etDistrict.setAdapter(adapter)
|
||||||
|
|
||||||
|
|||||||
@@ -249,10 +249,14 @@ class DeviceProvisionFragment : Fragment() {
|
|||||||
private fun encryptAndSaveToFile(username: String, password: String) {
|
private fun encryptAndSaveToFile(username: String, password: String) {
|
||||||
val messageToEncrypt = "$username\n$password"
|
val messageToEncrypt = "$username\n$password"
|
||||||
val encryptionKey =
|
val encryptionKey =
|
||||||
Settings.Secure.getString(context?.contentResolver, Settings.Secure.ANDROID_ID)
|
Settings.Secure.getString(requireContext().contentResolver, Settings.Secure.ANDROID_ID)
|
||||||
val encryptedString = Encryption.encrypt(messageToEncrypt, encryptionKey)
|
val encryptedString = Encryption.encrypt(messageToEncrypt, encryptionKey)
|
||||||
Log.d("DEVICE ID/encryptionKey", encryptionKey)
|
Log.d("DEVICE ID/encryptionKey", encryptionKey)
|
||||||
val target = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
|
// val target = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)
|
||||||
|
val target = File(requireContext().getExternalFilesDir(null), "HPOSDocuments")
|
||||||
|
if (!target.exists()) {
|
||||||
|
target.mkdirs() // Create the directory if it doesn't exist
|
||||||
|
}
|
||||||
val file = File(target, "credentials.txt")
|
val file = File(target, "credentials.txt")
|
||||||
|
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class DigitalCardFragment : Fragment() {
|
|||||||
binding.progressBar.visibility = View.VISIBLE
|
binding.progressBar.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
Log.d("DigitalCardFragment", "Name: ${DataHolder.hemoCubeTestData?.name}")
|
Log.d("DigitalCardFragment", "Name: ${DataHolder.hemoCubeTestData?.name}")
|
||||||
Log.d("DigitalCardFragment", "DOB: ${testDetails?.birthYear}")
|
Log.d("DigitalCardFragment", "DOB: ${testDetails?.age}")
|
||||||
Log.d("DigitalCardFragment", "Gender: ${testDetails?.gender}")
|
Log.d("DigitalCardFragment", "Gender: ${testDetails?.gender}")
|
||||||
Log.d("DigitalCardFragment", "State: ${testDetails?.state}")
|
Log.d("DigitalCardFragment", "State: ${testDetails?.state}")
|
||||||
Log.d("DigitalCardFragment", "ABHA ID: ${testDetails?.abhaId}")
|
Log.d("DigitalCardFragment", "ABHA ID: ${testDetails?.abhaId}")
|
||||||
@@ -67,7 +67,7 @@ class DigitalCardFragment : Fragment() {
|
|||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
binding.progressBar.visibility = View.GONE
|
binding.progressBar.visibility = View.GONE
|
||||||
binding.name.text = "Name: ${DataHolder.hemoCubeTestData?.name}"
|
binding.name.text = "Name: ${DataHolder.hemoCubeTestData?.name}"
|
||||||
binding.dob.text = "DOB: ${testDetails?.birthYear}"
|
binding.dob.text = "DOB: ${testDetails?.age}"
|
||||||
binding.gender.text = "Gender: ${testDetails?.gender}"
|
binding.gender.text = "Gender: ${testDetails?.gender}"
|
||||||
binding.State.text = "State: ${testDetails?.state}"
|
binding.State.text = "State: ${testDetails?.state}"
|
||||||
binding.abhaid.text = "ABHA ID: ${testDetails?.abhaId}"
|
binding.abhaid.text = "ABHA ID: ${testDetails?.abhaId}"
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ import javax.inject.Inject
|
|||||||
@Suppress("MemberVisibilityCanBePrivate")
|
@Suppress("MemberVisibilityCanBePrivate")
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
class HemoCubeViewModel @Inject constructor(
|
class HemoCubeViewModel @Inject constructor(
|
||||||
private val hemoCubeDao: HemoCubeDao,
|
val hemoCubeDao: HemoCubeDao,
|
||||||
private val hemoCubeBufferDao: HemoCubeBufferDao,
|
private val hemoCubeBufferDao: HemoCubeBufferDao,
|
||||||
private val repository: Repository,
|
private val repository: Repository,
|
||||||
private val logFileManager: LogFileManager,
|
private val logFileManager: LogFileManager,
|
||||||
@@ -132,13 +132,23 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
try {
|
try {
|
||||||
if (isOnline) {
|
if (isOnline) {
|
||||||
parseData()
|
parseData()
|
||||||
addResultTestToDb(quickCapture)
|
if(Constants.FIREBASE_INTEGRATION){
|
||||||
|
addResultTestToDb(quickCapture)
|
||||||
|
}else{
|
||||||
|
uploadToMolbio()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
parseData()
|
parseData()
|
||||||
addResultTestToDb(quickCapture)
|
val kitCount = sharedPreference.getInt(Constants.KIT_COUNT, 0)
|
||||||
|
with(sharedPreference.edit()) {
|
||||||
|
putInt(Constants.KIT_COUNT, kitCount.plus(1))
|
||||||
|
apply()
|
||||||
|
}
|
||||||
|
// addResultTestToDb(quickCapture,isOnline)
|
||||||
testDetails?.testTime = SimpleDateFormat(
|
testDetails?.testTime = SimpleDateFormat(
|
||||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
).format(Calendar.getInstance().time)
|
).format(Calendar.getInstance().time)
|
||||||
|
testDetails?.localFlag = false
|
||||||
hemoCubeDao.updateTest(testDetails!!)
|
hemoCubeDao.updateTest(testDetails!!)
|
||||||
fireBaseUpload.postValue("Local")
|
fireBaseUpload.postValue("Local")
|
||||||
}
|
}
|
||||||
@@ -146,6 +156,50 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
Log.e("Testdb", "Upload failed: ${e.message}")
|
Log.e("Testdb", "Upload failed: ${e.message}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fun uploadToMolbio(){
|
||||||
|
if (Constants.MOLBIO_INTEGRATION) {
|
||||||
|
testDetails!!.testStatus = true
|
||||||
|
testDetails.localFlag = true
|
||||||
|
val kitCount = sharedPreference.getInt(Constants.KIT_COUNT, 0)
|
||||||
|
with(sharedPreference.edit()) {
|
||||||
|
putInt(Constants.KIT_COUNT, kitCount.plus(1))
|
||||||
|
apply()
|
||||||
|
}
|
||||||
|
fireBaseUpload.postValue("Success")
|
||||||
|
testDetails.reportUploadTime = SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
|
).format(Calendar.getInstance().time)
|
||||||
|
val currentTimeFormatted = SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd'T'HH:mm:ssZZZZZ",
|
||||||
|
Locale.getDefault()
|
||||||
|
).format(Calendar.getInstance().time)
|
||||||
|
// Sanitize testDetails before using it in the API call
|
||||||
|
val sanitizedTestDetails = sanitizeDoubleValues(testDetails)
|
||||||
|
|
||||||
|
// Now, use sanitizedTestDetails for the API call
|
||||||
|
uploadResult(
|
||||||
|
MolbioV2ResultRequest(
|
||||||
|
mutableListOf(
|
||||||
|
MolbioV2Result(
|
||||||
|
rawData = sanitizedTestDetails,
|
||||||
|
analysisId = sanitizedTestDetails._id,
|
||||||
|
analysisDate = currentTimeFormatted,
|
||||||
|
analysisStatus = sanitizedTestDetails.classificationResult,
|
||||||
|
thresholds = Constants.BUFFER_INTENSITY_THRESHOLDS[sanitizedTestDetails.deviceId]?.toString(),
|
||||||
|
interpretation = sanitizedTestDetails.classificationResult,
|
||||||
|
testId = sanitizedTestDetails._id,
|
||||||
|
testTime = currentTimeFormatted,
|
||||||
|
collectionTime = currentTimeFormatted,
|
||||||
|
expiryTime = currentTimeFormatted,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
viewModelScope.launch {
|
||||||
|
hemoCubeDao.updateTest(testDetails)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun login(loginRequest: LoginRequest) = viewModelScope.launch {
|
fun login(loginRequest: LoginRequest) = viewModelScope.launch {
|
||||||
loginResponse.postValue(Result.Loading())
|
loginResponse.postValue(Result.Loading())
|
||||||
@@ -221,16 +275,20 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
is Result.Success -> {
|
is Result.Success -> {
|
||||||
it.data.data?.forEach { id ->
|
it.data.data?.forEach { id ->
|
||||||
id.rawData?.let { it1 ->
|
id.rawData?.let { it1 ->
|
||||||
|
updateLocalFlag(it1._id)
|
||||||
updateMolbioFlag(
|
updateMolbioFlag(
|
||||||
it1._id
|
it1._id
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fireBaseBulkUpload.postValue("Success")
|
||||||
}
|
}
|
||||||
is Result.Error -> {
|
is Result.Error -> {
|
||||||
|
fireBaseBulkUpload.postValue("Error")
|
||||||
Log.d("result","result upload error")
|
Log.d("result","result upload error")
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
|
fireBaseBulkUpload.postValue("Error")
|
||||||
Log.d("result","result upload else")
|
Log.d("result","result upload else")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -248,7 +306,6 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -399,7 +456,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
testDetails?.coefficients = DataHolder.hemoCubeTestData?.coefficients
|
testDetails?.coefficients = DataHolder.hemoCubeTestData?.coefficients
|
||||||
testDetails?.incubationTime = DataHolder.hemoCubeTestData?.incubationTime.toString()
|
testDetails?.incubationTime = DataHolder.hemoCubeTestData?.incubationTime.toString()
|
||||||
testDetails?.name = DataHolder.hemoCubeTestData?.name.toString()
|
testDetails?.name = DataHolder.hemoCubeTestData?.name.toString()
|
||||||
testDetails?.birthYear = DataHolder.hemoCubeTestData?.birthYear.toString()
|
testDetails?.age = DataHolder.hemoCubeTestData?.age.toString()
|
||||||
testDetails?.userImageURL = DataHolder.hemoCubeTestData?.userImageURL.toString()
|
testDetails?.userImageURL = DataHolder.hemoCubeTestData?.userImageURL.toString()
|
||||||
testDetails?.classificationResult = DataHolder.hemoCubeTestData?.classificationResult!!
|
testDetails?.classificationResult = DataHolder.hemoCubeTestData?.classificationResult!!
|
||||||
testDetails?.prdClassification = DataHolder.hemoCubeTestData?.prdClassification.toString()
|
testDetails?.prdClassification = DataHolder.hemoCubeTestData?.prdClassification.toString()
|
||||||
@@ -429,6 +486,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
try {
|
try {
|
||||||
testDetails!!.quickCapture = quickCapture
|
testDetails!!.quickCapture = quickCapture
|
||||||
|
testDetails.testStatus = true
|
||||||
testDetails.reportUploadTime = SimpleDateFormat(
|
testDetails.reportUploadTime = SimpleDateFormat(
|
||||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||||
).format(Calendar.getInstance().time)
|
).format(Calendar.getInstance().time)
|
||||||
@@ -461,6 +519,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}else{
|
}else{
|
||||||
when (val response = repository.addTestToDatabase(testDetails)) {
|
when (val response = repository.addTestToDatabase(testDetails)) {
|
||||||
is Response.Success -> {
|
is Response.Success -> {
|
||||||
|
testDetails.localFlag = true
|
||||||
val kitCount = sharedPreference.getInt(Constants.KIT_COUNT, 0)
|
val kitCount = sharedPreference.getInt(Constants.KIT_COUNT, 0)
|
||||||
with(sharedPreference.edit()) {
|
with(sharedPreference.edit()) {
|
||||||
putInt(Constants.KIT_COUNT, kitCount.plus(1))
|
putInt(Constants.KIT_COUNT, kitCount.plus(1))
|
||||||
@@ -468,7 +527,6 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
Log.i("Testdb", "Data uploaded to Firestore successfully")
|
||||||
fireBaseUpload.postValue("Success")
|
fireBaseUpload.postValue("Success")
|
||||||
testDetails.localFlag = true
|
|
||||||
if (Constants.MOLBIO_INTEGRATION) {
|
if (Constants.MOLBIO_INTEGRATION) {
|
||||||
// Sanitize testDetails before using it in the API call
|
// Sanitize testDetails before using it in the API call
|
||||||
val sanitizedTestDetails = sanitizeDoubleValues(testDetails)
|
val sanitizedTestDetails = sanitizeDoubleValues(testDetails)
|
||||||
@@ -560,7 +618,9 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
fun deleteById(userId: String) = viewModelScope.launch {
|
fun deleteById(userId: String) = viewModelScope.launch {
|
||||||
hemoCubeDao.deleteById(id = userId)
|
hemoCubeDao.deleteById(id = userId)
|
||||||
}
|
}
|
||||||
|
fun deleteByStatus() = viewModelScope.launch {
|
||||||
|
hemoCubeDao.deleteByStatus()
|
||||||
|
}
|
||||||
|
|
||||||
private fun addResultTestToDbforbuffercheck(bufferCheckData: BufferCheckData) {
|
private fun addResultTestToDbforbuffercheck(bufferCheckData: BufferCheckData) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@@ -606,7 +666,7 @@ class HemoCubeViewModel @Inject constructor(
|
|||||||
userData._id,
|
userData._id,
|
||||||
userData.name,
|
userData.name,
|
||||||
userData.bloodGroup,
|
userData.bloodGroup,
|
||||||
userData.birthYear,
|
userData.age,
|
||||||
userData.classificationResult,
|
userData.classificationResult,
|
||||||
userData.testTime.toString(),
|
userData.testTime.toString(),
|
||||||
userData.userImageURL
|
userData.userImageURL
|
||||||
|
|||||||
@@ -112,14 +112,14 @@ class TestRightResults : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateResults() {
|
private fun updateResults() {
|
||||||
if (viewModel.testDetails?.name == "" && viewModel.testDetails?.birthYear == "") {
|
if (viewModel.testDetails?.name == "" && viewModel.testDetails?.age == "") {
|
||||||
binding.tvName.visibility = View.GONE
|
binding.tvName.visibility = View.GONE
|
||||||
binding.tvAge.visibility = View.GONE
|
binding.tvAge.visibility = View.GONE
|
||||||
} else {
|
} else {
|
||||||
binding.tvName.text = getString(R.string.name_in_textview, viewModel.testDetails?.name)
|
binding.tvName.text = getString(R.string.name_in_textview, viewModel.testDetails?.name)
|
||||||
binding.tvAge.text = getString(
|
binding.tvAge.text = getString(
|
||||||
R.string.age_in_textview,
|
R.string.age_in_textview,
|
||||||
viewModel.testDetails?.birthYear?.toInt()?.calculateAgeFromYOB().toString()
|
viewModel.testDetails?.age?.toInt()?.calculateAgeFromYOB().toString()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ class TrueHemeViewModel @Inject constructor(
|
|||||||
testDetails?.coefficients = DataHolder.hemoCubeTestData?.coefficients
|
testDetails?.coefficients = DataHolder.hemoCubeTestData?.coefficients
|
||||||
testDetails?.incubationTime = DataHolder.hemoCubeTestData?.incubationTime.toString()
|
testDetails?.incubationTime = DataHolder.hemoCubeTestData?.incubationTime.toString()
|
||||||
testDetails?.name = DataHolder.hemoCubeTestData?.name.toString()
|
testDetails?.name = DataHolder.hemoCubeTestData?.name.toString()
|
||||||
testDetails?.birthYear = DataHolder.hemoCubeTestData?.birthYear.toString()
|
testDetails?.age = DataHolder.hemoCubeTestData?.age.toString()
|
||||||
testDetails?.userImageURL = DataHolder.hemoCubeTestData?.userImageURL.toString()
|
testDetails?.userImageURL = DataHolder.hemoCubeTestData?.userImageURL.toString()
|
||||||
testDetails?.classificationResult = DataHolder.hemoCubeTestData?.classificationResult!!
|
testDetails?.classificationResult = DataHolder.hemoCubeTestData?.classificationResult!!
|
||||||
testDetails?.prdClassification = DataHolder.hemoCubeTestData?.prdClassification.toString()
|
testDetails?.prdClassification = DataHolder.hemoCubeTestData?.prdClassification.toString()
|
||||||
@@ -434,7 +434,7 @@ class TrueHemeViewModel @Inject constructor(
|
|||||||
userData._id,
|
userData._id,
|
||||||
userData.name,
|
userData.name,
|
||||||
userData.bloodGroup,
|
userData.bloodGroup,
|
||||||
userData.birthYear,
|
userData.age,
|
||||||
userData.classificationResult,
|
userData.classificationResult,
|
||||||
userData.testTime.toString(),
|
userData.testTime.toString(),
|
||||||
userData.userImageURL
|
userData.userImageURL
|
||||||
|
|||||||
@@ -102,7 +102,26 @@
|
|||||||
android:hint="@string/sample_id" />
|
android:hint="@string/sample_id" />
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/til_age"
|
||||||
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/til_name">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/age"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLength="2"
|
||||||
|
android:inputType="number"
|
||||||
|
android:hint="@string/age" />
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/til_blood_group"
|
android:id="@+id/til_blood_group"
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||||
@@ -112,13 +131,13 @@
|
|||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/til_name">
|
app:layout_constraintTop_toBottomOf="@+id/til_age">
|
||||||
|
|
||||||
<AutoCompleteTextView
|
<AutoCompleteTextView
|
||||||
android:id="@+id/et_blood_group"
|
android:id="@+id/et_blood_group"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/select_blood_group"
|
android:hint="@string/select_blood_group"
|
||||||
android:inputType="none"
|
android:inputType="none"
|
||||||
android:labelFor="@id/til_blood_group"
|
android:labelFor="@id/til_blood_group"
|
||||||
app:simpleItems="@array/blood_group" />
|
app:simpleItems="@array/blood_group" />
|
||||||
|
|||||||
@@ -31,5 +31,9 @@
|
|||||||
<item>Chamarajanagar</item>
|
<item>Chamarajanagar</item>
|
||||||
<item>Other</item>
|
<item>Other</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
<string-array name="districtN">
|
||||||
|
<item>Nagpur</item>
|
||||||
|
<item>Other</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
<string name="acquire">Acquire</string>
|
<string name="acquire">Acquire</string>
|
||||||
<string name="enter_patient_details">Enter Patient Details</string>
|
<string name="enter_patient_details">Enter Patient Details</string>
|
||||||
<string name="patient_name">Patient Name</string>
|
<string name="patient_name">Patient Name</string>
|
||||||
<string name="age">Age in years</string>
|
<string name="age">Age</string>
|
||||||
<string name="gender">Gender</string>
|
<string name="gender">Gender</string>
|
||||||
<string name="name_error">Name can\'t be empty</string>
|
<string name="name_error">Name can\'t be empty</string>
|
||||||
<string name="age_error">Age can\'t be empty</string>
|
<string name="age_error">Age can\'t be empty</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user