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

 Conflicts:
	lib/screens/patients/profile/patient_profile_screen.dart
	lib/widgets/patients/profile/profile_medical_info_widget.dart
merge-requests/353/head
Mohammad Aljammal 5 years ago
commit ee25102c2d

@ -41,7 +41,7 @@ class VitalSignsService extends BaseService {
patientVitalSigns = null; patientVitalSigns = null;
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = patient.patientId; // patient.patientMRN
body['AppointmentNo'] = patient.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
// body['EpisodeID'] = patient.episodeNo; // body['EpisodeID'] = patient.episodeNo;
body['PatientTypeID'] = 1; body['PatientTypeID'] = 1;

@ -202,16 +202,19 @@ class AuthViewModel extends BaseViewModel {
*@return:Future<Map> *@return:Future<Map>
*@desc: getDocProfiles *@desc: getDocProfiles
*/ */
Future<dynamic> getDocProfiles(docInfo) async { Future<dynamic> getDocProfiles(docInfo, {bool allowChangeProfile = true}) async {
try { try {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_DOC_PROFILES, await baseAppClient.post(GET_DOC_PROFILES,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
doctorProfile = if(allowChangeProfile) {
DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); doctorProfile =
selectedClinicName = DoctorProfileModel.fromJson(response['DoctorProfileList'][0]);
response['DoctorProfileList'][0]['ClinicDescription']; selectedClinicName =
response['DoctorProfileList'][0]['ClinicDescription'];
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: docInfo); }, body: docInfo);

File diff suppressed because it is too large Load Diff

@ -31,123 +31,128 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
body: NetworkBaseView( body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Center(
child: Column( child: Container(
// mainAxisAlignment: model.medicalFileList.length != 0 && color: Colors.white,
// model.medicalFileList != null child: Column(
// ? MainAxisAlignment.start // mainAxisAlignment: model.medicalFileList.length != 0 &&
// : MainAxisAlignment.center, // model.medicalFileList != null
children: [ // ? MainAxisAlignment.start
PatientPageHeaderWidget(patient), // : MainAxisAlignment.center,
Divider( children: [
height: 1.0, PatientPageHeaderWidget(patient),
thickness: 1.0, Divider(
color: Colors.grey, height: 1.0,
), thickness: 1.0,
(model.medicalFileList.length != 0 && color: Colors.grey,
model.medicalFileList != null) ),
? ListView.builder( (model.medicalFileList.length != 0 &&
//physics: , model.medicalFileList != null)
physics: NeverScrollableScrollPhysics(), ? ListView.builder(
scrollDirection: Axis.vertical, //physics: ,
shrinkWrap: true, physics: NeverScrollableScrollPhysics(),
itemCount: model.medicalFileList[0].entityList[0] scrollDirection: Axis.vertical,
.timelines.length, shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) { itemCount: model.medicalFileList[0].entityList[0]
return Padding( .timelines.length,
padding: EdgeInsets.symmetric( itemBuilder: (BuildContext ctxt, int index) {
horizontal: 12.0, vertical: 8.0), return Padding(
child: InkWell( padding: EdgeInsets.symmetric(
child: Container( horizontal: 12.0, vertical: 8.0),
child: Column( child: InkWell(
children: [ child: Container(
Row( child: Column(
children: [ children: [
AppText( Row(
TranslationBase.of(context).branch + children: [
": ", AppText(
fontWeight: FontWeight.w700, TranslationBase.of(context)
), .branch +
AppText(model ": ",
.medicalFileList[0]
.entityList[0]
.timelines[index]
.projectName),
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.doctorName
.toUpperCase() +
": ",
fontWeight: FontWeight.w700,
),
Expanded(
child: AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), AppText(model
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.clinicName +
": ",
fontWeight: FontWeight.w700,
),
AppText(
model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[index] .timelines[index]
.clinicName, .projectName),
), ],
], ),
), Row(
SizedBox(height: 10.0), children: [
Divider( AppText(
height: 1.0, TranslationBase.of(context)
thickness: 1.0, .doctorName
color: Colors.grey.shade400, .toUpperCase() +
) ": ",
], fontWeight: FontWeight.w700,
),
Expanded(
child: AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
fontWeight: FontWeight.w700,
),
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.clinicName +
": ",
fontWeight: FontWeight.w700,
),
AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.clinicName,
),
],
),
SizedBox(height: 10.0),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey.shade400,
)
],
),
), ),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
MedicalFileDetails(
age: patient.age,
firstName: patient.firstName,
lastName: patient.lastName,
gender:
patient.genderDescription,
encounterNumber: index,
pp: patient.patientId,
)),
);
},
), ),
onTap: () { );
Navigator.push( })
context, : Center(
MaterialPageRoute( child: Container(
builder: (context) => child: AppText(
MedicalFileDetails( 'THERES NO MEDICAL FILE FOR THIS Patient',
age: patient.age,
firstName: patient.firstName,
lastName: patient.lastName,
gender: patient.genderDescription,
encounterNumber: index,
pp: patient.patientId,
)),
);
},
), ),
);
})
: Center(
child: Container(
child: AppText(
'THERES NO MEDICAL FILE FOR THIS Patient',
), ),
), )
) ],
], ),
), ),
), ),
), ),

@ -91,7 +91,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
}); });
Navigator.of(context).pushNamed(PATIENTS, arguments: { Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues, "patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType "selectedType": _selectedType,
"isSearch": true,
}); });
} }
} else { } else {

@ -1,19 +1,22 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_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/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
import 'package:doctor_app_flutter/routes.dart'; 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/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/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';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -39,6 +42,9 @@ class _PatientsScreenState extends State<PatientsScreen> {
List date; List date;
List unFilterDate; List unFilterDate;
var clinicId;
AuthViewModel authProvider;
Color sideColor = Colors.black; Color sideColor = Colors.black;
List<PatiantInformtion> responseModelList; List<PatiantInformtion> responseModelList;
List<PatiantInformtion> responseModelList2; List<PatiantInformtion> responseModelList2;
@ -53,6 +59,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
bool _isInit = true; bool _isInit = true;
String patientType; String patientType;
bool isSearch = false;
String patientTypeTitle; String patientTypeTitle;
var _isLoading = true; var _isLoading = true;
@ -64,6 +71,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
PatientModel patient; PatientModel patient;
searchData(String str) { searchData(String str) {
this.responseModelList = this.responseModelList2; this.responseModelList = this.responseModelList2;
var strExist = str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
@ -191,14 +199,26 @@ class _PatientsScreenState extends State<PatientsScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context);
_locations = [ _locations = [
TranslationBase.of(context).all, TranslationBase
TranslationBase.of(context).today, .of(context)
TranslationBase.of(context).tomorrow, .all,
TranslationBase.of(context).nextWeek, TranslationBase
.of(context)
.today,
TranslationBase
.of(context)
.tomorrow,
TranslationBase
.of(context)
.nextWeek,
]; ];
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute
.of(context)
.settings
.arguments as Map;
patient = widget.patientSearchForm != null patient = widget.patientSearchForm != null
? widget.patientSearchForm ? widget.patientSearchForm
@ -208,6 +228,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
? widget.selectedType ? widget.selectedType
: routeArgs['selectedType']; : routeArgs['selectedType'];
if(routeArgs != null && routeArgs.containsKey("isSearch")){
isSearch = routeArgs['isSearch'];
}
if (!projectsProvider.isArabic) if (!projectsProvider.isArabic)
patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
else else
@ -229,10 +253,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
model model
.getPatientList( .getPatientList(
val2 == 7 val2 == 7
? getPatientArrivalListRequestModel.toJson() ? getPatientArrivalListRequestModel.toJson()
: patient, : patient,
patientType) patientType)
.then((res) { .then((res) {
setState(() { setState(() {
if (res != null && res['MessageStatus'] == 1) { if (res != null && res['MessageStatus'] == 1) {
@ -286,119 +310,272 @@ class _PatientsScreenState extends State<PatientsScreen> {
body: _isLoading body: _isLoading
? Container() ? Container()
: _isError : _isError
? DrAppEmbeddedError(error: error) ? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0 : lItems == null || lItems.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: error:
TranslationBase.of(context).youDontHaveAnyPatient) TranslationBase.of(context).youDontHaveAnyPatient)
: Container( : Container(
child: ListView( child: ListView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
children: <Widget>[ children: <Widget>[
Container( Container(
child: lItems == null child: lItems == null
? Column( ? Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(
0, 0, 0, 0), //250 0, 0, 0, 0), //250
child: child:
DrAppCircularProgressIndeicator(), DrAppCircularProgressIndeicator(),
)), )),
), ),
], ],
) )
: Column( : Column(
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: MediaQuery.of(context) top: MediaQuery.of(context)
.size .size
.height * .height *
0.03), 0.03),
child: SERVICES_PATIANT2[ child: SERVICES_PATIANT2[
int.parse(patientType)] == int.parse(patientType)] ==
"List_MyOutPatient" "List_MyOutPatient"
? _locationBar(context) ? _locationBar(context)
: Container(), : Container(),
), ),
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: height:
SizeConfig.screenHeight * 0.05, SizeConfig.screenHeight * 0.05,
child: TextField( child: TextField(
controller: _controller, controller: _controller,
onChanged: (String str) { onChanged: (String str) {
this.searchData(str); this.searchData(str);
}, },
decoration: buildInputDecoration( decoration: buildInputDecoration(
context, context,
TranslationBase.of(context) TranslationBase
.searchPatient), .of(context)
), .searchPatient),
), ),
SizedBox( ),
height: 10.0, SizedBox(
), height: 10.0,
Divider( ),
thickness: 0.8, if(int.parse(patientType)==7)
color: Color(0xffCCCCCC), projectsProvider
), .doctorClinicsList.length >
Container( 0
decoration: BoxDecoration( ? FractionallySizedBox(
color: Color(0Xffffffff), widthFactor: 0.9,
borderRadius: child: Column(
BorderRadius.circular(20)), children: [
margin: Container(
EdgeInsets.fromLTRB(0, 0, 0, 0), width: MediaQuery.of(context).size.width *0.8,
child: (responseModelList.length > 0) child: Center(
? Column( child: DropdownButtonHideUnderline(
// mainAxisAlignment: MainAxisAlignment.center, child: DropdownButton(
children: responseModelList dropdownColor:
.map((PatiantInformtion Colors.white,
item) { iconEnabledColor:
return PatientCard( Colors.black,
patientInfo: item, isExpanded: true,
patientType: patientType, value: clinicId == null
onTap: () { ? projectsProvider
Navigator.of(context) .doctorClinicsList[
.pushNamed( 0]
PATIENTS_PROFILE, .clinicID
arguments: { : clinicId,
"patient": item, iconSize: 25,
"patientType": elevation: 16,
patientType, selectedItemBuilder:
"from": patient (BuildContext
.getFrom, context) {
"to": return projectsProvider
patient.getTo, .doctorClinicsList
}); .map((item) {
}, return Row(
); mainAxisSize:
}).toList(), MainAxisSize
) .max,
: Center( children: <Widget>[
child: DrAppEmbeddedError( AppText(
error: TranslationBase.of( item.clinicName,
context) fontSize: SizeConfig
.youDontHaveAnyPatient), .textMultiplier *
), 2.1,
color: Colors
.black,
),
],
);
}).toList();
},
onChanged: (newValue) {
clinicId = newValue;
changeClinic(newValue, context, model);
},
items: projectsProvider
.doctorClinicsList
.map((item) {
return DropdownMenuItem(
child: Text(
item.clinicName,
textAlign:
TextAlign.end,
), ),
], value: item.clinicID,
), );
) }).toList(),
], )),
), ),
),
],
),
)
: AppText(
TranslationBase
.of(context)
.noClinic),
Divider(
thickness: 0.8,
color: Color(0xffCCCCCC),
),
Container(
decoration: BoxDecoration(
color: Color(0Xffffffff),
borderRadius:
BorderRadius.circular(20)),
margin:
EdgeInsets.fromLTRB(0, 0, 0, 0),
child: (responseModelList.length > 0)
? Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: responseModelList
.map((PatiantInformtion
item) {
return PatientCard(patientInfo: item,
patientType: patientType,
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item,
"patientType":patientType,
"from" : patient.getFrom,
"to" : patient.getTo,"isSearch" : isSearch,
});
},);
}).toList(),
)
: Center(
child: DrAppEmbeddedError(
error: TranslationBase.of(
context)
.youDontHaveAnyPatient),
), ),
),
],
),
)
],
),
),
), ),
); );
} }
changeClinic(clinicId, BuildContext context, model) async {
GifLoaderDialogUtils.showMyDialog(context);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: doctorProfile.doctorID,
clinicID: clinicId,
license: true,
projectID: doctorProfile.projectID,
tokenID: '',
languageID: 2);
authProvider.getDocProfiles(docInfo.toJson(), allowChangeProfile: false)
.then((profileList) async {
print(profileList['DoctorProfileList'][0]);
int val2 = int.parse(patientType);
GetPatientArrivalListRequestModel
getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel(
from: patient.From,
to: patient.To,
clinicID: profileList['DoctorProfileList'][0]['ClinicID'],
doctorID: profileList['DoctorProfileList'][0]['DoctorID'].toString(),
patientMRN: patient.getPatientID,
pageIndex: 0,
pageSize: 0);
model
.getPatientList(
getPatientArrivalListRequestModel.toJson(),
patientType)
.then((res) {
setState(() {
if (res != null && res['MessageStatus'] == 1) {
if (val2 == 7) {
if (res[SERVICES_PATIANT2[val2]] == null) {
_isError = true;
_isLoading = false;
this.error = error.toString();
} else {
var localList = [];
if (res["patientArrivalList"]["entityList"] == null) {
res["patientArrivalList"]["entityList"] = [];
}
res["patientArrivalList"]["entityList"].forEach((v) {
Map<String, dynamic> mergedPatient = {
...v,
...v["patientDetails"]
};
localList.add(mergedPatient);
});
lItems = localList;
}
}
parsed = lItems;
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
_isError = false;
} else {
_isError = true;
error = model.error ?? res['ErrorEndUserMessage'] ??
res['ErrorMessage'];
}
_isLoading = false;
});
GifLoaderDialogUtils.hideDialog(context);
}).catchError((error) {
helpers.showErrorToast(error.toString());
GifLoaderDialogUtils.hideDialog(context);
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
helpers.showErrorToast(err);
});
}
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
return InputDecoration( return InputDecoration(
prefixIcon: Icon(Icons.search, color: Colors.grey), prefixIcon: Icon(Icons.search, color: Colors.grey),

@ -9,12 +9,12 @@ 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/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:22/4/2020 *@Date:22/4/2020
@ -25,8 +25,7 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class PatientProfileScreen extends StatelessWidget { class PatientProfileScreen extends StatelessWidget {
PatiantInformtion patient; PatiantInformtion patient;
bool isFromSearch = false;
//TODO change it //TODO change it
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,11 +36,14 @@ class PatientProfileScreen extends StatelessWidget {
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String from = routeArgs['from']; String from = routeArgs['from'];
String to = routeArgs['to']; String to = routeArgs['to'];
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
}
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: patient.patientMRN??patient.patientId, patientMRN: patient.patientMRN ?? patient.patientId,
doctorID: '', doctorID: '',
editedBy: ''); editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP); await model.getPatientAllergy(generalGetReqForSOAP);
@ -51,449 +53,534 @@ class PatientProfileScreen extends StatelessWidget {
if (model.allergySeverityList.length == 0) { if (model.allergySeverityList.length == 0) {
await model.getMasterLookup(MasterKeysService.AllergySeverity); await model.getMasterLookup(MasterKeysService.AllergySeverity);
} }
}, },
builder: (_, model, w) =>AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).patientProfile, appBarTitle: TranslationBase.of(context).patientProfile,
body: Container(
color: Color(0XFFF2F2F2),
body: Container( child: CustomScrollView(primary: false, slivers: <Widget>[
color: Color(0XFFF2F2F2), SliverList(
child: CustomScrollView(primary: false, slivers: <Widget>[ delegate: SliverChildListDelegate(
SliverList( [
delegate: SliverChildListDelegate( Column(
[ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Container(
children: [ decoration: BoxDecoration(boxShadow: <BoxShadow>[
Container( BoxShadow(
decoration: BoxDecoration(boxShadow: <BoxShadow>[ color: Colors.grey.shade300,
BoxShadow( blurRadius: 10.0,
color: Colors.grey.shade300, spreadRadius: 0,
blurRadius: 10.0, offset: Offset(0, 10)),
spreadRadius: 0, ], color: Colors.white),
offset: Offset(0, 10)), child: Column(children: <Widget>[
], color: Colors.white), Padding(
child: Column(children: <Widget>[ padding: const EdgeInsets.all(8.0),
Padding( child: Row(
padding: const EdgeInsets.all(8.0), children: <Widget>[
child: Row( AvatarWidget(
children: <Widget>[ Icon(
AvatarWidget( patient.genderDescription == "Male"
Icon( ? DoctorApp.male
patient.genderDescription == "Male" : DoctorApp.female_icon,
? DoctorApp.male size: 70,
: DoctorApp.female_icon, color: Colors.white,
size: 70, ),
color: Colors.white, ),
), SizedBox(
), width: 20,
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
), ),
Row( Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNo, patient.firstName +
' ' +
patient.lastName,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox( Row(
width: 4, children: [
), AppText(
AppText( TranslationBase.of(context)
patient.patientId.toString(), .fileNo,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.bold,
),
SizedBox(
width: 4,
),
AppText(
patient.patientId.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
), ),
model.patientAllergiesList
.isNotEmpty &&
model.getAllergicNames(
projectViewModel
.isArabic) !=
''
? Container(
width: MediaQuery.of(context)
.size
.width *
0.65,
child: Padding(
padding: const EdgeInsets
.symmetric(vertical: 8),
child: AppText(
TranslationBase.of(
context)
.allergicTO +
" : " +
model.getAllergicNames(
projectViewModel
.isArabic),
color: Color(0xFFB9382C),
fontWeight:
FontWeight.bold,
),
),
)
: AppText(''),
], ],
), )
model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?Container( ],
width: MediaQuery.of(context).size.width *0.65, ),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
Container(
height: 11 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.fromLTRB(
child: AppText( 16.0, 8.0, 8.0, 8.0),
TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), child: Column(
color: Color(0xFFB9382C), crossAxisAlignment:
fontWeight: FontWeight.bold, CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).age,
fontWeight: FontWeight.bold,
fontSize: 2 *
SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context) /*patient.age*/}",
fontWeight: FontWeight.normal,
fontSize: 1.6 *
SizeConfig.textMultiplier,
),
],
), ),
), ),
) : AppText(''),
],
)
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
Container(
height: 11 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).age,
fontWeight: FontWeight.bold,
fontSize: 2 * SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}",
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
],
), ),
), Container(
), width: 1,
Container( color: Color(0xffCCCCCC),
width: 1,
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).nationality,
fontWeight: FontWeight.bold,
fontSize: 2 * SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient.nationalityName ??patient.nationality ,
fontWeight: FontWeight.normal,
fontSize: 1.7 * SizeConfig.textMultiplier,
),
],
), ),
), Expanded(
), child: Padding(
Container( padding: const EdgeInsets.fromLTRB(
width: 1, 16.0, 8.0, 8.0, 8.0),
color: Color(0xffCCCCCC), child: Column(
), crossAxisAlignment:
Expanded( CrossAxisAlignment.start,
child: Padding( children: [
padding: const EdgeInsets.fromLTRB( AppText(
16.0, 8.0, 8.0, 8.0), TranslationBase.of(context)
child: Column( .nationality,
crossAxisAlignment: CrossAxisAlignment.start, fontWeight: FontWeight.bold,
children: [ fontSize: 2 *
AppText( SizeConfig.textMultiplier,
TranslationBase.of(context).gender, ),
fontWeight: FontWeight.bold, SizedBox(
fontSize: 2 * SizeConfig.textMultiplier, height: 4,
), ),
SizedBox( AppText(
height: 4, patient.nationalityName ??
patient.nationality,
fontWeight: FontWeight.normal,
fontSize: 1.7 *
SizeConfig.textMultiplier,
),
],
), ),
AppText( ),
patient.gender.toString() == '1' ? 'Male' : 'Female', ),
fontWeight: FontWeight.normal, Container(
fontSize: 1.8 * SizeConfig.textMultiplier, width: 1,
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.gender,
fontWeight: FontWeight.bold,
fontSize: 2 *
SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient.gender.toString() == '1'
? 'Male'
: 'Female',
fontWeight: FontWeight.normal,
fontSize: 1.8 *
SizeConfig.textMultiplier,
),
],
), ),
], ),
), ),
), ],
), ),
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
]),
),
if (patient.admissionNo != null)
Container(
margin: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).admissionDetail,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 1.8 * SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
), ),
Container( Container(
decoration: BoxDecoration( width: double.infinity,
color: Colors.white, height: 1,
shape: BoxShape.rectangle, color: Color(0xffCCCCCC),
borderRadius: BorderRadius.circular(8), ),
border: Border.fromBorderSide(BorderSide( ]),
color: Color(0xffBBBBBB), ),
width: 1, if (patient.admissionNo != null)
)), Container(
), margin: EdgeInsets.all(16),
child: Column( child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: [
padding: EdgeInsets.all(16), AppText(
child: Column( TranslationBase.of(context)
children: [ .admissionDetail,
Row( color: Colors.black,
children: [ fontWeight: FontWeight.bold,
Container( fontSize: 1.8 * SizeConfig.textMultiplier,
width: ),
14 * SizeConfig.textMultiplier, SizedBox(
child: AppText( height: 4,
TranslationBase.of(context) ),
.dateTime, Container(
color: Colors.black, decoration: BoxDecoration(
fontWeight: FontWeight.bold, color: Colors.white,
fontSize: 1.6 * shape: BoxShape.rectangle,
SizeConfig.textMultiplier, borderRadius: BorderRadius.circular(8),
), border:
), Border.fromBorderSide(BorderSide(
Expanded( color: Color(0xffBBBBBB),
child: AppText( width: 1,
patient.createdOn != null )),
? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" ),
: "", child: Column(
color: Colors.black, children: [
fontWeight: FontWeight.normal, Padding(
fontSize: padding: EdgeInsets.all(16),
1.6 * SizeConfig.textMultiplier, child: Column(
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Container(
width:
14 * SizeConfig.textMultiplier,
child: AppText(
TranslationBase.of(context)
.admissionNo,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 1.6 *
SizeConfig.textMultiplier,
),
),
AppText(
patient.admissionNo != null
? patient.admissionNo
: '',
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize:
1.6 * SizeConfig.textMultiplier,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [ children: [
Container( Row(
width: children: [
14 * SizeConfig.textMultiplier, Container(
child: AppText( width: 14 *
TranslationBase.of(context).losNo, SizeConfig
color: Colors.black, .textMultiplier,
fontWeight: FontWeight.bold, child: AppText(
fontSize: 1.6 * TranslationBase.of(
SizeConfig.textMultiplier, context)
), .dateTime,
color: Colors.black,
fontWeight:
FontWeight.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
),
Expanded(
child: AppText(
patient.createdOn !=
null
? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}"
: "",
color: Colors.black,
fontWeight:
FontWeight.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
),
],
), ),
AppText( SizedBox(
patient.createdOn != null height: 4,
? DateUtils
.differenceBetweenServerDateAndCurrent(
patient.createdOn, context)
: "",
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize:
1.6 * SizeConfig.textMultiplier,
), ),
], Row(
),
],
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 5,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
height: 10 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( Container(
TranslationBase.of(context) width: 14 *
.area, SizeConfig
fontWeight: FontWeight.bold, .textMultiplier,
fontSize: 1.6 * child: AppText(
SizeConfig.textMultiplier, TranslationBase.of(
), context)
SizedBox( .admissionNo,
height: 4, color: Colors.black,
fontWeight:
FontWeight.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
), ),
AppText( AppText(
patient.clinicDescription, patient.admissionNo !=
fontWeight: FontWeight.normal, null
? patient.admissionNo
: '',
color: Colors.black,
fontWeight:
FontWeight.normal,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig.textMultiplier, SizeConfig
.textMultiplier,
), ),
], ],
), ),
), SizedBox(
), height: 4,
Container( ),
width: 1, Row(
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [ children: [
Expanded( Container(
child: Row( width: 14 *
crossAxisAlignment: SizeConfig
CrossAxisAlignment.start, .textMultiplier,
children: [ child: AppText(
AppText( TranslationBase.of(
TranslationBase.of(
context) context)
.room, .losNo,
fontWeight: color: Colors.black,
fontWeight:
FontWeight.bold, FontWeight.bold,
fontSize: 1.6 * fontSize: 1.6 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
),
SizedBox(
width: 4,
),
Expanded(
child: AppText(
"${patient.nursingStationName}\n${patient.roomId}",
fontWeight:
FontWeight.normal,
fontSize: 1.4 *
SizeConfig
.textMultiplier,
),
),
],
), ),
), ),
SizedBox( AppText(
height: 4, patient.createdOn != null
? DateUtils
.differenceBetweenServerDateAndCurrent(
patient
.createdOn,
context)
: "",
color: Colors.black,
fontWeight:
FontWeight.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
), ),
Expanded( ],
child: Row( ),
crossAxisAlignment: ],
CrossAxisAlignment.start, ),
children: [ ),
AppText( const Divider(
TranslationBase.of( color: Color(0xffCCCCCC),
context) height: 5,
.bed, thickness: 1,
fontWeight: indent: 0,
FontWeight.bold, endIndent: 0,
fontSize: 1.6 * ),
SizeConfig Container(
.textMultiplier, height:
), 10 * SizeConfig.textMultiplier,
SizedBox( child: Row(
width: 4, children: [
Expanded(
child: Padding(
padding: const EdgeInsets
.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
TranslationBase.of(
context)
.area,
fontWeight:
FontWeight.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient
.clinicDescription,
fontWeight:
FontWeight.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
],
),
),
),
Container(
width: 1,
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets
.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
mainAxisAlignment:
MainAxisAlignment
.spaceEvenly,
children: [
Expanded(
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
TranslationBase.of(
context)
.room,
fontWeight:
FontWeight
.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
SizedBox(
width: 4,
),
Expanded(
child: AppText(
"${patient.nursingStationName}\n${patient.roomId}",
fontWeight:
FontWeight
.normal,
fontSize: 1.4 *
SizeConfig
.textMultiplier,
),
),
],
), ),
AppText( ),
"${patient.bedId}", SizedBox(
fontWeight: height: 4,
FontWeight.normal, ),
fontSize: 1.6 * Expanded(
SizeConfig child: Row(
.textMultiplier, crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
TranslationBase.of(
context)
.bed,
fontWeight:
FontWeight
.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
SizedBox(
width: 4,
),
AppText(
"${patient.bedId}",
fontWeight:
FontWeight
.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
],
), ),
], ),
), ],
), ),
], ),
), ),
), ],
), ),
], )
), ],
) ),
], )
), ],
) ),
], ),
), ],
), ),
], ],
), ),
], ),
), SliverPadding(
padding: const EdgeInsets.all(16.0),
sliver: isFromSearch
? ProfileMedicalInfoWidgetSearch(
patient: patient,
patientType: patientType,
from: from,
to: to,
)
: ProfileMedicalInfoWidget(
patient: patient,
patientType: patientType,
from: from,
to: to,
),
)
]),
), ),
SliverPadding( ));
padding: const EdgeInsets.all(16.0),
sliver: ProfileMedicalInfoWidget(
patient: patient, patientType:patientType, from: from, to: to,
))
]),
),
));
} }
} }

@ -35,7 +35,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getPrescription(mrn: patient.patientMRN), onModelReady: (model) => model.getPrescription(mrn: 0),
builder: builder:
(BuildContext context, PrescriptionViewModel model, Widget child) => (BuildContext context, PrescriptionViewModel model, Widget child) =>
AppScaffold( AppScaffold(
@ -45,6 +45,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
color: Colors.white,
child: Column( child: Column(
children: [ children: [
PatientPageHeaderWidget(patient), PatientPageHeaderWidget(patient),
@ -135,6 +136,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
height: 50.0, height: 50.0,
width: 450.0, width: 450.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white,
border: Border.all( border: Border.all(
color: Colors.grey), color: Colors.grey),
borderRadius: borderRadius:
@ -174,12 +176,13 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
}, },
), ),
SizedBox( SizedBox(
height: 15.0, height: 10.0,
), ),
...List.generate( ...List.generate(
model.prescriptionList[0] model.prescriptionList[0]
.rowcount, .rowcount,
(index) => Container( (index) => Container(
color: Colors.white,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
@ -197,6 +200,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
// CrossAxisAlignment.start, // CrossAxisAlignment.start,
children: [ children: [
Container( Container(
color: Colors.white,
height: MediaQuery.of( height: MediaQuery.of(
context) context)
.size .size
@ -260,6 +264,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
), ),
Container( Container(
color: Colors.white,
// height: MediaQuery.of( // height: MediaQuery.of(
// context) // context)
// .size // .size
@ -324,6 +329,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
Row( Row(
children: [ children: [
Container( Container(
color: Colors
.white,
child: child:
Expanded( Expanded(
child: child:
@ -533,6 +540,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
Expanded( Expanded(
child: child:
Container( Container(
color: Colors
.white,
// height: MediaQuery.of(context).size.height * // height: MediaQuery.of(context).size.height *
// 0.038, // 0.038,
child: child:
@ -567,6 +576,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
), ),
Container( Container(
color: Colors.white,
height: MediaQuery.of( height: MediaQuery.of(
context) context)
.size .size

@ -47,6 +47,7 @@ class _NewPrescriptionHistoryScreenState
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
color: Colors.white,
child: Column( child: Column(
children: [ children: [
PatientPageHeaderWidget(patient), PatientPageHeaderWidget(patient),
@ -83,6 +84,7 @@ class _NewPrescriptionHistoryScreenState
model.prescriptionList[0] model.prescriptionList[0]
.rowcount, .rowcount,
(index) => Container( (index) => Container(
color: Colors.white,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(

@ -34,7 +34,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure(mrn: patient.patientMRN), onModelReady: (model) => model.getProcedure(mrn: 0),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -43,6 +43,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
color: Colors.white,
child: Column( child: Column(
children: [ children: [
PatientPageHeaderWidget(patient), PatientPageHeaderWidget(patient),
@ -130,6 +131,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
height: 50.0, height: 50.0,
width: 450.0, width: 450.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white,
border: Border.all( border: Border.all(
color: Colors.grey), color: Colors.grey),
borderRadius: borderRadius:
@ -189,11 +191,12 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
// ), // ),
// ), // ),
SizedBox( SizedBox(
height: 35.0, height: 10.0,
), ),
...List.generate( ...List.generate(
model.procedureList[0].rowcount, model.procedureList[0].rowcount,
(index) => Container( (index) => Container(
color: Colors.white,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.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/util/date-utils.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:flutter/material.dart'; import 'package:flutter/material.dart';
class PatientProfileButton extends StatelessWidget { class PatientProfileButton extends StatelessWidget {
@ -9,24 +11,44 @@ class PatientProfileButton extends StatelessWidget {
final String icon; final String icon;
final dynamic route; final dynamic route;
final PatiantInformtion patient; final PatiantInformtion patient;
String from;
String to;
final String url = "assets/images/"; final String url = "assets/images/";
final bool isDisable;
final bool isLoading;
final Function onTap;
PatientProfileButton( PatientProfileButton(
{Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route}) {Key key,
this.patient,
this.nameLine1,
this.nameLine2,
this.icon,
this.route,
this.isDisable = false,
this.onTap,
this.isLoading = false,
this.from,
this.to})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0), margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell( child: InkWell(
onTap: () { onTap: isDisable
? null
: onTap != null
? onTap
: () {
navigator(context, this.route); navigator(context, this.route);
}, },
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: child: Column(
Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
@ -43,6 +65,7 @@ class PatientProfileButton extends StatelessWidget {
textAlign: TextAlign.left, textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
), ),
if (isLoading) DrAppCircularProgressIndeicator()
], ],
), ),
), ),
@ -61,7 +84,7 @@ class PatientProfileButton extends StatelessWidget {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
// border: Border.all(), // border: Border.all(),
color: Colors.white, color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide( border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB), color: Color(0xffBBBBBB),
@ -81,6 +104,13 @@ class PatientProfileButton extends StatelessWidget {
} }
void navigator(BuildContext context, route) { void navigator(BuildContext context, route) {
Navigator.of(context).pushNamed(route, arguments: {'patient': patient}); if (from == null) {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null) {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
Navigator.of(context).pushNamed(route,
arguments: {'patient': patient, 'from': from, 'to': to});
} }
} }

@ -7,6 +7,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/profile/PatientProfileButton.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:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -15,22 +16,15 @@ import 'package:hexcolor/hexcolor.dart';
import '../../../config/size_config.dart'; import '../../../config/size_config.dart';
import '../../shared/app_texts_widget.dart'; import '../../shared/app_texts_widget.dart';
/*
*@author: Elham Rababah
*@Date:22/4/2020
*@param:
*@return:ProfileMedicalInfoWidget
*@desc: Profile Medical Info Widget
*/
class ProfileMedicalInfoWidget extends StatelessWidget { class ProfileMedicalInfoWidget extends StatelessWidget {
ProfileMedicalInfoWidget(
{Key key, this.patient, this.patientType, this.from, this.to});
String from; String from;
String to; String to;
//TODO change it
PatiantInformtion patient; PatiantInformtion patient;
String patientType; String patientType;
ProfileMedicalInfoWidget(
{Key key, this.patient, this.patientType, this.from, this.to});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
@ -137,7 +131,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
? PatientProfileButton( ? PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
route: ORDER_PRESCRIPTION, route: ORDER_PRESCRIPTION_HISTORY,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: 'lab.png') icon: 'lab.png')
@ -185,162 +179,3 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
); );
} }
} }
class CircleAvatarWidget extends StatelessWidget {
const CircleAvatarWidget(
{Key key,
@required this.url,
@required this.des,
this.height,
this.width})
: super(key: key);
final String url;
final String des;
final double height;
final double width;
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Container(
height: height,
width: width,
// width: 50,
// height: 50,
decoration: new BoxDecoration(
// color: Colors.green, // border color
shape: BoxShape.circle,
border: Border.all(color: HexColor('#B7831A'), width: 1.5)),
child: CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
child: Image.asset(url),
backgroundColor: Colors.transparent,
),
),
SizedBox(
height: 10,
),
AppText(
des,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
)
],
),
);
}
}
class PatientProfileButton extends StatelessWidget {
final String nameLine1;
final String nameLine2;
final String icon;
final dynamic route;
final PatiantInformtion patient;
String from;
String to;
final String url = "assets/images/";
final bool isDisable;
final bool isLoading;
final Function onTap;
PatientProfileButton(
{Key key,
this.patient,
this.nameLine1,
this.nameLine2,
this.icon,
this.route,
this.isDisable = false,
this.onTap,
this.isLoading = false,
this.from,
this.to})
: super(key: key);
@override
Widget build(BuildContext context) {
return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell(
onTap: isDisable
? null
: onTap != null
? onTap
: () {
navigator(context, this.route);
},
child: Column(children: <Widget>[
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
this.nameLine1,
color: Color(0xFFB9382C),
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
AppText(
this.nameLine2,
color: Colors.black,
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
if (isLoading) DrAppCircularProgressIndeicator()
],
),
),
Expanded(
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
child: new Image.asset(url + icon))
],
)),
)
]),
),
decoration: BoxDecoration(
// border: Border.all(),
color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
width: 1,
)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.fromLTRB(5, 10, 5, 5),
);
}
void navigator(BuildContext context, route) {
if (from == null) {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null) {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
Navigator.of(context).pushNamed(route,
arguments: {'patient': patient, 'from': from, 'to': to});
}
}

@ -0,0 +1,94 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../config/size_config.dart';
import '../../shared/app_texts_widget.dart';
class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
String from;
String to;
PatiantInformtion patient;
String patientType;
ProfileMedicalInfoWidgetSearch(
{Key key, this.patient, this.patientType, this.from, this.to});
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => SliverGrid.count(
crossAxisSpacing: 10,
mainAxisSpacing: 20,
crossAxisCount: 2,
childAspectRatio: 1.5,
children: [
PatientProfileButton(
key: key,
patient: patient,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'heartbeat.png'),
PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_INSURANCE_APPROVALS,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'lab.png'),
PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_ADMISSION_REQUEST,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'heartbeat.png'),
(int.parse(patientType) == 7 || int.parse(patientType) == 6)
? PatientProfileButton(
key: key,
patient: patient,
route: ORDER_PRESCRIPTION,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'lab.png')
: PatientProfileButton(
key: key,
patient: patient,
route: ORDER_PRESCRIPTION_HISTORY,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'lab.png'),
PatientProfileButton(
key: key,
patient: patient,
route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'sick_leaves_icons.png'),
PatientProfileButton(
key: key,
patient: patient,
route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'radiology-1.png'),
],
),
);
}
}
Loading…
Cancel
Save