Radiology Critical finding CR Implemented

development-3.3
haroon amjad 2 years ago
parent 519b7cfc2e
commit ee86db3778

@ -7,9 +7,9 @@ const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/';
// const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/';
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 BASE_URL = 'https://webservices.hmg.com/';
@ -281,6 +281,10 @@ const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp
const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser";
const DOCTOR_RADIOLOGY_CRITICAL_FINDINGS = "Services/DoctorApplication.svc/REST/FetchRadCriticalFinding";
const ACKNOWLEDGE_RADIOLOGY_CRITICAL_FINDINGS = "Services/DoctorApplication.svc/REST/Acknowledgeradcriticalfindings";
var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************

@ -0,0 +1,60 @@
class RadiologyCriticalFindingModel {
String clinicName;
String doctorName;
String imageURL;
int invoiceLineItemNo;
int invoiceNo;
String notificationMesssage;
int patientId;
String patientName;
String procedureName;
String reportData;
String reportOn;
String resultFindings;
RadiologyCriticalFindingModel(
{this.clinicName,
this.doctorName,
this.imageURL,
this.invoiceLineItemNo,
this.invoiceNo,
this.notificationMesssage,
this.patientId,
this.patientName,
this.procedureName,
this.reportData,
this.reportOn,
this.resultFindings});
RadiologyCriticalFindingModel.fromJson(Map<String, dynamic> json) {
clinicName = json['clinicName'];
doctorName = json['doctorName'];
imageURL = json['imageURL'];
invoiceLineItemNo = json['invoiceLineItemNo'];
invoiceNo = json['invoiceNo'];
notificationMesssage = json['notificationMesssage'];
patientId = json['patientId'];
patientName = json['patientName'];
procedureName = json['procedureName'];
reportData = json['reportData'];
reportOn = json['reportOn'];
resultFindings = json['resultFindings'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['clinicName'] = this.clinicName;
data['doctorName'] = this.doctorName;
data['imageURL'] = this.imageURL;
data['invoiceLineItemNo'] = this.invoiceLineItemNo;
data['invoiceNo'] = this.invoiceNo;
data['notificationMesssage'] = this.notificationMesssage;
data['patientId'] = this.patientId;
data['patientName'] = this.patientName;
data['procedureName'] = this.procedureName;
data['reportData'] = this.reportData;
data['reportOn'] = this.reportOn;
data['resultFindings'] = this.resultFindings;
return data;
}
}

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/dashboard/radiology_critical_finding_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart';
@ -7,8 +8,12 @@ import '../../model/dashboard/doctor_schedule.dart';
class DashboardService extends BaseService {
List<DashboardModel> _dashboardItemsList = [];
RadiologyCriticalFindingModel _radiologyCriticalFindingModel;
List<DashboardModel> get dashboardItemsList => _dashboardItemsList;
RadiologyCriticalFindingModel get radiologyCriticalFindingModel => _radiologyCriticalFindingModel;
bool hasVirtualClinic = false;
String sServiceID;
@ -48,4 +53,46 @@ class DashboardService extends BaseService {
},
);
}
Future acknowledgeDoctorHasRadiologyFindings(String invoiceNo, String invoiceLineItemNo) async {
hasError = false;
await getDoctorProfile(isGetProfile: true);
await baseAppClient.post(
ACKNOWLEDGE_RADIOLOGY_CRITICAL_FINDINGS,
onSuccess: (dynamic response, int statusCode) {
// _radiologyCriticalFindingModel = RadiologyCriticalFindingModel.fromJson(response["RadiologyVMEntityListInfoResponse"]["entityList"][0]);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"DoctorID": doctorProfile?.doctorID, // test user 9920
"LoginDoctorID": doctorProfile?.doctorID,
"invoiceNo": invoiceNo,
"invoiceLineItemNo": invoiceLineItemNo,
},
);
}
Future checkDoctorHasRadiologyFindings() async {
hasError = false;
await getDoctorProfile(isGetProfile: true);
await baseAppClient.post(
DOCTOR_RADIOLOGY_CRITICAL_FINDINGS,
onSuccess: (dynamic response, int statusCode) {
if(response["RadiologyVMEntityListInfoResponse"]["entityList"].length != 0) {
_radiologyCriticalFindingModel = RadiologyCriticalFindingModel.fromJson(response["RadiologyVMEntityListInfoResponse"]["entityList"][0]);
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"DoctorID": doctorProfile?.doctorID, // test user 9920
"LoginDoctorID": doctorProfile?.doctorID
},
);
}
}

@ -328,13 +328,19 @@ class AuthenticationViewModel extends BaseViewModel {
getDeviceInfoFromFirebase() async {
// await checkIsHuawei();
var token;
var APNSToken;
_firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) {
_firebaseMessaging.requestPermission();
}
setState(ViewState.Busy);
try {
if (Platform.isIOS) {
APNSToken = await _firebaseMessaging.getAPNSToken();
print("APNS TOKEN: $APNSToken");
}
token = await _firebaseMessaging.getToken();
print("Device TOKEN: $token");
} catch (ex) {
print(ex);
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart';
import 'package:doctor_app_flutter/core/model/dashboard/radiology_critical_finding_model.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart';
@ -16,12 +17,12 @@ import 'base_view_model.dart';
class DashboardViewModel extends BaseViewModel {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
DashboardService _dashboardService = locator<DashboardService>();
SpecialClinicsService _specialClinicsService =
locator<SpecialClinicsService>();
SpecialClinicsService _specialClinicsService = locator<SpecialClinicsService>();
DoctorReplyService _doctorReplyService = locator<DoctorReplyService>();
List<DashboardModel> get dashboardItemsList =>
_dashboardService.dashboardItemsList;
List<DashboardModel> get dashboardItemsList => _dashboardService.dashboardItemsList;
RadiologyCriticalFindingModel get radiologyCriticalFindingModel => _dashboardService.radiologyCriticalFindingModel;
bool get hasVirtualClinic => _dashboardService.hasVirtualClinic;
@ -29,10 +30,9 @@ class DashboardViewModel extends BaseViewModel {
int get notRepliedCount => _doctorReplyService.notRepliedCount;
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
_specialClinicsService.specialClinicalCareList;
Future startHomeScreenServices(ProjectViewModel projectsProvider,
AuthenticationViewModel authProvider) async {
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList => _specialClinicsService.specialClinicalCareList;
Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async {
setState(ViewState.Busy);
await getDoctorProfile(isGetProfile: true);
@ -41,6 +41,7 @@ class DashboardViewModel extends BaseViewModel {
_dashboardService.getDashboard(),
_dashboardService.checkDoctorHasLiveCare(),
_specialClinicsService.getSpecialClinicalCareList(),
_dashboardService.checkDoctorHasRadiologyFindings()
]);
if (_dashboardService.hasError) {
@ -53,14 +54,13 @@ class DashboardViewModel extends BaseViewModel {
}
Future setFirebaseNotification(AuthenticationViewModel authProvider) async {
_firebaseMessaging.requestPermission(
sound: true, badge: true, alert: true, provisional: true);
_firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true);
_firebaseMessaging.getToken().then((String token) async {
if (token != '') {
// DEVICE_TOKEN = token;
///TODO Elham* return it back
authProvider.insertDeviceImei(token);
authProvider.insertDeviceImei(token);
}
});
}
@ -75,6 +75,10 @@ class DashboardViewModel extends BaseViewModel {
await _dashboardService.checkDoctorHasLiveCare();
}
Future acknowledgeRadiologyCriticalFinding(String invoiceNo, String invoiceLineItemNo) async {
await _dashboardService.acknowledgeDoctorHasRadiologyFindings(invoiceNo, invoiceLineItemNo);
}
Future getSpecialClinicalCareList() async {
setState(ViewState.Busy);
await _specialClinicsService.getSpecialClinicalCareList();
@ -85,8 +89,7 @@ class DashboardViewModel extends BaseViewModel {
// setState(ViewState.Idle);
}
Future changeClinic(
int clinicId, AuthenticationViewModel authProvider) async {
Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal);
await getDoctorProfile();
ClinicModel clinicModel = ClinicModel(
@ -130,6 +133,4 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
}

@ -71,8 +71,14 @@ class _HomeScreenState extends State<HomeScreen> {
return BaseView<DashboardViewModel>(
onModelReady: (model) async {
model.startHomeScreenServices(
projectsProvider, authenticationViewModel);
model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) {
if (model.radiologyCriticalFindingModel != null) {
print("onModelReady radiologyCriticalFindingModel!!!");
showRadiologyFindingDialog(model);
} else {
print("onModelReady radiologyCriticalFindingModel EMPTYYYY!!!");
}
});
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -87,12 +93,9 @@ class _HomeScreenState extends State<HomeScreen> {
//TODO Elham* make it componet
Container(
width: 40,
margin: EdgeInsets.only(
left: projectsProvider.isArabic ? 0 : 32,
right: projectsProvider.isArabic ? 23 : 0),
margin: EdgeInsets.only(left: projectsProvider.isArabic ? 0 : 32, right: projectsProvider.isArabic ? 23 : 0),
child: IconButton(
icon: SvgPicture.asset('assets/images/svgs/menu.svg',
height: 25, width: 10),
icon: SvgPicture.asset('assets/images/svgs/menu.svg', height: 25, width: 10),
iconSize: 15,
color: Colors.black,
onPressed: () => Scaffold.of(context).openDrawer(),
@ -105,118 +108,69 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
Container(
width: MediaQuery.of(context).size.width * .6,
child: projectsProvider.doctorClinicsList.length >
0
child: projectsProvider.doctorClinicsList.length > 0
? Stack(
children: [
DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor:
AppGlobal.appTextColor,
iconEnabledColor: AppGlobal.appTextColor,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value: clinicId == null
? projectsProvider
.doctorClinicsList[0].clinicID
: clinicId,
value: clinicId == null ? projectsProvider.doctorClinicsList[0].clinicID : clinicId,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return projectsProvider
.doctorClinicsList
.map((item) {
selectedItemBuilder: (BuildContext context) {
return projectsProvider.doctorClinicsList.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment
.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding:
EdgeInsets.all(0),
margin:
EdgeInsets.all(2),
decoration:
new BoxDecoration(
color: AppGlobal
.appRedColor,
borderRadius:
BorderRadius
.circular(
20),
padding: EdgeInsets.all(0),
margin: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: AppGlobal.appRedColor,
borderRadius: BorderRadius.circular(20),
),
constraints:
BoxConstraints(
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: Center(
child: AppText(
projectsProvider
.doctorClinicsList
.length
.toString(),
color:
Colors.white,
letterSpacing:
-0.72,
fontWeight:
FontWeight
.w600,
fontSize:
projectsProvider
.isArabic
? 10
: 12,
textAlign:
TextAlign
.center,
projectsProvider.doctorClinicsList.length.toString(),
color: Colors.white,
letterSpacing: -0.72,
fontWeight: FontWeight.w600,
fontSize: projectsProvider.isArabic ? 10 : 12,
textAlign: TextAlign.center,
),
)),
],
),
AppText(
Utils
.convertToTitleCase(
item.clinicName),
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal
.appTextColor,
fontWeight:
FontWeight.bold,
textAlign: TextAlign.end),
AppText(Utils.convertToTitleCase(item.clinicName),
fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, textAlign: TextAlign.end),
],
);
}).toList();
},
onChanged: (newValue) async {
clinicId = newValue;
GifLoaderDialogUtils.showMyDialog(
context);
await model.changeClinic(newValue,
authenticationViewModel);
GifLoaderDialogUtils.hideDialog(
context);
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
GifLoaderDialogUtils.showMyDialog(context);
await model.changeClinic(newValue, authenticationViewModel);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
},
items: projectsProvider
.doctorClinicsList
.map((item) {
items: projectsProvider.doctorClinicsList.map((item) {
return DropdownMenuItem(
child: AppText(
Utils.convertToTitleCase(
item.clinicName),
Utils.convertToTitleCase(item.clinicName),
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal.appTextColor,
@ -229,8 +183,7 @@ class _HomeScreenState extends State<HomeScreen> {
)),
],
)
: AppText(
TranslationBase.of(context).noClinic),
: AppText(TranslationBase.of(context).noClinic),
),
],
),
@ -260,22 +213,16 @@ class _HomeScreenState extends State<HomeScreen> {
? FractionallySizedBox(
widthFactor: 0.90,
child: Container(
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 10,
),
sliderActiveIndex == 1
? DashboardSliderItemWidget(
model.dashboardItemsList[4])
: sliderActiveIndex == 0
? DashboardSliderItemWidget(
model.dashboardItemsList[3])
: DashboardSliderItemWidget(
model.dashboardItemsList[6]),
])))
child: Column(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
SizedBox(
height: 10,
),
sliderActiveIndex == 1
? DashboardSliderItemWidget(model.dashboardItemsList[4])
: sliderActiveIndex == 0
? DashboardSliderItemWidget(model.dashboardItemsList[3])
: DashboardSliderItemWidget(model.dashboardItemsList[6]),
])))
: SizedBox(),
],
)
@ -314,12 +261,9 @@ class _HomeScreenState extends State<HomeScreen> {
: SizeConfig.isHeightLarge
? 15
: 13),
child: ListView(
scrollDirection: Axis.horizontal,
children: [
...homePatientsCardsWidget(
model, projectsProvider),
])),
child: ListView(scrollDirection: Axis.horizontal, children: [
...homePatientsCardsWidget(model, projectsProvider),
])),
SizedBox(
height: 20,
),
@ -336,27 +280,28 @@ class _HomeScreenState extends State<HomeScreen> {
);
}
List<Widget> homePatientsCardsWidget(
DashboardViewModel model, projectsProvider) {
showRadiologyFindingDialog(DashboardViewModel model) {
Utils.showConfirmationDialog(context, model.radiologyCriticalFindingModel.notificationMesssage, () async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await model.acknowledgeRadiologyCriticalFinding(model.radiologyCriticalFindingModel.invoiceNo.toString(), model.radiologyCriticalFindingModel.invoiceLineItemNo.toString());
GifLoaderDialogUtils.hideDialog(context);
}, isShowCancelButton: false);
}
List<Widget> homePatientsCardsWidget(DashboardViewModel model, projectsProvider) {
colorIndex = 0;
List<LinearGradient> backgroundColors = List(3);
backgroundColors[0] = LinearGradient(
begin: Alignment(-1.0, -2.0),
end: Alignment(1.0, 2.0),
colors: [
AppGlobal.appRedColor,
Color(0xFFAD3B3B),
]); //AppGlobal.appRedColor;
backgroundColors[1] =
LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
backgroundColors[0] = LinearGradient(begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [
AppGlobal.appRedColor,
Color(0xFFAD3B3B),
]); //AppGlobal.appRedColor;
backgroundColors[1] = LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
Color(0xFFC9C9C9),
Color(0xFFC9C9C9),
]);
backgroundColors[2] = LinearGradient(
begin: Alignment.center,
end: Alignment.center,
colors: [Color(0xFF71787E), AppGlobal.appTextColor]);
backgroundColors[2] = LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [Color(0xFF71787E), AppGlobal.appTextColor]);
List<Color> backgroundIconColors = List(3);
backgroundIconColors[0] = Colors.white12;
backgroundIconColors[1] = Colors.white38;
@ -375,8 +320,7 @@ class _HomeScreenState extends State<HomeScreen> {
cardIcon: DoctorApp.livecare,
textColor: textColors[colorIndex],
iconSize: 21,
text:
"${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
onTap: () {
// TODO MOSA TEST
// PatiantInformtion patient = PatiantInformtion(
@ -411,13 +355,12 @@ class _HomeScreenState extends State<HomeScreen> {
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.qr_reader,
textColor: textColors[colorIndex],
text: "ER sign In" ,
text: "ER sign In",
onTap: () {
Navigator.push(
context,
FadePage(
page: ErSignInScreen(
),
page: ErSignInScreen(),
),
);
},
@ -435,8 +378,7 @@ class _HomeScreenState extends State<HomeScreen> {
context,
FadePage(
page: InPatientScreen(
specialClinic: model.getSpecialClinic(
clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
),
),
);
@ -469,19 +411,13 @@ class _HomeScreenState extends State<HomeScreen> {
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');
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),
patientSearchRequestModel: PatientSearchRequestModel(from: date, to: date, doctorID: authenticationViewModel.doctorProfile.doctorID),
),
settings: RouteSettings(name: 'OutPatientsScreen'),
));
@ -541,10 +477,7 @@ class _HomeScreenState extends State<HomeScreen> {
));
changeColorIndex();
return [
...List.generate(patientCards.length, (index) => patientCards[index])
.toList()
];
return [...List.generate(patientCards.length, (index) => patientCards[index]).toList()];
}
changeColorIndex() {

@ -26,7 +26,7 @@ class Utils {
get currentLanguage => null;
static showConfirmationDialog(BuildContext context, String message, Function okFunction) {
static showConfirmationDialog(BuildContext context, String message, Function okFunction, {bool isShowCancelButton = true}) {
return showDialog(
context: context,
barrierDismissible: false, // user must tap button!
@ -47,14 +47,18 @@ class Utils {
fontColor: Colors.white,
color: AppGlobal.appGreenColor,
),
AppButton(
onPressed: () {
Navigator.of(context).pop();
},
title: TranslationBase.of(context).cancel,
fontColor: Colors.white,
color: Colors.red[600],
SizedBox(
height: 30,
),
if (isShowCancelButton)
AppButton(
onPressed: () {
Navigator.of(context).pop();
},
title: TranslationBase.of(context).cancel,
fontColor: Colors.white,
color: Colors.red[600],
),
],
),
],

@ -15,26 +15,26 @@ class ConfirmationDialog extends StatefulWidget {
}
class _ConfirmationDialogState extends State<ConfirmationDialog> {
@override
Widget build(BuildContext context) {
return AlertDialog(
return AlertDialog(
title: Text("Alert"),
content: Text(widget.title),
actions: [
TextButton(
child: Text(TranslationBase.of(context).cancel),
onPressed: () { Navigator.pop(context);},
onPressed: () {
Navigator.pop(context);
},
),
TextButton(
child: Text(TranslationBase.of(context).ok),
onPressed: () {
Navigator.pop(context);
widget.onTapGrant();
},
)
TextButton(
child: Text(TranslationBase.of(context).ok),
onPressed: () {
Navigator.pop(context);
widget.onTapGrant();
},
)
],
);
}
}

Loading…
Cancel
Save