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';
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************

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

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

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

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

@ -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/borderedButton.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';

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

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

@ -35,69 +35,72 @@ class AddSickLeavScreen extends StatelessWidget {
child: Column(children: [
PatientProfileHeaderNewDesign(
patient, routeArgs['patientType'], routeArgs['arrivalType']),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
fontWeight: FontWeight.bold,
),
AppText(
TranslationBase.of(context).sickLeave,
fontSize: 24,
fontWeight: FontWeight.bold,
),
],
)),
Container(
width: SizeConfig.screenWidth,
margin: EdgeInsets.only(
left: 20, right: 20, top: 10, bottom: 10),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
child: Container(
patient.patientStatusType == 43
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
fontWeight: FontWeight.bold,
),
AppText(
TranslationBase.of(context).sickLeave,
fontSize: 24,
fontWeight: FontWeight.bold,
),
],
)),
Container(
width: SizeConfig.screenWidth,
margin: EdgeInsets.only(
left: 20, right: 20, top: 10, bottom: 10),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
color: Colors.white,
borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
child: Container(
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
color: Colors.white,
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
)),
Padding(
child: AppText(
TranslationBase.of(context)
.noSickLeaveApplied,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 16,
textAlign: TextAlign.center,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
)),
Padding(
child: AppText(
TranslationBase.of(context).noSickLeaveApplied,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 16,
textAlign: TextAlign.center,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
],
)),
],
),
],
)),
],
)
: SizedBox(),
model.getAllSIckLeave.length > 0
? Column(
children: model.getAllSIckLeave

@ -1205,6 +1205,8 @@ class TranslationBase {
String get unReplied => localizedValues['unReplied'][locale.languageCode];
String get replied => localizedValues['replied'][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> {

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

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

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

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

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

@ -43,34 +43,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
childAspectRatio: 1 / 1.0,
crossAxisCount: 3,
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)
PatientProfileButton(
key: key,
@ -89,60 +61,38 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
if (selectedPatientType != 0 &&
selectedPatientType != 5 &&
selectedPatientType != 7)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ADMISSION_REQUEST,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
// (int.parse(patientType) == 7 || int.parse(patientType) == 6)
// ? PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: ORDER_PRESCRIPTION,
// nameLine1: TranslationBase.of(context).orders,
// nameLine2: TranslationBase.of(context).prescription,
// 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'),
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.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(
key: key,
patient: patient,
@ -168,10 +118,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR,
nameLine1: TranslationBase.of(context).myReferral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
@ -189,6 +139,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_UCAF_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'),
@ -198,29 +149,32 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
route: REFER_PATIENT_TO_DOCTOR,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).myReferral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
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'),
route: PATIENT_ADMISSION_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
if (patientType == "1")
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
],
),
);

@ -39,19 +39,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
@ -66,19 +68,19 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// route: PATIENT_ADMISSION_REQUEST,
// nameLine1: TranslationBase.of(context).admission,
// nameLine2: TranslationBase.of(context).request,
// icon: 'heartbeat.png'),
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.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'),
(int.parse(patientType) == 7 || int.parse(patientType) == 6)
? PatientProfileButton(
key: key,
@ -103,19 +105,10 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.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'),
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
key: key,
patient: patient,
@ -125,15 +118,23 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.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(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
],
),
);

@ -11,9 +11,10 @@ class ExpandableSOAPWidget extends StatelessWidget {
final Widget child;
final Function onTap;
final headerTitle;
final bool isRequired;
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);
@override
@ -37,9 +38,10 @@ class ExpandableSOAPWidget extends StatelessWidget {
children: [
Texts(headerTitle,
variant: isExpanded ? "bodyText" : '',
bold: isExpanded ? true : false,
// bold: isExpanded ? true : false,
fontSize: 15,
color: Colors.black),
if(isRequired)
Icon(
FontAwesomeIcons.asterisk,
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 {
final int index;
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
@override
@ -20,7 +21,7 @@ class StepsWidget extends StatelessWidget {
? Stack(
children: [
Container(
height: 150,
height: height == 0 ? 150 : height,
width: MediaQuery.of(context).size.width,
color: Colors.transparent,
child: Center(
@ -46,24 +47,24 @@ class StepsWidget extends StatelessWidget {
border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
? null
: Border.all(
color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
: index > 0
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height:5
),
SizedBox(height: 5),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
@ -72,10 +73,8 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 12,
),
StatusLabel(
selectedStepId: index,
stepId: 0,
),
StatusLabel(selectedStepId: index, stepId: 0,),
],
),
],
@ -84,7 +83,10 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 50,
left: MediaQuery.of(context).size.width * 0.28,
left: MediaQuery
.of(context)
.size
.width * 0.28,
child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column(
@ -97,25 +99,23 @@ class StepsWidget extends StatelessWidget {
border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
: index > 1
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height: 5,
height:5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -125,10 +125,9 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 12,
),
StatusLabel(
selectedStepId: index,
stepId: 1,
),
StatusLabel(selectedStepId: index, stepId: 1,),
],
),
],
@ -137,10 +136,14 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 50,
left: MediaQuery.of(context).size.width * 0.52,
left: MediaQuery
.of(context)
.size
.width * 0.52,
child: InkWell(
onTap: () {
if (index >= 3) changeCurrentTab(2);
if (index >= 3)
changeCurrentTab(2);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -152,25 +155,23 @@ class StepsWidget extends StatelessWidget {
border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
: index > 2
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height: 5,
height:5,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -180,10 +181,7 @@ class StepsWidget extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 12,
),
StatusLabel(
selectedStepId: index,
stepId: 2,
),
StatusLabel(selectedStepId: index, stepId: 2,),
],
),
],
@ -205,43 +203,38 @@ class StepsWidget extends StatelessWidget {
border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)
: index > 3
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height: 5,
),
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
"Plan",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: 12,
),
StatusLabel(
selectedStepId: index,
stepId: 3,
),
],
),
height:5,
),
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
"Plan",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: 12,
),
StatusLabel(selectedStepId: index, stepId: 3,),
],
),
),
],
),
),
@ -251,8 +244,11 @@ class StepsWidget extends StatelessWidget {
: Stack(
children: [
Container(
height: 150,
width: MediaQuery.of(context).size.width,
height: height == 0 ? 150 : height,
width: MediaQuery
.of(context)
.size
.width,
color: Colors.transparent,
child: Center(
child: Divider(
@ -277,24 +273,24 @@ class StepsWidget extends StatelessWidget {
border: index == 0
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 0
? null
: Border.all(
color: Colors.black, width: 0.75),
? null
: Border.all(
color: Colors.black, width: 0.75),
shape: BoxShape.circle,
color: index == 0
? Color(0xFFCC9B14)
: index > 0
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height:5
),
SizedBox(height: 5),
AppText(
"شخصي",
fontWeight: FontWeight.bold,
@ -306,7 +302,10 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 50,
right: MediaQuery.of(context).size.width * 0.28,
right: MediaQuery
.of(context)
.size
.width * 0.28,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column(
@ -319,28 +318,28 @@ class StepsWidget extends StatelessWidget {
border: index == 1
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 1
? Color(0xFFCC9B14)
: index > 1
? Color(0xFF359846)
: Color(0xFFCCCCCC),
? Color(0xFF359846)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height:5
),
SizedBox(height: 5),
AppText(
"هدف",
fontWeight: FontWeight.bold,
fontSize: 14,
fontSize:14,
),
],
),
@ -348,7 +347,10 @@ class StepsWidget extends StatelessWidget {
),
Positioned(
top: 50,
right: MediaQuery.of(context).size.width * 0.52,
right: MediaQuery
.of(context)
.size
.width * 0.52,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column(
@ -361,33 +363,32 @@ class StepsWidget extends StatelessWidget {
border: index == 2
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 2
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 2
? Color(0xFFCC9B14)
: index > 2
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height: 5,
height:5,
),
Padding(
padding: const EdgeInsets.only(right: 2),
child: AppText(
"تقدير",
fontWeight: FontWeight.bold,
fontSize: 14,
),
"تقدير",
fontWeight: FontWeight.bold,
fontSize:14,
),
),
],
),
@ -408,48 +409,44 @@ class StepsWidget extends StatelessWidget {
border: index == 3
? Border.all(color: Color(0xFFCC9B14), width: 2)
: index > 3
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
? null
: Border.all(
color: Color(0xFFCCCCCC), width: 0.75),
shape: BoxShape.circle,
color: index == 3
? Color(0xFFCC9B14)
: index > 3
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
? Color(0xFFCC9B14)
: Color(0xFFCCCCCC),
),
child: Center(
child: Icon(
FontAwesomeIcons.check,
size: 20,
color: Colors.white,
)),
child: Icon(FontAwesomeIcons.check, size: 20,
color: Colors.white,)
),
),
SizedBox(
height: 5,
height:5,
),
Container(
margin: EdgeInsets.only(right: index == 3 ? 15 : 0),
child: AppText(
Container(
margin: EdgeInsets.only(right:index == 3? 15:0),
child: AppText(
"خطة",
fontWeight: FontWeight.bold,
fontSize: 14,
),
),
fontSize:14,
),
),
],
),
),
),
],
);
);
}
}
class StatusLabel extends StatelessWidget {
const StatusLabel({
Key key,
this.stepId,
this.selectedStepId,
Key key, this.stepId, this.selectedStepId,
}) : super(key: key);
final int stepId;
@ -461,30 +458,24 @@ class StatusLabel extends StatelessWidget {
width: 65,
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
decoration: BoxDecoration(
color: stepId == selectedStepId
? Color(0xFFF1E9D3)
: stepId < selectedStepId
? Color(0xFFD8E8DB)
: Color(0xFFCCCCCC),
color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId <
selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC),
borderRadius: BorderRadius.all(
Radius.circular(5.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
border: Border.all(
color: HexColor('#707070'),
width: 0.30),
),
child: AppText(
stepId == selectedStepId
? "inProgress"
: stepId < selectedStepId
? "Completed"
: " Locked ",
stepId == selectedStepId ? "inProgress" : stepId < selectedStepId
? "Completed"
: " Locked ",
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
fontSize: 10,
color: stepId == selectedStepId
? Color(0xFFCC9B14)
: stepId < selectedStepId
? Color(0xFF359846)
: Color(0xFF969696),
color: stepId == selectedStepId ? Color(0xFFCC9B14) : 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:doctor_app_flutter/config/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';
@ -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:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../custom_validation_error.dart';
@ -41,21 +41,21 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: TranslationBase.of(context).addAllergies,
borderColor: HexColor('#707070'),
borderWidth: 0.30,
fontSize: 13.5,
borderRadius: 12,
onTapTextFields: () {
openAllergiesList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
suffixIconColor: Color(0xFF2B353E),
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
return TranslationBase.of(context).emptyMessage;
else
return null;
}),
@ -80,36 +80,59 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
.toUpperCase(),
variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Colors.black),
width: MediaQuery.of(context).size.width * 0.5,
// variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Color(0xFF2B353E)),
Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergySeverity
.nameAr
: selectedAllergy.selectedAllergySeverity
.nameEn
.toUpperCase(),
// variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
// bold: true,
color: Color(0xFFCC9B14)),
],
),
width: MediaQuery
.of(context)
.size
.width * 0.5,
),
Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergySeverity.nameAr
: selectedAllergy.selectedAllergySeverity.nameEn
.toUpperCase(),
variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: AppGlobal.appPrimaryColor),
if (selectedAllergy.isChecked)
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
child: Row(
children: [Container(
child: Texts(
TranslationBase
.of(context)
.remove,
fontSize: 15,
variant: "bodyText",
color: HexColor("#B8382C"),),
),
Icon(
FontAwesomeIcons.times,
color: HexColor("#B8382C"),
size: 20,
),
],
),
onTap: () => removeAllergy(selectedAllergy),
)
@ -119,14 +142,6 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
children: [
AppText(
selectedAllergy.remark != null &&
selectedAllergy.remark != ''
? TranslationBase.of(context).remarks + " : "
: '',
fontWeight: FontWeight.bold,
fontSize: 13,
),
Container(
width: MediaQuery.of(context).size.width * 0.55,
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/viewModel/SOAP_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:provider/provider.dart';
import 'PriorityBar.dart';
class UpdateHistoryWidget extends StatefulWidget {
final List<MySelectedHistory> myHistoryList;
@ -51,20 +53,21 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: TranslationBase.of(context).addHistory,
borderColor: HexColor('#707070'),
borderWidth: 0.30,
fontSize: 13.5,
borderRadius: 12,
onTapTextFields: () {
openHistoryList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
suffixIconColor: Color(0xFF2B353E),
readOnly: true,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
return TranslationBase.of(context).emptyMessage;
else
return null;
}),
@ -87,20 +90,41 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
variant: "bodyText",
fontSize: 15,
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
// bold: true,
color: Colors.black),
width: MediaQuery.of(context).size.width * 0.7,
width: MediaQuery
.of(context)
.size
.width * 0.5,
),
if (myHistory.isChecked)
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
child: Row(
children: [
Container(
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),
)
@ -142,111 +166,29 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
openHistoryList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isDismissible: false,
isScrollControlled: true,
context: context,
builder: (context) {
return AddHistoryDialog(
changePageViewIndex: changePageViewIndex,
controller: _controller,
myHistoryList: widget.myHistoryList,
addSelectedHistories: () {
setState(() {
Navigator.of(context).pop();
});
},
removeHistory: (masterKey) => removeHistory(masterKey),
return FractionallySizedBox(
heightFactor: 1,
child: AddHistoryDialog(
changePageViewIndex: changePageViewIndex,
controller: _controller,
myHistoryList: widget.myHistoryList,
addSelectedHistories: () {
setState(() {
Navigator.of(context).pop();
});
},
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 {
final Function changePageViewIndex;
@ -267,7 +209,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.7,
heightFactor: 1,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.historyFamilyList.length == 0) {
@ -288,20 +230,66 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
SizedBox(
height: 10,
child: Column(
children: [
Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
}),
SizedBox(
height: 20,
),
Expanded(
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(
height: 10,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
}),
SizedBox(
height: 20,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: widget.controller,
@ -381,9 +369,9 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
],
),
),
),
],
),
)),
)),
),
),
));

@ -263,6 +263,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
headerTitle: TranslationBase
.of(context)
.histories,
isRequired: false,
onTap: () {
setState(() {
isHistoryExpand = !isHistoryExpand;
@ -285,6 +286,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
.of(context)
.allergiesSoap
,
isRequired: false,
onTap: () {
setState(() {
isAllergiesExpand = !isAllergiesExpand;
@ -337,6 +339,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
title: TranslationBase
.of(context)
.next,
fontWeight: FontWeight.bold,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
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/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_objective_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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../patient-profile-header-new-design.dart';
import 'objective/update_objective_page.dart';
class UpdateSoapIndex extends StatefulWidget {
final bool isUpdate;
@ -35,7 +35,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
List<MySelectedExamination> mySelectedExamination = List();
List<MySelectedAssessment> mySelectedAssessment = List();
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel();
GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex) {
if (pageIndex != _currentIndex) changeLoadingState(true);
_controller.jumpToPage(pageIndex);
@ -67,96 +69,76 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
isLoading: _isLoading,
isShowAppBar: false,
// appBarTitle: TranslationBase.of(context).healthRecordInformation,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
boxShadow: <BoxShadow>[],
color: Theme.of(context).scaffoldBackgroundColor),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
// PatientPageHeaderWidget(patient),
PatientProfileHeaderNewDesign(patient, '7', '7'),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
// TODO mousa removed the singleChildScrollView
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
boxShadow: <BoxShadow>[],
color: Theme.of(context).scaffoldBackgroundColor),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
// PatientPageHeaderWidget(patient),
PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
Container(
color: Theme.of(context).scaffoldBackgroundColor,
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
height: MediaQuery.of(context).size.height * 0.21,
),
FractionallySizedBox(
child: SingleChildScrollView(
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.75,
child: Column(
children: [
Container(
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width *
0.05,
right: MediaQuery.of(context).size.width *
0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
),
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient,
changeLoadingState: changeLoadingState
),
UpdateObjectivePage(
changePageViewIndex: changePageViewIndex,
mySelectedExamination:
mySelectedExamination,
patientInfo: patient,
changeLoadingState: changeLoadingState
),
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex,
mySelectedAssessmentList:
mySelectedAssessment,
patientInfo: patient,
changeLoadingState: changeLoadingState
),
UpdatePlanPage(
changePageViewIndex: changePageViewIndex,
patientInfo: patient,
patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState
)
],
),
),
],
),
),
),
)
],
),
),
Container(
color: Theme.of(context).scaffoldBackgroundColor,
height: MediaQuery.of(context).size.height * 0.50,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateObjectivePage(
changePageViewIndex: changePageViewIndex,
mySelectedExamination: mySelectedExamination,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex,
mySelectedAssessmentList: mySelectedAssessment,
patientInfo: patient,
changeLoadingState: changeLoadingState),
UpdatePlanPage(
changePageViewIndex: changePageViewIndex,
patientInfo: patient,
patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState)
],
),
)
],
),
],
),
),
],
),
),
);

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

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

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

Loading…
Cancel
Save