diff --git a/lib/models/patient/prescription_req_model.dart b/lib/models/patient/prescription_req_model.dart index e69de29b..a4bfe1b7 100644 --- a/lib/models/patient/prescription_req_model.dart +++ b/lib/models/patient/prescription_req_model.dart @@ -0,0 +1,64 @@ +class PrescriptionReqModel { + int patientID; + int setupID; + int projectID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + + PrescriptionReqModel( + {this.patientID, + this.setupID, + this.projectID, + this.languageID, + this.stamp = '2020-04-26T09:32:18.317Z', + this.iPAdress = '11.11.11.11', + this.versionID = 1.2, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.tokenID, + this.isLoginForDoctorApp = true, + this.patientOutSA = false, + this.patientTypeID}); + + PrescriptionReqModel.fromJson(Map json) { + patientID = json['PatientID']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/models/patient/prescription_res_model.dart b/lib/models/patient/prescription_res_model.dart index 3b57a845..5ff08e3e 100644 --- a/lib/models/patient/prescription_res_model.dart +++ b/lib/models/patient/prescription_res_model.dart @@ -1,64 +1,144 @@ -class PrescriptionReqModel { - int patientID; - int setupID; +class PrescriptionResModel { + String setupID; int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int patientID; + int appointmentNo; + String appointmentDate; + String doctorName; + String clinicDescription; + String name; + int episodeID; + int actualDoctorRate; + int admission; + int clinicID; + String companyName; + String despensedStatus; + String dischargeDate; + int dischargeNo; + int doctorID; + String doctorImageURL; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isInsurancePatient; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + List speciality; - PrescriptionReqModel( - {this.patientID, - this.setupID, + PrescriptionResModel( + {this.setupID, this.projectID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.patientID, + this.appointmentNo, + this.appointmentDate, + this.doctorName, + this.clinicDescription, + this.name, + this.episodeID, + this.actualDoctorRate, + this.admission, + this.clinicID, + this.companyName, + this.despensedStatus, + this.dischargeDate, + this.dischargeNo, + this.doctorID, + this.doctorImageURL, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isInsurancePatient, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.qR, + this.speciality}); - PrescriptionReqModel.fromJson(Map json) { - patientID = json['PatientID']; + PrescriptionResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; - languageID = json['LanguageID']; - stamp = json['stamp']; - iPAdress = json['IPAdress']; - versionID = json['VersionID']; - channel = json['Channel']; - tokenID = json['TokenID']; - sessionID = json['SessionID']; - isLoginForDoctorApp = json['IsLoginForDoctorApp']; - patientOutSA = json['PatientOutSA']; - patientTypeID = json['PatientTypeID']; + patientID = json['PatientID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + doctorName = json['DoctorName']; + clinicDescription = json['ClinicDescription']; + name = json['Name']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + admission = json['Admission']; + clinicID = json['ClinicID']; + companyName = json['CompanyName']; + despensedStatus = json['Despensed_Status']; + dischargeDate = json['DischargeDate']; + dischargeNo = json['DischargeNo']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isInsurancePatient = json['IsInsurancePatient']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + qR = json['QR']; + speciality = json['Speciality'].cast(); } Map toJson() { final Map data = new Map(); - data['PatientID'] = this.patientID; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; - data['LanguageID'] = this.languageID; - data['stamp'] = this.stamp; - data['IPAdress'] = this.iPAdress; - data['VersionID'] = this.versionID; - data['Channel'] = this.channel; - data['TokenID'] = this.tokenID; - data['SessionID'] = this.sessionID; - data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; - data['PatientOutSA'] = this.patientOutSA; - data['PatientTypeID'] = this.patientTypeID; + data['PatientID'] = this.patientID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['DoctorName'] = this.doctorName; + data['ClinicDescription'] = this.clinicDescription; + data['Name'] = this.name; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['Admission'] = this.admission; + data['ClinicID'] = this.clinicID; + data['CompanyName'] = this.companyName; + data['Despensed_Status'] = this.despensedStatus; + data['DischargeDate'] = this.dischargeDate; + data['DischargeNo'] = this.dischargeNo; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsInsurancePatient'] = this.isInsurancePatient; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; return data; } } diff --git a/lib/models/patient/radiology_req_model.dart b/lib/models/patient/radiology_req_model.dart new file mode 100644 index 00000000..35b398bf --- /dev/null +++ b/lib/models/patient/radiology_req_model.dart @@ -0,0 +1,60 @@ +class RadiologyReqModel { + int patientID; + int projectID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + + RadiologyReqModel( + {this.patientID, + this.projectID, + this.languageID, + this.stamp = '2020-04-26T09:32:18.317Z', + this.iPAdress = '11.11.11.11', + this.versionID = 1.2, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.tokenID, + this.isLoginForDoctorApp = true, + this.patientOutSA = false, + this.patientTypeID}); + + RadiologyReqModel.fromJson(Map json) { + patientID = json['PatientID']; + projectID = json['ProjectID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/models/patient/radiology_res_model.dart b/lib/models/patient/radiology_res_model.dart new file mode 100644 index 00000000..45161195 --- /dev/null +++ b/lib/models/patient/radiology_res_model.dart @@ -0,0 +1,72 @@ +class RadiologyResModel { + String setupID; + int projectID; + int patientID; + int invoiceLineItemNo; + int invoiceNo; + String reportData; + String imageURL; + int clinicId; + int doctorId; + String reportDate; + String clinicName; + String doctorImageURL; + String doctorName; + String projectName; + Null statusDescription; + + RadiologyResModel( + {this.setupID, + this.projectID, + this.patientID, + this.invoiceLineItemNo, + this.invoiceNo, + this.reportData, + this.imageURL, + this.clinicId, + this.doctorId, + this.reportDate, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.projectName, + this.statusDescription}); + + RadiologyResModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + invoiceLineItemNo = json['InvoiceLineItemNo']; + invoiceNo = json['InvoiceNo']; + reportData = json['ReportData']; + imageURL = json['ImageURL']; + clinicId = json['ClinicId']; + doctorId = json['DoctorId']; + reportDate = json['ReportDate']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + projectName = json['ProjectName']; + statusDescription = json['StatusDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['InvoiceLineItemNo'] = this.invoiceLineItemNo; + data['InvoiceNo'] = this.invoiceNo; + data['ReportData'] = this.reportData; + data['ImageURL'] = this.imageURL; + data['ClinicId'] = this.clinicId; + data['DoctorId'] = this.doctorId; + data['ReportDate'] = this.reportDate; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['ProjectName'] = this.projectName; + data['StatusDescription'] = this.statusDescription; + return data; + } +} diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 2d97c48f..ce00c085 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -2,6 +2,9 @@ import 'dart:convert'; import 'package:doctor_app_flutter/models/patient/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/prescription_req_model.dart'; +import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart'; +import 'package:doctor_app_flutter/models/patient/radiology_res_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; @@ -16,13 +19,18 @@ import '../util/helpers.dart'; const GET_PATIENT_VITAL_SIGN = BASE_URL + 'Doctors.svc/REST/Doctor_GetPatientVitalSign'; const GET_PATIENT_LAB_OREDERS =BASE_URL + 'DoctorApplication.svc/REST/GetPatientLabOreders'; - +const GET_PRESCRIPTION =BASE_URL+'Patients.svc/REST/GetPrescriptionApptList'; +const GET_RADIOLOGY = BASE_URL+'DoctorApplication.svc/REST/GetPatientRadResult'; class PatientsProvider with ChangeNotifier { bool isLoading = true; bool isError = false; String error = ''; List patientVitalSignList = []; List patientLabResultOrdersList = []; + List patientPrescriptionsList = []; + List patientRadiologyList = []; + + Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); @@ -74,8 +82,8 @@ class PatientsProvider with ChangeNotifier { /* *@author: Elham Rababah *@Date:27/4/2020 - *@param: - *@return:Future + *@param: patient + *@return: *@desc: getPatientVitalSign */ getPatientVitalSign(patient) async { @@ -125,8 +133,8 @@ class PatientsProvider with ChangeNotifier { /*@author: Elham Rababah *@Date:27/4/2020 - *@param: - *@return:Future + *@param: patient + *@return: *@desc: getLabResult Orders */ getLabResultOrders(patient) async { @@ -164,4 +172,90 @@ class PatientsProvider with ChangeNotifier { throw error; } } + +/*@author: Elham Rababah + *@Date:3/5/2020 + *@param: patient + *@return: + *@desc: getPatientPrescriptions + */ +getPatientPrescriptions(patient) async { + try { + if (await Helpers.checkConnection()) { + final response = await client.post(GET_PRESCRIPTION, + body: json.encode(patient)); + final int statusCode = response.statusCode; + isLoading = false; + + if (statusCode < 200 || statusCode >= 400 || json == null) { + isError = true; + error = 'Error While Fetching data'; + } else { + var res = json.decode(response.body); + print('$res'); + if (res['MessageStatus'] == 1) { + patientPrescriptionsList = []; + print("res['PatientPrescriptionList']"); + res['PatientPrescriptionList'].forEach((v) { + patientPrescriptionsList.add(new PrescriptionResModel.fromJson(v)); + }); + } else { + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; + } + } + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; + } + notifyListeners(); + } catch (error) { + throw error; + } + } + +/*@author: Elham Rababah + *@Date:3/5/2020 + *@param: patient + *@return: + *@desc: getPatientRadiology + */ +getPatientRadiology(patient) async { + try { + if (await Helpers.checkConnection()) { + final response = await client.post(GET_RADIOLOGY, + body: json.encode(patient)); + final int statusCode = response.statusCode; + isLoading = false; + + if (statusCode < 200 || statusCode >= 400 || json == null) { + isError = true; + error = 'Error While Fetching data'; + } else { + var res = json.decode(response.body); + print('$res'); + if (res['MessageStatus'] == 1) { + patientRadiologyList = []; + print("res['List_GetRadOreders']"); + res['List_GetRadOreders'].forEach((v) { + patientRadiologyList.add(new RadiologyResModel .fromJson(v)); + }); + } else { + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; + } + } + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; + } + notifyListeners(); + } catch (error) { + throw error; + } + } + + } diff --git a/lib/routes.dart b/lib/routes.dart index 9c135640..b56ae070 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,10 +1,3 @@ -import 'package:doctor_app_flutter/screens/doctor/message_screen.dart'; -import 'package:doctor_app_flutter/screens/doctor/services_screen.dart'; - -import './screens/doctor/my_schedule_screen.dart'; - -import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; - import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; import './screens/auth/login_screen.dart'; @@ -12,16 +5,23 @@ import './screens/auth/verification_methods_screen.dart'; import './screens/auth/verify_account_screen.dart'; import './screens/blood_bank_screen.dart'; import './screens/dashboard_screen.dart'; -import 'screens/doctor/doctor_reply_screen.dart'; +import './screens/doctor/message_screen.dart'; +import './screens/doctor/my_schedule_screen.dart'; +import './screens/doctor/services_screen.dart'; import './screens/medicine/medicine_search_screen.dart'; -import './screens/patients/profile/patient_profile_screen.dart'; +import './screens/medicine/pharmacies_list_screen.dart'; import './screens/patients/patient_search_screen.dart'; import './screens/patients/patients_screen.dart'; +import './screens/patients/profile/lab_result/lab_orders_screen.dart'; +import './screens/patients/profile/patient_profile_screen.dart'; +import './screens/patients/profile/prescriptions/prescriptions_screen.dart'; +import './screens/patients/profile/radiology/radiology_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_screen.dart'; import './screens/profile_screen.dart'; import './screens/settings/settings_screen.dart'; +import 'screens/doctor/doctor_reply_screen.dart'; -const String INIT_ROUTE = LOGIN; +const String INIT_ROUTE = PATIENT_SEARCH; const String HOME = '/'; const String LOGIN = 'login'; const String PROFILE = 'profile'; @@ -41,6 +41,10 @@ const String MESSAGES = 'messages'; const String SERVICES = 'services'; const String SETTINGS = 'settings'; const String VITAL_SIGN = 'vital-sign'; +const String LAB_ORDERS = 'lab_orders'; +const String PRESCRIPTIONS = 'Prescription'; +const String RADIOLOGY = 'Radiology'; + var routes = { HOME: (_) => DashboardScreen(), @@ -61,5 +65,8 @@ var routes = { PHARMACIES_LIST: (_) => PharmaciesListScreen(itemID: null,), VITAL_SIGN: (_) => VitalSignScreen(), MESSAGES: (_) => MessagesScreen(), - SERVICES: (_) => ServicesScreen() + SERVICES: (_) => ServicesScreen(), + LAB_ORDERS:(_)=>LabOrdersScreen(), + PRESCRIPTIONS:(_)=>PrescriptionScreen(), + RADIOLOGY:(_)=>RadiologyScreen() }; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index f69a809d..39da40e8 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -70,7 +70,7 @@ class _PatientSearchScreenState extends State { String token = await sharedPref.getString(TOKEN); int projectID = await sharedPref.getInt(PROJECT_ID); _patientSearchFormValues.TokenID = token; - _patientSearchFormValues.ProjectID = projectID; + _patientSearchFormValues.ProjectID = 2;//projectID; // print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf"); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, diff --git a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart new file mode 100644 index 00000000..ab1769d7 --- /dev/null +++ b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart @@ -0,0 +1,161 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/prescription_req_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../../../config/shared_pref_kay.dart'; +import '../../../../models/patient/vital_sign_req_model.dart'; +import '../../../../providers/patients_provider.dart'; + +import '../../../../util/dr_app_shared_pref.dart'; +import '../../../../widgets/shared/app_scaffold_widget.dart'; +import '../../../../widgets/shared/card_with_bg_widget.dart'; +import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +/* + *@author: Elham Rababah + *@Date:26/4/2020 + *@param: + *@return:PrescriptionScreen + *@desc: PrescriptionScreen class + */ + +class PrescriptionScreen extends StatefulWidget { + @override + _PrescriptionScreenState createState() => _PrescriptionScreenState(); +} + +class _PrescriptionScreenState extends State { + PatientsProvider patientsProv; + var _isInit = true; + + /* + *@author: Elham Rababah + *@Date:28/4/2020 + *@param: context + *@return: + *@desc: getPrescriptionsList Function + */ + getPrescriptionsList(context) async { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String token = await sharedPref.getString(TOKEN); + // String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + // int inOutpatientType = 1; + // if (type == '0') { + // inOutpatientType = 2; + // } + // print(type); + PrescriptionReqModel prescriptionReqModel = PrescriptionReqModel( + patientID: patient.patientId, + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2, + setupID: 0 + ); + patientsProv.getPatientPrescriptions(prescriptionReqModel.toJson()); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + getPrescriptionsList(context); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Prescriptions", + showAppDrawer: false, + showBottomBar: false, + body: patientsProv.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProv.isError + ? Center( + child: Text( + patientsProv.error, + style: TextStyle(color: Theme.of(context).errorColor), + ), + ) + : patientsProv.patientPrescriptionsList.length == 0 + ? Center( + child: Text( + 'You don\'t have any Prescriptions', + style: TextStyle(color: Theme.of(context).errorColor), + ), + ) + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: patientsProv.patientPrescriptionsList.length, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + child: CardWithBgWidget( + widget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + CircleAvatar( + radius: + SizeConfig.imageSizeMultiplier * + 12, + backgroundImage: NetworkImage( + patientsProv + .patientPrescriptionsList[index] + .doctorImageURL), + backgroundColor: Colors.transparent, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 8, 0, 0, 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + '${patientsProv.patientPrescriptionsList[index].doctorName}', + fontSize: 2.5 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 8, + ), + AppText( + ' ${patientsProv.patientPrescriptionsList[index].clinicDescription}', + fontSize: 2.5 * + SizeConfig + .textMultiplier), + SizedBox( + height: 8, + ), + ], + ), + ), + ) + ], + ), + ], + ), + ), + onTap: () {}, + ); + }), + ), + ); + } +} diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart new file mode 100644 index 00000000..8f0aaf55 --- /dev/null +++ b/lib/screens/patients/profile/radiology/radiology_screen.dart @@ -0,0 +1,168 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/radiology_req_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../../../config/shared_pref_kay.dart'; +import '../../../../models/patient/vital_sign_req_model.dart'; +import '../../../../providers/patients_provider.dart'; + +import '../../../../util/dr_app_shared_pref.dart'; +import '../../../../widgets/shared/app_scaffold_widget.dart'; +import '../../../../widgets/shared/card_with_bg_widget.dart'; +import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +/* + *@author: Elham Rababah + *@Date:26/4/2020 + *@param: + *@return:RadiologyScreen + *@desc: RadiologyScreen class + */ + +class RadiologyScreen extends StatefulWidget { + @override + _RadiologyScreenState createState() => _RadiologyScreenState(); +} + +class _RadiologyScreenState extends State { + PatientsProvider patientsProv; + var _isInit = true; + + /* + *@author: Elham Rababah + *@Date:28/4/2020 + *@param: context + *@return: + *@desc: getRadiologyList Function + */ + getRadiologyList(context) async { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String token = await sharedPref.getString(TOKEN); + String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + int inOutpatientType = 1; + if (type == '0') { + inOutpatientType = 2; + } + print(type); + RadiologyReqModel radiologyReqModel = RadiologyReqModel( + patientID: patient.patientId, + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2, + ); + patientsProv.getPatientRadiology(radiologyReqModel.toJson()); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + getRadiologyList(context); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Radiology", + showAppDrawer: false, + showBottomBar: false, + body: patientsProv.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProv.isError + ? Center( + child: Text( + patientsProv.error, + style: TextStyle(color: Theme.of(context).errorColor), + ), + ) + : patientsProv.patientRadiologyList.length == 0 + ? Center( + child: Text( + 'You don\'t have any Vital Sign', + style: TextStyle(color: Theme.of(context).errorColor), + ), + ) + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: patientsProv.patientRadiologyList.length, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + child: CardWithBgWidget( + widget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + CircleAvatar( + radius: + SizeConfig.imageSizeMultiplier * + 12, + backgroundImage: NetworkImage( + patientsProv + .patientRadiologyList[index] + .doctorImageURL), + backgroundColor: Colors.transparent, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 8, 0, 0, 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + '${patientsProv.patientRadiologyList[index].doctorName}', + fontSize: 2.5 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 8, + ), + AppText( + 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', + fontSize: 2.5 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 8, + ), + AppText( + ' ${patientsProv.patientRadiologyList[index].clinicName}', + fontSize: 2.5 * + SizeConfig + .textMultiplier), + SizedBox( + height: 8, + ), + ], + ), + ), + ) + ], + ), + ], + ), + ), + onTap: () {}, + ); + }), + ), + ); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 272fa638..7817e9b0 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -66,17 +66,28 @@ class ProfileMedicalInfoWidget extends StatelessWidget { height: (contWidth) / 3.5, ), ), - CircleAvatarWidget( - des: 'Prescription', - url: url + 'note.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + InkWell( + onTap: () { + navigator(context, PRESCRIPTIONS); + }, + child: CircleAvatarWidget( + des: 'Prescription', + url: url + 'note.png', + width: (contWidth) / 3.5, + height: (contWidth) / 3.5, + ), ), - CircleAvatarWidget( - des: 'Radiology', - url: url + 'radiology-1.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + InkWell( + //RADIOLOGY + onTap: () { + navigator(context, RADIOLOGY); + }, + child: CircleAvatarWidget( + des: 'Radiology', + url: url + 'radiology-1.png', + width: (contWidth) / 3.5, + height: (contWidth) / 3.5, + ), ), ], ) @@ -91,8 +102,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { } void navigator(BuildContext context, route) { - Navigator.of(context) - .pushNamed(route, arguments: {'patient': patient}); + Navigator.of(context).pushNamed(route, arguments: {'patient': patient}); } }