diff --git a/lib/config/config.dart b/lib/config/config.dart index 8ebef939..6b269bad 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -3,7 +3,7 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z]"; 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_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; @@ -50,7 +50,7 @@ var SERVICES_PATIANT_HEADER = [ //****************** // Colors ////// by : ibrahim -const PRIMARY_COLOR = 0xff58434F; +const PRIMARY_COLOR = 0xf5f5f5; const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index dbf68203..c5f92247 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -318,7 +318,7 @@ class PatientsProvider with ChangeNotifier { getPatientInsuranceApprovals(patient) async{ - //setBasicData(); + setBasicData(); try { if (await Helpers.checkConnection()) { final response =await AppClient.post(PATIENT_INSURANCE_APPROVALS_URL, body: json.encode(patient)); diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart index 7381e85b..428de7c5 100644 --- a/lib/screens/patients/profile/progress_note_screen.dart +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -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 { PatientsProvider patientsProv; + var notesList; + var filteredNotesList; + final _controller = TextEditingController(); var _isInit = true; /* @@ -62,6 +67,7 @@ class _ProgressNoteState extends State { if (_isInit) { patientsProv = Provider.of(context); getProgressNoteList(context); + notesList = patientsProv.patientProgressNoteList; } _isInit = false; } @@ -76,59 +82,108 @@ class _ProgressNoteState extends State { ? 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: [ - 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: [ + 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: [ + 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(";