merge-requests/307/head
Sultan Khan 5 years ago
commit fa80d62e7d

@ -18,7 +18,7 @@ PODS:
- Firebase/Messaging (6.33.0): - Firebase/Messaging (6.33.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseMessaging (~> 4.7.0) - FirebaseMessaging (~> 4.7.0)
- firebase_core (0.5.2): - firebase_core (0.5.3):
- Firebase/CoreOnly (~> 6.33.0) - Firebase/CoreOnly (~> 6.33.0)
- Flutter - Flutter
- firebase_core_web (0.1.0): - firebase_core_web (0.1.0):
@ -250,7 +250,7 @@ SPEC CHECKSUMS:
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7 firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659
firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1
firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
@ -292,4 +292,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
COCOAPODS: 1.10.0.rc.1 COCOAPODS: 1.10.1

@ -4,7 +4,7 @@ class GetProcedureReqModel {
int pageSize; int pageSize;
int pageIndex; int pageIndex;
List<String> search; List<String> search;
dynamic categoryId; dynamic category;
String vidaAuthTokenID; String vidaAuthTokenID;
GetProcedureReqModel( GetProcedureReqModel(
@ -13,7 +13,7 @@ class GetProcedureReqModel {
this.pageSize, this.pageSize,
this.pageIndex, this.pageIndex,
this.search, this.search,
this.categoryId, this.category,
this.vidaAuthTokenID}); this.vidaAuthTokenID});
GetProcedureReqModel.fromJson(Map<String, dynamic> json) { GetProcedureReqModel.fromJson(Map<String, dynamic> json) {
@ -22,7 +22,7 @@ class GetProcedureReqModel {
pageSize = json['PageSize']; pageSize = json['PageSize'];
pageIndex = json['PageIndex']; pageIndex = json['PageIndex'];
search = json['Search'].cast<String>(); search = json['Search'].cast<String>();
categoryId = json['CategoryId']; category = json['Category'];
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
} }
@ -33,7 +33,7 @@ class GetProcedureReqModel {
data['PageSize'] = this.pageSize; data['PageSize'] = this.pageSize;
data['PageIndex'] = this.pageIndex; data['PageIndex'] = this.pageIndex;
data['Search'] = this.search; data['Search'] = this.search;
data['CategoryId'] = this.categoryId; data['Category'] = this.category;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data; return data;
} }

@ -198,9 +198,9 @@ class PatientReferralService extends LookupService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = pendingReferral.patientID; body['PatientMRN'] = pendingReferral.patientID;
body['AppointmentNo'] = pendingReferral.sourceAppointmentNo; body['AppointmentNo'] = pendingReferral.targetAppointmentNo;
body['SetupID'] = pendingReferral.sourceSetupID; body['SetupID'] = pendingReferral.targetSetupID;
body['ProjectID'] = pendingReferral.sourceProjectId; body['ProjectID'] = pendingReferral.targetProjectId;
body['IsAccepted'] = isAccepted; body['IsAccepted'] = isAccepted;
body['PatientName'] = pendingReferral.patientName; body['PatientName'] = pendingReferral.patientName;
body['ReferralResponse'] = pendingReferral.remarksFromSource; body['ReferralResponse'] = pendingReferral.remarksFromSource;

@ -106,8 +106,8 @@ class UcafService extends LookupService {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = patient.patientMRN;
// body['AppointmentNo'] = patient.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
// body['EpisodeID'] = patient.episodeNo; body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post (GET_ORDER_PROCEDURE, await baseAppClient.post (GET_ORDER_PROCEDURE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -73,13 +73,14 @@ class ProcedureService extends BaseService {
}, body: Map()); }, body: Map());
} }
Future getProcedureCategory({String categoryName}) async { Future getProcedureCategory({String categoryName, String categoryID}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel( _getProcedureCategoriseReqModel = GetProcedureReqModel(
search: [categoryName], search: [""],
patientMRN: 0, patientMRN: 0,
pageIndex: 1, pageIndex: 0,
clinicId: 0, clinicId: 0,
pageSize: 300, pageSize: 0,
category: categoryID,
); );
hasError = false; hasError = false;
_categoriesList.clear(); _categoriesList.clear();

@ -29,11 +29,12 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureCategory({String categoryName}) async { Future getProcedureCategory({String categoryName, String categoryID}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.BusyLocal); setState(ViewState.Busy);
await _procedureService.getProcedureCategory(categoryName: categoryName); await _procedureService.getProcedureCategory(
categoryName: categoryName, categoryID: categoryID);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -54,6 +54,7 @@ class PatiantInformtion {
String genderDescription; String genderDescription;
String nursingStationName; String nursingStationName;
String startTime; String startTime;
String visitType;
PatiantInformtion({ PatiantInformtion({
this.list, this.list,
@ -105,7 +106,9 @@ class PatiantInformtion {
this.genderInt, this.genderInt,
this.isSigned, this.isSigned,
this.medicationOrders, this.medicationOrders,
this.nationality,this.patientMRN this.nationality,
this.patientMRN,
this.visitType,
}); });
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => factory PatiantInformtion.fromJson(Map<String, dynamic> json) =>
@ -159,6 +162,7 @@ class PatiantInformtion {
medicationOrders :json['medicationOrders'], medicationOrders :json['medicationOrders'],
nationality :json['nationality']??json['NationalityNameN'], nationality :json['nationality']??json['NationalityNameN'],
patientMRN :json['patientMRN'] ?? json['PatientMRN'], patientMRN :json['patientMRN'] ?? json['PatientMRN'],
visitType :json['visitType'] ?? json['visitType'],
); );
} }

@ -46,6 +46,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
bool isFormSubmitted = false; bool isFormSubmitted = false;
FocusNode _nodeText1 = FocusNode();
FocusNode _nodeText2 = FocusNode();
FocusNode _nodeText3 = FocusNode();
var _patientSearchFormValues = PatientModel( var _patientSearchFormValues = PatientModel(
FirstName: "0", FirstName: "0",
MiddleName: "0", MiddleName: "0",
@ -110,374 +114,383 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
return AppScaffold( return GestureDetector(
appBarTitle: TranslationBase.of(context).searchPatient, onTap: (){
body: ListView( FocusScope.of(context).requestFocus(new FocusNode());
children: <Widget>[ },
RoundedContainer( child: AppScaffold(
child: Column( appBarTitle: TranslationBase.of(context).searchPatient,
children: <Widget>[ body: ListView(
Column( children: <Widget>[
children: <Widget>[ RoundedContainer(
Container( child: Column(
child: Icon( children: <Widget>[
DoctorApp.search_patient_1, Column(
size: 100, children: <Widget>[
color: Colors.black, Container(
), child: Icon(
margin: EdgeInsets.only(top: 10), DoctorApp.search_patient_1,
), size: 100,
Padding( color: Colors.black,
padding: const EdgeInsets.only(top: 12.0), ),
child: AppText( margin: EdgeInsets.only(top: 10),
TranslationBase.of(context)
.searchPatientImageCaptionTitle
.toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: SizeConfig.heightMultiplier * 2.5,
), ),
), Padding(
Padding( padding: const EdgeInsets.only(top: 12.0),
padding: const EdgeInsets.only(top: 5.0), child: AppText(
child: AppText( TranslationBase.of(context)
TranslationBase.of(context) .searchPatientImageCaptionTitle
.searchPatientImageCaptionBody, .toUpperCase(),
fontSize: SizeConfig.heightMultiplier * 2, fontWeight: FontWeight.bold,
fontSize: SizeConfig.heightMultiplier * 2.5,
),
), ),
) Padding(
], padding: const EdgeInsets.only(top: 5.0),
), child: AppText(
Container( TranslationBase.of(context)
padding: EdgeInsets.all(15), .searchPatientImageCaptionBody,
width: SizeConfig.screenWidth * 1, fontSize: SizeConfig.heightMultiplier * 2,
child: Form(
key: _formKey,
autovalidate: _autoValidate,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 5,
), ),
Container( )
height: 40.0, ],
decoration: ShapeDecoration( ),
shape: RoundedRectangleBorder( Container(
side: BorderSide( padding: EdgeInsets.all(15),
width: 1.0, width: SizeConfig.screenWidth * 1,
style: BorderStyle.solid, child: Form(
color: HexColor("#CCCCCC")), key: _formKey,
borderRadius: autovalidate: _autoValidate,
BorderRadius.all(Radius.circular(6.0)), child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 5,
), ),
width: double.infinity, Container(
child: Padding( height: 40.0,
padding: EdgeInsets.only( decoration: ShapeDecoration(
top: SizeConfig.widthMultiplier * 0.9, shape: RoundedRectangleBorder(
bottom: SizeConfig.widthMultiplier * 0.9, side: BorderSide(
right: SizeConfig.widthMultiplier * 3, width: 1.0,
left: SizeConfig.widthMultiplier * 3), style: BorderStyle.solid,
child: Row( color: HexColor("#CCCCCC")),
mainAxisSize: MainAxisSize.max, borderRadius:
children: <Widget>[ BorderRadius.all(Radius.circular(6.0)),
Expanded( ),
// add Expanded to have your dropdown button fill remaining space ),
child: DropdownButtonHideUnderline( width: double.infinity,
child: DropdownButton( child: Padding(
isExpanded: true, padding: EdgeInsets.only(
value: _selectedType, top: SizeConfig.widthMultiplier * 0.9,
iconSize: 25, bottom: SizeConfig.widthMultiplier * 0.9,
elevation: 16, right: SizeConfig.widthMultiplier * 3,
selectedItemBuilder: left: SizeConfig.widthMultiplier * 3),
(BuildContext context) { child: Row(
return PATIENT_TYPE.map((item) { mainAxisSize: MainAxisSize.max,
return Row( children: <Widget>[
mainAxisSize: MainAxisSize.max, Expanded(
children: <Widget>[ // add Expanded to have your dropdown button fill remaining space
!projectsProvider.isArabic child: DropdownButtonHideUnderline(
? AppText( child: DropdownButton(
item['text'], isExpanded: true,
fontSize: SizeConfig value: _selectedType,
.textMultiplier * iconSize: 25,
2.1, elevation: 16,
) selectedItemBuilder:
: AppText( (BuildContext context) {
item['text_ar'], return PATIENT_TYPE.map((item) {
fontSize: SizeConfig return Row(
.textMultiplier * mainAxisSize: MainAxisSize.max,
2.1, children: <Widget>[
), !projectsProvider.isArabic
], ? AppText(
item['text'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
: AppText(
item['text_ar'],
fontSize: SizeConfig
.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (String newValue) => {
setState(() {
_selectedType = newValue;
selectedPatientType =
int.parse(_selectedType);
})
},
items: PATIENT_TYPE.map((item) {
!projectsProvider.isArabic
? itemText = item['text']
: itemText = item['text_ar'];
return DropdownMenuItem(
child: Text(
itemText,
textAlign: TextAlign.end,
),
value: item['val'],
); );
}).toList(); }).toList(),
}, )),
onChanged: (String newValue) => { ),
setState(() { ],
_selectedType = newValue; ),
selectedPatientType =
int.parse(_selectedType);
})
},
items: PATIENT_TYPE.map((item) {
!projectsProvider.isArabic
? itemText = item['text']
: itemText = item['text_ar'];
return DropdownMenuItem(
child: Text(
itemText,
textAlign: TextAlign.end,
),
value: item['val'],
);
}).toList(),
)),
),
],
), ),
), ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius:
borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(
border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))),
width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.only(top: 5),
padding: EdgeInsets.only(top: 5), child: AppTextFormField(
child: AppTextFormField( labelText:
labelText: TranslationBase.of(context).firstName,
TranslationBase.of(context).firstName, borderColor: Colors.white,
borderColor: Colors.white, onSaved: (value) {
onSaved: (value) { value == null || value == ''
value == null || value == '' ? _patientSearchFormValues.setFirstName =
? _patientSearchFormValues.setFirstName = "0"
"0" : _patientSearchFormValues.setFirstName =
: _patientSearchFormValues.setFirstName = value;
value;
if (value != null && if (value != null &&
value.toString().trim().isEmpty) { value.toString().trim().isEmpty) {
_patientSearchFormValues.setFirstName = "0"; _patientSearchFormValues.setFirstName = "0";
} }
}, },
// validator: (value) { // validator: (value) {
// return TextValidator().validateName(value); // return TextValidator().validateName(value);
// }, // },
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppTextFormField( child: AppTextFormField(
labelText:
TranslationBase.of(context).middleName,
borderColor: Colors.white,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues.setMiddleName =
"0"
: _patientSearchFormValues.setMiddleName =
value;
if (value != null && value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues.setMiddleName =
"0";
}
},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_LETTERS),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase.of(context).lastName,
borderColor: Colors.white,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues.setLastName =
"0"
: _patientSearchFormValues.setLastName =
value;
if (value != null && value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues.setLastName = "0";
}
},
inputFormatter: ONLY_LETTERS),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: labelText:
TranslationBase.of(context).middleName, TranslationBase.of(context).phoneNumber,
borderColor: Colors.white,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues.setMiddleName =
"0"
: _patientSearchFormValues.setMiddleName =
value;
if (value != null && value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues.setMiddleName =
"0";
}
},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_LETTERS),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase.of(context).lastName,
borderColor: Colors.white, borderColor: Colors.white,
textInputType: TextInputType.number,
textInputAction: TextInputAction.done,
inputFormatter: ONLY_NUMBERS,
focusNode: _nodeText1,
onSaved: (value) { onSaved: (value) {
value == null || value == '' value == null || value == ''
? _patientSearchFormValues.setLastName = ? _patientSearchFormValues
"0" .setPatientMobileNumber = "0"
: _patientSearchFormValues.setLastName = : _patientSearchFormValues
value; .setPatientMobileNumber = value;
if (value != null && value if (value != null && value
.toString() .toString()
.trim() .trim()
.isEmpty) { .isEmpty) {
_patientSearchFormValues.setLastName = "0"; _patientSearchFormValues
.setPatientMobileNumber = "0";
} }
}, },
inputFormatter: ONLY_LETTERS), ),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText:
TranslationBase.of(context).phoneNumber,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues
.setPatientMobileNumber = "0"
: _patientSearchFormValues
.setPatientMobileNumber = value;
if (value != null && value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues
.setPatientMobileNumber = "0";
}
},
), ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius:
borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(
border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))),
width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.only(top: 5),
padding: EdgeInsets.only(top: 5), child: AppTextFormField(
child: AppTextFormField( labelText:
TranslationBase.of(context).patientID,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
focusNode: _nodeText2,
onSaved: (value) {
value == null || value==''
? _patientSearchFormValues.setPatientID =
0
: _patientSearchFormValues.setPatientID =
int.parse(value);
if (value != null && value
.trim()
.toString()
.isEmpty) {
_patientSearchFormValues.setPatientID = 0;
}
}),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: labelText:
TranslationBase.of(context).patientID, TranslationBase.of(context).patientFile,
borderColor: Colors.white, borderColor: Colors.white,
textInputType: TextInputType.number, textInputType: TextInputType.number,
focusNode: _nodeText3,
inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {},
value == null || value=='' ),
? _patientSearchFormValues.setPatientID =
0
: _patientSearchFormValues.setPatientID =
int.parse(value);
if (value != null && value
.trim()
.toString()
.isEmpty) {
_patientSearchFormValues.setPatientID = 0;
}
}),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText:
TranslationBase.of(context).patientFile,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
onSaved: (value) {},
), ),
), (!(_selectedType == '2' || _selectedType == '4'))
(!(_selectedType == '2' || _selectedType == '4')) ? DynamicElements(_patientSearchFormValues, isFormSubmitted)
? DynamicElements(_patientSearchFormValues, isFormSubmitted) : SizedBox(
: SizedBox( height: 0,
height: 0, ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Container(
Container( child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.all(
borderRadius: BorderRadius.all( Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(
border: Border.all( width: 1.0,
width: 1.0, color: HexColor("#CCCCCC"))),
color: HexColor("#CCCCCC"))), height: 25,
height: 25, width: 25,
width: 25, child: Checkbox(
child: Checkbox( value: onlyArrived,
value: onlyArrived, checkColor: HexColor("#2A930A"),
checkColor: HexColor("#2A930A"), activeColor: Colors.white,
activeColor: Colors.white, onChanged: (bool newValue) {
onChanged: (bool newValue) { setState(() {
setState(() { onlyArrived = newValue;
onlyArrived = newValue; });
}); }),
}), ),
), SizedBox(
SizedBox( width: 12,
width: 12, ),
), AppText(
AppText( TranslationBase.of(context)
TranslationBase.of(context) .onlyArrivedPatient,
.onlyArrivedPatient, fontSize: SizeConfig.textMultiplier * 2),
fontSize: SizeConfig.textMultiplier * 2), ])),
])), SizedBox(
SizedBox( height: 10,
height: 10, ),
), ],
], ),
), ),
), )
) ],
], ),
), ),
), Container(
Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap(
child: Wrap( alignment: WrapAlignment.center,
alignment: WrapAlignment.center, children: <Widget>[
children: <Widget>[ AppButton(
AppButton( title: TranslationBase.of(context).search,
title: TranslationBase.of(context).search, onPressed: () {
onPressed: () { _validateInputs();
_validateInputs(); },
}, ),
), ],
], ),
), ),
), ],
], )),
)); );
} }
} }

@ -1,12 +1,3 @@
/*
*@author: Amjad Amireh Merge to Elham rababah
*@Date:27/4/2020
*@param:
*@return:PatientsScreen
*@desc:
*/
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -19,6 +10,7 @@ import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
@ -93,14 +85,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
} }
/*
*@author: Amjad Amireh
*@Date:5/5/2020
*@param:
*@return:Convert time from Milesecond to date with time
*@desc:
*/
convertDate(String str) { convertDate(String str) {
String timeConvert; String timeConvert;
const start = "/Date("; const start = "/Date(";
@ -129,14 +113,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
return newDateformat.toString(); return newDateformat.toString();
} }
/*
*@author: Amjad Amireh
*@Date:5/5/2020
*@param:
*@return:Convert time from Milesecond to date
*@desc:
*/
convertDateFormat(String str) { convertDateFormat(String str) {
String timeConvert; String timeConvert;
const start = "/Date("; const start = "/Date(";
@ -156,24 +132,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
return newDate.toString(); return newDate.toString();
} }
convertDateFormat2(String str) {
String timeConvert;
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
return newDate.toString();
}
filterBooking(String str) { filterBooking(String str) {
this.responseModelList = this.responseModelList2; this.responseModelList = this.responseModelList2;
@ -228,14 +186,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
return TranslationBase.of(context).all; return TranslationBase.of(context).all;
} }
/*
*@author: Amjad Amireh Modified New design
*@Date:21/5/2020
*@param:
*@return:PatientsScreen
*@desc:
*/
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_locations = [ _locations = [
@ -401,322 +351,19 @@ class _PatientsScreenState extends State<PatientsScreen> {
children: responseModelList children: responseModelList
.map((PatiantInformtion .map((PatiantInformtion
item) { item) {
return Container( return PatientCard(patientInfo: item,
decoration: patientType: patientType,
myBoxDecoration(), onTap: () {
child: InkWell( Navigator.of(context)
child: Row( .pushNamed(
children: <Widget>[ PATIENTS_PROFILE,
Column( arguments: {
mainAxisAlignment: "patient": item,
MainAxisAlignment "patientType":patientType,
.start, "from" : patient.getFrom,
children: < "to" : patient.getTo,
Widget>[ });
Padding( },);
padding: EdgeInsets
.only(
left:
12.0),
child:
Container(
decoration:
BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
0,
0,
0,
0.08),
offset: Offset(0.0,
5.0),
blurRadius:
16.0)
],
borderRadius:
BorderRadius.all(
Radius.circular(35.0)),
color: Color(
0xffCCCCCC),
),
width: 70,
height: 70,
child: Icon(
item.genderDescription ==
"Male"
? DoctorApp
.male
: DoctorApp
.female_icon,
size: 70,
color: Colors
.white,
),
),
),
],
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Column(
children: [
SizedBox(
height:
10.0,
),
AppText(
item.firstName +
" " +
item.lastName,
fontSize:
2.0 * SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
SizedBox(
height:
5,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <
Widget>[
Wrap(
children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.patientId.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
SizedBox(
width: 10,
),
],
),
SizedBox(
height:
2.5,
),
Container(
child:
AppText(
TranslationBase.of(context).nationality + " : " + (item.nationalityName ?? item.nationality),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
margin:
EdgeInsets.only(right: projectsProvider.isArabic ? 0 : 10, left: projectsProvider.isArabic ? 10 : 0),
),
SizedBox(
width:
10,
),
SizedBox(
height:
15.5,
),
SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
)
: SizedBox(
height: 5,
),
],
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
// mainAxisAlignment:
// MainAxisAlignment
// .spaceBetween,
children: <
Widget>[
SizedBox(
height:
0.5,
),
SizedBox(
height:
0,
),
Wrap(
children: [
AppText(
TranslationBase
.of(
context)
.age2,
fontSize: 1.8 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight
.bold,
backGroundcolor: Colors
.white,
),
AppText(
" ${DateUtils.getAgeByBirthday(item.dateofBirth, context)}",
fontSize: 1.8 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight
.w300,
backGroundcolor: Colors
.white,
),
SizedBox(
width: 10,
),
],
),
SizedBox(
height:
2.5,
),
Wrap(
children: [
AppText(
TranslationBase.of(context).gender2,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.gender.toString() == '1' ? 'Male' : 'Female',
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
8,
),
SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 25.5,
),
],
)
: SizedBox(
height: 15,
),
],
),
),
],
),
],
),
),
// Divider(color: Colors.grey)
],
),
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item,
"patientType":patientType,
"from" : patient.getFrom,
"to" : patient.getTo,
});
},
),
);
}).toList(), }).toList(),
) )
: Center( : Center(
@ -754,88 +401,78 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
Widget _locationBar(BuildContext _context) { Widget _locationBar(BuildContext _context) {
return Expanded( return Container(
child: Container( height: MediaQuery.of(context).size.height * 0.0619,
height: MediaQuery.of(context).size.height * 0.0619, width: SizeConfig.screenWidth * 0.94,
width: SizeConfig.screenWidth * 0.94, decoration: BoxDecoration(
decoration: BoxDecoration( color: Color(0Xffffffff),
color: Color(0Xffffffff), borderRadius: BorderRadius.circular(12.5),
borderRadius: BorderRadius.circular(12.5), border: Border.all(
border: Border.all( width: 0.5,
width: 0.5,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell(
child: Center(
child: Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.058,
width: SizeConfig.screenWidth * 0.2334,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12.5),
topRight: Radius.circular(12.5),
topLeft: Radius.circular(9.5),
bottomLeft: Radius.circular(9.5)),
color:
_isActive ? HexColor("#B8382B") : Colors.white,
),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.normal,
),
),
)),
),
),
onTap: () {
filterBooking(item.toString());
setState(() {
_activeLocation = _locations.indexOf(item);
});
}),
_isActive
? Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10),
topRight: Radius.circular(10)),
color: Colors.white),
alignment: Alignment.center,
height: 1,
width: SizeConfig.screenWidth * 0.23,
)
: Container()
]);
}).toList(),
), ),
), ),
); child: Row(
} mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell(
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.058,
width: SizeConfig.screenWidth * 0.2334,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12.5),
topRight: Radius.circular(12.5),
topLeft: Radius.circular(9.5),
bottomLeft: Radius.circular(9.5)),
color:
_isActive ? HexColor("#B8382B") : Colors.white,
),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.normal,
),
),
)),
),
onTap: () {
filterBooking(item.toString());
myBoxDecoration() { setState(() {
return BoxDecoration( _activeLocation = _locations.indexOf(item);
border: Border( });
bottom: BorderSide( }),
color: Color(0xffCCCCCC), _isActive
width: 0.5, ? Container(
), decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10),
topRight: Radius.circular(10)),
color: Colors.white),
alignment: Alignment.center,
height: 1,
width: SizeConfig.screenWidth * 0.23,
)
: Container()
]);
}).toList(),
), ),
); );
} }
} }

@ -157,6 +157,7 @@ class MyReferralDetailScreen extends StatelessWidget {
} else { } else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept);
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context);
} }
}, },
), ),
@ -180,6 +181,7 @@ class MyReferralDetailScreen extends StatelessWidget {
} else { } else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject);
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context);
} }
}, },
), ),

File diff suppressed because it is too large Load Diff

@ -375,7 +375,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
FontWeight FontWeight
.w700, .w700,
fontSize: fontSize:
17.0, 15.0,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
@ -419,6 +419,14 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
Row( Row(
children: [ children: [
AppText(
'Doctor Remarks : ',
fontWeight:
FontWeight
.w700,
fontSize:
13.0,
),
Expanded( Expanded(
child: child:
Container( Container(

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
@ -103,467 +104,479 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
(BuildContext context, MedicineViewModel model, Widget child) => (BuildContext context, MedicineViewModel model, Widget child) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet( child: GestureDetector(
initialChildSize: 0.95, onTap: (){
maxChildSize: 0.99, FocusScope.of(context).requestFocus(new FocusNode());
minChildSize: 0.6, },
builder: child: DraggableScrollableSheet(
(BuildContext context, ScrollController scrollController) { initialChildSize: 0.95,
return Container( maxChildSize: 0.99,
height: MediaQuery.of(context).size.height * 1.3, minChildSize: 0.6,
child: Form( builder:
child: Padding( (BuildContext context, ScrollController scrollController) {
padding: EdgeInsets.symmetric( return Container(
horizontal: 20.0, vertical: 12.0), height: MediaQuery.of(context).size.height * 1.3,
child: Column( child: Form(
crossAxisAlignment: CrossAxisAlignment.start, child: Padding(
children: [ padding: EdgeInsets.symmetric(
AppText( horizontal: 20.0, vertical: 12.0),
widget.drugName.toUpperCase(), child: Column(
fontWeight: FontWeight.w900, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
SizedBox( AppText(
height: 10.0, widget.drugName.toUpperCase(),
), fontWeight: FontWeight.w900,
Column( ),
children: [ SizedBox(
// Container( height: 10.0,
// height: MediaQuery.of(context).size.height * ),
// 0.070, Column(
// child: InkWell( children: [
// onTap: model.allMedicationList != null // Container(
// ? () { // height: MediaQuery.of(context).size.height *
// setState(() { // 0.070,
// newSelectedMedication = null; // child: InkWell(
// }); // onTap: model.allMedicationList != null
// } // ? () {
// : null, // setState(() {
// child: newSelectedMedication == null // newSelectedMedication = null;
// ? AutoCompleteTextField< // });
// GetMedicationResponseModel>( // }
// decoration: // : null,
// textFieldSelectorDecoration( // child: newSelectedMedication == null
// widget.drugNameGeneric, // ? AutoCompleteTextField<
// newSelectedMedication != null // GetMedicationResponseModel>(
// ? newSelectedMedication // decoration:
// .genericName // textFieldSelectorDecoration(
// : null, // widget.drugNameGeneric,
// true, // newSelectedMedication != null
// ), // ? newSelectedMedication
// itemSubmitted: (item) => setState( // .genericName
// () => newSelectedMedication = // : null,
// item), // true,
// key: key, // ),
// suggestions: // itemSubmitted: (item) => setState(
// model.allMedicationList, // () => newSelectedMedication =
// itemBuilder: (context, // item),
// suggestion) => // key: key,
// new Padding( // suggestions:
// child: Texts(suggestion // model.allMedicationList,
// .description + // itemBuilder: (context,
// '/' + // suggestion) =>
// suggestion.genericName), // new Padding(
// padding: // child: Texts(suggestion
// EdgeInsets.all(8.0)), // .description +
// itemSorter: (a, b) => 1, // '/' +
// itemFilter: (suggestion, input) => // suggestion.genericName),
// suggestion.genericName // padding:
// .toLowerCase() // EdgeInsets.all(8.0)),
// .startsWith( // itemSorter: (a, b) => 1,
// input.toLowerCase()) || // itemFilter: (suggestion, input) =>
// suggestion.description // suggestion.genericName
// .toLowerCase() // .toLowerCase()
// .startsWith( // .startsWith(
// input.toLowerCase()) || // input.toLowerCase()) ||
// suggestion.keywords // suggestion.description
// .toLowerCase() // .toLowerCase()
// .startsWith( // .startsWith(
// input.toLowerCase()), // input.toLowerCase()) ||
// ) // suggestion.keywords
// : TextField( // .toLowerCase()
// decoration: // .startsWith(
// textFieldSelectorDecoration( // input.toLowerCase()),
// TranslationBase.of(context) // )
// .searchMedicineNameHere, // : TextField(
// newSelectedMedication != null // decoration:
// ? newSelectedMedication // textFieldSelectorDecoration(
// .description + // TranslationBase.of(context)
// ('${newSelectedMedication.genericName}') // .searchMedicineNameHere,
// : null, // newSelectedMedication != null
// true, // ? newSelectedMedication
// ), // .description +
// enabled: false, // ('${newSelectedMedication.genericName}')
// ), // : null,
// ), // true,
// ), // ),
// SizedBox( // enabled: false,
// height: 12, // ),
// ), // ),
Container( // ),
height: MediaQuery.of(context).size.height * // SizedBox(
0.060, // height: 12,
width: double.infinity, // ),
child: Row( Container(
children: [ height: MediaQuery.of(context).size.height *
Container( 0.060,
width: width: double.infinity,
MediaQuery.of(context).size.width * child: Row(
0.4900, children: [
height: Container(
MediaQuery.of(context).size.height * width:
0.55, MediaQuery.of(context).size.width *
child: TextFields( 0.4900,
inputFormatters: [ height:
LengthLimitingTextInputFormatter(4) MediaQuery.of(context).size.height *
], 0.55,
hintText: widget.doseStreangth, child: TextFields(
fontSize: 15.0, inputFormatters: [
controller: strengthController, LengthLimitingTextInputFormatter(4),
keyboardType: TextInputType.number, WhitelistingTextInputFormatter
onChanged: (String value) { .digitsOnly
setState(() { ],
strengthChar = value.length; hintText: widget.doseStreangth,
}); fontSize: 15.0,
if (strengthChar >= 4) { controller: strengthController,
DrAppToastMsg.showErrorToast( keyboardType: TextInputType.number,
"Only 4 Digits allowed for strength"); onChanged: (String value) {
} setState(() {
}, strengthChar = value.length;
// validator: (value) { });
// if (value.isEmpty && if (strengthChar >= 4) {
// strengthController.text.length > DrAppToastMsg.showErrorToast(
// 4) "Only 4 Digits allowed for strength");
// return TranslationBase.of(context) }
// .emptyMessage; },
// else // validator: (value) {
// return null; // if (value.isEmpty &&
// }, // strengthController.text.length >
// 4)
// return TranslationBase.of(context)
// .emptyMessage;
// else
// return null;
// },
),
), ),
), SizedBox(
SizedBox( width: 10.0,
width: 10.0, ),
), Container(
Container( width:
width: MediaQuery.of(context).size.width *
MediaQuery.of(context).size.width * 0.3700,
0.3700, child: InkWell(
child: InkWell( onTap: model.medicationStrengthList !=
onTap: model.medicationStrengthList != null
null ? () {
? () { Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: model list: model
.medicationStrengthList, .medicationStrengthList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: TranslationBase.of( okText: TranslationBase.of(
context) context)
.ok, .ok,
okFunction: okFunction:
(selectedValue) { (selectedValue) {
setState(() { setState(() {
units = selectedValue; units = selectedValue;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: builder:
(BuildContext context) { (BuildContext context) {
return dialog; return dialog;
}, },
); );
} }
: null, : null,
child: TextField( child: TextField(
decoration: decoration:
textFieldSelectorDecoration( textFieldSelectorDecoration(
'UNIT Type', 'UNIT Type',
units != null units != null
? units['nameEn'] ? units['nameEn']
: null, : null,
true), true),
enabled: false, enabled: false,
),
), ),
), ),
],
),
),
SizedBox(
height: 12,
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: model.medicationRouteList != null
? () {
Helpers.hideKeyboard(context);
ListSelectDialog dialog =
ListSelectDialog(
list: model.medicationRouteList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
route = selectedValue;
});
if (route == null) {
route = route['id'];
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
'Route',
route != null
? route['nameEn']
: null,
true),
enabled: false,
), ),
], ),
),
SizedBox(
height: 12.0,
), ),
), Container(
SizedBox( height: MediaQuery.of(context).size.height *
height: 12, 0.070,
), child: InkWell(
Container( onTap: model.medicationDoseTimeList != null
height: MediaQuery.of(context).size.height * ? () {
0.070, Helpers.hideKeyboard(context);
child: InkWell( ListSelectDialog dialog =
onTap: model.medicationRouteList != null ListSelectDialog(
? () { list:
ListSelectDialog dialog = model.medicationDoseTimeList,
ListSelectDialog( attributeName: 'nameEn',
list: model.medicationRouteList, attributeValueId: 'id',
attributeName: 'nameEn', okText:
attributeValueId: 'id', TranslationBase.of(context)
okText: .ok,
TranslationBase.of(context) okFunction: (selectedValue) {
.ok, setState(() {
okFunction: (selectedValue) { doseTime = selectedValue;
setState(() { });
route = selectedValue; },
}); );
if (route == null) { showDialog(
route = route['id']; barrierDismissible: false,
} context: context,
}, builder: (BuildContext context) {
); return dialog;
showDialog( },
barrierDismissible: false, );
context: context, }
builder: (BuildContext context) { : null,
return dialog; child: TextField(
}, decoration: textFieldSelectorDecoration(
); TranslationBase.of(context).doseTime,
} doseTime != null
: null, ? doseTime['nameEn']
child: TextField( : null,
decoration: textFieldSelectorDecoration( true),
'Route', enabled: false,
route != null ),
? route['nameEn']
: null,
true),
enabled: false,
), ),
), ),
), SizedBox(
SizedBox( height: 12.0,
height: 12.0, ),
), Container(
Container( height: MediaQuery.of(context).size.height *
height: MediaQuery.of(context).size.height * 0.070,
0.070, child: InkWell(
child: InkWell( onTap: model.medicationFrequencyList != null
onTap: model.medicationDoseTimeList != null ? () {
? () { Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: list:
model.medicationDoseTimeList, model.medicationFrequencyList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
doseTime = selectedValue; frequencyUpdate =
}); selectedValue;
}, });
); },
showDialog( );
barrierDismissible: false, showDialog(
context: context, barrierDismissible: false,
builder: (BuildContext context) { context: context,
return dialog; builder: (BuildContext context) {
}, return dialog;
); },
} );
: null, }
child: TextField( : null,
decoration: textFieldSelectorDecoration( child: TextField(
TranslationBase.of(context).doseTime, decoration: textFieldSelectorDecoration(
doseTime != null TranslationBase.of(context).frequency,
? doseTime['nameEn'] frequencyUpdate != null
: null, ? frequencyUpdate['nameEn']
true), : null,
enabled: false, true),
enabled: false,
),
), ),
), ),
), SizedBox(
SizedBox( height: 12.0,
height: 12.0, ),
), Container(
Container( height: MediaQuery.of(context).size.height *
height: MediaQuery.of(context).size.height * 0.070,
0.070, child: InkWell(
child: InkWell( onTap: model.medicationDurationList != null
onTap: model.medicationFrequencyList != null ? () {
? () { Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: list:
model.medicationFrequencyList, model.medicationDurationList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
frequencyUpdate = updatedDuration =
selectedValue; selectedValue;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return dialog; return dialog;
}, },
); );
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).frequency, TranslationBase.of(context).duration,
frequencyUpdate != null updatedDuration != null
? frequencyUpdate['nameEn'] ? updatedDuration['nameEn']
: null, .toString()
true), : null,
enabled: false, true),
enabled: false,
),
), ),
), ),
), SizedBox(
SizedBox( height: 12.0,
height: 12.0, ),
), Container(
Container( decoration: BoxDecoration(
height: MediaQuery.of(context).size.height * borderRadius: BorderRadius.all(
0.070, Radius.circular(6.0)),
child: InkWell( border: Border.all(
onTap: model.medicationDurationList != null width: 1.0,
? () { color: HexColor("#CCCCCC"))),
ListSelectDialog dialog = child: TextFields(
ListSelectDialog( hintText: widget.remarks,
list: controller: remarksController,
model.medicationDurationList, maxLines: 7,
attributeName: 'nameEn', minLines: 4,
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
updatedDuration =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).duration,
updatedDuration != null
? updatedDuration['nameEn']
.toString()
: null,
true),
enabled: false,
), ),
), ),
), SizedBox(
SizedBox( height: 12.0,
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: widget.remarks,
controller: remarksController,
maxLines: 7,
minLines: 4,
), ),
), SizedBox(
SizedBox( height:
height: 12.0, MediaQuery.of(context).size.height * 0.12,
), ),
SizedBox( Container(
height: margin: EdgeInsets.all(
MediaQuery.of(context).size.height * 0.12, SizeConfig.widthMultiplier * 2),
), child: Wrap(
Container( alignment: WrapAlignment.center,
margin: EdgeInsets.all( children: <Widget>[
SizeConfig.widthMultiplier * 2), AppButton(
child: Wrap( title:
alignment: WrapAlignment.center, 'update prescription'.toUpperCase(),
children: <Widget>[ onPressed: () {
AppButton( updatePrescription(
title: newDoseStreangth:
'update prescription'.toUpperCase(), strengthController
onPressed: () { .text.isNotEmpty
updatePrescription( ? strengthController.text
newDoseStreangth: : widget.doseStreangth,
strengthController newUnit: units !=
.text.isNotEmpty null
? strengthController.text ? units['id'].toString()
: widget.doseStreangth, : widget.doseUnit,
newUnit: units != doseUnit: widget.doseUnit,
null doseStreangth: widget
? units['id'].toString() .doseStreangth,
: widget.doseUnit, duration: widget.duration,
doseUnit: widget.doseUnit, startDate: widget.startDate,
doseStreangth: widget doseId: widget.dose,
.doseStreangth, frequencyId: widget.frequency,
duration: widget.duration, routeId: widget.route,
startDate: widget.startDate, patient: widget.patient,
doseId: widget.dose, model: widget.model,
frequencyId: widget.frequency, newDuration:
routeId: widget.route, updatedDuration !=
patient: widget.patient, null
model: widget.model, ? updatedDuration[
newDuration: 'id']
updatedDuration != .toString()
null : widget.duration,
? updatedDuration[ drugId: widget.drugId,
'id'] remarks: remarksController.text,
.toString() route: route !=
: widget.duration, null
drugId: widget.drugId, ? route['id'].toString()
remarks: remarksController.text, : widget.route,
route: route != frequency:
null frequencyUpdate !=
? route['id'].toString() null
: widget.route, ? frequencyUpdate['id']
frequency: .toString()
frequencyUpdate != : widget.frequency,
null dose: doseTime != null
? frequencyUpdate['id'] ? doseTime['id'].toString()
.toString() : widget.dose,
: widget.frequency, enteredRemarks:
dose: doseTime != null widget.enteredRemarks);
? doseTime['id'].toString() Navigator.pop(context);
: widget.dose, },
enteredRemarks: ),
widget.enteredRemarks); ],
Navigator.pop(context); ),
},
),
],
), ),
), ],
], ),
), ],
], ),
), ),
), ));
)); }),
}), ),
), ),
); );
}); });

@ -147,7 +147,17 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
selectedCategory = selectedValue; selectedCategory = selectedValue;
model.getProcedureCategory( model.getProcedureCategory(
categoryName: selectedCategory[ categoryName: selectedCategory[
'categoryName']); 'categoryName'],
categoryID: selectedCategory[
'categoryId'] <=
9
? "0" +
selectedCategory[
'categoryId']
.toString()
: selectedCategory[
'categoryId']
.toString());
}); });
}, },
); );
@ -221,7 +231,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
setSelectedType(value); setSelectedType(value);
}, },
), ),
Text(TranslationBase.of(context).regular), Text('routine'),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: Color(0xFFB9382C),
groupValue: selectedType, groupValue: selectedType,

@ -37,6 +37,13 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
class _EntityListCheckboxSearchWidgetState class _EntityListCheckboxSearchWidgetState
extends State<EntityListCheckboxSearchWidget> { extends State<EntityListCheckboxSearchWidget> {
int selectedType;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
List<EntityList> items = List(); List<EntityList> items = List();
@override @override

@ -259,11 +259,11 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
), ),
Expanded( Expanded(
child: Container( child: Container(
height: MediaQuery.of( // height: MediaQuery.of(
context) // context)
.size // .size
.height * // .height *
0.21, // 0.21,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -281,7 +281,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
FontWeight FontWeight
.w700, .w700,
fontSize: fontSize:
15.0, 13.0,
), ),
AppText( AppText(
model model
@ -292,7 +292,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
.procedureId .procedureId
.toString(), .toString(),
fontSize: fontSize:
13.0, 12.0,
), ),
SizedBox( SizedBox(
width: 12.0, width: 12.0,
@ -305,17 +305,17 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
FontWeight FontWeight
.w700, .w700,
fontSize: fontSize:
14.0, 13.0,
), ),
Expanded( Expanded(
child: child:
AppText( AppText(
model.procedureList[0].entityList[index].orderType == model.procedureList[0].entityList[index].orderType ==
1 1
? 'Regular' ? 'Routine'
: 'Urgent', : 'Urgent',
fontSize: fontSize:
13.0, 11.5,
color: Color( color: Color(
0xFFB9382C), 0xFFB9382C),
), ),

@ -135,7 +135,17 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
model.getProcedureCategory( model.getProcedureCategory(
categoryName: categoryName:
selectedCategory[ selectedCategory[
'categoryName']); 'categoryName'],
categoryID: selectedCategory[
'categoryId'] <=
9
? "0" +
selectedCategory[
'categoryId']
.toString()
: selectedCategory[
'categoryId']
.toString());
}); });
}, },
); );
@ -212,7 +222,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
setSelectedType(value); setSelectedType(value);
}, },
), ),
Text(TranslationBase.of(context).regular), Text('routine'),
], ],
), ),
), ),

File diff suppressed because it is too large Load Diff

@ -83,315 +83,320 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
builder: (_, model, w) => BaseView<SickLeaveViewModel>( builder: (_, model, w) => BaseView<SickLeaveViewModel>(
onModelReady: (model2) => model2.preSickLeaveStatistics( onModelReady: (model2) => model2.preSickLeaveStatistics(
widget.appointmentNo, widget.patientMRN), widget.appointmentNo, widget.patientMRN),
builder: (_, model2, w) => AppScaffold( builder: (_, model2, w) => GestureDetector(
baseViewModel: model2, onTap: (){
isShowAppBar: false, FocusScope.of(context).requestFocus(new FocusNode());
body: Center( },
child: Container( child: AppScaffold(
margin: EdgeInsets.only(top: 10), baseViewModel: model2,
child: FractionallySizedBox( isShowAppBar: false,
widthFactor: 0.9, body: Center(
child: ListView( child: Container(
children: [ margin: EdgeInsets.only(top: 10),
Padding( child: FractionallySizedBox(
child: AppText( widthFactor: 0.9,
widget.isExtended == true child: ListView(
? TranslationBase.of(context) children: [
.extendSickLeave Padding(
: TranslationBase.of(context) child: AppText(
.addSickLeave, widget.isExtended == true
fontWeight: FontWeight.bold, ? TranslationBase.of(context)
), .extendSickLeave
padding: EdgeInsets.all(10)), : TranslationBase.of(context)
Container( .addSickLeave,
margin: EdgeInsets.only(left: 10, right: 10), fontWeight: FontWeight.bold,
decoration: BoxDecoration( ),
borderRadius: padding: EdgeInsets.all(10)),
BorderRadius.all(Radius.circular(6.0)), Container(
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextFormField(
borderColor: Colors.white,
onChanged: (value) {
addSickLeave.noOfDays = value;
if (widget.extendedData != null) {
widget.extendedData.noOfDays =
int.parse(value);
}
},
hintText: widget.extendedData != null
? widget.extendedData.noOfDays
.toString()
: TranslationBase.of(context)
.sickLeaveDays,
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_NUMBERS)
]),
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0, color: HexColor("#CCCCCC"))),
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// AppText( AppTextFormField(
// TranslationBase.of(context).sickLeaveDate, borderColor: Colors.white,
// fontSize: 10, onChanged: (value) {
// ), addSickLeave.noOfDays = value;
AppTextFormField( if (widget.extendedData != null) {
hintText: widget.extendedData != null widget.extendedData.noOfDays =
? widget.extendedData.startDate int.parse(value);
: TranslationBase.of(context) }
.sickLeaveDate, },
borderColor: Colors.white, hintText: widget.extendedData != null
prefix: IconButton( ? widget.extendedData.noOfDays
icon: Icon(Icons.calendar_today)), .toString()
textInputType: TextInputType.number, : TranslationBase.of(context)
controller: _toDateController, .sickLeaveDays,
onTap: () { // validator: (value) {
_presentDatePicker('_selectedToDate'); // return TextValidator().validateName(value);
}, // },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_NUMBERS)
onChanged: (value) { ]),
addSickLeave.startDate = value; ),
if (widget.extendedData != null) { SizedBox(
widget.extendedData.startDate = height: 10,
value; ),
} Container(
}), margin: EdgeInsets.only(left: 10, right: 10),
], decoration: BoxDecoration(
)), borderRadius:
Container( BorderRadius.all(Radius.circular(6.0)),
margin: EdgeInsets.only( border: Border.all(
top: 10, left: 10, right: 10), width: 1.0,
decoration: BoxDecoration( color: HexColor("#CCCCCC"))),
borderRadius: padding: EdgeInsets.all(5),
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
// AppText( // AppText(
// TranslationBase.of(context).clinicName, // TranslationBase.of(context).sickLeaveDate,
// fontSize: 10, // fontSize: 10,
// ), // ),
Row( AppTextFormField(
mainAxisSize: MainAxisSize.max, hintText: widget.extendedData != null
children: <Widget>[ ? widget.extendedData.startDate
Expanded( : TranslationBase.of(context)
// add Expanded to have your dropdown button fill remaining space .sickLeaveDate,
child: DropdownButtonHideUnderline( borderColor: Colors.white,
child: new IgnorePointer( prefix: IconButton(
ignoring: true, icon: Icon(Icons.calendar_today)),
child: DropdownButton( textInputType: TextInputType.number,
isExpanded: true, controller: _toDateController,
value: getClinicName( onTap: () {
model) ?? _presentDatePicker('_selectedToDate');
"", },
iconSize: 0, inputFormatter: ONLY_DATE,
elevation: 16, onChanged: (value) {
selectedItemBuilder: addSickLeave.startDate = value;
(BuildContext if (widget.extendedData != null) {
context) { widget.extendedData.startDate =
return model value;
}
}),
],
)),
Container(
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).clinicName,
// fontSize: 10,
// ),
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: new IgnorePointer(
ignoring: true,
child: DropdownButton(
isExpanded: true,
value: getClinicName(
model) ??
"",
iconSize: 0,
elevation: 16,
selectedItemBuilder:
(BuildContext
context) {
return model
.getClinicNameList()
.map((item) {
return Row(
mainAxisSize:
MainAxisSize
.max,
children: <Widget>[
AppText(
item,
fontSize: SizeConfig
.textMultiplier *
2.1,
color:
Colors.grey,
),
],
);
}).toList();
},
onChanged: (newValue) =>
{},
items: model
.getClinicNameList() .getClinicNameList()
.map((item) { .map((item) {
return Row( return DropdownMenuItem(
mainAxisSize: value:
MainAxisSize item.toString(),
.max, child: Text(
children: <Widget>[ item,
AppText( textAlign:
item, TextAlign.end,
fontSize: SizeConfig ),
.textMultiplier *
2.1,
color:
Colors.grey,
),
],
); );
}).toList(); }).toList(),
}, ))),
onChanged: (newValue) => ),
{}, ],
items: model )
.getClinicNameList() ],
.map((item) {
return DropdownMenuItem(
value:
item.toString(),
child: Text(
item,
textAlign:
TextAlign.end,
),
);
}).toList(),
))),
),
],
)
],
),
)),
model2.sickLeaveStatistics[
'recommendedSickLeaveDays'] !=
null
? Padding(
child: AppText(
model2.sickLeaveStatistics[
'recommendedSickLeaveDays'],
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
), ),
padding: EdgeInsets.all(10), )),
) model2.sickLeaveStatistics[
: SizedBox( 'recommendedSickLeaveDays'] !=
height: 10, null
), ? Padding(
Container( child: AppText(
margin: EdgeInsets.only(left: 10, right: 10), model2.sickLeaveStatistics[
decoration: BoxDecoration( 'recommendedSickLeaveDays'],
borderRadius: fontWeight: FontWeight.bold,
BorderRadius.all(Radius.circular(6.0)), textAlign: TextAlign.start,
border: Border.all( ),
width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(10),
padding: EdgeInsets.all(5), )
child: Column( : SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 10,
children: [ ),
// AppText( Container(
// TranslationBase.of(context).doctorName, margin: EdgeInsets.only(left: 10, right: 10),
// fontSize: 10, decoration: BoxDecoration(
// ), borderRadius:
new IgnorePointer( BorderRadius.all(Radius.circular(6.0)),
ignoring: true, border: Border.all(
child: AppTextFormField( width: 1.0, color: HexColor("#CCCCCC"))),
readOnly: true, padding: EdgeInsets.all(5),
hintText: profile['DoctorName'], child: Column(
borderColor: Colors.white, crossAxisAlignment: CrossAxisAlignment.start,
onSaved: (value) {}, children: [
// validator: (value) { // AppText(
// return TextValidator().validateName(value); // TranslationBase.of(context).doctorName,
// }, // fontSize: 10,
inputFormatter: ONLY_NUMBERS)) // ),
], new IgnorePointer(
ignoring: true,
child: AppTextFormField(
readOnly: true,
hintText: profile['DoctorName'],
borderColor: Colors.white,
onSaved: (value) {},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_NUMBERS))
],
),
),
SizedBox(
height: 10,
), ),
), Container(
SizedBox( margin: EdgeInsets.only(left: 10, right: 10),
height: 10, decoration: BoxDecoration(
), borderRadius:
Container( BorderRadius.all(Radius.circular(6.0)),
margin: EdgeInsets.only(left: 10, right: 10), border: Border.all(
decoration: BoxDecoration( width: 1.0, color: HexColor("#CCCCCC"))),
borderRadius: padding: EdgeInsets.all(5),
BorderRadius.all(Radius.circular(6.0)), child: Column(
border: Border.all( crossAxisAlignment: CrossAxisAlignment.start,
width: 1.0, color: HexColor("#CCCCCC"))), children: [
padding: EdgeInsets.all(5), // AppText(
child: Column( // TranslationBase.of(context).remarks,
crossAxisAlignment: CrossAxisAlignment.start, // fontSize: 10,
children: [ // ),
// AppText( TextField(
// TranslationBase.of(context).remarks, maxLines: 3,
// fontSize: 10, decoration: InputDecoration(
// ), contentPadding: EdgeInsets.all(20.0),
TextField( border: InputBorder.none,
maxLines: 3, hintText: widget.extendedData != null
decoration: InputDecoration( ? widget.extendedData.remarks
contentPadding: EdgeInsets.all(20.0), : TranslationBase.of(context)
border: InputBorder.none, .remarks),
hintText: widget.extendedData != null onChanged: (value) {
? widget.extendedData.remarks addSickLeave.remarks = value;
: TranslationBase.of(context) if (widget.extendedData != null) {
.remarks), widget.extendedData.remarks = value;
onChanged: (value) { }
addSickLeave.remarks = value; },
if (widget.extendedData != null) { )
widget.extendedData.remarks = value; ],
} ),
},
)
],
), ),
), Container(
Container( margin: EdgeInsets.all(
margin: EdgeInsets.all( SizeConfig.widthMultiplier * 5),
SizeConfig.widthMultiplier * 5), child: Wrap(
child: Wrap( alignment: WrapAlignment.center,
alignment: WrapAlignment.center, children: <Widget>[
children: <Widget>[ AppButton(
AppButton( title: widget.isExtended == true
title: widget.isExtended == true ? TranslationBase.of(context).extend
? TranslationBase.of(context).extend : TranslationBase.of(context).add,
: TranslationBase.of(context).add, onPressed: () async {
onPressed: () async { if (widget.isExtended) {
if (widget.isExtended) { await model2.extendSickLeave(
await model2.extendSickLeave( widget.extendedData);
widget.extendedData);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
model2.sickleaveResponse[ model2.sickleaveResponse[
'ListSickLeavesToExtent'] 'ListSickLeavesToExtent']
['success']); ['success']);
Navigator.of(context).popUntil((route) { Navigator.of(context).popUntil((route) {
return route.settings.name == return route.settings.name ==
PATIENTS_PROFILE; PATIENTS_PROFILE;
}); });
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
ADD_SICKLEAVE, ADD_SICKLEAVE,
arguments: { arguments: {
'patient': widget.patient 'patient': widget.patient
}); });
//print(value); //print(value);
//}); //});
} else { } else {
_validateInputs(model2); _validateInputs(model2);
} }
}, },
), ),
], ],
),
), ),
), // Column(
// Column( // children: [
// children: [ // Texts(TranslationBase.of(context)
// Texts(TranslationBase.of(context) // .previousSickLeaveIssue +
// .previousSickLeaveIssue + // ' ')
// ' ') // ],
// ], // )
// ) ],
], ),
), ),
), ),
), ),
), ),
))); )));
} }
void _validateInputs(model2) async { void _validateInputs(model2) async {

@ -408,4 +408,9 @@ class Helpers {
)), )),
); );
} }
/// hides the keyboard if its already open
static hideKeyboard(BuildContext context) {
FocusScope.of(context).unfocus();
}
} }

@ -0,0 +1,244 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.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/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class PatientCard extends StatelessWidget {
final PatiantInformtion patientInfo;
final Function onTap;
final String patientType;
const PatientCard({Key key, this.patientInfo, this.onTap, this.patientType}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(10),
decoration: myBoxDecoration(),
margin: EdgeInsets.only(bottom: 12),
child: InkWell(
child: Row(
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment
.start,
children: <
Widget>[
Padding(
padding: EdgeInsets
.only(
left:
12.0),
child:
Container(
decoration:
BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
0,
0,
0,
0.08),
offset: Offset(0.0,
5.0),
blurRadius:
16.0)
],
borderRadius:
BorderRadius.all(
Radius.circular(35.0)),
color: Color(
0xffCCCCCC),
),
width: 70,
height: 70,
child: Icon(
patientInfo.genderDescription ==
"Male"
? DoctorApp
.male
: DoctorApp
.female_icon,
size: 70,
color: Colors
.white,
),
),
),
],
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:CrossAxisAlignment.start,
children: [
AppText(
patientInfo.firstName +
" " +
patientInfo.lastName,
fontSize:
2.0 * SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
SizedBox(height: 12,),
Table(
border: TableBorder.symmetric(
// inside: BorderSide(width: 2.0, color: Colors.white),
),
// defaultVerticalAlignment:TableCellVerticalAlignment.middle ,
children: [
TableRow(children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNo,
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 2.2 * SizeConfig.textMultiplier)),
new TextSpan(text: patientInfo.patientId.toString()),
],),),
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age+ " : ",
style: TextStyle(fontWeight: FontWeight.w700, )),
new TextSpan(text: "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}"),
],),),
),
]
),
TableRow(children: [
SizedBox(height: 5,),
SizedBox(height: 5,)
]),
TableRow(children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).nationality + " : ",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 2.2 * SizeConfig.textMultiplier)),
new TextSpan(text: (patientInfo.nationalityName ?? patientInfo.nationality)),
],),),
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).gender + " : ",
style: TextStyle(fontWeight: FontWeight.w700, )),
new TextSpan(text: patientInfo.gender.toString() == '1' ? 'Male' : 'Female'),
],),),
),
]
),
],
),
if(SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
patientInfo.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(patientInfo.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(top: 8,),
)
],
),
),
// Divider(color: Colors.grey)
],
),
onTap: onTap,
),
);
}
convertDateFormat2(String str) {
String timeConvert;
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
return newDate.toString();
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color(0xffCCCCCC),
width: 0.5,
),
),
);
}
}

@ -43,7 +43,7 @@ class PatientHeaderWidgetNoAvatar extends StatelessWidget {
], ],
), ),
AppText( AppText(
"NEW VISIT", patient.visitType ?? "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),

@ -54,7 +54,7 @@ class TextFields extends StatefulWidget {
this.focus = false, this.focus = false,
this.maxLengthEnforced = true, this.maxLengthEnforced = true,
this.suffixIconColor, this.suffixIconColor,
this.inputAction, this.inputAction = TextInputAction.done,
this.onSubmit, this.onSubmit,
this.keepPadding = true, this.keepPadding = true,
this.textCapitalization = TextCapitalization.none, this.textCapitalization = TextCapitalization.none,

@ -17,7 +17,7 @@ class AppTextFormField extends FormField<String> {
TextInputType textInputType, TextInputType textInputType,
String hintText, String hintText,
FocusNode focusNode, FocusNode focusNode,
TextInputAction textInputAction, TextInputAction textInputAction=TextInputAction.done,
ValueChanged<String> onFieldSubmitted, ValueChanged<String> onFieldSubmitted,
IconButton prefix, IconButton prefix,
String labelText, String labelText,
@ -38,10 +38,10 @@ class AppTextFormField extends FormField<String> {
focusNode: focusNode, focusNode: focusNode,
keyboardType: textInputType, keyboardType: textInputType,
readOnly: readOnly, readOnly: readOnly,
inputFormatters: [ // inputFormatters: [
FilteringTextInputFormatter.allow( // FilteringTextInputFormatter.allow(
RegExp(inputFormatter)), // RegExp(inputFormatter)),
], // ],
onChanged: onChanged ?? onChanged: onChanged ??
(value) { (value) {
state.didChange(value); state.didChange(value);

@ -559,7 +559,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.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -830,7 +830,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.2" version: "1.10.0-nullsafety.1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
@ -965,5 +965,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save