From 9f4802c22550dd57c30131a929bf5ff8117a1e74 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 May 2020 12:16:32 +0300 Subject: [PATCH 1/6] progress note --- lib/config/config.dart | 4 +- lib/providers/patients_provider.dart | 2 +- .../profile/progress_note_screen.dart | 153 ++++++++++++------ 3 files changed, 107 insertions(+), 52 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 8ebef939..6b269bad 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -3,7 +3,7 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; +const BASE_URL = 'https://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"; @@ -50,7 +50,7 @@ var SERVICES_PATIANT_HEADER = [ //****************** // Colors ////// by : ibrahim -const PRIMARY_COLOR = 0xff58434F; +const PRIMARY_COLOR = 0xf5f5f5; const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index dbf68203..c5f92247 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -318,7 +318,7 @@ class PatientsProvider with ChangeNotifier { getPatientInsuranceApprovals(patient) async{ - //setBasicData(); + setBasicData(); try { if (await Helpers.checkConnection()) { final response =await AppClient.post(PATIENT_INSURANCE_APPROVALS_URL, body: json.encode(patient)); diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart index 7381e85b..428de7c5 100644 --- a/lib/screens/patients/profile/progress_note_screen.dart +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -1,7 +1,9 @@ +import 'package:doctor_app_flutter/config/config.dart'; 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:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../../config/shared_pref_kay.dart'; @@ -30,6 +32,9 @@ class ProgressNoteScreen extends StatefulWidget { class _ProgressNoteState extends State { PatientsProvider patientsProv; + var notesList; + var filteredNotesList; + final _controller = TextEditingController(); var _isInit = true; /* @@ -62,6 +67,7 @@ class _ProgressNoteState extends State { if (_isInit) { patientsProv = Provider.of(context); getProgressNoteList(context); + notesList = patientsProv.patientProgressNoteList; } _isInit = false; } @@ -76,59 +82,108 @@ class _ProgressNoteState extends State { ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) - : patientsProv.patientProgressNoteList.length == 0 + : notesList == null ? 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 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, - ) - ], - )); - }), - ), + : Column( + children: [ + Container( + width: SizeConfig.screenWidth * 0.80, + margin: EdgeInsets.all(20), + child: TextField( + controller: _controller, + onChanged: (String str) { + this.searchData(str); + }, + decoration: buildInputDecoration( + context, 'Search Patient'), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: + notesList.length, + itemBuilder: (BuildContext ctxt, int index) { + return RoundedContainer( + backgroundColor: Colors.yellow[200], + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + notesList[index] + ["DoctorName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + convertDateFormat(notesList[index] + ["AssessmentDate"]), + marginLeft: 10, + color: Colors.grey[600], + ), + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + AppText( + notesList[index] + ["Notes"], + margin: 10, + ) + ], + )); + }), + ), + ), + ], + ), ); } + + InputDecoration buildInputDecoration(BuildContext context, hint) { + return InputDecoration( + prefixIcon: Icon(Icons.search, color:Colors.black), + filled: true, + fillColor: Colors.white, + hintText: hint, + hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(20)), + borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(50.0)), + borderSide: BorderSide(color: Colors.grey), //), + )); + } + +searchData(String str) { + + var strExist = str.length > 0 ? true : false; + + if(strExist){ + filteredNotesList = null; + filteredNotesList = notesList.where((note) => note["DoctorName"].toString().contains(str.toUpperCase())).toList(); + setState(() { + notesList = filteredNotesList; + }); + }else{ + setState(() { + notesList = patientsProv.patientProgressNoteList; + }); + } + } convertDateFormat(String str) { const start = "/Date("; From 0c112ebca5233f3c217ff5f1f07fa990d6ecf87f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Jun 2020 00:34:16 +0300 Subject: [PATCH 2/6] finished new screens --- lib/config/config.dart | 4 +- .../patient/insurance_aprovals_request.dart | 2 +- lib/models/patient/orders_request.dart | 2 +- lib/models/patient/progress_note_request.dart | 2 +- .../profile/insurance_approvals_screen.dart | 386 +++++++++++++++--- .../profile/patient_orders_screen.dart | 168 +++++--- .../profile/progress_note_screen.dart | 143 ++++--- 7 files changed, 529 insertions(+), 178 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index f1a58489..92291ed3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -3,7 +3,7 @@ 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 PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; @@ -50,7 +50,7 @@ var SERVICES_PATIANT_HEADER = [ //****************** // Colors ////// by : ibrahim -const PRIMARY_COLOR = 0xf5f5f5; +const PRIMARY_COLOR = 0xff515B5D; const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index b94b9b9b..e36355d8 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -46,7 +46,7 @@ class InsuranceAprovalsRequest { this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', this.versionID = 1.2, - this.tokenID = '@dm!n', + this.tokenID , this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, this.patientOutSA = false}); diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart index 92df2ab9..5e1283fa 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/models/patient/orders_request.dart @@ -45,7 +45,7 @@ class OrdersRequest { this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID = '@dm!n', + this.tokenID , this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index 87e2bf66..ce38b56e 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -45,7 +45,7 @@ class ProgressNoteRequest { this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID = '@dm!n', + this.tokenID , this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, diff --git a/lib/screens/patients/profile/insurance_approvals_screen.dart b/lib/screens/patients/profile/insurance_approvals_screen.dart index d3083f7a..e2d531c5 100644 --- a/lib/screens/patients/profile/insurance_approvals_screen.dart +++ b/lib/screens/patients/profile/insurance_approvals_screen.dart @@ -1,7 +1,10 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/patient/insurance_aprovals_request.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../../config/shared_pref_kay.dart'; @@ -30,6 +33,9 @@ class InsuranceApprovalsScreen extends StatefulWidget { class _InsuranceApprovalsState extends State { PatientsProvider patientsProv; + var approvalsList; + var filteredApprovalsList; + final _controller = TextEditingController(); var _isInit = true; /* @@ -46,13 +52,15 @@ class _InsuranceApprovalsState extends State { 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()); + InsuranceAprovalsRequest insuranceApprovalsRequest = + InsuranceAprovalsRequest( + patientID: patient.patientId, + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2); + patientsProv + .getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()); } @override @@ -61,8 +69,9 @@ class _InsuranceApprovalsState extends State { if (_isInit) { patientsProv = Provider.of(context); getInsuranceApprovalsList(context); + approvalsList = patientsProv.insuranceApporvalsList; + _isInit = false; } - _isInit = false; } @override @@ -75,62 +84,320 @@ class _InsuranceApprovalsState extends State { ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) - : patientsProv.insuranceApporvalsList.length == 0 + : patientsProv.insuranceApporvalsList == null ? 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, - ) - ], - )); - }), + : Column( + children: [ + Container( + margin: EdgeInsets.all(10), + width: SizeConfig.screenWidth * 0.80, + child: TextField( + controller: _controller, + onChanged: (String str) { + this.searchData(str); + }, + decoration: buildInputDecoration( + context, 'Search Insurance Approvals'), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: approvalsList.length, + itemBuilder: (BuildContext ctxt, int index) { + return RoundedContainer( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Row( + children: [ + Icon( + approvalsList[index][ + "ApprovalStatusDescption"] + .toString() + .contains("Approved") + ? Icons.check_circle_outline + : approvalsList[index][ + "ApprovalStatusDescption"] + .toString() + .contains("Cancelled") + ? Icons.highlight_off + : Icons.history, + color: approvalsList[index][ + "ApprovalStatusDescption"] + .toString() + .contains("Approved") + ? Colors.green + : approvalsList[index][ + "ApprovalStatusDescption"] + .toString() + .contains("Cancelled") + ? Colors.red + : Colors.yellow, + ), + Expanded( + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + approvalsList[index] + ["ClinicName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + approvalsList[index] + ["DoctorName"], + marginLeft: 10, + marginTop: 1, + ), + AppText( + convertDateFormat( + approvalsList[index] + ["ApprovalDate"]), + marginLeft: 10, + marginBottom: 5, + color: Colors.grey[600], + ), + ], + ), + ) + ], + ), + children: [ + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + RoundedContainer( + backgroundColor: + Color(PRIMARY_COLOR), + child: Column( + children: [ + Row( + children: [ + AppText( + "Approval No:", + color: Colors.white, + fontSize: 16, + margin: 10, + ), + AppText( + approvalsList[index] + ["ApprovalNo"] + .toString(), + color: Colors.white, + fontSize: 19, + fontWeight: + FontWeight.bold, + margin: 5, + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + "PRODUCER NAME", + fontSize: 10, + color: Colors.white, + marginLeft: SizeConfig + .widthMultiplier * + 3, + ), + AppText(checkList(approvalsList[index]["ApporvalDetails"])? + approvalsList[index] + [ + "ApporvalDetails"][0] + [ + "ProcedureName"] : "", + fontSize: 12, + fontWeight: FontWeight.bold, + marginLeft: SizeConfig + .widthMultiplier * + 3, + marginTop: 3, + color: Colors.white, + ), + ], + ), + ), + Expanded( + flex: 1, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + "STATUS", + fontSize: 10, + color: Colors.white, + marginLeft: SizeConfig + .widthMultiplier * + 9, + ), + AppText( + approvalsList[index] + [ + "ApprovalStatusDescption"], + fontSize: 12, + fontWeight: FontWeight.bold, + marginLeft: SizeConfig + .widthMultiplier * + 9, + marginTop: 3, + color: Colors.white, + ), + ], + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + "RECEIPT ON", + fontSize: 10, + color: Colors.white, + marginLeft: SizeConfig + .widthMultiplier * + 3, + marginTop: SizeConfig + .heightMultiplier * + 1.5, + ), + AppText( + convertDateFormat( approvalsList[index] + ["ReceiptOn"]), + fontSize: 12, + fontWeight: FontWeight.bold, + marginLeft: SizeConfig + .widthMultiplier * + 3, + marginTop: 3, + marginBottom: SizeConfig.heightMultiplier*2, + color: Colors.white, + ), + ], + ), + ), + Expanded( + flex: 1, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + "EXPIRY DATE", + fontSize: 10, + color: Colors.white, + marginTop: SizeConfig + .heightMultiplier * + 1.5, + marginLeft: SizeConfig + .widthMultiplier * + 9, + ), + AppText( + convertDateFormat( + approvalsList[ + index][ + "ExpiryDate"]), + fontSize: 12, + fontWeight: FontWeight.bold, + marginLeft: SizeConfig + .widthMultiplier * + 9, + marginTop: 3, + marginBottom: SizeConfig.heightMultiplier*2, + color: Colors.white, + ), + ], + ), + ), + ], + ), + ], + )), + ], + ), + ], + )); + }), + ), + ), + ], ), ); } + InputDecoration buildInputDecoration(BuildContext context, hint) { + return InputDecoration( + prefixIcon: Icon(Icons.search, color: Colors.black), + filled: true, + fillColor: Colors.white, + hintText: hint, + hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10)), + borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Colors.grey), //), + )); + } + + searchData(String str) { + var strExist = str.length > 0 ? true : false; + + if (strExist) { + filteredApprovalsList = null; + filteredApprovalsList = approvalsList + .where((note) => + note["ClinicName"].toString().contains(str.toUpperCase())) + .toList(); + setState(() { + approvalsList = filteredApprovalsList; + }); + } else { + setState(() { + approvalsList = patientsProv.insuranceApporvalsList; + }); + } + } + convertDateFormat(String str) { const start = "/Date("; const end = "+0300)"; @@ -148,4 +415,7 @@ class _InsuranceApprovalsState extends State { return newDate.toString(); } + bool checkList(List list){ + return list.length > 0 ? true : false; + } } diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart index d05a7504..b602fea7 100644 --- a/lib/screens/patients/profile/patient_orders_screen.dart +++ b/lib/screens/patients/profile/patient_orders_screen.dart @@ -1,7 +1,9 @@ +import 'package:doctor_app_flutter/config/config.dart'; 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:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../../config/shared_pref_kay.dart'; @@ -30,6 +32,9 @@ class PatientsOrdersScreen extends StatefulWidget { class _PatientsOrdersState extends State { PatientsProvider patientsProv; + var notesList; + var filteredNotesList; + final _controller = TextEditingController(); var _isInit = true; /* @@ -47,7 +52,7 @@ class _PatientsOrdersState extends State { print(type); ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( - visitType: 3, // if equal 3 then this will return orders + visitType: 3, // if equal 3 then this will return orders admissionNo: int.parse(patient.admissionNo), projectID: patient.projectId, tokenID: token, @@ -62,6 +67,7 @@ class _PatientsOrdersState extends State { if (_isInit) { patientsProv = Provider.of(context); getProgressNoteList(context); + notesList = patientsProv.patientProgressNoteList; } _isInit = false; } @@ -76,60 +82,122 @@ class _PatientsOrdersState extends State { ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) - : patientsProv.patientProgressNoteList.length == 0 + : notesList == null ? 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, - ) - ], - )); - }), + error: 'You don\'t have any Orders') + : Column( + children: [ + Container( + margin: EdgeInsets.all(10), + width: SizeConfig.screenWidth * 0.80, + child: TextField( + controller: _controller, + onChanged: (String str) { + this.searchData(str); + }, + decoration: + buildInputDecoration(context, 'Search Orders'), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: notesList.length, + itemBuilder: (BuildContext ctxt, int index) { + return RoundedContainer( + backgroundColor: Colors.white, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + notesList[index] + ["DoctorName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + convertDateFormat( + notesList[index] + ["AssessmentDate"]), + marginLeft: 10, + color: Colors.grey[600], + ), + ], + ), + ), + children: [ + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + AppText( + notesList[index]["Notes"], + margin: 5, + ) + ], + ), + ], + )); + }), + ), + ), + ], ), ); } + InputDecoration buildInputDecoration(BuildContext context, hint) { + return InputDecoration( + prefixIcon: Icon(Icons.search, color: Colors.black), + filled: true, + fillColor: Colors.white, + hintText: hint, + hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(20)), + borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(50.0)), + borderSide: BorderSide(color: Colors.grey), //), + )); + } + + searchData(String str) { + var strExist = str.length > 0 ? true : false; + + if (strExist) { + filteredNotesList = null; + filteredNotesList = notesList + .where((note) => + note["DoctorName"].toString().contains(str.toUpperCase())) + .toList(); + setState(() { + notesList = filteredNotesList; + }); + } else { + setState(() { + notesList = patientsProv.patientProgressNoteList; + }); + } + } + convertDateFormat(String str) { const start = "/Date("; const end = "+0300)"; diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart index 428de7c5..0014432c 100644 --- a/lib/screens/patients/profile/progress_note_screen.dart +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -86,20 +86,20 @@ class _ProgressNoteState extends State { ? DrAppEmbeddedError( error: 'You don\'t have any Progress Note') : Column( - children: [ - Container( - width: SizeConfig.screenWidth * 0.80, - margin: EdgeInsets.all(20), - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str); - }, - decoration: buildInputDecoration( - context, 'Search Patient'), - ), - ), - Expanded( + children: [ + Container( + margin: EdgeInsets.all(10), + width: SizeConfig.screenWidth * 0.80, + child: TextField( + controller: _controller, + onChanged: (String str) { + this.searchData(str); + }, + decoration: + buildInputDecoration(context, 'Search Note'), + ), + ), + Expanded( child: Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, @@ -107,82 +107,95 @@ class _ProgressNoteState extends State { SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( - itemCount: - notesList.length, + itemCount: notesList.length, itemBuilder: (BuildContext ctxt, int index) { return RoundedContainer( - backgroundColor: Colors.yellow[200], + backgroundColor: Colors.white, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText( - notesList[index] - ["DoctorName"], - marginTop: 10, - marginLeft: 10, - marginBottom: 5, - fontWeight: FontWeight.bold, - ), - AppText( - convertDateFormat(notesList[index] - ["AssessmentDate"]), - marginLeft: 10, - color: Colors.grey[600], + ExpansionTile( + title: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + notesList[index] + ["DoctorName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + convertDateFormat( + notesList[index] + ["AssessmentDate"]), + marginLeft: 10, + color: Colors.grey[600], + ), + ], + ), + ), + children: [ + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + AppText( + notesList[index]["Notes"], + margin: 5, + ) + ], ), - Divider( - color: Colors.black, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - AppText( - notesList[index] - ["Notes"], - margin: 10, - ) ], )); }), ), - ), - ], - ), + ), + ], + ), ); } - + InputDecoration buildInputDecoration(BuildContext context, hint) { return InputDecoration( - prefixIcon: Icon(Icons.search, color:Colors.black), + prefixIcon: Icon(Icons.search, color: Colors.black), filled: true, fillColor: Colors.white, hintText: hint, hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), + borderRadius: BorderRadius.all(Radius.circular(10)), borderSide: BorderSide(color: Hexcolor('#CCCCCC')), ), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(50.0)), + borderRadius: BorderRadius.all(Radius.circular(10.0)), borderSide: BorderSide(color: Colors.grey), //), )); } -searchData(String str) { - - var strExist = str.length > 0 ? true : false; - - if(strExist){ - filteredNotesList = null; - filteredNotesList = notesList.where((note) => note["DoctorName"].toString().contains(str.toUpperCase())).toList(); - setState(() { - notesList = filteredNotesList; - }); - }else{ - setState(() { - notesList = patientsProv.patientProgressNoteList; - }); - } + searchData(String str) { + var strExist = str.length > 0 ? true : false; + + if (strExist) { + filteredNotesList = null; + filteredNotesList = notesList + .where((note) => + note["DoctorName"].toString().contains(str.toUpperCase())) + .toList(); + setState(() { + notesList = filteredNotesList; + }); + } else { + setState(() { + notesList = patientsProv.patientProgressNoteList; + }); + } } convertDateFormat(String str) { From 3c3d85c255e330d9d7b4583b211af1a251a2e23e Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Tue, 2 Jun 2020 09:48:03 +0300 Subject: [PATCH 3/6] My Referred Patient --- lib/models/my_referred_patient_model.dart | 224 +++++++++++ lib/providers/referred_patient_provider.dart | 77 ++++ lib/screens/dashboard_screen.dart | 35 +- .../doctor/my_referred_patient_screen.dart | 67 ++++ .../doctor/my_referred_patient_widget.dart | 360 ++++++++++++++++++ 5 files changed, 760 insertions(+), 3 deletions(-) create mode 100644 lib/models/my_referred_patient_model.dart create mode 100644 lib/providers/referred_patient_provider.dart create mode 100644 lib/screens/doctor/my_referred_patient_screen.dart create mode 100644 lib/widgets/doctor/my_referred_patient_widget.dart diff --git a/lib/models/my_referred_patient_model.dart b/lib/models/my_referred_patient_model.dart new file mode 100644 index 00000000..4aaef077 --- /dev/null +++ b/lib/models/my_referred_patient_model.dart @@ -0,0 +1,224 @@ +/* + *@author: Amjad amireh + *@Date:1/6/2020 + *@param: + *@return: + *@desc: MyReferredPatientModel + */ + +import 'dart:convert'; +import 'package:doctor_app_flutter/util/helpers.dart'; + + +import 'package:doctor_app_flutter/util/helpers.dart'; + +class MyReferredPatientModel { + int projectID; + int lineItemNo; + int doctorID; + int patientID; + String doctorName; + String doctorNameN; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomID; + String bedID; + String nursingStationID; + String description; + String nationalityName; + String nationalityNameN; + String clinicDescription; + String clinicDescriptionN; + int referralDoctor; + int referringDoctor; + int referralClinic; + int referringClinic; + int referralStatus; + String referralDate; + String referringDoctorRemarks; + String referredDoctorRemarks; + String referralResponseOn; + int priority; + int frequency; + DateTime mAXResponseTime; + String age; + String frequencyDescription; + String genderDescription; + bool isDoctorLate; + bool isDoctorResponse; + String nursingStationName; + String priorityDescription; + String referringClinicDescription; + String referringDoctorName; + + MyReferredPatientModel( + {this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.age, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); + + MyReferredPatientModel.fromJson(Map json) { + projectID = json['ProjectID']; + lineItemNo = json['LineItemNo']; + doctorID = json['DoctorID']; + patientID = json['PatientID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + mobileNumber = json['MobileNumber']; + emailAddress = json['EmailAddress']; + patientIdentificationNo = json['PatientIdentificationNo']; + patientType = json['PatientType']; + admissionNo = json['AdmissionNo']; + admissionDate = json['AdmissionDate']; + roomID = json['RoomID']; + bedID = json['BedID']; + nursingStationID = json['NursingStationID']; + description = json['Description']; + nationalityName = json['NationalityName']; + nationalityNameN = json['NationalityNameN']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + referralDoctor = json['ReferralDoctor']; + referringDoctor = json['ReferringDoctor']; + referralClinic = json['ReferralClinic']; + referringClinic = json['ReferringClinic']; + referralStatus = json['ReferralStatus']; + referralDate = json['ReferralDate']; + referringDoctorRemarks = json['ReferringDoctorRemarks']; + referredDoctorRemarks = json['ReferredDoctorRemarks']; + referralResponseOn = json['ReferralResponseOn']; + priority = json['Priority']; + frequency = json['Frequency']; + mAXResponseTime = Helpers.convertStringToDate(json['MAXResponseTime']); + age = json['Age']; + frequencyDescription = json['FrequencyDescription']; + genderDescription = json['GenderDescription']; + isDoctorLate = json['IsDoctorLate']; + isDoctorResponse = json['IsDoctorResponse']; + nursingStationName = json['NursingStationName']; + priorityDescription = json['PriorityDescription']; + referringClinicDescription = json['ReferringClinicDescription']; + referringDoctorName = json['ReferringDoctorName']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['LineItemNo'] = this.lineItemNo; + data['DoctorID'] = this.doctorID; + data['PatientID'] = this.patientID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['MobileNumber'] = this.mobileNumber; + data['EmailAddress'] = this.emailAddress; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['PatientType'] = this.patientType; + data['AdmissionNo'] = this.admissionNo; + data['AdmissionDate'] = this.admissionDate; + data['RoomID'] = this.roomID; + data['BedID'] = this.bedID; + data['NursingStationID'] = this.nursingStationID; + data['Description'] = this.description; + data['NationalityName'] = this.nationalityName; + data['NationalityNameN'] = this.nationalityNameN; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['ReferralDoctor'] = this.referralDoctor; + data['ReferringDoctor'] = this.referringDoctor; + data['ReferralClinic'] = this.referralClinic; + data['ReferringClinic'] = this.referringClinic; + data['ReferralStatus'] = this.referralStatus; + data['ReferralDate'] = this.referralDate; + data['ReferringDoctorRemarks'] = this.referringDoctorRemarks; + data['ReferredDoctorRemarks'] = this.referredDoctorRemarks; + data['ReferralResponseOn'] = this.referralResponseOn; + data['Priority'] = this.priority; + data['Frequency'] = this.frequency; + data['MAXResponseTime'] = this.mAXResponseTime; + data['Age'] = this.age; + data['FrequencyDescription'] = this.frequencyDescription; + data['GenderDescription'] = this.genderDescription; + data['IsDoctorLate'] = this.isDoctorLate; + data['IsDoctorResponse'] = this.isDoctorResponse; + data['NursingStationName'] = this.nursingStationName; + data['PriorityDescription'] = this.priorityDescription; + data['ReferringClinicDescription'] = this.referringClinicDescription; + data['ReferringDoctorName'] = this.referringDoctorName; + return data; + } +} + + diff --git a/lib/providers/referred_patient_provider.dart b/lib/providers/referred_patient_provider.dart new file mode 100644 index 00000000..19904f2b --- /dev/null +++ b/lib/providers/referred_patient_provider.dart @@ -0,0 +1,77 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/models/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/models/my_referred_patient_model.dart'; +//import 'package:doctor_app_flutter/models/my_referred_patient_model.dart'; +import 'package:doctor_app_flutter/models/request_add_referred_doctor_remarks.dart'; +import 'package:doctor_app_flutter/models/request_my_referral_patient_model.dart'; +import 'package:flutter/cupertino.dart'; + + +class MyReferredPatientProvider with ChangeNotifier { + List listMyReferralPatientModel = []; + + bool isLoading = true; + bool isError = false; + String error = ''; + + RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); + + MyReferredPatientProvider() { + getMyReferralPatient(); + } + + getMyReferralPatient() async { + try { + await BaseAppClient.post( + 'DoctorApplication.svc/REST/GtMyReferralPatient', + body: _requestMyReferralPatient.toJson(), + onSuccess: (dynamic response, int statusCode) { + response['List_MyReferralPatient'].forEach((v) { + listMyReferralPatientModel.add(MyReferredPatientModel.fromJson(v)); + }); + isError = false; + isLoading = false; + }, + onFailure: (String error, int statusCode) { + isError = true; + isLoading = false; + this.error = error; + }, + ); + notifyListeners(); + } catch (error) { + isLoading = false; + isError = true; + this.error = 'Something wrong happened, please contact the admin'; + notifyListeners(); + } + } + + Future replay( + String referredDoctorRemarks, MyReferredPatientModel model) async { + try { + _requestAddReferredDoctorRemarks.admissionNo = model.admissionNo; + _requestAddReferredDoctorRemarks.patientID = model.patientID; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo; + _requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor; + + await BaseAppClient.post( + 'DoctorApplication.svc/REST/GtMyReferredPatient', + body: _requestAddReferredDoctorRemarks.toJson(), + onSuccess: (dynamic body, int statusCode) { + model.referredDoctorRemarks = referredDoctorRemarks; + listMyReferralPatientModel[ + listMyReferralPatientModel.indexOf(model)] = model; + notifyListeners(); + }, + onFailure: (String error, int statusCode) { + throw (error); + }, + ); + } catch (error) { + throw error; + } + } +} diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index d2a777f1..fc6ceb54 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart'; import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/providers/hospital_provider.dart'; import 'package:doctor_app_flutter/providers/referral_patient_provider.dart'; +import 'package:doctor_app_flutter/providers/referred_patient_provider.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -19,6 +20,8 @@ import '../widgets/shared/rounded_container_widget.dart'; import 'doctor/doctor_reply_screen.dart'; import 'doctor/my_referral_patient_screen.dart'; +import 'doctor/my_referred_patient_screen.dart'; + class DashboardScreen extends StatefulWidget { DashboardScreen({Key key, this.title}) : super(key: key); @@ -244,12 +247,12 @@ class _DashboardScreenState extends State { ), ), Expanded( - flex: 2, + flex: 3, child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( - flex: 2, + flex: 1, child: InkWell( child: DashboardItemIconText( DoctorApp.home_icon, @@ -272,7 +275,7 @@ class _DashboardScreenState extends State { ), ), Expanded( - flex: 2, + flex: 1, child: InkWell( onTap: (){ Navigator.push( @@ -294,6 +297,32 @@ class _DashboardScreenState extends State { ), ), ), + + //================== + Expanded( + flex: 1, + child: InkWell( + onTap: (){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ChangeNotifierProvider( + create: (_) => MyReferredPatientProvider(), + child: MyReferredPatient(), + ), + ), + ); + }, + child: DashboardItemIconText( + DoctorApp.home_icon, + "", + "My Referred Patient", + showBorder: false, + backgroundColor: Colors.orange, + ), + ), + ), + //================== ], ), ), diff --git a/lib/screens/doctor/my_referred_patient_screen.dart b/lib/screens/doctor/my_referred_patient_screen.dart new file mode 100644 index 00000000..009f62ec --- /dev/null +++ b/lib/screens/doctor/my_referred_patient_screen.dart @@ -0,0 +1,67 @@ +import 'package:doctor_app_flutter/providers/referred_patient_provider.dart'; +import 'package:doctor_app_flutter/providers/schedule_provider.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/doctor/my_referred_patient_widget.dart'; +import 'package:doctor_app_flutter/widgets/doctor/my_schedule_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../widgets/shared/app_scaffold_widget.dart'; + +class MyReferredPatient extends StatelessWidget { + + MyReferredPatientProvider referredPatientProvider; + + @override + Widget build(BuildContext context) { + referredPatientProvider = Provider.of(context); + return AppScaffold( + showBottomBar: false, + showAppDrawer: false, + appBarTitle: TranslationBase.of(context).mySchedule, + body: referredPatientProvider.isLoading + ? DrAppCircularProgressIndeicator() + : referredPatientProvider.isError + ? Center( + child: AppText( + referredPatientProvider.error, + color: Theme.of(context).errorColor, + ), + ) + : referredPatientProvider.listMyReferralPatientModel.length == 0 + ? Center( + child: AppText( + TranslationBase.of(context).errorNoSchedule, + color: Theme.of(context).errorColor, + ), + ) + : Container( + padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0), + child: ListView( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Container( + child: Column( + + children: referredPatientProvider.listMyReferralPatientModel.map((item) { + return MyReferredPatientWidget( + myReferredPatientModel: item, + ); + }).toList(), + ), + ), + ], + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/doctor/my_referred_patient_widget.dart b/lib/widgets/doctor/my_referred_patient_widget.dart new file mode 100644 index 00000000..0ab91954 --- /dev/null +++ b/lib/widgets/doctor/my_referred_patient_widget.dart @@ -0,0 +1,360 @@ + +import 'package:doctor_app_flutter/models/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/models/my_referred_patient_model.dart'; +import 'package:flutter/material.dart'; + + +import 'package:doctor_app_flutter/config/size_config.dart'; + +import 'package:doctor_app_flutter/providers/referred_patient_provider.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_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:flutter/cupertino.dart'; + +import 'package:provider/provider.dart'; + + + +class MyReferredPatientWidget extends StatefulWidget { + +final MyReferredPatientModel myReferredPatientModel; + + MyReferredPatientWidget({Key key, this.myReferredPatientModel}); + + @override + _MyReferredPatientWidgetState createState() => _MyReferredPatientWidgetState(); + + + +} + +class _MyReferredPatientWidgetState extends State { + + bool _showDetails = false; + bool _isLoading = false; + final _formKey = GlobalKey(); + String error; + TextEditingController answerController; + + @override + void initState() { + + + super.initState(); + + } + + @override + Widget build(BuildContext context) { + return CardWithBgWidgetNew( + widget: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + AppText( + '${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}', + fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + 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: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Divider(color: Colors.grey), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'File No', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.myReferredPatientModel.referringDoctor}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + + ), + Container( + height: SizeConfig.realScreenWidth * 0.1, + width: 0.8, + color: Colors.grey, + margin: EdgeInsets.only(left: 15, right: 15), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Referring Doctor', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + widget.myReferredPatientModel + .referringClinicDescription, + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + ], + ), + + Divider(color: Colors.grey), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Referring Clinic', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.myReferredPatientModel.referringClinicDescription}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + Container( + height: SizeConfig.realScreenWidth * 0.1, + width: 0.8, + color: Colors.grey, + margin: EdgeInsets.only(left: 15, right: 15), + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Frequency', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + widget.myReferredPatientModel + .frequencyDescription, + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + ], + ), + Divider(color: Colors.grey), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Priority', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.myReferredPatientModel.priorityDescription}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + Container( + height: SizeConfig.realScreenWidth * 0.1, + width: 0.8, + color: Colors.grey, + margin: EdgeInsets.only(left: 15, right: 15), + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'Max Response Time', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + Helpers.getDateFormatted(widget + .myReferredPatientModel + .mAXResponseTime), + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + ], + ), + Divider(color: Colors.grey), + AppText( + 'Clinic Details and Remarks', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + textAlign: TextAlign.start, + ), + SizedBox( + height: 5, + ), + AppText( + '${widget.myReferredPatientModel.referringDoctorRemarks}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ), + SizedBox( + height: 5, + ), + AppText( + 'Answer/Suggestions', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + textAlign: TextAlign.start, + ), + SizedBox( + height: 5, + ), + AppText( + '${widget.myReferredPatientModel.referredDoctorRemarks}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ), + // Form( + // key: _formKey, + // child: TextFields( + // maxLines: 2, + // minLines: 2, + // hintText: 'Answer the patient', + // initialValue: widget.myReferredPatientModel.referredDoctorRemarks ?? '', + // readOnly: _isLoading, + // validator: (value) { + // if (value.isEmpty) + // return "please enter answer"; + // else + // return null; + // }, + // ), + // ), + SizedBox(height: 10.0), + if (error != null && error.isNotEmpty) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Theme.of(context) + .errorColor + .withOpacity(0.06), + ), + padding: EdgeInsets.symmetric( + vertical: 8.0, horizontal: 12.0), + child: Row( + children: [ + Expanded( + child: Texts(error ?? "", + style: "bodyText1", + color: Theme.of(context) + .errorColor)), + ], + ), + ), + SizedBox(height: 10.0), + ], + ), + SizedBox(height: 10.0), + Container( + width: double.infinity, + child: Button( + onTap: () async { + final form = _formKey.currentState; + if (form.validate()) { + setState(() { + _isLoading = true; + }); + try { + await Provider.of(context, listen: false).replay(answerController.text.toString(), widget.myReferredPatientModel); + // await Provider.of(context, listen: false).replay(answerController.text.toString(), widget.myReferredPatientModel);//myReferredPatientModel + setState(() { + _isLoading = false; + }); + } catch (e) { + setState(() { + error = e.toString(); + _isLoading = false; + }); + } + } + }, + title: 'Verify', + loading: _isLoading, + ), + ) + ], + ) + ], + ), + ) + ], + ), + ), + ); + } +} \ No newline at end of file From 505b3383ff303bbf16ba30b70926c500b8e9b94a Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Tue, 2 Jun 2020 10:49:44 +0300 Subject: [PATCH 4/6] patient screen Modify --- lib/screens/patients/patients_screen.dart | 79 ++++++++++++----------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 87bc84a2..bcdc4218 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -338,14 +338,14 @@ class _PatientsScreenState extends State { ), SizedBox(height: 10.0), Container( - width: SizeConfig.screenWidth * 0.80, + width: SizeConfig.screenWidth * 0.9, child: TextField( controller: _controller, onChanged: (String str) { this.searchData(str); }, decoration: buildInputDecoration( - context, 'Search Patient'), + context, 'Search '), ), ), SizedBox( @@ -385,9 +385,9 @@ class _PatientsScreenState extends State { url + avatarMale, height: - 100.0, + 80.0, width: - 100.0, + 80.0, semanticsLabel: 'Male Logo') ] @@ -402,7 +402,11 @@ class _PatientsScreenState extends State { semanticsLabel: 'Female Logo') ], + ), + SizedBox( + width: 10, + ), Column( crossAxisAlignment: CrossAxisAlignment @@ -412,7 +416,7 @@ class _PatientsScreenState extends State { item.firstName + " " + item.lastName, - fontSize: 2.5 * + fontSize: 2.0 * SizeConfig .textMultiplier, fontWeight: @@ -437,12 +441,10 @@ class _PatientsScreenState extends State { backGroundcolor: Colors.white, ), - SizedBox( - height: 8, - ), - SizedBox( - height: 8, - ), + + // SizedBox( + // height: 8, + // ), AppText( "Age:" + item.age @@ -566,7 +568,7 @@ class _PatientsScreenState extends State { Widget _locationBar(BuildContext _context) { return Container( height: MediaQuery.of(context).size.height * 0.065, - width: SizeConfig.screenWidth * 0.80, + width: SizeConfig.screenWidth * 0.9, decoration: BoxDecoration( color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)), child: Row( @@ -575,30 +577,35 @@ class _PatientsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: _locations.map((item) { bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ + return Column(mainAxisSize: MainAxisSize.min, + children: [ InkWell( - child: Container( - height: 40, - width: 80, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(50), - color: _isActive ? Hexcolor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 15, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - // backgroundColor:_isActive - // ? Hexcolor("#B8382B") - // : Colors.white,//sideColor, - - fontWeight: FontWeight.bold), + child: Center( + child: Container( + height: 40, + width: 90, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50), + color: _isActive ? Hexcolor("#B8382B") : Colors.white, ), - )), + child: Center( + child: Text( + item, + + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + // backgroundColor:_isActive + // ? Hexcolor("#B8382B") + // : Colors.white,//sideColor, + + fontWeight: FontWeight.bold, + ), + ), + )), + ), onTap: () { print(_locations.indexOf(item)); @@ -606,7 +613,7 @@ class _PatientsScreenState extends State { setState(() { _activeLocation = _locations.indexOf(item); - // sideColor=Colors.redAccent; + }); }), _isActive @@ -616,7 +623,7 @@ class _PatientsScreenState extends State { color: Colors.white), alignment: Alignment.center, height: 3, - width: 80, + width: 90, ) : Container() ]); From 29239fddde594b4a29ae21045749c46ad82f66e7 Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Tue, 2 Jun 2020 11:42:51 +0300 Subject: [PATCH 5/6] modify search --- lib/screens/patients/patient_search_screen.dart | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 2c0963cd..d00aabdb 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -58,9 +58,8 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { -print("============== _selectedType============"+ _selectedType); - if(_selectedType!='3') - { +//print("============== _selectedType============"+ _selectedType); + try { //==================== @@ -102,15 +101,7 @@ print("============== _selectedType============"+ _selectedType); } catch (err) { handelCatchErrorCase(err); } - } - else - { - Navigator.of(context).pushNamed(PATIENTS_REFERRED, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": _selectedType - }); - - } + } handelCatchErrorCase(err) { From 69a618018dda0ec07b10cd9f6732346f1a63f416 Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Tue, 2 Jun 2020 16:35:23 +0300 Subject: [PATCH 6/6] MyPrefered Patiant --- lib/config/config.dart | 2 +- lib/models/my_referred_patient_model.dart | 343 +++++++++--------- .../request_add_referred_doctor_remarks.dart | 1 + .../verify_referral_doctor_remarks.dart | 103 ++++++ lib/providers/referred_patient_provider.dart | 57 ++- .../doctor/my_referred_patient_widget.dart | 78 ++-- 6 files changed, 346 insertions(+), 238 deletions(-) create mode 100644 lib/models/verify_referral_doctor_remarks.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 92291ed3..63d5545f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -2,7 +2,7 @@ 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 PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; diff --git a/lib/models/my_referred_patient_model.dart b/lib/models/my_referred_patient_model.dart index 4aaef077..9ecfdb2f 100644 --- a/lib/models/my_referred_patient_model.dart +++ b/lib/models/my_referred_patient_model.dart @@ -1,73 +1,18 @@ -/* - *@author: Amjad amireh - *@Date:1/6/2020 - *@param: - *@return: - *@desc: MyReferredPatientModel - */ import 'dart:convert'; + import 'package:doctor_app_flutter/util/helpers.dart'; +MyReferredPatientModel myReferredPatientModelFromJson(String str) => MyReferredPatientModel.fromJson(json.decode(str)); -import 'package:doctor_app_flutter/util/helpers.dart'; +String myReferredPatientModelToJson(MyReferredPatientModel data) => json.encode(data.toJson()); class MyReferredPatientModel { - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; - String nursingStationID; - String description; - String nationalityName; - String nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - String referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - DateTime mAXResponseTime; - String age; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; - - MyReferredPatientModel( - {this.projectID, + MyReferredPatientModel({ + this.projectId, this.lineItemNo, - this.doctorID, - this.patientID, + this.doctorId, + this.patientId, this.doctorName, this.doctorNameN, this.firstName, @@ -84,9 +29,9 @@ class MyReferredPatientModel { this.patientType, this.admissionNo, this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, + this.roomId, + this.bedId, + this.nursingStationId, this.description, this.nationalityName, this.nationalityNameN, @@ -103,7 +48,8 @@ class MyReferredPatientModel { this.referralResponseOn, this.priority, this.frequency, - this.mAXResponseTime, + this.maxResponseTime, + this.dischargeDate, this.age, this.frequencyDescription, this.genderDescription, @@ -111,114 +57,165 @@ class MyReferredPatientModel { this.isDoctorResponse, this.nursingStationName, this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName}); + this.referralClinicDescription, + this.referralDoctorName, + }); - MyReferredPatientModel.fromJson(Map json) { - projectID = json['ProjectID']; - lineItemNo = json['LineItemNo']; - doctorID = json['DoctorID']; - patientID = json['PatientID']; - doctorName = json['DoctorName']; - doctorNameN = json['DoctorNameN']; - firstName = json['FirstName']; - middleName = json['MiddleName']; - lastName = json['LastName']; - firstNameN = json['FirstNameN']; - middleNameN = json['MiddleNameN']; - lastNameN = json['LastNameN']; - gender = json['Gender']; - dateofBirth = json['DateofBirth']; - mobileNumber = json['MobileNumber']; - emailAddress = json['EmailAddress']; - patientIdentificationNo = json['PatientIdentificationNo']; - patientType = json['PatientType']; - admissionNo = json['AdmissionNo']; - admissionDate = json['AdmissionDate']; - roomID = json['RoomID']; - bedID = json['BedID']; - nursingStationID = json['NursingStationID']; - description = json['Description']; - nationalityName = json['NationalityName']; - nationalityNameN = json['NationalityNameN']; - clinicDescription = json['ClinicDescription']; - clinicDescriptionN = json['ClinicDescriptionN']; - referralDoctor = json['ReferralDoctor']; - referringDoctor = json['ReferringDoctor']; - referralClinic = json['ReferralClinic']; - referringClinic = json['ReferringClinic']; - referralStatus = json['ReferralStatus']; - referralDate = json['ReferralDate']; - referringDoctorRemarks = json['ReferringDoctorRemarks']; - referredDoctorRemarks = json['ReferredDoctorRemarks']; - referralResponseOn = json['ReferralResponseOn']; - priority = json['Priority']; - frequency = json['Frequency']; - mAXResponseTime = Helpers.convertStringToDate(json['MAXResponseTime']); - age = json['Age']; - frequencyDescription = json['FrequencyDescription']; - genderDescription = json['GenderDescription']; - isDoctorLate = json['IsDoctorLate']; - isDoctorResponse = json['IsDoctorResponse']; - nursingStationName = json['NursingStationName']; - priorityDescription = json['PriorityDescription']; - referringClinicDescription = json['ReferringClinicDescription']; - referringDoctorName = json['ReferringDoctorName']; - } + int projectId; + int lineItemNo; + int doctorId; + int patientId; + String doctorName; + dynamic doctorNameN; + String firstName; + String middleName; + String lastName; + dynamic firstNameN; + dynamic middleNameN; + dynamic lastNameN; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomId; + String bedId; + dynamic nursingStationId; + dynamic description; + String nationalityName; + dynamic nationalityNameN; + String clinicDescription; + dynamic clinicDescriptionN; + int referralDoctor; + int referringDoctor; + int referralClinic; + int referringClinic; + int referralStatus; + String referralDate; + String referringDoctorRemarks; + String referredDoctorRemarks; + String referralResponseOn; + int priority; + int frequency; + DateTime maxResponseTime; + dynamic dischargeDate; + String age; + String frequencyDescription; + String genderDescription; + bool isDoctorLate; + bool isDoctorResponse; + String nursingStationName; + String priorityDescription; + String referralClinicDescription; + String referralDoctorName; - Map toJson() { - final Map data = new Map(); - data['ProjectID'] = this.projectID; - data['LineItemNo'] = this.lineItemNo; - data['DoctorID'] = this.doctorID; - data['PatientID'] = this.patientID; - data['DoctorName'] = this.doctorName; - data['DoctorNameN'] = this.doctorNameN; - data['FirstName'] = this.firstName; - data['MiddleName'] = this.middleName; - data['LastName'] = this.lastName; - data['FirstNameN'] = this.firstNameN; - data['MiddleNameN'] = this.middleNameN; - data['LastNameN'] = this.lastNameN; - data['Gender'] = this.gender; - data['DateofBirth'] = this.dateofBirth; - data['MobileNumber'] = this.mobileNumber; - data['EmailAddress'] = this.emailAddress; - data['PatientIdentificationNo'] = this.patientIdentificationNo; - data['PatientType'] = this.patientType; - data['AdmissionNo'] = this.admissionNo; - data['AdmissionDate'] = this.admissionDate; - data['RoomID'] = this.roomID; - data['BedID'] = this.bedID; - data['NursingStationID'] = this.nursingStationID; - data['Description'] = this.description; - data['NationalityName'] = this.nationalityName; - data['NationalityNameN'] = this.nationalityNameN; - data['ClinicDescription'] = this.clinicDescription; - data['ClinicDescriptionN'] = this.clinicDescriptionN; - data['ReferralDoctor'] = this.referralDoctor; - data['ReferringDoctor'] = this.referringDoctor; - data['ReferralClinic'] = this.referralClinic; - data['ReferringClinic'] = this.referringClinic; - data['ReferralStatus'] = this.referralStatus; - data['ReferralDate'] = this.referralDate; - data['ReferringDoctorRemarks'] = this.referringDoctorRemarks; - data['ReferredDoctorRemarks'] = this.referredDoctorRemarks; - data['ReferralResponseOn'] = this.referralResponseOn; - data['Priority'] = this.priority; - data['Frequency'] = this.frequency; - data['MAXResponseTime'] = this.mAXResponseTime; - data['Age'] = this.age; - data['FrequencyDescription'] = this.frequencyDescription; - data['GenderDescription'] = this.genderDescription; - data['IsDoctorLate'] = this.isDoctorLate; - data['IsDoctorResponse'] = this.isDoctorResponse; - data['NursingStationName'] = this.nursingStationName; - data['PriorityDescription'] = this.priorityDescription; - data['ReferringClinicDescription'] = this.referringClinicDescription; - data['ReferringDoctorName'] = this.referringDoctorName; - return data; - } -} + factory MyReferredPatientModel.fromJson(Map json) => MyReferredPatientModel( + projectId: json["ProjectID"], + lineItemNo: json["LineItemNo"], + doctorId: json["DoctorID"], + patientId: json["PatientID"], + doctorName: json["DoctorName"], + doctorNameN: json["DoctorNameN"], + firstName: json["FirstName"], + middleName: json["MiddleName"], + lastName: json["LastName"], + firstNameN: json["FirstNameN"], + middleNameN: json["MiddleNameN"], + lastNameN: json["LastNameN"], + gender: json["Gender"], + dateofBirth: json["DateofBirth"], + mobileNumber: json["MobileNumber"], + emailAddress: json["EmailAddress"], + patientIdentificationNo: json["PatientIdentificationNo"], + patientType: json["PatientType"], + admissionNo: json["AdmissionNo"], + admissionDate: json["AdmissionDate"], + roomId: json["RoomID"], + bedId: json["BedID"], + nursingStationId: json["NursingStationID"], + description: json["Description"], + nationalityName: json["NationalityName"], + nationalityNameN: json["NationalityNameN"], + clinicDescription: json["ClinicDescription"], + clinicDescriptionN: json["ClinicDescriptionN"], + referralDoctor: json["ReferralDoctor"], + referringDoctor: json["ReferringDoctor"], + referralClinic: json["ReferralClinic"], + referringClinic: json["ReferringClinic"], + referralStatus: json["ReferralStatus"], + referralDate: json["ReferralDate"], + referringDoctorRemarks: json["ReferringDoctorRemarks"], + referredDoctorRemarks: json["ReferredDoctorRemarks"], + referralResponseOn: json["ReferralResponseOn"], + priority: json["Priority"], + frequency: json["Frequency"], + maxResponseTime: Helpers.convertStringToDate(json['MAXResponseTime']),//json["MAXResponseTime"], + dischargeDate: json["DischargeDate"], + age: json["Age"], + frequencyDescription: json["FrequencyDescription"], + genderDescription: json["GenderDescription"], + isDoctorLate: json["IsDoctorLate"], + isDoctorResponse: json["IsDoctorResponse"], + nursingStationName: json["NursingStationName"], + priorityDescription: json["PriorityDescription"], + referralClinicDescription: json["ReferralClinicDescription"], + referralDoctorName: json["ReferralDoctorName"], + ); + Map toJson() => { + "ProjectID": projectId, + "LineItemNo": lineItemNo, + "DoctorID": doctorId, + "PatientID": patientId, + "DoctorName": doctorName, + "DoctorNameN": doctorNameN, + "FirstName": firstName, + "MiddleName": middleName, + "LastName": lastName, + "FirstNameN": firstNameN, + "MiddleNameN": middleNameN, + "LastNameN": lastNameN, + "Gender": gender, + "DateofBirth": dateofBirth, + "MobileNumber": mobileNumber, + "EmailAddress": emailAddress, + "PatientIdentificationNo": patientIdentificationNo, + "PatientType": patientType, + "AdmissionNo": admissionNo, + "AdmissionDate": admissionDate, + "RoomID": roomId, + "BedID": bedId, + "NursingStationID": nursingStationId, + "Description": description, + "NationalityName": nationalityName, + "NationalityNameN": nationalityNameN, + "ClinicDescription": clinicDescription, + "ClinicDescriptionN": clinicDescriptionN, + "ReferralDoctor": referralDoctor, + "ReferringDoctor": referringDoctor, + "ReferralClinic": referralClinic, + "ReferringClinic": referringClinic, + "ReferralStatus": referralStatus, + "ReferralDate": referralDate, + "ReferringDoctorRemarks": referringDoctorRemarks, + "ReferredDoctorRemarks": referredDoctorRemarks, + "ReferralResponseOn": referralResponseOn, + "Priority": priority, + "Frequency": frequency, + "MAXResponseTime": maxResponseTime, + "DischargeDate": dischargeDate, + "Age": age, + "FrequencyDescription": frequencyDescription, + "GenderDescription": genderDescription, + "IsDoctorLate": isDoctorLate, + "IsDoctorResponse": isDoctorResponse, + "NursingStationName": nursingStationName, + "PriorityDescription": priorityDescription, + "ReferralClinicDescription": referralClinicDescription, + "ReferralDoctorName": referralDoctorName, + }; +} diff --git a/lib/models/request_add_referred_doctor_remarks.dart b/lib/models/request_add_referred_doctor_remarks.dart index 0799c7ba..b396c47f 100644 --- a/lib/models/request_add_referred_doctor_remarks.dart +++ b/lib/models/request_add_referred_doctor_remarks.dart @@ -17,6 +17,7 @@ class RequestAddReferredDoctorRemarks { String sessionID; bool isLoginForDoctorApp; bool patientOutSA; + RequestAddReferredDoctorRemarks( {this.projectID, diff --git a/lib/models/verify_referral_doctor_remarks.dart b/lib/models/verify_referral_doctor_remarks.dart new file mode 100644 index 00000000..b9bfce0a --- /dev/null +++ b/lib/models/verify_referral_doctor_remarks.dart @@ -0,0 +1,103 @@ +import 'package:doctor_app_flutter/config/config.dart'; + +class VerifyReferralDoctorRemarks { + int projectID; + String admissionNo; + int lineItemNo; + String referredDoctorRemarks; + int editedBy; + int patientID; + int referringDoctor; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + String firstName; + + String middleName; + String lastName; + String patientMobileNumber; + String patientIdentificationID; + + VerifyReferralDoctorRemarks( + {this.projectID, + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel= CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA, + this.firstName, + this.middleName, + this.lastName, + this.patientMobileNumber, + this.patientIdentificationID, + }); + + VerifyReferralDoctorRemarks.fromJson(Map json) { + projectID = json['ProjectID']; + admissionNo = json['AdmissionNo']; + lineItemNo = json['LineItemNo']; + referredDoctorRemarks = json['ReferredDoctorRemarks']; + editedBy = json['EditedBy']; + patientID = json['PatientID']; + referringDoctor = json['ReferringDoctor']; + 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']; + firstName= json["FirstName"]; + middleName= json["MiddleName"]; + lastName= json["LastName"]; + patientMobileNumber= json["PatientMobileNumber"]; + patientIdentificationID = json["PatientIdentificationID"]; + + + + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['LineItemNo'] = this.lineItemNo; + data['ReferredDoctorRemarks'] = this.referredDoctorRemarks; + data['EditedBy'] = this.editedBy; + data['PatientID'] = this.patientID; + data['ReferringDoctor'] = this.referringDoctor; + 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['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientIdentificationID'] = this.patientIdentificationID; + return data; + } +} diff --git a/lib/providers/referred_patient_provider.dart b/lib/providers/referred_patient_provider.dart index 19904f2b..0f3e6741 100644 --- a/lib/providers/referred_patient_provider.dart +++ b/lib/providers/referred_patient_provider.dart @@ -1,22 +1,23 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/models/my_referral_patient_model.dart'; +//import 'package:doctor_app_flutter/models/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/my_referred_patient_model.dart'; //import 'package:doctor_app_flutter/models/my_referred_patient_model.dart'; -import 'package:doctor_app_flutter/models/request_add_referred_doctor_remarks.dart'; +//import 'package:doctor_app_flutter/models/request_add_referred_doctor_remarks.dart'; import 'package:doctor_app_flutter/models/request_my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/models/verify_referral_doctor_remarks.dart'; import 'package:flutter/cupertino.dart'; class MyReferredPatientProvider with ChangeNotifier { - List listMyReferralPatientModel = []; + List listMyReferredPatientModel = []; bool isLoading = true; bool isError = false; String error = ''; RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); - + // RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); + VerifyReferralDoctorRemarks _verifyreferraldoctorremarks = VerifyReferralDoctorRemarks(); MyReferredPatientProvider() { getMyReferralPatient(); } @@ -24,11 +25,11 @@ class MyReferredPatientProvider with ChangeNotifier { getMyReferralPatient() async { try { await BaseAppClient.post( - 'DoctorApplication.svc/REST/GtMyReferralPatient', + 'DoctorApplication.svc/REST/GtMyReferredPatient', body: _requestMyReferralPatient.toJson(), onSuccess: (dynamic response, int statusCode) { - response['List_MyReferralPatient'].forEach((v) { - listMyReferralPatientModel.add(MyReferredPatientModel.fromJson(v)); + response['List_MyReferredPatient'].forEach((v) { + listMyReferredPatientModel.add(MyReferredPatientModel.fromJson(v)); }); isError = false; isLoading = false; @@ -48,22 +49,40 @@ class MyReferredPatientProvider with ChangeNotifier { } } - Future replay( - String referredDoctorRemarks, MyReferredPatientModel model) async { + // Future replay( + // String referredDoctorRemarks, MyReferredPatientModel model) async { + Future replay( + MyReferredPatientModel model) async { try { - _requestAddReferredDoctorRemarks.admissionNo = model.admissionNo; - _requestAddReferredDoctorRemarks.patientID = model.patientID; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; - _requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo; - _requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor; + + _verifyreferraldoctorremarks.patientID=model.projectId; + _verifyreferraldoctorremarks.admissionNo =model.admissionNo; + _verifyreferraldoctorremarks.lineItemNo = model.lineItemNo; + + _verifyreferraldoctorremarks.referredDoctorRemarks=model.referredDoctorRemarks; + _verifyreferraldoctorremarks.referringDoctor=model.referringDoctor; + _verifyreferraldoctorremarks.firstName=model.firstName; + _verifyreferraldoctorremarks.middleName=model.middleName; + _verifyreferraldoctorremarks.lastName=model.lastName; + _verifyreferraldoctorremarks.patientMobileNumber=model.mobileNumber; + _verifyreferraldoctorremarks.patientIdentificationID=model.patientIdentificationNo; + + + + + + + + + await BaseAppClient.post( 'DoctorApplication.svc/REST/GtMyReferredPatient', - body: _requestAddReferredDoctorRemarks.toJson(), + body: _verifyreferraldoctorremarks.toJson(),//_requestAddReferredDoctorRemarks.toJson(), onSuccess: (dynamic body, int statusCode) { - model.referredDoctorRemarks = referredDoctorRemarks; - listMyReferralPatientModel[ - listMyReferralPatientModel.indexOf(model)] = model; + + listMyReferredPatientModel[ + listMyReferredPatientModel.indexOf(model)] = model; notifyListeners(); }, onFailure: (String error, int statusCode) { diff --git a/lib/widgets/doctor/my_referred_patient_widget.dart b/lib/widgets/doctor/my_referred_patient_widget.dart index 0ab91954..0998788a 100644 --- a/lib/widgets/doctor/my_referred_patient_widget.dart +++ b/lib/widgets/doctor/my_referred_patient_widget.dart @@ -99,7 +99,7 @@ class _MyReferredPatientWidgetState extends State { fontWeight: FontWeight.bold, ), AppText( - '${widget.myReferredPatientModel.referringDoctor}', + '${widget.myReferredPatientModel.patientId}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300, @@ -119,18 +119,18 @@ class _MyReferredPatientWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Referring Doctor', + 'Referral Doctor', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), - AppText( + Texts( widget.myReferredPatientModel - .referringClinicDescription, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) + .referralDoctorName, + maxLength: 80, + readMore: true, + ), + ], ), ), @@ -152,7 +152,7 @@ class _MyReferredPatientWidgetState extends State { fontWeight: FontWeight.bold, ), AppText( - '${widget.myReferredPatientModel.referringClinicDescription}', + '${widget.myReferredPatientModel.referralClinicDescription}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300, @@ -232,7 +232,7 @@ class _MyReferredPatientWidgetState extends State { AppText( Helpers.getDateFormatted(widget .myReferredPatientModel - .mAXResponseTime), + .maxResponseTime), fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300, @@ -249,15 +249,17 @@ class _MyReferredPatientWidgetState extends State { fontWeight: FontWeight.bold, textAlign: TextAlign.start, ), + SizedBox( height: 5, ), - AppText( - '${widget.myReferredPatientModel.referringDoctorRemarks}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ), + + Texts( + '${widget.myReferredPatientModel.referringDoctorRemarks}', + style: "bodyText1", + readMore: true, + textAlign: TextAlign.start, + maxLength: 100), SizedBox( height: 5, ), @@ -270,28 +272,17 @@ class _MyReferredPatientWidgetState extends State { SizedBox( height: 5, ), - AppText( - '${widget.myReferredPatientModel.referredDoctorRemarks}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ), - // Form( - // key: _formKey, - // child: TextFields( - // maxLines: 2, - // minLines: 2, - // hintText: 'Answer the patient', - // initialValue: widget.myReferredPatientModel.referredDoctorRemarks ?? '', - // readOnly: _isLoading, - // validator: (value) { - // if (value.isEmpty) - // return "please enter answer"; - // else - // return null; - // }, - // ), - // ), + + Texts( + '${widget.myReferredPatientModel.referredDoctorRemarks}', + style: "bodyText1", + readMore: true, + textAlign: TextAlign.start, + maxLength: 100), + SizedBox( + height: 5, + ), + SizedBox(height: 10.0), if (error != null && error.isNotEmpty) Column( @@ -325,13 +316,10 @@ class _MyReferredPatientWidgetState extends State { child: Button( onTap: () async { final form = _formKey.currentState; - if (form.validate()) { - setState(() { - _isLoading = true; - }); + try { - await Provider.of(context, listen: false).replay(answerController.text.toString(), widget.myReferredPatientModel); - // await Provider.of(context, listen: false).replay(answerController.text.toString(), widget.myReferredPatientModel);//myReferredPatientModel + await Provider.of(context, listen: false).replay(widget.myReferredPatientModel); + setState(() { _isLoading = false; }); @@ -341,7 +329,7 @@ class _MyReferredPatientWidgetState extends State { _isLoading = false; }); } - } + }, title: 'Verify', loading: _isLoading,