From d136537b44e01864c3a97516a5edb20f60dd5d60 Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Mon, 8 Jun 2020 13:41:35 +0300 Subject: [PATCH 1/6] Modify Patiant screen List style --- lib/config/config.dart | 4 ++-- lib/screens/dashboard_screen.dart | 10 ++++++---- lib/screens/doctor/my_referral_patient_screen.dart | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index dade19d6..886430ad 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -2,8 +2,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z]"; const ONLY_DATE = "[0-9/]"; -// const BASE_URL = 'https://hmgwebservices.com/Services/'; -const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; + const BASE_URL = 'https://hmgwebservices.com/Services/'; +//const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems_Region"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 2db9dcfd..a00471df 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -42,7 +42,9 @@ class _DashboardScreenState extends State { child: Scaffold( body: SingleChildScrollView( child: SizedBox( - height: MediaQuery.of(context).size.height, + height: MediaQuery.of(context).size.height*1.09, + // height: MediaQuery.of(context).size.height * 0.2, + // width: SizeConfig.screenWidth * 0.9, child: Column( children: [ Expanded( @@ -290,7 +292,7 @@ class _DashboardScreenState extends State { valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, - titleFontSize: 16, + titleFontSize: 14, ), onTap: () { Navigator.push( @@ -328,7 +330,7 @@ class _DashboardScreenState extends State { valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, - titleFontSize: 16, + titleFontSize: 14, ), ), ), @@ -363,7 +365,7 @@ class _DashboardScreenState extends State { valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, - titleFontSize: 16, + titleFontSize: 14, ), ), ), diff --git a/lib/screens/doctor/my_referral_patient_screen.dart b/lib/screens/doctor/my_referral_patient_screen.dart index d79313e4..58c6e432 100644 --- a/lib/screens/doctor/my_referral_patient_screen.dart +++ b/lib/screens/doctor/my_referral_patient_screen.dart @@ -43,6 +43,7 @@ class MyReferralPatient extends StatelessWidget { children: [ SizedBox( height: 10, + ), Container( child: Column( From 39cc4fa4bf1dc6983ecce732a60b0c3deb5004cd Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Jun 2020 18:26:16 +0300 Subject: [PATCH 2/6] refere to doctor --- .vscode/settings.json | 2 +- lib/config/config.dart | 4 + .../get_clinic_by_project_id_request.dart | 80 +++++ .../get_doctor_by_clinic_id_request.dart | 86 +++++ ...t_list_stp_referral_frequency_request.dart | 75 +++++ .../patient/refer_to_doctor_request.dart | 147 +++++++++ .../pharmacies_items_request_model.dart | 80 +++-- lib/providers/medicine_provider.dart | 2 +- lib/providers/patients_provider.dart | 301 +++++++++++++++--- lib/routes.dart | 3 + .../profile/refer_patient_screen.dart | 269 ++++++++++++++++ .../profile/profile_medical_info_widget.dart | 2 +- 12 files changed, 971 insertions(+), 80 deletions(-) create mode 100644 lib/models/patient/get_clinic_by_project_id_request.dart create mode 100644 lib/models/patient/get_doctor_by_clinic_id_request.dart create mode 100644 lib/models/patient/get_list_stp_referral_frequency_request.dart create mode 100644 lib/models/patient/refer_to_doctor_request.dart create mode 100644 lib/screens/patients/profile/refer_patient_screen.dart diff --git a/.vscode/settings.json b/.vscode/settings.json index e592e48b..045932f0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "commentBox.styles": { "defaultStyle": { - "commentStartToken": "/* \n *@author: Amjad Amireh \n *@Date:27/4/2020 \n *@param: \n *@return:\n *@desc: ", + "commentStartToken": "/* \n *@author: Ibrahim Albitar \n *@Date:03/06/2020 \n *@param: \n *@return:\n *@desc: ", "commentEndToken": "\n */", "leftEdgeToken": " * ", "rightEdgeToken": "", diff --git a/lib/config/config.dart b/lib/config/config.dart index 6f094704..4f3a5770 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -9,6 +9,10 @@ const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_INSURANCE_APPROVALS_URL = "DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; const PATIENT_ORDERS_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_REFER_TO_DOCTOR_URL = "DoctorApplication.svc/REST/ReferToDoctor"; +const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "DoctorApplication.svc/REST/GetDoctorsByClinicID"; +const PATIENT_GET_LIST_REFERAL_URL = "Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = "DoctorApplication.svc/REST/GetClinicsByProjectID"; const GET_PROJECTS = 'Lists.svc/REST/GetProjectForDoctorAPP'; const GET_PATIENT_VITAL_SIGN = 'Doctors.svc/REST/Doctor_GetPatientVitalSign'; diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart new file mode 100644 index 00000000..862fbab4 --- /dev/null +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -0,0 +1,80 @@ +class ClinicByProjectIdRequest { + + /* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: + *@return: + *@desc: ClinicByProjectIdRequest + */ + + int projectID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + /* + { + "ProjectID": 21, + "LanguageID": 2, + "stamp": "2020-06-03T11:18:19.979Z", + "IPAdress": "11.11.11.11", + "VersionID": 1.2, + "Channel": 9, + "TokenID": "gyIQFH4WWEm2Tq7xjYMjsg==", + "SessionID": "JBXRsDl37L", + "IsLoginForDoctorApp": true, + "PatientOutSA": false, + "PatientTypeID": 1 +} + */ + + ClinicByProjectIdRequest( + {this.projectID, + this.languageID = 2, + this.stamp = "2020-06-03T11:18:19.979Z", + this.iPAdress = "11.11.11.11", + this.versionID = 1.2, + this.channel = 9, + this.tokenID, + this.sessionID = "JBXRsDl37L", + this.isLoginForDoctorApp = true, + this.patientOutSA = false, + this.patientTypeID = 1}); + + ClinicByProjectIdRequest.fromJson(Map json) { + 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['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/get_doctor_by_clinic_id_request.dart b/lib/models/patient/get_doctor_by_clinic_id_request.dart new file mode 100644 index 00000000..a2b33e29 --- /dev/null +++ b/lib/models/patient/get_doctor_by_clinic_id_request.dart @@ -0,0 +1,86 @@ +class DoctorsByClinicIdRequest { + +/* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: + *@return: + *@desc: DoctorsByClinicIdRequest + */ + + int projectID; + String clinicID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + + /* + { + "ProjectID": 21, + "ClinicID": "0", + "LanguageID": 2, + "stamp": "2020-06-03T11:22:04.702Z", + "IPAdress": "11.11.11.11", + "VersionID": 1.2, + "Channel": 9, + "TokenID": "gyIQFH4WWEm2Tq7xjYMjsg==", + "SessionID": "JBXRsDl37L", + "IsLoginForDoctorApp": true, + "PatientOutSA": false, + "PatientTypeID": 1 +} + */ + + DoctorsByClinicIdRequest( + {this.projectID, + this.clinicID, + this.languageID = 2, + this.stamp = "2020-06-03T11:22:04.702Z", + this.iPAdress = "11.11.11.11", + this.versionID = 1.2, + this.channel = 9, + this.tokenID, + this.sessionID = "JBXRsDl37L", + this.isLoginForDoctorApp = true, + this.patientOutSA = false, + this.patientTypeID = 1}); + + DoctorsByClinicIdRequest.fromJson(Map json) { + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + 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['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + 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/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart new file mode 100644 index 00000000..3b3c2655 --- /dev/null +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -0,0 +1,75 @@ +class STPReferralFrequencyRequest { + +/* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: + *@return: + *@desc: + */ + + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + /* +{ + "LanguageID": 2, + "stamp": "2020-06-03T11:18:19.986Z", + "IPAdress": "11.11.11.11", + "VersionID": 1.2, + "Channel": 9, + "TokenID": "gyIQFH4WWEm2Tq7xjYMjsg==", + "SessionID": "JBXRsDl37L", + "IsLoginForDoctorApp": true, + "PatientOutSA": false, + "PatientTypeID": 1 +} + */ + + STPReferralFrequencyRequest( + {this.languageID = 2, + this.stamp = "2020-06-03T11:18:19.986Z", + this.iPAdress = "11.11.11.11", + this.versionID = 1.2, + this.channel = 9, + this.tokenID, + this.sessionID = "JBXRsDl37L", + this.isLoginForDoctorApp = true, + this.patientOutSA = false, + this.patientTypeID = 1}); + + STPReferralFrequencyRequest.fromJson(Map json) { + 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['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/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart new file mode 100644 index 00000000..11229596 --- /dev/null +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -0,0 +1,147 @@ +class ReferToDoctorRequest { + +/* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: + *@return: + *@desc: ReferToDoctor + */ + + int projectID; + int admissionNo; + String roomID; + String referralClinic; + String referralDoctor; + int createdBy; + int editedBy; + int patientID; + int patientTypeID; + int referringClinic; + int referringDoctor; + String referringDoctorRemarks; + String priority; + String frequency; + String extension; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + + + /* +{ + "ProjectID": 21, + "AdmissionNo": 2020005477, + "RoomID": "ISO-6", + "ReferralClinic": "36", + "ReferralDoctor": "230893", + "CreatedBy": 121814, + "EditedBy": 121814, + "PatientID": 3349491, + "PatientTypeID": 1, + "ReferringClinic": 14, + "ReferringDoctor": 121814, + "ReferringDoctorRemarks": "dfcdfdfdf", + "Priority": "1", + "Frequency": "1", + "Extension": "eeee", + "LanguageID": 2, + "stamp": "2020-06-03T11:26:42.358Z", + "IPAdress": "11.11.11.11", + "VersionID": 1.2, + "Channel": 9, + "TokenID": "gyIQFH4WWEm2Tq7xjYMjsg==", + "SessionID": "JBXRsDl37L", + "IsLoginForDoctorApp": true, + "PatientOutSA": false +} + */ + + ReferToDoctorRequest( + {this.projectID, + this.admissionNo, + this.roomID = "ISO-6", + this.referralClinic, + this.referralDoctor , + this.createdBy, + this.editedBy , + this.patientID, + this.patientTypeID = 1, + this.referringClinic, + this.referringDoctor, + this.referringDoctorRemarks, + this.priority , + this.frequency, + this.extension, + this.languageID = 2, + this.stamp = "2020-06-03T11:26:42.358Z", + this.iPAdress = "11.11.11.11", + this.versionID = 1.2, + this.channel = 9, + this.tokenID, + this.sessionID = "JBXRsDl37L", + this.isLoginForDoctorApp = true, + this.patientOutSA = false}); + + ReferToDoctorRequest.fromJson(Map json) { + projectID = json['ProjectID']; + admissionNo = json['AdmissionNo']; + roomID = json['RoomID']; + referralClinic = json['ReferralClinic']; + referralDoctor = json['ReferralDoctor']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + patientID = json['PatientID']; + patientTypeID = json['PatientTypeID']; + referringClinic = json['ReferringClinic']; + referringDoctor = json['ReferringDoctor']; + referringDoctorRemarks = json['ReferringDoctorRemarks']; + priority = json['Priority']; + frequency = json['Frequency']; + extension = json['Extension']; + 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']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['RoomID'] = this.roomID; + data['ReferralClinic'] = this.referralClinic; + data['ReferralDoctor'] = this.referralDoctor; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['PatientID'] = this.patientID; + data['PatientTypeID'] = this.patientTypeID; + data['ReferringClinic'] = this.referringClinic; + data['ReferringDoctor'] = this.referringDoctor; + data['ReferringDoctorRemarks'] = this.referringDoctorRemarks; + data['Priority'] = this.priority; + data['Frequency'] = this.frequency; + data['Extension'] = this.extension; + 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; + return data; + } +} diff --git a/lib/models/pharmacies_items_request_model.dart b/lib/models/pharmacies_items_request_model.dart index f9531e63..96df6da8 100644 --- a/lib/models/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies_items_request_model.dart @@ -5,55 +5,65 @@ *@return: *@desc: */ + + class PharmaciesItemsRequestModel { - String phrItemName; - int languageID; - String stamp; - String ipAdress; - double versionID; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + String pHRItemName; + int pageIndex = 0; + int pageSize = 20; + double versionID = 5.2; + int channel = 3; + int languageID = 2; + String iPAdress = "10.20.10.20"; + String generalid = "Cs2020@2016\$2958"; + int patientOutSA = 0; + String sessionID = "KvFJENeAUCxyVdIfEkHw"; + bool isDentalAllowedBackend = false; + int deviceTypeID = 2; PharmaciesItemsRequestModel( - {this.phrItemName = '', - this.patientTypeID = 1, - this.languageID = 2, - this.stamp = '2020-04-23T21:01:21.492Z', - this.ipAdress = '10.20.10.20', + {this.pHRItemName, + this.pageIndex = 0, + this.pageSize = 20, this.versionID = 5.2, - this.tokenID , + this.channel = 3, + this.languageID = 2, + this.iPAdress = "10.20.10.20", + this.generalid = "Cs2020@2016\$2958", + this.patientOutSA = 0, this.sessionID = "KvFJENeAUCxyVdIfEkHw", - this.isLoginForDoctorApp = true, - this.patientOutSA = false}); + this.isDentalAllowedBackend = false, + this.deviceTypeID = 2}); PharmaciesItemsRequestModel.fromJson(Map json) { - phrItemName = json['PHR_itemName']; - patientTypeID = json['PatientTypeID']; - languageID = json['LanguageID']; - stamp = json['stamp']; - ipAdress = json['IPAdress']; + pHRItemName = json['PHR_itemName']; + pageIndex = json['PageIndex']; + pageSize = json['PageSize']; versionID = json['VersionID']; - tokenID = json['TokenID']; - sessionID = json['SessionID']; - isLoginForDoctorApp = json['IsLoginForDoctorApp']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; } Map toJson() { final Map data = new Map(); - data['PHR_itemName'] = this.phrItemName; - data['PatientTypeID'] = this.patientTypeID; - data['LanguageID'] = this.languageID; - data['stamp'] = this.stamp; - data['IPAdress'] = this.ipAdress; + data['PHR_itemName'] = this.pHRItemName; + data['PageIndex'] = this.pageIndex; + data['PageSize'] = this.pageSize; data['VersionID'] = this.versionID; - data['TokenID'] = this.tokenID; - data['SessionID'] = this.sessionID; - data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; return data; } -} +} \ No newline at end of file diff --git a/lib/providers/medicine_provider.dart b/lib/providers/medicine_provider.dart index 97e030fe..a0d8f4ed 100644 --- a/lib/providers/medicine_provider.dart +++ b/lib/providers/medicine_provider.dart @@ -25,7 +25,7 @@ class MedicineProvider with ChangeNotifier { resetDefaultValues(); try { if (await Helpers.checkConnection()) { - _itemsRequestModel.phrItemName = itemName; + _itemsRequestModel.pHRItemName = itemName; final response = await AppClient.post(PHARMACY_ITEMS_URL, body: json.encode(_itemsRequestModel.toJson())); diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 8b84420a..25e640ec 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -2,12 +2,18 @@ import 'dart:convert'; import 'package:doctor_app_flutter/client/app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; +import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart'; +import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart'; import 'package:doctor_app_flutter/models/patient/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/lab_result.dart'; import 'package:doctor_app_flutter/models/patient/lab_result_req_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_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:doctor_app_flutter/models/patient/refer_to_doctor_request.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; @@ -35,7 +41,6 @@ class PatientsProvider with ChangeNotifier { List patientPrescriptionsList = []; List patientRadiologyList = []; - /*@author: ibrahe albitar *@Date:2/6/2020 *@desc: getPatientPrescriptions @@ -46,8 +51,20 @@ class PatientsProvider with ChangeNotifier { var patientProgressNoteList = []; var insuranceApporvalsList = []; + var doctorsList = []; + var clinicsList = []; + var referalFrequancyList = []; + + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = + DoctorsByClinicIdRequest(); + STPReferralFrequencyRequest _referralFrequencyRequest = + STPReferralFrequencyRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = + ClinicByProjectIdRequest(); + ReferToDoctorRequest _referToDoctorRequest = ReferToDoctorRequest(); + Client client = - HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); + HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); PatiantInformtion _selectedPatient; @@ -220,7 +237,7 @@ class PatientsProvider with ChangeNotifier { try { if (await Helpers.checkConnection()) { final response = - await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient)); + await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient)); final int statusCode = response.statusCode; isLoading = false; @@ -279,7 +296,7 @@ class PatientsProvider with ChangeNotifier { try { if (await Helpers.checkConnection()) { final response = - await AppClient.post(GET_RADIOLOGY, body: json.encode(patient)); + await AppClient.post(GET_RADIOLOGY, body: json.encode(patient)); final int statusCode = response.statusCode; isLoading = false; @@ -310,7 +327,6 @@ class PatientsProvider with ChangeNotifier { } } - getLabResult(LabOrdersResModel labOrdersResModel) async { labResultList.clear(); isLoading = true; @@ -320,15 +336,14 @@ class PatientsProvider with ChangeNotifier { requestLabResult.orderNo = labOrdersResModel.orderNo; requestLabResult.invoiceNo = labOrdersResModel.invoiceNo; requestLabResult.patientTypeID = labOrdersResModel.patientType; - await BaseAppClient.post( - 'DoctorApplication.svc/REST/GetPatientLabResults', + await BaseAppClient.post('DoctorApplication.svc/REST/GetPatientLabResults', onSuccess: (dynamic response, int statusCode) { - isError = false; - isLoading = false; - response['List_GetLabNormal'].forEach((v) { - labResultList.add(new LabResult.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { + isError = false; + isLoading = false; + response['List_GetLabNormal'].forEach((v) { + labResultList.add(new LabResult.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { isError = true; isLoading = false; this.error = error; @@ -336,13 +351,12 @@ class PatientsProvider with ChangeNotifier { notifyListeners(); } - getPatientInsuranceApprovals(patient) async { setBasicData(); try { 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)); final int statusCode = response.statusCode; isLoading = false; @@ -371,44 +385,247 @@ class PatientsProvider with ChangeNotifier { } } -/*@author: ibrahe albitar +/*@author: ibrahem albitar *@Date:2/6/2020 - *@desc: getPatientPrescriptions + *@desc: getPatientProgressNote */ getPatientProgressNote(patient) async { - setBasicData(); - try { - if (await Helpers.checkConnection()) { - final response = await AppClient.post(PATIENT_PROGRESS_NOTE_URL, - 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'; + setBasicData(); + try { + if (await Helpers.checkConnection()) { + final response = await AppClient.post(PATIENT_PROGRESS_NOTE_URL, + 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) { + patientProgressNoteList = res['List_GetPregressNoteForInPatient']; } else { - var res = json.decode(response.body); - print('$res'); - if (res['MessageStatus'] == 1) { - patientProgressNoteList = res['List_GetPregressNoteForInPatient']; - } else { - isError = true; - error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; - } + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; } + } + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; + } + notifyListeners(); + } catch (err) { + handelCatchErrorCase(err); + } + } + + /*@author: ibrahem albitar + *@Date:3/6/2020 + *@desc: getDoctorsList + */ + getDoctorsList(String clinicId) async { + String token = await sharedPref.getString(TOKEN); + int projectID = await sharedPref.getInt(PROJECT_ID); + setBasicData(); + try { + if (await Helpers.checkConnection()) { + _doctorsByClinicIdRequest.projectID = projectID; + _doctorsByClinicIdRequest.clinicID = clinicId; + _doctorsByClinicIdRequest.tokenID = token; + + final response = await AppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL, + body: json.encode(_doctorsByClinicIdRequest)); + final int statusCode = response.statusCode; + isLoading = false; + + if (statusCode < 200 || statusCode >= 400 || json == null) { + isError = true; + error = 'Error While Fetching data'; } else { - isLoading = false; + var res = json.decode(response.body); + print('$res'); + if (res['MessageStatus'] == 1) { + doctorsList = res['List_Doctors_All']; + } else { + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; + } + } + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; + } + notifyListeners(); + } catch (err) { + handelCatchErrorCase(err); + } + } + + List getDoctorNameList() { + var doctorNamelist = + doctorsList.map((value) => value['DoctorName'].toString()).toList(); + return doctorNamelist; + } + + /*@author: ibrahem albitar + *@Date:3/6/2020 + *@desc: getClinicsList + */ + getClinicsList() async { + String token = await sharedPref.getString(TOKEN); + setBasicData(); + try { + if (await Helpers.checkConnection()) { + int projectID = await sharedPref.getInt(PROJECT_ID); + _clinicByProjectIdRequest.projectID = projectID; + _clinicByProjectIdRequest.tokenID = token; + + final response = await AppClient.post(PATIENT_GET_CLINIC_BY_PROJECT_URL, + body: json.encode(_clinicByProjectIdRequest)); + final int statusCode = response.statusCode; + isLoading = false; + + if (statusCode < 200 || statusCode >= 400 || json == null) { isError = true; - error = 'Please Check The Internet Connection'; + error = 'Error While Fetching data'; + } else { + var res = json.decode(response.body); + print('$res'); + if (res['MessageStatus'] == 1) { + clinicsList = res['List_Clinic_All']; + } else { + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; + } } - notifyListeners(); - } catch (err) { - handelCatchErrorCase(err); + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; } + notifyListeners(); + } catch (err) { + handelCatchErrorCase(err); } + } + List getClinicNameList() { + var clinicsNameslist = clinicsList + .map((value) => value['ClinicDescription'].toString()) + .toList(); + return clinicsNameslist; + } + + /*@author: ibrahem albitar + *@Date:3/6/2020 + *@desc: getReferralFrequancyList + */ + getReferralFrequancyList() async { + String token = await sharedPref.getString(TOKEN); + setBasicData(); + try { + if (await Helpers.checkConnection()) { + _referralFrequencyRequest.tokenID = token; + final response = await AppClient.post(PATIENT_GET_LIST_REFERAL_URL, + body: json.encode(_referralFrequencyRequest)); + 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) { + referalFrequancyList = res['list_STPReferralFrequency']; + } else { + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; + } + } + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; + } + notifyListeners(); + } catch (err) { + handelCatchErrorCase(err); + } + } + List getReferralNamesList() { + var referralNamesList = referalFrequancyList + .map((value) => value['Description'].toString()) + .toList(); + return referralNamesList; + } + /*@author: ibrahem albitar + *@Date:3/6/2020 + *@desc: referToDoctor + */ + referToDoctor( + int selectedDoctorID, + int selectedClinicID, + String selectedReferralFrequancyID, + int admissionNo, + String extension, + String doctorRemark) async { + String token = await sharedPref.getString(TOKEN); + int projectID = await sharedPref.getInt(PROJECT_ID); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); + int doctorID = doctorProfile.doctorID; + int clinicId = doctorProfile.clinicID; + setBasicData(); + try { + if (await Helpers.checkConnection()) { + // _referToDoctorRequest.tokenID = token; + // _referToDoctorRequest.admissionNo = admissionNo; + // _referToDoctorRequest.projectID = projectID; + // _referToDoctorRequest.tokenID = token; + // _referToDoctorRequest.extension = extension; + // _referToDoctorRequest.frequency = selectedReferralFrequancyID; + // _referToDoctorRequest.patientID = + // _referToDoctorRequest.priority = + // _referToDoctorRequest.referralClinic = + // _referToDoctorRequest.referralDoctor = + // _referToDoctorRequest.referringDoctorRemarks = + // _referToDoctorRequest.roomID = + // _referToDoctorRequest.referringClinic = + // _referToDoctorRequest.referringDoctor = + + final response = await AppClient.post(PATIENT_REFER_TO_DOCTOR_URL, + body: json.encode(_referralFrequencyRequest)); + 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) { + patientProgressNoteList = res['List_GetPregressNoteForInPatient']; + } else { + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; + } + } + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; + } + notifyListeners(); + } catch (err) { + handelCatchErrorCase(err); + } + } } diff --git a/lib/routes.dart b/lib/routes.dart index 9c87ff2f..9ef1237a 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen.dart'; import './screens/patients/profile/vital_sign/body_measurements_screen.dart'; @@ -56,6 +57,7 @@ const String LAB_ORDERS = 'patients/lab_orders'; const String PRESCRIPTIONS = 'patients/prescription'; const String RADIOLOGY = 'patients/radiology'; const String PROGRESS_NOTE = 'patients/progress-note'; +const String REFER_PATIENT = 'patients/refer-patient'; const String PATIENT_ORDERS = 'patients/patient_orders'; const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; @@ -88,6 +90,7 @@ var routes = { PRESCRIPTIONS: (_) => PrescriptionScreen(), RADIOLOGY: (_) => RadiologyScreen(), PROGRESS_NOTE: (_) => ProgressNoteScreen(), + REFER_PATIENT: (_)=> ReferPatientScreen(), PATIENT_ORDERS: (_) => PatientsOrdersScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart new file mode 100644 index 00000000..6f489237 --- /dev/null +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -0,0 +1,269 @@ +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:provider/provider.dart'; +import '../../../config/size_config.dart'; +import '../../../providers/patients_provider.dart'; +import '../../../util/dr_app_shared_pref.dart'; +import '../../../widgets/shared/app_scaffold_widget.dart'; +import '../../../widgets/shared/app_texts_widget.dart'; +import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +/* + *@author: ibrahim albitar + *@Date:4/6/2020 + *@param: + *@return: + *@desc: + */ + +class ReferPatientScreen extends StatefulWidget { + @override + _ReferPatientState createState() => _ReferPatientState(); +} + +class _ReferPatientState extends State { + PatientsProvider patientsProv; + var doctorsList; + var clinicsList; + var referralFrequancyList; + final _controller = TextEditingController(); + var _isInit = true; + + String _selectedClinic; + String _selectedDoctor; + String _selectedReferralFrequancy; + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + patientsProv.getClinicsList(); + patientsProv.getReferralFrequancyList(); + setState(() { + clinicsList = patientsProv.clinicsList; + referralFrequancyList = patientsProv.referalFrequancyList; + }); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Progress Note", + showAppDrawer: false, + showBottomBar: false, + body: patientsProv.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProv.isError + ? DrAppEmbeddedError(error: patientsProv.error) + : clinicsList == null + ? DrAppEmbeddedError( + error: 'You don\'t have any Progress Note') + : Column( + children: [ + RoundedContainer( + margin: 0, + showBorder: true, + raduis: 30, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedClinic, + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return patientsProv + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedDoctor = null; + _selectedClinic = newValue; + var clinicInfo = + clinicsList.singleWhere((i) => + i['ClinicDescription'] + .toString() + .contains(_selectedClinic)); + var clinicId = + clinicInfo['ClinicID'].toString(); + patientsProv.getDoctorsList(clinicId); + }) + }, + items: patientsProv + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, + ), + ); + }).toList(), + ), + ), + ], + ), + ), + ), + //--------------------------------------------------------------------// + RoundedContainer( + margin: 0, + showBorder: true, + raduis: 30, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedDoctor, + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return patientsProv + .getDoctorNameList() + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedDoctor = newValue; + }) + }, + items: patientsProv + .getDoctorNameList() + .map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, + ), + ); + }).toList(), + ), + ), + ], + ), + ), + ), //-----------------------------/// + RoundedContainer( + margin: 0, + showBorder: true, + raduis: 30, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedReferralFrequancy, + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return patientsProv + .getReferralNamesList() + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedReferralFrequancy = newValue; + }) + }, + items: patientsProv + .getReferralNamesList() + .map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, + ), + ); + }).toList(), + ), + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 657690be..89acca60 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -127,7 +127,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { visible: selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 2, child: InkWell( onTap: () { - navigator(context, PRESCRIPTIONS); + navigator(context, REFER_PATIENT); }, child: CircleAvatarWidget( des: 'Refer Patient ', From 76f8eba86e7da798212ddf408fb4bdea883c4a7f Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Tue, 9 Jun 2020 10:24:22 +0300 Subject: [PATCH 3/6] create Prescription In and Out Patient --- lib/models/prescription_report.dart | 140 ++++++++++ lib/models/request_prescription_report.dart | 68 +++++ lib/providers/patients_provider.dart | 30 ++- ...t_patient_prescription_details_screen.dart | 247 ++++++++++++++++++ .../prescription_out_patinets_widget.dart | 14 +- 5 files changed, 495 insertions(+), 4 deletions(-) create mode 100644 lib/models/prescription_report.dart create mode 100644 lib/models/request_prescription_report.dart create mode 100644 lib/screens/patients/out_patient_prescription_details_screen.dart diff --git a/lib/models/prescription_report.dart b/lib/models/prescription_report.dart new file mode 100644 index 00000000..05d28bdc --- /dev/null +++ b/lib/models/prescription_report.dart @@ -0,0 +1,140 @@ +class PrescriptionReport { + String address; + int appointmentNo; + String clinic; + String companyName; + int days; + String doctorName; + int doseDailyQuantity; + String frequency; + int frequencyNumber; + Null imageExtension; + Null imageSRCUrl; + Null imageString; + Null imageThumbUrl; + String isCovered; + String itemDescription; + int itemID; + String orderDate; + int patientID; + String patientName; + String phoneOffice1; + Null prescriptionQR; + int prescriptionTimes; + Null productImage; + String productImageBase64; + String productImageString; + int projectID; + String projectName; + String remarks; + String route; + String sKU; + int scaleOffset; + String startDate; + + PrescriptionReport( + {this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); + + PrescriptionReport.fromJson(Map json) { + address = json['Address']; + appointmentNo = json['AppointmentNo']; + clinic = json['Clinic']; + companyName = json['CompanyName']; + days = json['Days']; + doctorName = json['DoctorName']; + doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; + productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; + sKU = json['SKU']; + scaleOffset = json['ScaleOffset']; + startDate = json['StartDate']; + } + + Map toJson() { + final Map data = new Map(); + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + return data; + } +} diff --git a/lib/models/request_prescription_report.dart b/lib/models/request_prescription_report.dart new file mode 100644 index 00000000..0581692e --- /dev/null +++ b/lib/models/request_prescription_report.dart @@ -0,0 +1,68 @@ +class RequestPrescriptionReport { + int projectID; + int appointmentNo; + int episodeID; + String setupID; + int patientTypeID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + + RequestPrescriptionReport( + {this.projectID, + this.appointmentNo, + this.episodeID, + this.setupID, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); + + RequestPrescriptionReport.fromJson(Map json) { + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + setupID = json['SetupID']; + patientTypeID = json['PatientTypeID']; + 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']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['SetupID'] = this.setupID; + data['PatientTypeID'] = this.patientTypeID; + 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; + return data; + } +} diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 9bf8d34b..a3e665c1 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription_report_for_in_patient.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:doctor_app_flutter/models/prescription_report.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; @@ -36,6 +37,7 @@ class PatientsProvider with ChangeNotifier { List patientPrescriptionsList = []; List patientRadiologyList = []; List prescriptionReportForInPatientList = []; + List prescriptionReport = []; /*@author: ibrahe albitar *@Date:2/6/2020 @@ -48,7 +50,7 @@ class PatientsProvider with ChangeNotifier { var insuranceApporvalsList = []; Client client = - HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); + HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); PatiantInformtion _selectedPatient; @@ -219,7 +221,7 @@ class PatientsProvider with ChangeNotifier { try { if (await Helpers.checkConnection()) { final response = - await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient)); + await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient)); final int statusCode = response.statusCode; isLoading = false; @@ -276,12 +278,34 @@ class PatientsProvider with ChangeNotifier { this.error = error; }, body: patient); notifyListeners(); - } catch (err) { handelCatchErrorCase(err); } } + getPrescriptionReport(prescriptionReqModel) async{ + prescriptionReport = []; + isLoading = true; + isError = false; + error = ""; + notifyListeners(); + await BaseAppClient.post( + 'Patients.svc/REST/GetPrescriptionReport', + onSuccess: (dynamic response, int statusCode) { + response['ListPRM'].forEach((v) { + prescriptionReport + .add(PrescriptionReport.fromJson(v)); + }); + isError = false; + isLoading = false; + }, onFailure: (String error, int statusCode) { + isError = true; + isLoading = false; + this.error = error; + }, body: prescriptionReqModel); + notifyListeners(); + } + /*@author: Elham Rababah *@Date:12/5/2020 *@param: patient diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart new file mode 100644 index 00000000..aa61f1fb --- /dev/null +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -0,0 +1,247 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart'; +import 'package:doctor_app_flutter/models/prescription_report.dart'; +import 'package:doctor_app_flutter/models/request_prescription_report.dart'; +import 'package:doctor_app_flutter/providers/patients_provider.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class OutPatientPrescriptionDetailsScreen extends StatefulWidget { + final PrescriptionResModel prescriptionResModel; + + OutPatientPrescriptionDetailsScreen({Key key, this.prescriptionResModel}); + + @override + _OutPatientPrescriptionDetailsScreenState createState() => + _OutPatientPrescriptionDetailsScreenState(); +} + +class _OutPatientPrescriptionDetailsScreenState + extends State { + bool _isInit = true; + PatientsProvider patientsProvider; + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProvider = Provider.of(context); + + RequestPrescriptionReport prescriptionReqModel = + RequestPrescriptionReport( + appointmentNo: widget.prescriptionResModel.appointmentNo, + episodeID: widget.prescriptionResModel.episodeID, + setupID: widget.prescriptionResModel.setupID, + patientTypeID: widget.prescriptionResModel.patientID); + patientsProvider.getPrescriptionReport(prescriptionReqModel.toJson()); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'Prescription Details', + body: patientsProvider.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProvider.isError + ? DrAppEmbeddedError(error: patientsProvider.error) + : CardWithBgWidgetNew( + widget: ListView.builder( + itemCount: patientsProvider.prescriptionReport.length, + itemBuilder: (BuildContext context, int index) { + return OutPatientPrescriptionDetailsItem( + prescriptionReport: + patientsProvider.prescriptionReport[index], + ); + }), + ), + ); + } +} + +class OutPatientPrescriptionDetailsItem extends StatefulWidget { + final PrescriptionReport prescriptionReport; + + OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport}); + + @override + _OutPatientPrescriptionDetailsItemState createState() => + _OutPatientPrescriptionDetailsItemState(); +} + +class _OutPatientPrescriptionDetailsItemState + extends State { + bool _showDetails = false; + @override + Widget build(BuildContext context) { + return Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + flex: 5, + child: AppText( + '${widget.prescriptionReport.itemDescription} ', + fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + _showDetails = !_showDetails; + }); + }, + child: Icon(_showDetails + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)), + ), + ], + ), + !_showDetails + ? Container() + : AnimatedContainer( + duration: Duration(milliseconds: 200), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + Divider( + color: Color(0xFF000000), + height: 0.5, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + ), + children: [ + TableRow(children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Route', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.prescriptionReport.route}', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + Container( + margin: EdgeInsets.only( + left: 4, top: 2.5, right: 2.5, bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Frequency Timing', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + widget.prescriptionReport.frequency, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + ]), + TableRow(children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Insurance Covered', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + Container( + margin: EdgeInsets.only( + left: 4, top: 2.5, right: 2.5, bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Duration Days', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.prescriptionReport.days}', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ) + ]), + TableRow( + children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Doctor Remarks', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.prescriptionReport.remarks}', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + Container() + ], + ), + ], + ), + ], + ), + ) + ], + ), + ); + } +} diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index b4c75120..bedd6427 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart'; +import 'package:doctor_app_flutter/screens/patients/out_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; @@ -25,7 +26,18 @@ class PrescriptionOutPatientWidget extends StatelessWidget { itemCount: patientPrescriptionsList.length, itemBuilder: (BuildContext context, int index) { return InkWell( - onTap: () {}, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + OutPatientPrescriptionDetailsScreen( + prescriptionResModel: + patientPrescriptionsList[index], + ), + ), + ); + }, child: CardWithBgWidgetNew( widget: Column( crossAxisAlignment: CrossAxisAlignment.start, From 14527e19b1744e5cfe56fed5c7325cb273ff3e7d Mon Sep 17 00:00:00 2001 From: ibrahim albitar Date: Tue, 9 Jun 2020 11:07:04 +0300 Subject: [PATCH 4/6] fix issues --- lib/screens/patients/profile/refer_patient_screen.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index 6f489237..1781867c 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -55,8 +55,6 @@ class _ReferPatientState extends State { Widget build(BuildContext context) { return AppScaffold( appBarTitle: "Progress Note", - showAppDrawer: false, - showBottomBar: false, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError From d3818bd3b3fd10cb1431b9f601c02574db5918c0 Mon Sep 17 00:00:00 2001 From: ibrahim albitar Date: Tue, 9 Jun 2020 11:48:58 +0300 Subject: [PATCH 5/6] fix --- lib/widgets/patients/profile/profile_medical_info_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 4bb0421d..28868afb 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -71,7 +71,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: PRESCRIPTIONS, + route: REFER_PATIENT, name: 'Refer Patient', icon: 'note.png'), PatientProfileButton( From 0c94188405aaabec4deda9e9e01c87ef264415d0 Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Tue, 9 Jun 2020 14:47:24 +0300 Subject: [PATCH 6/6] Done Prescription Details Screen --- lib/providers/doctor_reply_provider.dart | 26 +-- ...t_patient_prescription_details_screen.dart | 182 +----------------- ...n_patient_prescription_details_screen.dart | 26 +-- ...out_patient_prescription_details_item.dart | 138 +++++++++++++ 4 files changed, 161 insertions(+), 211 deletions(-) create mode 100644 lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart diff --git a/lib/providers/doctor_reply_provider.dart b/lib/providers/doctor_reply_provider.dart index c7e48afa..493cb472 100644 --- a/lib/providers/doctor_reply_provider.dart +++ b/lib/providers/doctor_reply_provider.dart @@ -3,7 +3,6 @@ import 'package:doctor_app_flutter/models/request_doctor_reply.dart'; import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart'; import 'package:flutter/cupertino.dart'; - class DoctorReplyProvider with ChangeNotifier { List listDoctorWorkingHoursTable = []; @@ -18,20 +17,21 @@ class DoctorReplyProvider with ChangeNotifier { getDoctorReply() async { try { - await BaseAppClient.post('DoctorApplication.svc/REST/GtMyPatientsQuestions', - body: _requestDoctorReply.toJson(), - onSuccess: (dynamic response, int statusCode) { - response['List_GtMyPatientsQuestions'].forEach((v) { - listDoctorWorkingHoursTable.add(ListGtMyPatientsQuestions.fromJson(v)); - isError = false; - isLoading = false; - }); - }, - onFailure: (String error, int statusCode) { - isError = true; + await BaseAppClient.post( + 'DoctorApplication.svc/REST/GtMyPatientsQuestions', + body: _requestDoctorReply.toJson(), + onSuccess: (dynamic response, int statusCode) { + response['List_GtMyPatientsQuestions'].forEach((v) { + listDoctorWorkingHoursTable + .add(ListGtMyPatientsQuestions.fromJson(v)); + isError = false; isLoading = false; - this.error= error; }); + }, onFailure: (String error, int statusCode) { + isError = true; + isLoading = false; + this.error = error; + }); notifyListeners(); } catch (error) { diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index aa61f1fb..a8f97290 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -1,11 +1,8 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart'; -import 'package:doctor_app_flutter/models/prescription_report.dart'; import 'package:doctor_app_flutter/models/request_prescription_report.dart'; import 'package:doctor_app_flutter/providers/patients_provider.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; @@ -67,181 +64,4 @@ class _OutPatientPrescriptionDetailsScreenState } } -class OutPatientPrescriptionDetailsItem extends StatefulWidget { - final PrescriptionReport prescriptionReport; - OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport}); - - @override - _OutPatientPrescriptionDetailsItemState createState() => - _OutPatientPrescriptionDetailsItemState(); -} - -class _OutPatientPrescriptionDetailsItemState - extends State { - bool _showDetails = false; - @override - Widget build(BuildContext context) { - return Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - flex: 5, - child: AppText( - '${widget.prescriptionReport.itemDescription} ', - fontSize: 2.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - setState(() { - _showDetails = !_showDetails; - }); - }, - child: Icon(_showDetails - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)), - ), - ], - ), - !_showDetails - ? Container() - : AnimatedContainer( - duration: Duration(milliseconds: 200), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - Divider( - color: Color(0xFF000000), - height: 0.5, - ), - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 0.5), - ), - children: [ - TableRow(children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Route', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.prescriptionReport.route}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - Container( - margin: EdgeInsets.only( - left: 4, top: 2.5, right: 2.5, bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Frequency Timing', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - widget.prescriptionReport.frequency, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - ]), - TableRow(children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Insurance Covered', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - Container( - margin: EdgeInsets.only( - left: 4, top: 2.5, right: 2.5, bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Duration Days', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.prescriptionReport.days}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ) - ]), - TableRow( - children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Doctor Remarks', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.prescriptionReport.remarks}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - Container() - ], - ), - ], - ), - ], - ), - ) - ], - ), - ); - } -} diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index 30a57b15..f4a8a395 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -1,12 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription_report_for_in_patient.dart'; -import 'package:doctor_app_flutter/providers/referral_patient_provider.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; @@ -23,8 +17,6 @@ class InpatientPrescriptionDetailsScreen extends StatefulWidget { class _InpatientPrescriptionDetailsScreenState extends State { bool _showDetails = false; - bool _isLoading = false; - final _formKey = GlobalKey(); String error; TextEditingController answerController; bool _isInit = true; @@ -32,7 +24,6 @@ class _InpatientPrescriptionDetailsScreenState @override void initState() { -// answerController = new TextEditingController(text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); super.initState(); } @@ -49,7 +40,7 @@ class _InpatientPrescriptionDetailsScreenState @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: 'perscription info', + appBarTitle: 'Prescription info', body: CardWithBgWidgetNew( widget: Container( child: ListView( @@ -99,23 +90,23 @@ class _InpatientPrescriptionDetailsScreenState des: '${prescription.refillID}', key: 'Refill'), buildTableRow( - des: '${prescription.dose}', - key: 'Dose'), + des: '${prescription.dose}', key: 'Dose'), buildTableRow( des: '${prescription.unitofMeasurement}', key: 'UOM'), buildTableRow( - des: '${Helpers.getDate(prescription.startDatetime) }', + des: + '${Helpers.getDate(prescription.startDatetime)}', key: 'Start Date'), buildTableRow( - des: '${Helpers.getDate(prescription.stopDatetime)}', + des: + '${Helpers.getDate(prescription.stopDatetime)}', key: 'Stop Date'), buildTableRow( des: '${prescription.noOfDoses}', key: 'No of Doses'), buildTableRow( - des: '${prescription.route}', - key: 'Route'), + des: '${prescription.route}', key: 'Route'), buildTableRow( des: '${prescription.comments}', key: 'Comments'), @@ -123,7 +114,8 @@ class _InpatientPrescriptionDetailsScreenState des: '${prescription.pharmacyRemarks}', key: 'Pharmacy Remarks'), buildTableRow( - des: '${Helpers.getDate(prescription.prescriptionDatetime)}', + des: + '${Helpers.getDate(prescription.prescriptionDatetime)}', key: 'Prescription Date'), buildTableRow( des: '${prescription.refillID}', diff --git a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart new file mode 100644 index 00000000..fc212afe --- /dev/null +++ b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart @@ -0,0 +1,138 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/prescription_report.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class OutPatientPrescriptionDetailsItem extends StatefulWidget { + final PrescriptionReport prescriptionReport; + + OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport}); + + @override + _OutPatientPrescriptionDetailsItemState createState() => + _OutPatientPrescriptionDetailsItemState(); +} + +class _OutPatientPrescriptionDetailsItemState + extends State { + bool _showDetails = false; + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + flex: 5, + child: AppText( + '${widget.prescriptionReport.itemDescription} ', + fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + _showDetails = !_showDetails; + }); + }, + child: Icon(_showDetails + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)), + ), + ], + ), + !_showDetails + ? Container() + : AnimatedContainer( + duration: Duration(milliseconds: 200), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + Divider( + color: Color(0xFF000000), + height: 0.5, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + ), + children: [ + buildTableRow( + key: 'Route', + des: widget.prescriptionReport.route), + buildTableRow( + key: 'Frequency Timing', + des: widget.prescriptionReport.frequency), + buildTableRow(key: 'Insurance Covered', des: ''), + buildTableRow( + key: 'Duration Days', + des: widget.prescriptionReport.days), + buildTableRow( + key: 'IDoctor Remarks', + des: widget.prescriptionReport.remarks), + ], + ), + Divider( + color: Color(0xFF000000), + height: 0.5, + ), + ], + ), + ) + ], + ), + ); + } + + TableRow buildTableRow({des, key}) { + print('$key: $des'); + return TableRow(children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Row( + children: [ + Expanded( + child: Container( + child: AppText( + key, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + textAlign: TextAlign.start, + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(left: 4, top: 2.5, right: 2.5, bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + '${des}', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + textAlign: TextAlign.center, + ) + ], + ), + ), + ), + ], + ), + ), + ]); + } +} \ No newline at end of file