Merge branch 'development' into home-refactoring

# Conflicts:
#	lib/screens/home/home_screen.dart
merge-requests/648/head
mosazaid 5 years ago
commit 34a7c0b148

@ -322,4 +322,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
COCOAPODS: 1.10.0.rc.1 COCOAPODS: 1.10.1

@ -88,7 +88,6 @@ class BaseAppClient {
onFailure(Helpers.generateContactAdminMsg(), statusCode); onFailure(Helpers.generateContactAdminMsg(), statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']); parsed['AndroidLink'], parsed['IOSLink']);
@ -99,7 +98,7 @@ class BaseAppClient {
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
} else if (!isAllowAny) { } else if (!isAllowAny) {
await Helpers.logout(); await Helpers.logout();
Helpers.showErrorToast('Your session expired Please login agian'); Helpers.showErrorToast('Your session expired Please login again');
} }
if (isAllowAny) { if (isAllowAny) {
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);

@ -47,7 +47,7 @@ const Map<String, Map<String, String>> localizedValues = {
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'}, 'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'},
'inPatient': {'en': 'My InPatients', 'ar': 'مرضاي'}, 'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'},
'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'},
'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'},
'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'},

@ -44,7 +44,7 @@ class DischargedPatientService extends BaseService {
Future gtMyDischargeReferralPatient() async { Future gtMyDischargeReferralPatient() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
await getDoctorProfile(); await getDoctorProfile(isGetProfile: true);
body['DoctorID'] = doctorProfile.doctorID; body['DoctorID'] = doctorProfile.doctorID;
body['FirstName'] = "0"; body['FirstName'] = "0";
body['MiddleName'] = "0"; body['MiddleName'] = "0";

@ -48,6 +48,7 @@ class HomePatientCard extends StatelessWidget {
Container( Container(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Icon( Icon(
cardIcon, cardIcon,

@ -107,7 +107,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length),
tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient, counter: model.myIinPatientList.length), tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged),
], ],
), ),

@ -0,0 +1,8 @@
import 'package:flutter/cupertino.dart';
class MedicalReportPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}

@ -173,13 +173,12 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: progressNoteController.text.isNotEmpty? 130:70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap( child: Column(
alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
progressNoteController.text.isEmpty if(progressNoteController.text.isNotEmpty)
? SizedBox() Container(
: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).clearText, title: TranslationBase.of(context).clearText,

@ -22,7 +22,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
class AddReplayOnReferralPatient extends StatefulWidget { class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel; final MyReferralPatientModel myReferralInPatientModel;
//TODO Jammal
const AddReplayOnReferralPatient( const AddReplayOnReferralPatient(
{Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) {Key key, this.patientReferralViewModel, this.myReferralInPatientModel})
: super(key: key); : super(key: key);
@ -38,7 +38,7 @@ class _AddReplayOnReferralPatientState
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
var event = RobotProvider(); var event = RobotProvider();
TextEditingController progressNoteController = TextEditingController(); TextEditingController replayOnReferralController = TextEditingController();
@override @override
void initState() { void initState() {
requestPermissions(); requestPermissions();
@ -71,12 +71,12 @@ class _AddReplayOnReferralPatientState
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText: 'Replay your responses here', hintText: 'Replay your responses here',
controller: progressNoteController, controller: replayOnReferralController,
maxLines: 35, maxLines: 35,
minLines: 25, minLines: 25,
hasBorder: true, hasBorder: true,
validationError: validationError:
progressNoteController.text.isEmpty && replayOnReferralController.text.isEmpty &&
isSubmitted isSubmitted
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
@ -107,11 +107,11 @@ class _AddReplayOnReferralPatientState
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: replayOnReferralController.text.isNotEmpty? 130:70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap( child: Column(
alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
progressNoteController.text.isEmpty replayOnReferralController.text.isEmpty
? SizedBox() ? SizedBox()
: Container( : Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
@ -120,7 +120,7 @@ class _AddReplayOnReferralPatientState
title: TranslationBase.of(context).clearText, title: TranslationBase.of(context).clearText,
onPressed: () { onPressed: () {
setState(() { setState(() {
progressNoteController.text = ''; replayOnReferralController.text = '';
}); });
}, },
)), )),
@ -135,10 +135,10 @@ class _AddReplayOnReferralPatientState
setState(() { setState(() {
isSubmitted = true; isSubmitted = true;
}); });
if (progressNoteController.text.isNotEmpty) { if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replay( await widget.patientReferralViewModel.replay(
progressNoteController.text.trim(), replayOnReferralController.text.trim(),
widget.myReferralInPatientModel); widget.myReferralInPatientModel);
if (widget.patientReferralViewModel.state == if (widget.patientReferralViewModel.state ==
ViewState.ErrorLocal) { ViewState.ErrorLocal) {
@ -199,7 +199,7 @@ class _AddReplayOnReferralPatientState
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
progressNoteController.text += reconizedWord + '\n'; replayOnReferralController.text += reconizedWord + '\n';
}); });
} }
} }

@ -385,8 +385,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
true; true;
visbiltySearch = false; visbiltySearch = false;
_selectedMedication = _selectedMedication =
model.allMedicationList[ model.allMedicationList[index];
index];
uom = _selectedMedication uom = _selectedMedication
.uom; .uom;
}, },
@ -406,6 +405,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
AppText(_selectedMedication?.description??"",bold: true,),
Container( Container(
child: Row( child: Row(
children: [ children: [
@ -435,10 +436,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Row( child: Row(
children: [ children: [
Container( Container(
width: MediaQuery.of(context) width: MediaQuery.of(context).size.width * 0.35,
.size
.width *
0.550,
child: TextFields( child: TextFields(
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter( LengthLimitingTextInputFormatter(
@ -447,9 +445,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// .digitsOnly // .digitsOnly
], ],
hintText: hintText:
TranslationBase.of( TranslationBase.of(context).strength,
context)
.strength,
controller: controller:
strengthController, strengthController,
keyboardType: TextInputType keyboardType: TextInputType
@ -513,7 +509,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
0.350, 0.450,
child: InkWell( child: InkWell(
onTap: onTap:
model.itemMedicineListUnit != model.itemMedicineListUnit !=
@ -560,21 +556,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: decoration:
textFieldSelectorDecoration( textFieldSelectorDecoration('Select',
TranslationBase.of(
context) model.itemMedicineListUnit.length == 1
.unit, ? units = model.itemMedicineListUnit[0]['description']
model.itemMedicineListUnit : units != null ? units['description'].toString() : null,
.length ==
1
? model.itemMedicineListUnit[
0][
'description']
: units !=
null
? units[
'description']
: null,
true), true),
enabled: false), enabled: false),
), ),
@ -640,10 +626,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of( TranslationBase.of(
context) context)
.route, .route,
route != null model.itemMedicineListRoute
? route[ .length ==
'description'] 1
: null, ? model.itemMedicineListRoute[
0]
['description']
: route != null
? route[
'description']
: null,
true), true),
enabled: false, enabled: false,
), ),
@ -725,10 +717,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of( TranslationBase.of(
context) context)
.frequency, .frequency,
frequency != null model.itemMedicineList
? frequency[ .length ==
'description'] 1
: null, ? model.itemMedicineList[
0]
['description']
: frequency != null
? frequency[
'description']
: null,
true), true),
enabled: false, enabled: false,
), ),
@ -1138,12 +1136,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
formKey.currentState.save(); formKey.currentState.save();
// Navigator.pop(context); // Navigator.pop(context);
// openDrugToDrug(); // openDrugToDrug();
if (route == null || if (frequency == null ||
frequency == null || strengthController
.text ==
"" ||
doseTime == null || doseTime == null ||
duration == null || duration == null ||
selectedDate == null || selectedDate == null) {
units == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of( TranslationBase.of(
context) context)
@ -1206,27 +1205,48 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// // .trim()) // // .trim())
// // .toList() // // .toList()
// // .join(' '), // // .join(' '),
// dose: // dose: strengthController
// strengthController // .text,
// .text, // doseUnit: model
// doseUnit: units[ // .itemMedicineListUnit
// 'parameterCode'] // .length ==
// .toString(), // 1
// patient: // ? model
// widget.patient, // .itemMedicineListUnit[
// 0][
// 'parameterCode']
// .toString()
// : units['parameterCode']
// .toString(),
// patient: widget.patient,
// doseTimeIn: // doseTimeIn:
// doseTime['id'] // doseTime['id']
// .toString(), // .toString(),
// model: widget.model, // model: widget.model,
// duration: // duration: duration['id']
// duration['id']
// .toString(),
// frequency: frequency[
// 'parameterCode']
// .toString(),
// route: route[
// 'parameterCode']
// .toString(), // .toString(),
// frequency: model
// .itemMedicineList
// .length ==
// 1
// ? model
// .itemMedicineList[
// 0][
// 'parameterCode']
// .toString()
// : frequency[
// 'parameterCode']
// .toString(),
// route: model.itemMedicineListRoute
// .length ==
// 1
// ? model
// .itemMedicineListRoute[
// 0][
// 'parameterCode']
// .toString()
// : route['parameterCode']
// .toString(),
// drugId: // drugId:
// _selectedMedication // _selectedMedication
// .itemId // .itemId
@ -1240,8 +1260,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// instruction: // instruction:
// instructionController // instructionController
// .text, // .text,
// doseTime: // doseTime: selectedDate,
// selectedDate,
// ); // );
} }
} }
@ -1350,7 +1369,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
children: [ children: [
DrugToDrug( DrugToDrug(
widget.patient, widget.patient,
getPriscriptionforDrug(widget.prescriptionList), getPriscriptionforDrug(widget.prescriptionList, model),
model.patientAssessmentList), model.patientAssessmentList),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3),
@ -1382,8 +1401,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
doseTimeIn: doseTime['id'].toString(), doseTimeIn: doseTime['id'].toString(),
model: widget.model, model: widget.model,
duration: duration['id'].toString(), duration: duration['id'].toString(),
frequency: frequency['parameterCode'].toString(), frequency: model.itemMedicineList.length == 1
route: route['parameterCode'].toString(), ? model.itemMedicineList[0]['parameterCode']
: frequency['parameterCode'].toString(),
route: model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode']
: route['parameterCode'].toString(),
drugId: _selectedMedication.itemId.toString(), drugId: _selectedMedication.itemId.toString(),
strength: strengthController.text, strength: strengthController.text,
indication: indicationController.text, indication: indicationController.text,
@ -1431,7 +1454,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}); });
} }
getPriscriptionforDrug(List<PrescriptionModel> prescriptionList) { // selectedValue(itemMdeicationList,key){
// // String selected = "";
// // units[key]=itemMdeicationList.length==1? itemMdeicationList[0][key]:units[key].toString();
// //
// // selected = units[key];
// //
// // return selected;
// // }
getPriscriptionforDrug(
List<PrescriptionModel> prescriptionList, MedicineViewModel model) {
var prescriptionDetails = []; var prescriptionDetails = [];
if (prescriptionList.length > 0) { if (prescriptionList.length > 0) {
prescriptionList[0].entityList.forEach((element) { prescriptionList[0].entityList.forEach((element) {
@ -1455,11 +1488,19 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
'DrugId': _selectedMedication.mediSpanGPICode, 'DrugId': _selectedMedication.mediSpanGPICode,
'DrugName': _selectedMedication.description, 'DrugName': _selectedMedication.description,
'Dose': strengthController.text, 'Dose': strengthController.text,
'DoseType': units['parameterCode'].toString(), 'DoseType': model.itemMedicineListUnit.length == 1
'Unit': units['description'], ? model.itemMedicineListUnit[0]['parameterCode'].toString()
'FrequencyType': frequency['parameterCode'].toString(), : units['parameterCode'].toString(),
'Unit': model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]['description']
: units['description'],
'FrequencyType': model.itemMedicineList.length == 1
? model.itemMedicineList[0]['parameterCode']
: frequency['parameterCode'].toString(),
'Duration': duration['id'].toString(), 'Duration': duration['id'].toString(),
'RouteID': route['parameterCode'].toString(), 'RouteID': model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode'].toString()
: route['parameterCode'].toString(),
'IsScreen': true 'IsScreen': true
}); });
} }

@ -10,7 +10,7 @@ class GetActivityButton extends StatelessWidget {
width: 120, width: 120,
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
height: 120, height: 130,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
@ -22,7 +22,7 @@ class GetActivityButton extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: AppText(value.value.toString(), child: AppText(value.value.toString(),
fontSize: 28, fontWeight: FontWeight.bold)), fontSize: 30, fontWeight: FontWeight.bold)),
Expanded( Expanded(
child: AppText( child: AppText(
value.kPIParameter, value.kPIParameter,

@ -303,7 +303,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
"${TranslationBase.of(context).numOfDays}: ", "${TranslationBase.of(context).numOfDays}: ",
fontSize: 15, fontSize: 15,
), ),
if(isDischargedPatient) if(isDischargedPatient && patient.dischargeDate!=null)
AppText( AppText(
"${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", "${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 15, fontSize: 15,

@ -573,7 +573,7 @@ packages:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.2" version: "0.6.3-nullsafety.1"
json_annotation: json_annotation:
dependency: transitive dependency: transitive
description: description:
@ -615,7 +615,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:
@ -907,7 +907,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:
@ -1098,5 +1098,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