Delteing unused file & refactoring routes page

merge-requests/522/head
hussam al-habibeh 5 years ago
parent fac8473f59
commit ebe05226e9

@ -1,18 +1,13 @@
import 'package:doctor_app_flutter/screens/QR_reader_screen.dart';
import 'package:doctor_app_flutter/screens/home/home_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/message_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/services_screen.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'icons_app/doctor_app_icons.dart';
class LandingPage extends StatefulWidget {

@ -4,94 +4,43 @@ import 'package:doctor_app_flutter/screens/patients/ECGPage.dart';
import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-input-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart';
import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart';
import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_screen_history.dart';
import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart';
import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart';
import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart';
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart';
import './screens/QR_reader_screen.dart';
import './screens/auth/change_password_screen.dart';
import './screens/auth/login_screen.dart';
import './screens/auth/verification_methods_screen.dart';
import './screens/auth/verify_account_screen.dart';
import './screens/blood_bank_screen.dart';
import './screens/doctor/message_screen.dart';
import './screens/doctor/my_schedule_screen.dart';
import './screens/doctor/services_screen.dart';
import './screens/medicine/medicine_search_screen.dart';
import './screens/medicine/pharmacies_list_screen.dart';
import './screens/patients/patient_search_screen.dart';
import './screens/patients/patients_referred_screen.dart';
import './screens/patients/patients_screen.dart';
import './screens/patients/profile/insurance_approvals_screen.dart';
import './screens/patients/profile/lab_result/lab_orders_screen.dart';
import './screens/patients/profile/patient_orders_screen.dart';
import './screens/patients/profile/patient_profile_screen.dart';
import './screens/patients/profile/prescriptions/prescriptions_screen.dart';
import './screens/patients/profile/progress_note_screen.dart';
import './screens/patients/profile/radiology/radiology_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart';
import './screens/profile_screen.dart';
import './screens/settings/settings_screen.dart';
import 'landing_page.dart';
import 'screens/doctor/doctor_reply_screen.dart';
import 'screens/live_care/panding_list.dart';
import 'screens/patients/profile/admission-request/admission-request-detail-screen.dart';
import 'screens/patients/profile/admission-request/admission-request-first-screen.dart';
import 'screens/patients/profile/admission-request/admission-request-third-screen.dart';
import 'screens/patients/profile/admission-request/admission-request_second-screen.dart';
import 'screens/patients/profile/referral/my-referral-detail-screen.dart';
import 'screens/patients/profile/referral/refer-patient-screen.dart';
import 'screens/prescription/prescription_screen.dart';
import 'screens/patients/profile/vital_sign/vital-signs-screen.dart';
const String INIT_ROUTE = ROOT;
const String ROOT = 'root';
const String HOME = '/';
const String LOGIN = 'login';
const String PROFILE = 'profile';
const String CHANGE_PASSWORD = 'change-password';
const String VERIFY_ACCOUNT = 'verify-account';
const String VERIFICATION_METHODS = 'verification-methods';
const String MY_SCHEDULE = 'my-schedule';
const String QR_READER = 'qr-reader';
const String PATIENT_SEARCH = 'patients/patient-search';
const String PATIENTS = 'patients/patients';
const String PATIENTS_PROFILE = 'patients/patients-profile';
const String PATIENTS_REFERRED = 'patients/patients-referred';
const String BLOOD_BANK = 'blood-bank';
const String DOCTOR_REPLY = 'doctor-reply';
const String MEDICINE_SEARCH = 'medicine/medicine-search';
const String PHARMACIES_LIST = 'medicine/pharmacies-list';
const String MESSAGES = 'messages';
const String SERVICES = 'services';
const String SETTINGS = 'settings';
const String VITAL_SIGN = 'patients/vital-sign';
const String LAB_ORDERS = 'patients/lab_orders';
const String LAB_RESULT = 'patients/lab_result';
const String PRESCRIPTIONS = 'patients/prescription';
const String MEDICAL_FILE = 'patients/radiology';
const String PROGRESS_NOTE = 'patients/progress-note';
const String REFER_PATIENT = 'patients/refer-patient';
const String MY_REFERRAL_DETAIL = 'my_referral_detail';
const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor';
const String PATIENT_ORDERS = 'patients/patient_orders';
const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals';
const String PATIENT_INSURANCE_APPROVALS_NEW = 'patients/patient_insurance_approvals_new';
const String PATIENT_INSURANCE_APPROVALS_NEW =
'patients/patient_insurance_approvals_new';
const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data';
const String CREATE_EPISODE = 'patients/create-episode';
const String UPDATE_EPISODE = 'patients/update-episode';
const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request';
@ -100,83 +49,41 @@ const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third';
const String PATIENT_UCAF_REQUEST = 'patients/ucaf';
const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail';
const String PATIENT_ECG = 'patients/ecg';
const String BODY_MEASUREMENTS = 'patients/body-measurements';
const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details';
// const String VIDEO_CALL = 'video-call';
const String LIVECARE_PENDING_LIST = 'livecare-pendinglist';
const String ORDER_PRESCRIPTION = 'prescription/prescriptionsss';
const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new';
const String ORDER_PRESCRIPTION_HISTORY = 'prescription/prescriptionsssH';
const String ORDER_PROCEDURE = 'procedure/procedure';
// const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox';
const String PATIENT_SICKLEAVE = 'patients/patient_sickleave';
const String ADD_SICKLEAVE = 'add-sickleave';
const String SHOW_SICKLEAVE = 'show-sickleave';
const String RADIOLOGY = 'radiology';
const String RADIOLOGY_PATIENT = 'radiology-patient';
//todo: change the routing way.
var routes = {
ROOT: (_) => RootPage(),
HOME: (_) => LandingPage(),
LOGIN: (_) => Loginsreen(),
PROFILE: (_) => ProfileScreen(),
MY_SCHEDULE: (_) => MyScheduleScreen(),
PATIENT_SEARCH: (_) => PatientSearchScreen(),
PATIENTS_REFERRED: (_) => PatientReferredScreen(),
PATIENTS: (_) => PatientsScreen(),
QR_READER: (_) => QrReaderScreen(),
BLOOD_BANK: (_) => BloodBankScreen(),
DOCTOR_REPLY: (_) => DoctorReplyScreen(),
MEDICINE_SEARCH: (_) => MedicineSearchScreen(),
SETTINGS: (_) => SettingsScreen(),
CHANGE_PASSWORD: (_) => ChangePasswordScreen(),
VERIFY_ACCOUNT: (_) => VerifyAccountScreen(),
VERIFICATION_METHODS: (_) => VerificationMethodsScreen(),
PATIENTS_PROFILE: (_) => PatientProfileScreen(),
PHARMACIES_LIST: (_) => PharmaciesListScreen(
itemID: null,
),
MESSAGES: (_) => MessagesScreen(),
SERVICES: (_) => ServicesScreen(),
LAB_ORDERS: (_) => LabOrdersScreen(),
LAB_RESULT: (_) => LabsHomePage(),
PRESCRIPTIONS: (_) => PrescriptionScreen(),
MEDICAL_FILE: (_) => MedicalFilePage(),
PROGRESS_NOTE: (_) => ProgressNoteScreen(),
REFER_PATIENT: (_) => ReferPatientScreen(),
REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(),
PATIENT_ORDERS: (_) => PatientsOrdersScreen(),
PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(),
PATIENT_INSURANCE_APPROVALS_NEW: (_) => InsuranceApprovalScreenNew(),
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(),
RADIOLOGY: (_) => RadiologyScreen(),
RADIOLOGY_PATIENT: (_) => RadiologyHomePage(),
PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestFirstScreen(),
PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(),
PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(),
// PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(),
CREATE_EPISODE: (_) => UpdateSoapIndex(
isUpdate: true,
),
UPDATE_EPISODE: (_) => UpdateSoapIndex(
isUpdate: true,
),
BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(),
IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(),
// VIDEO_CALL: (_) => VideoCallPage(patientData: null),
LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(),
// LIVECARE_END_DIALOG: (_) => EndCallDialogBox(),
PATIENT_SICKLEAVE: (_) => SickLeaveScreen(),
ADD_SICKLEAVE: (_) => AddSickLeavScreen(),
SHOW_SICKLEAVE: (_) => ShowSickLeaveScreen(),
ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(),
ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(),
ORDER_PRESCRIPTION_HISTORY: (_) => NewPrescriptionHistoryScreen(),
ORDER_PROCEDURE: (_) => ProcedureScreen(),
// LIVECARE_END_DIALOG: (_) => EndCallDialogBox()
MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(),
PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(),
PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(),

@ -1,49 +0,0 @@
import 'package:flutter/material.dart';
import '../../lookups/auth_lookup.dart';
import '../../widgets/auth/auth_header.dart';
import '../../widgets/auth/verfiy_account.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
class VerifyAccountScreen extends StatefulWidget {
@override
_VerifyAccountScreenState createState() => _VerifyAccountScreenState();
}
class _VerifyAccountScreenState extends State<VerifyAccountScreen> {
bool _isLoading = false;
/*
*@author: Elham Rababah
*@Date:19/4/2020
*@param: isLoading
*@return:
*@desc: Change Isloading attribute in order to show or hide loader
*/
void changeLoadingStata(isLoading) {
setState(() {
_isLoading = isLoading;
});
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isLoading: _isLoading,
isShowAppBar: false,
body: SafeArea(
child: ListView(children: <Widget>[
Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.verifyPassword),
VerifyAccount(changeLoadingStata: changeLoadingStata),
],
),
),
]),
));
}
}

@ -1,11 +0,0 @@
import 'package:flutter/material.dart';
class BloodBankScreen
extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Blood Bank"),),
);
}
}

@ -1,14 +0,0 @@
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class MessagesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: false,
body: Center(
child: Text('Messages heeer'),
),
);
}
}

@ -1,14 +0,0 @@
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class ServicesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: false,
body: Center(
child: Text('Services heeer'),
),
);
}
}

@ -1,103 +0,0 @@
/*
*@author: Amjad Amireh Modified Referred Patients
*@Date:27/5/2020
*@desc:
*/
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable_item_widget.dart';
import 'package:flutter/material.dart';
class PatientReferredScreen extends StatefulWidget {
PatientReferredScreen({Key key}) : super(key: key);
@override
_PatientReferredScreenState createState() => _PatientReferredScreenState();
}
class _PatientReferredScreenState extends State<PatientReferredScreen> {
String patientType;
String patientTypetitle;
List<Map<dynamic,dynamic>>list_product;
@override
void initState() {
super.initState();
list_product=new List();
for(var k=1;k<=5;k++)
{
Map map=Map();
map.putIfAbsent(getName(k), ()=>getContent());
list_product.add(map);
}
list_product.map((s){
}).map((list)=>list).toList();}
@override
Widget build(BuildContext context) {
List<String>list=List();
return AppScaffold(
//TODO : add Translation
appBarTitle: "My Referred Patients",//patientTypetitle,
body: Center(
child: ListView(
children: <Widget>[
for(final map in list_product)
for(final keys in map.keys)
ExpandableItem(keys,map[keys].toList())
,
],
)
),
);
}
String getName(int month)
{
switch(month)
{
case 1:
return "Mahmoud Shrouf";
case 2:
return "Mahmoud Shrouf";
case 3:
return "Mahmoud Shrouf";
case 4:
return "Mahmoud Shrouf";
case 5:
return "Mahmoud Shrouf";
case 6:
return "Mahmoud Shrouf";
case 7:
return "Mahmoud Shrouf";
case 8:
return "Mahmoud Shrouf";
case 9:
return "Mahmoud Shrouf";
case 10:
return "Mahmoud Shrouf";
case 11:
return "Mahmoud Shrouf";
case 12:
return "Mahmoud Shrouf";
}
}
List<dynamic> getContent()
{
return ["1","2","3","4","5","6"].toList();
}
}

@ -1,493 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/insurance_aprovals_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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 '../../../config/shared_pref_kay.dart';
import '../../../config/size_config.dart';
import '../../../models/patient/patiant_info_model.dart';
import '../../../util/dr_app_shared_pref.dart';
import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.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<InsuranceApprovalsScreen> {
var approvalsList;
var filteredApprovalsList;
final _controller = TextEditingController();
/*
*@author: ibrahim al bitar
*@Date:21/5/2020
*@param:
*@return:
*@desc:
*/
getInsuranceApprovalsList(
BuildContext context, PatientViewModel model) 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);
model
.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()).then((c){
approvalsList = model.insuranceApporvalsList;
});
}
@override
Widget build(BuildContext context) {
return BaseView<PatientViewModel>(
onModelReady: (model) => getInsuranceApprovalsList(context, model),
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.insuranceApprovals,
body: model.insuranceApporvalsList == null ||
model.insuranceApporvalsList.length == 0
? DrAppEmbeddedError(
error:
TranslationBase
.of(context)
.errorNoInsuranceApprovals)
: Column(
children: <Widget>[
Container(
margin: EdgeInsets.all(10),
width: SizeConfig.screenWidth * 0.80,
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str, model);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(
context,
TranslationBase
.of(context)
.searchInsuranceApprovals),
),
),
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: <Widget>[
ExpansionTile(
title: Row(
children: <Widget>[
Column(
children: <Widget>[
Icon(
approvalsList[index][
"ApprovalStatusDescption"]
.toString()
.contains("Approved")
? DoctorApp.approved_icon
: approvalsList[index][
"ApprovalStatusDescption"]
.toString()
.contains(
"Cancelled")
? DoctorApp
.reject_icon
: DoctorApp
.pending_icon,
color: approvalsList[index][
"ApprovalStatusDescption"]
.toString()
.contains("Approved")
? Colors.green
: approvalsList[index][
"ApprovalStatusDescption"]
.toString()
.contains(
"Cancelled")
? Colors.red
: Colors.yellow,
),
AppText(
approvalsList[index][
"ApprovalStatusDescption"],
fontSize: SizeConfig
.textMultiplier *
1.5,
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: <Widget>[
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: <Widget>[
Divider(
color: Colors.black,
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
RoundedContainer(
backgroundColor:
Color(PRIMARY_COLOR),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
approvalsList[index]
["ApprovalNo"]
.toString(),
color: Colors.white,
fontSize: 19,
fontWeight: FontWeight.bold,
marginTop: 10,
marginLeft: 10,
marginRight: 10,
marginBottom: 2,
),
AppText(
TranslationBase.of(context)
.approvalNo,
color: Colors.white,
fontSize: 16,
marginTop: 2,
marginLeft: 10,
marginBottom: 15,
marginRight: 10,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <Widget>[
AppText(
TranslationBase.of(
context)
.producerName,
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: <Widget>[
AppText(
TranslationBase.of(
context)
.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: <Widget>[
Expanded(
flex: 1,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <Widget>[
AppText(
TranslationBase.of(
context)
.receiptOn,
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: <Widget>[
AppText(
TranslationBase.of(
context)
.expiryDate,
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, PatientViewModel model) {
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 = model.insuranceApporvalsList;
});
}
}
convertDateFormat(String str) {
if (str == null) return '';
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();
}
bool checkList(List list) {
return list.length > 0 ? true : false;
}
}

@ -1,262 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/lab_orders/lab_orders_req_model.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
import 'lab_result_secreen.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/*
*@author: Elham Rababah
*@Date:26/4/2020
*@param:
*@return:LabOrdersScreen
*@desc: LabOrdersScreen class
*/
class LabOrdersScreen extends StatefulWidget {
@override
_LabOrdersScreenState createState() => _LabOrdersScreenState();
}
class _LabOrdersScreenState extends State<LabOrdersScreen> {
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:
*@desc: getLabResultOrders Function
*/
getLabResultOrders(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
LabOrdersReqModel labOrdersReqModel = LabOrdersReqModel(
patientID: patient.patientId,
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType??1,
languageID: 2);
model.getLabResultOrders(labOrdersReqModel.toJson());
}
@override
Widget build(BuildContext context) {
return BaseView<PatientViewModel>(
onModelReady: (model) => getLabResultOrders(context, model),
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.labOrders,
body: model.patientLabResultOrdersList.length == 0
? DrAppEmbeddedError(
error: TranslationBase
.of(context)
.errorNoLabOrders)
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
),
child: ListView.builder(
itemCount:
model.patientLabResultOrdersList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
LabResult(
labOrders: model
.patientLabResultOrdersList[index],
),
),
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
url: model
.patientLabResultOrdersList[
index]
.doctorImageURL,
name: model
.patientLabResultOrdersList[
index]
.doctorName,
),
Expanded(
child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
if(model
.patientLabResultOrdersList[index]
.doctorName != null )
AppText(
'${model
.patientLabResultOrdersList[index]
.doctorName}',
fontSize: 1.7 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight.w600,
),
SizedBox(
height: 8,
),
AppText(
' ${model
.patientLabResultOrdersList[index]
.projectName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800]),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).invoiceNo,
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${model
.patientLabResultOrdersList[index]
.invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
],
),SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).orderNo,
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${model
.patientLabResultOrdersList[index]
.orderNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
],
)
],
),
),
)
],
),
SizedBox(
height: 3,
),
Divider(
color: Colors.grey,
),
SizedBox(
height: 3,
),
Row(
children: <Widget>[
Icon(
EvaIcons.calendar,
color: Colors.grey[700],
),
SizedBox(
width: 10,
),
Expanded(
child: AppText(
'${Helpers.getDate(model
.patientLabResultOrdersList[index]
.createdOn)}',
fontSize: 2.0 *
SizeConfig.textMultiplier,
),
)
],
)
],
),
),
);
}),
),
),
),);
}
}

@ -1,219 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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 '../../../config/shared_pref_kay.dart';
import '../../../config/size_config.dart';
import '../../../models/patient/patiant_info_model.dart';
import '../../../util/dr_app_shared_pref.dart';
import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.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<PatientsOrdersScreen> {
var notesList;
var filteredNotesList;
final _controller = TextEditingController();
var _isInit = true;
/*
*@author: ibrahim al bitar
*@Date:21/5/2020
*@param:
*@return:
*@desc:
*/
getProgressNoteList(BuildContext context, PatientViewModel model ) 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);
model.getPatientProgressNote(progressNoteRequest.toJson()).then((c){
notesList = model.patientProgressNoteList;
});
}
@override
Widget build(BuildContext context) {
return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).orders,
body: notesList == null || notesList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoOrders)
: Column(
children: <Widget>[
Container(
margin: EdgeInsets.all(10),
width: SizeConfig.screenWidth * 0.80,
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str, model);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(context,
TranslationBase.of(context).searchOrders),
),
),
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: <Widget>[
ExpansionTile(
title: Container(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
notesList[index]
["DoctorName"],
marginTop: 10,
marginLeft: 10,
marginBottom: 5,
fontWeight: FontWeight.bold,
),
AppText(
notesList[index]
["AdmissionNo"],
marginLeft: 10,
color: Colors.grey[600],
),
AppText(
convertDateFormat(
notesList[index]
["AssessmentDate"]),
marginLeft: 10,
color: Colors.grey[600],
),
],
),
),
children: <Widget>[
Divider(
color: Colors.black,
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
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, PatientViewModel model) {
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 = model.patientProgressNoteList;
});
}
}
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();
}
}

@ -1,88 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/reauest_prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/prescription_in_patinets_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/prescription_out_patinets_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../models/patient/prescription/prescription_req_model.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/*
*@author: Elham Rababah
*@Date:26/4/2020
*@param:
*@return:PrescriptionScreen
*@desc: PrescriptionScreen class
*/
class PrescriptionScreen extends StatefulWidget {
@override
_PrescriptionScreenState createState() => _PrescriptionScreenState();
}
class _PrescriptionScreenState extends State<PrescriptionScreen> {
String type = '2';
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:
*@desc: getPrescriptionsList Function
*/
getPrescriptionsList(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
if (type == '1') {
RequestPrescriptionReportForInPatient prescriptionReqModel =
RequestPrescriptionReportForInPatient(
patientID: patient.patientId,
patientTypeID: patient.patientType,
admissionNo: int.parse(patient.admissionNo));
model.getInPatientPrescriptions(prescriptionReqModel.toJson());
} else {
PrescriptionReqModel prescriptionReqModel = PrescriptionReqModel(
patientID: patient.patientId,
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2,
setupID: 0);
model.getOutPatientPrescriptions(prescriptionReqModel.toJson());
}
}
@override
Widget build(BuildContext context) {
return BaseView<PatientViewModel>(
onModelReady: (model) => getPrescriptionsList(context, model),
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.prescription,
body: type == '1'
? PrescriptionInPatientWidget(
prescriptionReportForInPatientList:
model.prescriptionReportForInPatientList,
)
: PrescriptionOutPatientWidget(
patientPrescriptionsList:
model.patientPrescriptionsList,
),
),);
}
}

@ -1,192 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology/radiology_req_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_report_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/*
*@author: Elham Rababah
*@Date:26/4/2020
*@param:
*@return:RadiologyScreen
*@desc: RadiologyScreen class
*/
class RadiologyScreen extends StatefulWidget {
@override
_RadiologyScreenState createState() => _RadiologyScreenState();
}
class _RadiologyScreenState extends State<RadiologyScreen> {
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:
*@desc: getRadiologyList Function
*/
getRadiologyList(context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
int inOutpatientType = 1;
if (type == '0') {
inOutpatientType = 2;
}
print(type);
RadiologyReqModel radiologyReqModel = RadiologyReqModel(
patientID: patient.patientId,
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2,
);
model.getPatientRadiology(radiologyReqModel.toJson());
}
@override
Widget build(BuildContext context) {
return BaseView<PatientViewModel>(
onModelReady: (model) => getRadiologyList(context, model),
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.radiology,
body:
model.patientRadiologyList.length == 0
? DrAppEmbeddedError(
error: TranslationBase
.of(context)
.youDoNotHaveAnyItem)
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
),
child: ListView.builder(
itemCount: model.patientRadiologyList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
RadiologyReportScreen(
reportData: model
.patientRadiologyList[index]
.reportData,
url: model
.patientRadiologyList[index].imageURL,
)),
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
url: model
.patientRadiologyList[index]
.doctorImageURL,
),
Expanded(
child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${model.patientRadiologyList[index].doctorName}',
fontSize: 2.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold),
SizedBox(
height: 8,
),
AppText(
'Invoice No:${model.patientRadiologyList[index].invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
' ${model.patientRadiologyList[index].clinicName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Theme.of(context)
.primaryColor,
),
SizedBox(
height: 8,
),
],
),
),
)
],
),
],
),
),
);
}),
),
),
),);
}
}

@ -1,407 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.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:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import '../../../config/size_config.dart';
import '../../../util/dr_app_shared_pref.dart';
import '../../../util/extenstions.dart';
import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/*
*@author: ibrahim albitar
*@Date:4/6/2020
*@param:
*@return:
*@desc:
*/
class ReferPatientScreen extends StatefulWidget {
@override
_ReferPatientState createState() => _ReferPatientState();
}
class _ReferPatientState extends State<ReferPatientScreen> {
dynamic _selectedClinic;
dynamic _selectedDoctor;
final _extController = TextEditingController();
int _activePriority = 1;
dynamic _selectedFrequency;
final _remarksController = TextEditingController();
bool isValid;
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referralPatient,
body: model.clinicsList == null
? DrAppEmbeddedError(error: 'Something Wrong!')
: SingleChildScrollView(
child: Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = null;
_selectedClinic = selectedValue;
model.getDoctorsList(
_selectedClinic['ClinicID']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinicSelect,
_selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doctorSelect,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).ext, null, false),
enabled: true,
controller: _extController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
priorityBar(context, screenSize),
SizedBox(
height: 20,
),
AppText(
"${TranslationBase.of(context).referralFrequency} ${getPriority()}",
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 20,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.referralFrequencyList != null &&
model.referralFrequencyList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.referralFrequencyList,
attributeName: 'Description',
attributeValueId: 'ParameterCode',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedFrequency = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.selectReferralFrequency,
_selectedFrequency != null
? _selectedFrequency['Description']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinicDetailsandRemarks,
null,
false),
enabled: true,
controller: _remarksController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_LETTERS))
],
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
child: Column(
children: <Widget>[
AppText(
TranslationBase.of(context).pleaseFill,
color: HexColor("#B8382B"),
fontWeight: FontWeight.bold,
margin: 10,
visibility: isValid == null ? false : !isValid,
),
// TODO replace AppButton with secondary button and add loading
AppButton(
title: TranslationBase.of(context).send,
color: HexColor("#B8382B"),
onPressed: () => {referToDoctor(context, model)},
)
],
),
),
],
),
),
),
),
);
}
Widget priorityBar(BuildContext _context, Size screenSize) {
List<String> _priorities = [
TranslationBase.of(context).veryUrgent.toUpperCase(),
TranslationBase.of(context).urgent.toUpperCase(),
TranslationBase.of(context).routine.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item) {
bool _isActive = _priorities[_activePriority] == item ? true : false;
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
)),
),
onTap: () {
print(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);
});
},
),
);
}).toList(),
),
);
}
String getPriority() {
DateTime date = DateTime.now();
switch (_activePriority) {
case 0:
date = date.add(new Duration(hours: 3));
break;
case 1:
date = date.add(new Duration(hours: 6));
break;
case 2:
date = date.add(new Duration(days: 1));
break;
}
var format = DateFormat('yyyy/mm/dd HH:mm a');
var time = format.format(date);
print(time);
return time;
}
referToDoctor(BuildContext context, PatientViewModel model) async {
if (!validation()) {
return;
}
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
try {
await model.referToDoctor(
extension: _extController.value.text,
admissionNo: int.parse(patient.admissionNo),
referringDoctorRemarks: _remarksController.value.text,
frequency: _selectedFrequency['ParameterCode'].toString(),
patientID: patient.patientId,
patientTypeID: patient.patientType,
priority: (_activePriority + 1).toString(),
roomID: patient.roomId,
selectedClinicID: _selectedClinic['ClinicID'].toString(),
selectedDoctorID: _selectedDoctor['DoctorID'].toString(),
projectID: patient.projectId);
// TODO: Add Translation
DrAppToastMsg.showSuccesToast('Reply Successfully');
Navigator.pop(context);
} catch (e) {
DrAppToastMsg.showErrorToast(e);
}
}
bool validation() {
setState(() {
isValid = !_extController.value.text.isNullOrEmpty() &&
!_remarksController.value.text.isNullOrEmpty() &&
_selectedClinic != null &&
_selectedDoctor != null &&
_selectedFrequency != null;
});
return isValid;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
}

@ -1,91 +0,0 @@
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:flutter/material.dart';
import '../config/size_config.dart';
import '../widgets/shared/app_scaffold_widget.dart';
import '../widgets/shared/drawer_item_widget.dart';
import '../widgets/shared/profile_image_widget.dart';
import '../widgets/shared/rounded_container_widget.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
class ProfileScreen extends StatefulWidget {
ProfileScreen({Key key, this.title, this.doctorProfileall}) : super(key: key);
final String title;
DoctorProfileModel doctorProfileall;
@override
_ProfileScreenState createState() => _ProfileScreenState();
}
class _ProfileScreenState extends State<ProfileScreen> {
//**************************
DoctorProfileModel doctorProfile;
//AppDrawer dr;
//******************
@override
Widget build(BuildContext context) {
Map arg = ModalRoute.of(context).settings.arguments
as Map; //ModalRoute.of(context).settings.arguments;
doctorProfile = arg['doctorProfileall'];
print("******************");
//print(doctorProfile.doctorName);
print("******************");
return AppScaffold(
appBarTitle: TranslationBase.of(context).profile,
body: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container(
height: MediaQuery.of(context).size.height *
0.35, //SizeConfig.heightMultiplier * 35,
child: Container(
child: DrawerHeader(
child: Container(
child: ProfileImageWidget(
url: doctorProfile.doctorImageURL,
//"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png",
name: doctorProfile.doctorName, //"Dr. Chris evans",
des: doctorProfile
.clinicDescription //"Director of medical records",
),
),
),
),
),
RoundedContainer(
child: ListView(
children: <Widget>[
DrawerItem(
TranslationBase.of(context).gender,
icon: Icons.person_pin,
color: Colors.black,
subTitle: doctorProfile.genderDescription //"Male"
,
),
DrawerItem(TranslationBase.of(context).clinic, icon: Icons.build,
color: Colors.black,
subTitle:
doctorProfile.clinicDescription //"Neurology Clinic",
),
DrawerItem(
TranslationBase.of(context).hospital,
icon: Icons.local_hospital,
color: Colors.black,
subTitle: doctorProfile.projectName, //"Al-Takkassussi",
),
DrawerItem(
TranslationBase.of(context).speciality,
icon: Icons.crop_square,
color: Colors.black,
subTitle: doctorProfile.doctorRate == 0
? TranslationBase.of(context).beingBad
: TranslationBase.of(context).beingGreat,
),
],
),
width: SizeConfig.screenWidth * 0.70,
height: SizeConfig.screenHeight * 0.40,
),
]));
}
}

@ -1,66 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class SettingsScreen extends StatelessWidget {
ProjectViewModel projectsProvider;
@override
Widget build(BuildContext context) {
projectsProvider = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).settings.toUpperCase(),
body: ListView(
children: [
AppText(TranslationBase.of(context).language.toUpperCase(),fontSize: 18,margin: 5,fontWeight: FontWeight.bold,),
Container(
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey[600],width: 2.0),
borderRadius: BorderRadius.circular(8.0)
),
child: ClipRRect(
borderRadius: BorderRadius.circular(7.0),
child: Row(
children: [
Expanded(
child: InkWell(
onTap: () { projectsProvider.changeLanguage('en'); },
child: AnimatedContainer(
duration: Duration(milliseconds: 350),
decoration: BoxDecoration(
color: !projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
),
child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500]))
),
),
),
Expanded(
child: InkWell(
onTap: (){projectsProvider.changeLanguage('ar');},
child: AnimatedContainer(
duration: Duration(milliseconds: 350),
decoration: BoxDecoration(
color: projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
),
child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],))
),
),
)
],
),
),
)
],
),
);
}
}
Loading…
Cancel
Save