@ -44,6 +44,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import ' package:diplomaticquarterapp/widgets/avatar/large_avatar.dart ' ;
import ' package:diplomaticquarterapp/widgets/bottom_options/bottom_sheet.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart ' ;
import ' package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart ' ;
import ' package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart ' ;
import ' package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart ' ;
import ' package:diplomaticquarterapp/widgets/my_rich_text.dart ' ;
@ -453,7 +454,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
isLiveCareAppointment: false ,
date: DateUtil . convertStringToDate ( ancillaryLists [ 0 ] . ancillaryOrderList ! [ index ] . orderDate ) ,
isSortByClinic: true ,
isAllowCheckInAncillary: ancillaryLists [ 0 ] . ancillaryOrderList ! [ index ] . is Allow CheckIn! ,
isAllowCheckInAncillary: ancillaryLists [ 0 ] . ancillaryOrderList ! [ index ] . is CheckInAllow ! ,
onAncillaryCheckInTap: ( ) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList ( ) ;
appo . doctorTitle = TranslationBase . of ( context ) . dr . toString ( ) ;
@ -468,7 +469,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
appo . actualDoctorRate = 0 ;
appo . noOfPatientsRate = 0 ;
navigateToQR( context , " " , new PatientShareResponse ( ) , appo , true ) ;
ShowAncillaryOrderOnlineCheckInBottomSheet( ancillaryLists [ 0 ] . ancillaryOrderList ! [ index ] , ancillaryLists [ 0 ] . projectID ! ) ;
} ,
) ;
} ,
@ -1179,7 +1180,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
patientShareResponse . clinicID = appo . clinicID ;
patientShareResponse . projectID = appo . projectID ;
patientShareResponse . isFollowup = appo . isFollowup ;
navigateToQR ( context , " " , patientShareResponse , appo , false );
navigateToQR ( context , " " , patientShareResponse , appo );
projectViewModel . analytics . todoList . to_do_list_check_in ( appo ) ;
/ / } else {
/ / Utils . showErrorToast ( TranslationBase . of ( context ) . NFCNotSupported ) ;
@ -1193,7 +1194,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} ) ;
}
Future navigateToQR ( context , String appoQR , PatientShareResponse patientShareResponse , AppoitmentAllHistoryResultList appintment , bool isAncillaryOrderCheckIn ) async {
ShowAncillaryOrderOnlineCheckInBottomSheet( AncillaryOrderList ancillaryOrderList , int projectID ) {
showMyBottomSheet ( context ,
callBackFunc: ( ) { } ,
child: Padding (
@ -1210,8 +1211,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GridView (
physics: const NeverScrollableScrollPhysics ( ) ,
shrinkWrap: true ,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
crossAxisCount: ( MediaQuery . of ( context ) . size . width < 550 ) ? 3 : 5 , childAspectRatio: 1 / 1 , crossAxisSpacing: 8 , mainAxisSpacing: 12 ) ,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount ( crossAxisCount: ( MediaQuery . of ( context ) . size . width < 550 ) ? 3 : 5 , childAspectRatio: 1 / 1 , crossAxisSpacing: 8 , mainAxisSpacing: 12 ) ,
children: [
attendanceMethod ( TranslationBase . of ( context ) . scanNFC , " assets/images/nfc/contactless.svg " , true , ( ) {
if ( _supportsNFC ) {
@ -1219,6 +1220,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
showNfcReader ( context , onNcfScan: ( String nfcId ) {
Future . delayed ( const Duration ( milliseconds: 100 ) , ( ) {
print ( nfcId ) ;
autoGenerateInvoice ( ancillaryOrderList , projectID ) ;
/ / getProjectIDFromNFC ( nfcId , true ) ;
/ / Navigator . push ( context , FadePage ( page: EROnlineCheckInPaymentDetails ( ) ) ) ;
} ) ;
@ -1235,28 +1237,28 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
String onlineCheckInQRCode = ( await BarcodeScanner . scan ( ) . then ( ( value ) = > value . rawContent ) ) ;
if ( onlineCheckInQRCode ! = " " ) {
print ( onlineCheckInQRCode ) ;
autoGenerateInvoice ( ancillaryOrderList , projectID ) ;
/ / getProjectIDFromNFC ( onlineCheckInQRCode , true ) ;
/ / sendNfcCheckInRequest ( onlineCheckInQRCode , 2 ) ;
} else { }
} ) ,
attendanceMethod ( TranslationBase . of ( context ) . checkInViaLocation , " assets/images/new/services/location.svg " , true , ( ) { } )
attendanceMethod ( TranslationBase . of ( context ) . checkInViaLocation , " assets/images/new/services/location.svg " , true , ( ) {
startLocationCheckIn ( ancillaryOrderList , projectID ) ;
} )
] ,
) ,
] ,
) ,
) ) ;
}
/ / Navigator . push ( context , FadePage ( page: QRCode ( patientShareResponse: patientShareResponse , appoQR: appoQR , appointment: appintment , isAncillaryOrderCheckIn: isAncillaryOrderCheckIn ) ) )
/ / . then ( ( value ) {
/ / if ( isAncillaryOrderCheckIn ) {
/ / Utils . showErrorToast ( " isAncillaryOrderCheckIn " ) ;
/ / } else {
/ / getPatientAppointmentHistory ( ) ;
/ / }
/ / } ) ;
Future navigateToQR ( context , String appoQR , PatientShareResponse patientShareResponse , AppoitmentAllHistoryResultList appintment ) async {
Navigator . push ( context , FadePage ( page: QRCode ( patientShareResponse: patientShareResponse , appoQR: appoQR , appointment: appintment ) ) ) . then ( ( value ) {
getPatientAppointmentHistory ( ) ;
} ) ;
}
startLocationCheckIn ( ) async {
startLocationCheckIn ( AncillaryOrderList ancillaryOrderList , int projectID ) async {
GifLoaderDialogUtils . showMyDialog ( context ) ;
locationUtils = new LocationUtils ( isShowConfirmDialog: true , context: context ) ;
locationUtils . getCurrentLocation ( callBack: ( value ) {
@ -1265,6 +1267,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
print ( dist ) ;
if ( dist < = projectDetailListModel . geofenceRadius ! ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
autoGenerateInvoice ( ancillaryOrderList , projectID ) ;
/ / sendNfcCheckInRequest ( projectDetailListModel . checkInQrCode ! , 2 ) ;
} else {
GifLoaderDialogUtils . hideDialog ( context ) ;
@ -1678,6 +1681,42 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} ) ;
}
autoGenerateInvoice ( AncillaryOrderList ancillaryOrderList , int projectID ) {
List < dynamic > selectedProcListAPI = [ ] ;
ancillaryOrderList . ancillaryProcedureListModels ! . forEach ( ( element ) {
selectedProcListAPI . add ( {
" ApprovalLineItemNo " : element . approvalLineItemNo ,
" OrderLineItemNo " : element . orderLineItemNo ,
" ProcedureID " : element . procedureID ,
} ) ;
} ) ;
GifLoaderDialogUtils . showMyDialog ( context ) ;
DoctorsListService service = new DoctorsListService ( ) ;
service . autoGenerateAncillaryOrdersInvoice ( ancillaryOrderList . orderNo , projectID , ancillaryOrderList . appointmentNo , selectedProcListAPI , projectViewModel . isArabic ? 1 : 2 , context ) . then ( ( res ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
showAlertDialog ( res [ ' AncillaryOrderInvoiceList ' ] [ 0 ] [ ' InvoiceNo ' ] ) ;
} ) . catchError ( ( err ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
AppToast . showErrorToast ( message: err ) ;
print ( err ) ;
} ) ;
}
showAlertDialog ( dynamic queueNo ) {
AlertDialogBox (
context: context ,
confirmMessage: TranslationBase . of ( context ) . ancillaryOrderCheckInSuccess + queueNo . toString ( ) ,
okText: TranslationBase . of ( context ) . ok ,
okFunction: ( ) {
AlertDialogBox . closeAlertDialog ( context ) ;
Navigator . of ( context ) . pop ( ) ;
Navigator . pushAndRemoveUntil ( context , MaterialPageRoute ( builder: ( context ) = > LandingPage ( ) ) , ( Route < dynamic > r ) = > false ) ;
} ) . showAlertDialog ( context ) ;
}
insertLiveCareVIDARequest ( AppoitmentAllHistoryResultList appo ) {
GifLoaderDialogUtils . showMyDialog ( context ) ;
DoctorsListService service = new DoctorsListService ( ) ;
@ -1699,27 +1738,27 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
Widget attendanceMethod ( String title , String image , bool isEnabled , VoidCallback onPress ) = > InkWell (
onTap: ( ) {
Navigator . pop ( context ) ;
onPress ( ) ;
} ,
child: Container (
decoration: containerColorRadiusBorderWidth ( Colors . white , 15 , CustomColors . darkGreyColor , 1 ) ,
clipBehavior: Clip . antiAlias ,
padding: const EdgeInsets . only ( left: 10 , right: 10 , top: 14 , bottom: 14 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Expanded ( child: SvgPicture . asset ( image , color: Colors . black , alignment: Alignment . topLeft ) ) ,
Text (
title ,
style: TextStyle ( color: Colors . black , fontSize: 14 , letterSpacing: - 0.68 , fontWeight: FontWeight . bold ) ,
onTap: ( ) {
Navigator . pop ( context ) ;
onPress ( ) ;
} ,
child: Container (
decoration: containerColorRadiusBorderWidth ( Colors . white , 15 , CustomColors . darkGreyColor , 1 ) ,
clipBehavior: Clip . antiAlias ,
padding: const EdgeInsets . only ( left: 10 , right: 10 , top: 14 , bottom: 14 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Expanded ( child: SvgPicture . asset ( image , color: Colors . black , alignment: Alignment . topLeft ) ) ,
Text (
title ,
style: TextStyle ( color: Colors . black , fontSize: 14 , letterSpacing: - 0.68 , fontWeight: FontWeight . bold ) ,
) ,
/ / title . toText17 ( isBold: true , color: Colors . white ) ,
] ,
) ,
/ / title . toText17 ( isBold: true , color: Colors . white ) ,
] ,
) ,
) ,
) ;
) ,
) ;
ancillaryOrdersDetails ( item , projectId ) {
Navigator . push (