Merge branch 'referral_in_patient' into 'development'

Referral in patient

See merge request Cloud_Solution/doctor_app_flutter!610
merge-requests/609/merge
Mohammad Aljammal 5 years ago
commit a0fc64f2c9

@ -145,11 +145,11 @@ class BaseAppClient {
: SETUP_ID; : SETUP_ID;
} }
body['VersionID'] = 6.3; body['VersionID'] = 8.3;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = "10.20.10.20";
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA') body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] != null

@ -78,6 +78,8 @@ class VitalSignsService extends BaseService {
body['PatientTypeID'] = patient.patientType; body['PatientTypeID'] = patient.patientType;
// if(isInPatient){ // if(isInPatient){
body['InOutPatientType'] = 0; body['InOutPatientType'] = 0;
body['isDentalAllowedBackend'] = false;
body['IPAdress'] = "10.20.10.20";
// }else { // }else {
// body['InOutPatientType'] = 2; // body['InOutPatientType'] = 2;
// } // }

@ -59,10 +59,11 @@ class PrescriptionViewModel extends BaseViewModel {
getPrescriptionsInPatient(PatiantInformtion patient) async { getPrescriptionsInPatient(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
error="";
await _prescriptionsService.getPrescriptionInPatient( await _prescriptionsService.getPrescriptionInPatient(
mrn: patient.patientId, adn: patient.admissionNo); mrn: patient.patientId, adn: patient.admissionNo);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = "No Prescription Found";
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
_filterList(); _filterList();
@ -268,7 +269,7 @@ class PrescriptionViewModel extends BaseViewModel {
if (patientType == "7") if (patientType == "7")
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
else else
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else { } else {
_filterList(); _filterList();
await _getPrescriptionsOrders(); await _getPrescriptionsOrders();

@ -147,7 +147,7 @@ class ProcedureViewModel extends BaseViewModel {
if(patientType=="7") if(patientType=="7")
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
else else
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else { } else {
_radiologyService.finalRadiologyList.forEach((element) { _radiologyService.finalRadiologyList.forEach((element) {
List<FinalRadiologyList> finalRadiologyListClinic = List<FinalRadiologyList> finalRadiologyListClinic =

@ -62,7 +62,7 @@ class SickLeaveViewModel extends BaseViewModel {
await _sickLeaveService.getSickLeavePatient(patientMRN); await _sickLeaveService.getSickLeavePatient(patientMRN);
if (_sickLeaveService.hasError) { if (_sickLeaveService.hasError) {
error = _sickLeaveService.error; error = _sickLeaveService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -174,7 +174,7 @@ class PatiantInformtion {
genderDescription: json["GenderDescription"], genderDescription: json["GenderDescription"],
nursingStationName: json["NursingStationName"], nursingStationName: json["NursingStationName"],
appointmentDate: json["AppointmentDate"] ?? '', appointmentDate: json["AppointmentDate"] ?? '',
startTime: json["startTime"], startTime: json["startTime"]??json['StartTime'],
appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'],
appointmentType: json['appointmentType'], appointmentType: json['appointmentType'],
appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'], appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'],

@ -309,7 +309,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontSize: 14,fontWeight: FontWeight.w300, fontSize: 14,fontWeight: FontWeight.w300,
), ),
AppText( AppText(
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", "${DateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
], ],

@ -195,9 +195,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
DateUtils.convertDateFromServerFormat( "${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays+1}",
referredPatient.dischargeDate,
"dd MMM,yyyy"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize:

@ -125,78 +125,78 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Row( // Row(
mainAxisAlignment: MainAxisAlignment.end, // mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
InkWell( // InkWell(
child: this.showOther == false // child: this.showOther == false
? AppText( // ? AppText(
TranslationBase.of(context) // TranslationBase.of(context)
.searchWithOther, // .searchWithOther,
color: Colors.red, // color: Colors.red,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
) // )
: AppText( // : AppText(
TranslationBase.of(context) // TranslationBase.of(context)
.hideOtherCriteria, // .hideOtherCriteria,
color: Colors.red, // color: Colors.red,
fontWeight: FontWeight.bold), // fontWeight: FontWeight.bold),
onTap: () { // onTap: () {
setState(() { // setState(() {
this.showOther = !this.showOther; // this.showOther = !this.showOther;
}); // });
}, // },
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 30, // height: 30,
), // ),
if (showOther) // if (showOther)
Column( // Column(
children: [ // children: [
AppTextFieldCustom( // AppTextFieldCustom(
hintText: // hintText:
TranslationBase.of(context).firstName, // TranslationBase.of(context).firstName,
controller: firstNameInfoController, // controller: firstNameInfoController,
maxLines: 1, // maxLines: 1,
minLines: 1, // minLines: 1,
hasBorder: true, // hasBorder: true,
onChanged: (_) {}, // onChanged: (_) {},
// validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
), // ),
SizedBox( // SizedBox(
height: 10, // height: 10,
), // ),
AppTextFieldCustom( // AppTextFieldCustom(
hintText: // hintText:
TranslationBase.of(context).middleName, // TranslationBase.of(context).middleName,
controller: middleNameInfoController, // controller: middleNameInfoController,
maxLines: 1, // maxLines: 1,
minLines: 1, // minLines: 1,
onChanged: (_) {}, // onChanged: (_) {},
hasBorder: true, // hasBorder: true,
// validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
), // ),
SizedBox( // SizedBox(
height: 10, // height: 10,
), // ),
AppTextFieldCustom( // AppTextFieldCustom(
hintText: // hintText:
TranslationBase.of(context).lastName, // TranslationBase.of(context).lastName,
controller: lastNameFileInfoController, // controller: lastNameFileInfoController,
maxLines: 1, // maxLines: 1,
minLines: 1, // minLines: 1,
onChanged: (_) {}, // onChanged: (_) {},
hasBorder: true, // hasBorder: true,
// validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
), // ),
SizedBox( // SizedBox(
height: 10, // height: 10,
), // ),
], // ],
), // ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.12, height: MediaQuery.of(context).size.height * 0.12,
), ),

@ -160,7 +160,7 @@ class LineChartCurvedState extends State<LineChartCurved> {
), ),
minX: 0, minX: 0,
maxX: (widget.labResult.length - 1).toDouble(), maxX: (widget.labResult.length - 1).toDouble(),
maxY: getMaxY(), maxY: getMaxY()+2,
minY: getMinY(), minY: getMinY(),
lineBarsData: getData(), lineBarsData: getData(),
); );

@ -1,4 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_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/models/SOAP/PostEpisodeReqModel.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -7,6 +10,10 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../routes.dart'; import '../../../routes.dart';
@ -29,6 +36,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
String from; String from;
String to; String to;
TabController _tabController; TabController _tabController;
int index = 0;
int _activeTab = 0;
@override @override
void initState() { void initState() {
_tabController = TabController(length: 2,vsync:this); _tabController = TabController(length: 2,vsync:this);
@ -59,70 +68,123 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
isDischargedPatient = routeArgs['isDischargedPatient']; isDischargedPatient = routeArgs['isDischargedPatient'];
} }
if(isInpatient) if(isInpatient)
_tabController.index =0; _activeTab = 0;
else else
_tabController.index = 1; _activeTab = 1;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
builder: (_, patientViewModel, w) => AppScaffold( builder: (_, patientViewModel, w) => AppScaffold(
baseViewModel: patientViewModel, baseViewModel: patientViewModel,
appBarTitle: TranslationBase.of(context).patientProfile, appBarTitle: TranslationBase.of(context).patientProfile,
isShowAppBar: true, isShowAppBar: false,//TODO fix button location
appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,),
body: SingleChildScrollView( body: SingleChildScrollView(
child: isFromSearch ?Column( child: Container(
child: Column(
children: [
Stack(
children: [ children: [
DefaultTabController( PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?250:0,),
length: 2, if (patient.patientStatusType != null &&
initialIndex: isInpatient ? 0 : 1, patient.patientStatusType == 43)
child: SizedBox( BaseView<SOAPViewModel>(
height: MediaQuery.of(context).size.height * 1.0, onModelReady: (model) async {},
width: double.infinity, builder: (_, model, w) => Positioned(
child: Scaffold( top: 175,
appBar: AppBar( left: 20,
backgroundColor: Colors.white, right: 20,
automaticallyImplyLeading: false, child: Row(
toolbarHeight: 65, children: [
elevation: 0, Expanded(child: Container()),
bottom: TabBar( if (patient.episodeNo == 0)
controller: _tabController, AppButton(
indicator: BoxDecoration( title:
shape: BoxShape.rectangle, "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
borderRadius: BorderRadius.circular(10), // Creates border color: patient.patientStatusType == 43
color: Color(0xffD02126), ? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white,
vPadding: 8,
radius: 30,
hPadding: 20,
fontWeight: FontWeight.normal,
fontSize: 1.6,
icon: Image.asset(
"assets/images/create-episod.png",
color: Colors.white,
height: 30,
), ),
indicatorColor: Colors.red[500], onPressed: () async {
unselectedLabelColor: Color(0xff5A6168), if (patient.patientStatusType == 43) {
labelColor: Colors.white, PostEpisodeReqModel
tabs: <Widget>[ postEpisodeReqModel =
Container( PostEpisodeReqModel(
width: MediaQuery.of(context).size.width * 0.35, appointmentNo:
height: MediaQuery.of(context).size.height * 0.06, patient.appointmentNo,
child: Center( patientMRN:
child: Text('Inpatient Info'), patient.patientMRN);
GifLoaderDialogUtils.showMyDialog(
context);
await model.postEpisode(
postEpisodeReqModel);
GifLoaderDialogUtils.hideDialog(
context);
patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(
CREATE_EPISODE,
arguments: {
'patient': patient
});
}
},
), ),
if (patient.episodeNo != 0)
AppButton(
title:
"${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color: patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white,
vPadding: 8,
radius: 30,
hPadding: 20,
fontWeight: FontWeight.normal,
fontSize: 1.6,
icon: Image.asset(
"assets/images/modilfy-episode.png",
color: Colors.white,
height: 30,
), ),
Container( onPressed: () {
width: MediaQuery.of(context).size.width * 0.35, if (patient.patientStatusType ==
height: MediaQuery.of(context).size.height * 0.06, 43) {
child: Center( Navigator.of(context).pushNamed(
child: Text('OutPatient Info'), UPDATE_EPISODE,
), arguments: {
'patient': patient
});
}
}),
],
), ),
]), )),
],
), ),
body: Container( Container(
margin: EdgeInsets.only(top: 10), child: isFromSearch ?Column(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15),
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [ children: [
GridView.count(
tabsBar(context,screenSize),
SizedBox(height: 10,),
if(_activeTab==0)
Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15),
child: GridView.count(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10, crossAxisSpacing: 10,
@ -165,6 +227,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW, route: ORDER_PRESCRIPTION_NEW,
isSelectInpatient: _activeTab==0,
isInPatient: isInpatient, isInPatient: isInpatient,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
@ -224,6 +287,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
arrivalType: arrivalType, arrivalType: arrivalType,
route: REFER_IN_PATIENT_TO_DOCTOR, route: REFER_IN_PATIENT_TO_DOCTOR,
isInPatient: true, isInPatient: true,
isDisable: isDischargedPatient|| isFromSearch,
nameLine1: TranslationBase.of(context).referral, nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'), icon: 'patient/refer_patient.png'),
@ -257,8 +321,11 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
icon: 'patient/patient_sick_leave.png'), icon: 'patient/patient_sick_leave.png'),
], ],
), ),
),
GridView.count( if(_activeTab==1)
Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15),
child: GridView.count(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10, crossAxisSpacing: 10,
@ -399,16 +466,12 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
], ],
), ),
],
),
),
),
),
),
), ),
], ],
):isInpatient?GridView.count( ):isInpatient?
Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15),
child: GridView.count(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10, crossAxisSpacing: 10,
@ -451,6 +514,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW, route: ORDER_PRESCRIPTION_NEW,
isSelectInpatient :true,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'), icon: 'patient/order_prescription.png'),
@ -511,6 +575,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
arrivalType: arrivalType, arrivalType: arrivalType,
route: REFER_IN_PATIENT_TO_DOCTOR, route: REFER_IN_PATIENT_TO_DOCTOR,
isInPatient: true, isInPatient: true,
isDisable: isDischargedPatient|| isFromSearch,
nameLine1: TranslationBase.of(context).referral, nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'), icon: 'patient/refer_patient.png'),
@ -542,7 +607,13 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'), icon: 'patient/patient_sick_leave.png'),
], ],
):GridView.count( ),
):
Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15),
child: GridView.count(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10, crossAxisSpacing: 10,
@ -608,6 +679,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW, route: ORDER_PRESCRIPTION_NEW,
isSelectInpatient: false,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'), icon: 'patient/order_prescription.png'),
@ -684,8 +756,70 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>with SingleT
], ],
), ),
), ),
],
),
),
],
),
),
),
)); ));
} }
Widget tabsBar(
BuildContext context, Size screenSize ) {
List<String> _tabs = [
"Inpatient Info".toUpperCase(),
"Outpatient Info".toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _tabs.map((item) {
bool _isActive = _tabs[_activeTab] == item ? true : false;
return Expanded(
child: InkWell(
onTap: () async {
setState(() {
_activeTab = _tabs.indexOf(item);
});
},
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
_isActive
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
item,
fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
),
);
}).toList(),
),
);
}
} }
class AvatarWidget extends StatelessWidget { class AvatarWidget extends StatelessWidget {
@ -710,3 +844,5 @@ class AvatarWidget extends StatelessWidget {
); );
} }
} }

@ -1,6 +1,9 @@
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/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.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/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';
@ -11,11 +14,14 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class PatientMakeInPatientReferralScreen extends StatefulWidget { class PatientMakeInPatientReferralScreen extends StatefulWidget {
@override @override
_PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState createState() =>
@ -41,6 +47,76 @@ class _PatientMakeInPatientReferralScreenState
String clinicError; String clinicError;
String doctorError; String doctorError;
String frequencyError; String frequencyError;
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
@override
void initState() {
requestPermissions();
event.controller.stream.listen((p) {
if (p['startPopUp'] == 'true') {
if (this.mounted) {
initSpeechState().then((value) => {onVoiceText()});
}
}
});
super.initState();
}
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
listenMode: stt.ListenMode.confirmation,
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
);
} else {
print("The user has denied the use of speech recognition.");
}
}
void errorListener(SpeechRecognitionError error) {
event.setValue({"searchText": 'null'});
//SpeechToText.closeAlertDialog(context);
print(error);
}
void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
}
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
}
void resultListener(result) {
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speech.stop();
_remarksController.text = reconizedWord;
});
} else {
print(result.finalResult);
}
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -387,14 +463,31 @@ class _PatientMakeInPatientReferralScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Stack(
children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText:"Remarks",
TranslationBase.of(context).dietTypeRemarks,
controller: _remarksController, controller: _remarksController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
), ),
Positioned(
top: 0, //MediaQuery.of(context).size.height * 0,
right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
),
onPressed: () {
initSpeechState()
.then((value) => {onVoiceText()});
},
),
),
],
),
], ],
), ),
) )

@ -10,9 +10,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
final List<TimeSeriesSales2> timeSeries1; final List<TimeSeriesSales2> timeSeries1;
final List<TimeSeriesSales2> timeSeries2; final List<TimeSeriesSales2> timeSeries2;
final int indexes; final int indexes;
final bool isOX;
LineChartCurvedBloodPressure( LineChartCurvedBloodPressure(
{this.title, this.timeSeries1, this.indexes, this.timeSeries2}); {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false});
List<int> xAxixs = List(); List<int> xAxixs = List();
List<double> yAxixs = List(); List<double> yAxixs = List();
@ -79,7 +80,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
color: Theme.of(context).primaryColor), color: Theme.of(context).primaryColor),
), ),
SizedBox(width: 5,), SizedBox(width: 5,),
AppText(TranslationBase.of(context).systolicLng) AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng)
], ],
), ),
SizedBox(width: 15,), SizedBox(width: 15,),
@ -93,7 +94,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
color: Colors.red), color: Colors.red),
), ),
SizedBox(width: 5,), SizedBox(width: 5,),
AppText(TranslationBase.of(context).diastolicLng,) AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,)
], ],
), ),
], ],

@ -47,6 +47,7 @@ class VitalSingChartBloodPressure extends StatelessWidget {
borderRadius: BorderRadius.circular(12)), borderRadius: BorderRadius.circular(12)),
child: LineChartCurvedBloodPressure( child: LineChartCurvedBloodPressure(
title: name, title: name,
isOX: title2=="SAO2",
timeSeries1: timeSeriesData1, timeSeries1: timeSeriesData1,
timeSeries2: timeSeriesData2, timeSeries2: timeSeriesData2,
indexes: timeSeriesData1.length ~/ 5.5, indexes: timeSeriesData1.length ~/ 5.5,

@ -25,10 +25,11 @@ class PrescriptionsPage extends StatelessWidget {
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
bool isSelectInpatient = routeArgs['isSelectInpatient'];
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) => onModelReady: (model) =>
patient.admissionNo != null && patient.admissionNo != "0" isSelectInpatient
? model.getPrescriptionsInPatient(patient) ? model.getPrescriptionsInPatient(patient)
: model.getPrescriptions(patient, patientType: patientType), : model.getPrescriptions(patient, patientType: patientType),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(

@ -199,8 +199,11 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
// categoryName: procedureName.text); // categoryName: procedureName.text);
// }, // },
onClick: () { onClick: () {
if(procedureName.text.isNotEmpty && procedureName.text.length>=3)
model.getProcedureCategory( model.getProcedureCategory(
categoryName: procedureName.text); categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast('At least three Characters');
}, },
), ),
), ),
@ -209,8 +212,11 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
if(procedureName.text.isNotEmpty && procedureName.text.length>=3)
model.getProcedureCategory( model.getProcedureCategory(
categoryName: procedureName.text); categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast('At least three Characters');
}, },
child: Icon( child: Icon(
Icons.search, Icons.search,

@ -2,6 +2,8 @@ import 'dart:convert';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../shared/app_texts_widget.dart'; import '../shared/app_texts_widget.dart';
@ -62,7 +64,8 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Align( child: Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: AppText(widget.label)))) child: AppText(widget.label)))),
Icon(EvaIcons.eye)
], ],
), ),
), ),

@ -116,7 +116,7 @@ class PatientCard extends StatelessWidget {
fontSize: 12, fontSize: 12,
), ),
], ],
): !isFromSearch?Row( ): !isFromSearch && patientInfo.patientStatusType==null ? Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
@ -129,8 +129,8 @@ class PatientCard extends StatelessWidget {
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
SizedBox(width: 8,), SizedBox(width: 8,),
AppText( AppText(
patientInfo.status==2? 'Confirmed':'Booked', patientInfo.status==2? 'Booked':'Confirmed',
color: patientInfo.status==2? Colors.green:Colors.grey , color: patientInfo.status==2? Colors.grey:Colors.green ,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
@ -154,8 +154,9 @@ class PatientCard extends StatelessWidget {
) )
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
AppText( AppText(
DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,) //
)+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), // )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)),
" ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${patientInfo.startTime}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
):SizedBox() ):SizedBox()
@ -355,96 +356,7 @@ class PatientCard extends StatelessWidget {
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
], ],
), ),
// Container(
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: <Widget>[
// Expanded(
// child: AppText(
// TranslationBase.of(context).noOfDays +
// " : ",
// fontSize: 14,
// ),
// ),
// AppText(
// patientInfo.days,
// color: Colors.white,
// fontSize: 1.5 * SizeConfig.textMultiplier,
// textAlign: TextAlign.center,
// fontWeight: FontWeight.bold,
// ),
// SizedBox(
// height: 0.5,
// )
// ],
// ),
// margin: EdgeInsets.only(
// top: 8,
// ),
// ),
//if (SERVICES_PATIANT2[int.parse(patientType)] ==
// "List_MyOutPatient")
// Container(
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: <Widget>[
// AppText(
// TranslationBase.of(context)
// .appointmentDate +
// " : ",
// fontSize: 14,
// ),
// // Container(
// // child:
// patientInfo.appointmentDate != null
// ? AppText(
// DateUtils
// .convertDateFromServerFormat(
// patientInfo.appointmentDate
// .toString(),
// 'yyyy-MM-dd'),
// fontSize: 12,
// fontWeight: FontWeight.bold,
// )
// : SizedBox(),
// //),
// patientInfo.startTimes != null
// ?
// //
// // Container(
// // // height: 15,
// // // width: 60,
// // padding: EdgeInsets.all(5),
// // decoration: BoxDecoration(
// // borderRadius:
// // BorderRadius.circular(25),
// // color: HexColor("#20A169"),
// // ),
// // child:
// AppText(
// ' ' + patientInfo.startTimes,
// fontSize: 11,
// fontWeight: FontWeight.bold,
// )
// //)
// : SizedBox(),
// SizedBox(
// width: 3.5,
// ),
// //,
// SizedBox(
// height: 0.5,
// )
// ],
// ),
// margin: EdgeInsets.only(
// top: 8,
// ),
//)
])) ]))
]), ]),
!isInpatient && !isFromSearch !isInpatient && !isFromSearch

@ -21,6 +21,7 @@ class PatientProfileButton extends StatelessWidget {
final bool isLoading; final bool isLoading;
final Function onTap; final Function onTap;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isSelectInpatient;
PatientProfileButton( PatientProfileButton(
{Key key, {Key key,
this.patient, this.patient,
@ -35,7 +36,7 @@ class PatientProfileButton extends StatelessWidget {
this.isLoading = false, this.isLoading = false,
this.from, this.from,
this.to, this.to,
this.isInPatient = false, this.isDischargedPatient=false, this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false,
}) })
: super(key: key); : super(key: key);
@ -133,6 +134,7 @@ class PatientProfileButton extends StatelessWidget {
'arrivalType': arrivalType, 'arrivalType': arrivalType,
'isInpatient': isInPatient, 'isInpatient': isInPatient,
'isDischargedPatient': isDischargedPatient, 'isDischargedPatient': isDischargedPatient,
'isSelectInpatient': isSelectInpatient,
}); });
} }
} }

@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
height: height == 0 ? isInpatient? 210:200 : height, height: height == 0 ? isInpatient? 220: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,7 +60,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
" " + " " +
Helpers.capitalize(patient.lastName)) Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.patientDetails.fullName), : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.2, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),

Loading…
Cancel
Save