diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 53739c9c..f72544a0 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -27,9 +27,9 @@ class VideoCallService extends BaseService{ this.patient = patientModel; DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//tartCallRes.openTokenID, - kSessionId: '1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg',//startCallRes.openSessionID, - kApiKey: '47247954',//'46209962', + kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", + kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg + kApiKey: '46209962',//'47247954' vcId: patient.vcId, patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), @@ -80,7 +80,7 @@ class VideoCallService extends BaseService{ endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; - // await _liveCarePatientServices.endCall(endCallReq); + await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; } diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 9e852978..0351db77 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -240,7 +240,7 @@ class PatientReferralViewModel extends BaseViewModel { patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: patient.appointmentNo, + admissionNo: int.parse(patient.admissionNo), referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 71d46dc9..29dc6198 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -224,10 +224,13 @@ class PatiantInformtion { isSigned: json['isSigned'], medicationOrders: json['medicationOrders'], nationality: json['nationality'] ?? json['NationalityNameN'], - patientMRN: json['patientMRN'] ?? json['PatientMRN']?? ( - json["PatientID"] != null ? - int.parse(json["PatientID"].toString()) - : int.parse(json["patientID"].toString())), + patientMRN: json['patientMRN'] ?? + json['PatientMRN'] ?? + (json["PatientID"] != null + ? int?.parse(json["PatientID"].toString()) + : json["patientID"] != null ? int?.parse( + json["patientID"].toString()) : json["patientId"] != null ? int + ?.parse(json["patientId"].toString()) : ''), visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'], nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index d355473d..d3db12b6 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -23,9 +23,9 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:hexcolor/hexcolor.dart'; class EndCallScreen extends StatefulWidget { + final PatiantInformtion patient; - - const EndCallScreen({Key key,}) : super(key: key); + const EndCallScreen({Key key, this.patient,}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -42,11 +42,18 @@ class _EndCallScreenState extends State { String to; LiveCarePatientViewModel liveCareModel; + @override + void initState() { + super.initState(); + if(widget.patient!=null) + patient = widget.patient; + } @override void didChangeDependencies() { super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; + if(routeArgs.containsKey('patient')) patient = routeArgs['patient']; } diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index ea61359a..03def2f7 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -339,19 +339,18 @@ class _PatientProfileScreenState extends State if(isCallFinished) { - // Navigator.push(context, MaterialPageRoute( - // builder: (BuildContext context) => EndCallScreen(patient:patient))); - var asd = ""; + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => EndCallScreen(patient:patient))); } else { GifLoaderDialogUtils.showMyDialog(context); - // await model.startCall( isReCall : false, vCID: patient.vcId); + await model.startCall( isReCall : false, vCID: patient.vcId); if(model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(model.error); } else { await model.getDoctorProfile(); - // patient.appointmentNo = model.startCallRes.appointmentNo; + patient.appointmentNo = model.startCallRes.appointmentNo; patient.episodeNo = 0; GifLoaderDialogUtils.hideDialog(context); @@ -360,53 +359,6 @@ class _PatientProfileScreenState extends State }); - // await VideoChannel.openVideoCallScreen( - // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//model.startCallRes.openTokenID, - // kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",// model.startCallRes.openSessionID, - // kApiKey: '47247954',//46209962 - // vcId: patient.vcId, - // patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), - // tokenID: await model.getToken(), - // generalId: GENERAL_ID, - // doctorId: model.doctorProfile.doctorID, - // onFailure: (String error) { - // DrAppToastMsg.showErrorToast(error); - // },onCallConnected: callConnected, - // onCallEnd: () { - // var asd=""; - // WidgetsBinding.instance.addPostFrameCallback((_) { - // GifLoaderDialogUtils.showMyDialog(context); - // model.endCall(patient.vcId, false,).then((value) { - // GifLoaderDialogUtils.hideDialog(context); - // if (model.state == ViewState.ErrorLocal) { - // DrAppToastMsg.showErrorToast(model.error); - // } - // setState(() { - // isCallFinished = true; - // }); - // }); - // }); - // Navigator.push(context, MaterialPageRoute( - // builder: (BuildContext context) => - // EndCallScreen(patient:patient))); - // }, - // onCallNotRespond: (SessionStatusModel sessionStatusModel) { - // var asd=""; - // // WidgetsBinding.instance.addPostFrameCallback((_) { - // // GifLoaderDialogUtils.showMyDialog(context); - // // model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - // // GifLoaderDialogUtils.hideDialog(context); - // // if (model.state == ViewState.ErrorLocal) { - // // DrAppToastMsg.showErrorToast(model.error); - // // } - // // setState(() { - // // isCallFinished = true; - // // }); - // // }); - // // - // // }); - // }); - } } diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index d998ca58..31611b67 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -18,7 +18,7 @@ class ProcedureCard extends StatelessWidget { final int categoryID; final PatiantInformtion patient; final int doctorID; - + final bool isInpatient; const ProcedureCard({ Key key, this.onTap, @@ -26,7 +26,7 @@ class ProcedureCard extends StatelessWidget { this.categoryID, this.categoryName, this.patient, - this.doctorID, + this.doctorID, this.isInpatient = false, }) : super(key: key); @override @@ -132,36 +132,6 @@ class ProcedureCard extends StatelessWidget { ), ], ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).doctorName + ": ", - // //color: Colors.grey, - // fontSize: 12, - // color: Colors.grey, - // ), - // AppText( - // entityList.doctorName.toString(), - // fontSize: 12, - // bold: true, - // ), - // ], - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).clinic + ": ", - // //color: Colors.grey, - // fontSize: 12, - // color: Colors.grey, - // ), - // AppText( - // entityList.clinicDescription ?? "", - // bold: true, - // fontSize: 12, - // ), - // ], - // ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -222,27 +192,6 @@ class ProcedureCard extends StatelessWidget { ), ], ), - /*Container( - alignment: Alignment.centerRight, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: entityList.procedureName, - patient: patient, - ), - ), - ); - }, - child: AppText( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, - ), - ), - ),*/ Padding( padding: const EdgeInsets.all(8.0), child: Row( @@ -254,9 +203,7 @@ class ProcedureCard extends StatelessWidget { fontSize: 12, ), ), - if ((entityList.categoryID == 2 || - entityList.categoryID == 4) && - doctorID == entityList.doctorID) + if ((entityList.categoryID == 2 || entityList.categoryID == 4) && doctorID == entityList.doctorID && !isInpatient) InkWell( child: Icon(DoctorApp.edit), onTap: onTap,