Add note creator details
This commit is contained in:
@@ -37,6 +37,7 @@ class BuildNotesList extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _BuildNotesListState extends State<BuildNotesList> {
|
class _BuildNotesListState extends State<BuildNotesList> {
|
||||||
|
final noteTitleController = TextEditingController();
|
||||||
final noteTextController = TextEditingController();
|
final noteTextController = TextEditingController();
|
||||||
final businessNameController = TextEditingController();
|
final businessNameController = TextEditingController();
|
||||||
final userNameController = TextEditingController();
|
final userNameController = TextEditingController();
|
||||||
@@ -119,6 +120,7 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
|||||||
|
|
||||||
void viewNotePopUp(Note selectednote) {
|
void viewNotePopUp(Note selectednote) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
noteTitleController.text = selectednote.note_name;
|
||||||
noteTextController.text = selectednote.note_text;
|
noteTextController.text = selectednote.note_text;
|
||||||
businessNameController.text = selectednote.doc_office;
|
businessNameController.text = selectednote.doc_office;
|
||||||
userNameController.text = selectednote.doctor;
|
userNameController.text = selectednote.doctor;
|
||||||
@@ -184,7 +186,17 @@ class _BuildNotesListState extends State<BuildNotesList> {
|
|||||||
width: 700,
|
width: 700,
|
||||||
child: MIHTextField(
|
child: MIHTextField(
|
||||||
controller: dateController,
|
controller: dateController,
|
||||||
hintText: "Created",
|
hintText: "Created Date",
|
||||||
|
editable: false,
|
||||||
|
required: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
SizedBox(
|
||||||
|
width: 700,
|
||||||
|
child: MIHTextField(
|
||||||
|
controller: noteTitleController,
|
||||||
|
hintText: "Note Title",
|
||||||
editable: false,
|
editable: false,
|
||||||
required: false,
|
required: false,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ class _PatientNotesState extends State<PatientNotes> {
|
|||||||
String apiUrlAddNote = "${AppEnviroment.baseApiUrl}/notes/insert/";
|
String apiUrlAddNote = "${AppEnviroment.baseApiUrl}/notes/insert/";
|
||||||
final titleController = TextEditingController();
|
final titleController = TextEditingController();
|
||||||
final noteTextController = TextEditingController();
|
final noteTextController = TextEditingController();
|
||||||
|
final officeController = TextEditingController();
|
||||||
|
final dateController = TextEditingController();
|
||||||
|
final doctorController = TextEditingController();
|
||||||
late Future<List<Note>> futueNotes;
|
late Future<List<Note>> futueNotes;
|
||||||
|
|
||||||
Future<List<Note>> fetchNotes(String endpoint) async {
|
Future<List<Note>> fetchNotes(String endpoint) async {
|
||||||
@@ -61,10 +64,10 @@ class _PatientNotesState extends State<PatientNotes> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> addPatientNoteAPICall() async {
|
Future<void> addPatientNoteAPICall() async {
|
||||||
String title = "";
|
// String title = "";
|
||||||
if (widget.businessUser!.title == "Doctor") {
|
// if (widget.businessUser!.title == "Doctor") {
|
||||||
title = "Dr.";
|
// title = "Dr.";
|
||||||
}
|
// }
|
||||||
var response = await http.post(
|
var response = await http.post(
|
||||||
Uri.parse("${AppEnviroment.baseApiUrl}/notes/insert/"),
|
Uri.parse("${AppEnviroment.baseApiUrl}/notes/insert/"),
|
||||||
headers: <String, String>{
|
headers: <String, String>{
|
||||||
@@ -73,9 +76,8 @@ class _PatientNotesState extends State<PatientNotes> {
|
|||||||
body: jsonEncode(<String, dynamic>{
|
body: jsonEncode(<String, dynamic>{
|
||||||
"note_name": titleController.text,
|
"note_name": titleController.text,
|
||||||
"note_text": noteTextController.text,
|
"note_text": noteTextController.text,
|
||||||
"doc_office": widget.business!.Name,
|
"doc_office": officeController.text,
|
||||||
"doctor":
|
"doctor": doctorController.text,
|
||||||
"$title ${widget.signedInUser.fname} ${widget.signedInUser.lname}",
|
|
||||||
"app_id": widget.selectedPatient.app_id,
|
"app_id": widget.selectedPatient.app_id,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -126,6 +128,18 @@ class _PatientNotesState extends State<PatientNotes> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void addNotePopUp() {
|
void addNotePopUp() {
|
||||||
|
DateTime now = new DateTime.now();
|
||||||
|
DateTime date = new DateTime(now.year, now.month, now.day);
|
||||||
|
var title = "";
|
||||||
|
if (widget.businessUser!.title == "Doctor") {
|
||||||
|
title = "Dr.";
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
officeController.text = widget.business!.Name;
|
||||||
|
doctorController.text =
|
||||||
|
"$title ${widget.signedInUser.fname} ${widget.signedInUser.lname}";
|
||||||
|
dateController.text = date.toString().substring(0, 10);
|
||||||
|
});
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
@@ -159,16 +173,46 @@ class _PatientNotesState extends State<PatientNotes> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 25.0),
|
const SizedBox(height: 25.0),
|
||||||
|
SizedBox(
|
||||||
|
width: 700,
|
||||||
|
child: MIHTextField(
|
||||||
|
controller: officeController,
|
||||||
|
hintText: "Office",
|
||||||
|
editable: false,
|
||||||
|
required: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
SizedBox(
|
||||||
|
width: 700,
|
||||||
|
child: MIHTextField(
|
||||||
|
controller: doctorController,
|
||||||
|
hintText: "Created By",
|
||||||
|
editable: false,
|
||||||
|
required: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
SizedBox(
|
||||||
|
width: 700,
|
||||||
|
child: MIHTextField(
|
||||||
|
controller: dateController,
|
||||||
|
hintText: "Created Date",
|
||||||
|
editable: false,
|
||||||
|
required: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 700,
|
width: 700,
|
||||||
child: MIHTextField(
|
child: MIHTextField(
|
||||||
controller: titleController,
|
controller: titleController,
|
||||||
hintText: "Title of Note",
|
hintText: "Note Title",
|
||||||
editable: true,
|
editable: true,
|
||||||
required: true,
|
required: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 25.0),
|
const SizedBox(height: 10.0),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: MIHMLTextField(
|
child: MIHMLTextField(
|
||||||
controller: noteTextController,
|
controller: noteTextController,
|
||||||
|
|||||||
Reference in New Issue
Block a user