From 35205b7024899b03bef750b3a3ad7dc44be29993 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 17 May 2020 11:49:13 +0300 Subject: [PATCH 1/6] patient medical info --- lib/config/config.dart | 4 + .../patient/insurance_aprovals_request.dart | 87 +++++++++++++++++ lib/models/patient/orders_request.dart | 88 +++++++++++++++++ lib/models/patient/progress_note_request.dart | 88 +++++++++++++++++ lib/providers/patients_provider.dart | 75 +++++++++++++- lib/routes.dart | 4 + .../profile/progress_note_screen.dart | 97 +++++++++++++++++++ .../profile/profile_medical_info_widget.dart | 68 +++++++++++-- pubspec.lock | 43 +++++--- 9 files changed, 532 insertions(+), 22 deletions(-) create mode 100644 lib/models/patient/insurance_aprovals_request.dart create mode 100644 lib/models/patient/orders_request.dart create mode 100644 lib/models/patient/progress_note_request.dart create mode 100644 lib/screens/patients/profile/progress_note_screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 93dfa881..1d36cbf1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,6 +6,10 @@ const ONLY_DATE = "[0-9/]"; const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; +const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = "DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_ORDERS_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; + //*********change value to decode json from Dropdown ************ var SERVICES_PATIANT = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; var SERVICES_PATIANT2 = ["List_MyOutPatient", "List_MyInPatient","List_MyDischargePatient" ,"List_MyReferredPatient","List_MyDischargeReferralPatient","List_MyTomorrowPatient","List_MyReferralPatient"]; diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart new file mode 100644 index 00000000..b94b9b9b --- /dev/null +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -0,0 +1,87 @@ +/* + *@author: Ibrahim Albitar + *@Date:15/5/2020 + + *@param: + {"PatientID":1089227, + "PatientTypeID":1, + "EXuldAPPNO":0, + "ProjectID":12, + "LanguageID":2, + "stamp":"2020-04-01T09:47:19.643Z", + "IPAdress":"11.11.11.11", + "VersionID":1.2, + "Channel":9, + "TokenID":"yIwh6wNyUkOeQlJRohWjyw==", + "SessionID":"LlBk8lUEJY", + "IsLoginForDoctorApp":true, + "PatientOutSA":false} + + *@return: + *@desc: + */ +class InsuranceAprovalsRequest { + int exuldAppNO; + int patientID; + int channel; + int projectID; + int languageID; + String stamp; + String ipAdress; + double versionID; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + + InsuranceAprovalsRequest( + { + this.exuldAppNO, + this.patientID, + this.channel = 9, + this.projectID = 12, + this.patientTypeID = 1, + this.languageID = 2, + this.stamp = '2020-04-23T21:01:21.492Z', + this.ipAdress = '11.11.11.11', + this.versionID = 1.2, + this.tokenID = '@dm!n', + this.sessionID = 'e29zoooEJ4', + this.isLoginForDoctorApp = true, + this.patientOutSA = false}); + + InsuranceAprovalsRequest.fromJson(Map json) { + exuldAppNO = json['EXuldAPPNO']; + patientID = json['PatientID']; + channel = json['Channel']; + projectID = json['ProjectID']; + patientTypeID = json['PatientTypeID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + ipAdress = json['IPAdress']; + versionID = json['VersionID']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + } + + Map toJson() { + final Map data = new Map(); + data['EXuldAPPNO'] = this.exuldAppNO; + data['PatientID'] = this.patientID; + data['Channel'] = this.channel; + data['ProjectID'] = this.projectID; + data['PatientTypeID'] = this.patientTypeID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.ipAdress; + data['VersionID'] = this.versionID; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + return data; + } +} diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart new file mode 100644 index 00000000..92df2ab9 --- /dev/null +++ b/lib/models/patient/orders_request.dart @@ -0,0 +1,88 @@ + +/* + *@author: Ibrahim Albitar + *@Date:15/5/2020 + + *@param: +{"VisitType":3, +"AdmissionNo":2020004683, +"ProjectID":12, +"LanguageID":2, +"stamp":"2020-04-01T09:53:50.410Z", +"IPAdress":"11.11.11.11", +"VersionID":1.2, +"Channel":9, +"TokenID":"yIwh6wNyUkOeQlJRohWjyw==", +"SessionID":"LlBk8lUEJY", +"IsLoginForDoctorApp":true, +"PatientOutSA":false, +"PatientTypeID":1} + +*@return: + *@desc: + */ + +class OrdersRequest { + int visitType; + int admissionNo; + int projectID; + int languageID; + String stamp; + String iPAdress; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + double versionID; + + OrdersRequest( + {this.visitType , + this.admissionNo, + this.projectID = 12, + this.stamp = '2020-04-23T21:01:21.492Z', + this.languageID = 2, + this.iPAdress = '11.11.11.11', + this.channel = 9, + this.tokenID = '@dm!n', + this.sessionID = "LlBk8lUEJY", + this.isLoginForDoctorApp = true, + this.patientTypeID = 1, + this.versionID = 1.2, + this.patientOutSA = false}); + + OrdersRequest.fromJson(Map json) { + visitType = json['VisitType']; + admissionNo = json['AdmissionNo']; + projectID = json['ProjectID']; + stamp = json['stamp']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + versionID = json['VersionID']; + } + + Map toJson() { + final Map data = new Map(); + data['VisitType'] = this.visitType; + data['AdmissionNo'] = this.admissionNo; + data['ProjectID'] = this.projectID; + data['stamp'] = this.stamp; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + 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['VersionID'] = this.versionID; + return data; + } +} \ No newline at end of file diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart new file mode 100644 index 00000000..87e2bf66 --- /dev/null +++ b/lib/models/patient/progress_note_request.dart @@ -0,0 +1,88 @@ + +/* + *@author: Ibrahim Albitar + *@Date:15/5/2020 + + *@param: +{"VisitType":5, +"AdmissionNo":2020004683, +"ProjectID":12, +"LanguageID":2, +"stamp":"2020-04-01T09:41:59.089Z", +"IPAdress":"11.11.11.11", +"VersionID":1.2, +"Channel":9, +"TokenID":"yIwh6wNyUkOeQlJRohWjyw==", +"SessionID":"LlBk8lUEJY", +"IsLoginForDoctorApp":true, +"PatientOutSA":false, +"PatientTypeID":1} + +*@return: + *@desc: + */ + +class ProgressNoteRequest { + int visitType; + int admissionNo; + int projectID; + int languageID; + String stamp; + String iPAdress; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + double versionID; + + ProgressNoteRequest( + {this.visitType , + this.admissionNo, + this.projectID = 12, + this.stamp = '2020-04-23T21:01:21.492Z', + this.languageID = 2, + this.iPAdress = '11.11.11.11', + this.channel = 9, + this.tokenID = '@dm!n', + this.sessionID = "LlBk8lUEJY", + this.isLoginForDoctorApp = true, + this.patientTypeID = 1, + this.versionID = 1.2, + this.patientOutSA = false}); + + ProgressNoteRequest.fromJson(Map json) { + visitType = json['VisitType']; + admissionNo = json['AdmissionNo']; + projectID = json['ProjectID']; + stamp = json['stamp']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + versionID = json['VersionID']; + } + + Map toJson() { + final Map data = new Map(); + data['VisitType'] = this.visitType; + data['AdmissionNo'] = this.admissionNo; + data['ProjectID'] = this.projectID; + data['stamp'] = this.stamp; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + 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['VersionID'] = this.versionID; + return data; + } +} \ No newline at end of file diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 9e6ef767..12409a39 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -1,11 +1,10 @@ import 'dart:convert'; +import 'package:doctor_app_flutter/client/app_client.dart'; 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:doctor_app_flutter/widgets/auth/login_form.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; @@ -34,6 +33,7 @@ class PatientsProvider with ChangeNotifier { List patientLabResultOrdersList = []; List patientPrescriptionsList = []; List patientRadiologyList = []; + var patientProgressNoteList = []; Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); @@ -293,4 +293,75 @@ class PatientsProvider with ChangeNotifier { handelCatchErrorCase(err); } } + + + 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'; + } 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); + } + } + + getPatientInsuranceApprovals(patient) async{ + + //setBasicData(); + try { + if (await Helpers.checkConnection()) { + final response =await AppClient.post(PATIENT_INSURANCE_APPROVALS_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) { + //patientRadiologyList = []; + res['List_ApprovalMain_InPatient'].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 (err) { + handelCatchErrorCase(err); + } + } + } diff --git a/lib/routes.dart b/lib/routes.dart index f2f5f6bb..d1fce59a 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,3 +1,5 @@ +import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; + import './screens/patients/profile/vital_sign/body_measurements_screen.dart'; import './screens/QR_reader_screen.dart'; @@ -47,6 +49,7 @@ const String VITAL_SIGN = 'patients/vital-sign'; 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 VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; @@ -75,6 +78,7 @@ var routes = { LAB_ORDERS: (_) => LabOrdersScreen(), PRESCRIPTIONS: (_) => PrescriptionScreen(), RADIOLOGY: (_) => RadiologyScreen(), + PROGRESS_NOTE: (_) => ProgressNoteScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), BODY_MEASUREMENTS: (_) => BodyMeasurementsScreen() }; diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart new file mode 100644 index 00000000..eed1563f --- /dev/null +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -0,0 +1,97 @@ +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../../config/shared_pref_kay.dart'; +import '../../../config/size_config.dart'; +import '../../../models/patient/patiant_info_model.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/card_with_bg_widget.dart'; +import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import '../../../widgets/shared/profile_image_widget.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +/* + *@author: ibrahim albitar + *@Date:15/5/2020 + *@param: + *@return: + *@desc: + */ + +class ProgressNoteScreen extends StatefulWidget { + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + PatientsProvider patientsProv; + var _isInit = true; + + /* + *@author: ibrahim al bitar + *@Date:16/5/2020 + *@param: + *@return: + *@desc: + */ + getProgressNoteList(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); + + print(type); + ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( + visitType: 5, + admissionNo: int.parse(patient.admissionNo), + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2); + patientsProv.getPatientProgressNote(progressNoteRequest.toJson()); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + getProgressNoteList(context); + } + _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) + : patientsProv.patientVitalSignList.length == 0 + ? DrAppEmbeddedError(error: 'You don\'t have any Progress Note') + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: patientsProv.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return AppText(patientsProv.patientProgressNoteList[index]["DoctorName"].toString()); + }), + ), + ); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 5bf83cf0..44f02b86 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -51,8 +51,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: CircleAvatarWidget( des: 'Vital Sign', url: url + 'heartbeat.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, ), ), InkWell( @@ -62,8 +62,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: CircleAvatarWidget( des: 'Lab Result', url: url + 'lab.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, ), ), InkWell( @@ -73,8 +73,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: CircleAvatarWidget( des: 'Prescription', url: url + 'note.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, ), ), InkWell( @@ -85,8 +85,58 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: CircleAvatarWidget( des: 'Radiology', url: url + 'radiology-1.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + InkWell( + onTap: () { + navigator(context, VITAL_SIGN); + }, + child: CircleAvatarWidget( + des: 'Progress Notes', + url: url + 'heartbeat.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), + ), + InkWell( + onTap: () { + navigator(context, PROGRESS_NOTE); + }, + child: CircleAvatarWidget( + des: 'Insurance Aprovals', + url: url + 'lab.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), + ), + InkWell( + onTap: () { + navigator(context, PRESCRIPTIONS); + }, + child: CircleAvatarWidget( + des: 'Refer Patient ', + url: url + 'note.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), + ), + InkWell( + //RADIOLOGY + onTap: () { + navigator(context, RADIOLOGY); + }, + child: CircleAvatarWidget( + des: 'Orders', + url: url + 'radiology-1.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, ), ), ], @@ -146,7 +196,7 @@ class CircleAvatarWidget extends StatelessWidget { ), AppText( des, - fontSize: 2 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, ) ], diff --git a/pubspec.lock b/pubspec.lock index 7deef573..e5831063 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,21 +21,21 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" + version: "2.0.13" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.5.2" + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.4.1" bazel_worker: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "2.0.0" build: dependency: transitive description: @@ -126,7 +126,21 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.1.3" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0" checked_yaml: dependency: transitive description: @@ -147,7 +161,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.14.12" connectivity: dependency: "direct main" description: @@ -182,7 +196,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.4" csslib: dependency: transitive description: @@ -308,6 +322,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.4" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.12" imei_plugin: dependency: "direct main" description: @@ -503,7 +524,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.3" scratch_space: dependency: transitive description: @@ -571,7 +592,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.7.0" stack_trace: dependency: transitive description: @@ -613,7 +634,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.2.15" timing: dependency: transitive description: @@ -683,7 +704,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.5.0" + version: "3.6.1" yaml: dependency: transitive description: From 2a71c2ab7926beb1828595dd16f4f625c78b7901 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 May 2020 12:48:19 +0300 Subject: [PATCH 2/6] fix merge --- pubspec.lock | 3 --- 1 file changed, 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 68d7f4e0..9b4511ab 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -36,8 +36,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.4.1" -<<<<<<< HEAD -======= barcode_scan: dependency: "direct main" description: @@ -45,7 +43,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.1" ->>>>>>> 8f56c5104af4e78067c70eb1e034615f45fcf6fc bazel_worker: dependency: transitive description: From 394bd514abaaac91586862d70db9174ebdea5581 Mon Sep 17 00:00:00 2001 From: Mahmoud Shrouf Date: Tue, 19 May 2020 14:55:02 +0300 Subject: [PATCH 3/6] My Changes Before Demo --- lib/screens/dashboard_screen.dart | 4 +- .../vital_sign/body_measurements_screen.dart | 2 +- lib/widgets/auth/verification_methods.dart | 4 +- .../profile/profile_header_widget.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 44 ++++++++++++++++--- lib/widgets/shared/app_scaffold_widget.dart | 2 +- 6 files changed, 46 insertions(+), 12 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 97e5158f..2146e547 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -252,9 +252,9 @@ class _DashboardScreenState extends State { child: DashboardItemIconText( DoctorApp.home_icon, "", - "In Patient", + "Search Medicine", showBorder: false, - backgroundColor: Colors.blueGrey[900], + backgroundColor: Colors.teal, ), onTap: () { Navigator.push( diff --git a/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart index bf89edac..992a5780 100644 --- a/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart +++ b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart @@ -36,7 +36,7 @@ class BodyMeasurementsScreen extends StatelessWidget { barGroupingType: charts.BarGroupingType.grouped, // behaviors: [new charts.SeriesLegend()], // primaryMeasureAxis: , - animationDuration: Duration(seconds: 5), + animationDuration: Duration(seconds: 1), ), ), ], diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 462f76ef..bbd386af 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -182,11 +182,11 @@ class _VerificationMethodsState extends State { Map model = { "LogInTokenID": _loggedUser['LogInTokenID'], "Channel": 9, - "MobileNumber": 785228065, //_loggedUser['MobileNumber'], + "MobileNumber": _loggedUser['MobileNumber'], "IPAdress": "11.11.11.11", "LanguageID": 2, "ProjectID": 15, //TODO : this should become daynamci - "ZipCode": 962, //_loggedUser['ZipCode'], + "ZipCode": _loggedUser['ZipCode'], "UserName": _loggedUser['List_MemberInformation'][0]['MemberID'], "OTP_SendType": oTPSendType }; diff --git a/lib/widgets/patients/profile/profile_header_widget.dart b/lib/widgets/patients/profile/profile_header_widget.dart index 4aa9f92b..1a5aec8a 100644 --- a/lib/widgets/patients/profile/profile_header_widget.dart +++ b/lib/widgets/patients/profile/profile_header_widget.dart @@ -28,7 +28,7 @@ class ProfileHeaderWidget extends StatelessWidget { height: SizeConfig.heightMultiplier * 30, child: ProfileImageWidget( url: - "http://images4.fanpop.com/image/photos/16200000/David-Schwimmer-Ross-Geller-ross-geller-16258927-629-779.jpg", + "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", name: patient.firstName + ' ' + patient.lastName, des: patient.patientId.toString(), height: SizeConfig.heightMultiplier * 17, diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 430387bc..e124a88f 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -1,13 +1,18 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../config/shared_pref_kay.dart'; import '../../config/size_config.dart'; import '../../providers/schedule_provider.dart'; import '../../routes.dart'; import '../../screens/doctor/my_schedule_screen.dart'; +import '../../util/dr_app_shared_pref.dart'; import '../../widgets/shared/drawer_item_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart'; import 'app_texts_widget.dart'; +import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); // OWNER : Ibrahim albitar // DATE : 06-04-2020 @@ -19,8 +24,30 @@ class AppDrawer extends StatefulWidget { } class _AppDrawerState extends State { + bool _isInit = true; + DoctorProfileModel doctorProfile; + @override + void didChangeDependencies() { + super.didChangeDependencies(); + // if (_isInit) { + getDocProfile();// TODO: Refactor this code to prevent errors in the cosole. + // } + _isInit = false; + } + + getDocProfile() async { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // doctorProfile = DoctorProfileModel.fromJson(profile); + setState(() { + doctorProfile = DoctorProfileModel.fromJson(profile); + }); + + String token = await sharedPref.getString(TOKEN); + } + @override Widget build(BuildContext context) { + // var x = getDocProfile(); return RoundedContainer( child: Container( margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 9), @@ -35,19 +62,20 @@ class _AppDrawerState extends State { children: [ CircleAvatar( radius: SizeConfig.imageSizeMultiplier * 12, - backgroundImage: NetworkImage( - "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png"), + backgroundImage: + NetworkImage(doctorProfile.doctorImageURL), backgroundColor: Colors.transparent, ), Padding( padding: EdgeInsets.only(top: 10), child: AppText( - "Dr. Chris evans", + doctorProfile.doctorName, + fontWeight: FontWeight.bold, color: Colors.white, - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier * 2, )), - AppText("Director of medical records", + AppText("Director of medical records",//TODO: Make The Dr Title Dynamic and check overflow issue. fontWeight: FontWeight.normal, color: Colors.white) ], ), @@ -83,6 +111,12 @@ class _AppDrawerState extends State { Navigator.of(context).pushNamed(QR_READER); }, ), + InkWell( + child: DrawerItem("lOGOUT", Icons.exit_to_app), + onTap: () { + Navigator.of(context).pushNamed(LOGIN); + }, + ), ])), ), width: SizeConfig.realScreenWidth * 0.55, diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 387871d4..d8904186 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -66,7 +66,7 @@ class AppScaffold extends StatelessWidget { height: 50, width: 50, url: - "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", + "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", ) ], ), From f4b62a615818e79cbc842c4bd16ba7fc06d0bdd3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 20 May 2020 17:21:19 +0300 Subject: [PATCH 4/6] add focus to input and fix cupertino picker --- lib/util/helpers.dart | 96 ++++++++++++++++------ lib/widgets/auth/login_form.dart | 42 +++++++--- lib/widgets/auth/verfiy_account.dart | 64 ++++++++++----- lib/widgets/auth/verification_methods.dart | 2 +- 4 files changed, 142 insertions(+), 62 deletions(-) diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 2065ea57..de75f0ec 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -16,6 +16,7 @@ DrAppToastMsg toastMsg = DrAppToastMsg(); *@desc: This class will contian some Function will help developer */ class Helpers { + int cupertinoPickerIndex = 0; /* *@author: Elham Rababah *@Date:12/4/2020 @@ -25,14 +26,58 @@ class Helpers { */ showCupertinoPicker(context, items, decKey, onSelectFun) { showModalBottomSheet( + isDismissible: false, context: context, builder: (BuildContext builder) { return Container( - height: SizeConfig.realScreenHeight * .3, - child: buildPickerItems(context, items, decKey, onSelectFun)); + // height: 500, + height: SizeConfig.realScreenHeight * 0.4, + color: Color(0xfff7f7f7), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + color: Color(0xfff7f7f7), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + CupertinoButton( + child: Text('Cancel'.toUpperCase(), style: textStyle(context)), + onPressed: () { + Navigator.pop(context); + }, + // padding: const EdgeInsets.symmetric( + // horizontal: 16.0, + // vertical: 5.0, + // ), + ), + CupertinoButton( + child: Text( + 'Done'.toUpperCase(), + style: textStyle(context), + ), + onPressed: () { + Navigator.pop(context); + onSelectFun(cupertinoPickerIndex); + }, + ) + ], + ), + ), + Container( + height: SizeConfig.realScreenHeight * 0.3, + color: Color(0xfff7f7f7), + child: + buildPickerItems(context, items, decKey, onSelectFun)) + ], + ), + ); }); } + TextStyle textStyle(context) => + TextStyle(color: Theme.of(context).primaryColor); + /* *@author: Elham Rababah *@Date:12/4/2020 @@ -41,24 +86,24 @@ class Helpers { *@desc: buildPickerIterm this function will build the items of the cupertino */ buildPickerItems(context, List items, decKey, onSelectFun) { - return Container( - child: CupertinoPicker( - magnification: 1.5, - // backgroundColor: Colors.black87, - children: items.map((item) { - return Text( - '${item["$decKey"]}', - style: TextStyle(fontSize: SizeConfig.textMultiplier *3), - ); - }).toList(), + return CupertinoPicker( + magnification: 1.5, + scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), - itemExtent: 25, //height of each item - looping: true, - onSelectedItemChanged: (int index) { - // selectitem =index; - onSelectFun(index); - }, - ), + // backgroundColor: Colors.black87, + children: items.map((item) { + return Text( + '${item["$decKey"]}', + style: TextStyle(fontSize: SizeConfig.textMultiplier * 3), + ); + }).toList(), + + itemExtent: 25, //height of each item + looping: true, + onSelectedItemChanged: (int index) { + // selectitem =index; + cupertinoPickerIndex = index; + }, ); } @@ -96,6 +141,7 @@ class Helpers { return false; } } + /* *@author: Elham Rababah *@Date:12/5/2020 @@ -103,15 +149,11 @@ class Helpers { *@return: String *@desc: generate Contact Admin Msg */ -generateContactAdminMsg([err = null]) { - String localMsg = 'Something wrong happened, please contact the admin'; + generateContactAdminMsg([err = null]) { + String localMsg = 'Something wrong happened, please contact the admin'; if (err != null) { - localMsg = localMsg +'\n \n'+ err.toString(); + localMsg = localMsg + '\n \n' + err.toString(); } return localMsg; - -} - + } } - - diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 43daa219..8ce783d0 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -53,6 +53,9 @@ class _LoginFormState extends State { @override Widget build(BuildContext context) { + final focusPass = FocusNode(); + final focusProject = FocusNode(); + if (projectsList.length == 0) { getProjectsList(); } @@ -68,6 +71,7 @@ class _LoginFormState extends State { buildSizedBox(), TextFormField( keyboardType: TextInputType.number, + textInputAction: TextInputAction.next, decoration: buildInputDecoration( context, 'Enter ID', 'assets/images/user_id_icon.png'), validator: (value) { @@ -79,23 +83,35 @@ class _LoginFormState extends State { onSaved: (value) { userInfo.UserID = value; }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusPass); + }, ), buildSizedBox(), TextFormField( - obscureText: true, - decoration: buildInputDecoration(context, 'Enter Password', - 'assets/images/password_icon.png'), - validator: (value) { - if (value.isEmpty) { - return 'Please enter your Password'; - } - return null; - }, - onSaved: (value) { - userInfo.Password = value; - }), + focusNode: focusPass, + obscureText: true, + textInputAction: TextInputAction.next, + decoration: buildInputDecoration( + context, 'Enter Password', 'assets/images/password_icon.png'), + validator: (value) { + if (value.isEmpty) { + return 'Please enter your Password'; + } + return null; + }, + onSaved: (value) { + userInfo.Password = value; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusProject); + helpers.showCupertinoPicker( + context, projectsList, 'Name', onSelectProject); + }, + ), buildSizedBox(), TextFormField( + focusNode: focusProject, controller: projectIdController, onTap: () { helpers.showCupertinoPicker( @@ -312,7 +328,7 @@ class _LoginFormState extends State { onSelectProject(index) { setState(() { userInfo.ProjectID = projectsList[index]["ID"]; - projectIdController.text = projectsList[index]['Desciption']; + projectIdController.text = projectsList[index]['Name']; }); } } diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index f701d554..465ce07e 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -51,7 +51,10 @@ class _VerifyAccountState extends State { @override Widget build(BuildContext context) { authProv = Provider.of(context); - + final focusD1 = FocusNode(); + final focusD2 = FocusNode(); + final focusD3 = FocusNode(); + final focusD4 = FocusNode(); return FutureBuilder( future: Future.wait([_loggedUserFuture]), builder: (BuildContext context, AsyncSnapshot snapshot) { @@ -78,6 +81,7 @@ class _VerifyAccountState extends State { Container( width: SizeConfig.realScreenWidth * 0.20, child: TextFormField( + textInputAction: TextInputAction.next, style: buildTextStyle(), maxLength: 1, textAlign: TextAlign.center, @@ -89,24 +93,37 @@ class _VerifyAccountState extends State { val; }, validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD2); + }, )), Container( - width: SizeConfig.realScreenWidth * 0.20, - child: TextFormField( - maxLength: 1, - textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), - onSaved: (val) { - verifyAccountFormValue['digit2'] = - val; - }, - validator: validateCodeDigit)), + width: SizeConfig.realScreenWidth * 0.20, + child: TextFormField( + focusNode: focusD2, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType.number, + decoration: + buildInputDecoration(context), + onSaved: (val) { + verifyAccountFormValue['digit2'] = + val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD3); + }, + validator: validateCodeDigit), + ), Container( width: SizeConfig.realScreenWidth * 0.20, child: TextFormField( + focusNode: focusD3, + textInputAction: TextInputAction.next, maxLength: 1, textAlign: TextAlign.center, style: buildTextStyle(), @@ -116,11 +133,15 @@ class _VerifyAccountState extends State { onSaved: (val) { verifyAccountFormValue['digit3'] = val; - }, + },onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, validator: validateCodeDigit)), Container( width: SizeConfig.realScreenWidth * 0.20, child: TextFormField( + focusNode: focusD4, maxLength: 1, textAlign: TextAlign.center, style: buildTextStyle(), @@ -294,18 +315,19 @@ class _VerifyAccountState extends State { if (res['MessageStatus'] == 1) { sharedPref.setString(TOKEN, res['AuthenticationTokenID']); if (res['List_DoctorProfile'] != null) { - loginProcessCompleted(res['List_DoctorProfile'][0],changeLoadingStata); + loginProcessCompleted( + res['List_DoctorProfile'][0], changeLoadingStata); } else { _asyncSimpleDialog(context, res['List_DoctorsClinic'], 'ClinicName', 'Please Select Clinic') .then((clinicInfo) { ClinicModel clinic = ClinicModel.fromJson(clinicInfo); print(clinicInfo); - getDocProfiles(clinic, changeLoadingStata); + getDocProfiles(clinic, changeLoadingStata); }); } } else { - changeLoadingStata(false); + changeLoadingStata(false); helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { @@ -319,7 +341,6 @@ class _VerifyAccountState extends State { } } - /* *@author: Elham Rababah *@Date:17/5/2020 @@ -327,7 +348,8 @@ class _VerifyAccountState extends State { *@return: *@desc: loginProcessCompleted */ - loginProcessCompleted(Map profile, Function changeLoadingStata) { + loginProcessCompleted( + Map profile, Function changeLoadingStata) { changeLoadingStata(false); sharedPref.setObj(DOCTOR_PROFILE, profile); Navigator.of(context).pushNamed(HOME); @@ -375,7 +397,7 @@ class _VerifyAccountState extends State { print("DoctorProfileList ${res['DoctorProfileList'][0]}"); loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata); } else { - changeLoadingStata(false); + changeLoadingStata(false); helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index bbd386af..0eb11866 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -150,7 +150,7 @@ class _VerificationMethodsState extends State { top: SizeConfig.heightMultiplier * 0.5), child: Image.asset( url, - height: SizeConfig.heightMultiplier * 11, + height: SizeConfig.heightMultiplier * 10, fit: BoxFit.cover, ), ), From 1ee2655e63326b5e7b0ebe1cd9fcce7b452a03fc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 May 2020 14:50:40 +0300 Subject: [PATCH 5/6] add new screens --- lib/config/config.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/config/config.dart b/lib/config/config.dart index 520b2029..15e73f79 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -16,6 +16,9 @@ const GET_PATIENT_LAB_OREDERS = 'DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Patients.svc/REST/GetPrescriptionApptList'; const GET_RADIOLOGY = 'DoctorApplication.svc/REST/GetPatientRadResult'; + +var selectedPatientType = 0; + //*********change value to decode json from Dropdown ************ var SERVICES_PATIANT = [ "GetMyOutPatient", From 7d1cfb7b4e41b51f3aaafa01cc37ddaafb60c0fd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 May 2020 14:51:20 +0300 Subject: [PATCH 6/6] add new screens --- lib/providers/patients_provider.dart | 8 +- lib/routes.dart | 7 + .../patients/patient_search_screen.dart | 1 + .../profile/insurance_approvals_screen.dart | 151 ++++++++++++++++++ .../profile/patient_orders_screen.dart | 150 +++++++++++++++++ .../profile/progress_note_screen.dart | 71 ++++++-- .../profile/profile_medical_info_widget.dart | 86 +++++----- 7 files changed, 423 insertions(+), 51 deletions(-) create mode 100644 lib/screens/patients/profile/insurance_approvals_screen.dart create mode 100644 lib/screens/patients/profile/patient_orders_screen.dart diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index af9c77b3..dbf68203 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -31,6 +31,7 @@ class PatientsProvider with ChangeNotifier { List patientPrescriptionsList = []; List patientRadiologyList = []; var patientProgressNoteList = []; + var insuranceApporvalsList = []; Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); @@ -284,8 +285,7 @@ class PatientsProvider with ChangeNotifier { getPatientProgressNote(patient) async{ - - //setBasicData(); + setBasicData(); try { if (await Helpers.checkConnection()) { final response =await AppClient.post(PATIENT_PROGRESS_NOTE_URL, body: json.encode(patient)); @@ -333,9 +333,7 @@ class PatientsProvider with ChangeNotifier { print('$res'); if (res['MessageStatus'] == 1) { //patientRadiologyList = []; - res['List_ApprovalMain_InPatient'].forEach((v) { - //patientRadiologyList.add(new RadiologyResModel.fromJson(v)); - }); + insuranceApporvalsList = res['List_ApprovalMain_InPatient']; } else { isError = true; error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; diff --git a/lib/routes.dart b/lib/routes.dart index d1fce59a..c53868c9 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,3 +1,6 @@ +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 './screens/patients/profile/vital_sign/body_measurements_screen.dart'; @@ -50,6 +53,8 @@ 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 PATIENT_ORDERS = 'patients/patient_orders'; +const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; @@ -79,6 +84,8 @@ var routes = { PRESCRIPTIONS: (_) => PrescriptionScreen(), RADIOLOGY: (_) => RadiologyScreen(), PROGRESS_NOTE: (_) => ProgressNoteScreen(), + PATIENT_ORDERS: (_) => PatientsOrdersScreen(), + PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), BODY_MEASUREMENTS: (_) => BodyMeasurementsScreen() }; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 914faf06..5fac0e34 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -165,6 +165,7 @@ class _PatientSearchScreenState extends State { onChanged: (String newValue) => { setState(() { _selectedType = newValue; + selectedPatientType = int.parse(_selectedType); }) }, items: PATIENT_TYPE.map((item) { diff --git a/lib/screens/patients/profile/insurance_approvals_screen.dart b/lib/screens/patients/profile/insurance_approvals_screen.dart new file mode 100644 index 00000000..d3083f7a --- /dev/null +++ b/lib/screens/patients/profile/insurance_approvals_screen.dart @@ -0,0 +1,151 @@ +import 'package:doctor_app_flutter/models/patient/insurance_aprovals_request.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../../config/shared_pref_kay.dart'; +import '../../../config/size_config.dart'; +import '../../../models/patient/patiant_info_model.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:21/5/2020 + *@param: + *@return: + *@desc: + */ + +class InsuranceApprovalsScreen extends StatefulWidget { + @override + _InsuranceApprovalsState createState() => _InsuranceApprovalsState(); +} + +class _InsuranceApprovalsState extends State { + PatientsProvider patientsProv; + var _isInit = true; + + /* + *@author: ibrahim al bitar + *@Date:21/5/2020 + *@param: + *@return: + *@desc: + */ + getInsuranceApprovalsList(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); + + print(type); + InsuranceAprovalsRequest insuranceApprovalsRequest = InsuranceAprovalsRequest( + patientID: patient.patientId, + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2); + patientsProv.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + getInsuranceApprovalsList(context); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Insurance Approvals", + showAppDrawer: false, + showBottomBar: false, + body: patientsProv.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProv.isError + ? DrAppEmbeddedError(error: patientsProv.error) + : patientsProv.insuranceApporvalsList.length == 0 + ? DrAppEmbeddedError( + error: 'You don\'t have any Insurance Approvals') + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: + patientsProv.insuranceApporvalsList.length, + itemBuilder: (BuildContext ctxt, int index) { + return RoundedContainer( + backgroundColor: Colors.yellow[200], + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patientsProv + .insuranceApporvalsList[index] + ["ClinicName"]+"-"+patientsProv + .insuranceApporvalsList[index] + ["DoctorName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + convertDateFormat(patientsProv + .insuranceApporvalsList[index] + ["ApprovalDate"]), + marginLeft: 10, + color: Colors.grey[600], + ), + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + AppText( + patientsProv + .insuranceApporvalsList[index] + ["CompanyName"], + margin: 10, + ) + ], + )); + }), + ), + ); + } + + convertDateFormat(String str) { + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } +} diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart new file mode 100644 index 00000000..d05a7504 --- /dev/null +++ b/lib/screens/patients/profile/patient_orders_screen.dart @@ -0,0 +1,150 @@ +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../../config/shared_pref_kay.dart'; +import '../../../config/size_config.dart'; +import '../../../models/patient/patiant_info_model.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:21/5/2020 + *@param: + *@return: + *@desc: + */ + +class PatientsOrdersScreen extends StatefulWidget { + @override + _PatientsOrdersState createState() => _PatientsOrdersState(); +} + +class _PatientsOrdersState extends State { + PatientsProvider patientsProv; + var _isInit = true; + + /* + *@author: ibrahim al bitar + *@Date:21/5/2020 + *@param: + *@return: + *@desc: + */ + getProgressNoteList(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); + + print(type); + ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( + visitType: 3, // if equal 3 then this will return orders + admissionNo: int.parse(patient.admissionNo), + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2); + patientsProv.getPatientProgressNote(progressNoteRequest.toJson()); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + getProgressNoteList(context); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Orders", + showAppDrawer: false, + showBottomBar: false, + body: patientsProv.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProv.isError + ? DrAppEmbeddedError(error: patientsProv.error) + : patientsProv.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: 'You don\'t have any Orders') + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: + patientsProv.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return RoundedContainer( + + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patientsProv + .patientProgressNoteList[index] + ["DoctorName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + convertDateFormat(patientsProv + .patientProgressNoteList[index] + ["AssessmentDate"]), + marginLeft: 10, + color: Colors.grey[600], + ), + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + AppText( + patientsProv + .patientProgressNoteList[index] + ["Notes"], + margin: 10, + ) + ], + )); + }), + ), + ); + } + + convertDateFormat(String str) { + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } +} diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart index eed1563f..7381e85b 100644 --- a/lib/screens/patients/profile/progress_note_screen.dart +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; -import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -11,9 +11,7 @@ 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/card_with_bg_widget.dart'; import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import '../../../widgets/shared/profile_image_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -46,10 +44,10 @@ class _ProgressNoteState extends State { PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - + print(type); ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( - visitType: 5, + visitType: 5, // if equal 5 then this will return progress note admissionNo: int.parse(patient.admissionNo), projectID: patient.projectId, tokenID: token, @@ -78,8 +76,9 @@ class _ProgressNoteState extends State { ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) - : patientsProv.patientVitalSignList.length == 0 - ? DrAppEmbeddedError(error: 'You don\'t have any Progress Note') + : patientsProv.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: 'You don\'t have any Progress Note') : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, @@ -87,11 +86,65 @@ class _ProgressNoteState extends State { SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( - itemCount: patientsProv.patientProgressNoteList.length, + itemCount: + patientsProv.patientProgressNoteList.length, itemBuilder: (BuildContext ctxt, int index) { - return AppText(patientsProv.patientProgressNoteList[index]["DoctorName"].toString()); + return RoundedContainer( + backgroundColor: Colors.yellow[200], + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patientsProv + .patientProgressNoteList[index] + ["DoctorName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + convertDateFormat(patientsProv + .patientProgressNoteList[index] + ["AssessmentDate"]), + marginLeft: 10, + color: Colors.grey[600], + ), + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + AppText( + patientsProv + .patientProgressNoteList[index] + ["Notes"], + margin: 10, + ) + ], + )); }), ), ); } + + convertDateFormat(String str) { + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 6394ae6d..3f40204b 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; @@ -94,49 +95,60 @@ class ProfileMedicalInfoWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - InkWell( - onTap: () { - navigator(context, PROGRESS_NOTE); - }, - child: CircleAvatarWidget( - des: 'Progress Notes', - url: url + 'heartbeat.png', - width: (contWidth) / 4.5, - height: (contWidth) / 4.5, + Visibility( + visible: selectedPatientType != 0 && selectedPatientType != 5 , + child: InkWell( + onTap: () { + navigator(context, PROGRESS_NOTE); + }, + child: CircleAvatarWidget( + des: 'Progress Notes', + url: url + 'heartbeat.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), ), ), - InkWell( - onTap: () { - navigator(context, PROGRESS_NOTE); - }, - child: CircleAvatarWidget( - des: 'Insurance Aprovals', - url: url + 'lab.png', - width: (contWidth) / 4.5, - height: (contWidth) / 4.5, + Visibility( + + child: InkWell( + onTap: () { + navigator(context, PATIENT_INSURANCE_APPROVALS); + }, + child: CircleAvatarWidget( + des: 'Insurance Aprovals', + url: url + 'lab.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), ), ), - InkWell( - onTap: () { - navigator(context, PRESCRIPTIONS); - }, - child: CircleAvatarWidget( - des: 'Refer Patient ', - url: url + 'note.png', - width: (contWidth) / 4.5, - height: (contWidth) / 4.5, + Visibility( + visible: selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 2, + child: InkWell( + onTap: () { + navigator(context, PRESCRIPTIONS); + }, + child: CircleAvatarWidget( + des: 'Refer Patient ', + url: url + 'note.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), ), ), - InkWell( - //RADIOLOGY - onTap: () { - navigator(context, RADIOLOGY); - }, - child: CircleAvatarWidget( - des: 'Orders', - url: url + 'radiology-1.png', - width: (contWidth) / 4.5, - height: (contWidth) / 4.5, + Visibility( + visible: selectedPatientType != 0 && selectedPatientType != 5, + child: InkWell( + onTap: () { + navigator(context, PATIENT_ORDERS); + }, + child: CircleAvatarWidget( + des: 'Orders', + url: url + 'radiology-1.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), ), ), ],