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

 Conflicts:
	lib/core/model/PatientSearchRequestModel.dart
	lib/core/viewModel/PatientSearchViewModel.dart
	lib/locator.dart
merge-requests/594/head
Elham Rababah 5 years ago
commit 56a5209d92

@ -152,6 +152,9 @@ const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure';
const GET_PATIENT_ARRIVAL_LIST =
'Services/DoctorApplication.svc/REST/PatientArrivalList';
const GET_PATIENT_IN_PATIENT_LIST =
'Services/DoctorApplication.svc/REST/GetMyInPatient';
const Verify_Referral_Doctor_Remarks =
'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';

@ -48,6 +48,7 @@ const Map<String, Map<String, String>> localizedValues = {
'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'الإحالة'},
'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'},
'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'},
'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'},
@ -782,7 +783,7 @@ const Map<String, Map<String, String>> localizedValues = {
},
"show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"},
"open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"},
"open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"},
'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"},
'searchPatient-name': {

@ -15,13 +15,13 @@ class PatientSearchRequestModel {
PatientSearchRequestModel(
{this.doctorID =0,
this.firstName ="0",
this.middleName="0",
this.lastName="0",
this.patientMobileNumber="0",
this.patientIdentificationID="0",
this.middleName ="0",
this.lastName ="0",
this.patientMobileNumber ="0",
this.patientIdentificationID ="0",
this.patientID =0,
this.from="0",
this.to="0"});
this.from ="0",
this.to ="0"});
PatientSearchRequestModel.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];

@ -125,7 +125,7 @@ class FinalRadiology {
orderNo = json['OrderNo'];
projectName = json['ProjectName'];
qR = json['QR'];
isLiveCareAppodynamicment = json['IsLiveCareAppodynamicment'];
isLiveCareAppodynamicment = json['IsLiveCareAppointment'];
reportDataHTML = json['ReportDataHTML'];
reportDataTextdynamic = json['ReportDataTextdynamic'];
// speciality = json['Speciality'].cast<dynamic>();

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/widgets/shared/StarRating.dart';
class SickLeavePatientModel {
String setupID;
int projectID;
@ -30,8 +32,10 @@ class SickLeavePatientModel {
dynamic patientName;
String projectName;
String qR;
List<String> speciality;
// List<String> speciality;
String strRequestDate;
String startDate;
String endDate;
SickLeavePatientModel(
{this.setupID,
@ -65,11 +69,14 @@ class SickLeavePatientModel {
this.patientName,
this.projectName,
this.qR,
this.speciality,
this.strRequestDate});
// this.speciality,
this.strRequestDate,
this.startDate,
this.endDate});
SickLeavePatientModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
patientType = json['PatientType'];
@ -100,13 +107,16 @@ class SickLeavePatientModel {
patientName = json['PatientName'];
projectName = json['ProjectName'];
qR = json['QR'];
speciality = json['Speciality'].cast<String>();
// speciality = json['Speciality'].cast<String>();
strRequestDate = json['StrRequestDate'];
startDate = json['StartDate'];
endDate = json['EndDate'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType;
@ -137,8 +147,10 @@ class SickLeavePatientModel {
data['PatientName'] = this.patientName;
data['ProjectName'] = this.projectName;
data['QR'] = this.qR;
data['Speciality'] = this.speciality;
// data['Speciality'] = this.speciality;
data['StrRequestDate'] = this.strRequestDate;
data['StartDate'] = this.startDate;
data['EndDate'] = this.endDate;
return data;
}
}

@ -71,14 +71,19 @@ class VitalSignsService extends BaseService {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientID'] = patient.patientId;
body['PatientTypeID'] = 1;
if(isInPatient){
body['InOutPatientType'] = 1;
}else {
body['InOutPatientType'] = 2;
body['PatientTypeID'] = patient.patientType;
// if(isInPatient){
body['InOutPatientType'] = 0;
// }else {
// body['InOutPatientType'] = 2;
// }
if (patient.appointmentNo != null && patient.projectId != null) {
body['TransNo'] = patient.appointmentNo;
body['ProjectID'] = patient.projectId;
}
await baseAppClient.post(
await baseAppClient.postPatient(
GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
patientVitalSignsHistory.clear();
@ -93,6 +98,7 @@ class VitalSignsService extends BaseService {
super.error = error.toString();
},
body: body,
patient: patient
);
}
}

@ -0,0 +1,36 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class PatientInPatientService extends BaseService {
List<PatiantInformtion> inPatientList = List();
Future getInPatientList(
PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false;
await getDoctorProfile();
if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID;
}else {
requestModel.doctorID = 0;
}
await baseAppClient.post(
GET_PATIENT_IN_PATIENT_LIST,
onSuccess: (dynamic response, int statusCode) {
inPatientList.clear();
response['List_MyInPatient'].forEach((v) {
inPatientList.add(PatiantInformtion.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: requestModel.toJson(),
);
}
}

@ -98,13 +98,13 @@ class SickLeaveService extends BaseService {
Future getSickLeave(patientMRN) async {
hasError = false;
await baseAppClient.post(
await baseAppClient.postPatient(
GET_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
_getAllsickLeave.clear();
response['SickLeavesList']['entityList'].forEach((v) {
_getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v));
_getAllsickLeavePatient.clear();
response['List_SickLeave'].forEach((v) {
_getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
@ -115,26 +115,26 @@ class SickLeaveService extends BaseService {
);
}
// Future getSickLeavePatient(patientMRN) async {
// _sickLeavePatientRequestModel =
// SickLeavePatientRequestModel(patientID: patientMRN, patientType: 1);
// hasError = false;
// await baseAppClient.post(
// GET_SICK_LEAVE_PATIENT,
// onSuccess: (dynamic response, int statusCode) {
// Future.value(response);
// _getAllsickLeavePatient.clear();
// response['List_SickLeave'].forEach((v) {
// _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v));
// });
// },
// onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// },
// body: _sickLeavePatientRequestModel.toJson(),
// );
// }
Future getSickLeavePatient(patientMRN) async {
_sickLeavePatientRequestModel = SickLeavePatientRequestModel(
patientID: patientMRN, patientTypeID: 2, patientType: 1);
hasError = false;
await baseAppClient.postPatient(
GET_SICK_LEAVE_PATIENT,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
_getAllsickLeavePatient.clear();
response['List_SickLeave'].forEach((v) {
_getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _sickLeavePatientRequestModel.toJson(),
);
}
Future getRescheduleLeave() async {
hasError = false;

@ -5,6 +5,12 @@ import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import '../../locator.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/patientInPatientService.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@ -105,5 +111,49 @@ class PatientSearchViewModel extends BaseViewModel{
}
}
class PatientSearchViewModel extends BaseViewModel {
PatientInPatientService _inPatientService =
locator<PatientInPatientService>();
List<PatiantInformtion> get _inPatientList => _inPatientService.inPatientList;
List<PatiantInformtion> filteredInPatientItems = List();
Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false}) async {
setState(ViewState.Busy);
await _inPatientService.getInPatientList(requestModel, isMyInpatient);
if (_inPatientService.hasError) {
error = _inPatientService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
filteredInPatientItems.clear();
filteredInPatientItems.addAll(_inPatientList);
}
}
void filterSearchResults(String query) {
var strExist = query.length > 0 ? true : false;
if (strExist) {
filteredInPatientItems = [];
for (var i = 0; i < _inPatientList.length; i++) {
String firstName = _inPatientList[i].firstName.toUpperCase();
String lastName = _inPatientList[i].lastName.toUpperCase();
String mobile = _inPatientList[i].mobileNumber.toUpperCase();
String patientID = _inPatientList[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
mobile.contains(query) ||
patientID.contains(query)) {
filteredInPatientItems.add(_inPatientList[i]);
}
}
notifyListeners();
} else {
filteredInPatientItems = _inPatientList;
notifyListeners();
}
}
}
}

@ -52,12 +52,13 @@ class VitalSignsViewModel extends BaseViewModel {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient);
// if (isInPatient) {
// await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient);
// } else {
// await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
// }
if (isInPatient) {
await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
} else {
await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient);
}
if (_vitalSignService.hasError) {
error = _vitalSignService.error;

@ -10,6 +10,7 @@ class SickLeaveViewModel extends BaseViewModel {
SickLeaveService _sickLeaveService = locator<SickLeaveService>();
get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics;
get getAllSIckLeave => _sickLeaveService.getAllSickLeave;
get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient;
List get allOffTime => _sickLeaveService.getOffTimeList;
List get allReasons => _sickLeaveService.getReasons;
List get coveringDoctors => _sickLeaveService.coveringDoctorsList;
@ -56,6 +57,16 @@ class SickLeaveViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getSickLeavePatient(patientMRN) async {
setState(ViewState.Busy);
await _sickLeaveService.getSickLeavePatient(patientMRN);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getRescheduleLeave() async {
setState(ViewState.Busy);
await _sickLeaveService.getRescheduleLeave();

@ -28,6 +28,7 @@ import 'core/service/patient-doctor-referral-service.dart';
import 'core/service/patient-ucaf-service.dart';
import 'core/service/patient-vital-signs-service.dart';
import 'core/service/patient/out_patient_service.dart';
import 'core/service/patientInPatientService.dart';
import 'core/service/prescriptions_service.dart';
import 'core/service/radiology_service.dart';
import 'core/service/referral_patient_service.dart';
@ -81,6 +82,7 @@ void setupLocator() {
locator.registerLazySingleton(() => ReferralService());
locator.registerLazySingleton(() => MyReferralInPatientService());
locator.registerLazySingleton(() => DischargedPatientService());
locator.registerLazySingleton(() => PatientInPatientService());
locator.registerLazySingleton(() => OutPatientService());
/// View Model

@ -64,6 +64,7 @@ class MyReferredPatientModel {
String referralClinicDescription;
String referringDoctorName;
bool isReferralDoctorSameBranch;
String referralStatusDesc;
MyReferredPatientModel({
this.rowID,
@ -128,7 +129,7 @@ class MyReferredPatientModel {
this.referringDoctorName,
this.isReferralDoctorSameBranch,
this.referralDoctorName,
this.referralClinicDescription,
this.referralClinicDescription,this.referralStatusDesc
});
MyReferredPatientModel.fromJson(Map<String, dynamic> json) {
@ -194,6 +195,7 @@ class MyReferredPatientModel {
referringDoctorName = json['ReferringDoctorName'];
referralDoctorName = json['ReferralDoctorName'];
referralClinicDescription = json['ReferralClinicDescription'];
referralStatusDesc = json['ReferralStatusDesc'];
}
Map<String, dynamic> toJson() {

@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart';
import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen_new.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart';
@ -31,6 +32,7 @@ import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.d
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-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/transitions/fade_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -495,15 +497,21 @@ class _HomeScreenState extends State<HomeScreen> {
),
hasBorder: false,
onTap: () {
getRequestHeader(true);
Navigator.of(context)
.pushNamed(PATIENTS, arguments: {
"patientSearchForm":
_patientSearchFormValues,
"selectedType": "1",
"arrivalType": "1",
"isInpatient": true
});
Navigator.push(
context,
FadePage(
page: PatientInPatientScreen(),
),
);
// getRequestHeader(true);
// Navigator.of(context)
// .pushNamed(PATIENTS, arguments: {
// "patientSearchForm":
// _patientSearchFormValues,
// "selectedType": "1",
// "arrivalType": "1",
// "isInpatient": true
// });
},
),
HomePageCard(

@ -0,0 +1,189 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import '../../routes.dart';
class PatientInPatientScreen extends StatefulWidget {
@override
_PatientInPatientScreenState createState() => _PatientInPatientScreenState();
}
class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
int _activeTab = 0;
TextEditingController _searchController = TextEditingController();
@override
void dispose() {
_searchController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientSearchViewModel>(
onModelReady: (model) => model.getInPatientList(requestModel),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
TranslationBase.of(context).inPatient,
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
fontFamily: 'Poppins',
),
),
]),
),
),
tabsBar(context, screenSize, model),
model.filteredInPatientItems.length > 0
? Expanded(
child: Container(
margin: EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.searchPatientName,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
onPressed: () {},
),
controller: _searchController,
onChanged: (value) {
model.filterSearchResults(value);
}),
const SizedBox(
height: 16,
),
...model.filteredInPatientItems.map((item) {
return PatientCard(
patientInfo: item,
patientType: "1",
arrivalType: "1",
isInpatient: true,
onTap: () {
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": item,
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
}).toList(),
],
),
),
),
)
: Container(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable)),
],
),
),
);
}
Widget tabsBar(
BuildContext context, Size screenSize, PatientSearchViewModel model) {
List<String> _tabs = [
TranslationBase.of(context).inPatientAll.toUpperCase(),
TranslationBase.of(context).inPatient.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _tabs.map((item) {
bool _isActive = _tabs[_activeTab] == item ? true : false;
return Expanded(
child: InkWell(
onTap: () async {
setState(() {
_activeTab = _tabs.indexOf(item);
});
// GifLoaderDialogUtils.showMyDialog(
// context);
await model.getInPatientList(requestModel,
isMyInpatient: _activeTab == 1);
},
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
_isActive
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
item,
fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
),
);
}).toList(),
),
);
}
}

@ -3,6 +3,7 @@ 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/patients/profile/lab_result/laboratory_result_page.dart';
import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -37,7 +38,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getLabs(patient, isInpatient: isInpatient),
onModelReady: (model) => model.getLabs(patient, isInpatient: false),
builder: (context, ProcedureViewModel model, widget) => AppScaffold(
baseViewModel: model,
backgroundColor: Colors.grey[100],
@ -105,42 +106,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
)),
);
},label: 'Apply for New Lab Order',),
if(!isInpatient)
Container(
margin: EdgeInsets.only(right: 8),
width: double.maxFinite,
child: InkWell(
onTap: (){
setState(() {
isInpatient= true;
});
model.getLabs(patient, isInpatient: true);
},
child: Align(
alignment: Alignment.centerRight,
child: AppText('View Inpatient Lab Result',
textDecoration:TextDecoration.underline,color: Colors.red,),
),
),
),
if(isInpatient)
Container(
width: double.maxFinite,
margin: EdgeInsets.only(right: 8),
child: InkWell(
onTap: (){
setState(() {
isInpatient= false;
});
model.getLabs(patient, isInpatient: false);
},
child: Align(
alignment: Alignment.centerRight,
child: AppText('View Outpatient Lab Result',
textDecoration:TextDecoration.underline,color: Colors.red,),
),
),
),
...List.generate(
model.patientLabOrdersList.length,
(index) => Column(
@ -149,26 +115,80 @@ class _LabsHomePageState extends State<LabsHomePage> {
children: model
.patientLabOrdersList[index].patientLabOrdersList
.map((labOrder) {
return DoctorCard(
onTap: () => Navigator.push(
context,
FadePage(
page: LaboratoryResultPage(
patientLabOrders: labOrder,
patient: patient,
arrivalType: arrivalType,
patientType: patientType,
return Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
color: Colors.white),
child: Row(
children: [
Container(
width: 20,
height: 160,
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: labOrder.isLiveCareAppointment
? Colors.red[900]
: !labOrder.isInOutPatient
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8),
),
),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
labOrder.isLiveCareAppointment
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !labOrder.isInOutPatient
? TranslationBase.of(context)
.inPatient
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),
),
Expanded(
child: DoctorCard(
isNoMargin: true,
onTap: () => Navigator.push(
context,
FadePage(
page: LaboratoryResultPage(
patientLabOrders: labOrder,
patient: patient,
arrivalType: arrivalType,
patientType: patientType,
),
),
),
doctorName: labOrder.doctorName,
invoiceNO: ' ${labOrder.invoiceNo}',
profileUrl: labOrder.doctorImageURL,
branch: labOrder.projectName,
clinic: labOrder.clinicDescription,
appointmentDate: labOrder.orderDate,
orderNo: labOrder.orderNo,
isShowTime: false,
),
),
),
],
),
doctorName: labOrder.doctorName,
invoiceNO: ' ${labOrder.invoiceNo}',
profileUrl: labOrder.doctorImageURL,
branch: labOrder.projectName,
clinic: labOrder.clinicDescription,
appointmentDate: labOrder.orderDate,
orderNo: labOrder.orderNo,
isShowTime: false,
);
}).toList(),
),

@ -64,17 +64,18 @@ class RadiologyDetailsPage extends StatelessWidget {
SizedBox(
height: 5,
),
AppText(TranslationBase.of(context).generalResult),
SizedBox(
height: 5,
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
'${finalRadiology.reportData.trim()}',
textAlign: TextAlign.start,
fontSize: 17,
color: Colors.grey,
color: Color(0xff575757),
),
),
SizedBox(
@ -94,8 +95,9 @@ class RadiologyDetailsPage extends StatelessWidget {
margin:
EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: SecondaryButton(
color: Colors.red[600],
color: Color(0xffD02127),
disabled: finalRadiology.dIAPACSURL == "",
textColor: Color(0xffFFFFFF),
onTap: () {
launch(model.radImageURL);
},

@ -4,6 +4,7 @@ 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/patients/profile/radiology/radiology_details_page.dart';
import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -24,6 +25,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
PatiantInformtion patient;
String arrivalType;
bool isInpatient;
@override
void didChangeDependencies() {
super.didChangeDependencies();
@ -38,8 +40,8 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) =>
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: isInpatient),
onModelReady: (model) => model.getPatientRadOrders(patient,
patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],
@ -112,63 +114,81 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
},
label: 'Apply for Radiology Order',
),
if(!isInpatient)
Container(
width: double.maxFinite,
margin: EdgeInsets.only(right: 8),
child: InkWell(
onTap: (){
setState(() {
isInpatient = true;
});
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: true);
},
child: Align(
alignment: Alignment.centerRight,
child: AppText('View Inpatient Lab Result',
textDecoration:TextDecoration.underline,color: Colors.red,),
),
),
),
if(isInpatient)
Container(
margin: EdgeInsets.only(right: 8),
width: double.maxFinite,
child: InkWell(
onTap: (){
setState(() {
isInpatient = false;
});
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false);
},
child: Align(
alignment: Alignment.centerRight,
child: AppText('View Outpatient Lab Result',
textDecoration:TextDecoration.underline,color: Colors.red,),
),
),
),
...List.generate(
model.radiologyList.length,
(index) => InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: RadiologyDetailsPage(
finalRadiology: model.radiologyList[index],
patient: patient,
(index) => Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
),
),
child: DoctorCard(
doctorName: model.radiologyList[index].doctorName,
profileUrl: model.radiologyList[index].doctorImageURL,
invoiceNO: '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}',
clinic: model.radiologyList[index].clinicDescription,
appointmentDate:
!isInpatient?model.radiologyList[index].orderDate :
model.radiologyList[index].reportDate,
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
color: Colors.white),
child: Row(
children: [
Container(
width: 20,
height: 160,
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: model.radiologyList[index].isLiveCareAppodynamicment
? Colors.red[900]
: !model.radiologyList[index].isInOutPatient
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8),
),
),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
model.radiologyList[index].isLiveCareAppodynamicment
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !model.radiologyList[index].isInOutPatient
? TranslationBase.of(context)
.inPatient
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),
),
Expanded(
child: DoctorCard(
isNoMargin: true,
doctorName: model.radiologyList[index].doctorName,
profileUrl: model.radiologyList[index].doctorImageURL,
invoiceNO: '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}',
clinic: model.radiologyList[index].clinicDescription,
appointmentDate: !isInpatient
? model.radiologyList[index].orderDate
: model.radiologyList[index].reportDate,
onTap: () {
Navigator.push(
context,
FadePage(
page: RadiologyDetailsPage(
finalRadiology: model.radiologyList[index],
patient: patient,
),
),
);
},
),
),
],
),
)),
if (model.radiologyList.isEmpty &&

@ -66,8 +66,7 @@ class ReferredPatientScreen extends StatelessWidget {
);
},
child: PatientReferralItemWidget(
referralStatus:
"${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}",
referralStatus:model.getReferredPatientItem(index).referralStatusDesc,
referralStatusCode: model
.getReferredPatientItem(index)
.referralStatus,

@ -146,7 +146,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
MainAxisAlignment.spaceBetween,
children: [
AppText(
"${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}",
referredPatient.referralStatusDesc,
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700,

@ -284,118 +284,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column(
//mainAxisAlignment: MainAxisAlignment.end,
children: [
// Container(
// height: MediaQuery.of(context).size.height *
// 0.070,
// color: Colors.white,
// child: InkWell(
// onTap: model.allMedicationList != null
// ? () {
// Helpers.hideKeyboard(context);
// setState(() {
// _selectedMedication = null;
// model.getItem(
// itemID: _selectedMedication
// .itemId);
// });
// }
// : null,
// child: _selectedMedication == null
// ? AutoCompleteTextField<
// GetMedicationResponseModel>(
// onFocusChanged: (__) {
// if (_selectedMedication !=
// null) {
// model.getItem(
// itemID:
// _selectedMedication
// .itemId);
// uom = _selectedMedication.uom;
// } else {
// null;
// }
// if (_selectedMedication !=
// null &&
// duration != null &&
// frequency != null &&
// strengthController.text !=
// null) {
// model.getBoxQuantity(
// freq: frequency[
// 'parameterCode'],
// duration: duration['id'],
// itemCode:
// _selectedMedication
// .itemId,
// strength: double.parse(
// strengthController
// .text));
// box = model.boxQuintity;
//
// return;
// }
// },
// decoration:
// textFieldSelectorDecoration(
// TranslationBase.of(context)
// .searchMedicineNameHere,
// _selectedMedication != null
// ? _selectedMedication
// .genericName
// : null,
// true,
// ),
// itemSubmitted: (item) => setState(
// () => _selectedMedication =
// item),
// key: key,
// suggestions:
// model.allMedicationList,
// itemBuilder: (context,
// suggestion) =>
// new Padding(
// child: AppText(suggestion
// .description +
// '/' +
// suggestion
// .genericName),
// padding:
// EdgeInsets.all(15.0)),
// itemSorter: (a, b) => 1,
// suggestionsAmount: 7,
// itemFilter: (suggestion, input) =>
// suggestion.genericName.toLowerCase().startsWith(
// input.toLowerCase()) ||
// suggestion.description
// .toLowerCase()
// .startsWith(input
// .toLowerCase()) ||
// suggestion.keywords
// .toLowerCase()
// .startsWith(
// input.toLowerCase()),
// )
// : TextField(
// onEditingComplete: () {
// model.getItem(
// itemID: _selectedMedication
// .itemId);
// },
// decoration: textFieldSelectorDecoration(
// TranslationBase.of(context)
// .searchMedicineNameHere,
// _selectedMedication != null
// ? _selectedMedication
// .description +
// ('${_selectedMedication.genericName}')
// : null,
// false,
// suffixIcon:
// Icon(Icons.search)),
// enabled: false,
// ),
// ),
// ),
FractionallySizedBox(
widthFactor: 0.9,
child: Container(

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
@ -22,7 +23,7 @@ class AddSickLeavScreen extends StatelessWidget {
patient = routeArgs['patient'];
return BaseView<SickLeaveViewModel>(
onModelReady: (model) =>
model.getSickLeave(patient.patientMRN ?? patient.patientId),
model.getSickLeavePatient(patient.patientMRN ?? patient.patientId),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
@ -102,25 +103,26 @@ class AddSickLeavScreen extends StatelessWidget {
],
)
: SizedBox(),
model.getAllSIckLeave.length > 0
model.getAllSIckLeavePatient.length > 0
? Column(
children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) {
children: model.getAllSIckLeavePatient
.map<Widget>((SickLeavePatientModel item) {
return RoundedContainer(
margin: EdgeInsets.all(10),
child: Column(
children: [
Container(
decoration: BoxDecoration(
border: Border(
left: BorderSide(
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
width: 5.0,
))),
// decoration: BoxDecoration(
// border: Border(
// left: BorderSide(
// // color: item.status == 1
// // ? Colors.yellow[800]
// // : item.status == 2
// // ? Colors.green
// // : Colors.black,
// color: Colors.red,
// width: 5.0,
// ))),
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment:
@ -139,35 +141,37 @@ class AddSickLeavScreen extends StatelessWidget {
Container(
padding: EdgeInsets.all(3),
child: AppText(
item.status == 1
? TranslationBase.of(
context)
.hold
: item.status == 2
? TranslationBase
.of(
context)
.active
: TranslationBase
.of(context)
.all,
item.doctorName,
// item.status == 1
// ? TranslationBase.of(
// context)
// .hold
// : item.status == 2
// ? TranslationBase
// .of(
// context)
// .active
// : TranslationBase
// .of(context)
// .all,
fontWeight:
FontWeight.bold,
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
// color: item.status == 1
// ? Colors.yellow[800]
// : item.status == 2
// ? Colors.green
// : Colors.black,
color: Colors.red,
),
),
Row(
children: [
AppText(TranslationBase
.of(context)
.daysSickleave +
": "),
AppText(
TranslationBase.of(
context)
.daysSickleave),
AppText(
item.noOfDays
item.sickLeaveDays
.toString(),
fontWeight:
FontWeight.bold,
@ -183,52 +187,55 @@ class AddSickLeavScreen extends StatelessWidget {
' ',
),
Flexible(
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight:
FontWeight.bold,
))
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight:
FontWeight.bold,
),
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
AppText(
item.remarks ?? "",
children: [
AppText(
TranslationBase.of(
context)
.endDate +
' ',
),
Flexible(
child: AppText(
DateUtils
.convertStringToDateFormat(
item.endDate,
'dd-MMM-yyyy'),
fontWeight:
FontWeight.bold,
),
// (item.status == 1 ||
// item.status == 2)
// ? IconButton(
// icon: Image.asset(
// 'assets/images/edit.png'),
//
// // color: Colors.green, //Colors.black,
// onPressed: () => {
// if (item.status ==
// 1)
// {
// DrAppToastMsg.showErrorToast(
// TranslationBase.of(
// context)
// .sickleaveonhold)
// }
// else
// {
// openSickLeave(
// context,
// true,
// extendedData:
// item)
// }
// },
// )
// : SizedBox()
]),
)
],
),
Row(children: [
AppText(TranslationBase.of(
context)
.branch +
": "),
AppText(
item.projectName ?? "",
),
]),
Row(children: [
AppText(TranslationBase.of(
context)
.clinic +
": "),
AppText(
item.clinicName ?? "",
),
]),
],
),
SizedBox(

@ -101,6 +101,8 @@ class TranslationBase {
String get inPatient => localizedValues['inPatient'][locale.languageCode];
String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode];
String get operations => localizedValues['operations'][locale.languageCode];
String get patientServices =>

@ -238,11 +238,9 @@ class _SecondaryButtonState extends State<SecondaryButton>
widget.label,
style: TextStyle(
color: widget.textColor,
fontSize: widget.small ? 12.0 : 15.0,
// fontWeight: FontWeight.w800,
fontFamily: projectViewModel.isArabic
? 'Cairo'
: 'Poppins'),
fontSize: 16,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins'),
),
)
],

@ -20,6 +20,7 @@ class DoctorCard extends StatelessWidget {
final String clinic;
final bool isShowEye;
final bool isShowTime;
final bool isNoMargin;
DoctorCard(
{this.doctorName,
@ -31,13 +32,13 @@ class DoctorCard extends StatelessWidget {
this.orderNo,
this.isPrescriptions = false,
this.clinic,
this.isShowEye = true, this.isShowTime= true});
this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
margin: EdgeInsets.all(10),
margin: EdgeInsets.all(!isNoMargin? 10:0),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,

@ -4,11 +4,11 @@ class TextFieldsUtils{
static BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor,
{double borderWidth = -1}) {
{double borderWidth = -1, double borderRadius = 12}) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(12)),
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: borderWidth == -1 ? 2.0 : borderWidth,

Loading…
Cancel
Save