Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into search_out_patient

merge-requests/609/head
Elham Rababah 5 years ago
commit e06771a298

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

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

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

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

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

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

@ -309,7 +309,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontSize: 14,fontWeight: FontWeight.w300,
),
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,
fontWeight: FontWeight.w700),
],

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

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

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

File diff suppressed because it is too large Load Diff

@ -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/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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/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/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/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.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 {
@override
_PatientMakeInPatientReferralScreenState createState() =>
@ -41,6 +47,76 @@ class _PatientMakeInPatientReferralScreenState
String clinicError;
String doctorError;
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
Widget build(BuildContext context) {
@ -387,13 +463,30 @@ class _PatientMakeInPatientReferralScreenState
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).dietTypeRemarks,
controller: _remarksController,
inputType: TextInputType.multiline,
minLines: 4,
maxLines: 6,
Stack(
children: [
AppTextFieldCustom(
hintText:"Remarks",
controller: _remarksController,
inputType: TextInputType.multiline,
minLines: 4,
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> timeSeries2;
final int indexes;
final bool isOX;
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<double> yAxixs = List();
@ -79,7 +80,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
color: Theme.of(context).primaryColor),
),
SizedBox(width: 5,),
AppText(TranslationBase.of(context).systolicLng)
AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng)
],
),
SizedBox(width: 15,),
@ -93,7 +94,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
color: Colors.red),
),
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)),
child: LineChartCurvedBloodPressure(
title: name,
isOX: title2=="SAO2",
timeSeries1: timeSeriesData1,
timeSeries2: timeSeriesData2,
indexes: timeSeriesData1.length ~/ 5.5,

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

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

@ -2,6 +2,8 @@ import 'dart:convert';
import 'dart:typed_data';
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 '../shared/app_texts_widget.dart';
@ -62,7 +64,8 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
padding: EdgeInsets.all(5),
child: Align(
alignment: Alignment.centerLeft,
child: AppText(widget.label))))
child: AppText(widget.label)))),
Icon(EvaIcons.eye)
],
),
),

@ -116,7 +116,7 @@ class PatientCard extends StatelessWidget {
fontSize: 12,
),
],
): !isFromSearch?Row(
): !isFromSearch && patientInfo.patientStatusType==null ? Row(
children: [
AppText(
TranslationBase.of(context).notArrived,
@ -129,8 +129,8 @@ class PatientCard extends StatelessWidget {
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
SizedBox(width: 8,),
AppText(
patientInfo.status==2? 'Confirmed':'Booked',
color: patientInfo.status==2? Colors.green:Colors.grey ,
patientInfo.status==2? 'Booked':'Confirmed',
color: patientInfo.status==2? Colors.grey:Colors.green ,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
@ -154,8 +154,9 @@ class PatientCard extends StatelessWidget {
)
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
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',
fontWeight: FontWeight.w400,
):SizedBox()
@ -355,96 +356,7 @@ class PatientCard extends StatelessWidget {
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

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

@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
decoration: BoxDecoration(
color: Colors.white,
),
height: height == 0 ? isInpatient? 210:200 : height,
height: height == 0 ? isInpatient? 220:200 : height,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
@ -60,7 +60,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
" " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.2,
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),

Loading…
Cancel
Save