Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into fix-issues

 Conflicts:
	lib/widgets/patients/profile/soap_update/steps_widget.dart
merge-requests/451/head
hussam al-habibeh 4 years ago
commit b83c7835b9

@ -247,7 +247,6 @@ const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh'; 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
var selectedPatientType = 1; var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************

@ -517,7 +517,7 @@ const Map<String, Map<String, String>> localizedValues = {
'addHistory': {'en': "Add History", 'ar': "اضافه تاريخ مرضي"}, 'addHistory': {'en': "Add History", 'ar': "اضافه تاريخ مرضي"},
'searchHistory': {'en': "Search History", 'ar': " البحث"}, 'searchHistory': {'en': "Search History", 'ar': " البحث"},
'addSelectedHistories': { 'addSelectedHistories': {
'en': "add selected histories", 'en': "Add Selected Histories",
'ar': " اضافه تاريخ مرضي" 'ar': " اضافه تاريخ مرضي"
}, },
'addAllergies': {'en': "Add Allergies", 'ar': "أضف الحساسية"}, 'addAllergies': {'en': "Add Allergies", 'ar': "أضف الحساسية"},
@ -824,8 +824,13 @@ const Map<String, Map<String, String>> localizedValues = {
"accepted": {"en": "Accepted", "ar": "وافقت"}, "accepted": {"en": "Accepted", "ar": "وافقت"},
"cancelled": {"en": "Cancelled", "ar": "ألغيت"}, "cancelled": {"en": "Cancelled", "ar": "ألغيت"},
"unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"},
"replied": {"en": "Replied", "ar": " تم الرد"},"typeHereToReply": { "searchHere": {"en": "Search here", "ar": "إبحث هنا"},
"replied": {"en": "Replied", "ar": " تم الرد"},
"typeHereToReply": {
"en": "Type here to reply", "en": "Type here to reply",
"ar": "اكتب هنا للرد" "ar": "اكتب هنا للرد"
},"remove": {
"en": "Remove",
"ar": "حذف"
}, },
}; };

@ -136,8 +136,10 @@ class SickLeaveService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
offTime = []; offTime = [];
response['MasterLookUpList']['entityList'].forEach((item) => { response['MasterLookUpList']['entityList'].forEach((item) => {
if (item['code'] == '1' || item['code'] == '2') //if (item['code'] == '1' || item['code'] == '2')
{offTime.add(item)} // {
offTime.add(item)
//}//
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -801,7 +801,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
model.dashboardItemsList[4] model.dashboardItemsList[6]
.kPIName, .kPIName,
fontSize: fontSize:
SizeConfig.textMultiplier * SizeConfig.textMultiplier *
@ -827,11 +827,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
Axis.horizontal, Axis.horizontal,
children: new List.generate( children: new List.generate(
model model
.dashboardItemsList[4] .dashboardItemsList[6]
.summaryoptions .summaryoptions
.length, (int index) { .length, (int index) {
return getActivityButton(model return getActivityButton(model
.dashboardItemsList[4] .dashboardItemsList[6]
.summaryoptions[index]); .summaryoptions[index]);
}))) })))
], ],
@ -843,7 +843,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
model.dashboardItemsList[6] model.dashboardItemsList[4]
.kPIName, .kPIName,
fontSize: fontSize:
SizeConfig.textMultiplier * SizeConfig.textMultiplier *
@ -869,11 +869,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
Axis.horizontal, Axis.horizontal,
children: new List.generate( children: new List.generate(
model model
.dashboardItemsList[6] .dashboardItemsList[4]
.summaryoptions .summaryoptions
.length, (int index) { .length, (int index) {
return getActivityButton(model return getActivityButton(model
.dashboardItemsList[6] .dashboardItemsList[4]
.summaryoptions[index]); .summaryoptions[index]);
}))) })))
], ],
@ -1221,7 +1221,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Container( Container(
height: 150, height: 150,
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
width: ((SizeConfig.screenWidth * .55) / 5.3), width: 40,
child: SizedBox(), child: SizedBox(),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), color: Colors.red[50]), borderRadius: BorderRadius.circular(10), color: Colors.red[50]),
@ -1233,14 +1233,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
height: max != 0 ? (150 * value.value) / max : 0, height: max != 0 ? (150 * value.value) / max : 0,
width: ((SizeConfig.screenWidth * .55) / 5), width: 40,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: Colors.red[300]))), color: Colors.red[300]))),
Container( Container(
height: 150, height: 150,
margin: EdgeInsets.only(left: 10, top: 5), margin: EdgeInsets.only(left: 5, top: 5),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(10),
child: RotatedBox( child: RotatedBox(
quarterTurns: 1, quarterTurns: 1,
child: Center( child: Center(

@ -226,11 +226,11 @@ class _PatientsScreenState extends State<PatientsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context); authProvider = Provider.of(context);
_locations = [ _locations = [
TranslationBase.of(context).all,
TranslationBase.of(context).today, TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow, TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek, TranslationBase.of(context).nextWeek,
]; ];
//TranslationBase.of(context).all,
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
@ -454,12 +454,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
.size .size
.height * .height *
0.03), 0.03),
child: _locationBar(context) // child: _locationBar(context)
// child: SERVICES_PATIANT2[ child: SERVICES_PATIANT2[
// int.parse(patientType)] == int.parse(patientType)] ==
// "List_MyOutPatient" "patientArrivalList"
// ? _locationBar(context) ? _locationBar(context)
// : Container(), : Container(),
), ),
// Row( // Row(
// mainAxisAlignment: // mainAxisAlignment:

@ -17,6 +17,7 @@ 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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widg
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -74,11 +75,8 @@ class MyReferralPatientScreen extends StatelessWidget {
'referral': model.pendingReferral[index] 'referral': model.pendingReferral[index]
}); });
}, },
child: Icon( child: Icon(FontAwesomeIcons.arrowRight,
Icons.info_outline, size: 25, color: Colors.black),
color: Colors.black,
size: 30,
),
), ),
), ),
), ),

@ -104,13 +104,19 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
offTime = widget.updateData != null
? widget.updateData.requisitionType.toString()
: offTime;
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>( builder: (_, model, w) => BaseView<SickLeaveViewModel>(
onModelReady: (model2) => { onModelReady: (model2) => {
model2.getOffTime(), model2.getOffTime(),
model2.getReasons(18), model2.getReasons(offTime == '1'
? 18
: offTime == '2'
? 19
: 102),
model2.getCoveringDoctors() model2.getCoveringDoctors()
}, },
builder: (_, model2, w) => GestureDetector( builder: (_, model2, w) => GestureDetector(

@ -35,7 +35,8 @@ class AddSickLeavScreen extends StatelessWidget {
child: Column(children: [ child: Column(children: [
PatientProfileHeaderNewDesign( PatientProfileHeaderNewDesign(
patient, routeArgs['patientType'], routeArgs['arrivalType']), patient, routeArgs['patientType'], routeArgs['arrivalType']),
Column( patient.patientStatusType == 43
? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
@ -86,7 +87,8 @@ class AddSickLeavScreen extends StatelessWidget {
)), )),
Padding( Padding(
child: AppText( child: AppText(
TranslationBase.of(context).noSickLeaveApplied, TranslationBase.of(context)
.noSickLeaveApplied,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 16, fontSize: 16,
@ -97,7 +99,8 @@ class AddSickLeavScreen extends StatelessWidget {
], ],
)), )),
], ],
), )
: SizedBox(),
model.getAllSIckLeave.length > 0 model.getAllSIckLeave.length > 0
? Column( ? Column(
children: model.getAllSIckLeave children: model.getAllSIckLeave

@ -1205,6 +1205,8 @@ class TranslationBase {
String get unReplied => localizedValues['unReplied'][locale.languageCode]; String get unReplied => localizedValues['unReplied'][locale.languageCode];
String get replied => localizedValues['replied'][locale.languageCode]; String get replied => localizedValues['replied'][locale.languageCode];
String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode];
String get searchHere => localizedValues['searchHere'][locale.languageCode];
String get remove => localizedValues['remove'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -463,28 +463,32 @@ class PatientReferralItemWidget extends StatelessWidget {
width: 30, width: 30,
height: 30, height: 30,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 10 /*10:85*/, left:
right: projectViewModel.isArabic ? 10 : 10 /*85:10*/, projectViewModel.isArabic ? 10 : 10 /*10:85*/,
right:
projectViewModel.isArabic ? 10 : 10 /*85:10*/,
top: 5), top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: bottom: BorderSide(
BorderSide(color: Colors.grey[400], width: 2.5), color: Colors.grey[400], width: 2.5),
left: left: BorderSide(
BorderSide(color: Colors.grey[400], width: 2.5), color: Colors.grey[400], width: 2.5),
)), )),
), ),
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only(left: 10, top: 25, right : 10, bottom: 0), margin: EdgeInsets.only(
left: 10, top: 25, right: 10, bottom: 0),
child: Column( child: Column(
children: [ children: [
RichText( RichText(
text: TextSpan( text: TextSpan(
style: TextStyle( style: TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black), color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
@ -492,7 +496,8 @@ class PatientReferralItemWidget extends StatelessWidget {
.referralDoctor + .referralDoctor +
" : ", " : ",
style: TextStyle( style: TextStyle(
fontSize: 14, fontFamily: 'Poppins')), fontSize: 14,
fontFamily: 'Poppins')),
TextSpan( TextSpan(
text: referralDoctorName, text: referralDoctorName,
style: TextStyle( style: TextStyle(
@ -511,8 +516,7 @@ class PatientReferralItemWidget extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Icon(FontAwesomeIcons.arrowRight, child: infoIcon ?? Container())
size: 25, color: Colors.black))
], ],
), ),
// onTap: onTap, // onTap: onTap,

@ -116,7 +116,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' arrivalType == '1'|| patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != null patient.startTime != null
? patient.startTime ? patient.startTime

@ -14,9 +14,10 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
final double height;
PatientProfileHeaderNewDesign( PatientProfileHeaderNewDesign(
this.patient, this.patientType, this.arrivalType); this.patient, this.patientType, this.arrivalType, {this.height = 0.0});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,7 +37,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
height: 200, height: height == 0 ? 200 : height,
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(top: 50),
@ -116,7 +117,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != null patient.startTime != null
? patient.startTime ? patient.startTime

@ -150,7 +150,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
'Poppins', 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != patient.startTime !=
null null

@ -150,7 +150,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
'Poppins', 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != patient.startTime !=
null null

@ -43,34 +43,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
childAspectRatio: 1 / 1.0, childAspectRatio: 1 / 1.0,
crossAxisCount: 3, crossAxisCount: 3,
children: [ children: [
/*if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
isDisable: patient.episodeNo != 0 ? true : false,
nameLine1: TranslationBase.of(context).createNew,
nameLine2: TranslationBase.of(context).episode,
route: CREATE_EPISODE,
onTap: () async {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: patient.appointmentNo,
patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel);
patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(CREATE_EPISODE,
arguments: {'patient': patient});
},
isLoading: model.state == ViewState.BusyLocal,
icon: 'create-episod.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
isDisable: patient.episodeNo == 0 ? true : false,
nameLine1: TranslationBase.of(context).update,
nameLine2: TranslationBase.of(context).episode,
route: UPDATE_EPISODE,
icon: 'modilfy-episode.png'),*/
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -84,15 +56,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: VITAL_SIGN_DETAILS, route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'), icon: 'patient/vital_signs.png'),
if (selectedPatientType != 7) if (selectedPatientType != 7)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -102,47 +65,34 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).previewHealth, nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport, nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'), icon: 'patient/health_summary.png'),
if (selectedPatientType != 0 &&
selectedPatientType != 5 &&
selectedPatientType != 7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PROGRESS_NOTE, route: LAB_RESULT,
nameLine1: TranslationBase.of(context).progress, nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).note, nameLine2: TranslationBase.of(context).result,
icon: 'patient/Progress_notes.png'), icon: 'patient/lab_results.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_ADMISSION_REQUEST, route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).request, nameLine2: TranslationBase.of(context).service,
icon: 'patient/admission_req.png'), icon: 'patient/health_summary.png'),
// (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton(
// ? PatientProfileButton( key: key,
// key: key, patient: patient,
// patient: patient, patientType: patientType,
// patientType: patientType, arrivalType: arrivalType,
// arrivalType: arrivalType, route: PATIENT_ECG,
// route: ORDER_PRESCRIPTION, nameLine1: TranslationBase.of(context).patient,
// nameLine1: TranslationBase.of(context).orders, nameLine2: "ECG",
// nameLine2: TranslationBase.of(context).prescription, icon: 'patient/patient_sick_leave.png'),
// icon: 'patient/order_prescription.png')
// : PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: ORDER_PRESCRIPTION_HISTORY,
// nameLine1: TranslationBase.of(context).orders,
// nameLine2: TranslationBase.of(context).prescription,
// icon: 'patient/order_prescription.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -168,10 +118,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR, route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).myReferral, nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).service,
icon: 'patient/refer_patient.png'), icon: 'patient/vital_signs.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -189,6 +139,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_UCAF_REQUEST, route: PATIENT_UCAF_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf, nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'), icon: 'patient/ucaf.png'),
@ -198,29 +149,32 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: RADIOLOGY_PATIENT, route: REFER_PATIENT_TO_DOCTOR,
nameLine1: TranslationBase.of(context).radiology, isDisable: patient.patientStatusType != 43 ? true : false,
nameLine2: TranslationBase.of(context).service, nameLine1: TranslationBase.of(context).myReferral,
icon: 'patient/health_summary.png'), nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW, route: PATIENT_ADMISSION_REQUEST,
nameLine1: TranslationBase.of(context).insurance, isDisable: patient.patientStatusType != 43 ? true : false,
nameLine2: TranslationBase.of(context).service, nameLine1: TranslationBase.of(context).admission,
icon: 'patient/vital_signs.png'), nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
if (patientType == "1")
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_ECG, route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).progress,
nameLine2: "ECG", nameLine2: TranslationBase.of(context).note,
icon: 'patient/patient_sick_leave.png'), icon: 'patient/Progress_notes.png'),
], ],
), ),
); );

@ -39,19 +39,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: RADIOLOGY_PATIENT, from: from,
nameLine1: TranslationBase.of(context).radiology, to: to,
nameLine2: TranslationBase.of(context).service, nameLine1: TranslationBase.of(context).vital,
icon: 'patient/health_summary.png'), nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW, route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).insurance, nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/vital_signs.png'), icon: 'patient/health_summary.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -66,19 +68,19 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
from: from, route: RADIOLOGY_PATIENT,
to: to, nameLine1: TranslationBase.of(context).radiology,
nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).service,
nameLine2: TranslationBase.of(context).signs, icon: 'patient/health_summary.png'),
route: VITAL_SIGN_DETAILS, PatientProfileButton(
icon: 'patient/vital_signs.png'), key: key,
// PatientProfileButton( patient: patient,
// key: key, patientType: patientType,
// patient: patient, arrivalType: arrivalType,
// route: PATIENT_ADMISSION_REQUEST, route: PATIENT_ECG,
// nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).patient,
// nameLine2: TranslationBase.of(context).request, nameLine2: "ECG",
// icon: 'heartbeat.png'), icon: 'patient/patient_sick_leave.png'),
(int.parse(patientType) == 7 || int.parse(patientType) == 6) (int.parse(patientType) == 7 || int.parse(patientType) == 6)
? PatientProfileButton( ? PatientProfileButton(
key: key, key: key,
@ -103,19 +105,10 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: MEDICAL_FILE, route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).previewHealth, nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).summaryReport, nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'), icon: 'patient/vital_signs.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -125,6 +118,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
nameLine1: TranslationBase.of(context).patientSick, nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'), icon: 'patient/patient_sick_leave.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// route: PATIENT_ADMISSION_REQUEST,
// nameLine1: TranslationBase.of(context).admission,
// nameLine2: TranslationBase.of(context).request,
// icon: 'heartbeat.png'),
if (patientType == "1")
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,

@ -11,9 +11,10 @@ class ExpandableSOAPWidget extends StatelessWidget {
final Widget child; final Widget child;
final Function onTap; final Function onTap;
final headerTitle; final headerTitle;
final bool isRequired;
const ExpandableSOAPWidget( const ExpandableSOAPWidget(
{Key key, this.isExpanded, this.child, this.onTap, this.headerTitle}) {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true})
: super(key: key); : super(key: key);
@override @override
@ -37,9 +38,10 @@ class ExpandableSOAPWidget extends StatelessWidget {
children: [ children: [
Texts(headerTitle, Texts(headerTitle,
variant: isExpanded ? "bodyText" : '', variant: isExpanded ? "bodyText" : '',
bold: isExpanded ? true : false, // bold: isExpanded ? true : false,
fontSize: 15, fontSize: 15,
color: Colors.black), color: Colors.black),
if(isRequired)
Icon( Icon(
FontAwesomeIcons.asterisk, FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor, color: AppGlobal.appPrimaryColor,

@ -0,0 +1,92 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class ExaminationIitemCard extends StatelessWidget {
final MySelectedExamination examination;
final Function removeExamination;
ExaminationIitemCard(this.examination, this.removeExamination);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
color: Colors.white,
padding: EdgeInsets.all(8),
margin: EdgeInsets.only(bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Container(
child: AppText(
projectViewModel.isArabic
? examination.selectedExamination.nameAr != null &&
examination.selectedExamination.nameAr != ""
? examination.selectedExamination.nameAr
: examination.selectedExamination.nameEn
: examination.selectedExamination.nameEn,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.8,
),
)),
Row(
children: [
AppText(
TranslationBase.of(context).remove,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: Colors.red.shade800,
fontSize: SizeConfig.textMultiplier * 1.8,
),
InkWell(
onTap: removeExamination,
child: Icon(
Icons.clear,
size: 20,
color: Colors.red.shade800,
),
)
],
),
],
),
AppText(
!examination.isNormal
? examination.isAbnormal
? TranslationBase.of(context).abnormal
: TranslationBase.of(context).notExamined
: TranslationBase.of(context).normal,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: !examination.isNormal
? examination.isAbnormal
? Colors.red.shade800
: Colors.grey.shade800
: Colors.green.shade800,
fontSize: SizeConfig.textMultiplier * 1.8,
),
SizedBox(
height: 4,
),
AppText(
examination.remark,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
color: Colors.grey.shade500,
fontSize: SizeConfig.textMultiplier * 1.8,
),
],
),
);
}
}

@ -0,0 +1,506 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/app-textfield-custom.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/borderedButton.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
// Author Mosa Abuzaid
class AddExaminationPage extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
AddExaminationPage(
{this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination});
@override
_AddExaminationPageState createState() => _AddExaminationPageState();
}
class _AddExaminationPageState extends State<AddExaminationPage> {
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
backgroundColor: Color.fromRGBO(248, 248, 248, 1),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
padding:
EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16),
color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: AppText(
"${TranslationBase.of(context).addExamination}",
fontSize: SizeConfig.textMultiplier * 3.3,
color: Colors.black,
fontWeight: FontWeight.w700,
),
),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Icon(
Icons.clear,
size: 40,
),
)
],
),
),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.all(16.0),
padding: EdgeInsets.all(0.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.fromBorderSide(BorderSide(
color: Colors.grey.shade400,
width: 0.4,
)),
),
child: Column(
children: [
ExaminationsListSearchWidget(
masterList: model.physicalExaminationList,
isServiceSelected: (master) =>
isServiceSelected(master),
removeHistory: (history) {
setState(() {
widget.removeExamination(history);
});
},
addHistory: (selectedExamination) {
setState(() {
widget.mySelectedExamination
.add(selectedExamination);
});
},
),
],
),
),
],
),
),
),
Container(
padding: EdgeInsets.all(16),
color: Colors.white,
child: BorderedButton(
"${TranslationBase.of(context).addExamination}",
backgroundColor: HexColor("#359846"),
textColor: Colors.white,
vPadding: 12,
radius: 12,
fontWeight: FontWeight.w600,
fontSize: SizeConfig.textMultiplier * 2.5,
fontFamily: 'Poppins',
handler: () {
widget.addSelectedExamination();
},
),
)
],
),
),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) {
return true;
}
return false;
}
}
class ExaminationsListSearchWidget extends StatefulWidget {
final Function(MasterKeyModel) removeHistory;
final Function(MySelectedExamination) addHistory;
final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel> masterList;
ExaminationsListSearchWidget(
{this.removeHistory,
this.addHistory,
this.isServiceSelected,
this.masterList});
@override
_ExaminationsListSearchWidgetState createState() =>
_ExaminationsListSearchWidgetState();
}
class _ExaminationsListSearchWidgetState
extends State<ExaminationsListSearchWidget> {
int expandedIndex = -1;
List<MasterKeyModel> items = List();
TextEditingController filteredSearchController = TextEditingController();
@override
void initState() {
items.addAll(widget.masterList);
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
AppTextFieldCustom(
height: MediaQuery.of(context).size.height * 0.080,
hintText: TranslationBase.of(context).searchExamination,
isDropDown: true,
hasBorder: false,
controller: filteredSearchController,
onChanged: (value) {
filterSearchResults(value);
},
suffixIcon: Icon(
Icons.search,
color: Colors.black,
),
),
DividerWithSpacesAround(
height: 2,
),
...items.mapIndexed((index, item) {
return AddExaminationWidget(
item: item,
addHistory: widget.addHistory,
removeHistory: widget.removeHistory,
isServiceSelected: widget.isServiceSelected,
isExpand: index == expandedIndex,
expandClick: () {
setState(() {
if (expandedIndex == index) {
expandedIndex = -1;
} else {
expandedIndex = index;
}
});
},
);
}).toList(),
],
);
}
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = List();
dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List();
dummySearchList.forEach((item) {
if (item.nameAr.toLowerCase().contains(query.toLowerCase()) ||
item.nameEn.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
});
}
}
}
class AddExaminationWidget extends StatefulWidget {
MasterKeyModel item;
final Function(MasterKeyModel) removeHistory;
final Function(MySelectedExamination) addHistory;
final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand;
final Function expandClick;
AddExaminationWidget({
this.item,
this.removeHistory,
this.addHistory,
this.isServiceSelected,
this.isExpand,
this.expandClick,
});
@override
_AddExaminationWidgetState createState() => _AddExaminationWidgetState();
}
class _AddExaminationWidgetState extends State<AddExaminationWidget> {
int status = 3;
TextEditingController remarksController = TextEditingController();
MySelectedExamination examination = MySelectedExamination();
@override
void initState() {
examination.selectedExamination = widget.item;
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: CheckboxListTile(
title: AppText(
projectViewModel.isArabic
? widget.item.nameAr != null && widget.item.nameAr != ""
? widget.item.nameAr
: widget.item.nameEn
: widget.item.nameEn,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
),
value: widget.isServiceSelected(widget.item),
activeColor: HexColor("#D02127"),
onChanged: (newValue) {
setState(() {
if (widget.isServiceSelected(widget.item)) {
widget.removeHistory(widget.item);
widget.expandClick();
} else {
examination.isNormal = status == 1;
examination.isAbnormal = status == 2;
examination.notExamined = status == 3;
examination.remark = remarksController.text;
widget.addHistory(examination);
widget.expandClick();
}
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 8),
child: InkWell(
onTap: widget.expandClick,
child: Icon(widget.isExpand
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down)),
),
],
),
bodyWidget: Container(
padding: EdgeInsets.symmetric(horizontal: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(bottom: 8),
child: AppText(
TranslationBase.of(context).status,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
),
),
Row(
children: [
Expanded(
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
status = 1;
});
examination.isNormal = true;
examination.isAbnormal = false;
examination.notExamined = false;
},
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 1
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
),
AppText(
TranslationBase.of(context).normal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
),
],
)),
Expanded(
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
status = 2;
});
examination.isNormal = false;
examination.isAbnormal = true;
examination.notExamined = false;
},
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 2
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
),
AppText(
TranslationBase.of(context).abnormal,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
),
],
)),
Expanded(
child: Row(
children: [
InkWell(
onTap: () {
setState(() {
status = 3;
});
examination.isNormal = false;
examination.isAbnormal = false;
examination.notExamined = true;
},
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 3
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
),
),
),
Expanded(
child: AppText(
TranslationBase.of(context).notExamined,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
),
),
],
)),
],
),
Container(
margin: EdgeInsets.only(top: 8),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
minLines: 2,
maxLines: 4,
inputType: TextInputType.multiline,
onChanged: (value){
examination.remark = value;
},
),
),
],
),
),
isExpand: widget.isExpand,
),
);
}
}
extension FicListExtension<T> on List<T> {
/// Maps each element of the list.
/// The [map] function gets both the original [item] and its [index].
Iterable<E> mapIndexed<E>(E Function(int index, T item) map) sync* {
for (var index = 0; index < length; index++) {
yield map(index, this[index]);
}
}
}

@ -0,0 +1,493 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'examination-item-card.dart';
import 'objective-add-examination-page.dart';
class UpdateObjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final Function changeLoadingState;
final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo;
UpdateObjectivePage(
{Key key,
this.changePageViewIndex,
this.mySelectedExamination,
this.patientInfo,
this.changeLoadingState});
@override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
}
class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
bool isSysExaminationExpand = false;
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: 0.5,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
widget.mySelectedExamination.clear();
GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo);
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
MySelectedExamination tempEam = MySelectedExamination(
selectedExamination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
createdBy: element.createdBy,
notExamined: element.notExamined,
isNew: element.isNew,
isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam);
});
}
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
// baseViewModel: model,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
color: Color.fromRGBO(248, 248, 248, 1),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.95,
child: Container(
margin: EdgeInsets.all(8.0),
padding: EdgeInsets.all(12.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.fromBorderSide(BorderSide(
color: Colors.grey.shade400,
width: 0.4,
)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).physicalSystemExamination}",
fontFamily: 'Poppins',
fontSize:
SizeConfig.textMultiplier * 2.0,
fontWeight: isSysExaminationExpand
? FontWeight.w700
: FontWeight.normal,
),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isSysExaminationExpand =
!isSysExaminationExpand;
});
},
child: Icon(isSysExaminationExpand
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down))
],
),
bodyWidget: Column(
children: [
InkWell(
onTap: () {
openExaminationList(context);
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 8, horizontal: 8.0),
margin:
EdgeInsets.symmetric(vertical: 8),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey.shade400,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(8),
),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).addExamination}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.black,
fontWeight: FontWeight.bold,
),
AppText(
"${TranslationBase.of(context).searchHere}",
fontSize: SizeConfig
.textMultiplier *
1.8,
color: Colors.grey.shade700,
fontWeight: FontWeight.bold,
),
],
)),
Icon(
Icons.add_box_rounded,
size: 25,
)
],
),
),
),
/* ...List.generate(
widget.mySelectedExamination.length,
(index) => Container(
child: ExaminationIitemCard(
widget.mySelectedExamination[
index], () {
removeExamination(widget
.mySelectedExamination[
index]
.selectedExamination);
}),
)),*/
Column(
children: widget.mySelectedExamination
.map((examination) {
return ExaminationIitemCard(
examination, () {
removeExamination(examination
.selectedExamination);
});
}).toList(),
)
],
),
isExpand: isSysExaminationExpand,
),
],
),
),
),
),
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: HexColor("#EAEAEA"),
fontColor: Colors.black,
onPressed: () {
widget.changePageViewIndex(0);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
color: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0
? HexColor("#D02127")
: HexColor("#A5A5A5"),
fontColor: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"),
disabled: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0
? false
: true,
fontWeight: FontWeight.bold,
onPressed: () async {
await submitUpdateObjectivePage(model);
},
),
),
],
),
),
],
)));
}
submitUpdateObjectivePage(SOAPViewModel model) async {
if (widget.mySelectedExamination.isNotEmpty) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
.add(ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
});
if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel);
} else {
await model.patchPhysicalExam(postPhysicalExamRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
} else {
// widget.changeLoadingState(true);
//
// widget.changePageViewIndex(2);
helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
}
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination
.where((element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0)
setState(() {
widget.mySelectedExamination.remove(history.first);
});
}
openExaminationList(BuildContext context) {
Navigator.push(
context,
FadePage(
page: AddExaminationPage(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey)),
),
);
/*showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddExaminationDailog(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey),
);
});*/
}
}
class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog(
{Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key);
@override
_AddExaminationDailogState createState() => _AddExaminationDailogState();
}
class _AddExaminationDailogState extends State<AddExaminationDailog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
/*MasterKeyCheckboxSearchWidget(
model: model,
hintSearchText:
TranslationBase.of(context).searchExamination,
buttonName:
TranslationBase.of(context).addExamination,
masterList: model.physicalExaminationList,
removeHistory: (history) {
setState(() {
widget.removeExamination(history);
});
},
addHistory: (history) {
setState(() {
MySelectedExamination mySelectedExamination =
new MySelectedExamination(
selectedExamination: history);
widget.mySelectedExamination
.add(mySelectedExamination);
});
},
addSelectedHistories: () {
widget.addSelectedExamination();
},
isServiceSelected: (master) =>
isServiceSelected(master),
),*/
]),
))),
)),
);
}
}

@ -9,8 +9,9 @@ import 'package:provider/provider.dart';
class StepsWidget extends StatelessWidget { class StepsWidget extends StatelessWidget {
final int index; final int index;
final Function changeCurrentTab; final Function changeCurrentTab;
final double height;
StepsWidget({Key key, this.index, this.changeCurrentTab}); StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0});
// TODO : Add translation to name // TODO : Add translation to name
@override @override
@ -20,7 +21,7 @@ class StepsWidget extends StatelessWidget {
? Stack( ? Stack(
children: [ children: [
Container( Container(
height: 150, height: height == 0 ? 150 : height,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
@ -57,13 +58,13 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(FontAwesomeIcons.check, size: 20,
FontAwesomeIcons.check, color: Colors.white,)
size: 20, ),
color: Colors.white, ),
)), SizedBox(
height:5
), ),
SizedBox(height: 5),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
@ -72,10 +73,8 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
StatusLabel( StatusLabel(selectedStepId: index, stepId: 0,),
selectedStepId: index,
stepId: 0,
),
], ],
), ),
], ],
@ -84,7 +83,10 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 50, top: 50,
left: MediaQuery.of(context).size.width * 0.28, left: MediaQuery
.of(context)
.size
.width * 0.28,
child: InkWell( child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null, onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -108,14 +110,12 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(FontAwesomeIcons.check, size: 20,
FontAwesomeIcons.check, color: Colors.white,)
size: 20, ),
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height: 5, height:5,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -125,10 +125,9 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
StatusLabel(
selectedStepId: index, StatusLabel(selectedStepId: index, stepId: 1,),
stepId: 1,
),
], ],
), ),
], ],
@ -137,10 +136,14 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 50, top: 50,
left: MediaQuery.of(context).size.width * 0.52, left: MediaQuery
.of(context)
.size
.width * 0.52,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (index >= 3) changeCurrentTab(2); if (index >= 3)
changeCurrentTab(2);
}, },
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -159,18 +162,16 @@ class StepsWidget extends StatelessWidget {
color: index == 2 color: index == 2
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: index > 2 : index > 2
? Color(0xFF359846) ? Color(0xFFCC9B14)
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(FontAwesomeIcons.check, size: 20,
FontAwesomeIcons.check, color: Colors.white,)
size: 20, ),
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height: 5, height:5,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -180,10 +181,7 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
StatusLabel( StatusLabel(selectedStepId: index, stepId: 2,),
selectedStepId: index,
stepId: 2,
),
], ],
), ),
], ],
@ -216,14 +214,12 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(FontAwesomeIcons.check, size: 20,
FontAwesomeIcons.check, color: Colors.white,)
size: 20, ),
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height: 5, height:5,
), ),
Center( Center(
child: Column( child: Column(
@ -235,10 +231,7 @@ class StepsWidget extends StatelessWidget {
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 12, fontSize: 12,
), ),
StatusLabel( StatusLabel(selectedStepId: index, stepId: 3,),
selectedStepId: index,
stepId: 3,
),
], ],
), ),
), ),
@ -251,8 +244,11 @@ class StepsWidget extends StatelessWidget {
: Stack( : Stack(
children: [ children: [
Container( Container(
height: 150, height: height == 0 ? 150 : height,
width: MediaQuery.of(context).size.width, width: MediaQuery
.of(context)
.size
.width,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
child: Divider( child: Divider(
@ -288,13 +284,13 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(FontAwesomeIcons.check, size: 20,
FontAwesomeIcons.check, color: Colors.white,)
size: 20, ),
color: Colors.white, ),
)), SizedBox(
height:5
), ),
SizedBox(height: 5),
AppText( AppText(
"شخصي", "شخصي",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -306,7 +302,10 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 50, top: 50,
right: MediaQuery.of(context).size.width * 0.28, right: MediaQuery
.of(context)
.size
.width * 0.28,
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -330,17 +329,17 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(FontAwesomeIcons.check, size: 20,
FontAwesomeIcons.check, color: Colors.white,)
size: 20, ),
color: Colors.white, ),
)), SizedBox(
height:5
), ),
SizedBox(height: 5),
AppText( AppText(
"هدف", "هدف",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize:14,
), ),
], ],
), ),
@ -348,7 +347,10 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 50, top: 50,
right: MediaQuery.of(context).size.width * 0.52, right: MediaQuery
.of(context)
.size
.width * 0.52,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null, onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column( child: Column(
@ -372,21 +374,20 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(FontAwesomeIcons.check, size: 20,
FontAwesomeIcons.check, color: Colors.white,)
size: 20, ),
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height: 5, height:5,
), ),
Padding( Padding(
padding: const EdgeInsets.only(right: 2), padding: const EdgeInsets.only(right: 2),
child: AppText( child: AppText(
"تقدير", "تقدير",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize:14,
), ),
), ),
], ],
@ -419,21 +420,19 @@ class StepsWidget extends StatelessWidget {
: Color(0xFFCCCCCC), : Color(0xFFCCCCCC),
), ),
child: Center( child: Center(
child: Icon( child: Icon(FontAwesomeIcons.check, size: 20,
FontAwesomeIcons.check, color: Colors.white,)
size: 20, ),
color: Colors.white,
)),
), ),
SizedBox( SizedBox(
height: 5, height:5,
), ),
Container( Container(
margin: EdgeInsets.only(right: index == 3 ? 15 : 0), margin: EdgeInsets.only(right:index == 3? 15:0),
child: AppText( child: AppText(
"خطة", "خطة",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize:14,
), ),
), ),
], ],
@ -447,9 +446,7 @@ class StepsWidget extends StatelessWidget {
class StatusLabel extends StatelessWidget { class StatusLabel extends StatelessWidget {
const StatusLabel({ const StatusLabel({
Key key, Key key, this.stepId, this.selectedStepId,
this.stepId,
this.selectedStepId,
}) : super(key: key); }) : super(key: key);
final int stepId; final int stepId;
@ -461,30 +458,24 @@ class StatusLabel extends StatelessWidget {
width: 65, width: 65,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration( decoration: BoxDecoration(
color: stepId == selectedStepId color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId <
? Color(0xFFF1E9D3) selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC),
: stepId < selectedStepId
? Color(0xFFD8E8DB)
: Color(0xFFCCCCCC),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5.0), Radius.circular(5.0),
), ),
border: Border.all(color: HexColor('#707070'), width: 0.30), border: Border.all(
color: HexColor('#707070'),
width: 0.30),
), ),
child: AppText( child: AppText(
stepId == selectedStepId stepId == selectedStepId ? "inProgress" : stepId < selectedStepId
? "inProgress"
: stepId < selectedStepId
? "Completed" ? "Completed"
: " Locked ", : " Locked ",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 10, fontSize: 10,
color: stepId == selectedStepId color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId <
? Color(0xFFCC9B14) selectedStepId ? Color(0xFF359846) : Color(0xFF969696),
: stepId < selectedStepId
? Color(0xFF359846)
: Color(0xFF969696),
), ),
); );
} }

@ -0,0 +1,93 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class PriorityBar extends StatefulWidget {
final Function onTap;
const PriorityBar({Key key, this.onTap}) : super(key: key);
@override
_PriorityBarState createState() => _PriorityBarState();
}
class _PriorityBarState extends State<PriorityBar> {
int _activePriority = 0;
int index = -1;
List<String> _priorities = [
"Family",
"Surgical/Sports",
"Medical",
];
List<String> _prioritiesAr = [
"أسرة",
"جراحي / رياضي",
"طبي",
];
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration();
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
height: screenSize.height * 0.080,
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((
item,
) {
bool _isActive = _priorities[_activePriority] == item ? true : false;
if (index < 2) {
index++;
}
return Expanded(
child: InkWell(
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
(projectViewModel.isArabic)
? _prioritiesAr[index]
: item,
style: TextStyle(
fontSize: 15,
color: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
),
),
if(_isActive)
Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,)
],
),
),
onTap: () {
widget.onTap(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);
});
}),
);
}).toList(),
),
);
}
}

@ -1,5 +1,4 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -17,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dar
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../custom_validation_error.dart'; import '../custom_validation_error.dart';
@ -41,21 +41,21 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context).addAllergies, hintText: TranslationBase.of(context).addAllergies,
borderColor: HexColor('#707070'),
borderWidth: 0.30,
fontSize: 13.5, fontSize: 13.5,
borderRadius: 12,
onTapTextFields: () { onTapTextFields: () {
openAllergiesList(context); openAllergiesList(context);
}, },
readOnly: true, readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline, suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor, suffixIconColor: Color(0xFF2B353E),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
// controller: messageController, // controller: messageController,
validator: (value) { validator: (value) {
if (value == null) if (value == null)
return TranslationBase return TranslationBase.of(context).emptyMessage;
.of(context)
.emptyMessage;
else else
return null; return null;
}), }),
@ -80,37 +80,60 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
child: Texts( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr ? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn : selectedAllergy.selectedAllergy.nameEn
.toUpperCase(), .toUpperCase(),
variant: "bodyText", // variant: "bodyText",
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy.isChecked
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
bold: true, bold: true,
color: Colors.black), color: Color(0xFF2B353E)),
width: MediaQuery.of(context).size.width * 0.5,
),
Texts( Texts(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy.selectedAllergySeverity.nameAr ? selectedAllergy.selectedAllergySeverity
: selectedAllergy.selectedAllergySeverity.nameEn .nameAr
: selectedAllergy.selectedAllergySeverity
.nameEn
.toUpperCase(), .toUpperCase(),
variant: "bodyText", // variant: "bodyText",
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy.isChecked
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
bold: true, // bold: true,
color: AppGlobal.appPrimaryColor), color: Color(0xFFCC9B14)),
],
),
width: MediaQuery
.of(context)
.size
.width * 0.5,
),
if (selectedAllergy.isChecked) if (selectedAllergy.isChecked)
InkWell( InkWell(
child: Icon( child: Row(
FontAwesomeIcons.trash, children: [Container(
color: Colors.grey, child: Texts(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
color: HexColor("#B8382C"),),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 20, size: 20,
), ),
],
),
onTap: () => removeAllergy(selectedAllergy), onTap: () => removeAllergy(selectedAllergy),
) )
], ],
@ -119,14 +142,6 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: Row( child: Row(
children: [ children: [
AppText(
selectedAllergy.remark != null &&
selectedAllergy.remark != ''
? TranslationBase.of(context).remarks + " : "
: '',
fontWeight: FontWeight.bold,
fontSize: 13,
),
Container( Container(
width: MediaQuery.of(context).size.width * 0.55, width: MediaQuery.of(context).size.width * 0.55,
child: AppText( child: AppText(

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -17,6 +17,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'PriorityBar.dart';
class UpdateHistoryWidget extends StatefulWidget { class UpdateHistoryWidget extends StatefulWidget {
final List<MySelectedHistory> myHistoryList; final List<MySelectedHistory> myHistoryList;
@ -51,20 +53,21 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context).addHistory, hintText: TranslationBase.of(context).addHistory,
borderColor: HexColor('#707070'),
borderWidth: 0.30,
fontSize: 13.5, fontSize: 13.5,
borderRadius: 12,
onTapTextFields: () { onTapTextFields: () {
openHistoryList(context); openHistoryList(context);
}, },
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline, suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor, suffixIconColor: Color(0xFF2B353E),
readOnly: true,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
// controller: messageController, // controller: messageController,
validator: (value) { validator: (value) {
if (value == null) if (value == null)
return TranslationBase.of(context) return TranslationBase.of(context).emptyMessage;
.emptyMessage;
else else
return null; return null;
}), }),
@ -87,20 +90,41 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
projectViewModel.isArabic projectViewModel.isArabic
? myHistory.selectedHistory.nameAr ? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn, : myHistory.selectedHistory.nameEn,
variant: "bodyText", fontSize: 15,
textDecoration: myHistory.isChecked textDecoration: myHistory.isChecked
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
bold: true, // bold: true,
color: Colors.black), color: Colors.black),
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery
.of(context)
.size
.width * 0.5,
), ),
if (myHistory.isChecked) if (myHistory.isChecked)
InkWell( InkWell(
child: Icon( child: Row(
FontAwesomeIcons.trash, children: [
color: Colors.grey, Container(
size: 20, child: Texts(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
// bold: true,
color: HexColor("#B8382C"),),
// width: MediaQuery.of(context).size.width * 0.3,
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 17,
),
],
), ),
onTap: () => removeHistory(myHistory.selectedHistory), onTap: () => removeHistory(myHistory.selectedHistory),
) )
@ -142,10 +166,13 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
openHistoryList(BuildContext context) { openHistoryList(BuildContext context) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
isDismissible: false,
isScrollControlled: true, isScrollControlled: true,
context: context, context: context,
builder: (context) { builder: (context) {
return AddHistoryDialog( return FractionallySizedBox(
heightFactor: 1,
child: AddHistoryDialog(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
controller: _controller, controller: _controller,
myHistoryList: widget.myHistoryList, myHistoryList: widget.myHistoryList,
@ -155,98 +182,13 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
}); });
}, },
removeHistory: (masterKey) => removeHistory(masterKey), removeHistory: (masterKey) => removeHistory(masterKey),
),
); );
}); });
} }
} }
class PriorityBar extends StatefulWidget {
final Function onTap;
const PriorityBar({Key key, this.onTap}) : super(key: key);
@override
_PriorityBarState createState() => _PriorityBarState();
}
class _PriorityBarState extends State<PriorityBar> {
int _activePriority = 0;
int index =-1;
List<String> _priorities = [
"Family",
"Surgical/Sports",
"Medical",
];
List<String> _prioritiesAr = [
"أسرة",
"جراحي / رياضي" ,
"طبي",
];
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,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
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;
if(index <2){
index++;
}
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(
(projectViewModel.isArabic)?_prioritiesAr[index]: item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
)),
),
onTap: () {
widget.onTap(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);
});
}),
);
}).toList(),
),
);
}
}
class AddHistoryDialog extends StatefulWidget { class AddHistoryDialog extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
@ -267,7 +209,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FractionallySizedBox( return FractionallySizedBox(
heightFactor: 0.7, heightFactor: 1,
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.historyFamilyList.length == 0) { if (model.historyFamilyList.length == 0) {
@ -288,10 +230,54 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
isShowAppBar: false, isShowAppBar: false,
body: Center( body: Center(
child: Container( child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column( child: Column(
children: [ children: [
Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
height: 115,
child: Container(
padding: EdgeInsets.only(
left: 10, right: 10),
margin: EdgeInsets.only(top: 40),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize:20,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).addHistory,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 20)),
],
),
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Icon(FontAwesomeIcons.times,
size: 30,
color: Color(0xFF2B353E)))
],
),
],
),
),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -302,6 +288,8 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
height: 20, height: 20,
), ),
Expanded( Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: PageView( child: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: widget.controller, controller: widget.controller,
@ -381,8 +369,8 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
], ],
), ),
), ),
],
), ),
],
)), )),
), ),
), ),

@ -263,6 +263,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
headerTitle: TranslationBase headerTitle: TranslationBase
.of(context) .of(context)
.histories, .histories,
isRequired: false,
onTap: () { onTap: () {
setState(() { setState(() {
isHistoryExpand = !isHistoryExpand; isHistoryExpand = !isHistoryExpand;
@ -285,6 +286,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
.of(context) .of(context)
.allergiesSoap .allergiesSoap
, ,
isRequired: false,
onTap: () { onTap: () {
setState(() { setState(() {
isAllergiesExpand = !isAllergiesExpand; isAllergiesExpand = !isAllergiesExpand;
@ -337,6 +339,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
title: TranslationBase title: TranslationBase
.of(context) .of(context)
.next, .next,
fontWeight: FontWeight.bold,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
addSubjectiveInfo( addSubjectiveInfo(

@ -1,730 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class UpdateObjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final Function changeLoadingState;
final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo;
UpdateObjectivePage(
{Key key,
this.changePageViewIndex,
this.mySelectedExamination,
this.patientInfo,
this.changeLoadingState});
@override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
}
class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
bool isSysExaminationExpand = false;
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: 0.5,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
widget.mySelectedExamination.clear();
GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo);
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
MySelectedExamination tempEam = MySelectedExamination(
selectedExamination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
createdBy: element.createdBy,
notExamined: element.notExamined,
isNew: element.isNew,
isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam);
});
}
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
// baseViewModel: model,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
color: Color.fromRGBO(248, 248, 248, 1),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.95,
child: Container(
margin: EdgeInsets.all(8.0),
padding: EdgeInsets.all(12.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.fromBorderSide(BorderSide(
color: Colors.grey.shade400,
width: 0.4,
)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).physicalSystemExamination}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
fontWeight: isSysExaminationExpand ? FontWeight.w700 : FontWeight.normal,
),
/*Texts(
TranslationBase.of(context)
.physicalSystemExamination,
variant: isSysExaminationExpand
? "bodyText"
: '',
bold: isSysExaminationExpand
? true
: false,
color: Colors.black),*/
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isSysExaminationExpand =
!isSysExaminationExpand;
});
},
child: Icon(isSysExaminationExpand
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
Container(
margin: EdgeInsets.only(
left: 10, right: 10, top: 15),
child: TextFields(
hintText: TranslationBase.of(context)
.physicalSystemExamination,
fontSize: 13.5,
onTapTextFields: () {
openExaminationList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon:
EvaIcons.plusCircleOutline,
suffixIconColor:
AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Column(
children: widget.mySelectedExamination
.map((examination) {
TextEditingController
remarksController =
TextEditingController(
text: examination.remark);
return Container(
margin: EdgeInsets.only(
left: 15, right: 15, top: 15),
child: Column(children: [
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Texts(
(examination
.selectedExamination
.nameEn)
.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Row(
children: [
InkWell(
child: Center(
child: Container(
height: screenSize
.height *
0.070,
decoration: containerBorderDecoration(
examination
.isNormal
? Color(
0xFF515A5D)
: Colors
.white,
Colors
.grey),
child: Center(
child:
Padding(
padding:
const EdgeInsets.all(
8.0),
child: Text(
TranslationBase.of(
context)
.normal,
style:
TextStyle(
fontSize:
12,
color: examination.isNormal
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isAbnormal =
false;
examination
.isNormal =
true;
examination
.notExamined =
false;
});
}),
SizedBox(
width: 12,
),
InkWell(
child: Center(
child: Container(
height: screenSize
.height *
0.070,
decoration: containerBorderDecoration(
examination
.isAbnormal
? Color(
0xFF515A5D)
: Colors
.white,
Colors
.black),
child: Center(
child:
Padding(
padding:
const EdgeInsets.all(
8.0),
child: Text(
TranslationBase.of(
context)
.abnormal,
style:
TextStyle(
fontSize:
12,
color: examination.isAbnormal
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isNormal =
false;
examination
.isAbnormal =
true;
examination
.notExamined =
false;
});
}),
SizedBox(
width: 12,
),
InkWell(
child: Center(
child: Container(
height: screenSize
.height *
0.070,
decoration: containerBorderDecoration(
examination
.notExamined
? Color(
0xFF515A5D)
: Colors
.white,
Colors
.black),
child: Center(
child:
Padding(
padding:
const EdgeInsets.all(
8.0),
child: Text(
"Not Examined",
style:
TextStyle(
fontSize:
12,
color: examination.notExamined
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isAbnormal =
false;
examination
.isNormal =
false;
examination
.notExamined =
true;
});
}),
],
),
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
),
onTap: () => removeExamination(
examination
.selectedExamination),
)
],
),
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText:
remarksController
.text !=
''
? true
: false,
showLabelText: true,
hintText:
TranslationBase.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 4,
controller:
remarksController,
onChanged: (val) {
examination.remark = val;
},
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
]));
}).toList(),
)
],
)
]),
isExpand: isSysExaminationExpand,
),
],
),
),
),
),
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: HexColor("#EAEAEA"),
fontColor: Colors.black,
onPressed: () {
widget.changePageViewIndex(0);
},
),
),
SizedBox(
width: 10,
),
Expanded(
child: AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
color: HexColor("#A5A5A5"),
fontColor: HexColor("#5A5A5A"),
fontWeight: FontWeight.bold,
onPressed: () async {
await submitUpdateObjectivePage(model);
},
),
),
],
),
),
],
)));
}
submitUpdateObjectivePage(SOAPViewModel model) async {
if (widget.mySelectedExamination.isNotEmpty) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
.add(ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
});
if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel);
} else {
await model.patchPhysicalExam(postPhysicalExamRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
} else {
// widget.changeLoadingState(true);
//
// widget.changePageViewIndex(2);
helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
}
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination
.where((element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0)
setState(() {
widget.mySelectedExamination.remove(history.first);
});
}
openExaminationList(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
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,
),
);
}
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddExaminationDailog(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey),
);
});
}
}
class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog(
{Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key);
@override
_AddExaminationDailogState createState() => _AddExaminationDailogState();
}
class _AddExaminationDailogState extends State<AddExaminationDailog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
MasterKeyCheckboxSearchWidget(
model: model,
hintSearchText:
TranslationBase.of(context).searchExamination,
buttonName:
TranslationBase.of(context).addExamination,
masterList: model.physicalExaminationList,
removeHistory: (history) {
setState(() {
widget.removeExamination(history);
});
},
addHistory: (history) {
setState(() {
MySelectedExamination mySelectedExamination =
new MySelectedExamination(
selectedExamination: history);
widget.mySelectedExamination
.add(mySelectedExamination);
});
},
addSelectedHistories: () {
widget.addSelectedExamination();
},
isServiceSelected: (master) =>
isServiceSelected(master),
),
]),
))),
)),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) {
return true;
}
return false;
}
}

@ -9,13 +9,13 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_objective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../patient-profile-header-new-design.dart'; import '../patient-profile-header-new-design.dart';
import 'objective/update_objective_page.dart';
class UpdateSoapIndex extends StatefulWidget { class UpdateSoapIndex extends StatefulWidget {
final bool isUpdate; final bool isUpdate;
@ -35,7 +35,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
List<MySelectedExamination> mySelectedExamination = List(); List<MySelectedExamination> mySelectedExamination = List();
List<MySelectedAssessment> mySelectedAssessment = List(); List<MySelectedAssessment> mySelectedAssessment = List();
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex) { changePageViewIndex(pageIndex) {
if (pageIndex != _currentIndex) changeLoadingState(true); if (pageIndex != _currentIndex) changeLoadingState(true);
_controller.jumpToPage(pageIndex); _controller.jumpToPage(pageIndex);
@ -67,8 +69,8 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
isLoading: _isLoading, isLoading: _isLoading,
isShowAppBar: false, isShowAppBar: false,
// appBarTitle: TranslationBase.of(context).healthRecordInformation, // appBarTitle: TranslationBase.of(context).healthRecordInformation,
body: SingleChildScrollView( // TODO mousa removed the singleChildScrollView
child: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
@ -79,33 +81,27 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// PatientPageHeaderWidget(patient), // PatientPageHeaderWidget(patient),
PatientProfileHeaderNewDesign(patient, '7', '7'), PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,),
Container( Container(
width: double.infinity, width: double.infinity,
height: 1, height: 1,
color: Color(0xffCCCCCC), color: Color(0xffCCCCCC),
), ),
FractionallySizedBox(
child: SingleChildScrollView(
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.75,
child: Column(
children: [
Container( Container(
color: Theme.of(context).scaffoldBackgroundColor,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * left: MediaQuery.of(context).size.width * 0.05,
0.05, right: MediaQuery.of(context).size.width * 0.05),
right: MediaQuery.of(context).size.width *
0.05),
child: StepsWidget( child: StepsWidget(
index: _currentIndex, index: _currentIndex,
changeCurrentTab: changePageViewIndex, changeCurrentTab: changePageViewIndex,
height: MediaQuery.of(context).size.height * 0.21,
), ),
), ),
Expanded( Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.50,
child: PageView( child: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: _controller, controller: _controller,
onPageChanged: (index) { onPageChanged: (index) {
@ -120,37 +116,24 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
myAllergiesList: myAllergiesList, myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList, myHistoryList: myHistoryList,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState changeLoadingState: changeLoadingState),
),
UpdateObjectivePage( UpdateObjectivePage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
mySelectedExamination: mySelectedExamination: mySelectedExamination,
mySelectedExamination,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState changeLoadingState: changeLoadingState),
),
UpdateAssessmentPage( UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
mySelectedAssessmentList: mySelectedAssessmentList: mySelectedAssessment,
mySelectedAssessment,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState changeLoadingState: changeLoadingState),
),
UpdatePlanPage( UpdatePlanPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
patientInfo: patient, patientInfo: patient,
patientProgressNote: patientProgressNote, patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState changeLoadingState: changeLoadingState)
)
],
),
),
], ],
), ),
),
),
) )
], ],
), ),
@ -158,7 +141,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
], ],
), ),
), ),
),
); );
} }
} }

@ -9,6 +9,7 @@ class AppTextFieldCustom extends StatefulWidget {
final String hintText; final String hintText;
final TextEditingController controller; final TextEditingController controller;
final bool isDropDown; final bool isDropDown;
final bool hasBorder;
final String dropDownText; final String dropDownText;
final Icon suffixIcon; final Icon suffixIcon;
final Color dropDownColor; final Color dropDownColor;
@ -17,12 +18,14 @@ class AppTextFieldCustom extends StatefulWidget {
final int minLines; final int minLines;
final int maxLines; final int maxLines;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter> inputFormatters;
final Function(String) onChanged;
AppTextFieldCustom({ AppTextFieldCustom({
this.height = 0, this.height = 0,
this.onClick, this.onClick,
this.hintText, this.hintText,
this.controller, this.controller,
this.hasBorder = true,
this.isDropDown = false, this.isDropDown = false,
this.dropDownText, this.dropDownText,
this.suffixIcon, this.suffixIcon,
@ -32,6 +35,7 @@ class AppTextFieldCustom extends StatefulWidget {
this.minLines = 1, this.minLines = 1,
this.maxLines = 1, this.maxLines = 1,
this.inputFormatters, this.inputFormatters,
this.onChanged,
}); });
@override @override
@ -43,8 +47,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
height: widget.height != 0 ? widget.height : null, height: widget.height != 0 ? widget.height : null,
decoration: decoration: widget.hasBorder
containerBorderDecoration(Color(0Xffffffff), Color(0xFFEFEFEF)), ? containerBorderDecoration(Color(0Xffffffff), Color(0xFFEFEFEF))
: null,
padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0),
child: InkWell( child: InkWell(
onTap: widget.onClick ?? null, onTap: widget.onClick ?? null,
@ -80,7 +85,17 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
enabled: widget.enabled, enabled: widget.enabled,
minLines: widget.minLines, minLines: widget.minLines,
maxLines: widget.maxLines, maxLines: widget.maxLines,
inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [], inputFormatters: widget.inputFormatters != null
? widget.inputFormatters
: [],
onChanged: (value) {
if (widget.onChanged != null){
widget.onChanged(value);
setState(() {
});
}
},
) )
: AppText( : AppText(
widget.dropDownText, widget.dropDownText,

@ -75,7 +75,7 @@ class _AppButtonState extends State<AppButton> {
), ),
) )
: AppText( : AppText(
widget.title.toUpperCase(), widget.title,
color: widget.fontColor, color: widget.fontColor,
fontSize: SizeConfig.textMultiplier * widget.fontSize, fontSize: SizeConfig.textMultiplier * widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,

@ -13,6 +13,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'app_texts_widget.dart';
class MasterKeyCheckboxSearchWidget extends StatefulWidget { class MasterKeyCheckboxSearchWidget extends StatefulWidget {
final SOAPViewModel model; final SOAPViewModel model;
final Function addSelectedHistories; final Function addSelectedHistories;
@ -49,15 +51,14 @@ class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchW
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
child: Column( child: Column(
children: [ children: [
Container( Expanded(
height: MediaQuery.of(context).size.height * 0.5, child: Container(
height: MediaQuery.of(context).size.height * 0.62,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
@ -67,17 +68,36 @@ class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchW
hintText: widget.hintSearchText ?? TranslationBase hintText: widget.hintSearchText ?? TranslationBase
.of(context) .of(context)
.searchHistory, .searchHistory,
borderWidth: 0.0,
padding: EdgeInsets.all(20),
borderRadius: 0,
suffixIcon: EvaIcons.search, suffixIcon: EvaIcons.search,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); filterSearchResults(value);
}, },
), ),
SizedBox(height: 15,), // SizedBox(height: 15,),
Column( DividerWithSpacesAround(),
Container(
// padding:EdgeInsets.all(20),
child: Column(
children: items.map((historyInfo) { children: items.map((historyInfo) {
return Column( return Column(
children: [ children: [
Row( InkWell(
onTap:(){
setState(() {
if (widget
.isServiceSelected(historyInfo)) {
widget.removeHistory(historyInfo);
} else {
widget.addHistory(historyInfo);
}
});
},
child: Row(
children: [ children: [
Checkbox( Checkbox(
value: value:
@ -97,32 +117,37 @@ class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchW
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0), horizontal: 10, vertical: 0),
child: Texts(projectViewModel.isArabic child: AppText(projectViewModel.isArabic
? historyInfo.nameAr!=""?historyInfo.nameAr:historyInfo.nameEn ? historyInfo.nameAr!=""?historyInfo.nameAr:historyInfo.nameEn
: historyInfo.nameEn, : historyInfo.nameEn,
variant: "bodyText", color: Color(0xFF575757),
bold: true, fontSize: 16,
color: Colors.black), fontWeight:FontWeight.w600,
),
), ),
), ),
], ],
), ),
DividerWithSpacesAround(), ),
// DividerWithSpacesAround(),
], ],
); );
}).toList(), }).toList(),
), ),
),
], ],
), ),
)), )),
), ),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
if (widget.model.state == ViewState.Idle) if (widget.model.state == ViewState.Idle)
AppButton( AppButton(
title: widget.buttonName?? TranslationBase.of(context).addSelectedHistories.toUpperCase(), title: widget.buttonName?? TranslationBase.of(context).addSelectedHistories,
padding: 10, padding: 10,
color: Color(0xFF359846),
onPressed: () { onPressed: () {
widget.addSelectedHistories(); widget.addSelectedHistories();
}, },

Loading…
Cancel
Save