From d7b7cc998e8195a427683ea5a520d7822da604ac Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Mon, 27 Apr 2020 11:34:15 +0300 Subject: [PATCH 1/2] Patiant search --- lib/config/config.dart | 4 + lib/lookups/patient_lookup.dart | 15 +- lib/main.dart | 3 + lib/models/patient_model.dart | 21 +++ lib/providers/patients_provider.dart | 13 +- lib/routes.dart | 6 +- .../patients/TopTenUsersModelResponse.dart | 31 ++++ lib/screens/patients/patiant_info_model.dart | 131 +++++++++++++ .../patients/patient_search_screen.dart | 4 +- .../patients/patients_list_screen.dart | 4 +- lib/screens/patients/patients_screen.dart | 175 +++++++++++++++--- 11 files changed, 374 insertions(+), 33 deletions(-) create mode 100644 lib/screens/patients/TopTenUsersModelResponse.dart create mode 100644 lib/screens/patients/patiant_info_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 2db3184a..ad9ab173 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -3,3 +3,7 @@ const BASE_URL = 'https://hmgwebservices.com/Services/'; const ONLY_NUMBERS = "[0-9]"; 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"]; +//****************** \ No newline at end of file diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index 3770b7ea..fbb382c2 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -1,11 +1,16 @@ const PATIENT_TYPE = const [ - {"text": "outPatiant", "val": "1"}, - {"text": "Tomorrow Patient", "val": "2"}, + {"text": "outPatiant", "val": "0"}, + {"text": "InPatiant", "val": "1"}, + {"text": "Discharge", "val": "2"}, {"text": "Referrd", "val": "3"}, - {"text": "Discharge", "val": "4"}, - {"text": "InPatiant", "val": "5"}, - {"text": "Referral Discharge", "val": "6"}, + {"text": "Referral Discharge", "val": "4"}, + {"text": "Tomorrow Patient", "val": "5"}, + {"text": "Referral", "val": "6"}, + + + + ]; diff --git a/lib/main.dart b/lib/main.dart index 251bea26..4710b91c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -25,6 +25,9 @@ class MyApp extends StatelessWidget { ChangeNotifierProvider.value(value: ProjectsProvider()), ], child: MaterialApp( + //******amjad*****To remove debug app******************* + showSemanticsDebugger: false, + //******************************** title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, diff --git a/lib/models/patient_model.dart b/lib/models/patient_model.dart index eb1b3016..e49f64ea 100644 --- a/lib/models/patient_model.dart +++ b/lib/models/patient_model.dart @@ -20,6 +20,17 @@ class PatientModel { bool IsLoginForDoctorApp; bool PatientOutSA; + + getFirstName() { + return this.FirstName; + } + + setFirstName( FirstName) { + this.FirstName = FirstName; + } + + + PatientModel( {this.ProjectID, this.ClinicID, @@ -41,4 +52,14 @@ class PatientModel { this.SessionID, this.IsLoginForDoctorApp, this.PatientOutSA}); + + + factory PatientModel.fromJson(Map json) => PatientModel( + + FirstName: json["FirstName"], + LastName: json["LasttName"], + + ); } +//*************************** + \ No newline at end of file diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 7ab8abf7..942685da 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -12,8 +12,14 @@ class PatientsProvider with ChangeNotifier { Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); Future getPatientList(PatientModel patient, patientType) async { - const url = - BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient'; + /* const url = + BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient';*/ + // var srvicePatiant = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; + // print("a=SERVICES_PATIANT[patientType]========='=======a"); + int val=int.parse(patientType); + final url = BASE_URL+'DoctorApplication.svc/REST/'+SERVICES_PATIANT[val]; + // print("a===========$url=======a"); + try { final response = await client.post(url, @@ -39,6 +45,9 @@ class PatientsProvider with ChangeNotifier { "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, "PatientOutSA": patient.PatientOutSA })); +//********************** +//*********************** + return Future.value(json.decode(response.body)); } catch (error) { throw error; diff --git a/lib/routes.dart b/lib/routes.dart index be11ee52..0ee97b2f 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/screens/patients/patients_list_screen.dart'; + import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; import './screens/auth/login_screen.dart'; @@ -16,7 +18,7 @@ import './screens/profile_screen.dart'; import './screens/settings/settings_screen.dart'; -const String INIT_ROUTE = LOGIN; +const String INIT_ROUTE = LOGIN;//PATIENT_SEARCH; const String HOME = '/'; const String LOGIN = 'login'; const String PROFILE = 'profile'; @@ -39,7 +41,7 @@ var routes = { PROFILE: (_) => ProfileScreen(), MY_SCHEDULE: (_) => MyScheduleScreen(), PATIENT_SEARCH: (_) => PatientSearchScreen(), - PATIENTS: (_) => PatientsScreen(), + PATIENTS: (_) =>PatientsScreen(), QR_READER: (_) => QrReaderScreen(), BLOOD_BANK: (_) => BloodBankScreen(), DOCTOR_REPLY: (_) => DoctorReplyScreen(), diff --git a/lib/screens/patients/TopTenUsersModelResponse.dart b/lib/screens/patients/TopTenUsersModelResponse.dart new file mode 100644 index 00000000..ba4a5d97 --- /dev/null +++ b/lib/screens/patients/TopTenUsersModelResponse.dart @@ -0,0 +1,31 @@ + +/* + *@author: Amjad Amireh + *@Date:27/4/2020 + *@param: + *@return:pass a List to a List from a JSON + + *@desc: + */ +import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart'; +class TopTenUsersModelResponse { + final List list; + String firstName; + TopTenUsersModelResponse({ + this.list, + this.firstName, + }); + + factory TopTenUsersModelResponse.fromJson(List parsedJson) { + + // List list = new List(); + List list = new List(); + //PatiantInformtion + list = parsedJson.map((i) => PatiantInformtion.fromJson(i)).toList(); + + return new TopTenUsersModelResponse(list: list); + } +} + +class PatiantInformtionl { +} \ No newline at end of file diff --git a/lib/screens/patients/patiant_info_model.dart b/lib/screens/patients/patiant_info_model.dart new file mode 100644 index 00000000..94a5c09d --- /dev/null +++ b/lib/screens/patients/patiant_info_model.dart @@ -0,0 +1,131 @@ +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 + *@param: + *@return:Patian information Model + + *@desc: + */ + + + +class PatiantInformtion { + final List list; + int projectId; + int clinicId; + int doctorId; + int patientId; + String doctorName; + String doctorNameN; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int gender; + String dateofBirth; + String nationalityId; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomId; + String bedId; + String nursingStationId; + String description; + String clinicDescription; + String clinicDescriptionN; + String nationalityName; + String nationalityNameN; + String age; + String genderDescription; + String nursingStationName; + + PatiantInformtion({ + this.list, + this.projectId, + this.clinicId, + this.doctorId, + this.patientId, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.nationalityId, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomId, + this.bedId, + this.nursingStationId, + this.description, + this.clinicDescription, + this.clinicDescriptionN, + this.nationalityName, + this.nationalityNameN, + this.age, + this.genderDescription, + this.nursingStationName, + }); + + factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( + projectId: json["ProjectID"], + clinicId: json["ClinicID"], + doctorId: json["DoctorID"], + patientId: json["PatientID"], + doctorName: json["DoctorName"], + doctorNameN: json["DoctorNameN"], + firstName: json["FirstName"], + middleName: json["MiddleName"], + lastName: json["LastName"], + firstNameN: json["FirstNameN"], + middleNameN: json["MiddleNameN"], + lastNameN: json["LastNameN"], + gender: json["Gender"], + dateofBirth: json["DateofBirth"], + nationalityId: json["NationalityID"], + mobileNumber: json["MobileNumber"], + emailAddress: json["EmailAddress"], + patientIdentificationNo: json["PatientIdentificationNo"], + patientType: json["PatientType"], + admissionNo: json["AdmissionNo"], + admissionDate: json["AdmissionDate"], + roomId: json["RoomID"], + bedId: json["BedID"], + nursingStationId: json["NursingStationID"], + description: json["Description"], + clinicDescription: json["ClinicDescription"], + clinicDescriptionN: json["ClinicDescriptionN"], + nationalityName: json["NationalityName"], + nationalityNameN: json["NationalityNameN"], + age: json["Age"], + genderDescription: json["GenderDescription"], + nursingStationName: json["NursingStationName"], + ); + + + + + + + +} diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 6cd681c7..5e90847c 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -63,13 +63,13 @@ class _PatientSearchScreenState extends State { if (_formKey.currentState.validate()) { // If all data are correct then save data to out variables - _formKey.currentState.save(); + // _formKey.currentState.save(); sharedPref.getString(TOKEN).then((token) { print(token+"EEEEEE"); _patientSearchFormValues.TokenID = token; _patientSearchFormValues.ProjectID= 15; - print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf"); + // print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf"); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, "selectedType": _selectedType diff --git a/lib/screens/patients/patients_list_screen.dart b/lib/screens/patients/patients_list_screen.dart index 33d2cad3..be3b2a86 100644 --- a/lib/screens/patients/patients_list_screen.dart +++ b/lib/screens/patients/patients_list_screen.dart @@ -20,7 +20,6 @@ class _PatientsListScreenState extends State { String patientType = routeArgs['selectedType']; print(patientType); if (_isInit) { - // setState(() {}); PatientsProvider patientsProv = Provider.of(context); patientsProv.getPatientList(patient, patientType).then((res) { // print('MessageStatus${res['MessageStatus']}'); @@ -62,3 +61,6 @@ class _PatientsListScreenState extends State { ); } } +/* +{ProjectID: 15, ClinicID: null, DoctorID: 4709, PatientID: 1288076, DoctorName: SHAZIA MAQSOOD, DoctorNameN: null, FirstName: LAMA, MiddleName: ABDULLAH, LastName: AL-SALOOM, FirstNameN: null, MiddleNameN: null, LastNameN: null, Gender: 2, DateofBirth: /Date(522363600000+0300)/, NationalityID: null, MobileNumber: 0543133371, EmailAddress: Lala_as@hotmail.com, PatientIdentificationNo: 1040451369, PatientType: 1, AdmissionNo: 2020008493, AdmissionDate: /Date(1587589200000+0300)/, RoomID: 119, BedID: 119, NursingStationID: null, Description: null, ClinicDescription: OB-GYNE, ClinicDescriptionN: null, NationalityName: Saudi, NationalityNameN: null, Age: 34 Yr, GenderDescription: Female, NursingStationName: Post Natal Ward – A2} +*/ \ No newline at end of file diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index f4b8516f..5365e27e 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -1,38 +1,171 @@ +/* + *@author: Amjad Amireh Merge to Elham rababah + *@Date:27/4/2020 + *@param: + *@return:PatientsScreen + + *@desc: + */ +import 'package:doctor_app_flutter/models/patient_model.dart'; +import 'package:doctor_app_flutter/providers/patients_provider.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/screens/patients/TopTenUsersModelResponse.dart'; +import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +//************* +import '../../config/size_config.dart'; +import 'package:hexcolor/hexcolor.dart'; +//******** import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/card_with_bg_widget.dart'; -class PatientsScreen extends StatelessWidget { - List litems = [ - "1", - "1", - "1", - ]; +import 'package:doctor_app_flutter/config/config.dart'; + +class PatientsScreen extends StatefulWidget { + @override + _PatientsScreenState createState() => _PatientsScreenState(); +} + +class _PatientsScreenState extends State { + List litems; + //******************* + List responseModelList; + //List> litems2; + //******************* + + + bool _isInit = true; + + var _isLoading = true; + + var _hasError; + //*******Amjad add to search box****** + final _controller = TextEditingController(); + //************** + PatientModel patient; + + @override + void didChangeDependencies() { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + //PatientModel patient = routeArgs['patientSearchForm']; + patient = routeArgs['patientSearchForm']; + + //PatiantInformtion patiantInfo = routeArgs['patientSearchForm']; + + print(patient.TokenID+"EEEEEE"); + String patientType = routeArgs['selectedType']; + 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]];//res['List_MyInPatient']; + //******************** + // litems2=res[SERVICES_PATIANT2[val2]]; + //PatiantInformtion + //List responseModelList = new PatiantInformtion.fromJson(litems).;//TopTenUsersModelResponse.fromJson(parsed).list; + final List parsed = litems;//json.decode(response.body); + //List responseModelList = new TopTenUsersModelResponse.fromJson(parsed).list; + // List responseModelList = new TopTenUsersModelResponse.fromJson(parsed).list; + responseModelList = new TopTenUsersModelResponse.fromJson(parsed).list; + //******************** + _isLoading = false; + _hasError = res['ErrorEndUserMessage']; + + }); + print(res); + }).catchError((error) { + print(error); + }); + } + _isInit = false; + super.didChangeDependencies(); + } + @override Widget build(BuildContext context) { return AppScaffold( appBarTitle: 'Patients', - body: Container( - child: Column( - children: litems.map((item) { - return InkWell( - child: CardWithBgWidget( - line1Text: 'Fahad AlSlehm - 324599', - line2Text: '12/04/2020 - 02:00 PM', - heightPercentage: 0.15, - widthPercentage: 0.80), - onTap: (){ - Navigator.of(context).pushNamed(PATIENTS_PROFILE); - }, - ); - }).toList(), + //***********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: [ + Container( + width: SizeConfig.screenWidth * 0.80, + child: TextField( + controller: _controller, + onSubmitted: (value) { + // fetch all the news related to the keyword + if (value.isNotEmpty) { + // vm.search(value); + } + }, + decoration: buildInputDecoration( + context, 'Search patiant'), + ), + ), + Column(children: responseModelList.map((PatiantInformtion item) { + return InkWell( + child: CardWithBgWidget( + + line1Text:item.nationalityName,//item['FirstName'],//patient.getFirstName(),//item['FirstName'], + line2Text:item.lastName, //responseModelList['LastName'],//item['LastName'],//'12/04/2020 - 02:00 PM', + line3Text: item.middleName, + heightPercentage: 0.15, + widthPercentage: 0.80), + onTap: (){ + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {"patient": responseModelList}); + }, + ); + }).toList()) + ], + + ), ), - ), + ], + )) ); } + + //***********amjad update************* + 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( + borderRadius: BorderRadius.all(Radius.circular(20)), + borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).primaryColor), + )); + } + //************* } + //*********************** + class CustomShapeClipper extends CustomClipper { @override From 691e7dbac64fc1fc68e491bdb8fa02836ddcdb66 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 27 Apr 2020 12:21:00 +0300 Subject: [PATCH 2/2] first step in vital sign and fix some thing in master --- lib/providers/patients_provider.dart | 35 ++++-- lib/routes.dart | 17 ++- lib/screens/patients/patients_screen.dart | 2 +- .../profile/vital_sign/vital_sign_screen.dart | 104 ++++++++++++++++++ .../profile/patient_profile_widget.dart | 35 +++++- .../profile/profile_header_widget.dart | 6 +- .../profile/profile_medical_info_widget.dart | 32 ++++-- lib/widgets/shared/app_scaffold_widget.dart | 2 +- 8 files changed, 198 insertions(+), 35 deletions(-) create mode 100644 lib/screens/patients/profile/vital_sign/vital_sign_screen.dart diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 942685da..e349e024 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -8,19 +8,21 @@ import 'package:http_interceptor/http_client_with_interceptor.dart'; import '../interceptor/http_interceptor.dart'; import '../models/patient_model.dart'; +const GET_PATIENT_VITAL_SIGN = 'Doctors.svc/REST/Doctor_GetPatientVitalSign'; + class PatientsProvider with ChangeNotifier { Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); Future getPatientList(PatientModel patient, patientType) async { - /* const url = + /* const url = BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient';*/ - // var srvicePatiant = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; - // print("a=SERVICES_PATIANT[patientType]========='=======a"); - int val=int.parse(patientType); - final url = BASE_URL+'DoctorApplication.svc/REST/'+SERVICES_PATIANT[val]; - // print("a===========$url=======a"); - - + // var srvicePatiant = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; + // print("a=SERVICES_PATIANT[patientType]========='=======a"); + int val = int.parse(patientType); + final url = + BASE_URL + 'DoctorApplication.svc/REST/' + SERVICES_PATIANT[val]; + // print("a===========$url=======a"); + try { final response = await client.post(url, body: json.encode({ @@ -53,4 +55,21 @@ class PatientsProvider with ChangeNotifier { throw error; } } + +/* + *@author: Elham Rababah + *@Date:27/4/2020 + *@param: + *@return:Future + *@desc: getPatientVitalSign + */ + Future getPatientVitalSign(patient) async { + try { + final response = + await client.post(GET_PATIENT_VITAL_SIGN, body: json.encode(patient)); + return Future.value(json.decode(response.body)); + } catch (error) { + throw error; + } + } } diff --git a/lib/routes.dart b/lib/routes.dart index 0ee97b2f..383a311a 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,6 +1,3 @@ - -import 'package:doctor_app_flutter/screens/patients/patients_list_screen.dart'; - import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; import './screens/auth/login_screen.dart'; @@ -14,17 +11,17 @@ import './screens/my_schedule_screen.dart'; import './screens/patients/patient_profile_screen.dart'; import './screens/patients/patient_search_screen.dart'; import './screens/patients/patients_screen.dart'; +import './screens/patients/profile/vital_sign/vital_sign_screen.dart'; import './screens/profile_screen.dart'; import './screens/settings/settings_screen.dart'; - -const String INIT_ROUTE = LOGIN;//PATIENT_SEARCH; +const String INIT_ROUTE = LOGIN; //PATIENT_SEARCH; const String HOME = '/'; const String LOGIN = 'login'; const String PROFILE = 'profile'; const String CHANGE_PASSWORD = 'change-password'; const String VERIFY_ACCOUNT = 'verify-account'; -const String VERIFICATION_METHODS ='verification-methods'; +const String VERIFICATION_METHODS = 'verification-methods'; const String MY_SCHEDULE = 'my-schedule'; const String QR_READER = 'qr-reader'; const String PATIENT_SEARCH = 'patients/patient-search'; @@ -34,6 +31,7 @@ const String BLOOD_BANK = 'blood-bank'; const String DOCTOR_REPLY = 'doctor-reply'; const String MEDICINE_SEARCH = 'medicine-search'; const String SETTINGS = 'settings'; +const String VITAL_SIGN = 'vital-sign'; var routes = { HOME: (_) => DashboardScreen(), @@ -41,7 +39,7 @@ var routes = { PROFILE: (_) => ProfileScreen(), MY_SCHEDULE: (_) => MyScheduleScreen(), PATIENT_SEARCH: (_) => PatientSearchScreen(), - PATIENTS: (_) =>PatientsScreen(), + PATIENTS: (_) => PatientsScreen(), QR_READER: (_) => QrReaderScreen(), BLOOD_BANK: (_) => BloodBankScreen(), DOCTOR_REPLY: (_) => DoctorReplyScreen(), @@ -49,6 +47,7 @@ var routes = { SETTINGS: (_) => SettingsScreen(), CHANGE_PASSWORD: (_) => ChangePasswordScreen(), VERIFY_ACCOUNT: (_) => VerifyAccountScreen(), - VERIFICATION_METHODS:(_)=> VerificationMethodsScreen(), - PATIENTS_PROFILE:(_)=> PatientProfileScreen() + VERIFICATION_METHODS: (_) => VerificationMethodsScreen(), + PATIENTS_PROFILE: (_) => PatientProfileScreen(), + VITAL_SIGN: (_) => VitalSignScreen() }; diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 5365e27e..f5c2efe2 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -122,7 +122,7 @@ class _PatientsScreenState extends State { line1Text:item.nationalityName,//item['FirstName'],//patient.getFirstName(),//item['FirstName'], line2Text:item.lastName, //responseModelList['LastName'],//item['LastName'],//'12/04/2020 - 02:00 PM', - line3Text: item.middleName, + // line3Text: item.middleName, heightPercentage: 0.15, widthPercentage: 0.80), onTap: (){ diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart new file mode 100644 index 00000000..bc7cf633 --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart @@ -0,0 +1,104 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/models/patient_model.dart'; +import 'package:doctor_app_flutter/providers/patients_provider.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../../../widgets/shared/app_scaffold_widget.dart'; +import '../../../../widgets/shared/card_with_bg_widget.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +/* + *@author: Elham Rababah + *@Date:26/4/2020 + *@param: + *@return:VitalSignScreen + *@desc: VitalSignScreen class + */ +class VitalSignScreen extends StatefulWidget { + @override + _VitalSignScreenState createState() => _VitalSignScreenState(); +} + +class _VitalSignScreenState extends State { + List litems = [ + "1", + "1", + "1", + ]; + + var _isLoading = true; + var _hasError; + var _isInit = true; + + @override + void didChangeDependencies() { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + var patient = routeArgs['patient']; + print(patient); + // String patientType = routeArgs['selectedType']; + // print(patientType); + sharedPref.getString(TOKEN).then((token) { + print(token); + var model = { + "PatientID": patient['PatientID'], + "ProjectID": patient['ProjectID'], + "PatientTypeID": patient['PatientType'], + "InOutPatientType": 1, + "TransNo":patient['AdmissionNo'] !=null ? int.parse(patient['AdmissionNo']) : 0, + "LanguageID": 2, + "stamp": "2020-04-26T09:32:18.317Z", + "IPAdress": "11.11.11.11", + "VersionID": 1.2, + "Channel": 9, + "TokenID": token, + "SessionID": "E2bsEeYEJo", + "IsLoginForDoctorApp": true, + "PatientOutSA": false + }; + if (_isInit) { + PatientsProvider patientsProv = Provider.of(context); + patientsProv.getPatientVitalSign(model).then((res) { + print('wwww'); + debugPrint("${res}"); + setState(() { + _isLoading = false; + _hasError = res['ErrorEndUserMessage']; + }); + print(res); + }).catchError((error) { + print(error); + }); + } + _isInit = false; + }); + + super.didChangeDependencies(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "VITAL SIGN", + body: Container( + child: Column( + children: litems.map((item) { + return InkWell( + child: CardWithBgWidget( + line1Text: 'Fahad AlSlehm - 324599', + line2Text: '12/04/2020 - 02:00 PM', + heightPercentage: 0.15, + widthPercentage: 0.80), + onTap: () { + Navigator.of(context).pushNamed(VITAL_SIGN); + }, + ); + }).toList(), + ), + ), + ); + } +} diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 9a1d3437..c0d09210 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -13,12 +13,43 @@ import './profile_status_info_widget.dart'; *@desc: Patient Profile Widget */ class PatientProfileWidget extends StatelessWidget { + Map patient = { + "ProjectID": 15, + "ClinicID": null, + "DoctorID": 70907, + "PatientID": 3315674, + "DoctorName": "MOQBIL ABDULLAH AL HODAITHY", + "DoctorNameN": null, + "FirstName": "WALEED", + "MiddleName": "ALI", + "LastName": "AL-YAZIDI", + "FirstNameN": null, + "MiddleNameN": null, + "LastNameN": null, + "Gender": 1, + "DateofBirth": "/Date(534286800000+0300)/", + "NationalityID": null, + "MobileNumber": "0500014559", + "EmailAddress": "unknown@unknown.com", + "PatientIdentificationNo": "1063236754", + "NationalityName": "Saudi", + "NationalityNameN": null, + "PatientStatusType": null, + "PatientType": 1, + "AppointmentDate": "/Date(1587848400000+0300)/", + "StartTime": "13:00:00", + "Age": "34 Yr", + "ClinicDescription": "INTERNAL MEDICINE CLINIC", + "GenderDescription": "Male", + "AdmissionDate": "/Date(1587848400000+0300)/", + "AdmissionNo": "2020008652" + }; @override Widget build(BuildContext context) { return ListView(padding: EdgeInsets.zero, children: [ - ProfileHeaderWidget(), + ProfileHeaderWidget(patient: patient), ProfileGeneralInfoWidget(), - ProfileMedicalInfoWidget(), + ProfileMedicalInfoWidget(patient: patient), ProfileStatusInfoWidget() ]); } diff --git a/lib/widgets/patients/profile/profile_header_widget.dart b/lib/widgets/patients/profile/profile_header_widget.dart index 05a132ac..6e3d17c3 100644 --- a/lib/widgets/patients/profile/profile_header_widget.dart +++ b/lib/widgets/patients/profile/profile_header_widget.dart @@ -14,7 +14,9 @@ import '../../shared/profile_image_widget.dart'; class ProfileHeaderWidget extends StatelessWidget { const ProfileHeaderWidget({ Key key, + this.patient }) : super(key: key); + final patient; @override Widget build(BuildContext context) { @@ -23,8 +25,8 @@ class ProfileHeaderWidget extends StatelessWidget { child: ProfileImageWidget( url: "http://images4.fanpop.com/image/photos/16200000/David-Schwimmer-Ross-Geller-ross-geller-16258927-629-779.jpg", - name: "Fahad AlSlehm", - des: "324599", + name: patient['FirstName']+' '+patient['LastName'] , + des: patient['FirstName'], height: SizeConfig.heightMultiplier * 17, width: SizeConfig.heightMultiplier * 17, color: Hexcolor('#58434F')), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 198f6147..c0c2d0fe 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/routes.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -5,7 +6,6 @@ import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; import '../../shared/rounded_container_widget.dart'; - /* *@author: Elham Rababah *@Date:22/4/2020 @@ -14,14 +14,12 @@ import '../../shared/rounded_container_widget.dart'; *@desc: Profile Medical Info Widget */ class ProfileMedicalInfoWidget extends StatelessWidget { - const ProfileMedicalInfoWidget({ - Key key, - }) : super(key: key); - + ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key); + Map patient; @override Widget build(BuildContext context) { String url = "assets/images/"; - final double contWidth = SizeConfig.screenWidth * 0.70; + final double contWidth = SizeConfig.realScreenWidth * 0.70; final double contHeight = SizeConfig.screenHeight * 0.30; return RoundedContainer( @@ -44,11 +42,16 @@ class ProfileMedicalInfoWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - CircleAvatarWidget( - des: 'Vital Sign', - url: url + 'heartbeat.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + InkWell( + onTap: () { + navigator(context,VITAL_SIGN); + }, + child: CircleAvatarWidget( + des: 'Vital Sign', + url: url + 'heartbeat.png', + width: (contWidth) / 3.5, + height: (contWidth) / 3.5, + ), ), CircleAvatarWidget( des: 'Lab Result', @@ -79,6 +82,11 @@ class ProfileMedicalInfoWidget extends StatelessWidget { height: contHeight, ); } + + void navigator(BuildContext context,route) { + Navigator.of(context).pushNamed(VITAL_SIGN, + arguments: {'patient': patient}); + } } class CircleAvatarWidget extends StatelessWidget { @@ -106,7 +114,7 @@ class CircleAvatarWidget extends StatelessWidget { decoration: new BoxDecoration( // color: Colors.green, // border color shape: BoxShape.circle, - border: Border.all(color: Hexcolor('#B7831A'),width: 1.5)), + border: Border.all(color: Hexcolor('#B7831A'), width: 1.5)), child: CircleAvatar( radius: SizeConfig.imageSizeMultiplier * 12, child: Image.asset(url), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 5fd84067..9410f9bf 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -3,9 +3,9 @@ import 'package:hexcolor/hexcolor.dart'; import '../../config/size_config.dart'; import '../../presentation/doctor_app_icons.dart'; -import '../../screens/patients/patients_screen.dart'; import '../../widgets/shared/app_drawer_widget.dart'; import '../../widgets/shared/app_loader_widget.dart'; +import '../../widgets/shared/custom_shape_clipper.dart'; class AppScaffold extends StatelessWidget { bool pageOnly = false;