diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..5092efb
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/hposregistration/ui/fragments/registration/ReviewDetailsRegistrationFragment.kt b/app/src/main/java/com/example/hposregistration/ui/fragments/registration/ReviewDetailsRegistrationFragment.kt
index 12564de..f39b770 100644
--- a/app/src/main/java/com/example/hposregistration/ui/fragments/registration/ReviewDetailsRegistrationFragment.kt
+++ b/app/src/main/java/com/example/hposregistration/ui/fragments/registration/ReviewDetailsRegistrationFragment.kt
@@ -120,6 +120,8 @@ class ReviewDetailsRegistrationFragment : BaseFragment() {
requireContext().getString(R.string.state_details, userData.state)
binding.tvPincode.text =
requireContext().getString(R.string.pincode_details, userData.pinCode)
+ binding.centerName.text =
+ requireContext().getString(R.string.centre_name, userData.CenterName)
if (userData.isUnderMedication!!) {
binding.tvIsUnderMedication.text = requireContext().getString(
R.string.is_patient_under_any_medication_details, "Yes"
@@ -138,11 +140,15 @@ class ReviewDetailsRegistrationFragment : BaseFragment() {
R.string.is_patient_undergoing_any_blood_transfusion_details, "No"
)
}
-
if (userData.sickleCellHistory != "") {
binding.tvSickleCellFamilyHistory.text = requireContext().getString(
R.string.sickle_cell_family_history, userData.sickleCellHistory
)
+
+ }else{
+ binding.tvSickleCellFamilyHistory.text = requireContext().getString(
+ R.string.sickle_cell_family_history, "No"
+ )
}
}
}
diff --git a/app/src/main/java/com/example/hposregistration/ui/fragments/registration/UserDetailsRegistrationFragment.kt b/app/src/main/java/com/example/hposregistration/ui/fragments/registration/UserDetailsRegistrationFragment.kt
index d689d9a..da037e6 100644
--- a/app/src/main/java/com/example/hposregistration/ui/fragments/registration/UserDetailsRegistrationFragment.kt
+++ b/app/src/main/java/com/example/hposregistration/ui/fragments/registration/UserDetailsRegistrationFragment.kt
@@ -4,7 +4,6 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import android.widget.RadioButton
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
@@ -79,6 +78,59 @@ class UserDetailsRegistrationFragment : Fragment() {
}
}
user.sickleCellHistory.let { etFamilyHistory.setText(it) }
+ user.isUnderMedication.let {
+ if (it != null) {
+ yes.isChecked = it
+ }
+ }
+ user.isUnderTransfusion.let {
+ if (it != null) {
+ yes1.isChecked = it
+ }
+ }
+// user.sickleCellHistory.let {
+// if (it != null && binding.etFamilyHistory.isVisible) {
+// if (it.isNotEmpty()) {
+//
+// yes1history.isChecked = true
+//
+//
+// }
+//
+// }else{
+// no1history.isChecked = true
+// }
+// }
+
+
+ user.sickleCellHistory?.let {
+ if (binding.etFamilyHistory.isVisible) {
+ binding.etFamilyHistory.setText(it)
+ yes1history.isChecked = true
+ }
+ }
+
+
+
+
+ binding.yes1history.setOnClickListener {
+ user.sickleCellHistory.let { etFamilyHistory.setText(it) }
+ binding.tilFamilyHistory.visibility =
+ if (binding.yes1history.isChecked) View.VISIBLE else View.GONE
+ }
+
+ binding.no1history.setOnClickListener {
+ binding.tilFamilyHistory.visibility =
+ if (binding.no1history.isChecked) View.GONE else View.VISIBLE
+ }
+
+ if (yes1history.isChecked) {
+ binding.tilFamilyHistory.visibility = View.VISIBLE
+
+ } else {
+ binding.tilFamilyHistory.visibility = View.GONE
+ }
+
}
}
@@ -212,7 +264,14 @@ class UserDetailsRegistrationFragment : Fragment() {
etFamilyHistory.error = "Please enter your family history"
return false
} else {
+ userData.isUnderMedication = yes.isChecked
+ userData.isUnderTransfusion = yes1.isChecked
+
+ if(etFamilyHistory.isVisible) {
+ val familyHistory = etFamilyHistory.text.toString()
userData.sickleCellHistory = familyHistory
+ }else{
+ userData.sickleCellHistory = ""
}
return true
}
diff --git a/app/src/main/res/layout/fragment_review_details_registration.xml b/app/src/main/res/layout/fragment_review_details_registration.xml
index f796a51..d1f4eef 100644
--- a/app/src/main/res/layout/fragment_review_details_registration.xml
+++ b/app/src/main/res/layout/fragment_review_details_registration.xml
@@ -196,7 +196,7 @@
app:layout_constraintTop_toBottomOf="@id/tvState" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@id/radioGroup" />
+
+ app:layout_constraintTop_toBottomOf="@id/cb_item2">
Enter Person\'s Details
Person\'s Name
Age in years
- Gender
+ Select Gender
Name can\'t be empty
Age can\'t be empty
Gender can\'t be empty
Age should be valid
Birth Year
- Marital status
+ Select Marital status
Father\'s/Husband\'s Name
- Caste
+ Select Caste
Person\'s Address Details
District
City / Town
@@ -39,10 +39,11 @@
Pincode
Patient Medical Records
Review
- Blood Group
+ Select Blood Group
House
Is user under any medication or treatment?
Is user undergoing any blood transfusion?
+
User List
Register User
Is user having any family history for Sickle Cell
@@ -69,9 +70,12 @@
City/Town: %1$s
District: %1$s
State: %1$s
+ Center Name: %1$s
+
Pincode: %1$s
Is Under Medication: %1$s
Is Under Blood Transfusion: %1$s
+ Is Any Sickle cell History: %1$s
Sickle cell Family History: %1$s
Center Name