progress note

merge-requests/79/head
unknown 4 years ago
parent 7f5831335b
commit 9f4802c225

@ -3,7 +3,7 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z]"; const ONLY_LETTERS = "[a-zA-Z]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; const BASE_URL = 'https://hmgwebservices.com/Services/';
const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems"; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems";
const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient";
@ -50,7 +50,7 @@ var SERVICES_PATIANT_HEADER = [
//****************** //******************
// Colors ////// by : ibrahim // Colors ////// by : ibrahim
const PRIMARY_COLOR = 0xff58434F; const PRIMARY_COLOR = 0xf5f5f5;
const TRANSACTION_NO = 0; const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;

@ -318,7 +318,7 @@ class PatientsProvider with ChangeNotifier {
getPatientInsuranceApprovals(patient) async{ getPatientInsuranceApprovals(patient) async{
//setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response =await AppClient.post(PATIENT_INSURANCE_APPROVALS_URL, body: json.encode(patient)); final response =await AppClient.post(PATIENT_INSURANCE_APPROVALS_URL, body: json.encode(patient));

@ -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/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/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../config/shared_pref_kay.dart'; import '../../../config/shared_pref_kay.dart';
@ -30,6 +32,9 @@ class ProgressNoteScreen extends StatefulWidget {
class _ProgressNoteState extends State<ProgressNoteScreen> { class _ProgressNoteState extends State<ProgressNoteScreen> {
PatientsProvider patientsProv; PatientsProvider patientsProv;
var notesList;
var filteredNotesList;
final _controller = TextEditingController();
var _isInit = true; var _isInit = true;
/* /*
@ -62,6 +67,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
if (_isInit) { if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context); patientsProv = Provider.of<PatientsProvider>(context);
getProgressNoteList(context); getProgressNoteList(context);
notesList = patientsProv.patientProgressNoteList;
} }
_isInit = false; _isInit = false;
} }
@ -76,59 +82,108 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error) ? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.patientProgressNoteList.length == 0 : notesList == null
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: 'You don\'t have any Progress Note') error: 'You don\'t have any Progress Note')
: Container( : Column(
margin: EdgeInsets.fromLTRB( children: <Widget>[
SizeConfig.realScreenWidth * 0.05, Container(
0, width: SizeConfig.screenWidth * 0.80,
SizeConfig.realScreenWidth * 0.05, margin: EdgeInsets.all(20),
0), child: TextField(
child: ListView.builder( controller: _controller,
itemCount: onChanged: (String str) {
patientsProv.patientProgressNoteList.length, this.searchData(str);
itemBuilder: (BuildContext ctxt, int index) { },
return RoundedContainer( decoration: buildInputDecoration(
backgroundColor: Colors.yellow[200], context, 'Search Patient'),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: <Widget>[ Expanded(
AppText( child: Container(
patientsProv margin: EdgeInsets.fromLTRB(
.patientProgressNoteList[index] SizeConfig.realScreenWidth * 0.05,
["DoctorName"], 0,
marginTop: 10, SizeConfig.realScreenWidth * 0.05,
marginLeft: 10, 0),
marginBottom: 5, child: ListView.builder(
fontWeight: FontWeight.bold, itemCount:
), notesList.length,
AppText( itemBuilder: (BuildContext ctxt, int index) {
convertDateFormat(patientsProv return RoundedContainer(
.patientProgressNoteList[index] backgroundColor: Colors.yellow[200],
["AssessmentDate"]), child: Column(
marginLeft: 10, crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.grey[600], children: <Widget>[
), AppText(
Divider( notesList[index]
color: Colors.black, ["DoctorName"],
height: 20, marginTop: 10,
thickness: 1, marginLeft: 10,
indent: 0, marginBottom: 5,
endIndent: 0, fontWeight: FontWeight.bold,
), ),
AppText( AppText(
patientsProv convertDateFormat(notesList[index]
.patientProgressNoteList[index] ["AssessmentDate"]),
["Notes"], marginLeft: 10,
margin: 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) { convertDateFormat(String str) {
const start = "/Date("; const start = "/Date(";

Loading…
Cancel
Save