Merge branch 'code_reafactoring' into 'development'

Code reafactoring

See merge request Cloud_Solution/doctor_app_flutter!522
merge-requests/517/merge
Mohammad Aljammal 5 years ago
commit b49df64d4c

@ -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,14 +1,10 @@
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/screens/patients/profile/patient_profile_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.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/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -100,7 +96,11 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(mrn: pp),
onModelReady: (model) async {
if (model.medicalFileList.length == 0) {
model.getMedicalFile(mrn: pp);
}
},
builder:
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
@ -128,8 +128,6 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: Container(
child: Column(
children: [
// PatientProfileHeaderNewDesign(patient,
// patient.patientType.toString(), patient.arrivedOn),
model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
@ -144,161 +142,6 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: Container(
child: Column(
children: [
// Container(
// width: double.infinity,
// margin: EdgeInsets.only(
// top: 10, left: 10, right: 10),
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.all(
// Radius.circular(10.0),
// ),
// border: Border.all(
// color: Colors.grey[200], width: 0.5),
// ),
// child: Column(
// children: [
// Row(
// children: [
// if (model.medicalFileList.length !=
// 0 &&
// model
// .medicalFileList[0]
// .entityList[0]
// .timelines[
// encounterNumber]
// .timeLineEvents[0]
// .consulations
// .length !=
// 0)
// Expanded(
// child: AppText(
// model
// .medicalFileList[0]
// .entityList[0]
// .timelines[
// encounterNumber]
// .timeLineEvents[0]
// .consulations[0]
// .doctorName
// .toUpperCase(),
// fontWeight: FontWeight.w700,
// ),
// ),
// ],
// ),
// if (model.medicalFileList.length != 0)
// Row(
// children: [
// AppText(
// TranslationBase.of(context)
// .clinic +
// ": ",
// ),
// if (model.medicalFileList
// .length !=
// 0 &&
// model
// .medicalFileList[0]
// .entityList[0]
// .timelines[
// encounterNumber]
// .timeLineEvents[0]
// .consulations
// .length !=
// 0)
// AppText(
// model
// .medicalFileList[0]
// .entityList[0]
// .timelines[
// encounterNumber]
// .timeLineEvents[0]
// .consulations[0]
// .clinicName,
// fontWeight: FontWeight.w700,
// ),
// ],
// ),
// Row(
// children: [
// AppText(
// TranslationBase.of(context)
// .episode +
// ": ",
// //fontWeight: FontWeight.w700,
// ),
// if (model.medicalFileList.length !=
// 0 &&
// model
// .medicalFileList[0]
// .entityList[0]
// .timelines[
// encounterNumber]
// .timeLineEvents[0]
// .consulations
// .length !=
// 0)
// AppText(
// model
// .medicalFileList[0]
// .entityList[0]
// .timelines[encounterNumber]
// .timeLineEvents[0]
// .consulations[0]
// .episodeID
// .toString(),
// fontWeight: FontWeight.w700,
// ),
// ],
// ),
// Row(
// children: [
// AppText(
// TranslationBase.of(context)
// .visitDate +
// ": ",
// //fontWeight: FontWeight.w700,
// ),
// if (model.medicalFileList.length !=
// 0 &&
// model
// .medicalFileList[0]
// .entityList[0]
// .timelines[
// encounterNumber]
// .timeLineEvents[0]
// .consulations
// .length !=
// 0)
// AppText(
// '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(
// model
// .medicalFileList[0]
// .entityList[0]
// .timelines[
// encounterNumber]
// .date,
// ), isArabic: projectViewModel.isArabic)}',
// color: Colors.black,
// fontWeight: FontWeight.w700,
// fontSize: 14,
// ),
// SizedBox(width: 35.0),
// // AppText(
// // 'Appt Date : ',
// // fontWeight: FontWeight.w700,
// // ),
// // AppText(
// // '23/12/2020',
// // ),
// ],
// ),
// ],
// ),
// ),
SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 &&
model
@ -655,14 +498,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
),
),
// SizedBox(
// height: 30,
// ),
// Container(
// width: double.infinity,
// height: 1,
// color: Color(0xffCCCCCC),
// ),
SizedBox(
height: 30,
),
@ -889,14 +725,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
),
),
// SizedBox(
// height: 30,
// ),
// Container(
// width: double.infinity,
// height: 1,
// color: Color(0xffCCCCCC),
// ),
SizedBox(
height: 30,
),
@ -1086,11 +915,6 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox(
height: 30,
),
// Container(
// width: double.infinity,
// height: 1,
// color: Color(0xffCCCCCC),
// ),
],
),
),

@ -1,25 +1,16 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/screens/medical-file/medical_file_details.dart';
import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.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/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class MedicalFilePage extends StatefulWidget {
@override
@ -49,13 +40,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
child: SingleChildScrollView(
child: Container(
child: Column(
// mainAxisAlignment: model.medicalFileList.length != 0 &&
// model.medicalFileList != null
// ? MainAxisAlignment.start
// : MainAxisAlignment.center,
children: [
// PatientProfileHeaderNewDesign(
// patient, patient.patientType.toString(), arrivalType),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),

@ -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,263 +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/date-utils.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(
'${DateUtils.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,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