VidaPlus changes for radiology

development-3.3_voipCall
haroon amjad 3 years ago
parent 1a67129a85
commit e530646c28

@ -8,11 +8,11 @@ const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
// const BASE_URL_LIVE_CARE = 'https://livecareuat.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://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL // const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL
// const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";

@ -0,0 +1,15 @@
class VidaPlusProjectListModel {
int projectID;
VidaPlusProjectListModel({this.projectID});
VidaPlusProjectListModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
return data;
}
}

@ -1,10 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class HospitalsService extends BaseService { class HospitalsService extends BaseService {
List<GetHospitalsResponseModel> hospitals = List(); List<GetHospitalsResponseModel> hospitals = List();
List<VidaPlusProjectListModel> vidaPlusProjectListModel = List();
Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async {
hasError = false; hasError = false;
@ -15,6 +17,12 @@ class HospitalsService extends BaseService {
response['ProjectInfo'].forEach((hospital) { response['ProjectInfo'].forEach((hospital) {
hospitals.add(GetHospitalsResponseModel.fromJson(hospital)); hospitals.add(GetHospitalsResponseModel.fromJson(hospital));
}); });
vidaPlusProjectListModel.clear();
if (response['ProjectListVidaPlus'].length != 0) {
response['ProjectListVidaPlus'].forEach((item) {
vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item));
});
}
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -10,11 +10,11 @@ class RadiologyService extends BaseService {
String url = ''; String url = '';
bool isRadiologyVIDAPlus = false; bool isRadiologyVIDAPlus = false;
Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo; body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo;
body['InvoiceNo_VP'] = invoiceNo; body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0";
body['LineItemNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;

@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/user_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/authentication_service.dart';
@ -52,6 +53,8 @@ class AuthenticationViewModel extends BaseViewModel {
CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes;
List<VidaPlusProjectListModel> get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel;
NewLoginInformationModel loggedUser; NewLoginInformationModel loggedUser;
GetIMEIDetailsModel user; GetIMEIDetailsModel user;
@ -238,7 +241,8 @@ class AuthenticationViewModel extends BaseViewModel {
/// add token to shared preferences in case of send activation code is success /// add token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
await sharedPref.setString(DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); await sharedPref.setString(
DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : "");
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -32,12 +33,14 @@ class ProjectViewModel with ChangeNotifier {
bool get isArabic => _isArabic; bool get isArabic => _isArabic;
StreamSubscription subscription; StreamSubscription subscription;
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;
ProjectViewModel() { ProjectViewModel() {
loadSharedPrefLanguage(); loadSharedPrefLanguage();
subscription = Connectivity() subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
.onConnectivityChanged
.listen((ConnectivityResult result) {
switch (result) { switch (result) {
case ConnectivityResult.wifi: case ConnectivityResult.wifi:
isInternetConnection = true; isInternetConnection = true;
@ -53,6 +56,11 @@ class ProjectViewModel with ChangeNotifier {
}); });
} }
setVidaPlusProjectList(List<VidaPlusProjectListModel> vidaPlusProjectListModelInput) {
_vidaPlusProjectListModel = vidaPlusProjectListModelInput;
notifyListeners();
}
void loadSharedPrefLanguage() async { void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_Language); currentLanguage = await sharedPref.getString(APP_Language);
_appLocale = Locale(currentLanguage ?? 'en'); _appLocale = Locale(currentLanguage ?? 'en');
@ -95,12 +103,18 @@ class ProjectViewModel with ChangeNotifier {
try { try {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
doctorClinicsList = []; doctorClinicsList = [];
response['List_DoctorsClinic'].forEach((v) { response['List_DoctorsClinic'].forEach((v) {
doctorClinicsList.add(new ClinicModel.fromJson(v)); doctorClinicsList.add(new ClinicModel.fromJson(v));
}); });
_vidaPlusProjectListModel.clear();
if (response['ProjectListVidaPlus'].length != 0) {
response['ProjectListVidaPlus'].forEach((item) {
_vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item));
});
setVidaPlusProjectList(_vidaPlusProjectListModel);
}
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -122,7 +136,6 @@ class ProjectViewModel with ChangeNotifier {
projectID: doctorProfile.projectID, projectID: doctorProfile.projectID,
); );
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false) await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).getDoctorProfileBasedOnClinic(clinicModel);
.getDoctorProfileBasedOnClinic(clinicModel);
} }
} }

@ -53,9 +53,9 @@ class RadiologyViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url; String get radImageURL => _radiologyService.url;
getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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';
@ -32,10 +33,12 @@ class _LoginScreenState extends State<LoginScreen> {
FocusNode focusPass = FocusNode(); FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode(); FocusNode focusProject = FocusNode();
AuthenticationViewModel authenticationViewModel; AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authenticationViewModel = Provider.of<AuthenticationViewModel>(context); authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: HexColor('#F8F8F8'), backgroundColor: HexColor('#F8F8F8'),
@ -44,142 +47,106 @@ class _LoginScreenState extends State<LoginScreen> {
Container( Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( //TODO Use App Text rather than text
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
//TODO Use App Text rather than text Column(
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 30,
children: <Widget>[
SizedBox(
height: 30,
),
],
), ),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Text(
TranslationBase.of(context).welcomeTo,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins'),
),
Text(
TranslationBase.of(context)
.drSulaimanAlHabib,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontSize: SizeConfig.isMobile
? 24
: SizeConfig.realScreenWidth *
0.029,
fontFamily: 'Poppins'),
),
Text(
"Doctor App",
style: TextStyle(
fontSize: SizeConfig.isMobile
? 16
: SizeConfig.realScreenWidth *
0.030,
fontWeight: FontWeight.w600,
color: Color(0xFFD02127)),
),
]),
], ],
)),
SizedBox(
height: 40,
), ),
Form( Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
key: loginFormKey, SizedBox(
child: Column( height: 10,
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: <Widget>[ Text(
Container( TranslationBase.of(context).welcomeTo,
width: SizeConfig.realScreenWidth * 0.90, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, fontFamily: 'Poppins'),
height: SizeConfig.realScreenHeight * 0.65, ),
child: Column( Text(
crossAxisAlignment: TranslationBase.of(context).drSulaimanAlHabib,
CrossAxisAlignment.start, style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, fontFamily: 'Poppins'),
children: [
buildSizedBox(),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).enterId,
hasBorder: true,
controller: userIdController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo
.userID = value.trim();
});
},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.enterPassword,
hasBorder: true,
isSecure: true,
controller: passwordController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo
.password = value.trim();
});
// if(allowCallApi) {
this.getProjects(
authenticationViewModel
.userInfo.userID);
// setState(() {
// allowCallApi = false;
// });
// }
},
onClick: () {},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.selectYourProject,
hasBorder: true,
controller: projectIdController,
isTextFieldHasSuffix: true,
enabled: false,
onClick: () {
Utils.showCupertinoPicker(
context,
projectsList,
'facilityName',
onSelectProject,
authenticationViewModel);
},
),
buildSizedBox()
]),
),
],
), ),
) Text(
"Doctor App",
style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)),
),
]),
], ],
)),
SizedBox(
height: 40,
),
Form(
key: loginFormKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * 0.90,
height: SizeConfig.realScreenHeight * 0.65,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).enterId,
hasBorder: true,
controller: userIdController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo.userID = value.trim();
});
},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).enterPassword,
hasBorder: true,
isSecure: true,
controller: passwordController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo.password = value.trim();
});
// if(allowCallApi) {
this.getProjects(authenticationViewModel.userInfo.userID);
// setState(() {
// allowCallApi = false;
// });
// }
},
onClick: () {},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).selectYourProject,
hasBorder: true,
controller: projectIdController,
isTextFieldHasSuffix: true,
enabled: false,
onClick: () {
Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel);
},
),
buildSizedBox()
]),
),
],
),
) )
])) ],
)
]))
]), ]),
), ),
bottomSheet: Container( bottomSheet: Container(
@ -195,8 +162,7 @@ class _LoginScreenState extends State<LoginScreen> {
title: TranslationBase.of(context).login, title: TranslationBase.of(context).login,
color: AppGlobal.appRedColor, color: AppGlobal.appRedColor,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
disabled: authenticationViewModel.userInfo.userID == null || disabled: authenticationViewModel.userInfo.userID == null || authenticationViewModel.userInfo.password == null,
authenticationViewModel.userInfo.password == null,
onPressed: () { onPressed: () {
login(context); login(context);
}, },
@ -246,8 +212,7 @@ class _LoginScreenState extends State<LoginScreen> {
onSelectProject(index) { onSelectProject(index) {
setState(() { setState(() {
authenticationViewModel.userInfo.projectID = authenticationViewModel.userInfo.projectID = projectsList[index].facilityId;
projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName; projectIdController.text = projectsList[index].facilityName;
}); });
@ -264,8 +229,8 @@ class _LoginScreenState extends State<LoginScreen> {
if (authenticationViewModel.state == ViewState.Idle) { if (authenticationViewModel.state == ViewState.Idle) {
projectsList = authenticationViewModel.hospitals; projectsList = authenticationViewModel.hospitals;
setState(() { setState(() {
authenticationViewModel.userInfo.projectID = projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList);
projectsList[0].facilityId; authenticationViewModel.userInfo.projectID = projectsList[0].facilityId;
projectIdController.text = projectsList[0].facilityName; projectIdController.text = projectsList[0].facilityName;
}); });
} }

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; 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/project_view_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/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart';
@ -25,6 +26,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'package:quiver/async.dart'; import 'package:quiver/async.dart';
import '../../../../locator.dart'; import '../../../../locator.dart';
@ -137,6 +139,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId);
@ -199,6 +202,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
isFromLiveCare: isFromLiveCare, isFromLiveCare: isFromLiveCare,
from: from, from: from,
to: to, to: to,
projectViewModel: projectViewModel,
), ),
), ),
SizedBox( SizedBox(

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -16,122 +18,50 @@ class ProfileGridForOther extends StatelessWidget {
final bool isFromLiveCare; final bool isFromLiveCare;
String from; String from;
String to; String to;
ProjectViewModel projectViewModel;
ProfileGridForOther( ProfileGridForOther({Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to, this.isFromLiveCare, this.projectViewModel}) : super(key: key);
{Key key,
this.patient,
this.patientType,
this.arrivalType,
this.height,
this.isInpatient,
this.from,
this.to,
this.isFromLiveCare})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient),
TranslationBase.of(context).vital, PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient),
TranslationBase.of(context).signs, PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg',
VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg',
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD,
TranslationBase.of(context).lab,
TranslationBase.of(context).special,
ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).service,
RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg',
TranslationBase.of(context).health,
TranslationBase.of(context).summary,
HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg',
PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient),
TranslationBase.of(context).orders, PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg',
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg',
TranslationBase.of(context).insurance,
TranslationBase.of(context).service,
PATIENT_INSURANCE_APPROVALS_NEW,
'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg',
TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave,
ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
if (isFromLiveCare || if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
(patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg',
PatientProfileCardModel( isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null),
TranslationBase.of(context).patient, if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
TranslationBase.of(context).ucaf,
PATIENT_UCAF_REQUEST,
'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 ||
patient.appointmentNo == null),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral, TranslationBase.of(context).referral,
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR, REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg', 'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null,
? patient.appointmentNo == null
: patient.patientStatusType != 43 ||
patient.appointmentNo == null,
), ),
if (isFromLiveCare || if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
(patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg',
PatientProfileCardModel(
TranslationBase.of(context).admission,
TranslationBase.of(context).request,
PATIENT_ADMISSION_REQUEST,
'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare isDisable:
? patient.appointmentNo == null Utils.isVidaPlusProject(projectViewModel, patient.projectId) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null),
: patient.patientStatusType != 43 ||
patient.appointmentNo == null),
]; ];
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),

@ -1,15 +1,18 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_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/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../../../locator.dart'; import '../../../../locator.dart';
@ -26,9 +29,15 @@ class RadiologyDetailsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<RadiologyViewModel>( return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL( onModelReady: (model) => model.getRadImageURL(
patient: patient, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), patient: patient,
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID),
),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,

@ -143,7 +143,10 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
isNoMargin: true, isNoMargin: true,
doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName), doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName),
profileUrl: model.radiologyList[index].doctorImageURL, profileUrl: model.radiologyList[index].doctorImageURL,
invoiceNO: model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}', invoiceNO: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID)
? '${model.radiologyList[index].invoiceNo_VP}'
: '${model.radiologyList[index].invoiceNo}',
// model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}', branch: '${model.radiologyList[index].projectName}',
clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription), clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate,
@ -152,7 +155,13 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
context, context,
FadePage( FadePage(
page: RadiologyDetailsPage( page: RadiologyDetailsPage(
finalRadiology: model.radiologyList[index], patient: patient, isInpatient: isInpatient, isVidaPlus: model.radiologyList[index].isRecordFromVidaPlus), finalRadiology: model.radiologyList[index],
patient: patient,
isInpatient: isInpatient,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID)
// false
// model.radiologyList[index].isRecordFromVidaPlus
),
), ),
); );
}, },

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m
import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -25,8 +26,7 @@ class Utils {
get currentLanguage => null; get currentLanguage => null;
static showConfirmationDialog( static showConfirmationDialog(BuildContext context, String message, Function okFunction) {
BuildContext context, String message, Function okFunction) {
return showDialog( return showDialog(
context: context, context: context,
barrierDismissible: false, // user must tap button! barrierDismissible: false, // user must tap button!
@ -63,8 +63,7 @@ class Utils {
}); });
} }
static showCupertinoPicker(context, List<GetHospitalsResponseModel> items, static showCupertinoPicker(context, List<GetHospitalsResponseModel> items, decKey, onSelectFun, AuthenticationViewModel model) {
decKey, onSelectFun, AuthenticationViewModel model) {
showModalBottomSheet( showModalBottomSheet(
isDismissible: false, isDismissible: false,
context: context, context: context,
@ -82,8 +81,7 @@ class Utils {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
CupertinoButton( CupertinoButton(
child: Text(TranslationBase.of(context).cancel, child: Text(TranslationBase.of(context).cancel, style: textStyle(context)),
style: textStyle(context)),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
@ -101,27 +99,19 @@ class Utils {
], ],
), ),
), ),
Container( Container(height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model))
height: SizeConfig.realScreenHeight * 0.3,
color: Color(0xfff7f7f7),
child: buildPickerItems(
context, items, decKey, onSelectFun, model))
], ],
), ),
); );
}); });
} }
static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor);
static TextStyle textStyle(context) => static buildPickerItems(context, List<GetHospitalsResponseModel> items, decKey, onSelectFun, model) {
TextStyle(color: Theme.of(context).primaryColor);
static buildPickerItems(context, List<GetHospitalsResponseModel> items,
decKey, onSelectFun, model) {
return CupertinoPicker( return CupertinoPicker(
magnification: 1.5, magnification: 1.5,
scrollController: scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex),
FixedExtentScrollController(initialItem: cupertinoPickerIndex),
children: items.map((item) { children: items.map((item) {
return Text( return Text(
'${item.facilityName}', '${item.facilityName}',
@ -147,10 +137,8 @@ class Utils {
} }
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity());
await (Connectivity().checkConnectivity()); if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) {
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true; return true;
} else { } else {
return false; return false;
@ -163,8 +151,7 @@ class Utils {
listOfHours.forEach((element) { listOfHours.forEach((element) {
WorkingHours workingHours = WorkingHours(); WorkingHours workingHours = WorkingHours();
var from = element.substring( var from = element.substring(element.indexOf('m ') + 2, element.indexOf('To') - 1);
element.indexOf('m ') + 2, element.indexOf('To') - 1);
workingHours.from = from.trim(); workingHours.from = from.trim();
var to = element.substring(element.indexOf('To') + 2); var to = element.substring(element.indexOf('To') + 2);
workingHours.to = to.trim(); workingHours.to = to.trim();
@ -232,9 +219,7 @@ class Utils {
return parsedString; return parsedString;
} }
static InputDecoration textFieldSelectorDecoration( static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) {
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon, Color dropDownColor}) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -264,9 +249,7 @@ class Utils {
); );
} }
static BoxDecoration containerBorderDecoration( static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1}) {
Color containerColor, Color borderColor,
{double borderWidth = -1}) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -326,8 +309,6 @@ class Utils {
return kpi; return kpi;
} }
static String convertToTitleCase(String text) { static String convertToTitleCase(String text) {
if (text == null) { if (text == null) {
return null; return null;
@ -354,4 +335,14 @@ class Utils {
// Join/Merge all words back to one String // Join/Merge all words back to one String
return capitalizedWords.join(' '); return capitalizedWords.join(' ');
} }
static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) {
bool isVidaPlus = false;
projectViewModel.vidaPlusProjectList.forEach((element) {
if (element.projectID == projectID) {
isVidaPlus = true;
}
});
return isVidaPlus;
}
} }

@ -73,17 +73,14 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
right: 5, right: 5,
bottom: 5, bottom: 5,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))),
color: Colors.white,
border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))),
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 0),
margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50), margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50),
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
child: Row(children: [ child: Row(children: [
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
@ -96,11 +93,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
Expanded( Expanded(
child: AppText( child: AppText(
patient.firstName != null patient.firstName != null
? (Utils.capitalize(patient.firstName) + ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName))
" " + : Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName),
Utils.capitalize(patient.lastName))
: Utils.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',
@ -133,15 +127,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
), ),
Row(children: [ Row(children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
child: Container( child: Container(
width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, width: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
child: Image.asset( child: Image.asset(
gender == 1 gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -164,29 +155,18 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
.getTextMultiplierBasedOnWidth() *
3.5,
) )
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
.getTextMultiplierBasedOnWidth() *
3.5,
), ),
patient.startTime != null patient.startTime != null
? AppText( ? AppText(patient.startTime != null ? patient.startTime : '',
patient.startTime != null fontWeight: FontWeight.w700, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A))
? patient.startTime
: '',
fontWeight: FontWeight.w700,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A))
: SizedBox() : SizedBox()
], ],
)) ))
@ -199,9 +179,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNumber, TranslationBase.of(context).fileNumber,
fontSize: fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
SizeConfig.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
@ -210,9 +188,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
), ),
AppText( AppText(
patient.patientId.toString(), patient.patientId.toString(),
fontSize: fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
isCopyable: true, isCopyable: true,
@ -222,14 +198,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
Row( Row(
children: [ children: [
AppText( AppText(
patient.nationalityName ?? patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '',
patient.nationality ??
patient.nationalityId ??
'',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
), ),
patient.nationalityFlagURL != null patient.nationalityFlagURL != null
? ClipRRect( ? ClipRRect(
@ -238,9 +209,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
patient.nationalityFlagURL, patient.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -256,42 +225,29 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
), ),
if (patient.appointmentDate != null && if (patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult)
patient.appointmentDate.isNotEmpty &&
!isFromLabResult)
HeaderRow( HeaderRow(
label: label: TranslationBase.of(context).appointmentDate + " : ",
TranslationBase.of(context).appointmentDate + " : ", value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate)),
value: AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
patient.appointmentDate)),
), ),
if (isFromLabResult) if (isFromLabResult)
HeaderRow( HeaderRow(
label: "Result Date: ", label: "Result Date: ",
value: value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
), ),
// if(isInpatient) // if(isInpatient)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (patient.admissionDate != null && if (patient.admissionDate != null && patient.admissionDate.isNotEmpty)
patient.admissionDate.isNotEmpty)
HeaderRow( HeaderRow(
label: patient.admissionDate == null label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ",
? "" value: patient.admissionDate == null ? "" : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}",
: TranslationBase.of(context).admissionDate +
" : ",
value: patient.admissionDate == null
? ""
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}",
), ),
if (patient.admissionDate != null) if (patient.admissionDate != null)
HeaderRow( HeaderRow(
label: "${TranslationBase.of(context).numOfDays}: ", label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient && value: isDischargedPatient && patient.dischargeDate != null
patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
) )
@ -308,15 +264,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
Container( Container(
width: 30, width: 30,
height: 30, height: 30,
margin: EdgeInsets.only( margin: EdgeInsets.only(left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5),
left: projectViewModel.isArabic ? 10 : 85,
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: bottom: BorderSide(color: Colors.grey[400], width: 2.5),
BorderSide(color: Colors.grey[400], width: 2.5),
left: BorderSide(color: Colors.grey[400], width: 2.5), left: BorderSide(color: Colors.grey[400], width: 2.5),
)), )),
), ),
@ -339,65 +291,50 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
flex: 5, flex: 5,
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, AppText(
children: <Widget>[ Utils.convertToTitleCase('${TranslationBase.of(context).dr}$doctorName'),
AppText( color: Color(0xFF2E303A),
Utils.convertToTitleCase( fontWeight: FontWeight.w700,
'${TranslationBase.of(context).dr}$doctorName'), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A), isCopyable: true,
fontWeight: FontWeight.w700, ),
fontSize: SizeConfig if (orderNo != null && !isPrescriptions)
.getTextMultiplierBasedOnWidth() * HeaderRow(
3.5, label: 'Order No: ',
isCopyable: true, value: orderNo ?? '',
), ),
if (orderNo != null && !isPrescriptions) if (invoiceNO != null && !isPrescriptions)
HeaderRow( HeaderRow(
label: 'Order No: ', label: 'Invoice: ',
value: orderNo ?? '', value: invoiceNO ?? "",
), ),
if (invoiceNO != null && !isPrescriptions) if (branch != null)
HeaderRow( HeaderRow(
label: 'Invoice: ', label: 'Branch: ',
value: invoiceNO ?? "", value: branch ?? '',
), ),
if (branch != null) if (clinic != null)
HeaderRow( Container(
label: 'Branch: ', width: MediaQuery.of(context).size.width * 0.51,
value: branch ?? '', child: HeaderRow(label: 'Clinic: ', value: Utils.convertToTitleCase(clinic) ?? '', isExpanded: true),
), ),
if (clinic != null) if (isMedicalFile && episode != null)
Container( HeaderRow(
width: label: 'Episode: ',
MediaQuery.of(context).size.width * value: episode ?? '',
0.51, ),
child: HeaderRow( if (isMedicalFile && visitDate != null)
label: 'Clinic: ', HeaderRow(
value: Utils.convertToTitleCase( label: 'Visit Date: ',
clinic) ?? value: visitDate ?? '',
'', ),
isExpanded: true), if (!isMedicalFile)
), HeaderRow(
if (isMedicalFile && episode != null) label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ',
HeaderRow( value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
label: 'Episode: ', ),
value: episode ?? '', ]),
),
if (isMedicalFile && visitDate != null)
HeaderRow(
label: 'Visit Date: ',
value: visitDate ?? '',
),
if (!isMedicalFile)
HeaderRow(
label: !isPrescriptions
? 'Result Date:'
: 'Prescriptions Date ',
value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
),
]),
), ),
), ),
], ],
@ -424,7 +361,6 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
? 137 ? 137
: SizeConfig.isHeightShort : SizeConfig.isHeightShort
? 190 ? 190
: SizeConfig.heightMultiplier * : SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge ? 25 : 20)
(SizeConfig.isWidthLarge ? 25 : 20)
: height); : height);
} }

Loading…
Cancel
Save