Merge branch 'medical_report_changes' into 'development'

adding google anlyatic to doctor app

See merge request Cloud_Solution/doctor_app_flutter!777
merge-requests/775/merge
Mohammad Aljammal 5 years ago
commit 36f34226bd

@ -1,22 +1,16 @@
import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart'; import 'package:firebase_analytics/observer.dart';
import 'package:flutter/cupertino.dart';
class AnalyticsService { class AnalyticsService {
final FirebaseAnalytics _analytics = FirebaseAnalytics(); final FirebaseAnalytics _analytics = FirebaseAnalytics();
FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics);
FirebaseAnalyticsObserver(analytics: _analytics);
Future logEvent( Future logEvent({@required String eventCategory, @required String eventAction}) async {
{String eventCategory,
String eventLabel,
String eventAction,
String eventValue}) async {
await _analytics.logEvent(name: 'event', parameters: { await _analytics.logEvent(name: 'event', parameters: {
"eventCategory": eventCategory, "eventCategory": eventCategory,
"eventLabel": eventLabel,
"eventAction": eventAction, "eventAction": eventAction,
"eventValue": eventValue
}); });
} }
} }

@ -35,8 +35,7 @@ class MyApp extends StatelessWidget {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
return MultiProvider( return MultiProvider(
providers: [ providers: [
ChangeNotifierProvider<AuthenticationViewModel>( ChangeNotifierProvider<AuthenticationViewModel>(create: (context) => AuthenticationViewModel()),
create: (context) => AuthenticationViewModel()),
ChangeNotifierProvider<ProjectViewModel>( ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(), create: (context) => ProjectViewModel(),
), ),
@ -71,7 +70,7 @@ class MyApp extends StatelessWidget {
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
), ),
navigatorKey: locator<NavigationService>().navigatorKey, navigatorKey: locator<NavigationService>().navigatorKey,
navigatorObservers:[ navigatorObservers: [
locator<AnalyticsService>().getAnalyticsObserver(), locator<AnalyticsService>().getAnalyticsObserver(),
], ],
initialRoute: INIT_ROUTE, initialRoute: INIT_ROUTE,

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart';
@ -27,9 +29,7 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<MedicalFileViewModel>( return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId),
builder: builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold(
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
isInpatient: isInpatient, isInpatient: isInpatient,
@ -43,8 +43,7 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
child: Container( child: Container(
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@ -74,113 +73,68 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
), ),
), ),
), ),
(model.medicalFileList != null && (model.medicalFileList != null && model.medicalFileList.length != 0)
model.medicalFileList.length != 0)
? ListView.builder( ? ListView.builder(
//physics: , //physics: ,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0] itemCount: model.medicalFileList[0].entityList[0].timelines.length,
.timelines.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return InkWell( return InkWell(
onTap: () { onTap: () async {
if (model if (model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
.medicalFileList[0] .consulations.length !=
.entityList[0]
.timelines[index]
.timeLineEvents[0]
.consulations
.length !=
0) 0)
Navigator.push( await locator<AnalyticsService>().logEvent(
context, eventCategory: "Health Summary Page",
MaterialPageRoute( eventAction: "Health Summary Details",
builder: (context) => MedicalFileDetails(
age: patient.age is String
? patient.age ?? ""
: "${patient.age}",
firstName: patient.firstName,
lastName: patient.lastName,
gender: patient.genderDescription,
encounterNumber: index,
pp: patient.patientId,
patient: patient,
doctorName: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.timeLineEvents[0]
.consulations
.isNotEmpty
? model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName
: "",
clinicName: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.timeLineEvents[0]
.consulations
.isNotEmpty
? model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.clinicName
: "",
doctorImage: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.timeLineEvents[0]
.consulations
.isNotEmpty
? model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorImage
: "",
episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString()
: "",
vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString()),
settings: RouteSettings(name: 'MedicalFileDetails'),),
); );
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MedicalFileDetails(
age: patient.age is String ? patient.age ?? "" : "${patient.age}",
firstName: patient.firstName,
lastName: patient.lastName,
gender: patient.genderDescription,
encounterNumber: index,
pp: patient.patientId,
patient: patient,
doctorName: model.medicalFileList[0].entityList[0].timelines[index]
.timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].doctorName
: "",
clinicName: model.medicalFileList[0].entityList[0].timelines[index]
.timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].clinicName
: "",
doctorImage: model.medicalFileList[0].entityList[0].timelines[index]
.timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].doctorImage
: "",
episode: model.medicalFileList[0].entityList[0].timelines[index]
.timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
.consulations[0].episodeID
.toString()
: "",
vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString()),
settings: RouteSettings(name: 'MedicalFileDetails'),
),
);
}, },
child: DoctorCard( child: DoctorCard(
doctorName: model doctorName: model.medicalFileList[0].entityList[0].timelines[index].doctorName,
.medicalFileList[0] clinic: model.medicalFileList[0].entityList[0].timelines[index].clinicName,
.entityList[0] branch: model.medicalFileList[0].entityList[0].timelines[index].projectName,
.timelines[index] profileUrl: model.medicalFileList[0].entityList[0].timelines[index].doctorImage,
.doctorName, appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
clinic: model.medicalFileList[0].entityList[0] model.medicalFileList[0].entityList[0].timelines[index].date,
.timelines[index].clinicName,
branch: model.medicalFileList[0].entityList[0]
.timelines[index].projectName,
profileUrl: model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorImage,
appointmentDate:
AppDateUtils.getDateTimeFromServerFormat(
model.medicalFileList[0].entityList[0]
.timelines[index].date,
), ),
isPrescriptions: true, isPrescriptions: true,
isShowEye: model isShowEye: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
.medicalFileList[0] .consulations.length !=
.entityList[0]
.timelines[index]
.timeLineEvents[0]
.consulations
.length !=
0 0
? true ? true
: false), : false),
@ -196,8 +150,7 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context) child: AppText(TranslationBase.of(context).noMedicalFileFound),
.noMedicalFileFound),
) )
], ],
), ),

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -92,11 +94,13 @@ class _InsuranceApprovalScreenNewState extends State<InsuranceApprovalScreenNew>
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => InsuranceApprovalsDetails( builder: (context) => InsuranceApprovalsDetails(
patient: patient, patient: patient,
indexInsurance: index, indexInsurance: index,
patientType: patientType, patientType: patientType,
),settings: RouteSettings(name: 'InsuranceApprovalsDetails'),), ),
settings: RouteSettings(name: 'InsuranceApprovalsDetails'),
),
); );
}, },
child: DoctorCardInsurance( child: DoctorCardInsurance(
@ -175,15 +179,21 @@ class _InsuranceApprovalScreenNewState extends State<InsuranceApprovalScreenNew>
model.insuranceApproval.length, model.insuranceApproval.length,
(index) => Container( (index) => Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Insurance Approval Screen New",
eventAction: "Insurance Approval Details",
);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => InsuranceApprovalsDetails( builder: (context) => InsuranceApprovalsDetails(
patient: patient, patient: patient,
indexInsurance: index, indexInsurance: index,
patientType: patientType, patientType: patientType,
),settings: RouteSettings(name: 'InsuranceApprovalsDetails'),), ),
settings: RouteSettings(name: 'InsuranceApprovalsDetails'),
),
); );
}, },
child: DoctorCardInsurance( child: DoctorCardInsurance(

@ -1,8 +1,10 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -23,12 +25,10 @@ import '../../../../routes.dart';
class AdmissionRequestFirstScreen extends StatefulWidget { class AdmissionRequestFirstScreen extends StatefulWidget {
@override @override
_AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState();
_AdmissionRequestThirdScreenState();
} }
class _AdmissionRequestThirdScreenState class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScreen> {
extends State<AdmissionRequestFirstScreen> {
final _dietTypeRemarksController = TextEditingController(); final _dietTypeRemarksController = TextEditingController();
final _sickLeaveCommentsController = TextEditingController(); final _sickLeaveCommentsController = TextEditingController();
final _postMedicalHistoryController = TextEditingController(); final _postMedicalHistoryController = TextEditingController();
@ -61,8 +61,7 @@ class _AdmissionRequestThirdScreenState
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(patient),
patient),
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector( body: GestureDetector(
onTap: () { onTap: () {
@ -100,14 +99,12 @@ class _AdmissionRequestThirdScreenState
), ),
), ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).specialityAndDoctorDetail,
.specialityAndDoctorDetail,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -121,14 +118,15 @@ class _AdmissionRequestThirdScreenState
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: clinicError, validationError: clinicError,
dropDownText: _selectedClinic != null dropDownText: _selectedClinic != null
? projectViewModel.isArabic? _selectedClinic['clinicNameArabic'] : _selectedClinic['clinicNameEnglish'] ? projectViewModel.isArabic
? _selectedClinic['clinicNameArabic']
: _selectedClinic['clinicNameEnglish']
: null, : null,
enabled: false, enabled: false,
onClick: model.clinicList != null && onClick: model.clinicList != null && model.clinicList.length > 0
model.clinicList.length > 0
? () { ? () {
openListDialogField( openListDialogField(
projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish', projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish',
'clinicID', 'clinicID',
model.clinicList, (selectedValue) { model.clinicList, (selectedValue) {
setState(() { setState(() {
@ -137,28 +135,21 @@ class _AdmissionRequestThirdScreenState
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context); await model.getClinics().then((_) => GifLoaderDialogUtils.hideDialog(context));
await model.getClinics().then((_) => if (model.state == ViewState.Idle && model.clinicList.length > 0) {
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.clinicList.length > 0) {
openListDialogField( openListDialogField(
projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish', projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish',
'clinicID', 'clinicID',
model.clinicList, (selectedValue) { model.clinicList, (selectedValue) {
setState(() { setState(() {
_selectedClinic = selectedValue; _selectedClinic = selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error);
DrAppToastMsg.showErrorToast(
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
}, },
), ),
@ -169,17 +160,13 @@ class _AdmissionRequestThirdScreenState
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor, hintText: TranslationBase.of(context).doctor,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
dropDownText: _selectedDoctor != null dropDownText: _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null,
? _selectedDoctor['DoctorName']
: null,
enabled: false, enabled: false,
validationError: doctorError, validationError: doctorError,
onClick: _selectedClinic != null onClick: _selectedClinic != null
? model.doctorsList != null && ? model.doctorsList != null && model.doctorsList.length > 0
model.doctorsList.length > 0
? () { ? () {
openListDialogField('DoctorName', openListDialogField('DoctorName', 'DoctorID', model.doctorsList,
'DoctorID', model.doctorsList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDoctor = selectedValue; _selectedDoctor = selectedValue;
@ -187,29 +174,21 @@ class _AdmissionRequestThirdScreenState
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context);
await model await model
.getClinicDoctors( .getClinicDoctors(_selectedClinic['clinicID'])
_selectedClinic['clinicID']) .then((_) => GifLoaderDialogUtils.hideDialog(context));
.then((_) => GifLoaderDialogUtils if (model.state == ViewState.Idle && model.doctorsList.length > 0) {
.hideDialog(context)); openListDialogField('DoctorName', 'DoctorID', model.doctorsList,
if (model.state == ViewState.Idle &&
model.doctorsList.length > 0) {
openListDialogField('DoctorName',
'DoctorID', model.doctorsList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDoctor = selectedValue; _selectedDoctor = selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error);
DrAppToastMsg.showErrorToast(
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
} }
: null, : null,
@ -226,7 +205,7 @@ class _AdmissionRequestThirdScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
if(patient.gender != 1) if (patient.gender != 1)
CheckboxListTile( CheckboxListTile(
title: AppText( title: AppText(
TranslationBase.of(context).patientPregnant, TranslationBase.of(context).patientPregnant,
@ -262,8 +241,7 @@ class _AdmissionRequestThirdScreenState
contentPadding: EdgeInsets.all(0), contentPadding: EdgeInsets.all(0),
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).sickLeaveComments,
TranslationBase.of(context).sickLeaveComments,
controller: _sickLeaveCommentsController, controller: _sickLeaveCommentsController,
minLines: 2, minLines: 2,
maxLines: 4, maxLines: 4,
@ -278,43 +256,31 @@ class _AdmissionRequestThirdScreenState
hintText: TranslationBase.of(context).dietType, hintText: TranslationBase.of(context).dietType,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: dietTypeError, validationError: dietTypeError,
dropDownText: _selectedDietType != null dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : null,
? _selectedDietType['nameEn']
: null,
enabled: false, enabled: false,
onClick: model.dietTypesList != null && onClick: model.dietTypesList != null && model.dietTypesList.length > 0
model.dietTypesList.length > 0
? () { ? () {
openListDialogField( openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) {
'nameEn', 'id', model.dietTypesList,
(selectedValue) {
setState(() { setState(() {
_selectedDietType = selectedValue; _selectedDietType = selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context); await model
await model.getDietTypes(patient.patientId).then((_) => .getDietTypes(patient.patientId)
GifLoaderDialogUtils.hideDialog( .then((_) => GifLoaderDialogUtils.hideDialog(context));
context)); if (model.state == ViewState.Idle && model.dietTypesList.length > 0) {
if (model.state == ViewState.Idle && openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) {
model.dietTypesList.length > 0) {
openListDialogField(
'nameEn', 'id', model.dietTypesList,
(selectedValue) {
setState(() { setState(() {
_selectedDietType = selectedValue; _selectedDietType = selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error);
DrAppToastMsg.showErrorToast(
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
}, },
), ),
@ -322,8 +288,7 @@ class _AdmissionRequestThirdScreenState
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).dietTypeRemarks,
TranslationBase.of(context).dietTypeRemarks,
controller: _dietTypeRemarksController, controller: _dietTypeRemarksController,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
@ -363,82 +328,71 @@ class _AdmissionRequestThirdScreenState
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
color: HexColor("#D02127"), color: HexColor("#D02127"),
onPressed: () { onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Admission Request First Screen",
eventAction: "Go To Admission Request Two",
);
model.admissionRequestData = AdmissionRequest(); model.admissionRequestData = AdmissionRequest();
if (_selectedClinic != null && if (_selectedClinic != null &&
_selectedDoctor != null && _selectedDoctor != null &&
_sickLeaveCommentsController.text != "" && _sickLeaveCommentsController.text != "" &&
_postMedicalHistoryController.text != "" && _postMedicalHistoryController.text != "" &&
_postSurgicalHistoryController.text != "") { _postSurgicalHistoryController.text != "") {
model.admissionRequestData.patientMRN = model.admissionRequestData.patientMRN = patient.patientMRN;
patient.patientMRN; model.admissionRequestData.appointmentNo = patient.appointmentNo;
model.admissionRequestData.appointmentNo =
patient.appointmentNo;
model.admissionRequestData.episodeID = patient.episodeNo; model.admissionRequestData.episodeID = patient.episodeNo;
model.admissionRequestData.admissionRequestNo = 0; model.admissionRequestData.admissionRequestNo = 0;
model.admissionRequestData.admitToClinic = model.admissionRequestData.admitToClinic = _selectedClinic['clinicID'];
_selectedClinic['clinicID']; model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID'];
model.admissionRequestData.mrpDoctorID =
_selectedDoctor['DoctorID'];
model.admissionRequestData.isPregnant = _patientPregnant; model.admissionRequestData.isPregnant = _patientPregnant;
model.admissionRequestData.isSickLeaveRequired = model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired;
_isSickLeaveRequired; model.admissionRequestData.sickLeaveComments = _sickLeaveCommentsController.text;
model.admissionRequestData.sickLeaveComments = model.admissionRequestData.isDietType = _selectedDietType != null ? true : false;
_sickLeaveCommentsController.text; model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0;
model.admissionRequestData.isDietType = model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text;
_selectedDietType != null ? true : false; model.admissionRequestData.pastMedicalHistory = _postMedicalHistoryController.text;
model.admissionRequestData.dietType = model.admissionRequestData.pastSurgicalHistory = _postSurgicalHistoryController.text;
_selectedDietType != null Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {
? _selectedDietType['id']
: 0;
model.admissionRequestData.dietRemarks =
_dietTypeRemarksController.text;
model.admissionRequestData.pastMedicalHistory =
_postMedicalHistoryController.text;
model.admissionRequestData.pastSurgicalHistory =
_postSurgicalHistoryController.text;
Navigator.of(context)
.pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {
'patient': patient, 'patient': patient,
'patientType': patientType, 'patientType': patientType,
'arrivalType': arrivalType, 'arrivalType': arrivalType,
'admission-data': model.admissionRequestData 'admission-data': model.admissionRequestData
}); });
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill);
TranslationBase.of(context).pleaseFill);
setState(() { setState(() {
if(_selectedClinic == null){ if (_selectedClinic == null) {
clinicError = TranslationBase.of(context).fieldRequired; clinicError = TranslationBase.of(context).fieldRequired;
}else { } else {
clinicError = null; clinicError = null;
} }
if(_selectedDoctor == null){ if (_selectedDoctor == null) {
doctorError = TranslationBase.of(context).fieldRequired; doctorError = TranslationBase.of(context).fieldRequired;
}else { } else {
doctorError = null; doctorError = null;
} }
if(_sickLeaveCommentsController.text == ""){ if (_sickLeaveCommentsController.text == "") {
sickLeaveCommentError = TranslationBase.of(context).fieldRequired; sickLeaveCommentError = TranslationBase.of(context).fieldRequired;
}else { } else {
sickLeaveCommentError = null; sickLeaveCommentError = null;
} }
if(_selectedDietType == null){ if (_selectedDietType == null) {
dietTypeError = TranslationBase.of(context).fieldRequired; dietTypeError = TranslationBase.of(context).fieldRequired;
}else { } else {
dietTypeError = null; dietTypeError = null;
} }
if(_postMedicalHistoryController.text == ""){ if (_postMedicalHistoryController.text == "") {
medicalHistoryError = TranslationBase.of(context).fieldRequired; medicalHistoryError = TranslationBase.of(context).fieldRequired;
}else { } else {
medicalHistoryError = null; medicalHistoryError = null;
} }
if(_postSurgicalHistoryController.text == ""){ if (_postSurgicalHistoryController.text == "") {
surgicalHistoryError = TranslationBase.of(context).fieldRequired; surgicalHistoryError = TranslationBase.of(context).fieldRequired;
}else { } else {
surgicalHistoryError = null; surgicalHistoryError = null;
} }
}); });
@ -453,8 +407,8 @@ class _AdmissionRequestThirdScreenState
); );
} }
void openListDialogField(String attributeName, String attributeValueId, void openListDialogField(
List<dynamic> list, Function(dynamic selectedValue) okFunction) { String attributeName, String attributeValueId, List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: list, list: list,
attributeName: attributeName, attributeName: attributeName,

@ -2,8 +2,10 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -23,12 +25,10 @@ import '../../../../routes.dart';
class AdmissionRequestThirdScreen extends StatefulWidget { class AdmissionRequestThirdScreen extends StatefulWidget {
@override @override
_AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState();
_AdmissionRequestThirdScreenState();
} }
class _AdmissionRequestThirdScreenState class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScreen> {
extends State<AdmissionRequestThirdScreen> {
dynamic _selectedDiagnosis; dynamic _selectedDiagnosis;
dynamic _selectedIcd; dynamic _selectedIcd;
dynamic _selectedDiagnosisType; dynamic _selectedDiagnosisType;
@ -52,8 +52,7 @@ class _AdmissionRequestThirdScreenState
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(patient),
patient),
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector( body: GestureDetector(
onTap: () { onTap: () {
@ -106,18 +105,13 @@ class _AdmissionRequestThirdScreenState
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).diagnosis, hintText: TranslationBase.of(context).diagnosis,
dropDownText: _selectedDiagnosis != null dropDownText: _selectedDiagnosis != null ? _selectedDiagnosis['nameEn'] : null,
? _selectedDiagnosis['nameEn']
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: diagnosisError, validationError: diagnosisError,
onClick: model.diagnosisTypesList != null && onClick: model.diagnosisTypesList != null && model.diagnosisTypesList.length > 0
model.diagnosisTypesList.length > 0
? () { ? () {
openListDialogField('nameEn', 'id', openListDialogField('nameEn', 'id', model.diagnosisTypesList, (selectedValue) {
model.diagnosisTypesList,
(selectedValue) {
setState(() { setState(() {
_selectedDiagnosis = selectedValue; _selectedDiagnosis = selectedValue;
}); });
@ -125,24 +119,17 @@ class _AdmissionRequestThirdScreenState
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.getDiagnosis().then((_) => await model.getDiagnosis().then((_) => GifLoaderDialogUtils.hideDialog(context));
GifLoaderDialogUtils.hideDialog( if (model.state == ViewState.Idle && model.diagnosisTypesList.length > 0) {
context)); openListDialogField('nameEn', 'id', model.diagnosisTypesList, (selectedValue) {
if (model.state == ViewState.Idle &&
model.diagnosisTypesList.length > 0) {
openListDialogField('nameEn', 'id',
model.diagnosisTypesList,
(selectedValue) {
setState(() { setState(() {
_selectedDiagnosis = selectedValue; _selectedDiagnosis = selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
}, },
), ),
@ -152,18 +139,13 @@ class _AdmissionRequestThirdScreenState
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).icd, hintText: TranslationBase.of(context).icd,
dropDownText: _selectedIcd != null dropDownText: _selectedIcd != null ? _selectedIcd['description'] : null,
? _selectedIcd['description']
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: icdError, validationError: icdError,
onClick: model.icdCodes != null && onClick: model.icdCodes != null && model.icdCodes.length > 0
model.icdCodes.length > 0
? () { ? () {
openListDialogField( openListDialogField('description', 'code', model.icdCodes, (selectedValue) {
'description', 'code', model.icdCodes,
(selectedValue) {
setState(() { setState(() {
_selectedIcd = selectedValue; _selectedIcd = selectedValue;
}); });
@ -173,24 +155,17 @@ class _AdmissionRequestThirdScreenState
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model await model
.getICDCodes(patient.patientMRN) .getICDCodes(patient.patientMRN)
.then((_) => .then((_) => GifLoaderDialogUtils.hideDialog(context));
GifLoaderDialogUtils.hideDialog( if (model.state == ViewState.Idle && model.icdCodes.length > 0) {
context)); openListDialogField('description', 'code', model.icdCodes, (selectedValue) {
if (model.state == ViewState.Idle &&
model.icdCodes.length > 0) {
openListDialogField(
'description', 'code', model.icdCodes,
(selectedValue) {
setState(() { setState(() {
_selectedIcd = selectedValue; _selectedIcd = selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
}, },
), ),
@ -200,19 +175,14 @@ class _AdmissionRequestThirdScreenState
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).diagnoseType, hintText: TranslationBase.of(context).diagnoseType,
dropDownText: _selectedDiagnosisType != null dropDownText: _selectedDiagnosisType != null ? _selectedDiagnosisType['description'] : null,
? _selectedDiagnosisType['description']
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: diagnosisTypeError, validationError: diagnosisTypeError,
onClick: model.listOfDiagnosisSelectionTypes != onClick: model.listOfDiagnosisSelectionTypes != null &&
null && model.listOfDiagnosisSelectionTypes.length > 0
model.listOfDiagnosisSelectionTypes.length >
0
? () { ? () {
openListDialogField('description', 'code', openListDialogField('description', 'code', model.listOfDiagnosisSelectionTypes,
model.listOfDiagnosisSelectionTypes,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDiagnosisType = selectedValue; _selectedDiagnosisType = selectedValue;
@ -222,29 +192,20 @@ class _AdmissionRequestThirdScreenState
: () async { : () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model await model
.getMasterLookup(MasterKeysService .getMasterLookup(MasterKeysService.DiagnosisSelectionType)
.DiagnosisSelectionType) .then((_) => GifLoaderDialogUtils.hideDialog(context));
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.listOfDiagnosisSelectionTypes model.listOfDiagnosisSelectionTypes.length > 0) {
.length > openListDialogField('description', 'code', model.listOfDiagnosisSelectionTypes,
0) {
openListDialogField('description', 'code',
model.listOfDiagnosisSelectionTypes,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDiagnosisType = _selectedDiagnosisType = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
}, },
), ),
@ -279,58 +240,52 @@ class _AdmissionRequestThirdScreenState
title: TranslationBase.of(context).submit, title: TranslationBase.of(context).submit,
color: HexColor("#359846"), color: HexColor("#359846"),
onPressed: () async { onPressed: () async {
if (_selectedDiagnosis != null && await locator<AnalyticsService>().logEvent(
_selectedIcd != null && eventCategory: "Admission Request Third Screen",
_selectedDiagnosisType != null) { eventAction: "Submit Admission Request",
);
if (_selectedDiagnosis != null && _selectedIcd != null && _selectedDiagnosisType != null) {
model.admissionRequestData = admissionRequest; model.admissionRequestData = admissionRequest;
dynamic admissionRequestDiagnoses = [ dynamic admissionRequestDiagnoses = [
{ {
'diagnosisDescription': 'diagnosisDescription': _selectedDiagnosis['nameEn'],
_selectedDiagnosis['nameEn'],
'diagnosisType': _selectedDiagnosis['id'], 'diagnosisType': _selectedDiagnosis['id'],
'icdCode': _selectedIcd['code'], 'icdCode': _selectedIcd['code'],
'icdCodeDescription': 'icdCodeDescription': _selectedIcd['description'],
_selectedIcd['description'],
'type': _selectedDiagnosisType['code'], 'type': _selectedDiagnosisType['code'],
'remarks': "", 'remarks': "",
'isActive': true, 'isActive': true,
} }
]; ];
model.admissionRequestData model.admissionRequestData.admissionRequestDiagnoses = admissionRequestDiagnoses;
.admissionRequestDiagnoses =
admissionRequestDiagnoses;
await model.makeAdmissionRequest(); await model.makeAdmissionRequest();
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(TranslationBase.of(context).admissionRequestSuccessMsg);
TranslationBase.of(context) Navigator.popUntil(context, ModalRoute.withName(PATIENTS_PROFILE));
.admissionRequestSuccessMsg);
Navigator.popUntil(context,
ModalRoute.withName(PATIENTS_PROFILE));
} }
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill);
TranslationBase.of(context).pleaseFill);
setState(() { setState(() {
if(_selectedDiagnosis == null){ if (_selectedDiagnosis == null) {
diagnosisError = TranslationBase.of(context).fieldRequired; diagnosisError = TranslationBase.of(context).fieldRequired;
}else { } else {
diagnosisError = null; diagnosisError = null;
} }
if(_selectedIcd == null){ if (_selectedIcd == null) {
icdError = TranslationBase.of(context).fieldRequired; icdError = TranslationBase.of(context).fieldRequired;
}else { } else {
icdError = null; icdError = null;
} }
if(_selectedDiagnosisType == null){ if (_selectedDiagnosisType == null) {
diagnosisTypeError = TranslationBase.of(context).fieldRequired; diagnosisTypeError = TranslationBase.of(context).fieldRequired;
}else { } else {
diagnosisTypeError = null; diagnosisTypeError = null;
} }
}); });
@ -348,8 +303,8 @@ class _AdmissionRequestThirdScreenState
); );
} }
void openListDialogField(String attributeName, String attributeValueId, void openListDialogField(
List<dynamic> list, Function(dynamic selectedValue) okFunction) { String attributeName, String attributeValueId, List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: list, list: list,
attributeName: attributeName, attributeName: attributeName,

@ -3,8 +3,10 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
@ -26,12 +28,10 @@ import '../../../../routes.dart';
class AdmissionRequestSecondScreen extends StatefulWidget { class AdmissionRequestSecondScreen extends StatefulWidget {
@override @override
_AdmissionRequestSecondScreenState createState() => _AdmissionRequestSecondScreenState createState() => _AdmissionRequestSecondScreenState();
_AdmissionRequestSecondScreenState();
} }
class _AdmissionRequestSecondScreenState class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScreen> {
extends State<AdmissionRequestSecondScreen> {
final _postPlansEstimatedCostController = TextEditingController(); final _postPlansEstimatedCostController = TextEditingController();
final _estimatedCostController = TextEditingController(); final _estimatedCostController = TextEditingController();
final _expectedDaysController = TextEditingController(); final _expectedDaysController = TextEditingController();
@ -74,8 +74,7 @@ class _AdmissionRequestSecondScreenState
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(patient),
patient),
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector( body: GestureDetector(
onTap: () { onTap: () {
@ -112,14 +111,12 @@ class _AdmissionRequestSecondScreenState
), ),
), ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).postPlansEstimatedCost,
.postPlansEstimatedCost,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -129,15 +126,11 @@ class _AdmissionRequestSecondScreenState
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: hintText: TranslationBase.of(context).estimatedCost,
TranslationBase.of(context).estimatedCost,
controller: _estimatedCostController, controller: _estimatedCostController,
validationError: costError, validationError: costError,
inputType: TextInputType.number, inputType: TextInputType.number,
inputFormatters: [ inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))],
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -154,10 +147,8 @@ class _AdmissionRequestSecondScreenState
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).otherDepartmentsInterventions,
.otherDepartmentsInterventions, controller: _otherDepartmentsInterventionsController,
controller:
_otherDepartmentsInterventionsController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
validationError: otherInterventionsError, validationError: otherInterventionsError,
minLines: 2, minLines: 2,
@ -177,23 +168,18 @@ class _AdmissionRequestSecondScreenState
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: hintText: TranslationBase.of(context).expectedDays,
TranslationBase.of(context).expectedDays,
controller: _expectedDaysController, controller: _expectedDaysController,
validationError: expectedDaysError, validationError: expectedDaysError,
inputType: TextInputType.number, inputType: TextInputType.number,
inputFormatters: [ inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))],
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).expectedAdmissionDate,
.expectedAdmissionDate,
dropDownText: _expectedAdmissionDate != null dropDownText: _expectedAdmissionDate != null
? "${AppDateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" ? "${AppDateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
: null, : null,
@ -209,8 +195,7 @@ class _AdmissionRequestSecondScreenState
if (_expectedAdmissionDate == null) { if (_expectedAdmissionDate == null) {
_expectedAdmissionDate = DateTime.now(); _expectedAdmissionDate = DateTime.now();
} }
_selectDate(context, _expectedAdmissionDate, _selectDate(context, _expectedAdmissionDate, (picked) {
(picked) {
setState(() { setState(() {
_expectedAdmissionDate = picked; _expectedAdmissionDate = picked;
}); });
@ -223,47 +208,32 @@ class _AdmissionRequestSecondScreenState
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).floor, hintText: TranslationBase.of(context).floor,
dropDownText: _selectedFloor != null dropDownText: _selectedFloor != null ? _selectedFloor['description'] : null,
? _selectedFloor['description']
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: floorError, validationError: floorError,
onClick: model.floorList != null && onClick: model.floorList != null && model.floorList.length > 0
model.floorList.length > 0
? () { ? () {
openListDialogField( openListDialogField('description', 'floorID', model.floorList, (selectedValue) {
'description',
'floorID',
model.floorList, (selectedValue) {
setState(() { setState(() {
_selectedFloor = selectedValue; _selectedFloor = selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context); await model.getFloors().then((_) => GifLoaderDialogUtils.hideDialog(context));
await model.getFloors().then((_) => if (model.state == ViewState.Idle && model.floorList.length > 0) {
GifLoaderDialogUtils.hideDialog( openListDialogField('description', 'floorID', model.floorList,
context)); (selectedValue) {
if (model.state == ViewState.Idle &&
model.floorList.length > 0) {
openListDialogField(
'description',
'floorID',
model.floorList, (selectedValue) {
setState(() { setState(() {
_selectedFloor = selectedValue; _selectedFloor = selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error);
DrAppToastMsg.showErrorToast(
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
}, },
), ),
@ -273,46 +243,32 @@ class _AdmissionRequestSecondScreenState
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).ward, hintText: TranslationBase.of(context).ward,
dropDownText: _selectedWard != null dropDownText: _selectedWard != null ? _selectedWard['description'] : null,
? _selectedWard['description']
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
onClick: model.wardList != null && onClick: model.wardList != null && model.wardList.length > 0
model.wardList.length > 0
? () { ? () {
openListDialogField( openListDialogField('description', 'nursingStationID', model.wardList,
'description', (selectedValue) {
'nursingStationID',
model.wardList, (selectedValue) {
setState(() { setState(() {
_selectedWard = selectedValue; _selectedWard = selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context); await model.getWards().then((_) => GifLoaderDialogUtils.hideDialog(context));
await model.getWards().then((_) => if (model.state == ViewState.Idle && model.wardList.length > 0) {
GifLoaderDialogUtils.hideDialog( openListDialogField('description', 'nursingStationID', model.wardList,
context)); (selectedValue) {
if (model.state == ViewState.Idle &&
model.wardList.length > 0) {
openListDialogField(
'description',
'nursingStationID',
model.wardList, (selectedValue) {
setState(() { setState(() {
_selectedWard = selectedValue; _selectedWard = selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error);
DrAppToastMsg.showErrorToast(
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
}, },
), ),
@ -321,54 +277,37 @@ class _AdmissionRequestSecondScreenState
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: hintText: TranslationBase.of(context).roomCategory,
TranslationBase.of(context).roomCategory, dropDownText:
dropDownText: _selectedRoomCategory != null _selectedRoomCategory != null ? _selectedRoomCategory['description'] : null,
? _selectedRoomCategory['description']
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: roomError, validationError: roomError,
onClick: model.roomCategoryList != null && onClick: model.roomCategoryList != null && model.roomCategoryList.length > 0
model.roomCategoryList.length > 0
? () { ? () {
openListDialogField( openListDialogField('description', 'categoryID', model.roomCategoryList,
'description',
'categoryID',
model.roomCategoryList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedRoomCategory = _selectedRoomCategory = selectedValue;
selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context); await model
await model.getRoomCategories().then( .getRoomCategories()
(_) => .then((_) => GifLoaderDialogUtils.hideDialog(context));
GifLoaderDialogUtils.hideDialog( if (model.state == ViewState.Idle && model.roomCategoryList.length > 0) {
context)); openListDialogField('description', 'categoryID', model.roomCategoryList,
if (model.state == ViewState.Idle &&
model.roomCategoryList.length > 0) {
openListDialogField(
'description',
'categoryID',
model.roomCategoryList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedRoomCategory = _selectedRoomCategory = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error);
DrAppToastMsg.showErrorToast(
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
}, },
), ),
@ -376,8 +315,7 @@ class _AdmissionRequestSecondScreenState
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).treatmentLine,
TranslationBase.of(context).treatmentLine,
controller: _treatmentLineController, controller: _treatmentLineController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
validationError: treatmentsError, validationError: treatmentsError,
@ -388,8 +326,7 @@ class _AdmissionRequestSecondScreenState
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).complications,
TranslationBase.of(context).complications,
controller: _complicationsController, controller: _complicationsController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
validationError: complicationsError, validationError: complicationsError,
@ -400,8 +337,7 @@ class _AdmissionRequestSecondScreenState
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).otherProcedure,
TranslationBase.of(context).otherProcedure,
controller: _otherProceduresController, controller: _otherProceduresController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
validationError: proceduresError, validationError: proceduresError,
@ -413,53 +349,34 @@ class _AdmissionRequestSecondScreenState
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: hintText: TranslationBase.of(context).admissionType,
TranslationBase.of(context).admissionType, dropDownText: _selectedAdmissionType != null ? _selectedAdmissionType['nameEn'] : null,
dropDownText: _selectedAdmissionType != null
? _selectedAdmissionType['nameEn']
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: admissionTypeError, validationError: admissionTypeError,
onClick: model.admissionTypeList != null && onClick: model.admissionTypeList != null && model.admissionTypeList.length > 0
model.admissionTypeList.length > 0
? () { ? () {
openListDialogField('nameEn', 'id', openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) {
model.admissionTypeList,
(selectedValue) {
setState(() { setState(() {
_selectedAdmissionType = _selectedAdmissionType = selectedValue;
selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context);
await model await model
.getMasterLookup(MasterKeysService .getMasterLookup(MasterKeysService.AdmissionRequestType)
.AdmissionRequestType) .then((_) => GifLoaderDialogUtils.hideDialog(context));
.then((_) => if (model.state == ViewState.Idle && model.admissionTypeList.length > 0) {
GifLoaderDialogUtils.hideDialog( openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) {
context));
if (model.state == ViewState.Idle &&
model.admissionTypeList.length >
0) {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() { setState(() {
_selectedAdmissionType = _selectedAdmissionType = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state == ViewState.ErrorLocal) {
ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error);
DrAppToastMsg.showErrorToast(
model.error);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("Empty List");
"Empty List");
} }
}, },
), ),
@ -492,144 +409,115 @@ class _AdmissionRequestSecondScreenState
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
color: HexColor("#D02127"), color: HexColor("#D02127"),
onPressed: () async { onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Admission Request Second Screen",
eventAction: "Go To Admission Request Three",
);
if (_estimatedCostController.text != "" && if (_estimatedCostController.text != "" &&
_postPlansEstimatedCostController.text != "" && _postPlansEstimatedCostController.text != "" &&
_expectedDaysController.text != "" && _expectedDaysController.text != "" &&
_expectedAdmissionDate != null && _expectedAdmissionDate != null &&
_otherDepartmentsInterventionsController.text != _otherDepartmentsInterventionsController.text != "" &&
"" &&
_selectedFloor != null && _selectedFloor != null &&
_selectedRoomCategory != _selectedRoomCategory != null /*_selectedWard is not required*/ &&
null /*_selectedWard is not required*/ &&
_treatmentLineController.text != "" && _treatmentLineController.text != "" &&
_complicationsController.text != "" && _complicationsController.text != "" &&
_otherProceduresController.text != "" && _otherProceduresController.text != "" &&
_selectedAdmissionType != null) { _selectedAdmissionType != null) {
model.admissionRequestData = admissionRequest; model.admissionRequestData = admissionRequest;
model.admissionRequestData.estimatedCost = model.admissionRequestData.estimatedCost = int.parse(_estimatedCostController.text);
int.parse(_estimatedCostController.text); model.admissionRequestData.elementsForImprovement =
model.admissionRequestData
.elementsForImprovement =
_postPlansEstimatedCostController.text; _postPlansEstimatedCostController.text;
model.admissionRequestData.expectedDays = model.admissionRequestData.expectedDays = int.parse(_expectedDaysController.text);
int.parse(_expectedDaysController.text); model.admissionRequestData.admissionDate = _expectedAdmissionDate.toIso8601String();
model.admissionRequestData.admissionDate = model.admissionRequestData.otherDepartmentInterventions =
_expectedAdmissionDate.toIso8601String();
model.admissionRequestData
.otherDepartmentInterventions =
_otherDepartmentsInterventionsController.text; _otherDepartmentsInterventionsController.text;
model.admissionRequestData.admissionLocationID = model.admissionRequestData.admissionLocationID = _selectedFloor['floorID'];
_selectedFloor['floorID'];
model.admissionRequestData.wardID = model.admissionRequestData.wardID =
_selectedWard != null _selectedWard != null ? _selectedWard['nursingStationID'] : 0;
? _selectedWard['nursingStationID'] model.admissionRequestData.roomCategoryID = _selectedRoomCategory['categoryID'];
: 0;
model.admissionRequestData.roomCategoryID =
_selectedRoomCategory['categoryID'];
model.admissionRequestData model.admissionRequestData.admissionRequestProcedures = [];
.admissionRequestProcedures = [];
model.admissionRequestData.mainLineOfTreatment = model.admissionRequestData.mainLineOfTreatment = _treatmentLineController.text;
_treatmentLineController.text; model.admissionRequestData.complications = _complicationsController.text;
model.admissionRequestData.complications = model.admissionRequestData.otherProcedures = _otherProceduresController.text;
_complicationsController.text; model.admissionRequestData.admissionType = _selectedAdmissionType['id'];
model.admissionRequestData.otherProcedures =
_otherProceduresController.text;
model.admissionRequestData.admissionType =
_selectedAdmissionType['id'];
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {
PATIENT_ADMISSION_REQUEST_3, 'patient': patient,
arguments: { 'patientType': patientType,
'patient': patient, 'arrivalType': arrivalType,
'patientType': patientType, 'admission-data': model.admissionRequestData
'arrivalType': arrivalType, });
'admission-data': model.admissionRequestData
});
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill);
TranslationBase.of(context).pleaseFill);
setState(() { setState(() {
if (_estimatedCostController.text == "") { if (_estimatedCostController.text == "") {
costError = costError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
costError = null; costError = null;
} }
if (_postPlansEstimatedCostController.text == if (_postPlansEstimatedCostController.text == "") {
"") { plansError = TranslationBase.of(context).fieldRequired;
plansError =
TranslationBase.of(context).fieldRequired;
} else { } else {
plansError = null; plansError = null;
} }
if (_expectedDaysController.text == "") { if (_expectedDaysController.text == "") {
expectedDaysError = expectedDaysError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
expectedDaysError = null; expectedDaysError = null;
} }
if (_expectedAdmissionDate == null) { if (_expectedAdmissionDate == null) {
expectedDatesError = expectedDatesError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
expectedDatesError = null; expectedDatesError = null;
} }
if (_otherDepartmentsInterventionsController if (_otherDepartmentsInterventionsController.text == "") {
.text == otherInterventionsError = TranslationBase.of(context).fieldRequired;
"") {
otherInterventionsError =
TranslationBase.of(context).fieldRequired;
} else { } else {
otherInterventionsError = null; otherInterventionsError = null;
} }
if (_selectedFloor == null) { if (_selectedFloor == null) {
floorError = floorError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
floorError = null; floorError = null;
} }
if (_selectedRoomCategory == null) { if (_selectedRoomCategory == null) {
roomError = roomError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
roomError = null; roomError = null;
} }
if (_treatmentLineController.text == "") { if (_treatmentLineController.text == "") {
treatmentsError = treatmentsError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
treatmentsError = null; treatmentsError = null;
} }
if (_complicationsController.text == "") { if (_complicationsController.text == "") {
complicationsError = complicationsError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
complicationsError = null; complicationsError = null;
} }
if (_otherProceduresController.text == "") { if (_otherProceduresController.text == "") {
proceduresError = proceduresError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
proceduresError = null; proceduresError = null;
} }
if (_selectedAdmissionType == null) { if (_selectedAdmissionType == null) {
admissionTypeError = admissionTypeError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
admissionTypeError = null; admissionTypeError = null;
} }
@ -647,8 +535,7 @@ class _AdmissionRequestSecondScreenState
); );
} }
Future _selectDate(BuildContext context, DateTime dateTime, Future _selectDate(BuildContext context, DateTime dateTime, Function(DateTime picked) updateDate) async {
Function(DateTime picked) updateDate) async {
final DateTime picked = await showDatePicker( final DateTime picked = await showDatePicker(
context: context, context: context,
initialDate: dateTime, initialDate: dateTime,
@ -661,8 +548,8 @@ class _AdmissionRequestSecondScreenState
} }
} }
void openListDialogField(String attributeName, String attributeValueId, void openListDialogField(
List<dynamic> list, Function(dynamic selectedValue) okFunction) { String attributeName, String attributeValueId, List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: list, list: list,
attributeName: attributeName, attributeName: attributeName,

@ -1,8 +1,10 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
@ -75,166 +77,168 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
), ),
), ),
AddNewOrder( AddNewOrder(
onTap: () { onTap: () async {
// if (model.hasOnHold()) { // if (model.hasOnHold()) {
// Helpers.showErrorToast("Please Verified the on hold report to be able to add new one"); // Helpers.showErrorToast("Please Verified the on hold report to be able to add new one");
// } else // } else
await locator<AnalyticsService>().logEvent(
eventCategory: "Medical Report Page",
eventAction: "Add New Medical Report",
);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddVerifyMedicalReport( builder: (context) => AddVerifyMedicalReport(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
model: model, model: model,
status: MedicalReportStatus.ADD, status: MedicalReportStatus.ADD,
), ),
settings: RouteSettings(name: 'AddVerifyMedicalReport'), settings: RouteSettings(name: 'AddVerifyMedicalReport'),
), ),
); );
}, },
label: TranslationBase.of(context).createNewMedicalReport, label: TranslationBase.of(context).createNewMedicalReport,
), ),
// if (model.state != ViewState.ErrorLocal)ß // if (model.state != ViewState.ErrorLocal)ß
...List.generate( ...List.generate(
model.medicalReportList.length, model.medicalReportList.length,
(index) => InkWell( (index) => InkWell(
onTap: () { onTap: () {
if (model.medicalReportList[index].status == 1) { if (model.medicalReportList[index].status == 1) {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddVerifyMedicalReport( builder: (context) => AddVerifyMedicalReport(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
medicalReport: model.medicalReportList[index], medicalReport: model.medicalReportList[index],
model: model, model: model,
medicalNote: model.medicalReportList[index].reportDataHtml, medicalNote: model.medicalReportList[index].reportDataHtml,
),
settings: RouteSettings(name: 'AddVerifyMedicalReport')),
);
} else {
Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'type': MedicalReportStatus.ADD,
'medicalReport': model.medicalReportList[index],
'model': model,
});
}
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 8),
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : Colors.green[700],
widget: Column(
children: [
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
model.medicalReportList[index].status == 1
? TranslationBase.of(context).onHold
: TranslationBase.of(context).verified,
color: model.medicalReportList[index].status == 1
? Color(0xFFCC9B14)
: Colors.green[700],
fontSize: 1.4 * SizeConfig.textMultiplier,
bold: true,
),
AppText(
projectViewModel.isArabic
? model.medicalReportList[index].doctorNameN ?? ""
: model.medicalReportList[index].doctorName ?? "",
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
],
)),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
'${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}',
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
AppText(
'${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}',
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
fontSize: 1.5 * SizeConfig.textMultiplier,
),
],
), ),
], settings: RouteSettings(name: 'AddVerifyMedicalReport')),
), );
Row( } else {
crossAxisAlignment: CrossAxisAlignment.center, Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: {
children: [ 'patient': patient,
Container( 'patientType': patientType,
margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), 'arrivalType': arrivalType,
child: LargeAvatar( 'type': MedicalReportStatus.ADD,
name: projectViewModel.isArabic 'medicalReport': model.medicalReportList[index],
? model.medicalReportList[index].doctorNameN 'model': model,
: model.medicalReportList[index].doctorName, });
url: model.medicalReportList[index].doctorImageURL, }
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 8),
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : Colors.green[700],
widget: Column(
children: [
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
model.medicalReportList[index].status == 1
? TranslationBase.of(context).onHold
: TranslationBase.of(context).verified,
color: model.medicalReportList[index].status == 1
? Color(0xFFCC9B14)
: Colors.green[700],
fontSize: 1.4 * SizeConfig.textMultiplier,
bold: true,
), ),
width: 50, AppText(
height: 50, projectViewModel.isArabic
), ? model.medicalReportList[index].doctorNameN ?? ""
Expanded( : model.medicalReportList[index].doctorName ?? "",
child: Container( fontSize: 1.9 * SizeConfig.textMultiplier,
child: Column( fontWeight: FontWeight.w700,
crossAxisAlignment: CrossAxisAlignment.start, color: Color(0xFF2E303A),
children: [
AppText(
projectViewModel.isArabic
? model.medicalReportList[index].projectNameN
: model.medicalReportList[index].projectName,
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Color(0xFF2E303A),
),
AppText(
projectViewModel.isArabic
? model.medicalReportList[index].clinicNameN
: model.medicalReportList[index].clinicName,
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Color(0xFF2E303A),
),
],
),
), ),
],
)),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
'${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}',
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
AppText(
'${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}',
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
fontSize: 1.5 * SizeConfig.textMultiplier,
),
],
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0),
child: LargeAvatar(
name: projectViewModel.isArabic
? model.medicalReportList[index].doctorNameN
: model.medicalReportList[index].doctorName,
url: model.medicalReportList[index].doctorImageURL,
), ),
Container( width: 50,
height: 50, height: 50,
),
Expanded(
child: Container(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Icon( AppText(
model.medicalReportList[index].status == 1 ? DoctorApp.edit_1 : EvaIcons.eye, projectViewModel.isArabic
? model.medicalReportList[index].projectNameN
: model.medicalReportList[index].projectName,
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Color(0xFF2E303A),
),
AppText(
projectViewModel.isArabic
? model.medicalReportList[index].clinicNameN
: model.medicalReportList[index].clinicName,
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Color(0xFF2E303A),
), ),
], ],
), ),
) ),
], ),
), Container(
], height: 50,
), child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(
model.medicalReportList[index].status == 1 ? DoctorApp.edit_1 : EvaIcons.eye,
),
],
),
)
],
),
],
), ),
), ),
), ),
), ),
),
SizedBox( SizedBox(
height: 15, height: 15,
) )

@ -1,9 +1,11 @@
import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/note/update_note.dart'; import 'package:doctor_app_flutter/screens/patients/profile/note/update_note.dart';
@ -43,8 +45,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
AuthenticationViewModel authenticationViewModel; AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model, getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -59,10 +60,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2); languageID: 2);
model model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) {
.getPatientProgressNote(progressNoteRequest.toJson(),
isLocalBusy: isLocalBusy)
.then((c) {
notesList = model.patientProgressNoteList; notesList = model.patientProgressNoteList;
}); });
} }
@ -71,180 +69,121 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context); authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
final routeArgs = ModalRoute final routeArgs = ModalRoute.of(context).settings.arguments as Map;
.of(context)
.settings
.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient')) if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model), onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => builder: (_, model, w) => AppScaffold(
AppScaffold( baseViewModel: model,
baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
backgroundColor: Theme // appBarTitle: TranslationBase.of(context).progressNote,
.of(context) appBar: PatientProfileAppBar(
.scaffoldBackgroundColor, patient,
// appBarTitle: TranslationBase.of(context).progressNote, isInpatient: true,
appBar: PatientProfileAppBar( ),
patient, body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0
isInpatient: true, ? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoProgressNote)
), : Container(
body: model.patientProgressNoteList == null || color: Colors.grey[200],
model.patientProgressNoteList.length == 0 child: Column(
? DrAppEmbeddedError( children: <Widget>[
error: TranslationBase if (!isDischargedPatient)
.of(context) AddNewOrder(
.errorNoProgressNote) onTap: () async {
: Container( await locator<AnalyticsService>().logEvent(
color: Colors.grey[200], eventCategory: "Progress Note Screen",
child: Column( eventAction: "Update Progress Note",
children: <Widget>[ );
if (!isDischargedPatient) Navigator.push(
AddNewOrder( context,
onTap: () { MaterialPageRoute(
Navigator.push( builder: (context) => UpdateNoteOrder(
context, patientModel: model,
MaterialPageRoute( patient: patient,
builder: (context) => visitType: widget.visitType,
UpdateNoteOrder( isUpdate: false,
patientModel: model, ),
patient: patient, settings: RouteSettings(name: 'UpdateNoteOrder'),
visitType: widget.visitType, ),
isUpdate: false, );
),settings: RouteSettings(name: 'UpdateNoteOrder'),), },
); label: widget.visitType == 3
}, ? TranslationBase.of(context).addNewOrderSheet
label: widget.visitType == 3 : TranslationBase.of(context).addProgressNote,
? TranslationBase ),
.of(context) Expanded(
.addNewOrderSheet child: Container(
: TranslationBase child: ListView.builder(
.of(context) itemCount: model.patientProgressNoteList.length,
.addProgressNote, itemBuilder: (BuildContext ctxt, int index) {
), return FractionallySizedBox(
Expanded( widthFactor: 0.95,
child: Container( child: CardWithBgWidget(
child: ListView.builder( hasBorder: false,
itemCount: model.patientProgressNoteList.length, bgColor: model.patientProgressNoteList[index].status == 1 &&
itemBuilder: (BuildContext ctxt, int index) { authenticationViewModel.doctorProfile.doctorID !=
return FractionallySizedBox( model.patientProgressNoteList[index].createdBy
widthFactor: 0.95, ? Color(0xFFCC9B14)
child: CardWithBgWidget( : model.patientProgressNoteList[index].status == 4
hasBorder: false, ? Colors.red.shade700
bgColor: model.patientProgressNoteList[index] : model.patientProgressNoteList[index].status == 2
.status == ? Colors.green[600]
1 && : Color(0xFFCC9B14),
authenticationViewModel.doctorProfile.doctorID != widget: Column(
model children: [
.patientProgressNoteList[ Column(
index] crossAxisAlignment: CrossAxisAlignment.start,
.createdBy children: [
? Color(0xFFCC9B14) if (model.patientProgressNoteList[index].status == 1 &&
: model.patientProgressNoteList[index] authenticationViewModel.doctorProfile.doctorID !=
.status == model.patientProgressNoteList[index].createdBy)
4 AppText(
? Colors.red.shade700 TranslationBase.of(context).notePending,
: model.patientProgressNoteList[index] fontWeight: FontWeight.bold,
.status == color: Color(0xFFCC9B14),
2 fontSize: 12,
? Colors.green[600] ),
: Color(0xFFCC9B14), if (model.patientProgressNoteList[index].status == 4)
widget: Column(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
if (model
.patientProgressNoteList[
index]
.status ==
1 &&
authenticationViewModel
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy)
AppText(
TranslationBase
.of(context)
.notePending,
fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
),
if (model
.patientProgressNoteList[
index]
.status ==
4)
AppText( AppText(
TranslationBase TranslationBase.of(context).noteCanceled,
.of(context)
.noteCanceled,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.red.shade700, color: Colors.red.shade700,
fontSize: 12, fontSize: 12,
), ),
if (model if (model.patientProgressNoteList[index].status == 2)
.patientProgressNoteList[
index]
.status ==
2)
AppText( AppText(
TranslationBase TranslationBase.of(context).noteVerified,
.of(context)
.noteVerified,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.green[600], color: Colors.green[600],
fontSize: 12, fontSize: 12,
), ),
if (model.patientProgressNoteList[index].status != 2 && if (model.patientProgressNoteList[index].status != 2 &&
model model.patientProgressNoteList[index].status != 4 &&
.patientProgressNoteList[ authenticationViewModel.doctorProfile.doctorID ==
index] model.patientProgressNoteList[index].createdBy)
.status !=
4 &&
authenticationViewModel
.doctorProfile.doctorID ==
model
.patientProgressNoteList[
index]
.createdBy)
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) => UpdateNoteOrder(
UpdateNoteOrder( note: model.patientProgressNoteList[index],
note: model patientModel: model,
.patientProgressNoteList[ patient: patient,
index], visitType: widget.visitType,
patientModel:
model,
patient:
patient,
visitType: widget
.visitType,
isUpdate: true, isUpdate: true,
),settings: RouteSettings(name: 'UpdateNoteOrder'),), )),
); );
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[600], color: Colors.grey[600],
borderRadius: borderRadius: BorderRadius.circular(10),
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], // color:Colors.red[600],
@ -259,10 +198,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
TranslationBase TranslationBase.of(context).update,
.of(
context)
.update,
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -280,61 +216,33 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
context: context, context: context,
actionName: "verify", actionName: "verify",
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils GifLoaderDialogUtils.showMyDialog(context);
.showMyDialog( UpdateNoteReqModel reqModel = UpdateNoteReqModel(
context); admissionNo: int.parse(patient.admissionNo),
UpdateNoteReqModel cancelledNote: false,
reqModel = lineItemNo: model.patientProgressNoteList[index].lineItemNo,
UpdateNoteReqModel( createdBy: model.patientProgressNoteList[index].createdBy,
admissionNo: int notes: model.patientProgressNoteList[index].notes,
.parse(patient
.admissionNo),
cancelledNote:
false,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: true, verifiedNote: true,
patientTypeID: patientTypeID: patient.patientType,
patient
.patientType,
patientOutSA: false, patientOutSA: false,
); );
await model await model.updatePatientProgressNote(reqModel);
.updatePatientProgressNote( await getProgressNoteList(context, model, isLocalBusy: true);
reqModel); GifLoaderDialogUtils.hideDialog(context);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.green[600], color: Colors.green[600],
borderRadius: borderRadius: BorderRadius.circular(10),
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], // color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons FontAwesomeIcons.check,
.check,
size: 12, size: 12,
color: Colors.white, color: Colors.white,
), ),
@ -342,10 +250,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
TranslationBase TranslationBase.of(context).noteVerify,
.of(
context)
.noteVerify,
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -361,67 +266,37 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
onTap: () async { onTap: () async {
showMyDialog( showMyDialog(
context: context, context: context,
actionName: actionName: TranslationBase.of(context).cancel,
TranslationBase
.of(
context)
.cancel,
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils GifLoaderDialogUtils.showMyDialog(
.showMyDialog(
context, context,
); );
UpdateNoteReqModel UpdateNoteReqModel reqModel = UpdateNoteReqModel(
reqModel = admissionNo: int.parse(patient.admissionNo),
UpdateNoteReqModel(
admissionNo: int
.parse(patient
.admissionNo),
cancelledNote: true, cancelledNote: true,
lineItemNo: model lineItemNo: model.patientProgressNoteList[index].lineItemNo,
.patientProgressNoteList[ createdBy: model.patientProgressNoteList[index].createdBy,
index] notes: model.patientProgressNoteList[index].notes,
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: false, verifiedNote: false,
patientTypeID: patientTypeID: patient.patientType,
patient
.patientType,
patientOutSA: false, patientOutSA: false,
); );
await model await model.updatePatientProgressNote(reqModel);
.updatePatientProgressNote( await getProgressNoteList(context, model, isLocalBusy: true);
reqModel); GifLoaderDialogUtils.hideDialog(context);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red[600], color: Colors.red[600],
borderRadius: borderRadius: BorderRadius.circular(10),
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], // color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons FontAwesomeIcons.trash,
.trash,
size: 12, size: 12,
color: Colors.white, color: Colors.white,
), ),
@ -447,41 +322,25 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
height: 10, height: 10,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: MediaQuery.of(context) width: MediaQuery.of(context).size.width * 0.60,
.size
.width *
0.60,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
AppText( AppText(
TranslationBase TranslationBase.of(context).createdBy,
.of(
context)
.createdBy,
fontSize: 10, fontSize: 10,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model model.patientProgressNoteList[index].doctorName ?? '',
.patientProgressNoteList[ fontWeight: FontWeight.w600,
index]
.doctorName ??
'',
fontWeight:
FontWeight.w600,
fontSize: 12, fontSize: 12,
), ),
), ),
@ -493,85 +352,55 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Column( Column(
children: [ children: [
AppText( AppText(
model model.patientProgressNoteList[index].createdOn != null
.patientProgressNoteList[
index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted( ? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils AppDateUtils.getDateTimeFromServerFormat(
.getDateTimeFromServerFormat( model.patientProgressNoteList[index].createdOn),
model isArabic: projectViewModel.isArabic)
.patientProgressNoteList[ : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(),
index] isArabic: projectViewModel.isArabic),
.createdOn),
isArabic:
projectViewModel
.isArabic)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now(),
isArabic:
projectViewModel
.isArabic),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
model model.patientProgressNoteList[index].createdOn != null
.patientProgressNoteList[ ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(
index] model.patientProgressNoteList[index].createdOn))
.createdOn != : AppDateUtils.getHour(DateTime.now()),
null
? AppDateUtils.getHour(AppDateUtils
.getDateTimeFromServerFormat(
model
.patientProgressNoteList[
index]
.createdOn))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
], ],
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.end,
CrossAxisAlignment.end,
) )
], ],
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( Row(mainAxisAlignment: MainAxisAlignment.start, children: [
mainAxisAlignment: Expanded(
MainAxisAlignment.start, child: AppText(
children: [ model.patientProgressNoteList[index].notes,
Expanded( fontSize: 10,
child: AppText( ),
model ),
.patientProgressNoteList[ ])
index] ],
.notes, ),
fontSize: 10, SizedBox(
), height: 20,
), ),
]) ],
], ),
),
SizedBox(
height: 20,
),
],
), ),
), );
); }),
}), ),
), ),
), ],
], ),
), ),
),
), ),
); );
} }
@ -580,100 +409,92 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
showDialog( showDialog(
context: context, context: context,
builder: (ctx) => Center( builder: (ctx) => Center(
child: Container( child: Container(
width: MediaQuery width: MediaQuery.of(context).size.width * 0.8,
.of(context) height: 200,
.size child: AppScaffold(
.width * 0.8, isShowAppBar: false,
height: 200, body: Container(
child: AppScaffold( color: Colors.white,
isShowAppBar: false, child: Center(
body: Container( child: Column(
color: Colors.white,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// SizedBox(height: 20,),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
AppText( // SizedBox(height: 20,),
TranslationBase SizedBox(
.of(context) height: 10,
.noteConfirm, ),
fontWeight: FontWeight.w600, Row(
color: Colors.black, mainAxisAlignment: MainAxisAlignment.center,
fontSize: 16, children: [
AppText(
TranslationBase.of(context).noteConfirm,
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
),
],
),
SizedBox(
height: 10,
),
DividerWithSpacesAround(),
SizedBox(
height: 12,
), ),
],
),
SizedBox(
height: 10,
),
DividerWithSpacesAround(),
SizedBox(
height: 12,
),
Container( Container(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
color: Colors.white, color: Colors.white,
child: AppText( child: AppText(
projectViewModel.isArabic?"هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟":'Are you sure you want $actionName this order?', projectViewModel.isArabic
fontSize: 15, ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟"
textAlign: TextAlign.center, : 'Are you sure you want $actionName this order?',
), fontSize: 15,
), textAlign: TextAlign.center,
),
),
SizedBox( SizedBox(
height: 8, height: 8,
),
DividerWithSpacesAround(),
FractionallySizedBox(
widthFactor: 0.75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
child: AppText(
TranslationBase.of(context).cancel,
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Cancel"),
onPressed: () {
Navigator.of(context).pop();
}),
FlatButton(
child: AppText(
TranslationBase.of(context).noteConfirm,
fontWeight: FontWeight.w600,
color: Colors.red.shade700,
fontSize: 16,
), //Text("Confirm", ),
onPressed: () async {
await confirmFun();
Navigator.of(context).pop();
})
],
),
)
],
), ),
DividerWithSpacesAround(), ),
FractionallySizedBox(
widthFactor: 0.75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
child: AppText(
TranslationBase
.of(context)
.cancel,
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Cancel"),
onPressed: () {
Navigator.of(context).pop();
}),
FlatButton(
child: AppText(
TranslationBase
.of(context)
.noteConfirm,
fontWeight: FontWeight.w600,
color: Colors.red.shade700,
fontSize: 16,
), //Text("Confirm", ),
onPressed: () async {
await confirmFun();
Navigator.of(context).pop();
})
],
),
)
],
), ),
), ),
), ),
), ));
),
)
);
} }
} }

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
@ -232,6 +233,10 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
onPressed: () async { onPressed: () async {
if ((isFromLiveCare && patient.appointmentNo != null) || if ((isFromLiveCare && patient.appointmentNo != null) ||
patient.patientStatusType == 43) { patient.patientStatusType == 43) {
await locator<AnalyticsService>().logEvent(
eventCategory: "Patient Profile",
eventAction: "Create Episode",
);
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: int.parse(patient.appointmentNo.toString()), appointmentNo: int.parse(patient.appointmentNo.toString()),
patientMRN: patient.patientMRN); patientMRN: patient.patientMRN);
@ -264,7 +269,11 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
color: Colors.white, color: Colors.white,
height: 30, height: 30,
), ),
onPressed: () { onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Patient Profile ",
eventAction: "Update Episode",
);
if ((isFromLiveCare && if ((isFromLiveCare &&
patient.appointmentNo != null && patient.appointmentNo != null &&
patient.appointmentNo != 0) || patient.appointmentNo != 0) ||

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
@ -11,6 +12,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../../../locator.dart';
class RadiologyDetailsPage extends StatelessWidget { class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology; final FinalRadiology finalRadiology;
final PatiantInformtion patient; final PatiantInformtion patient;
@ -19,12 +22,7 @@ class RadiologyDetailsPage extends StatelessWidget {
final bool isInpatient; final bool isInpatient;
RadiologyDetailsPage( RadiologyDetailsPage(
{Key key, {Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false});
this.finalRadiology,
this.patient,
this.patientType,
this.arrivalType,
this.isInpatient = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,7 +34,7 @@ class RadiologyDetailsPage extends StatelessWidget {
invoiceNo: finalRadiology.invoiceNo), invoiceNo: finalRadiology.invoiceNo),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
appointmentDate: finalRadiology.orderDate, appointmentDate: finalRadiology.orderDate,
doctorName: finalRadiology.doctorName, doctorName: finalRadiology.doctorName,
clinic: finalRadiology.clinicDescription, clinic: finalRadiology.clinicDescription,
@ -44,7 +42,6 @@ class RadiologyDetailsPage extends StatelessWidget {
profileUrl: finalRadiology.doctorImageURL, profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology.invoiceNo.toString(), invoiceNO: finalRadiology.invoiceNo.toString(),
isAppointmentHeader: true, isAppointmentHeader: true,
), ),
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
@ -68,9 +65,11 @@ class RadiologyDetailsPage extends StatelessWidget {
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),), child: AppText(
TranslationBase.of(context).generalResult,
color: Color(0xff2E303A),
),
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText( child: AppText(
@ -94,13 +93,16 @@ class RadiologyDetailsPage extends StatelessWidget {
height: 80, height: 80,
width: double.maxFinite, width: double.maxFinite,
child: Container( child: Container(
margin: margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: SecondaryButton( child: SecondaryButton(
color: Color(0xffD02127), color: Color(0xffD02127),
disabled: finalRadiology.dIAPACSURL == "", disabled: finalRadiology.dIAPACSURL == "",
textColor: Color(0xffFFFFFF), textColor: Color(0xffFFFFFF),
onTap: () { onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "RadiologyDetailsPage",
eventAction: "Open Radiology Image",
);
launch(model.radImageURL); launch(model.radImageURL);
}, },
label: TranslationBase.of(context).openRad, label: TranslationBase.of(context).openRad,

@ -3,8 +3,10 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart'; import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -138,6 +140,10 @@ class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient>
Expanded( Expanded(
child: AppButton( child: AppButton(
onPressed: () async { onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Add Replay On Referral Patient",
eventAction: "Add Replay on Referral",
);
if (replayOnReferralController.text.isNotEmpty) { if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replayReferred( await widget.patientReferralViewModel.replayReferred(

@ -18,8 +18,7 @@ import 'package:flutter/material.dart';
class MyReferralDetailScreen extends StatelessWidget { class MyReferralDetailScreen extends StatelessWidget {
final MyReferralPatientModel referralPatient; final MyReferralPatientModel referralPatient;
const MyReferralDetailScreen({Key key, this.referralPatient}) const MyReferralDetailScreen({Key key, this.referralPatient}) : super(key: key);
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -54,8 +53,7 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
(Helpers.capitalize(referralPatient.firstName + " "+ (Helpers.capitalize(referralPatient.firstName + " " + referralPatient.lastName)),
referralPatient.lastName)),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -95,62 +93,48 @@ class MyReferralDetailScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
referralPatient.referralStatus != null referralPatient.referralStatus != null
? model.getReferralStatusNameByCode( ? model.getReferralStatusNameByCode(referralPatient.referralStatus, context)
referralPatient.referralStatus,
context)
: "", : "",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: referralPatient.referralStatus == 1 color: referralPatient.referralStatus == 1
? Color(0xffc4aa54) ? Color(0xffc4aa54)
: referralPatient.referralStatus == : referralPatient.referralStatus == 46 || referralPatient.referralStatus == 2
46 ||
referralPatient
.referralStatus ==
2
? Colors.green[700] ? Colors.green[700]
: Colors.red[700], : Colors.red[700],
), ),
AppText( AppText(
AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDayMonthYearDateFormatted(referralPatient.referralDate),
referralPatient.referralDate),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 2.0 * SizeConfig.textMultiplier,
2.0 * SizeConfig.textMultiplier,
color: Color(0XFF28353E), color: Color(0XFF28353E),
) )
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).fileNumber,
.fileNumber,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
"${referralPatient.patientID}", "${referralPatient.patientID}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: 1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -159,75 +143,56 @@ class MyReferralDetailScreen extends StatelessWidget {
AppDateUtils.getTimeHHMMA(referralPatient.referralDate), AppDateUtils.getTimeHHMMA(referralPatient.referralDate),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
) )
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).referredFrom,
.referredFrom,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
referralPatient.targetProjectId ==referralPatient.sourceProjectId referralPatient.targetProjectId == referralPatient.sourceProjectId
? TranslationBase.of( ? TranslationBase.of(context).sameBranch
context) : TranslationBase.of(context).otherBranch,
.sameBranch
: TranslationBase.of(
context)
.otherBranch,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * fontSize: 1.8 * SizeConfig.textMultiplier,
SizeConfig
.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).remarks + " : ",
.remarks +
" : ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referralPatient.referringDoctorRemarks?? referralPatient.referringDoctorRemarks ?? '',
'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * fontSize: 1.8 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -239,29 +204,22 @@ class MyReferralDetailScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
referralPatient.nationalityName != referralPatient.nationalityName != null
null
? referralPatient.nationalityName ? referralPatient.nationalityName
: "", : "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: fontSize: 1.4 * SizeConfig.textMultiplier,
1.4 * SizeConfig.textMultiplier,
), ),
referralPatient.nationalityFlagURL != referralPatient.nationalityFlagURL != null
null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referralPatient referralPatient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext errorBuilder:
context, (BuildContext context, Object exception, StackTrace stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -274,8 +232,7 @@ class MyReferralDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.only(left: 10, right: 0),
EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
'assets/images/patient/ic_ref_arrow_up.png', 'assets/images/patient/ic_ref_arrow_up.png',
height: 50, height: 50,
@ -283,20 +240,14 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
left: 0, padding: EdgeInsets.only(left: 4.0, right: 4.0),
top: 25,
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
child: Container( child: Container(
width: 40, width: 40,
height: 40, height: 40,
child: CircleAvatar( child: CircleAvatar(
radius: 25.0, radius: 25.0,
backgroundImage: NetworkImage( backgroundImage: NetworkImage(referralPatient.doctorImageURL),
referralPatient.doctorImageURL),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
), ),
), ),
@ -304,19 +255,14 @@ class MyReferralDetailScreen extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0),
left: 10,
top: 25,
right: 10,
bottom: 0),
child: Column( child: Column(
children: [ children: [
AppText( AppText(
referralPatient.doctorName, referralPatient.doctorName,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -347,8 +293,7 @@ class MyReferralDetailScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16), padding: const EdgeInsets.symmetric(horizontal: 16),
child: SizedBox( child: SizedBox(
child: ProfileMedicalInfoWidgetSearch( child: ProfileMedicalInfoWidgetSearch(
patient: model patient: model.getPatientFromReferralO(referralPatient),
.getPatientFromReferralO(referralPatient),
patientType: "7", patientType: "7",
isInpatient: false, isInpatient: false,
from: null, from: null,
@ -380,9 +325,7 @@ class MyReferralDetailScreen extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept);
TranslationBase.of(context)
.referralSuccessMsgAccept);
model.getMyReferralOutPatientService(); model.getMyReferralOutPatientService();
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
@ -407,9 +350,7 @@ class MyReferralDetailScreen extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject);
TranslationBase.of(context)
.referralSuccessMsgReject);
model.getMyReferralOutPatientService(); model.getMyReferralOutPatientService();
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
@ -21,8 +23,7 @@ import 'package:hexcolor/hexcolor.dart';
class PatientMakeReferralScreen extends StatefulWidget { class PatientMakeReferralScreen extends StatefulWidget {
// previous design page is: ReferPatientScreen // previous design page is: ReferPatientScreen
@override @override
_PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState();
_PatientMakeReferralScreenState();
} }
class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> { class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
@ -55,14 +56,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
referToList = List(); referToList = List();
dynamic sameBranch = { dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch};
"id": 1, dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch};
"name": TranslationBase.of(context).sameBranch
};
dynamic otherBranch = {
"id": 2,
"name": TranslationBase.of(context).otherBranch
};
referToList.add(sameBranch); referToList.add(sameBranch);
referToList.add(otherBranch); referToList.add(otherBranch);
@ -74,8 +69,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(patient),
patient),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
@ -109,57 +103,25 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.patientReferral.length == 0 model.patientReferral.length == 0
? referralForm(model, screenSize) ? referralForm(model, screenSize)
: PatientReferralItemWidget( : PatientReferralItemWidget(
referralStatus: model referralStatus: model.patientReferral[model.patientReferral.length - 1].referralStatus,
.patientReferral[ patientName: model.patientReferral[model.patientReferral.length - 1].patientName,
model.patientReferral.length - 1] patientGender:
.referralStatus, model.patientReferral[model.patientReferral.length - 1].patientDetails.gender,
patientName: model referredDate:
.patientReferral[ model.patientReferral[model.patientReferral.length - 1].referredOn.split(" ")[0],
model.patientReferral.length - 1] referredTime:
.patientName, model.patientReferral[model.patientReferral.length - 1].referredOn.split(" ")[1],
patientGender: model patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}",
.patientReferral[ isSameBranch:
model.patientReferral.length - 1] model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch,
.patientDetails
.gender,
referredDate: model
.patientReferral[
model.patientReferral.length - 1]
.referredOn
.split(" ")[0],
referredTime: model
.patientReferral[
model.patientReferral.length - 1]
.referredOn
.split(" ")[1],
patientID:
"${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: model
.patientReferral[
model.patientReferral.length - 1]
.isReferralDoctorSameBranch,
isReferral: true, isReferral: true,
remark: model remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource,
.patientReferral[ nationality:
model.patientReferral.length - 1] model.patientReferral[model.patientReferral.length - 1].patientDetails.nationalityName,
.remarksFromSource, nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl,
nationality: model doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl,
.patientReferral[ referralDoctorName:
model.patientReferral.length - 1] model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo,
.patientDetails
.nationalityName,
nationalityFlag: model
.patientReferral[
model.patientReferral.length - 1]
.nationalityFlagUrl,
doctorAvatar: model
.patientReferral[
model.patientReferral.length - 1]
.doctorImageUrl,
referralDoctorName: model
.patientReferral[
model.patientReferral.length - 1]
.referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
), ),
], ],
@ -171,29 +133,29 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
title: TranslationBase.of(context).refer, title: TranslationBase.of(context).refer,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: HexColor("#359846"), color: HexColor("#359846"),
onPressed: () { onPressed: () async {
setState(() { setState(() async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Refer Patient",
eventAction: "Submit Refer",
);
if (_referTo == null) { if (_referTo == null) {
branchError = branchError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
branchError = null; branchError = null;
} }
if (_selectedBranch == null) { if (_selectedBranch == null) {
hospitalError = hospitalError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
hospitalError = null; hospitalError = null;
} }
if (_selectedClinic == null) { if (_selectedClinic == null) {
clinicError = clinicError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
clinicError = null; clinicError = null;
} }
if (_selectedDoctor == null) { if (_selectedDoctor == null) {
doctorError = doctorError = TranslationBase.of(context).fieldRequired;
TranslationBase.of(context).fieldRequired;
} else { } else {
doctorError = null; doctorError = null;
} }
@ -204,16 +166,10 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedDoctor == null || _selectedDoctor == null ||
_remarksController.text == null) return; _remarksController.text == null) return;
model model
.makeReferral( .makeReferral(patient, appointmentDate.toIso8601String(), _selectedBranch['facilityId'],
patient, _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text)
appointmentDate.toIso8601String(),
_selectedBranch['facilityId'],
_selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'],
_remarksController.text)
.then((_) { .then((_) {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg);
TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context); Navigator.pop(context);
}); });
}, },
@ -259,8 +215,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model await model
.getClinics(_selectedBranch['facilityId']) .getClinics(_selectedBranch['facilityId'])
.then((_) => .then((_) => GifLoaderDialogUtils.hideDialog(context));
GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} }
@ -287,47 +242,42 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).hospital, hintText: TranslationBase.of(context).hospital,
dropDownText: _selectedBranch != null dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null,
? _selectedBranch['facilityName']
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: hospitalError, validationError: hospitalError,
onClick: model.branchesList != null && onClick:
model.branchesList.length > 0 && model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2
_referTo != null && ? () {
_referTo['id'] == 2 ListSelectDialog dialog = ListSelectDialog(
? () { list: model.branchesList,
ListSelectDialog dialog = ListSelectDialog( attributeName: 'facilityName',
list: model.branchesList, attributeValueId: 'facilityId',
attributeName: 'facilityName', okText: TranslationBase.of(context).ok,
attributeValueId: 'facilityId', okFunction: (selectedValue) {
okText: TranslationBase.of(context).ok, setState(() async {
okFunction: (selectedValue) { _selectedBranch = selectedValue;
setState(() async { _selectedClinic = null;
_selectedBranch = selectedValue; _selectedDoctor = null;
_selectedClinic = null; GifLoaderDialogUtils.showMyDialog(context);
_selectedDoctor = null; await model
GifLoaderDialogUtils.showMyDialog(context); .getClinics(_selectedBranch['facilityId'])
await model .then((_) => GifLoaderDialogUtils.hideDialog(context));
.getClinics(_selectedBranch['facilityId']) if (model.state == ViewState.ErrorLocal) {
.then((_) => DrAppToastMsg.showErrorToast(model.error);
GifLoaderDialogUtils.hideDialog(context)); }
if (model.state == ViewState.ErrorLocal) { });
DrAppToastMsg.showErrorToast(model.error); },
} );
}); showDialog(
}, barrierDismissible: false,
); context: context,
showDialog( builder: (BuildContext context) {
barrierDismissible: false, return dialog;
context: context, },
builder: (BuildContext context) { );
return dialog; }
}, : null,
);
}
: null,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -335,15 +285,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic, hintText: TranslationBase.of(context).clinic,
dropDownText: _selectedClinic != null dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null,
? _selectedClinic['ClinicDescription']
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: clinicError, validationError: clinicError,
onClick: _selectedBranch != null && onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0
model.clinicsList != null &&
model.clinicsList.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList, list: model.clinicsList,
@ -358,12 +304,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedClinic = selectedValue; _selectedClinic = selectedValue;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model await model
.getClinicDoctors( .getClinicDoctors(patient, _selectedClinic['ClinicID'], _selectedBranch['facilityId'])
patient, .then((_) => GifLoaderDialogUtils.hideDialog(context));
_selectedClinic['ClinicID'],
_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} }
@ -386,14 +328,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor, hintText: TranslationBase.of(context).doctor,
dropDownText: dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null,
_selectedDoctor != null ? _selectedDoctor['Name'] : null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: doctorError, validationError: doctorError,
onClick: _selectedClinic != null && onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0
model.doctorsList != null &&
model.doctorsList.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList, list: model.doctorsList,
@ -418,12 +357,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
} }
: () { : () {
if (_selectedClinic == null) { if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast("You need to select a clinic first");
"You need to select a clinic first"); } else if (model.doctorsList == null || model.doctorsList.length == 0) {
} else if (model.doctorsList == null || DrAppToastMsg.showErrorToast("There is no doctors for this clinic");
model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast(
"There is no doctors for this clinic");
} }
}, },
), ),
@ -433,9 +369,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).date, hintText: TranslationBase.of(context).date,
dropDownText: appointmentDate != null dropDownText:
? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" appointmentDate != null ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" : null,
: null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
suffixIcon: IconButton( suffixIcon: IconButton(

@ -1,7 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
@ -433,7 +435,8 @@ class ReferralPatientDetailScreen extends StatelessWidget {
], ],
), ),
), ),
if (referredPatient.referredDoctorRemarks!= null && referredPatient.referredDoctorRemarks.isNotEmpty) if (referredPatient.referredDoctorRemarks != null &&
referredPatient.referredDoctorRemarks.isNotEmpty)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0),
@ -486,13 +489,18 @@ class ReferralPatientDetailScreen extends StatelessWidget {
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
onPressed: () async { onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Referral Patient Detail",
eventAction: "Replay To Patient",
);
Navigator.push( Navigator.push(
context, context,
SlideUpPageRoute( SlideUpPageRoute(
widget: AddReplayOnReferralPatient( widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel, patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient, myReferralInPatientModel: referredPatient,
isEdited: referredPatient.referredDoctorRemarks!=null && referredPatient.referredDoctorRemarks.isNotEmpty, isEdited: referredPatient.referredDoctorRemarks != null &&
referredPatient.referredDoctorRemarks.isNotEmpty,
), ),
), ),
); );

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
@ -18,8 +20,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
int projectID; int projectID;
bool isNotOneAppointment; bool isNotOneAppointment;
VitalSignDetailsScreen( VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
{this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,14 +35,12 @@ class VitalSignDetailsScreen extends StatelessWidget {
String assetBasePath = "${imageBasePath}patient/vital_signs/"; String assetBasePath = "${imageBasePath}patient/vital_signs/";
return BaseView<VitalSignsViewModel>( return BaseView<VitalSignsViewModel>(
onModelReady: (model) => onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to, isInpatient),
model.getPatientVitalSignHistory(patient, from, to, isInpatient),
builder: (_, mode, widget) => AppScaffold( builder: (_, mode, widget) => AppScaffold(
baseViewModel: mode, baseViewModel: mode,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(patient),
patient),
appBarTitle: TranslationBase.of(context).vitalSign, appBarTitle: TranslationBase.of(context).vitalSign,
body: mode.patientVitalSignsHistory.length > 0 body: mode.patientVitalSignsHistory.length > 0
? Column( ? Column(
@ -57,7 +56,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s",
fontSize: SizeConfig.textMultiplier * 1.6, fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
@ -75,8 +74,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.23, height: MediaQuery.of(context).size.height * 0.23,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(12.0),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
horizontal: 16.0, vertical: 8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
color: Colors.white, color: Colors.white,
@ -100,17 +98,13 @@ class VitalSignDetailsScreen extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 1 mode.getBMIStatus() != 1
? '${assetBasePath}underweight_BMI.png' ? '${assetBasePath}underweight_BMI.png'
: '${assetBasePath}underweight_BMI-r.png', : '${assetBasePath}underweight_BMI-r.png',
height: MediaQuery.of(context) height: MediaQuery.of(context).size.height * 0.10,
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -118,38 +112,28 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).bmiUnderWeight}", "${TranslationBase.of(context).bmiUnderWeight}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.15,
SizeConfig.textMultiplier * 1.15, color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
AppText( AppText(
"(<18.5)", "(<18.5)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.15,
SizeConfig.textMultiplier * 1.15, color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null,
color: mode.getBMIStatus() == 1
? Color(0XFFD02127)
: null,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
], ],
)), )),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 2 mode.getBMIStatus() != 2
? '${assetBasePath}health_BMI.png' ? '${assetBasePath}health_BMI.png'
: '${assetBasePath}health_BMI-r.png', : '${assetBasePath}health_BMI-r.png',
height: MediaQuery.of(context) height: MediaQuery.of(context).size.height * 0.10,
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -158,40 +142,29 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText( child: AppText(
"${TranslationBase.of(context).normal}", "${TranslationBase.of(context).normal}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.15,
SizeConfig.textMultiplier *
1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2 color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null,
? Color(0XFFD02127)
: null,
), ),
), ),
AppText( AppText(
"(18.5-24.9)", "(18.5-24.9)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.15,
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 2 color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null,
? Color(0XFFD02127)
: null,
), ),
], ],
)), )),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 3 mode.getBMIStatus() != 3
? '${assetBasePath}ovrweight_BMI.png' ? '${assetBasePath}ovrweight_BMI.png'
: '${assetBasePath}ovrweight_BMI-r.png', : '${assetBasePath}ovrweight_BMI-r.png',
height: MediaQuery.of(context) height: MediaQuery.of(context).size.height * 0.10,
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -199,38 +172,28 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).bmiOverWeight}", "${TranslationBase.of(context).bmiOverWeight}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.155,
SizeConfig.textMultiplier * 1.155,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3 color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null,
? Color(0XFFD02127)
: null,
), ),
AppText( AppText(
"(25-29.9)", "(25-29.9)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.155,
SizeConfig.textMultiplier * 1.155,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 3 color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null,
? Color(0XFFD02127)
: null,
), ),
], ],
)), )),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 4 mode.getBMIStatus() != 4
? '${assetBasePath}Obese_BMI.png' ? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png', : '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context) height: MediaQuery.of(context).size.height * 0.10,
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -238,38 +201,28 @@ class VitalSignDetailsScreen extends StatelessWidget {
AppText( AppText(
"${TranslationBase.of(context).bmiObese}", "${TranslationBase.of(context).bmiObese}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.15,
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4 color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null,
? Color(0XFFD02127)
: null,
), ),
AppText( AppText(
"(30-34.9)", "(30-34.9)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.15,
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 4 color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null,
? Color(0XFFD02127)
: null,
), ),
], ],
)), )),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
mode.getBMIStatus() != 5 mode.getBMIStatus() != 5
? '${assetBasePath}Obese_BMI.png' ? '${assetBasePath}Obese_BMI.png'
: '${assetBasePath}Obese_BMI-r.png', : '${assetBasePath}Obese_BMI-r.png',
height: MediaQuery.of(context) height: MediaQuery.of(context).size.height * 0.10,
.size
.height *
0.10,
), ),
const SizedBox( const SizedBox(
height: 4, height: 4,
@ -279,24 +232,17 @@ class VitalSignDetailsScreen extends StatelessWidget {
child: AppText( child: AppText(
"${TranslationBase.of(context).bmiObeseExtreme}", "${TranslationBase.of(context).bmiObeseExtreme}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.15,
SizeConfig.textMultiplier *
1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5 color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null,
? Color(0XFFD02127)
: null,
), ),
), ),
AppText( AppText(
"(35<)", "(35<)",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: fontSize: SizeConfig.textMultiplier * 1.15,
SizeConfig.textMultiplier * 1.15,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: mode.getBMIStatus() == 5 color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null,
? Color(0XFFD02127)
: null,
), ),
], ],
)), )),
@ -308,11 +254,9 @@ class VitalSignDetailsScreen extends StatelessWidget {
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16),
horizontal: 16.0, vertical: 16),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
GridView.count( GridView.count(
shrinkWrap: true, shrinkWrap: true,
@ -326,16 +270,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: page: VitalSignItemDetailsScreen(
VitalSignItemDetailsScreen( pageKey: vitalSignDetails.Height,
pageKey: vitalSignDetails pageTitle: TranslationBase.of(context).height,
.Height, vitalList: mode.patientVitalSignsHistory,
pageTitle:
TranslationBase.of(
context)
.height,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -345,63 +283,51 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null, : null,
child: Container( child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context) des: TranslationBase.of(context).height,
.height, imagePath: "${assetBasePath}height.png",
imagePath:
"${assetBasePath}height.png",
lastVal: mode.heightCm, lastVal: mode.heightCm,
unit: TranslationBase.of(context) unit: TranslationBase.of(context).cm,
.cm,
), ),
), ),
), ),
InkWell( if (isNotOneAppointment)
onTap: () => isNotOneAppointment InkWell(
? Navigator.push( onTap: () async {
context, await locator<AnalyticsService>().logEvent(
FadePage( eventCategory: "Vital Sign Details Screen",
page: eventAction: "Vital Sign Details",
VitalSignItemDetailsScreen( );
pageKey: vitalSignDetails
.Weight, Navigator.push(
pageTitle: context,
TranslationBase.of( FadePage(
context) page: VitalSignItemDetailsScreen(
.weight, pageKey: vitalSignDetails.Weight,
vitalList: mode pageTitle: TranslationBase.of(context).weight,
.patientVitalSignsHistory, vitalList: mode.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
),
), ),
) ),
: null, );
child: VitalSignItem( },
des: TranslationBase.of(context) child: VitalSignItem(
.weight, des: TranslationBase.of(context).weight,
imagePath: imagePath: "${assetBasePath}weight.png",
"${assetBasePath}weight.png", unit: TranslationBase.of(context).kg,
unit: lastVal: mode.weightKg,
TranslationBase.of(context).kg, ),
lastVal: mode.weightKg,
), ),
),
InkWell( InkWell(
onTap: () => isNotOneAppointment onTap: () => isNotOneAppointment
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: page: VitalSignItemDetailsScreen(
VitalSignItemDetailsScreen( pageKey: vitalSignDetails.Temperature,
pageKey: vitalSignDetails pageTitle: TranslationBase.of(context).temperature,
.Temperature, vitalList: mode.patientVitalSignsHistory,
pageTitle:
TranslationBase.of(
context)
.temperature,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -411,13 +337,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
: null, : null,
child: Container( child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context) des: TranslationBase.of(context).temperature,
.temperature, imagePath: "${assetBasePath}temperature.png",
imagePath:
"${assetBasePath}temperature.png",
lastVal: mode.temperatureCelcius, lastVal: mode.temperatureCelcius,
unit: TranslationBase.of(context) unit: TranslationBase.of(context).tempC,
.tempC,
), ),
), ),
), ),
@ -426,16 +349,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: page: VitalSignItemDetailsScreen(
VitalSignItemDetailsScreen( pageKey: vitalSignDetails.heart,
pageKey: vitalSignDetails pageTitle: TranslationBase.of(context).heart,
.heart, vitalList: mode.patientVitalSignsHistory,
pageTitle:
TranslationBase.of(
context)
.heart,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -444,13 +361,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context) des: TranslationBase.of(context).heart,
.heart, imagePath: "${assetBasePath}heart_rate.png",
imagePath:
"${assetBasePath}heart_rate.png",
lastVal: mode.hartRat, lastVal: mode.hartRat,
unit: unit: TranslationBase.of(context).bpm,
TranslationBase.of(context).bpm,
), ),
), ),
InkWell( InkWell(
@ -458,16 +372,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: page: VitalSignItemDetailsScreen(
VitalSignItemDetailsScreen( pageKey: vitalSignDetails.Respiration,
pageKey: vitalSignDetails pageTitle: TranslationBase.of(context).respirationRate,
.Respiration, vitalList: mode.patientVitalSignsHistory,
pageTitle:
TranslationBase.of(
context)
.respirationRate,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -476,14 +384,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context) des: TranslationBase.of(context).respirationRate,
.respirationRate, imagePath: "${assetBasePath}respiration_rate.png",
imagePath: lastVal: mode.respirationBeatPerMinute,
"${assetBasePath}respiration_rate.png", unit: TranslationBase.of(context).respirationSigns,
lastVal:
mode.respirationBeatPerMinute,
unit: TranslationBase.of(context)
.respirationSigns,
), ),
), ),
InkWell( InkWell(
@ -491,16 +395,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: page: VitalSignItemDetailsScreen(
VitalSignItemDetailsScreen( pageKey: vitalSignDetails.BloodPressure,
pageKey: vitalSignDetails pageTitle: TranslationBase.of(context).bloodPressure,
.BloodPressure, vitalList: mode.patientVitalSignsHistory,
pageTitle:
TranslationBase.of(
context)
.bloodPressure,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -509,13 +407,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context) des: TranslationBase.of(context).bloodPressure,
.bloodPressure, imagePath: "${assetBasePath}blood_pressure.png",
imagePath:
"${assetBasePath}blood_pressure.png",
lastVal: mode.bloodPressure, lastVal: mode.bloodPressure,
unit: TranslationBase.of(context) unit: TranslationBase.of(context).sysDias,
.sysDias,
), ),
), ),
InkWell( InkWell(
@ -523,16 +418,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: page: VitalSignItemDetailsScreen(
VitalSignItemDetailsScreen( pageKey: vitalSignDetails.Oxygenation,
pageKey: vitalSignDetails pageTitle: TranslationBase.of(context).oxygenation,
.Oxygenation, vitalList: mode.patientVitalSignsHistory,
pageTitle:
TranslationBase.of(
context)
.oxygenation,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -541,10 +430,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context) des: TranslationBase.of(context).oxygenation,
.oxygenation, imagePath: "${assetBasePath}oxg.png",
imagePath:
"${assetBasePath}oxg.png",
lastVal: "${mode.oxygenation}%", lastVal: "${mode.oxygenation}%",
unit: "", unit: "",
), ),
@ -554,16 +441,10 @@ class VitalSignDetailsScreen extends StatelessWidget {
? Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(
page: page: VitalSignItemDetailsScreen(
VitalSignItemDetailsScreen( pageKey: vitalSignDetails.PainScale,
pageKey: vitalSignDetails pageTitle: TranslationBase.of(context).painScale,
.PainScale, vitalList: mode.patientVitalSignsHistory,
pageTitle:
TranslationBase.of(
context)
.painScale,
vitalList: mode
.patientVitalSignsHistory,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
@ -572,10 +453,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
) )
: null, : null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context) des: TranslationBase.of(context).painScale,
.painScale, imagePath: "${assetBasePath}painScale.png",
imagePath:
"${assetBasePath}painScale.png",
lastVal: mode.painScore, lastVal: mode.painScore,
unit: TranslationBase.of(context).severe, unit: TranslationBase.of(context).severe,
), ),
@ -588,19 +467,17 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
), ),
], ],
), ),
), ),
), ),
], ],
) )
: Container( : Container(
color: Theme color: Theme.of(context).scaffoldBackgroundColor,
.of(context) child: ErrorMessage(
.scaffoldBackgroundColor, error: TranslationBase.of(context).vitalSignEmptyMsg,
child: ErrorMessage(error: TranslationBase )),
.of(context)
.vitalSignEmptyMsg,)),
), ),
); );
} }
} }

@ -6,10 +6,12 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
@ -638,6 +640,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
title: TranslationBase.of(context).addMedication, title: TranslationBase.of(context).addMedication,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onPressed: () async { onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Add Prescription Form",
eventAction: "Add Prescription",
);
if (route != null && if (route != null &&
duration != null && duration != null &&
doseTime != null && doseTime != null &&

@ -1,7 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/add-procedure-page.dart'; import 'package:doctor_app_flutter/screens/procedures/add-procedure-page.dart';
@ -21,11 +23,10 @@ class ProcedureCheckOutScreen extends StatefulWidget {
final String toolbarTitle; final String toolbarTitle;
ProcedureCheckOutScreen( ProcedureCheckOutScreen(
{this.items, this.model, this.patient,@required this.addButtonTitle,@required this.toolbarTitle}); {this.items, this.model, this.patient, @required this.addButtonTitle, @required this.toolbarTitle});
@override @override
_ProcedureCheckOutScreenState createState() => _ProcedureCheckOutScreenState createState() => _ProcedureCheckOutScreenState();
_ProcedureCheckOutScreenState();
} }
class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> { class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
@ -36,8 +37,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold(
AppScaffold(
backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), backgroundColor: Color(0xffF8F8F8).withOpacity(0.9),
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
@ -82,10 +82,8 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
widget.items.length, widget.items.length,
(index) => Container( (index) => Container(
margin: EdgeInsets.only(bottom: 15.0), margin: EdgeInsets.only(bottom: 15.0),
decoration: BoxDecoration( decoration:
color: Colors.white, BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(10.0))),
borderRadius:
BorderRadius.all(Radius.circular(10.0))),
child: ExpansionTile( child: ExpansionTile(
initiallyExpanded: true, initiallyExpanded: true,
title: Row( title: Row(
@ -98,9 +96,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
SizedBox( SizedBox(
width: 6.0, width: 6.0,
), ),
Expanded( Expanded(child: AppText(widget.items[index].procedureName)),
child: AppText(
widget.items[index].procedureName)),
], ],
), ),
children: [ children: [
@ -113,11 +109,9 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
Row( Row(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: 11),
horizontal: 11),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).orderType,
.orderType,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xff2B353E), color: Color(0xff2B353E),
), ),
@ -129,14 +123,11 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
Radio( Radio(
activeColor: Color(0xFFD02127), activeColor: Color(0xFFD02127),
value: 0, value: 0,
groupValue: groupValue: widget.items[index].selectedType,
widget.items[index].selectedType,
onChanged: (value) { onChanged: (value) {
widget.items[index].selectedType = widget.items[index].selectedType = 0;
0;
setState(() { setState(() {
widget.items[index].type = widget.items[index].type = value.toString();
value.toString();
}); });
}, },
), ),
@ -147,15 +138,12 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
), ),
Radio( Radio(
activeColor: Color(0xFFD02127), activeColor: Color(0xFFD02127),
groupValue: groupValue: widget.items[index].selectedType,
widget.items[index].selectedType,
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {
widget.items[index].selectedType = widget.items[index].selectedType = 1;
1;
setState(() { setState(() {
widget.items[index].type = widget.items[index].type = value.toString();
value.toString();
}); });
}, },
), ),
@ -174,8 +162,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
height: 2.0, height: 2.0,
), ),
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 12, vertical: 15.0),
horizontal: 12, vertical: 15.0),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
controller: remarksController, controller: remarksController,
@ -222,11 +209,13 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
), ),
); );
}); });
await locator<AnalyticsService>().logEvent(
eventCategory: "Procedure Checkout Screen",
eventAction: "Add New Procedure",
);
Navigator.pop(context); Navigator.pop(context);
await model.preparePostProcedure( await model.preparePostProcedure(
entityList: entityList, entityList: entityList, patient: widget.patient, remarks: remarksController.text);
patient: widget.patient,
remarks: remarksController.text);
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
}, },

@ -2,8 +2,10 @@ import 'package:barcode_scan_fix/barcode_scan.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -61,7 +63,11 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
), ),
AppButton( AppButton(
title: TranslationBase.of(context).scanQr, title: TranslationBase.of(context).scanQr,
onPressed: () { onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "QrReaderScreen",
eventAction: "Scan QR",
);
_scanQrAndGetPatient(context, model); _scanQrAndGetPatient(context, model);
}, },
icon: Image.asset('assets/images/qr_code_white.png'), icon: Image.asset('assets/images/qr_code_white.png'),
@ -82,10 +88,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
int patientID = 0; int patientID = 0;
if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]);
PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel(
patientID: patientID,clinicID: 0, patientID: patientID, clinicID: 0, doctorID: 0, projectID: int.parse(listOfParams[0]));
doctorID: 0,
projectID: int.parse(listOfParams[0])
);
await model.getInPatientList(patientSearchRequestModel, isMyInpatient: false).then((d) { await model.getInPatientList(patientSearchRequestModel, isMyInpatient: false).then((d) {
if (model.state != ViewState.ErrorLocal) { if (model.state != ViewState.ErrorLocal) {

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
@ -20,23 +22,29 @@ class AddRescheduleLeavScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(
onModelReady: (model) => onModelReady: (model) => {model.getRescheduleLeave(), model.getCoveringDoctors()},
{model.getRescheduleLeave(), model.getCoveringDoctors()},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).rescheduleLeaves, appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column(children: [ child: Column(children: [
AddNewOrder( onTap: () { AddNewOrder(
openLeave( onTap: () async {
context, await locator<AnalyticsService>().logEvent(
false, eventCategory: "Add Reschedule"
); "Leave Screen",
},label: TranslationBase.of(context).applyForReschedule,), eventAction: "apply For Reschedule",
);
openLeave(
context,
false,
);
},
label: TranslationBase.of(context).applyForReschedule,
),
Column( Column(
children: model.getReschduleLeave children: model.getReschduleLeave.map<Widget>((GetRescheduleLeavesResponse item) {
.map<Widget>((GetRescheduleLeavesResponse item) {
return RoundedContainer( return RoundedContainer(
child: Column( child: Column(
children: [ children: [
@ -62,71 +70,55 @@ class AddRescheduleLeavScreen extends StatelessWidget {
child: Wrap( child: Wrap(
children: <Widget>[ children: <Widget>[
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
mainAxisAlignment: Container(
MainAxisAlignment.spaceBetween, padding: EdgeInsets.all(3),
children: [ margin: EdgeInsets.only(top: 10),
Container( child: AppText(
padding: EdgeInsets.all(3), item.statusDescription,
margin: fontWeight: FontWeight.bold,
EdgeInsets.only(top: 10), color: item.status == 10
child: AppText( ? Colors.red[800]
item.statusDescription, : item.status == 2
fontWeight: FontWeight.bold, ? HexColor('#CC9B14')
color: item.status == 10 : item.status == 9
? Colors.red[800] ? Colors.green
: item.status == 2 : Colors.red,
? HexColor('#CC9B14') fontSize: 14,
: item.status == 9 ),
? Colors.green ),
: Colors.red, Padding(
fontSize: 14, padding: EdgeInsets.only(top: 10),
), child: AppText(
), AppDateUtils.convertStringToDateFormat(
Padding( item.createdOn, 'yyyy-MM-dd HH:mm'),
padding: fontWeight: FontWeight.bold,
EdgeInsets.only(top: 10), ))
child: AppText( ]),
AppDateUtils
.convertStringToDateFormat(
item.createdOn,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
))
]),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Container( Container(
child: AppText( child: AppText(
item.requisitionType == 1 item.requisitionType == 1
? TranslationBase.of(context) ? TranslationBase.of(context).offTime
.offTime
: item.requisitionType == 2 : item.requisitionType == 2
? TranslationBase.of(context) ? TranslationBase.of(context).holiday
.holiday
: item.requisitionType == 3 : item.requisitionType == 3
? TranslationBase.of( ? TranslationBase.of(context).changeOfSchedule
context) : TranslationBase.of(context).newSchedule,
.changeOfSchedule
: TranslationBase.of(
context)
.newSchedule,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
)), )),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Row(children: [ Row(children: [
AppText(TranslationBase.of(context) AppText(TranslationBase.of(context).startDate),
.startDate),
AppText( AppText(
AppDateUtils.convertStringToDateFormat( AppDateUtils.convertStringToDateFormat(
item.dateTimeFrom, item.dateTimeFrom, 'yyyy-MM-dd HH:mm'),
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
@ -142,13 +134,10 @@ class AddRescheduleLeavScreen extends StatelessWidget {
), ),
Row( Row(
children: [ children: [
AppText(TranslationBase.of(context) AppText(TranslationBase.of(context).endDate),
.endDate),
AppText( AppText(
AppDateUtils AppDateUtils.convertStringToDateFormat(
.convertStringToDateFormat( item.dateTimeTo, 'yyyy-MM-dd HH:mm'),
item.dateTimeTo,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
], ],
@ -160,13 +149,10 @@ class AddRescheduleLeavScreen extends StatelessWidget {
model.coveringDoctors.length > 0 model.coveringDoctors.length > 0
? Row(children: [ ? Row(children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).coveringDoctor,
.coveringDoctor,
), ),
AppText( AppText(
getDoctor( getDoctor(model.coveringDoctors, item.coveringDoctorId),
model.coveringDoctors,
item.coveringDoctorId),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
]) ])
@ -176,28 +162,18 @@ class AddRescheduleLeavScreen extends StatelessWidget {
// .reasons, // .reasons,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
// ), // ),
Row( Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
mainAxisAlignment: Padding(
MainAxisAlignment.spaceBetween, padding: EdgeInsets.only(bottom: 5),
children: [ child: AppText(getReasons(model.allReasons, item.reasonId))),
Padding( (item.status == 2)
padding: EdgeInsets.only( ? IconButton(
bottom: 5), icon: Image.asset('assets/images/edit.png'),
child: AppText(getReasons( // color: Colors.green, //Colors.black,
model.allReasons, onPressed: () => {openLeave(context, true, extendedData: item)},
item.reasonId))), )
(item.status == 2) : SizedBox(),
? IconButton( ]),
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {
openLeave(context, true,
extendedData: item)
},
)
: SizedBox(),
]),
], ],
), ),
SizedBox( SizedBox(

@ -1,8 +1,10 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -64,7 +66,12 @@ class AddSickLeavScreen extends StatelessWidget {
], ],
)), )),
InkWell( InkWell(
onTap: () { onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Add Sick Leave Screen"
"Leave Screen",
eventAction: "apply For Sick Leave",
);
openSickLeave( openSickLeave(
context, context,
false, false,

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -11,8 +13,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget {
with PreferredSizeWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
@ -23,8 +24,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final Stream<String> videoCallDurationStream; final Stream<String> videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar( PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType,
this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false, this.videoCallDurationStream}); {this.height = 0.0,
this.isInpatient = false,
this.isDischargedPatient = false,
this.isFromLiveCare = false,
this.videoCallDurationStream});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -43,7 +48,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
height: height == 0 ? isInpatient? 215:200 : height, height: height == 0
? isInpatient
? 215
: 200
: height,
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(top: 50),
@ -60,10 +69,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
Expanded( Expanded(
child: AppText( child: AppText(
patient.firstName != null patient.firstName != null
? (Helpers.capitalize(patient.firstName) + ? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName))
" " + : Helpers.capitalize(patient.fullName ?? patient.patientDetails.fullName),
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.fullName??patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -81,7 +88,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 4), margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
onTap: () { onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Patient Profile Header",
eventAction: "Call Patient",
);
launch("tel://" + patient.mobileNumber); launch("tel://" + patient.mobileNumber);
}, },
child: Icon( child: Icon(
@ -93,14 +104,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
StreamBuilder( StreamBuilder(
stream: videoCallDurationStream, stream: videoCallDurationStream,
builder: (BuildContext context, AsyncSnapshot<String> snapshot) { builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
if(snapshot.hasData && snapshot.data != null) if (snapshot.hasData && snapshot.data != null)
return InkWell( return InkWell(
onTap: (){ onTap: () {},
},
child: Container( child: Container(
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text(snapshot.data, style: TextStyle(color: Colors.white),), child: Text(
snapshot.data,
style: TextStyle(color: Colors.white),
),
), ),
); );
else else
@ -116,9 +129,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
gender == 1 gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -130,8 +141,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SERVICES_PATIANT2[int.parse(patientType)] == SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList"
"patientArrivalList"
? Container( ? Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -151,19 +161,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1'|| patient.arrivedOn == null arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != null patient.startTime != null ? patient.startTime : '',
? patient.startTime
: '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )
: AppText( : AppText(
patient.arrivedOn != null patient.arrivedOn != null
? AppDateUtils.convertStringToDateFormat( ? AppDateUtils.convertStringToDateFormat(
patient.arrivedOn, patient.arrivedOn, 'MM-dd-yyyy HH:mm')
'MM-dd-yyyy HH:mm')
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -171,15 +178,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
], ],
)) ))
: SizedBox(), : SizedBox(),
if (SERVICES_PATIANT2[int.parse(patientType)] == if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" && !isFromLiveCare)
"List_MyOutPatient" && !isFromLiveCare)
Container( Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).appointmentDate + TranslationBase.of(context).appointmentDate + " : ",
" : ",
fontSize: 14, fontSize: 14,
), ),
patient.startTime != null patient.startTime != null
@ -191,7 +196,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
color: HexColor("#20A169"), color: HexColor("#20A169"),
), ),
child: AppText( child: AppText(
patient.startTime??"", patient.startTime ?? "",
color: Colors.white, color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -202,14 +207,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
SizedBox( SizedBox(
width: 3.5, width: 3.5,
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2( convertDateFormat2(patient.appointmentDate ?? ''),
patient.appointmentDate ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold,
),
), ),
),
SizedBox( SizedBox(
height: 0.5, height: 0.5,
) )
@ -224,27 +228,21 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
children: [ children: [
RichText( RichText(
text: TextSpan( text: TextSpan(
style: TextStyle( style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black),
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context).fileNumber, text: TranslationBase.of(context).fileNumber,
style: TextStyle( style: TextStyle(fontSize: 12, fontFamily: 'Poppins')),
fontSize: 12, fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
text: patient.patientId.toString(), text: patient.patientId.toString(),
style: TextStyle( style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 14)),
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 14)),
], ],
), ),
), ),
Row( Row(
children: [ children: [
AppText( AppText(
patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
@ -255,9 +253,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
patient.nationalityFlagURL, patient.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -275,19 +271,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(text: TranslationBase.of(context).age + " : ", style: TextStyle(fontSize: 14)),
text: TranslationBase.of(context).age+ " : ",
style: TextStyle(fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,isServerFormat: !isFromLiveCare)}", "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
style: TextStyle( style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14)),
fontWeight: FontWeight.w700, fontSize: 14)),
], ],
), ),
), ),
), ),
if(isInpatient) if (isInpatient)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -295,27 +288,22 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: fontSize: 2.0 * SizeConfig.textMultiplier,
2.0 * SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: patient.admissionDate == null text: patient.admissionDate == null
? "" ? ""
: TranslationBase.of(context) : TranslationBase.of(context).admissionDate + " : ",
.admissionDate + style: TextStyle(fontSize: 14)),
" : ", new TextSpan(
style: TextStyle(fontSize: 14)), text: patient.admissionDate == null
new TextSpan( ? ""
text: patient.admissionDate == null : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}",
? "" style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)),
: "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", ]))),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
]))),
if (patient.admissionDate != null) if (patient.admissionDate != null)
Row( Row(
children: [ children: [
@ -323,11 +311,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
"${TranslationBase.of(context).numOfDays}: ", "${TranslationBase.of(context).numOfDays}: ",
fontSize: 15, fontSize: 15,
), ),
if(isDischargedPatient && patient.dischargeDate!=null) if (isDischargedPatient && patient.dischargeDate != null)
AppText( AppText(
"${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w700) fontWeight: FontWeight.w700)
else else
AppText( AppText(
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
@ -356,8 +344,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final startIndex = str.indexOf(start); final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length); final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch( var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex)));
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() + newDate = date.year.toString() +
"/" + "/" +
date.month.toString().padLeft(2, '0') + date.month.toString().padLeft(2, '0') +
@ -365,13 +352,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
date.day.toString().padLeft(2, '0'); date.day.toString().padLeft(2, '0');
} }
return newDate??''; return newDate ?? '';
} }
isToday(date) { isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) == return DateFormat("yyyy-MM-dd").format(tempDate) == DateFormat("yyyy-MM-dd").format(DateTime.now());
DateFormat("yyyy-MM-dd").format(DateTime.now());
} }
myBoxDecoration() { myBoxDecoration() {

@ -1,51 +0,0 @@
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../config/size_config.dart';
import '../../shared/app_texts_widget.dart';
import '../../shared/rounded_container_widget.dart';
/*
*@author: Elham Rababah
*@Date:13/4/2020
*@param:
*@return: ProfileStatusInfoWidget
*@desc: Profile Status Info Widget
*/
class ProfileStatusInfoWidget extends StatelessWidget {
const ProfileStatusInfoWidget({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return RoundedContainer(
child: ListView(
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 14),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Insurance approval',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.w700,
color: HexColor('#58434F'),
),
AppText(
'Approved',
color: HexColor('#707070'),
fontSize: SizeConfig.textMultiplier * 2.5,
)
],
),
),
],
),
width: SizeConfig.screenWidth * 0.70,
height: SizeConfig.screenHeight * 0.12,
);
}
}

@ -657,7 +657,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -949,7 +949,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1147,5 +1147,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save