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

merge-requests/862/head
Elham Rababh 4 years ago
commit 469556758b

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_Li
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
class InPatientHeader extends StatelessWidget with PreferredSizeWidget {
@ -52,70 +53,71 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget {
activeTab != 2)
Container(
width: MediaQuery.of(context).size.width * .3,
child: DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
isExpanded: true,
value: selectedMapId == null
? model.specialClinicalCareMappingList[0].nursingStationID
: selectedMapId,
iconSize: 25,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return model.specialClinicalCareMappingList.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(2),
margin: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: Colors.red[800],
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: Center(
child: AppText(
model.specialClinicalCareMappingList.length
.toString(),
color: Colors.white,
fontSize:
projectsProvider.isArabic ? 10 : 11,
textAlign: TextAlign.center,
),
)),
],
),
AppText(item.description,
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.bold,
textAlign: TextAlign.end),
],
);
}).toList();
},
onChanged: (newValue) async {
onChangeFunc(newValue);
},
items: model.specialClinicalCareMappingList.map((item) {
return DropdownMenuItem(
child: AppText(
item.description,
textAlign: TextAlign.left,
),
value: item.nursingStationID,
);
}).toList(),
)),
child
: DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
isExpanded: true,
value: selectedMapId??model.specialClinicalCareMappingList[0].nursingStationID,
iconSize: 25,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return model.specialClinicalCareMappingList.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(2),
margin: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: Colors.red[800],
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: Center(
child: AppText(
model.specialClinicalCareMappingList
.length
.toString(),
color: Colors.white,
fontSize: projectsProvider.isArabic
? 10
: 11,
textAlign: TextAlign.center,
),
)),
],
),
AppText(selectedMapId == null?TranslationBase.of(context).all:item.description,
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.bold,
textAlign: TextAlign.end),
],
);
}).toList();
},
onChanged: (newValue) async {
onChangeFunc(newValue);
},
items: model.specialClinicalCareMappingList.map((item) {
return DropdownMenuItem(
child: AppText(
item.description,
textAlign: TextAlign.left,
),
value: item.nursingStationID,
);
}).toList(),
)),
),
]),
),

@ -70,8 +70,8 @@ class _InPatientScreenState extends State<InPatientScreen>
if (widget.specialClinic != null) {
await model
.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID);
requestModel.nursingStationID =
model.specialClinicalCareMappingList[0].nursingStationID;
// requestModel.nursingStationID =
// model.specialClinicalCareMappingList[0].nursingStationID;
}
requestModel.clinicID = 0;
await model.getInPatientList(requestModel);

@ -166,8 +166,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
index]
.createdBy)
AppText(
TranslationBase.of(context)
.notePending,
fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
@ -472,6 +474,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
fontWeight:
FontWeight.w600,
fontSize: 12,
isCopyable:true,
),
),
],
@ -505,6 +508,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.isArabic),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable:true,
),
AppText(
model
@ -522,6 +526,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable:true,
),
],
crossAxisAlignment:
@ -543,6 +548,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
index]
.notes,
fontSize: 10,
isCopyable:true,
),
),
])

@ -25,10 +25,12 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
class PatientMakeInPatientReferralScreen extends StatefulWidget {
@override
_PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState();
_PatientMakeInPatientReferralScreenState createState() =>
_PatientMakeInPatientReferralScreenState();
}
class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatientReferralScreen> {
class _PatientMakeInPatientReferralScreenState
extends State<PatientMakeInPatientReferralScreen> {
PatiantInformtion patient;
List<dynamic> referToList;
dynamic _referTo;
@ -66,7 +68,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
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);
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
@ -110,7 +113,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
@ -123,8 +127,14 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
referToList = List();
dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch};
dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch};
dynamic sameBranch = {
"id": 1,
"name": TranslationBase.of(context).sameBranch
};
dynamic otherBranch = {
"id": 2,
"name": TranslationBase.of(context).otherBranch
};
referToList.add(sameBranch);
referToList.add(otherBranch);
@ -176,7 +186,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).branch,
dropDownText: _referTo != null ? _referTo['name'] : null,
dropDownText:
_referTo != null ? _referTo['name'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: branchError,
@ -193,15 +204,23 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
model.getDoctorBranch().then((value) async {
model
.getDoctorBranch()
.then((value) async {
_selectedBranch = value;
if (_referTo['id'] == 1) {
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinics(_selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
.getClinics(_selectedBranch[
'facilityId'])
.then((_) =>
GifLoaderDialogUtils
.hideDialog(context));
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
} else {
_selectedBranch = null;
@ -226,7 +245,9 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).hospital,
dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null,
dropDownText: _selectedBranch != null
? _selectedBranch['facilityName']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: hospitalError,
@ -245,12 +266,17 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinics(_selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
.getClinics(
_selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils
.hideDialog(context));
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
});
},
@ -271,7 +297,9 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic,
dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null,
dropDownText: _selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: clinicError,
@ -284,19 +312,27 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
usingSearch: true,
hintSearchText: TranslationBase.of(context).clinicSearch,
hintSearchText:
TranslationBase.of(context)
.clinicSearch,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() async {
_selectedDoctor = null;
_selectedClinic = selectedValue;
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinicDoctors(
patient, _selectedClinic['ClinicID'], _selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
patient,
_selectedClinic['ClinicID'],
_selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils
.hideDialog(context));
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
});
},
@ -317,41 +353,49 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor,
dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null,
dropDownText: _selectedDoctor != null
? _selectedDoctor['Name']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: doctorError,
onClick:
_selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'Name',
attributeValueId: 'DoctorID',
usingSearch: true,
hintSearchText: TranslationBase.of(context).doctorSearch,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {
if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast("You need to select a clinic first");
} else if (model.doctorsList == null || model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast("There is no doctors for this clinic");
}
onClick: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'Name',
attributeValueId: 'DoctorID',
usingSearch: true,
hintSearchText:
TranslationBase.of(context)
.doctorSearch,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {
if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast(
"You need to select a clinic first");
} else if (model.doctorsList == null ||
model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast(
"There is no doctors for this clinic");
}
},
),
SizedBox(
height: 10,
@ -379,8 +423,11 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).referralFrequency,
dropDownText: _selectedFrequency != null ? _selectedFrequency['Description'] : null,
hintText:
TranslationBase.of(context).referralFrequency,
dropDownText: _selectedFrequency != null
? _selectedFrequency['Description']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: frequencyError,
@ -390,7 +437,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
attributeName: 'Description',
attributeValueId: 'ParameterCode',
usingSearch: true,
hintSearchText: TranslationBase.of(context).selectReferralFrequency,
hintSearchText: TranslationBase.of(context)
.selectReferralFrequency,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
@ -428,7 +476,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
maxLines: 6,
),
Positioned(
top: 0, //MediaQuery.of(context).size.height * 0,
top: 0,
//MediaQuery.of(context).size.height * 0,
right: 15,
child: IconButton(
icon: Icon(
@ -437,7 +486,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
size: 35,
),
onPressed: () {
initSpeechState().then((value) => {onVoiceText()});
initSpeechState()
.then((value) => {onVoiceText()});
},
),
),
@ -454,15 +504,14 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
? SizedBox()
: Container(
margin: EdgeInsets.all(5),
child: Expanded(
child: AppButton(
child: AppButton(
title: TranslationBase.of(context).clearText,
onPressed: () {
setState(() {
_remarksController.text = '';
});
},
))),
)),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
@ -472,27 +521,32 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
onPressed: () async {
setState(() {
if (_referTo == null) {
branchError = TranslationBase.of(context).fieldRequired;
branchError =
TranslationBase.of(context).fieldRequired;
} else {
branchError = null;
}
if (_selectedBranch == null) {
hospitalError = TranslationBase.of(context).fieldRequired;
hospitalError =
TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null;
}
if (_selectedClinic == null) {
clinicError = TranslationBase.of(context).fieldRequired;
clinicError =
TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if (_selectedDoctor == null) {
doctorError = TranslationBase.of(context).fieldRequired;
doctorError =
TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
}
if (_selectedFrequency == null) {
frequencyError = TranslationBase.of(context).fieldRequired;
frequencyError =
TranslationBase.of(context).fieldRequired;
} else {
frequencyError = null;
}
@ -509,7 +563,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
projectID: _selectedBranch['facilityId'],
clinicID: _selectedClinic['ClinicID'],
doctorID: _selectedDoctor['DoctorID'],
frequencyCode: _selectedFrequency['ParameterCode'],
frequencyCode:
_selectedFrequency['ParameterCode'],
ext: _extController.text,
remarks: _remarksController.text,
priority: _activePriority,
@ -517,7 +572,9 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
if (model.state == ViewState.ErrorLocal)
DrAppToastMsg.showErrorToast(model.error);
else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsg);
Navigator.pop(context);
}
}
@ -542,7 +599,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
];
return Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
@ -554,13 +612,15 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
child: Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
_isActive ? Color(0XFFB8382B) : Colors.white, _isActive ? Color(0XFFB8382B) : Colors.white),
_isActive ? Color(0XFFB8382B) : Colors.white,
_isActive ? Color(0XFFB8382B) : Colors.white),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive ? Colors.white : Colors.black, //Colors.black,
color: _isActive ? Colors.white : Colors.black,
//Colors.black,
fontWeight: FontWeight.bold,
),
),
@ -600,7 +660,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
return time;
}
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,

Loading…
Cancel
Save