diff --git a/.vscode/settings.json b/.vscode/settings.json index a1b95030..6fa6c5bf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "commentBox.styles": { "defaultStyle": { - "commentStartToken": "/* \n *@author: Elham Rababah \n *@Date:13/4/2020 \n *@param: \n *@return:\n *@desc: ", + "commentStartToken": "/* \n *@author: Amjad Amireh \n *@Date:28/4/2020 \n *@param: \n *@return:\n *@desc: ", "commentEndToken": "\n */", "leftEdgeToken": " * ", "rightEdgeToken": "", diff --git a/lib/config/config.dart b/lib/config/config.dart index ad9ab173..0a0f7715 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,5 +5,7 @@ const ONLY_LETTERS = "[a-zA-Z]"; const ONLY_DATE = "[0-9/]"; //*********change value to decode json from Dropdown ************ var SERVICES_PATIANT = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; -var SERVICES_PATIANT2 = ["List_MyOutPatient", "List_MyInPatient", "List_MyReferredPatient","List_MyReferredPatient","List_MyDischargeReferredPatient","List_MyTomorrowPatient","List_MyReferralPatient"]; +var SERVICES_JSON_PATIANT_LIST = ["List_MyOutPatient", "List_MyInPatient","List_MyDischargePatient" ,"List_MyReferredPatient","List_MyDischargeReferralPatient","List_MyTomorrowPatient","List_MyReferralPatient"]; +var SERVICES_PATIANT_HEADER = ["OutPatient", "InPatient", "Discharge","Referred","Referral Discharge","Tomorrow","Referral"]; + //****************** \ No newline at end of file diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 94a5c09d..ede3b5c3 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,10 +1,5 @@ import 'dart:convert'; -//PatiantInformtion patiantInformtionFromJson(String str) => PatiantInformtion.fromJson(json.decode(str)); - -////String patiantInformtionToJson(PatiantInformtion data) => json.encode(data.toJson()); -//****************************** */ - /* *@author: Amjad Amireh *@Date:27/4/2020 diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index c900a2ff..21ab018a 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -63,6 +63,20 @@ class _PatientSearchScreenState extends State { if (_formKey.currentState.validate()) { // If all data are correct then save data to out variables +<<<<<<< lib/screens/patients/patient_search_screen.dart + // _formKey.currentState.save(); + + sharedPref.getString(TOKEN).then((token) { + _patientSearchFormValues.TokenID = _patientSearchFormValues, + _patientSearchFormValues.ProjectID= _selectedType + + + + Navigator.of(context).pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": _selectedType + }); +======= // _formKey.currentState.save(); String token = await sharedPref.getString(TOKEN); int projectID = await sharedPref.getInt(PROJECT_ID); @@ -72,6 +86,7 @@ class _PatientSearchScreenState extends State { Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, "selectedType": _selectedType +>>>>>>> lib/screens/patients/patient_search_screen.dart }); } else { // If all data are not valid then start auto validation. diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 8b342581..ec375d37 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -33,19 +33,18 @@ class PatientsScreen extends StatefulWidget { class _PatientsScreenState extends State { List litems; - //******************* + List responseModelList; List _locations = ['Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; - //******************* - bool _isInit = true; - + String patientType; + String patientTypetitle; var _isLoading = true; var _hasError; - //*******Amjad add to search box****** + //******* search box****** final _controller = TextEditingController(); //************** PatientModel patient; @@ -53,31 +52,28 @@ class _PatientsScreenState extends State { @override void didChangeDependencies() { final routeArgs = ModalRoute.of(context).settings.arguments as Map; - //PatientModel patient = routeArgs['patientSearchForm']; - patient = routeArgs['patientSearchForm']; - //PatiantInformtion patiantInfo = routeArgs['patientSearchForm']; + patient = routeArgs['patientSearchForm']; print(patient.TokenID + "EEEEEE"); - String patientType = routeArgs['selectedType']; + + patientType = routeArgs['selectedType']; + patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; + print("**************patiant Type**************"); print(patientType); - print("**************test**************"); + if (_isInit) { - // setState(() {}); PatientsProvider patientsProv = Provider.of(context); patientsProv.getPatientList(patient, patientType).then((res) { - // print('MessageStatus${res['MessageStatus']}'); print('List_MyInPatient${(res['List_MyInPatient'])}'); setState(() { int val2 = int.parse(patientType); - litems = res[SERVICES_PATIANT2[val2]]; - //******************** - + litems = res[SERVICES_JSON_PATIANT_LIST[val2]]; + final List parsed = litems; - - responseModelList = - new ModelResponse.fromJson(parsed).list; + + responseModelList = new ModelResponse.fromJson(parsed).list; //******************** _isLoading = false; _hasError = res['ErrorEndUserMessage']; @@ -96,18 +92,15 @@ class _PatientsScreenState extends State { PatientsProvider patientsProv = Provider.of(context); return AppScaffold( - appBarTitle: 'Patients', + appBarTitle: patientTypetitle, //***********Modify by amjad (create List view to insert all new data webservise in scroll )************* body: Container( child: ListView(scrollDirection: Axis.vertical, children: [ Container( - //child:litems == null?Column():Column(children: [ child: litems == null ? Column() : Column( children: [ - //*********change to test screen************* */ - // child:Column(children: [ Padding( padding: EdgeInsets.only( top: MediaQuery.of(context).size.height * 0.03), @@ -168,18 +161,12 @@ class _PatientsScreenState extends State { ]))); } - //***********amjad update************* + //***********amjad update**buildInputDecoration ***to search box******** InputDecoration buildInputDecoration(BuildContext context, hint) { return InputDecoration( prefixIcon: Icon(Icons.search, color: Colors.red), filled: true, fillColor: Colors.white, - //Image.asset(asset), - /* icon: Padding( - padding: const EdgeInsets.all(8.0), - child: Icon(Icons.search), - ),*/ - hintText: hint, hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), enabledBorder: OutlineInputBorder( @@ -192,17 +179,12 @@ class _PatientsScreenState extends State { )); } - //************* Widget _locationBar(BuildContext _context) { - //********* - - //********* return Container( height: MediaQuery.of(context).size.height * 0.065, width: SizeConfig.screenWidth * 0.80, decoration: BoxDecoration( - color: Color(0Xff59434f), //Color.fromARGB(89, 67, 79,0), - borderRadius: BorderRadius.circular(20)), + color: Color(0Xff59434f), borderRadius: BorderRadius.circular(20)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisSize: MainAxisSize.max, @@ -239,4 +221,3 @@ class _PatientsScreenState extends State { )); } } -//***********************