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

 Conflicts:
	lib/config/config.dart
merge-requests/688/head
hussam al-habibeh 5 years ago
commit 36ce997529

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

@ -4,7 +4,7 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
//const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
@ -297,6 +297,9 @@ const GET_PROCEDURE_TEMPLETE =
const GET_PROCEDURE_TEMPLETE_DETAILS = const GET_PROCEDURE_TEMPLETE_DETAILS =
"Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet";
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP ='Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
var selectedPatientType = 1; var selectedPatientType = 1;

@ -996,4 +996,5 @@ const Map<String, Map<String, String>> localizedValues = {
"impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"},
"onHold": {"en": "'On Hold'", "ar": "قيد الانتظار"}, "onHold": {"en": "'On Hold'", "ar": "قيد الانتظار"},
"verified": {"en": "'Verified'", "ar": "Verified"}, "verified": {"en": "'Verified'", "ar": "Verified"},
"endCall": {"en": "'End'", "ar": "انهاء"},
}; };

@ -0,0 +1,22 @@
class PendingPatientERForDoctorAppRequestModel {
bool outSA;
int doctorID;
String sErServiceID;
PendingPatientERForDoctorAppRequestModel(
{this.outSA, this.doctorID, this.sErServiceID});
PendingPatientERForDoctorAppRequestModel.fromJson(Map<String, dynamic> json) {
outSA = json['OutSA'];
doctorID = json['DoctorID'];
sErServiceID = json['SErServiceID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['OutSA'] = this.outSA;
data['DoctorID'] = this.doctorID;
data['SErServiceID'] = this.sErServiceID;
return data;
}
}

@ -6,7 +6,8 @@ class DashboardService extends BaseService {
List<DashboardModel> _dashboardItemsList = []; List<DashboardModel> _dashboardItemsList = [];
List<DashboardModel> get dashboardItemsList => _dashboardItemsList; List<DashboardModel> get dashboardItemsList => _dashboardItemsList;
// DashboardModel _dashboard = DashboardModel(); bool hasVirtualClinic = false;
String sServiceID;
Future getDashboard() async { Future getDashboard() async {
hasError = false; hasError = false;
@ -28,4 +29,22 @@ class DashboardService extends BaseService {
}, },
); );
} }
Future checkDoctorHasLiveCare() async {
hasError = false;
await baseAppClient.post(
DOCTOR_CHECK_HAS_LIVE_CARE,
onSuccess: (dynamic response, int statusCode) {
hasVirtualClinic = response['HasVirtualClinic'];
sServiceID = response['SserviceID'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"DoctorID": 9920
},
);
}
} }

@ -1,5 +1,45 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class LiveCarePatientServices extends BaseService{ class LiveCarePatientServices extends BaseService{
List<PatiantInformtion> _patientList = [];
List<PatiantInformtion> get patientList => _patientList;
bool _isFinished = false;
bool get isFinished => _isFinished;
var endCallResponse = {};
Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{
hasError = false;
await baseAppClient.post(
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) {
_patientList.clear();
response['List_PendingPatientList'].forEach((v) {
_patientList.add(PatiantInformtion.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: pendingPatientERForDoctorAppRequestModel.toJson(),
);
}
Future endCall(EndCallReq endCallReq) async {
await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async {
_isFinished = true;
endCallResponse = response;
}, onFailure: (String error, int statusCode) {
_isFinished = true;
throw error;
}, body: endCallReq.toJson());
}
} }

@ -1,6 +1,83 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import '../../locator.dart';
class LiveCarePatientViewModel extends BaseViewModel { class LiveCarePatientViewModel extends BaseViewModel {
getPendingPatientERForDoctorApp() async {} List<PatiantInformtion> filterData = [];
LiveCarePatientServices _liveCarePatientServices =
locator<LiveCarePatientServices>();
bool get isFinished => _liveCarePatientServices.isFinished;
DashboardService _dashboardService =
locator<DashboardService>();
getPendingPatientERForDoctorApp() async {
setState(ViewState.BusyLocal);
PendingPatientERForDoctorAppRequestModel
pendingPatientERForDoctorAppRequestModel =
PendingPatientERForDoctorAppRequestModel(sErServiceID:_dashboardService.sServiceID, outSA: false);
await _liveCarePatientServices
.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
filterData = _liveCarePatientServices.patientList;
setState(ViewState.Idle);
}
}
Future endCall(request, isPatient, doctorID) async {
EndCallReq endCallReq = new EndCallReq();
endCallReq.doctorId = doctorID; //profile["DoctorID"];
endCallReq.generalid = 'Cs2020@2016\$2958';
endCallReq.vCID = request.vCID; //["VC_ID"];
endCallReq.isDestroy = isPatient;
setState(ViewState.BusyLocal);
await _liveCarePatientServices
.endCall(endCallReq);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
filterData = _liveCarePatientServices.patientList;
setState(ViewState.Idle);
}
}
searchData(String str) {
var strExist= str.length > 0 ? true : false;
if (strExist) {
filterData = [];
for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) {
String fullName =
_liveCarePatientServices.patientList[i].fullName.toUpperCase();
String patientID =
_liveCarePatientServices.patientList[i].patientId.toString();
String mobile =
_liveCarePatientServices.patientList[i].mobileNumber.toUpperCase();
if (fullName.contains(str.toUpperCase()) ||
patientID.contains(str)|| mobile.contains(str)) {
filterData.add(_liveCarePatientServices.patientList[i]);
}
}
notifyListeners();
} else {
filterData = _liveCarePatientServices.patientList;
notifyListeners();
}
}
} }

@ -12,14 +12,18 @@ import 'authentication_view_model.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
class DashboardViewModel extends BaseViewModel { class DashboardViewModel extends BaseViewModel {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
DashboardService _dashboardService = locator<DashboardService>(); DashboardService _dashboardService = locator<DashboardService>();
List<DashboardModel> get dashboardItemsList => List<DashboardModel> get dashboardItemsList =>
_dashboardService.dashboardItemsList; _dashboardService.dashboardItemsList;
Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async{ bool get hasVirtualClinic => _dashboardService.hasVirtualClinic;
String get sServiceID => _dashboardService.sServiceID;
Future setFirebaseNotification(ProjectViewModel projectsProvider,
AuthenticationViewModel authProvider) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await projectsProvider.getDoctorClinicsList(); await projectsProvider.getDoctorClinicsList();
@ -50,12 +54,27 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { Future checkDoctorHasLiveCare() async {
setState(ViewState.Busy);
await _dashboardService.checkDoctorHasLiveCare();
if (_dashboardService.hasError) {
error = _dashboardService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future changeClinic(
int clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await getDoctorProfile(); await getDoctorProfile();
ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: clinicId, projectID: doctorProfile.projectID,); ClinicModel clinicModel = ClinicModel(
doctorID: doctorProfile.doctorID,
clinicID: clinicId,
projectID: doctorProfile.projectID,
);
await authProvider.getDoctorProfileBasedOnClinic(clinicModel); await authProvider.getDoctorProfileBasedOnClinic(clinicModel);
if(authProvider.state == ViewState.ErrorLocal) { if (authProvider.state == ViewState.ErrorLocal) {
error = authProvider.error; error = authProvider.error;
} }
} }

@ -62,6 +62,8 @@ class PatiantInformtion {
String startTimes; String startTimes;
String dischargeDate; String dischargeDate;
int status; int status;
int vcId;
PatiantInformtion( PatiantInformtion(
{this.patientDetails, {this.patientDetails,
this.projectId, this.projectId,
@ -121,7 +123,7 @@ class PatiantInformtion {
this.nationalityFlagURL, this.nationalityFlagURL,
this.patientStatusType, this.patientStatusType,
this.visitTypeId, this.visitTypeId,
this.startTimes,this.dischargeDate,this.status}); this.startTimes,this.dischargeDate,this.status, this.vcId});
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => factory PatiantInformtion.fromJson(Map<String, dynamic> json) =>
PatiantInformtion( PatiantInformtion(
@ -130,7 +132,7 @@ class PatiantInformtion {
projectId: json["ProjectID"] ?? json["projectID"], projectId: json["ProjectID"] ?? json["projectID"],
clinicId: json["ClinicID"] ?? json["clinicID"], clinicId: json["ClinicID"] ?? json["clinicID"],
doctorId: json["DoctorID"] ?? json["doctorID"], doctorId: json["DoctorID"] ?? json["doctorID"],
patientId: json["PatientID"] ?? patientId: json["PatientID"]!= null ?json["PatientID"] is String ? int.parse(json["PatientID"]):json["PatientID"]:
json["patientID"] ?? json["patientID"] ??
json['patientMRN'] ?? json['patientMRN'] ??
json['PatientMRN'], json['PatientMRN'],
@ -142,10 +144,10 @@ class PatiantInformtion {
firstNameN: json["FirstNameN"] ?? json["firstNameN"], firstNameN: json["FirstNameN"] ?? json["firstNameN"],
middleNameN: json["MiddleNameN"] ?? json["middleNameN"], middleNameN: json["MiddleNameN"] ?? json["middleNameN"],
lastNameN: json["LastNameN"] ?? json["lastNameN"], lastNameN: json["LastNameN"] ?? json["lastNameN"],
gender: json["Gender"] ?? json["gender"], gender: json["Gender"]!= null? json["Gender"]is String ?int.parse(json["Gender"]):json["Gender"] :json["gender"],
fullName: json["fullName"] ?? json["fullName"], fullName: json["fullName"] ?? json["fullName"]??json["PatientName"],
fullNameN: json["fullNameN"] ?? json["fullNameN"], fullNameN: json["fullNameN"] ?? json["fullNameN"]??json["PatientName"],
dateofBirth: json["DateofBirth"] ?? json["dob"], dateofBirth: json["DateofBirth"] ?? json["dob"]??json['DateOfBirth'],
nationalityId: json["NationalityID"] ?? json["nationalityID"], nationalityId: json["NationalityID"] ?? json["nationalityID"],
mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], mobileNumber: json["MobileNumber"] ?? json["mobileNumber"],
emailAddress: json["EmailAddress"] ?? json["emailAddress"], emailAddress: json["EmailAddress"] ?? json["emailAddress"],
@ -199,5 +201,6 @@ class PatiantInformtion {
startTimes: json['StartTime'] ?? json['StartTime'], startTimes: json['StartTime'] ?? json['StartTime'],
dischargeDate: json['DischargeDate'] , dischargeDate: json['DischargeDate'] ,
status: json['Status'] , status: json['Status'] ,
vcId: json['VC_ID'] ,
); );
} }

@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart';
import 'package:doctor_app_flutter/screens/home/home_patient_card.dart'; import 'package:doctor_app_flutter/screens/home/home_patient_card.dart';
import 'package:doctor_app_flutter/screens/live_care/live_care_patient_screen.dart';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart';
import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart';
@ -33,7 +34,6 @@ import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart'; import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/app_texts_widget.dart';
import 'home_page_card.dart';
class HomeScreen extends StatefulWidget { class HomeScreen extends StatefulWidget {
HomeScreen({Key key, this.title}) : super(key: key); HomeScreen({Key key, this.title}) : super(key: key);
@ -55,6 +55,7 @@ class _HomeScreenState extends State<HomeScreen> {
int sliderActiveIndex = 0; int sliderActiveIndex = 0;
var clinicId; var clinicId;
AuthenticationViewModel authenticationViewModel; AuthenticationViewModel authenticationViewModel;
int colorIndex = 0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -68,9 +69,11 @@ class _HomeScreenState extends State<HomeScreen> {
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.setFirebaseNotification(projectsProvider, authenticationViewModel); await model.setFirebaseNotification(
projectsProvider, authenticationViewModel);
await model.getDashboard(); await model.getDashboard();
await model.getDoctorProfile(isGetProfile: true); await model.getDoctorProfile(isGetProfile: true);
await model.checkDoctorHasLiveCare();
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -238,10 +241,10 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
sliderActiveIndex == 1 sliderActiveIndex == 1
? DashboardSliderItemWidget( ? DashboardSliderItemWidget(
model.dashboardItemsList[3]) model.dashboardItemsList[6])
: sliderActiveIndex == 0 : sliderActiveIndex == 0
? DashboardSliderItemWidget( ? DashboardSliderItemWidget(
model.dashboardItemsList[6]) model.dashboardItemsList[3])
: DashboardSliderItemWidget( : DashboardSliderItemWidget(
model.dashboardItemsList[4]), model.dashboardItemsList[4]),
]))) ])))
@ -289,117 +292,7 @@ class _HomeScreenState extends State<HomeScreen> {
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: [ children: [
HomePatientCard( ...homePatientsCardsWidget(model),
backgroundColor: Color(0xffD02127),
backgroundIconColor: Colors.white12,
cardIcon: DoctorApp.inpatient,
textColor: Colors.white,
text: "Live Care Patients",
onTap: () {
Navigator.push(
context,
FadePage(
page: PatientInPatientScreen(),
),
);
},
),
HomePatientCard(
backgroundColor: Color(0xffD02127),
backgroundIconColor: Colors.white12,
cardIcon: DoctorApp.inpatient,
textColor: Colors.white,
text: TranslationBase.of(context)
.myInPatient,
onTap: () {
Navigator.push(
context,
FadePage(
page: PatientInPatientScreen(),
),
);
},
),
HomePatientCard(
backgroundColor: Colors.grey[300],
backgroundIconColor: Colors.white38,
cardIcon: DoctorApp.arrival_patients,
textColor: Colors.black,
text: TranslationBase.of(context)
.myOutPatient_2lines,
onTap: () {
String date =
AppDateUtils.convertDateToFormat(
DateTime(
DateTime.now().year,
DateTime.now().month,
DateTime.now().day),
'yyyy-MM-dd');
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OutPatientsScreen(
patientSearchRequestModel:
PatientSearchRequestModel(
from: date,
to: date,
doctorID:
authenticationViewModel
.doctorProfile
.doctorID)),
));
},
),
HomePatientCard(
backgroundColor: Color(0xff2B353E),
backgroundIconColor: Colors.white10,
cardIcon: DoctorApp.referral_1,
textColor: Colors.white,
text: TranslationBase.of(context)
.myPatientsReferral,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PatientReferralScreen(),
),
);
},
),
HomePatientCard(
backgroundColor: Color(0xffD02127),
backgroundIconColor: Colors.white10,
cardIcon: DoctorApp.search,
textColor: Colors.white,
text: TranslationBase.of(context)
.searchPatientDashBoard,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PatientSearchScreen(),
));
},
),
HomePatientCard(
backgroundColor: Color(0xffC9C9C9),
backgroundIconColor: Colors.black12,
cardIcon: DoctorApp.search_medicines,
textColor: Color(0xff2B353E),
text: TranslationBase.of(context)
.searchMedicineDashboard,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
MedicineSearchScreen(),
));
},
),
])), ])),
SizedBox( SizedBox(
height: 20, height: 20,
@ -416,4 +309,153 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
); );
} }
List<Widget> homePatientsCardsWidget(DashboardViewModel model) {
colorIndex = 0;
List<Color> backgroundColors = List(3);
backgroundColors[0] = Color(0xffD02127);
backgroundColors[1] = Colors.grey[300];
backgroundColors[2] = Color(0xff2B353E);
List<Color> backgroundIconColors = List(3);
backgroundIconColors[0] = Colors.white12;
backgroundIconColors[1] = Colors.white38;
backgroundIconColors[2] = Colors.white10;
List<Color> textColors = List(3);
textColors[0] = Colors.white;
textColors[1] = Colors.black;
textColors[2] = Colors.white;
List<HomePatientCard> patientCards = List();
if (model.hasVirtualClinic) {
patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.inpatient,
textColor: textColors[colorIndex],
text:
"${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
onTap: () {
Navigator.push(
context,
FadePage(
page: LiveCarePatientScreen(),
),
);
},
));
changeColorIndex();
}
patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.inpatient,
textColor: textColors[colorIndex],
text: TranslationBase.of(context).myInPatient,
onTap: () {
Navigator.push(
context,
FadePage(
page: PatientInPatientScreen(),
),
);
},
));
changeColorIndex();
patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.arrival_patients,
textColor: textColors[colorIndex],
text: TranslationBase.of(context).myOutPatient_2lines,
onTap: () {
String date = AppDateUtils.convertDateToFormat(
DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OutPatientsScreen(
patientSearchRequestModel: PatientSearchRequestModel(
from: date,
to: date,
doctorID:
authenticationViewModel.doctorProfile.doctorID)),
));
},
));
changeColorIndex();
patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.referral_1,
textColor: textColors[colorIndex],
text: TranslationBase.of(context)
.myPatientsReferral,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PatientReferralScreen(),
),
);
},
));
changeColorIndex();
patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.search,
textColor: textColors[colorIndex],
text: TranslationBase.of(context)
.searchPatientDashBoard,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PatientSearchScreen(),
));
},
));
changeColorIndex();
patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.search_medicines,
textColor: textColors[colorIndex],
text: TranslationBase.of(context)
.searchMedicineDashboard,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
MedicineSearchScreen(),
));
},
));
changeColorIndex();
return [
...List.generate(patientCards.length, (index) => patientCards[index])
.toList()
];
}
changeColorIndex() {
colorIndex++;
if (colorIndex > 2) {
colorIndex = 0;
}
}
} }

@ -1,59 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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:flutter/material.dart';
class LiveCarePatientScreen extends StatefulWidget {
@override
_LiveCarePatientScreenState createState() => _LiveCarePatientScreenState();
}
class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
@override
Widget build(BuildContext context) {
return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async {},
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(
"Live Care Patients",
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
),
),
]),
),
),
Expanded(
child: Column(
children: [],
),
),
],
),
),
);
}
}

@ -0,0 +1,160 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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_loader_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/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart';
import '../../routes.dart';
class LiveCarePatientScreen extends StatefulWidget {
@override
_LiveCarePatientScreenState createState() => _LiveCarePatientScreenState();
}
class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
final _controller = TextEditingController();
@override
Widget build(BuildContext context) {
return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async {
await model.getPendingPatientERForDoctorApp();
},
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(
"Live Care Patients",
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
),
),
]),
),
),
SizedBox(height: 20,),
Center(
child: FractionallySizedBox(
widthFactor: .9,
child: Container(
width: double.maxFinite,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: Color(0xffCCCCCC),
),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: 10, top: 10),
child: AppText(
TranslationBase.of(
context)
.searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20,
padding:
EdgeInsets.only(
bottom: 30),
),
onChanged: (String str) {
model.searchData(str);
}),
])),
),
),
model.state == ViewState.Idle
? Expanded(
child: Container(
child: model.filterData.isEmpty
? Center(
child: ErrorMessage(
error: TranslationBase.of(context)
.youDontHaveAnyPatient,
),
)
: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: "0",
arrivalType: "0",
isFromSearch: false,
isInpatient: false,
isFromLiveCare:true,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "0",
"isSearch": false,
"isInpatient": false,
"arrivalType": "0",
"isSearchAndOut": false,
"isFromLiveCare":true
});
},
// isFromSearch: widget.isSearch,
),
);
})),
) : Expanded(
child: AppLoaderWidget(containerColor: Colors.transparent,)),
],
),
),
);
}
}

@ -1,227 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import '../../../routes.dart';
class InPatientProfileScreen extends StatefulWidget {
@override
_InPatientProfileScreenState createState() => _InPatientProfileScreenState();
}
class _InPatientProfileScreenState extends State<InPatientProfileScreen>with SingleTickerProviderStateMixin {
PatiantInformtion patient;
bool isFromSearch = false;
bool isInpatient = false;
bool isDischargedPatient = false;
String patientType;
String arrivalType;
String from;
String to;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
from = routeArgs['from'];
to = routeArgs['to'];
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
}
if (routeArgs.containsKey("isInpatient")) {
isInpatient = routeArgs['isInpatient'];
}
if (routeArgs.containsKey("isDischargedPatient")) {
isDischargedPatient = routeArgs['isDischargedPatient'];
}
}
@override
Widget build(BuildContext context) {
return BaseView<PatientViewModel>(
builder: (_, patientViewModel, w) => AppScaffold(
baseViewModel: patientViewModel,
appBarTitle: TranslationBase.of(context).patientProfile,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType),
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(top: 10),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15),
child: GridView.count(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0,
crossAxisCount: 3,
children: [
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
isInPatient: true,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
isInPatient: true,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
isDischargedPatient: isDischargedPatient,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
isDischargedPatient: isDischargedPatient,
nameLine1: "Order", //"Text",
nameLine2:
"Sheet", //TranslationBase.of(context).orders,
icon: 'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures,
icon: 'patient/Order_Procedures.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: HEALTH_SUMMARY,
nameLine1: "Health",
//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: HEALTH_SUMMARY,
nameLine1: "Medical", //Health
//TranslationBase.of(context).medicalReport,
nameLine2: "Report", //Report
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_IN_PATIENT_TO_DOCTOR,
isInPatient: true,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).approvals,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: null,
nameLine1: "Discharge",
nameLine2: "Summery",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'),
],
),
),
),
),
));
}
}
class AvatarWidget extends StatelessWidget {
final Widget avatarIcon;
AvatarWidget(this.avatarIcon);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.08),
offset: Offset(0.0, 5.0),
blurRadius: 16.0)
],
borderRadius: BorderRadius.all(Radius.circular(35.0)),
color: Color(0xffCCCCCC),
),
child: avatarIcon,
);
}
}

@ -1,6 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.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/models/patient/MedicalReport/MeidcalReportModel.dart'; import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart';
@ -11,14 +9,11 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/html_rich_editor.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/html_rich_editor.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:html_editor_enhanced/html_editor.dart'; import 'package:html_editor_enhanced/html_editor.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class AddVerifyMedicalReport extends StatefulWidget { class AddVerifyMedicalReport extends StatefulWidget {
@override @override
@ -26,42 +21,6 @@ class AddVerifyMedicalReport extends StatefulWidget {
} }
class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> { class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
stt.SpeechToText speechHistoryFinding = stt.SpeechToText();
stt.SpeechToText speechLaboratoryData = stt.SpeechToText();
stt.SpeechToText speechRecommendation = stt.SpeechToText();
var recognizedWord1;
var recognizedWord2;
var recognizedWord3;
var event = RobotProvider();
TextEditingController historyFindingController = TextEditingController();
TextEditingController laboratoryDataController = TextEditingController();
TextEditingController recommendationController = TextEditingController();
String commentsError;
String comments2Error;
String comments3Error;
@override
void initState() {
requestPermissions();
event.controller.stream.listen((p) {
if (p['startPopUp'] == 'true') {
if (this.mounted) {
initSpeechState().then((value) {
onVoiceText();
});
initSpeechState2().then((value) {
onVoiceText2();
});
initSpeechState3().then((value) {
onVoiceText3();
});
}
}
});
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context); ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
@ -94,9 +53,15 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
HtmlRichEditor(initialText: model if (model.medicalReportTemplate.length > 0)
.medicalReportTemplate[0] HtmlRichEditor(
.templateTextHtml, height: MediaQuery.of(context).size.height * 0.75,), initialText: model
.medicalReportTemplate[0]
.templateTextHtml,
height:
MediaQuery.of(context).size.height *
0.75,
),
], ],
), ),
), ),
@ -121,13 +86,13 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
// disabled: progressNoteController.text.isEmpty, // disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () async { onPressed: () async {
String txtOfMedicalReport =
String txtOfMedicalReport = await HtmlEditor.getText(); await HtmlEditor.getText();
if (txtOfMedicalReport.isNotEmpty) { if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.insertMedicalReport(patient,txtOfMedicalReport model.insertMedicalReport(
); patient, txtOfMedicalReport);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
@ -166,137 +131,11 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
)); ));
} }
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speechHistoryFinding.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speechHistoryFinding.listen(
onResult: resultListener,
listenMode: stt.ListenMode.confirmation,
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
);
} else {
print("The user has denied the use of speech recognition.");
}
}
onVoiceText2() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speechLaboratoryData.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speechLaboratoryData.listen(
onResult: resultListener2,
listenMode: stt.ListenMode.confirmation,
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
);
} else {
print("The user has denied the use of speech recognition.");
}
}
onVoiceText3() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speechRecommendation.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speechRecommendation.listen(
onResult: resultListener3,
listenMode: stt.ListenMode.confirmation,
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
);
} else {
print("The user has denied the use of speech recognition.");
}
}
void errorListener(SpeechRecognitionError error) {
event.setValue({"searchText": 'null'});
//SpeechToText.closeAlertDialog(context);
print(error);
}
void statusListener(String status) {
recognizedWord1 = status == 'listening' ? 'Lisening...' : 'Sorry....';
recognizedWord2 = status == 'listening' ? 'Lisening...' : 'Sorry....';
recognizedWord3 = status == 'listening' ? 'Lisening...' : 'Sorry....';
}
void requestPermissions() async { void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [ Map<Permission, PermissionStatus> statuses = await [
Permission.microphone, Permission.microphone,
].request(); ].request();
} }
void resultListener(result) {
recognizedWord1 = result.recognizedWords;
event.setValue({"searchText": recognizedWord1});
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speechHistoryFinding.stop();
historyFindingController.text += recognizedWord1 + '\n';
});
} else {
print(result.finalResult);
}
}
void resultListener2(result) {
recognizedWord2 = result.recognizedWords;
event.setValue({"searchText": recognizedWord2});
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speechLaboratoryData.stop();
laboratoryDataController.text += recognizedWord2 + '\n';
});
} else {
print(result.finalResult);
}
}
void resultListener3(result) {
recognizedWord3 = result.recognizedWords;
event.setValue({"searchText": recognizedWord3});
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speechRecommendation.stop();
recommendationController.text += recognizedWord3 + '\n';
});
} else {
print(result.finalResult);
}
}
Future<void> initSpeechState() async {
bool hasSpeech = await speechHistoryFinding.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
Future<void> initSpeechState2() async {
bool hasSpeech = await speechLaboratoryData.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
Future<void> initSpeechState3() async {
bool hasSpeech = await speechRecommendation.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
} }
enum MedicalReportStatus { ADD, VERIFY } enum MedicalReportStatus { ADD, VERIFY }

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
@ -32,12 +33,16 @@ class MedicalReportPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientMedicalReportViewModel>( return BaseView<PatientMedicalReportViewModel>(
onModelReady: (model) => model.getMedicalReportList(patient), onModelReady: (model) async {
await model.getMedicalReportList(patient);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient,
patientType, patientType,
@ -80,10 +85,10 @@ class MedicalReportPage extends StatelessWidget {
}, },
label: TranslationBase.of(context).createNewMedicalReport, label: TranslationBase.of(context).createNewMedicalReport,
), ),
if (model.state == ViewState.ErrorLocal) // if (model.state == ViewState.ErrorLocal)
Container( // Container(
child: ErrorMessage(error: model.error), // child: ErrorMessage(error: model.error),
), // ),
if (model.state != ViewState.ErrorLocal) if (model.state != ViewState.ErrorLocal)
...List.generate( ...List.generate(
model.medicalReportList.length, model.medicalReportList.length,
@ -150,22 +155,26 @@ class MedicalReportPage extends StatelessWidget {
onTap: () { onTap: () {
if (model.medicalReportList[index].status == if (model.medicalReportList[index].status ==
0) { 0) {
Navigator.of(context) Navigator.of(context).pushNamed(
.pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { PATIENT_MEDICAL_REPORT_INSERT,
'patient': patient, arguments: {
'patientType': patientType, 'patient': patient,
'arrivalType': arrivalType, 'patientType': patientType,
'type': MedicalReportStatus.ADD, 'arrivalType': arrivalType,
'medicalReport' : model.medicalReportList[index] 'type': MedicalReportStatus.ADD,
}); 'medicalReport':
model.medicalReportList[index]
});
} else { } else {
Navigator.of(context) Navigator.of(context).pushNamed(
.pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { PATIENT_MEDICAL_REPORT_DETAIL,
'patient': patient, arguments: {
'patientType': patientType, 'patient': patient,
'arrivalType': arrivalType, 'patientType': patientType,
'medicalReport' : model.medicalReportList[index] 'arrivalType': arrivalType,
}); 'medicalReport':
model.medicalReportList[index]
});
} }
}, },
child: Icon( child: Icon(

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_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/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
@ -85,9 +86,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<PatientViewModel>( return BaseView<LiveCarePatientViewModel>(
builder: (_, patientViewModel, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: patientViewModel, baseViewModel: model,
appBarTitle: TranslationBase.of(context).patientProfile, appBarTitle: TranslationBase.of(context).patientProfile,
isShowAppBar: false, isShowAppBar: false,
body: Column( body: Column(
@ -97,18 +98,16 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
Column( Column(
children: [ children: [
PatientProfileHeaderNewDesignAppBar( PatientProfileHeaderNewDesignAppBar(
patient, patient, arrivalType ?? '0', patientType,
arrivalType ?? '0', isInpatient: isInpatient,
patientType, isFromLiveCare: isFromLiveCare,
isInpatient: isInpatient, height: (patient.patientStatusType != null &&
height: (patient.patientStatusType != null && patient.patientStatusType == 43)
patient.patientStatusType == 43) ? 210
? 210 : isDischargedPatient
: isDischargedPatient ? 240
? 240 : 0,
: 0, isDischargedPatient: isDischargedPatient),
isDischargedPatient:isDischargedPatient
),
Container( Container(
height: !isSearchAndOut height: !isSearchAndOut
? isDischargedPatient ? isDischargedPatient
@ -121,34 +120,35 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
child: isSearchAndOut child: isSearchAndOut
? ProfileGridForSearch( ? ProfileGridForSearch(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isInpatient: isInpatient, isInpatient: isInpatient,
from: from, from: from,
to: to, to: to,
) )
: isInpatient : isInpatient
? ProfileGridForInPatient( ? ProfileGridForInPatient(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isInpatient: isInpatient, isInpatient: isInpatient,
from: from, from: from,
to: to, to: to,
isDischargedPatient: isDischargedPatient:
isDischargedPatient, isDischargedPatient,
isFromSearch: isFromSearch, isFromSearch: isFromSearch,
) )
: ProfileGridForOther( : ProfileGridForOther(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isInpatient: isInpatient, isInpatient: isInpatient,
from: from, isFromLiveCare: isFromLiveCare,
to: to, from: from,
), to: to,
), ),
SizedBox( ),
SizedBox(
height: MediaQuery.of(context).size.height * 0.05, height: MediaQuery.of(context).size.height * 0.05,
) )
], ],
@ -272,14 +272,21 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
child: Center( child: Center(
child: AppButton( child: AppButton(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Colors.green[600], color: model.isFinished?Colors.red[600]:Colors.green[600],
title: TranslationBase title: model.isFinished?TranslationBase
.of(context)
.endCall:TranslationBase
.of(context) .of(context)
.initiateCall, .initiateCall,
onPressed: () async { onPressed: () async {
Navigator.push(context, MaterialPageRoute( if(model.isFinished) {
builder: (BuildContext context) => Navigator.push(context, MaterialPageRoute(
EndCallScreen(patient:patient))); builder: (BuildContext context) =>
EndCallScreen(patient:patient)));
} else {
// TODO Call initiateCall service
}
}, },
), ),
), ),

@ -14,6 +14,7 @@ class ProfileGridForOther extends StatelessWidget {
final String arrivalType; final String arrivalType;
final double height; final double height;
final bool isInpatient; final bool isInpatient;
final bool isFromLiveCare;
String from; String from;
String to; String to;
@ -25,7 +26,8 @@ class ProfileGridForOther extends StatelessWidget {
this.height, this.height,
this.isInpatient, this.isInpatient,
this.from, this.from,
this.to}) this.to,
this.isFromLiveCare})
: super(key: key); : super(key: key);
@override @override
@ -74,41 +76,67 @@ class ProfileGridForOther extends StatelessWidget {
'patient/Order_Procedures.png', 'patient/Order_Procedures.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).insurance, TranslationBase
TranslationBase.of(context).service, .of(context)
.insurance,
TranslationBase
.of(context)
.service,
PATIENT_INSURANCE_APPROVALS_NEW, PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png', 'patient/vital_signs.png',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patientSick, TranslationBase
TranslationBase.of(context).leave, .of(context)
.patientSick,
TranslationBase
.of(context)
.leave,
ADD_SICKLEAVE, ADD_SICKLEAVE,
'patient/patient_sick_leave.png', 'patient/patient_sick_leave.png',
isInPatient: isInpatient), isInPatient: isInpatient),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (isFromLiveCare ||
PatientProfileCardModel( (patient.appointmentNo != null && patient.appointmentNo != 0))
TranslationBase.of(context).patient,
TranslationBase.of(context).ucaf,
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR,
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).admission, TranslationBase
TranslationBase.of(context).request, .of(context)
.patient,
TranslationBase
.of(context)
.ucaf,
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ||
patient.appointmentNo == null ? true : false),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase
.of(context)
.referral,
TranslationBase
.of(context)
.patient,
REFER_PATIENT_TO_DOCTOR,
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ||
patient.appointmentNo == null ? true : false),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase
.of(context)
.admission,
TranslationBase
.of(context)
.request,
PATIENT_ADMISSION_REQUEST, PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png', 'patient/admission_req.png',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false), isDisable: patient.patientStatusType != 43 ||
patient.appointmentNo == null ? true : false),
]; ];
return Column( return Column(
@ -124,20 +152,22 @@ class ProfileGridForOther extends StatelessWidget {
itemCount: cardsList.length, itemCount: cardsList.length,
staggeredTileBuilder: (int index) => StaggeredTile.fit(1), staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => PatientProfileButton( itemBuilder: (BuildContext context, int index) => PatientProfileButton(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
from: from, from: from,
to: to, to: to,
nameLine1: cardsList[index].nameLine1, nameLine1: cardsList[index].nameLine1,
nameLine2: cardsList[index].nameLine2, nameLine2: cardsList[index].nameLine2,
route: cardsList[index].route, route: cardsList[index].route,
icon: cardsList[index].icon, icon: cardsList[index].icon,
isInPatient: cardsList[index].isInPatient, isInPatient: cardsList[index].isInPatient,
isDischargedPatient: cardsList[index].isDischargedPatient, isDischargedPatient: cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable, isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap, onTap: cardsList[index].onTap,
isLoading: cardsList[index].isLoading, isLoading: cardsList[index].isLoading,
isFromLiveCare: isFromLiveCare
), ),
), ),
), ),

@ -25,6 +25,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
PatiantInformtion patient; PatiantInformtion patient;
String arrivalType; String arrivalType;
bool isInpatient; bool isInpatient;
bool isFromLiveCare;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
@ -34,6 +35,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];
isInpatient = routeArgs['isInpatient']; isInpatient = routeArgs['isInpatient'];
isFromLiveCare = routeArgs['isFromLiveCare'];
print(arrivalType); print(arrivalType);
} }
@ -97,21 +99,25 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
fontSize: 13, fontSize: 13,
), ),
AppText( AppText(
TranslationBase.of(context).result, TranslationBase
.of(context)
.result,
bold: true, bold: true,
fontSize: 22, fontSize: 22,
), ),
], ],
), ),
), ),
if (patient.patientStatusType != null && if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddSelectedRadiologyOrder( builder: (context) =>
AddSelectedRadiologyOrder(
patient: patient, patient: patient,
model: model, model: model,
)), )),

@ -9,9 +9,9 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.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'; 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:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class VitalSignDetailsScreen extends StatelessWidget { class VitalSignDetailsScreen extends StatelessWidget {
int appointmentNo; int appointmentNo;
@ -39,6 +39,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
builder: (_, mode, widget) => AppScaffold( builder: (_, mode, widget) => AppScaffold(
baseViewModel: mode, baseViewModel: mode,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType), patient, patientType, arrivalType),
appBarTitle: TranslationBase.of(context).vitalSign, appBarTitle: TranslationBase.of(context).vitalSign,
@ -587,31 +588,18 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
), ),
], ],
),
),
),
],
)
: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).vitalSignEmptyMsg,
fontWeight: FontWeight.normal,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),
)
],
), ),
), ),
),
],
)
: Container(
color: Theme
.of(context)
.scaffoldBackgroundColor,
child: ErrorMessage(error: TranslationBase
.of(context)
.vitalSignEmptyMsg,)),
), ),
); );
} }

@ -26,8 +26,8 @@ class PrescriptionsPage extends StatelessWidget {
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
bool isFromLiveCare = routeArgs['isFromLiveCare'];
bool isSelectInpatient = routeArgs['isSelectInpatient']; bool isSelectInpatient = routeArgs['isSelectInpatient'];
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) => isSelectInpatient onModelReady: (model) => isSelectInpatient
? model.getPrescriptionsInPatient(patient) ? model.getPrescriptionsInPatient(patient)
@ -86,21 +86,25 @@ class PrescriptionsPage extends StatelessWidget {
fontSize: 13, fontSize: 13,
), ),
AppText( AppText(
TranslationBase.of(context).prescriptions, TranslationBase
.of(context)
.prescriptions,
bold: true, bold: true,
fontSize: 22, fontSize: 22,
), ),
], ],
), ),
), ),
if (patient.patientStatusType != null && if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
addPrescriptionForm(context, model, patient, addPrescriptionForm(context, model, patient,
model.prescriptionList); model.prescriptionList);
}, },
label: TranslationBase.of(context) label: TranslationBase
.of(context)
.applyForNewPrescriptionsOrder, .applyForNewPrescriptionsOrder,
), ),
...List.generate( ...List.generate(

@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart';
import 'package:doctor_app_flutter/screens/procedures/add_procedure_homeScreen.dart'; import 'package:doctor_app_flutter/screens/procedures/add_procedure_homeScreen.dart';
import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -14,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head
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 'ProcedureCard.dart'; import 'ProcedureCard.dart';
class ProcedureScreen extends StatelessWidget { class ProcedureScreen extends StatelessWidget {
@ -31,6 +31,7 @@ class ProcedureScreen extends StatelessWidget {
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
bool isFromLiveCare = routeArgs['isFromLiveCare'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure( onModelReady: (model) => model.getProcedure(
@ -91,21 +92,25 @@ class ProcedureScreen extends StatelessWidget {
fontSize: 13, fontSize: 13,
), ),
AppText( AppText(
TranslationBase.of(context).procedure, TranslationBase
.of(context)
.procedure,
bold: true, bold: true,
fontSize: 22, fontSize: 22,
), ),
], ],
), ),
), ),
if (patient.patientStatusType != null && if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddProcedureHome( builder: (context) =>
AddProcedureHome(
patient: patient, patient: patient,
model: model, model: model,
)), )),

@ -305,9 +305,14 @@ class AppDateUtils {
return DateFormat('hh:mm a').format(dateTime); return DateFormat('hh:mm a').format(dateTime);
} }
static String getAgeByBirthday(dynamic birthday, BuildContext context) { static String getAgeByBirthday(String birthOfDate, BuildContext context, { bool isServerFormat = true}) {
// https://leechy.dev/calculate-dates-diff-in-dart // https://leechy.dev/calculate-dates-diff-in-dart
DateTime birthDate = AppDateUtils.getDateTimeFromServerFormat(birthday); DateTime birthDate;
if(birthOfDate.contains("/Date")) {
birthDate = AppDateUtils.getDateTimeFromServerFormat(birthOfDate);
}else{
birthDate = DateTime.parse(birthOfDate);
}
final now = DateTime.now(); final now = DateTime.now();
int years = now.year - birthDate.year; int years = now.year - birthDate.year;
int months = now.month - birthDate.month; int months = now.month - birthDate.month;

@ -1337,6 +1337,8 @@ class TranslationBase {
String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode];
String get comments => localizedValues['comments'][locale.languageCode]; String get comments => localizedValues['comments'][locale.languageCode];
String get initiateCall => localizedValues['initiateCall '][locale.languageCode]; String get initiateCall => localizedValues['initiateCall '][locale.languageCode];
String get endCall => localizedValues['endCall '][locale.languageCode];
String get transferTo => localizedValues['transferTo'][locale.languageCode]; String get transferTo => localizedValues['transferTo'][locale.languageCode];
String get admin => localizedValues['admin'][locale.languageCode]; String get admin => localizedValues['admin'][locale.languageCode];
String get instructions => localizedValues['instructions'][locale.languageCode]; String get instructions => localizedValues['instructions'][locale.languageCode];

@ -1,4 +1,3 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -9,7 +8,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class PatientCard extends StatelessWidget { class PatientCard extends StatelessWidget {
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
@ -19,6 +17,7 @@ class PatientCard extends StatelessWidget {
final bool isInpatient; final bool isInpatient;
final bool isMyPatient; final bool isMyPatient;
final bool isFromSearch; final bool isFromSearch;
final bool isFromLiveCare;
const PatientCard( const PatientCard(
{Key key, {Key key,
@ -26,8 +25,12 @@ class PatientCard extends StatelessWidget {
this.onTap, this.onTap,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.isInpatient, this.isMyPatient = false, this.isFromSearch = false}) this.isInpatient,
this.isMyPatient = false,
this.isFromSearch = false,
this.isFromLiveCare = false})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -43,7 +46,7 @@ class PatientCard extends StatelessWidget {
marginLeft: (!isMyPatient && isInpatient)?0:10, marginLeft: (!isMyPatient && isInpatient)?0:10,
marginSymmetric:isFromSearch ? 10 : 0.0, marginSymmetric:isFromSearch ? 10 : 0.0,
hasBorder: false, hasBorder: false,
bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43 bgColor:isFromLiveCare?Colors.white:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43
? Colors.green[500] ? Colors.green[500]
:isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white, :isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white,
widget: Container( widget: Container(
@ -103,7 +106,7 @@ class PatientCard extends StatelessWidget {
fontSize: 10, fontSize: 10,
), ),
], ],
): !isFromSearch && patientInfo.patientStatusType==null ? Row( ): !isFromSearch&&!isFromLiveCare && patientInfo.patientStatusType==null ? Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
@ -174,7 +177,7 @@ class PatientCard extends StatelessWidget {
Expanded( Expanded(
// width: MediaQuery.of(context).size.width*0.51, // width: MediaQuery.of(context).size.width*0.51,
child: AppText( child: AppText(
(Helpers.capitalize(patientInfo.firstName) + isFromLiveCare? Helpers.capitalize(patientInfo.fullName): (Helpers.capitalize(patientInfo.firstName) +
" " + " " +
Helpers.capitalize(patientInfo.lastName)), Helpers.capitalize(patientInfo.lastName)),
fontSize: 16, fontSize: 16,
@ -299,7 +302,7 @@ class PatientCard extends StatelessWidget {
style: TextStyle(fontSize: 12)), style: TextStyle(fontSize: 12)),
new TextSpan( new TextSpan(
text: text:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 13)), fontSize: 13)),

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indei
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// ignore: must_be_immutable
class PatientProfileButton extends StatelessWidget { class PatientProfileButton extends StatelessWidget {
final String nameLine1; final String nameLine1;
final String nameLine2; final String nameLine2;
@ -26,6 +27,7 @@ class PatientProfileButton extends StatelessWidget {
final bool isSelectInpatient; final bool isSelectInpatient;
final bool isDartIcon; final bool isDartIcon;
final IconData dartIcon; final IconData dartIcon;
final bool isFromLiveCare;
PatientProfileButton({ PatientProfileButton({
Key key, Key key,
@ -45,7 +47,7 @@ class PatientProfileButton extends StatelessWidget {
this.isDischargedPatient = false, this.isDischargedPatient = false,
this.isSelectInpatient = false, this.isSelectInpatient = false,
this.isDartIcon = false, this.isDartIcon = false,
this.dartIcon, this.dartIcon, this.isFromLiveCare = false,
}) : super(key: key); }) : super(key: key);
@override @override
@ -142,6 +144,7 @@ class PatientProfileButton extends StatelessWidget {
'isInpatient': isInPatient, 'isInpatient': isInPatient,
'isDischargedPatient': isDischargedPatient, 'isDischargedPatient': isDischargedPatient,
'isSelectInpatient': isSelectInpatient, 'isSelectInpatient': isSelectInpatient,
"isFromLiveCare":isFromLiveCare
}); });
} }
} }

@ -19,9 +19,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final double height; final double height;
final bool isInpatient; final bool isInpatient;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isFromLiveCare;
PatientProfileHeaderNewDesignAppBar( PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false}); this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -60,7 +61,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
? (Helpers.capitalize(patient.firstName) + ? (Helpers.capitalize(patient.firstName) +
" " + " " +
Helpers.capitalize(patient.lastName)) Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.patientDetails.fullName), : Helpers.capitalize(patient.fullName??patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -152,13 +153,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
)) ))
: SizedBox(), : SizedBox(),
if (SERVICES_PATIANT2[int.parse(patientType)] == if (SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient") "List_MyOutPatient" && !isFromLiveCare)
Container( Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).appointmentDate + TranslationBase.of(context).appointmentDate +
" : ", " : ",
fontSize: 14, fontSize: 14,
), ),
@ -182,14 +183,14 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
SizedBox( SizedBox(
width: 3.5, width: 3.5,
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2( convertDateFormat2(
patient.appointmentDate ?? ''), patient.appointmentDate ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
), ),
),
SizedBox( SizedBox(
height: 0.5, height: 0.5,
) )
@ -260,7 +261,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
style: TextStyle(fontSize: 14)), style: TextStyle(fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context)}", "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,isServerFormat: !isFromLiveCare)}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontSize: 14)), fontWeight: FontWeight.w700, fontSize: 14)),
], ],

@ -24,7 +24,7 @@ class _AppLoaderWidgetState extends State<AppLoaderWidget> {
child: Stack( child: Stack(
children: [ children: [
Container( Container(
color: Colors.grey.withOpacity(0.6), color: widget.containerColor??Colors.grey.withOpacity(0.6),
), ),
Container(child: GifLoaderContainer(), margin: EdgeInsets.only( Container(child: GifLoaderContainer(), margin: EdgeInsets.only(
bottom: MediaQuery.of(context).size.height * 0.09)) bottom: MediaQuery.of(context).size.height * 0.09))

@ -587,7 +587,7 @@ packages:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.3-nullsafety.1" version: "0.6.2"
json_annotation: json_annotation:
dependency: transitive dependency: transitive
description: description:

Loading…
Cancel
Save