|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../config/shared_pref_kay.dart';
|
|
|
|
@ -30,6 +32,9 @@ class ProgressNoteScreen extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _ProgressNoteState extends State<ProgressNoteScreen> {
|
|
|
|
|
PatientsProvider patientsProv;
|
|
|
|
|
var notesList;
|
|
|
|
|
var filteredNotesList;
|
|
|
|
|
final _controller = TextEditingController();
|
|
|
|
|
var _isInit = true;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -62,6 +67,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
|
|
|
|
|
if (_isInit) {
|
|
|
|
|
patientsProv = Provider.of<PatientsProvider>(context);
|
|
|
|
|
getProgressNoteList(context);
|
|
|
|
|
notesList = patientsProv.patientProgressNoteList;
|
|
|
|
|
}
|
|
|
|
|
_isInit = false;
|
|
|
|
|
}
|
|
|
|
@ -76,60 +82,109 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
|
|
|
|
|
? DrAppCircularProgressIndeicator()
|
|
|
|
|
: patientsProv.isError
|
|
|
|
|
? DrAppEmbeddedError(error: patientsProv.error)
|
|
|
|
|
: patientsProv.patientProgressNoteList.length == 0
|
|
|
|
|
: notesList == null
|
|
|
|
|
? DrAppEmbeddedError(
|
|
|
|
|
error: 'You don\'t have any Progress Note')
|
|
|
|
|
: Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
|
|
|
0,
|
|
|
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
|
|
|
0),
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
itemCount:
|
|
|
|
|
patientsProv.patientProgressNoteList.length,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
backgroundColor: Colors.yellow[200],
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
patientsProv
|
|
|
|
|
.patientProgressNoteList[index]
|
|
|
|
|
["DoctorName"],
|
|
|
|
|
marginTop: 10,
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginBottom: 5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
convertDateFormat(patientsProv
|
|
|
|
|
.patientProgressNoteList[index]
|
|
|
|
|
["AssessmentDate"]),
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
),
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientsProv
|
|
|
|
|
.patientProgressNoteList[index]
|
|
|
|
|
["Notes"],
|
|
|
|
|
margin: 10,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.screenWidth * 0.80,
|
|
|
|
|
margin: EdgeInsets.all(20),
|
|
|
|
|
child: TextField(
|
|
|
|
|
controller: _controller,
|
|
|
|
|
onChanged: (String str) {
|
|
|
|
|
this.searchData(str);
|
|
|
|
|
},
|
|
|
|
|
decoration: buildInputDecoration(
|
|
|
|
|
context, 'Search Patient'),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
|
|
|
0,
|
|
|
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
|
|
|
0),
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
itemCount:
|
|
|
|
|
notesList.length,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
backgroundColor: Colors.yellow[200],
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
notesList[index]
|
|
|
|
|
["DoctorName"],
|
|
|
|
|
marginTop: 10,
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginBottom: 5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
convertDateFormat(notesList[index]
|
|
|
|
|
["AssessmentDate"]),
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
),
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
notesList[index]
|
|
|
|
|
["Notes"],
|
|
|
|
|
margin: 10,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InputDecoration buildInputDecoration(BuildContext context, hint) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
prefixIcon: Icon(Icons.search, color:Colors.black),
|
|
|
|
|
filled: true,
|
|
|
|
|
fillColor: Colors.white,
|
|
|
|
|
hintText: hint,
|
|
|
|
|
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
|
),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(50.0)),
|
|
|
|
|
borderSide: BorderSide(color: Colors.grey), //),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchData(String str) {
|
|
|
|
|
|
|
|
|
|
var strExist = str.length > 0 ? true : false;
|
|
|
|
|
|
|
|
|
|
if(strExist){
|
|
|
|
|
filteredNotesList = null;
|
|
|
|
|
filteredNotesList = notesList.where((note) => note["DoctorName"].toString().contains(str.toUpperCase())).toList();
|
|
|
|
|
setState(() {
|
|
|
|
|
notesList = filteredNotesList;
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
setState(() {
|
|
|
|
|
notesList = patientsProv.patientProgressNoteList;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
convertDateFormat(String str) {
|
|
|
|
|
const start = "/Date(";
|
|
|
|
|
const end = "+0300)";
|
|
|
|
|