Restructuración del Proyecto
This commit is contained in:
parent
e83dc3fabe
commit
6ee43fc790
|
@ -3,7 +3,20 @@
|
||||||
<component name="deploymentTargetDropDown">
|
<component name="deploymentTargetDropDown">
|
||||||
<value>
|
<value>
|
||||||
<entry key="app">
|
<entry key="app">
|
||||||
<State />
|
<State>
|
||||||
|
<runningDeviceTargetSelectedWithDropDown>
|
||||||
|
<Target>
|
||||||
|
<type value="RUNNING_DEVICE_TARGET" />
|
||||||
|
<deviceKey>
|
||||||
|
<Key>
|
||||||
|
<type value="VIRTUAL_DEVICE_PATH" />
|
||||||
|
<value value="C:\Users\USER\.android\avd\Pixel_3a_API_34_extension_level_7_x86_64.avd" />
|
||||||
|
</Key>
|
||||||
|
</deviceKey>
|
||||||
|
</Target>
|
||||||
|
</runningDeviceTargetSelectedWithDropDown>
|
||||||
|
<timeTargetWasSelectedWithDropDown value="2024-05-02T15:23:11.192908200Z" />
|
||||||
|
</State>
|
||||||
</entry>
|
</entry>
|
||||||
</value>
|
</value>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
android:name=".RegistrarDActivity"
|
android:name=".RegistrarDActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ConsultarPacientesActivity"
|
android:name="Reports.ConsultarPacientesActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".EliminarActivity"
|
android:name=".EliminarActivity"
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
package com.terratenientes.medicalhealth
|
package Adapters
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.ContentValues
|
import android.content.ContentValues
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.database.sqlite.SQLiteDatabase
|
import android.database.sqlite.SQLiteDatabase
|
||||||
import android.database.sqlite.SQLiteOpenHelper
|
import android.database.sqlite.SQLiteOpenHelper
|
||||||
import android.widget.Toast
|
import Data.Doctor
|
||||||
|
import Data.Paciente
|
||||||
|
|
||||||
class DoctorDataBaseHelper (context: Context) : SQLiteOpenHelper(context, DATABASE_NAME,null,
|
class DoctorDataBaseHelper (context: Context) : SQLiteOpenHelper(context, DATABASE_NAME,null,
|
||||||
DATABASE_VERSION){
|
DATABASE_VERSION
|
||||||
|
){
|
||||||
companion object{
|
companion object{
|
||||||
private const val DATABASE_NAME ="MedicalHealth"
|
private const val DATABASE_NAME ="MedicalHealth"
|
||||||
private const val DATABASE_VERSION=1
|
private const val DATABASE_VERSION=1
|
||||||
|
@ -124,7 +126,7 @@ class DoctorDataBaseHelper (context: Context) : SQLiteOpenHelper(context, DATABA
|
||||||
fun edadPaciente(nombrePaciente : String) : Int{
|
fun edadPaciente(nombrePaciente : String) : Int{
|
||||||
val db=readableDatabase
|
val db=readableDatabase
|
||||||
var edadPaciente =0
|
var edadPaciente =0
|
||||||
val queryEdad= "SELECT ${COLUMN_EDAD} FROM ${TABLE_PACIENTES} WHERE ${COLUMN_NOMBRE_PACIENTE}='${nombrePaciente}'"
|
val queryEdad= "SELECT $COLUMN_EDAD FROM $TABLE_PACIENTES WHERE $COLUMN_NOMBRE_PACIENTE='${nombrePaciente}'"
|
||||||
val cursor = db.rawQuery(queryEdad,null)
|
val cursor = db.rawQuery(queryEdad,null)
|
||||||
if(cursor.moveToFirst()){
|
if(cursor.moveToFirst()){
|
||||||
val columnEdad = cursor.getColumnIndex(COLUMN_EDAD)
|
val columnEdad = cursor.getColumnIndex(COLUMN_EDAD)
|
|
@ -1,5 +1,6 @@
|
||||||
package com.terratenientes.medicalhealth
|
package Adapters
|
||||||
|
|
||||||
|
import Data.Paciente
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
|
@ -1,5 +1,6 @@
|
||||||
package com.terratenientes.medicalhealth
|
package Adapters
|
||||||
|
|
||||||
|
import Data.Receta
|
||||||
import android.content.ContentValues
|
import android.content.ContentValues
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.database.sqlite.SQLiteDatabase
|
import android.database.sqlite.SQLiteDatabase
|
|
@ -1,3 +1,3 @@
|
||||||
package com.terratenientes.medicalhealth
|
package Data
|
||||||
|
|
||||||
data class Doctor(var Cedula : String ,var Nombre : String, var Apellido : String, var Telefono : String, var Consultorio : Int)
|
data class Doctor(var Cedula : String ,var Nombre : String, var Apellido : String, var Telefono : String, var Consultorio : Int)
|
|
@ -1,4 +1,4 @@
|
||||||
package com.terratenientes.medicalhealth
|
package Data
|
||||||
|
|
||||||
data class Paciente(
|
data class Paciente(
|
||||||
var id: Int, // Este campo representa el ID autoincrementable en la base de datos
|
var id: Int, // Este campo representa el ID autoincrementable en la base de datos
|
|
@ -1,3 +1,3 @@
|
||||||
package com.terratenientes.medicalhealth
|
package Data
|
||||||
|
|
||||||
data class Receta(val NombrePaciente : String, val edadPaciente : Int, val pesoPaciente: Double, val nombreMedicamento : String, val fecha : String, val dosis : String, val duracion :String)
|
data class Receta(val NombrePaciente : String, val edadPaciente : Int, val pesoPaciente: Double, val nombreMedicamento : String, val fecha : String, val dosis : String, val duracion :String)
|
|
@ -1,4 +1,4 @@
|
||||||
package com.terratenientes.medicalhealth
|
package Reports
|
||||||
|
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
@ -11,6 +11,11 @@ import android.os.Environment
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.core.app.ActivityCompat
|
import androidx.core.app.ActivityCompat
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import Adapters.DoctorDataBaseHelper
|
||||||
|
import com.terratenientes.medicalhealth.ModificarActivity
|
||||||
|
import Data.Paciente
|
||||||
|
import Adapters.PacienteAdapter
|
||||||
|
import com.terratenientes.medicalhealth.R
|
||||||
import com.terratenientes.medicalhealth.databinding.ActivityConsultarPacientesBinding
|
import com.terratenientes.medicalhealth.databinding.ActivityConsultarPacientesBinding
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileWriter
|
import java.io.FileWriter
|
|
@ -1,16 +1,14 @@
|
||||||
package com.terratenientes.medicalhealth
|
package com.terratenientes.medicalhealth
|
||||||
|
|
||||||
|
import Adapters.DoctorDataBaseHelper
|
||||||
|
import Data.Paciente
|
||||||
import android.R
|
import android.R
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.enableEdgeToEdge
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import com.terratenientes.medicalhealth.databinding.ActivityAgregarPacienteBinding
|
import com.terratenientes.medicalhealth.databinding.ActivityAgregarPacienteBinding
|
||||||
import com.terratenientes.medicalhealth.databinding.ActivityMainBinding
|
|
||||||
|
|
||||||
class AgregarActivity : AppCompatActivity() {
|
class AgregarActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
package com.terratenientes.medicalhealth
|
package com.terratenientes.medicalhealth
|
||||||
|
|
||||||
import android.R
|
import Adapters.DoctorDataBaseHelper
|
||||||
|
import Adapters.PacienteAdapter
|
||||||
|
import Data.Paciente
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
|
||||||
import android.widget.ArrayAdapter
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.enableEdgeToEdge
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import com.terratenientes.medicalhealth.databinding.ActivityAgregarPacienteBinding
|
|
||||||
import com.terratenientes.medicalhealth.databinding.ActivityEliminarPacienteBinding
|
import com.terratenientes.medicalhealth.databinding.ActivityEliminarPacienteBinding
|
||||||
|
|
||||||
class EliminarActivity : AppCompatActivity() {
|
class EliminarActivity : AppCompatActivity() {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.terratenientes.medicalhealth
|
package com.terratenientes.medicalhealth
|
||||||
|
|
||||||
|
import Adapters.DoctorDataBaseHelper
|
||||||
|
import Data.Doctor
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
@ -16,7 +18,7 @@ class MainActivity : AppCompatActivity() {
|
||||||
val view=binding.root
|
val view=binding.root
|
||||||
setContentView(view)
|
setContentView(view)
|
||||||
|
|
||||||
db =DoctorDataBaseHelper(this@MainActivity)
|
db = DoctorDataBaseHelper(this@MainActivity)
|
||||||
binding.btnIniciarSesion.setOnClickListener {
|
binding.btnIniciarSesion.setOnClickListener {
|
||||||
var res=db.validarDatos(binding.tvUsuario.text.toString(),binding.tvContrasena.text.toString())
|
var res=db.validarDatos(binding.tvUsuario.text.toString(),binding.tvContrasena.text.toString())
|
||||||
if(res==true){
|
if(res==true){
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.terratenientes.medicalhealth
|
package com.terratenientes.medicalhealth
|
||||||
|
|
||||||
|
import Adapters.DoctorDataBaseHelper
|
||||||
|
import Data.Paciente
|
||||||
|
import Reports.ConsultarPacientesActivity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package com.terratenientes.medicalhealth
|
package com.terratenientes.medicalhealth
|
||||||
|
|
||||||
|
import Adapters.DoctorDataBaseHelper
|
||||||
|
import Adapters.RecetaDataBaseHelper
|
||||||
|
import Data.Receta
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.database.sqlite.SQLiteOpenHelper
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.AdapterView
|
import android.widget.AdapterView
|
||||||
|
@ -10,8 +12,6 @@ import android.widget.ArrayAdapter
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import com.terratenientes.medicalhealth.databinding.ActivityRecetaBinding
|
import com.terratenientes.medicalhealth.databinding.ActivityRecetaBinding
|
||||||
|
|
||||||
class RecetaActivity : AppCompatActivity(), OnItemSelectedListener {
|
class RecetaActivity : AppCompatActivity(), OnItemSelectedListener {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package com.terratenientes.medicalhealth
|
package com.terratenientes.medicalhealth
|
||||||
|
|
||||||
|
import Adapters.DoctorDataBaseHelper
|
||||||
|
import Data.Doctor
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.enableEdgeToEdge
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowInsetsCompat
|
|
||||||
import com.terratenientes.medicalhealth.databinding.ActivityRegistrarDactivityBinding
|
import com.terratenientes.medicalhealth.databinding.ActivityRegistrarDactivityBinding
|
||||||
|
|
||||||
class RegistrarDActivity : AppCompatActivity() {
|
class RegistrarDActivity : AppCompatActivity() {
|
||||||
|
@ -28,7 +27,7 @@ class RegistrarDActivity : AppCompatActivity() {
|
||||||
val telefono=binding.etTelefonoRegisto.text.toString()
|
val telefono=binding.etTelefonoRegisto.text.toString()
|
||||||
val domicilio = binding.etDomicilio.text.toString()
|
val domicilio = binding.etDomicilio.text.toString()
|
||||||
val contrasena= binding.etContrasenaRegistro.text.toString()
|
val contrasena= binding.etContrasenaRegistro.text.toString()
|
||||||
val usuario=Doctor(cedula,nombre,apellido,telefono,domicilio.toInt())
|
val usuario= Doctor(cedula,nombre,apellido,telefono,domicilio.toInt())
|
||||||
db.agregarDoctores(usuario,contrasena)
|
db.agregarDoctores(usuario,contrasena)
|
||||||
Toast.makeText(this@RegistrarDActivity,"USUARIO AGREGADO",Toast.LENGTH_LONG).show()
|
Toast.makeText(this@RegistrarDActivity,"USUARIO AGREGADO",Toast.LENGTH_LONG).show()
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context=".ConsultarPacientesActivity">
|
tools:context="Reports.ConsultarPacientesActivity">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue