display patient information in queue
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:patient_manager/components/mihWarningMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
@@ -49,15 +50,29 @@ class _BuildPatientsListState extends State<BuildPatientQueueList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget displayQueue(int index) {
|
Widget displayQueue(int index) {
|
||||||
|
String fname = widget.patientQueue[index].first_name[0] + "********";
|
||||||
|
String lname = widget.patientQueue[index].last_name[0] + "********";
|
||||||
String title =
|
String title =
|
||||||
widget.patientQueue[index].date_time.split('T')[1].substring(0, 5);
|
widget.patientQueue[index].date_time.split('T')[1].substring(0, 5);
|
||||||
String subtitle =
|
String subtitle = "";
|
||||||
"Name: ${widget.patientQueue[index].first_name} ${widget.patientQueue[index].last_name}\nID No.: ${widget.patientQueue[index].id_no}\nMedical Aid No: ";
|
|
||||||
if (widget.patientQueue[index].medical_aid_no == "") {
|
if (widget.patientQueue[index].access == "pending") {
|
||||||
subtitle += "No Medical Aid";
|
subtitle +=
|
||||||
|
"Name: $fname $lname\nID No.: ${widget.patientQueue[index].id_no}\nMedical Aid No: ";
|
||||||
|
subtitle += "********";
|
||||||
} else {
|
} else {
|
||||||
subtitle += widget.patientQueue[index].medical_aid_no;
|
subtitle +=
|
||||||
|
"Name: ${widget.patientQueue[index].first_name} ${widget.patientQueue[index].last_name}\nID No.: ${widget.patientQueue[index].id_no}\nMedical Aid No: ";
|
||||||
|
if (widget.patientQueue[index].medical_aid_no == "") {
|
||||||
|
subtitle += "No Medical Aid";
|
||||||
|
} else {
|
||||||
|
subtitle +=
|
||||||
|
"Name: $fname $lname\nID No.: ${widget.patientQueue[index].id_no}\nMedical Aid No: ";
|
||||||
|
subtitle += widget.patientQueue[index].medical_aid_no;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
subtitle +=
|
||||||
|
"\nAccess Request: ${widget.patientQueue[index].access.toUpperCase()}";
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
"Appointment: $title",
|
"Appointment: $title",
|
||||||
@@ -72,17 +87,21 @@ class _BuildPatientsListState extends State<BuildPatientQueueList> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Patient selectedPatient;
|
if (widget.patientQueue[index].access != "pending") {
|
||||||
fetchPatients(widget.patientQueue[index].app_id).then(
|
Patient selectedPatient;
|
||||||
(result) {
|
fetchPatients(widget.patientQueue[index].app_id).then(
|
||||||
setState(() {
|
(result) {
|
||||||
selectedPatient = result;
|
setState(() {
|
||||||
Navigator.of(context).pushNamed('/patient-manager/patient',
|
selectedPatient = result;
|
||||||
arguments: PatientViewArguments(
|
Navigator.of(context).pushNamed('/patient-manager/patient',
|
||||||
widget.signedInUser, selectedPatient, "business"));
|
arguments: PatientViewArguments(
|
||||||
});
|
widget.signedInUser, selectedPatient, "business"));
|
||||||
},
|
});
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
noAccessWarning();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
trailing: Icon(
|
trailing: Icon(
|
||||||
Icons.arrow_forward,
|
Icons.arrow_forward,
|
||||||
@@ -91,6 +110,15 @@ class _BuildPatientsListState extends State<BuildPatientQueueList> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void noAccessWarning() {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return const MIHWarningMessage(warningType: "No Access");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
|
|||||||
Reference in New Issue
Block a user