Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 17 additions & 23 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,15 @@
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- For reading images -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

<!-- For reading videos -->
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.CAMERA" />


<!-- For reading audio -->
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />

<!-- Add WRITE permissions only if necessary -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<!-- Add the permission here -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<!-- Application -->
<application
android:name=".GuardianApplication"
android:allowBackup="false"
Expand All @@ -32,11 +24,12 @@
android:label="Guardians"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:theme="@style/Theme.GopherGuardian"
android:usesCleartextTraffic="true"
tools:replace="android:allowBackup,android:label"
tools:targetApi="31"
tools:ignore="ExtraText">

<activity
android:name=".WelcomeActivity"
android:exported="false" />
Expand All @@ -45,15 +38,16 @@
android:exported="false" />
<activity
android:name=".Training2"
android:exported="false"></activity>
android:exported="false" />
<activity
android:name=".Training"
android:exported="false" />

<activity
android:name=".view.patient.patientdata.heartrate.HeartRateActivity"
android:exported="false"
android:label="@string/title_activity_heart_rate"
android:theme="@style/Theme.TeamGuardians" />
android:label="@string/title_activity_heart_rate" />

<activity
android:name=".view.general.Setting"
android:exported="false" />
Expand All @@ -63,6 +57,9 @@
<activity
android:name=".view.general.Homepage4admin"
android:exported="false" />
<activity
android:name=".view.general.Homepage4doctor"
android:exported="false" />
<activity
android:name=".view.general.Homepage4caretaker"
android:exported="false" />
Expand Down Expand Up @@ -162,16 +159,18 @@
android:exported="false" />
<activity
android:name=".view.general.AddNewPatientActivity"
android:exported="false" /> <!-- Kussay: may we need to change the start up page into login page -->
android:exported="false" />

<!-- Main entry point -->
<activity
android:name=".view.general.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> <!-- These are here only for UI testing -->
</activity>

<activity
android:name=".view.patient.patientdata.medicaldiagnostics.MedicalDiagnosticsActivity"
android:exported="false" />
Expand All @@ -186,19 +185,15 @@
android:exported="false" />

<activity android:name=".ModulesActivity" />


<activity android:name=".Module1CoursesActivity" />
<activity android:name=".HomecareInductionActivity" />
<activity android:name=".InfectionControlActivity" />
<activity android:name=".SupportingMealtimesActivity" />


<activity android:name=".Module2CoursesActivity" />
<activity android:name=".MedicationTechniqueActivity" />
<activity android:name=".MedicationSafetyActivity" />


<activity android:name=".Module3CoursesActivity" />
<activity android:name=".InspiringLeadershipEIActivity" />
<activity android:name=".EmotionalIntelligenceCommunicationActivity" />
Expand All @@ -212,7 +207,6 @@
android:exported="false"
android:label="Patient Exercise Modules" />


<service
android:name=".model.FirebaseMessagingService"
android:exported="false">
Expand All @@ -226,6 +220,6 @@
android:resource="@array/preloaded_fonts" />

<activity android:name=".view.general.DashboardActivity"/>
</application>

</manifest>
</application>
</manifest>
13 changes: 13 additions & 0 deletions app/src/main/java/deakin/gopher/guardian/model/Doctor.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package deakin.gopher.guardian.model

import java.io.Serializable

data class Doctor(
var id: String? = null,
var fullName: String? = null,
var specialization: String? = null,
var phone: String? = null,
var email: String? = null,
var hospital: String? = null,
var assignedPatients: List<String>? = null,
) : Serializable
6 changes: 6 additions & 0 deletions app/src/main/java/deakin/gopher/guardian/model/login/Role.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@ sealed class Role(val name: String) : Serializable {
private fun readResolve(): Any = Nurse
}

data object Doctor : Role(R.string.doctor_role_name.toString().lowercase()) {
private fun readResolve(): Any = Doctor
}

companion object {
private const val CARETAKER_ROLE = "caretaker"
private const val ADMIN_ROLE = "admin"
private const val NURSE_ROLE = "nurse"
private const val DOCTOR_ROLE = "doctor"

fun create(name: String): Role {
return when (name.lowercase()) {
CARETAKER_ROLE.lowercase() -> Caretaker
ADMIN_ROLE.lowercase() -> Admin
NURSE_ROLE.lowercase() -> Nurse
DOCTOR_ROLE.lowercase() -> Doctor
else -> throw IllegalArgumentException("Unknown role: $name")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Intent
import deakin.gopher.guardian.model.login.Role
import deakin.gopher.guardian.view.general.Homepage4admin
import deakin.gopher.guardian.view.general.Homepage4caretaker
import deakin.gopher.guardian.view.general.Homepage4doctor
import deakin.gopher.guardian.view.general.Homepage4nurse
import deakin.gopher.guardian.view.general.LoginActivity
import deakin.gopher.guardian.view.general.PatientListActivity
Expand Down Expand Up @@ -43,6 +44,15 @@ class NavigationService(val activity: Activity) {
),
)
}

Role.Doctor -> {
activity.startActivity(
Intent(
activity.applicationContext,
Homepage4doctor::class.java,
),
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import retrofit2.converter.gson.GsonConverterFactory

object RetrofitClient {
// private const val BASE_URL = "http://10.0.2.2:3000/api/v1/"
private const val BASE_URL = "https://guardian-backend-opal.vercel.app/api/v1/"
private const val BASE_URL = "https://guardian-backend-x5v6.vercel.app/api/v1/"

private val client = OkHttpClient()
private val interceptor = HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package deakin.gopher.guardian.view.caretaker

import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import deakin.gopher.guardian.R

class PrescriptionActivity : AppCompatActivity() {
private lateinit var patientNameEditText: EditText
private lateinit var patientDobEditText: EditText
private lateinit var patientGenderEditText: EditText
private lateinit var drugNameEditText: EditText
private lateinit var dosageEditText: EditText
private lateinit var durationEditText: EditText
private lateinit var instructionsEditText: EditText
private lateinit var checkPrescriptionButton: Button
private lateinit var assignPrescriptionButton: Button

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_prescription)

// Initialize views
patientNameEditText = findViewById(R.id.etPatientName)
patientDobEditText = findViewById(R.id.etPatientDob)
patientGenderEditText = findViewById(R.id.etPatientGender)
drugNameEditText = findViewById(R.id.etDrugName)
dosageEditText = findViewById(R.id.etDosage)
durationEditText = findViewById(R.id.etDuration)
instructionsEditText = findViewById(R.id.etInstructions)
checkPrescriptionButton = findViewById(R.id.btnCheckPrescription)
assignPrescriptionButton = findViewById(R.id.btnAssignPrescription)

// Button listeners
checkPrescriptionButton.setOnClickListener {
// Placeholder logic for checking prescription
Toast.makeText(this, "Checking existing prescriptions...", Toast.LENGTH_SHORT).show()
}

assignPrescriptionButton.setOnClickListener {
val patientName = patientNameEditText.text.toString().trim()
val drugName = drugNameEditText.text.toString().trim()

if (patientName.isEmpty() || drugName.isEmpty()) {
Toast.makeText(this, "Please fill all mandatory fields", Toast.LENGTH_SHORT).show()
} else {
// Placeholder for saving prescription
Toast.makeText(
this,
"Prescription assigned to $patientName for $drugName",
Toast.LENGTH_LONG,
).show()
}
}
}
}
Loading